X,Y coordinates to add a new point

1537
2
12-14-2011 02:23 AM
by Anonymous User
Not applicable
Original User: GIS.Nadir

Dears,
How to add a functionality of adding a new point by providing input X,Y coordinates widget?

I mean it is similar to locate by coordinate widget, where one fills the X,Y coordinates text boxes then press ADD button to update the SDE layer with a new point feature.

Another challenge:
What if the inserted coordinates are in a different projection than the the map spatial reference?

Thanks
0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: dpaddock

You can call applyEdits() on FeatureLayer or FeatureLayerTask.

See:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/FeatureLayer.html#applyEdits()
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tasks/FeatureLayerTask.html#applyEdits()

var mapPoint:MapPoint = new MapPoint(x, y, new SpatialReference(123));
var graphic:Graphic = new Graphic(mapPoint);
featureLayer.applyEdits([graphic], null, null);


The server will project the coordinates if necessary.
0 Kudos
by Anonymous User
Not applicable
Original User: GIS.Nadir

Dear Paddok,
Many thanks for your useful guidelines and help.
I do appreciate it.
0 Kudos