问题描述
添加了一个动态图层,从数据库定时读取目标经纬度数据,将目标添加到动态图层上。请问怎样实现动态图层的刷新来显示动态的目标呢??困扰很久的问题了,显示目标的代码段:try{//ASSUMPTIONS://ThevariablemapjisoftypeMapJandhasloadedamap//ThevariablereqisoftypeHttpServletRequest//ThevariableresisoftypeHttpServletResponse//ThevariabledpisoftypeDoublePoint//Addannotationlayer-thislayerwillconsistofoneimagesymbolto"animate"//注解表格提供帮助类AnnotationTableDescHelperatdh=newAnnotationTableDescHelper("Animation_Layer");//注解数据服务帮助类AnnotationDataProviderHelperadph=newAnnotationDataProviderHelper();//本地数据服务引用LocalDataProviderRefldpr=newLocalDataProviderRef(adph);//创建注解图层Layeranimate_layer=mapj.getLayers().insert(ldpr,atdh,0,"Animation_Layer");//定义注点Renditionr=RenditionImpl.getDefaultRendition();r.setvalue(Rendition.SYMBOL_MODE,Rendition.SymbolMode.IMAGE);r.setvalue(Rendition.SYMBOL_URL,"file:///C:/images/car.gif");//创建这个点-----//先创建特征工厂FeatureFactoryff=mapj.getFeatureFactory();//包含单个属性的数组Attribute[]aAIntAttribute={newAttribute(33)};//创建IntegerPrimaryKeypkey=newPrimaryKey(aAIntAttribute);Featuref=ff.createPoint(dp,r,aAIntAttribute,pkey);PrimaryKeypk=animate_layer.addFeature(f);//CreatetheImageRequestComposerImageRequestComposerimageRC=ImageRequestComposer.create(mapj,256,Color.blue,"image/gif");/*CreatethecompositerendererRendertheimageStreamtheimagebacktotheclient*/CompositeRenderercompositeRenderer=newCompositeRenderer("http://localhost:8080/mapxtreme40/servlet/mapxtreme";,0);compositeRenderer.render(imageRC);ServletOutputStreamsos=res.getOutputStream();compositeRenderer.toStream(sos);//SetthisattributetofalsesothatthebottomimageisnotrenderednexttimecompositeRenderer.setRedrawBottom(false);}catch(Exceptione){//Takeappropriateerrorhandlingsteps
解决方案
解决方案二:
哥们,你找到解决方法没,怎么解决的呀
解决方案三:
同问啊!!!!