3

I have a WPF application using ArcGIS 10. In the application I can set two point by clicking on map and calculate route between them. every time I click on the map, The application creates a GraphicsLayer and a Graphic element using this code:

GraphicsLayer stopsGraphicsLayer = myMap.Layers["myStops"] as GraphicsLayer;
Graphic stop = new Graphic() [Geometry = e.MapPoint };

My question:

I need to get the XY Coordinates of the points clicked on the maps. Does anybody know what elements\attributes\methods to get this information? Thanks.

asked Oct 21, 2012 at 13:31

1 Answer 1

2

I found the answer (I've been looking for it a week): the coordinates are part of the geometry attribute.

The code I added to get the coordinates of the stop is this:

ESRI.ArcGIS.Client.Geometry.Geometry whats = stop.Geometry;

This returns a type saying somthing like "Point[x=456543.34,y=456234.23,WKID=2045]"

and if I want to do anything with it, I can record it as a string, split it as I want and parse it to an int.

Thanks again.

answered Oct 21, 2012 at 15:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.