开发者

Can I limit users to a specific range and zoom level on Bing Maps?

开发者 https://www.devze.com 2023-02-21 18:45 出处:网络
Similar to Can I limit users to a specific range and zoom level on Google Maps? except with Bing Maps.

Similar to Can I limit users to a specific range and zoom level on Google Maps? except with Bing Maps.

I don't see anything in the API for it specifically, so I'm not sure that it is easily done without overriding some method (and I don't know which one at that). I'm only working in javascript, not 开发者_运维问答silverlight or any serverside technology.


It can be done, but they don't make it easy. You need to listen to the mouse move event.

function LimitMove(e)
  {
     if (/* is map inside valid bounds check */)
     {
         return true; //true means we will handle the event (do nothing)
     }
     return false; //false means let the map do the default action (move)
  }

map.AttachEvent("onmousemove", LimitMove);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号