问题描述
采用教程上的代码在地图上显示不出来是怎么回事啊?请指教哦,谢谢~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}相关部分有示例代码。
解决方案
解决方案二:
按道理是可以出来的,你跟实例代码完全一样,怎么还出错,估计是你服务没配置好吧!检查配置信息吧!祝你好运吧!
解决方案三:
谢谢~不添加移动目标,直接渲染地图是能够显示的。这样到话服务器配置应该没有的问题啊。。