Joe
Joe

Reputation: 67

How do I override events in Bing Maps?

How do you override the mouseover and mouseout events for a pushpin with Bing Maps version 6.3?

Right now I am doing something along these lines:

var myMap;
myMap.SetCredentials("MY Credentials")
myMap.LoadMap();

myMap.AttachEvent("onmouseover", ShapeHandler);
myMap.AttachEvent("onmouseout", ShapeHandler);

function ShapeHandler(e) {
 ....
}

End result is my function executes but the native functions also execute I need to disable the native functions and so far have come up empty on how to do this?

Thanks

Upvotes: 0

Views: 410

Answers (1)

Alastair Aitchison
Alastair Aitchison

Reputation: 3532

Once your handler has done it's job ensure it returns true. i.e.

function ShapeHandler(e) {
  ...
  return true;
}

This will prevent any further processing from happening relating to that event.

Upvotes: 1

Related Questions