Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show blue dots icon on current location Google Maps

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

like image 299
Leonard Febrianto Avatar asked May 25 '15 14:05

Leonard Febrianto


1 Answers

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

like image 166
bjiang Avatar answered Oct 11 '22 07:10

bjiang