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:)

Share:
28,045
Leonard Febrianto
Author by

Leonard Febrianto

Updated on March 11, 2021

Comments

  • Leonard Febrianto
    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));
      }
    

    enter image description here

  • bjiang
    bjiang about 9 years
    Does this help for you? If so, please accept, thanks
  • Sethuraman Srinivasan
    Sethuraman Srinivasan over 5 years
    Is it possible to increase the size of this icon?