Search code examples
androidlocationgoogle-maps-api-2

Android Maps API v2 - event onClick on my location cursor


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();


Solution

  • 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.