Hi Rjuken,
Query: Programmatically zoom on map marker.
By selecting the map marker, you can programmatically zoom the area around it and this can be achieved by changing the GeoCoordinates and ZoomLevel property in the MarkerSelected event.
By Specifying the marker latitude and longitude values to the GeoCoordinates property, maps will be centered at the specified location.
To zoom the map, you can increase the ZoomLevel property.
Please find the code snippet below,
private void ImageryLayer_MarkerSelected(object sender, Syncfusion.SfMaps.XForms.MarkerSelectedEventArgs e)
{
double latitude = Convert.ToDouble(e.MapMarker.Latitude);
double longitude = Convert.ToDouble(e.MapMarker.Longitude);
layer.GeoCoordinates = new Point(latitude, longitude);
sfmap.ZoomLevel = 4;
} |
We have also prepared a sample for the same. You can download the sample from the below link.
Please find the screenshot below,
Before Zooming
After Zooming (area around the marker is zoomed)
Regards,
Yogapriya.S