I am working in android mapping application that’s used Osmdroid mapping API until now I am being able to show the map and the user location in the map , but how I can show the accuracy circle around the marker and is that can be testing in the emulator only.{I need some examples or tutorials on that }
Asked
Active
Viewed 2,162 times
2 Answers
1
Extend Overlay class and create a class and name it AccuracyIndicatorCircleOverlay (for example).
public class AccuracyIndicatorCircleOverlay extends Overlay {
}
Now override the draw method:
public void draw(Canvas canvas, MapView mapView, boolean shadow) {
super.draw(canvas, mapView, shadow);
// Now you can use getAccuracy() method of android.location.Location
// to draw a circle based on your requirements.
}

Ali Behzadian Nejad
- 8,804
- 8
- 56
- 106
0
I'm not familiar with osmdroid, but assuming you have access to the location data (specifically the accuracy) I would say just change out the image based on the accuracy. When you get a new location if the accuracy is different than previous then reset the image used for the user location. Seems to be the easiest solution assuming you get location updates.
If you are looking to add an overlay to a mapview here is a answer on SO where they used an overlay to create a radius according to accuracy.

Community
- 1
- 1

MikeIsrael
- 2,871
- 2
- 22
- 34
-
I want to know how I can add the accuracy circle that its radius is changing according to the accuracy. – harhouf Jun 25 '12 at 15:03
-
That is what I was explaining just create different images for different groups of accuracy. That would be much more efficient than drawing a separate radius circle. – MikeIsrael Jun 25 '12 at 15:05
-
Thanks for your suggestion ,but I want to know how to draw the accuracy circle (that its radius is changing according to the accuracy) as shown in Google map. You don't know any tutorials or examples about that. – harhouf Jun 27 '12 at 06:30
-
ok I added a link for where someone used an overlay to create an accuracy circle, but not sure if that is what you want, because that is using the mapview from google. – MikeIsrael Jun 27 '12 at 06:56