Select to view content in your preferred language

Polygon points with googlemap is different

757
2
10-21-2012 05:40 AM
JulieBiju
Deactivated User
Dear Friends,
I need urgent help for the following issue.

I developed one module for Drawing the polygon.These polygon points I am saving to the DB.Everything is working fine with the following URL
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />

Now same code I am trying to use with Googlemap.But the longitude and latitude of the same place giving different.

For eg:When i draw a polygon on ESRI_StreetMap_World_2D/MapServer .The points like 58.25,23.225 58.232,24.89 58.35,23.225

When I draw a polygon on Googlemap withthese same location,The points are 2704315.97807635,6496765.39170823 2704330.31001916,6496775.09562783,  2704315.97807635 6496765.39170823


Y it is getting the values like this.I am very confused.Can anybdy help me to solve my issue?PLEASEEEE


    End Sub
    Private Sub MyDrawObject_DrawComplete(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.DrawEventArgs)


        If TypeOf args.Geometry Is Polygon Then
            Dim cntpoints As Integer = DirectCast((args.Geometry), Polygon).Rings(0).Count
            If (cntpoints <= 2) Then Exit Sub
            Dim points As PointCollection = DirectCast((args.Geometry), Polygon).Rings(0)
            'Save the points

 For Each mapPoint As MapPoint In points
                ''''''''''''''''''Save data to DB      
                VID = VID + 1
                '-------------------
                Dim ProxySavePoly As ComboLoadClient = New ComboLoadClient()
                AddHandler ProxySavePoly.SavePolyGonIDCompleted, AddressOf client_SavePolyGonIDCompleted
                ProxySavePoly.SavePolyGonIDAsync(" VALUES(" & PID & "  ," & VID & "," & (mapPoint.Y) & "," & (mapPoint.X) & ", " & _
            " " & fahrid1 & ",'" & Geofencename & "','" & Geofencedesc & "','" & DateAndTime.Now & "')")
            Next
        End If
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
It's  a spatial refrence matter.

If your map is using web Mercator coordinates (depending on your base map), you can transform these coordinates to geographical coordinates y using the WebMercator.ToGeographic method.
0 Kudos
JulieBiju
Deactivated User
It's  a spatial refrence matter.

If your map is using web Mercator coordinates (depending on your base map), you can transform these coordinates to geographical coordinates y using the WebMercator.ToGeographic method.



Thank u so much. Ineed your help based on the code I pasted here with.I need to convert (mapPoint.Y) and (mapPoint.X)
How can i do this?PLease give me a help....


Private Sub MyDrawObject_DrawComplete(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.DrawEventArgs)


        If TypeOf args.Geometry Is Polygon Then
            Dim cntpoints As Integer = DirectCast((args.Geometry), Polygon).Rings(0).Count
            If (cntpoints <= 2) Then Exit Sub
            Dim points As PointCollection = DirectCast((args.Geometry), Polygon).Rings(0)
            'Save the points

 For Each mapPoint As MapPoint In points
                ''''''''''''''''''Save data to DB      
                VID = VID + 1
                '-------------------
                Dim ProxySavePoly As ComboLoadClient = New ComboLoadClient()
                AddHandler ProxySavePoly.SavePolyGonIDCompleted, AddressOf client_SavePolyGonIDCompleted
                ProxySavePoly.SavePolyGonIDAsync(" VALUES(" & PID & "  ," & VID & "," & (mapPoint.Y) & "," & (mapPoint.X) & ", " & _
            " " & fahrid1 & ",'" & Geofencename & "','" & Geofencedesc & "','" & DateAndTime.Now & "')")
            Next
        End If
0 Kudos