android custom map marker bounds

Posted by max4ever on Stack Overflow See other posts from Stack Overflow or by max4ever
Published on 2012-04-02T11:26:24Z Indexed on 2012/04/02 11:29 UTC
Read the original article Hit count: 379

Filed under:
|

Hello i am using a resized version of this marker( http://www.clker.com/clipart-orange-pin-4.html ) for showing markers in google maps on android.

The problem is i don't know how to make the marker point match the coordinates. The arrow point is at about 1/5 of the Width coordinates and MAX of the Height.

here is my class

public class GestionaleItemizedOverlay extends com.google.android.maps.ItemizedOverlay {

    public GestionaleItemizedOverlay(Drawable defaultMarker, Context context) {
        //super(boundCenterBottom(defaultMarker));
        super(boundCenter(defaultMarker));
        this.mContext = context;
    }
...

And this

    this.marker_poi = this.getContext().getResources().getDrawable(R.drawable.marker);
    this.marker_poi.setBounds(this.marker_poi.getIntrinsicWidth() / 2, this.marker_poi.getIntrinsicHeight(), this.marker_poi.getIntrinsicWidth() / 2, 0);
 new GestionaleItemizedOverlay(this.poi, this.context);

Do i need to setBounds on the marker before passing it to the constructor? and why does super(defaultMarker) makes all the markers not to show ?

© Stack Overflow or respective owner

Related posts about android

Related posts about google-maps