Is it possible to determine the pixel co-ordinates of a given marker, taking into account current zoom level and visible area of the map?
+2
A:
The method fromLatLngToContainerPixel following should give you what you're after, assuming markerPoint
is your marker, and zoomLevel
your current zoom:
map.fromLatLngToContainerPixel(markerPoint.getLatLng(), zoomLevel);
ConroyP
2009-10-12 07:04:09
Thanks, that's just the method I needed! (Actually it would be: 'map.fromLatLngToContainerPixel(markerPoint.getLatLng(), zoomLevel);' as the first parameter should be a GLatLng object.)
jonathanconway
2009-10-12 07:33:44
Updated to reflect markerPoint comment, and added direct link to documentation.
ConroyP
2009-10-12 09:05:39