Mouse events propagation from marker to underlying map -
i have 1 question, why dose mouse events related map never fire when on marker
exp. having mouse move listener added map never called when move on marker (there not called event propagation or bubbling).
this actully working on maps v2!
is bug, or changed behavior in v3?
blaze
here example...
if move around map, maplabel updated should if u move on marker maplabel never updated
var map; function initialize() { var mylatlng = new google.maps.latlng(-25.363882,131.044922); var myoptions = { zoom: 4, center: mylatlng, maptypeid: google.maps.maptypeid.roadmap } map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); google.maps.event.addlistener(map, 'mousemove', function() { document.getelementbyid('movelabel').innerhtml = 'mouse map move' + math.random(); }); var marker = new google.maps.marker({ position: mylatlng, map: map, title:"hello world!" }); google.maps.event.addlistener(marker, 'mouseout', function() { document.getelementbyid('markerlabel').innerhtml = ''; }); google.maps.event.addlistener(marker, 'mouseover', function() { document.getelementbyid('markerlabel').innerhtml = 'mouse on marker'; }); }
all google maps' data drawn placed on 7 layers. these layers called panes. according pane drawing belongs , can receive or not receive events. more information @ google.maps.mappanes documentation.
update: google maps draws data on 7 panes. panes children of same parent. event bubbling neccessary relation of elements should parent-child
( child can bubble event parent ),but not sibling-sibling
. in sibling-sibling
relation, event received element highest z-index
. reason don't events bubbled marker's pane map's pane.
Comments
Post a Comment