Select to view content in your preferred language

360 added to Longitude (WrapAround = True)

1110
0
10-15-2013 06:51 AM
williambich
Emerging Contributor
I believe this issue revolves around the map, when I am using WrapAround = True.

When I move the map to the left past 360 degrees, the longitude for the api gets compounded.  This is ok for the most part, I can always subtract 360 from the longitude.  The problem exists when I use the ESRI.ARCGIS.Client.Draw object, it uses the coordinates in the background to create my objects with the bad geometry.  I can always fix the geometry after I build it, but I really don't want to do this because its causing issues with multiple features we designed as well. Also when I refresh the map it causes the same problem, 1 out of 15 times the geometries are messed up (just like when i rotate the map past 360).

Is there a fix? Besides patching the MapPoints with the code below?


I can use this to fix the wraparound issue, but when I use ESRI.ARCGIS.Client.Draw it trashes the geometry, because there is not a place to put this code. The code came from: http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#MouseCoords

if (MyMap.WrapAroundIsActive)
                    mapPoint = ESRI.ArcGIS.Client.Geometry.Geometry.NormalizeCentralMeridian(mapPoint) as ESRI.ArcGIS.Client.Geometry.MapPoint;
                MapCoordsTextBlock.Text = string.Format("Map Coords: X = {0}, Y = {1}",
                    Math.Round(mapPoint.X, 4), Math.Round(mapPoint.Y, 4));
0 Kudos
0 Replies