While enabled, the my-location layer continuously draws an indication of a user's current location and bearing, and displays UI controls that allow a user to interact with their location (for example, to enable or disable camera tracking of their location and bearing).
myMap.setMyLocationEnabled(true);
The series:
A simple example using Google Maps Android API v2, step by step.
4 comments:
I was wondering if you could help me with this particular post. I can't seem to get my location to work. I got the map up and I am able to see it on my device, but I can't get the code right I guess.
I have some code I got off another site which has something similar in it. " mMap.setMyLocationEnabled(true) " . I can't get it to say myMap.setMyLocation... It says its an error. But there are no errors with any code on my app. But it's ok with it just being mMap... So I'm leaving that part, but I still can't get it to work. Can you help?
hmmm i have question.. where i can put this code? beside that, we must declare mymap first?
hello Anonymous,
It a step by step exercise, read here: http://android-er.blogspot.com/2012/12/a-simple-example-using-google-maps.html.
excelente me ayudo la linea :)
mapa.setMyLocationEnabled(true);
Post a Comment