开发者

Rotate drawable in OverlayItem

I have a mapview that has a custom item per OverlayItem and the class is here.

 class MapObject extends OverlayItem{

 String name;
 String heading;

 Drawable marker = null;

PlaneObject(GeoPoint pt, String name, String snippet, Drawable marker){
    super(pt,name,snippet);
    this.marker = marker;
}

@Override
public Drawable getMarker(int stateBitset){
    Drawable result = marker;
    setState(result,stateBitset);
    result.setBounds(-result.getIntrinsicWidth()/2, -result.getIntrinsicHeight(), result.getIntrinsicWidth() /2, 0);
    //Want to rotate the drawable to the angle stored in the heading variable
    return(result); 
}   

}

I would like to be able to rotate the Drawable by the heading within the class so when the mapView calls it then it will return t开发者_运维技巧he rotated drawable.


Take a look at this (change the signature to actually return the drawable!)

Rotate Bitmap to Match Bearing

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜