Disable panning capture to control bing cards

How to disable only the panning capture aspect for AJAX control 7.0 bing cards?

I tried this -

var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), { credentials: "bing maps credentials", mapTypeId: Microsoft.Maps.MapTypeId.road, disablePanning: true});

But setting the property disablePanningin the map parameters not only disables the capture panning, but also the panning scaling. The scale becomes not completely turned off, but instead it will increase and decrease only in the center of the map. Undoubtedly, you will be taken to zoom lens, where you can use the mouse scroll wheel to enlarge the image on the map under the cursor and, therefore, you can move around by zooming in and out and moving the cursor. I would like to enable panning zoom, but capture panning (where the user clicks and drags it) to disable it.

I am aiming for functionality very similar to that when using the editor of my places on the main bing maps site. When you use the polyline tool to draw on a map, panning capture is disabled, and panning zoom is turned on as you would like. I actually intend to create my own drawing tool, similar to the polyline tool, in the editor of my places .

I am studying api, but have not yet figured out how to do this. I also tried to figure out how this is done on the main bing maps website, but as javascript code is minimized, it is very difficult for me. I managed to get the polyline tool to capture the mouse, but that’s it.

Of course, there should be an easy way to do this. How it's done?

+3
source
1

, , ( / ). . . , mousedown , mousedown, . , MouseEventArgs :

Microsoft.Maps.Events.addHandler(yourMapObj, 'mousedown', function (mouseEvent) {
    mouseEvent.handled = true; //A boolean indicating whether the event is handled. If this property is set to true, the default map control behavior for the event is cancelled.
}); 

mousedown . , , . , . , , , mousedown. , mousedown, , . , , mousedown (), MouseEventArgs, , mousedown (messy).

+5

All Articles