views:

525

answers:

2

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
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
Updated to reflect markerPoint comment, and added direct link to documentation.
ConroyP
A: 

This doesn't seem to work for me..:(

Ashriya