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!