几何对象的创建

一、创建点对象

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;

  

posted @ 2016-09-07 10:26  网络云鱼  阅读(377)  评论(0)    收藏  举报