Issue
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 the rotated drawable.
Solution
Take a look at this (change the signature to actually return the drawable!)
Rotate Bitmap to Match Bearing
Answered By - Idistic
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.