Can I limit users to a specific range and zoom level on 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);
精彩评论