Bing Maps 8 Fetching a Drawn Shape

Bing Maps version 8 is scheduled to be released sometime this year. One new feature is a Drawing Control that allows users to draw a polygon on the map.

Drawing is fine but in order for the drawn shape to be useful, it’s necessary to know where the shape is on the map.


Because there’s no documentation yet, I don’t know if there will be a nice function that will return information about drawn shapes. So, I hacked together a demo that intercepts mouse-down events (while the user is drawing) and records the associated vertex of the shape.

It was a surprisingly difficult task because the JavaScript event model is kind of wacky. I really hope Bing Maps 8 will have built-in functions along the lines of a hypothetical “getDrawnShapes()”.


This entry was posted in Miscellaneous. Bookmark the permalink.