//Createtherenditionforthepoint
Renditionr=RenditionImpl.getDefaultRendition();
r.setvalue(Rendition.SYMBOL_MODE,Rendition.SymbolMode.IMAGE);
r.setvalue(Rendition.SYMBOL_URL,"file:///C:/images/car.gif");
//Createthepoint
FeatureFactoryff=mapj.getFeatureFactory();
//AnarraycontainingasingleintAttribute
Attribute[]aAIntAttribute={newAttribute(33)};
//createanewPrimaryKeyananinteger
PrimaryKeypkey=newPrimaryKey(aAIntAttribute);
Featuref=ff.createPoint(dp,r,aAIntAttribute,pkey);
PrimaryKeypk=animate_layer.addFeature(f);
//CreatetheImageRequestComposer
ImageRequestComposerimageRC=ImageRequestComposer.create(mapj,256,Color.blue,"image/gif");
/*
Createthecompositerenderer
Rendertheimage
Streamtheimagebacktotheclient
*/
CompositeRenderercompositeRenderer=newCompositeRenderer(":8080/mapxtreme40/servlet/mapxtreme",0);
compositeRenderer.render(imageRC);
ServletOutputStreamsos=res.getOutputStream();
compositeRenderer.toStream(sos);
//Setthisattributetofalsesothatthebottomimageisnotrenderednexttime
compositeRenderer.setRedrawBottom(false);
}catch(Exceptione){
//Takeappropriateerrorhandlingsteps
}
在地图中添加空间地图图层首先要定义Layer。
1.如何定义Layer(使用DataProvider)
定义Layer的关键是DataProvider。
Layer对象有一个内部的对象叫做DataProvider,它不是直接由用户创建的,但是它的描述确实定义一个图层。要描述DataProvider通过如下接口:
TableDescHelper–描述数据
DataProviderHelper–定义数据的源
DataProviderRef–描述获取数据的方式
MapXtreme提供一系列DataProvider,可以读取如下类型的数据:
MapInfotabformat(.tab)
Oracle8iwithSpatialOption
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-27888-14.html
强力反对和谴责
工资提高了
中国应该马上派战机和导弹严陈以待