I've looked high and low for an answer on this, and no one, in any forum question has been able to help. I've searched through the tutorials. The API Guide says:
The My Location button appears in the top right corner of the screen only when the My Location layer is enabled.
So I've been looking for this My Location layer and have been unable to find anything. How do I show my location on a Google Map?
Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.
The API Guide has it all wrong (really Google?). With Maps API v2 you do not need to enable a layer to show yourself, there is a simple call to the GoogleMaps instance you created with your map.
Google Documentation
The actual documentation that Google provides gives you your answer. You just need to
// map is a GoogleMap object map.isMyLocationEnabled = true
// map is a GoogleMap object map.setMyLocationEnabled(true);
and watch the magic happen.
Just make sure that you have location permission and requested it at runtime on API Level 23 (M) or above
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With