Problem with Custom Marker for Google Maps

Hello there,

Has anyone tried using custom markers for google maps? It somehow always appears slightly off from the actual point. Is there a workaround to this? Here is my code:

BasicMarker m=new BasicMarker(1L,new Point2D.Double(lon,lat), name);
m.setIconUrl("http://www.google.com/mapfiles/dd-end.png");
map.addMarker(m);

Hi,

i have the same problem. Any solution so far?

Another question to me is how to have icons with shadow.
The BasicMarker class only has setIconUrl() method.
Is there any other trick i don’t know?

To solve the marker offset problem, just set the anchor yourself with Marker.setIconAnchor(Point2D.Double) . For example, if I have a 16x16 custom bulls-eye marker and I want it to sit directly on the location, I’d call

bullseye.setIconAnchor(new Point2D.Double(8.0,8.0));

I don’t see an implementation of marker shadows in the GWT maps widget, so there’s no easy solution for that.