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失败");
}