我有一个mapview,每个OverlayItem都有一个自定义项目,类就在这里。
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);
}
}
我希望能够通过类中的标题旋转Drawable,这样当mapView调用它时,它将返回旋转的drawable。