I know that I was a bit late for the party, but I had the same problem, and I decided to use it using the built-in events.
Cause
Through many registration statements in various event handlers, I found that the problem occurs because the mousedown event occurs on the map, but the scrollbar somehow prevents the mouseup event from leaving the map draggable.
Decision
When the map is initialized, I add event handlers for the mouseDown event on the map.
Microsoft.Maps.Events.addHandler(map, 'mousedown', map_mousedown);
For the display box, I add event handlers for the mouseenter , mouseleave and entitychanged .
Microsoft.Maps.Events.addHandler(infobox, 'mouseenter', infobox_mouseenter); Microsoft.Maps.Events.addHandler(infobox, 'mouseleave', infobox_mouseleave); Microsoft.Maps.Events.addHandler(infobox, 'entitychanged', infobox_entitychanged);
In the mouseenter and mouseleave event handlers, I set a value that indicates whether the mouse pointer is over the info boxes, and reset it uses entitychanged when closing the info box.
var overInfobox = false; function infobox_mouseenter(event) { overInfobox = true; } function infobox_mouseleave(event) { overInfobox = false; } function infobox_entitychanged(event) { overInfobox = false; }
In the mousedown event handler for the map, this value is considered. If so, then the default action for the event (which drags the map) is prevented.
function map_mousedown(event) { if (overInfobox) event.handled = true; }
Thus, when a mouse click something inside the infobox, it will not affect the map. The scrollbars will work, and you can drag the map outside the info box (and when you close the info box, use the X in the upper corner).