Google Maps API v3 MouseEvent return position of marker not mouse -


i have implemented map markers , listeners on markers.

... google.maps.event.addlistener(marker,'rightclick',function(event) {showrightclick(event, map, marker);}); ...  // show right click menu function showrightclick(event, map, marker) {         var point = map.getcanvasprojection().fromlatlngtocontainerpixel(event.latlng);         var scriptinterface = getheader();         var screenx = point.x + window.screenleft;         var screeny = point.y + window.screentop;         scriptinterface.rightclick(marker.name, marker.objectid, marker.dimobjectid, screenx, screeny); } 

but, when listener triggers, event latitude , longitude of marker , not mouse. so, right click menu trying show appears @ bottom of marker , not mouse position.

does know if bug or expected behaviour?

although documentation says mouseevent event's latlng "the latitude/longitude below cursor when event occurred," location of marker in version 2.

the behaviour may expected same in version 3. don't believe it's bug, although can see produces unexpected results right-click.

you may need use dom right-click event instead (although difficult if not impossible associate marker).


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -