var extent : Extent = Graphic(event.target).geometry as Extent; const arrPoints:Array = [ new MapPoint(extent.xmin, extent.ymin), new MapPoint(extent.xmin, extent.ymax), new MapPoint(extent.xmax, extent.ymax), new MapPoint(extent.xmax, extent.ymin), new MapPoint(extent.xmin, extent.ymin) ]; var polygon:Polygon = new Polygon(); polygon.addRing(arrPoints); polygon.spatialReference = extent.spatialReference; Graphic(event.target).geometry = polygon; mapEditTool.activate(EditTool.MOVE|EditTool.EDIT_V ERTICES, [Graphic(event.target)]);
var myEditTool : EditTool = new EditTool(myMap) // make sure you pass in the map object myEditTool.activate(EditTool.MOVE, [myGraphic]); //where myGraphic is the newly created graphic(in your case with an extent geometry)
<!-- EditTool, again making sure you pass in the map object --> <esri:EditTool id="myEditTool" map="{myMap}"/> myEditTool.activate(EditTool.MOVE, [myGraphic]);
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.