Select to view content in your preferred language

How do you convert from lat,long to a map point?

3109
4
Jump to solution
10-12-2012 03:41 PM
Labels (1)
EzraSidran
Emerging Contributor
I have the lat, long and I wish to output it on the map using this:

            Graphic g = new Graphic();
            g.Geometry = new MapPoint(x, y);
            SimpleMarkerSymbol marker = new SimpleMarkerSymbol();
            marker.Color = new System.Windows.Media.SolidColorBrush(Colors.Red);
            marker.Style = SimpleMarkerSymbol.SimpleMarkerStyle.Circle;
            marker.Size = 10;
            g.Symbol = marker;
            graphicsLayer.Graphics.Add(g);
            pointGraphics.Add(g);


How do I convert the lat,long to the x,y of the MapPoint?
0 Kudos
1 Solution

Accepted Solutions
BKuiper
Frequent Contributor
You will need the GeometryService Projection function to map the Lat/Lon to the correct projection of your map.

In some cases you can use ESRI.ArcGIS.Client.Projection.WebMercator() (from 4326 to 102100)

View solution in original post

0 Kudos
4 Replies
BKuiper
Frequent Contributor
You will need the GeometryService Projection function to map the Lat/Lon to the correct projection of your map.

In some cases you can use ESRI.ArcGIS.Client.Projection.WebMercator() (from 4326 to 102100)
0 Kudos
EzraSidran
Emerging Contributor
Thank you very much for in the information!
0 Kudos
AnkitaBhatia
Occasional Contributor
Hi,
I am confused in which cases to use Geometry service and when to use Project.Mercator.
Right now i am using Mercator but it is not giving me proper result. The Y for my projected Map Point from Lat/Long is (-ve)INfinity.
Please help me resolve this.
0 Kudos
EzraSidran
Emerging Contributor
I think Bjorn's answer, above, will help you.
0 Kudos