Hi
I try search many tutorial on how can convert the map coordinate(Lat/Long) to screen coordinate but it seem i can't find any of it. I want to perform a traverse method for the map to plot a marker. Any suggestion and idea are much appreciate.
Hi Mohamad Fathin,
Does this help? MapView.LocationToScreen Method
Pass in any MapPoint and you get a screen position relative to the top-left corner of the MapView control.
Nick.
Hi Nicholas Furness
I try the reference you share.
double longitude = 100.458802; //reference starting point
double latitude = 5.997545;public Point LocationToScreen(MapPoint location)
{
location = new MapPoint(longitude,latitude, SpatialReferences.Wgs84);
return location;
}
But it get me this error :
Cannot implicitly convert type 'Esri.ArcGISRuntime.Geometry.MapPoint' to 'System.Windows.Point'
Fathin
I meant that you should call mapView.LocationToScreen, not write your own function.
Something like…
double longitude = 100.458802; //reference starting point
double latitude = 5.997545;
location = new MapPoint(longitude,latitude, SpatialReferences.Wgs84);
screenPoint = mapView.LocationToScreen(location);
Perhaps I misunderstood your question.
Hi Nicholas Furness
It work. Thank for your help.