Select to view content in your preferred language

How to add a GPS coordinate to a map that has different SpatialReference (2236)

1041
2
08-02-2011 12:40 PM
TomHwang
New Contributor
I need to add a point (from GPS coordinate: SpatialReference is 4326) to my map that has SpatialReference as 2236. I tried the way shown below but it did not work. Could anyone show me how to make this to work? Your help is greatly appreciated.

Tom Hwang

  ' the coordinate from GPS device
  Dim x As Double = -81.37886    ' Latitude
  Dim y As Double = 28.537548    ' Longitude

  Dim gra As New Graphic()
  With gra
            .Geometry = New MapPoint(x, y)
            .Symbol = MapTip_MarkerSymbol         ' a predefined symbol
            .Attributes.Add("MapTipID", "ID 1")      ' graphic attribute

             ' My map Spatial Reference is 2236 and I need to add a GPS point (4326) to the map
            .Geometry.SpatialReference = New ESRI.ArcGIS.Client.Geometry.SpatialReference(4326)     ' WGS84
        End With


        ' oMapTip is a GraphicsLayer
        oMapTip.Graphics.Add(gra)
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
You have to project your point in your map spatila reference by using a geometry service.

There is a sample here : http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Project

You can also look at this blog : http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2011/02/12/Auto_2D00_reprojecting-graphics-la...
0 Kudos
TomHwang
New Contributor
Hi dbroux,

  This works lovely! Thank you very much for your great help!

Tom Hwang
0 Kudos