Take the 2-minute tour ×

I am putting an image as an overlay on an Android google map. Does the image appear aligning the origin of the image at the coordinates? Is there a way to control it? If I want the center of the image to be at the overlay coordinates how do I go about?

Thanks a lot

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted
//This will make the center of the image to be at the coordinates.

public abstract class CustomOverlay<Item extends OverlayItem> extends ItemizedOverlay<Item> {

public CustomOverlay(Drawable defaultMarker, MapView mapView) {
    super(boundCenter(defaultMarker), mapView); 

share|improve this answer
Thank you. It works perfect. One thing I noticed is that the boundCenter works only for the default marker. If I change the marker using overlayitem.setMarker(anotherImage); the image is aligned at (0,0). Thank you very mcuh. It resolved my issue. –  zolio May 23 '12 at 2:39
add comment

Your Answer


