在Silverlight中为Bing地图设置最小/最大缩放 [英] Setting a min/max zoom for Bing maps in Silverlight

查看:61
本文介绍了在Silverlight中为Bing地图设置最小/最大缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Bing Maps的Silverlight SDK.我有我的地图,我所有的PushPins都已映射.现在,我要禁止用户缩小范围,直到他们看到整个世界,并将其限制在仅美国.如果有像Map.MaxZoom这样简单的东西,但是没有的话,那会很好.有帮助吗?

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?

推荐答案

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;
    }
}

您可以尝试!

这篇关于在Silverlight中为Bing地图设置最小/最大缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆