1

I have an application using Maps API v2 and I use the method map.setMyLocationEnabled(true); to display user location. It works well as in the classic Google Maps application, with the blue radius around the position cursor but I would like to implement something on click on the position cursor to display accuracy in a Toast or pop up. I have not found anything in Maps API v2 reference nor in StackOverflow about that...

The only thing I know is that I can get the accuracy with map.setOnMyLocationChangeListener() and the location.getAccuracy();

Avadhani Y
  • 7,566
  • 19
  • 63
  • 90
YannPl
  • 1,312
  • 1
  • 14
  • 30

1 Answers1

2

Maybe you should put a custom marker on your own position with the same imageResource as the default own-location marker with an own onClickListener, this way it will look the same as the built-in one, just don't forget to track the user's location, and update the marker at every location changed event.

Analizer
  • 1,594
  • 16
  • 30
  • The problem with it is that I have to manage all the location update part with the Location manager etc... And the custom marker doesn't look like the default one, with the arrow pointing in the user's movement direction and the blue radius of accuracy. – YannPl Apr 18 '13 at 07:35
  • and what if you don't remove it, just put a custom marker exactly on it with an own onClickListener but with the same image resource. This way it will look the same, with the radius and all (true, you'll have to manage all location updates) – Analizer Apr 18 '13 at 08:00
  • Oh, yeah good idea! And with the setOnMyLocationChangeListener from the GoogleMap object I'll not need to implement my own location algorithm. Thanks, you just won a new accepted answer! :D But please Edit it to explain the idea and remove the map.setMyLocationEnabled(false); ;) – YannPl Apr 18 '13 at 08:08
  • @Zarkaos See my answer [here](http://stackoverflow.com/a/16085390/1948704) for some example code illustrating this approach. – Nevermore Apr 20 '13 at 23:27