Search code examples
.netarcgis

Setting the viewpoint in ArcGIS Runtime .NET not working (10.2.7)


On mouse click, I am trying to set the viewpoint to a given google map co-ordinate location. When the below code runs, it moves the map to the wrong location at the incorrect scale. Any idea what I am doing wrong?

var point = new MapPoint
(
    -37.808934,
    144.975170,
    SpatialReference.Create(3857)  
);

var extent = new ViewpointCenter(point, 3000);

MyMapView.SetView(extent);

Solution

  • In my particular case, I was required to convert the co-ordinates in degrees to metres using ConvertCoordinate.FromDecimalDegrees(...) before passing them to the Viewpoint constructor.