如何在图层增加点线面(不通过扩展MapComponent类实现
来源:百度文库 编辑:神马文学网 时间:2024/06/06 13:10:48
在实时在线系统中实现地图呈现,所以需根据用户新增操作实时的在地图上增加点线面,下面的代码执行后,不能成功添加对象,不知为什么,请版主帮忙分析一下layerName = "line_cqt@hzydMap" ;
IMapService mapService = null;
String mapName = "hzyd";
int count = 6;
Entity[] targetEntities = new Entity[1] ;
targetEntities[0] = new Entity() ;
//targetEntities[0].fieldNames = {""};
//targetEntities[0].fieldValues = {""} ;
String[] fieldNames = new String[1] ;
String[] fieldValues = new String[1] ;
fieldNames[0] = "SmUserId" ;
fieldValues[0] = "1" ;
Geometry geo = new Geometry() ;
geo.feature = FeatureType.LINE ;
MapCoord[] points = new MapCoord[2] ;
MapCoord point = new MapCoord();
point.x = new Double(120.1969) ; point.y = new Double(30.31734) ;
MapCoord point1 = new MapCoord();
point1.x = new Double(120.29972) ; point1.y = new Double(30.51861) ;
points[0] = point ; points[1] = point ;
geo.points = points;
System.out.println(geo) ;
targetEntities[0].shape = geo ;
targetEntities[0].fieldNames = fieldNames ;
targetEntities[0].fieldValues = fieldValues ;
try {
mapService = MapServiceFactory.getRemoteMapService("127.0.0.1", 8700, "mapService1", mapName);
MapParam mapParam = mapService.getDefaultMapParam(mapName) ;
//得到需添加的基站小区记录
//调用相应方法在图层上添加地物
EditResult er = new EditResult() ;
er = mapService.addEntity(mapName, layerName, targetEntities, mapParam) ;
//mapService.u
System.out.println(er.succeed) ;
mapService = null ;
}catch (Exception ex) {
System.out.println("创建mapService失败") ;
throw new InstantiationError("创建mapService失败");
} 最后发现是本人粗心,少写了geo.points = points ;造成的
IMapService mapService = null;
String mapName = "hzyd";
int count = 6;
Entity[] targetEntities = new Entity[1] ;
targetEntities[0] = new Entity() ;
//targetEntities[0].fieldNames = {""};
//targetEntities[0].fieldValues = {""} ;
String[] fieldNames = new String[1] ;
String[] fieldValues = new String[1] ;
fieldNames[0] = "SmUserId" ;
fieldValues[0] = "1" ;
Geometry geo = new Geometry() ;
geo.feature = FeatureType.LINE ;
MapCoord[] points = new MapCoord[2] ;
MapCoord point = new MapCoord();
point.x = new Double(120.1969) ; point.y = new Double(30.31734) ;
MapCoord point1 = new MapCoord();
point1.x = new Double(120.29972) ; point1.y = new Double(30.51861) ;
points[0] = point ; points[1] = point ;
geo.points = points;
System.out.println(geo) ;
targetEntities[0].shape = geo ;
targetEntities[0].fieldNames = fieldNames ;
targetEntities[0].fieldValues = fieldValues ;
try {
mapService = MapServiceFactory.getRemoteMapService("127.0.0.1", 8700, "mapService1", mapName);
MapParam mapParam = mapService.getDefaultMapParam(mapName) ;
//得到需添加的基站小区记录
//调用相应方法在图层上添加地物
EditResult er = new EditResult() ;
er = mapService.addEntity(mapName, layerName, targetEntities, mapParam) ;
//mapService.u
System.out.println(er.succeed) ;
mapService = null ;
}catch (Exception ex) {
System.out.println("创建mapService失败") ;
throw new InstantiationError("创建mapService失败");
} 最后发现是本人粗心,少写了geo.points = points ;造成的
如何在图层增加点线面(不通过扩展MapComponent类实现
点线面、透视
平面构成之点线面
扩展JAAS实现类实例级授权
扩展JAAS实现类实例级授权(ZZ)
一步一步实现MFC扩展DLL中导出类和对话框
美术设计入门:素描基本造型 - 点线面、透视 00
美术设计入门:素描基本造型 - 点线面、透视 x
Quartz中扩展MethodInvokingJobDetailFactoryBean实现...
如何在标定坐标上添加一个图层标注[地理信息系统论坛社区]
胡锦涛:增加报酬 让劳动者实现体面劳动(图)
胡锦涛:增加报酬 让劳动者实现体面劳动(图)
胡锦涛:增加报酬 让劳动者实现体面劳动(图)2
用Shell扩展实现源代码统计程序
如何在 JavaScript 中实现拖放(上)
在JSP中如何实现MD5加密
如何在文章中实现首字下沉
如何在文章中实现首字下沉
如何在Linux下实现定时器
如何在文章中实现首字下沉
如何在 JavaScript 中实现拖放(上)
如何在 JavaScript 中实现拖放(中)
图层在Photoshop中的作用详解
Adobe Photoshop 盖印图层在哪里?