Bing Maps: disable pushpin events for static maps

Short Answer:

Disable the events by entering this line of code before you add VEShapes:

map.AttachEvent("onmouseover", function(e){ if (e.elementID) return true;});

Long Story:

Today I was working on creating a static Bing map for a report. It is supposed to show points within a radius, but it shouldn't have a tooltip or any interaction like that. To disable tooltips is simple: just don't add any description to the points, and there will be no pop up when there is a hover over the shape. Clicking on the pushphin shape, however, did trigger an event. And since there was no handling for the event, I was getting a nasty Bing maps error.

I had entered the code above at the bottom of the function that creates the map. However, I still had the problem. I was ready to post to stackoverflow to find an answer, but then I just tried a crazy idea: place the disabling code before I added any VEShape objects to the map.

That worked! And like most things, once you get the answer, it makes a lot of sense.