Show blue dots icon on current location Google Maps
28,045
You need to do as following:
GoogleMap myMap;
myMap.setMyLocationEnabled(true);
You can get all sample project code on my github here and try yourself:)
Author by
Leonard Febrianto
Updated on March 11, 2021Comments
-
Leonard Febrianto over 3 years
I'm getting confused when my blue dot icon is dissapeared. The past is i can show the blue dot icon. But now it just zoom the camera on my current location without blue dot icon.
Here is my code:
private void handleNewLocation(Location location) { Log.d(TAG, location.toString()); double currentLatitude = location.getLatitude(); double currentLongitude = location.getLongitude(); LatLng latLng = new LatLng(currentLatitude, currentLongitude); mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng)); mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 21)); }
-
bjiang about 9 yearsDoes this help for you? If so, please accept, thanks
-
Sethuraman Srinivasan over 5 yearsIs it possible to increase the size of this icon?