Setting a min/max zoom for Bing maps in Silverlight

允我心安 提交于 2019-12-01 20:51:02

问题


I am using the Silverlight sdk for Bing Maps. I have my map, I have my PushPins all mapped out. Now I want to disable the user from zooming out so far they see the whole world and keep it constricted to the just the US. It would be nice if there was something simple like Map.MaxZoom but there is not. Any help?


回答1:


public class MyMapMode : Microsoft.Maps.MapControl.Core.MercatorMode
{
    public Range<double> MapZoomRange = new Range<double>(1.0, 10.0);
    protected override Range<double> GetZoomRange(Location center)
    {
        return this.MapZoomRange;
    }
}

you can try it!



来源:https://stackoverflow.com/questions/2945726/setting-a-min-max-zoom-for-bing-maps-in-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!