Mootools and VE mouse events in FireFox
Hello Everyone
Has anyone had any experience getting VE to work with mootools? I have found if the mootools script is in the same page as a VE map then in FireFox the VE mouse events do not work correctly.
The event fires fine, but the event arguements are not right. As an example see the code below which adds a simple pushpin and then attaches an onclick event to the map. The onclick event should be able to get the elementID from the event arguements however in firefox this is not present.
<
html><head><title></title><metahttp-equiv="Content-Type"content="text/html; charset=utf-8"><scriptsrc="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"defer="defer"></script><script>var map =null;var pinPoint =null;var pinPixel =null;function GetMap(){
map =
new VEMap('myMap');map.LoadMap(
new VELatLong(34.118875035799, -118.3003306388855), 14 );map.AttachEvent(
"onclick",ShapeClickHandler);AddNumberedPushpin();
}
function ShapeClickHandler(e){//check if click was even over a shape (rather than just the map)if (e.elementID !=null){//check what type of shape was handledvar shape = map.GetShapeByID(e.elementID);alert(
'shape clicked');returntrue;}
else{alert(
'map clicked');}
//else default to normal behavoirreturnfalse;}
function AddNumberedPushpin(number,pinTitle,pinInfo){var icon ="<div class=\"numberedpushpin\">" + number +"</div>";var infobox ="<div class=\"custompopup\">" + pinInfo +"</div>"AddPushpin(icon,pinTitle,pinInfo);
}
function AddPushpin(layer,pinIcon,pinTitle,pinInfo){
var shape =new VEShape(VEShapeType.Pushpin, map.GetCenter());//Set the iconif(pinIcon!=null) shape.SetCustomIcon(pinIcon);//Set the info boxshape.SetTitle(pinTitle);
shape.SetDescription(pinInfo);
//Add the shape the the mapmap.AddShape(shape);
}
</script></head><bodyonload="GetMap();"><divid='myMap'style="position:relative; width:400px; height:400px;"></div></body></
html>I've tried looking through mootools and trying to debug what is happening, as well as changing the ordering of the script tags to change which file loads first.
Anyone any expereince or ideas?
Thanks
Brian Norman

