几何对象的创建
一、创建点对象
var point=new esri.geometry.Point(x,y,{wkid:102113});
var point= new esri.geometry.Point(-118.15, 33.80,new esri.SpatialReference({ wkid: 4326 }));
二、创建线对象
var polylineJson = {"paths": [[[x, y], [x, y]], "spatialReference":{"wkid":4326}};
var newLine=new esri.geometry.Polyline(polylineJson);
三、创建面对象
var polygon = new esri.geometry.Polygon(); var points = []; points.push(new esri.geometry.Point(minx, maxy)); points.push(new esri.geometry.Point(maxx, maxy)); points.push(new esri.geometry.Point(maxx, miny)); points.push(new esri.geometry.Point(minx, miny)); points.push(new esri.geometry.Point(minx, maxy)); polygon.addRing(points); polygon.spatialReference = map.spatialReference;

浙公网安备 33010602011771号