Set the scaling limit for bing cards for your Windows phone

Can I limit the maximum zoom of my map? I use SetView to map a map to a list of pushpins; if I have only one button, the map is scaled to 21. This is the way to big, I would like to limit it, for example 15. Thank you

+3
source share
2 answers

There is currently no single property that sets the maximum zoom level. However, you can use the MapZoom event handler and check the maximum ZoomLevel - if it goes outside, prevent further processing.

private void map1_MapZoom(object sender, Microsoft.Phone.Controls.Maps.MapZoomEventArgs e)
{
    if (((Map)sender).ZoomLevel > 3)
    {
        e.Handled = true;
    }
}
+1
source

ZoomLevel SetView:

myMap.SetView(LocationRect.CreateLocationRect(coordinates));
myMap.ZoomLevel = Math.Min(StopsMap.TargetZoomLevel, 15);

TargetZoomLevel.

0

Source: https://habr.com/ru/post/1793717/


All Articles