mapxtreme显示移动目标问题
采用教程上的代码在地图上显示不出来是怎么回事啊?请指教哦,谢谢~try {
// ASSUMPTIONS:
// The variable mapj is of type MapJ and has loaded a map
// The variable req is of type HttpServletRequest
// The variable res is of type HttpServletResponse
// The variable dp is of type DoublePoint
// Add annotation layer - this layer will consist of one image symbol to "animate"
//注解表格提供帮助类
AnnotationTableDescHelper atdh = new AnnotationTableDescHelper("Animation_Layer");
//注解数据服务帮助类
AnnotationDataProviderHelper adph = new AnnotationDataProviderHelper();
//本地数据服务引用
LocalDataProviderRef ldpr = new LocalDataProviderRef(adph);
//创建注解图层
Layer animate_layer = mapj.getLayers().insert(ldpr, atdh,0, "Animation_Layer");
//定义注点
Rendition r = RenditionImpl.getDefaultRendition();
r.setvalue(Rendition.SYMBOL_MODE,Rendition.SymbolMode.IMAGE);
r.setvalue(Rendition.SYMBOL_URL, "file:///C:/images/car.gif");
//创建这个点-----
//先创建特征工厂
FeatureFactory ff = mapj.getFeatureFactory();
//包含单个属性的数组
Attribute[] aAIntAttribute = {new Attribute(33)};
//创建Integer
PrimaryKey pkey = new PrimaryKey(aAIntAttribute);
Feature f = ff.createPoint(dp, r, aAIntAttribute, pkey);
PrimaryKey pk = animate_layer.addFeature(f);
// Create the ImageRequestComposer
ImageRequestComposer imageRC =ImageRequestComposer.create(mapj, 256, Color.blue,"image/gif");
/*
Create the composite renderer
Render the image
Stream the image back to the client
*/
CompositeRenderer compositeRenderer = new CompositeRenderer(" http://localhost:8080/mapxtreme40/servlet/mapxtreme";, 0);
compositeRenderer.render(imageRC);
ServletOutputStream sos = res.getOutputStream();
compositeRenderer.toStream(sos);
//Set this attribute to false so that the bottom image is not rendered next time
compositeRenderer.setRedrawBottom(false);
} catch(Exception e) {
//Take appropriate error handling steps
}相关部分有示例代码。
--------------------编程问答-------------------- 按道理是可以出来的,你跟实例代码完全一样,怎么还出错,估计是你服务没配置好吧!检查配置信息吧!祝你好运吧! --------------------编程问答-------------------- 谢谢~
不添加移动目标,直接渲染地图是能够显示的。这样到话服务器配置应该没有的问题啊。。
补充:企业软件 , 地理信息系统