Pages

Monday 18 March 2013

Android - Set marker to exact position using custom Overlay in MapView

There is a method in the ItemizedOverlay class called: boundCenterBottom(Drawable), which does the setBounds part. There's also a boundCenter(Drawable) method.

Just replace this code in your custom Itemized Overlay constructor :

public CustomItemizedOverlay(Drawable defaultMarker, MapView mapView) {
       super(boundCenterBottom(defaultMarker), mapView);
}

No comments :

Post a Comment