skb
skb

Reputation: 31094

How to turn off the draggable behavior in Bing Maps API 7.0

I am building a map application using the Bing Maps API 7.0 javascript control. I am trying to figure out how to toggle the default "draggable" behavior of the map. I want my users to be able select a rectangular region by clicking in one corner, and then dragging the mouse to the other corner. Is this possible?

I'm not asking for any help with the selection behavior, just the ability to toggle the draggable behavior. Thanks!

Upvotes: 1

Views: 375

Answers (1)

rbrundritt
rbrundritt

Reputation: 17954

The easiest way to do this is to set the map options to disable panning/zooming:

map.setOptions({disableZooming: true, disablePanning: true});

When you want to be able to move the map again then set these values to false.

Upvotes: 2

Related Questions