Reputation: 970
Google Maps itself can sort of Highlight areas, when you are searching for example for a city.
Since i haven´t found very much via the search function and google....
Is there an intended way to highlight an area (circle or rectangle) on an android mapview Or do i have to go the long way of calculating the necessary size of an picture (for example circle) (which is depending on the zoomlevel) and place it as a mapoverlay, which has to be replaced, whenever the zoom-level changes?
Upvotes: 0
Views: 951
Reputation: 11184
Extend Overlay
and override the draw
method.
For example:
class HighlightedAreaOverlay extends Overlay {
public void draw(Canvas canvas, MapView mapv, boolean shadow){
super.draw(canvas, mapv, shadow);
// your drawing code here
}
}
Then add it to your mapView by calling mapView.getOverlays().add(new HighlightedAreaOverlay());
Upvotes: 3