How can we implement tracking mode on Google Map?

455 views Asked by At

When I try to implement user tracking mode(like ios) on google map, the mode tracks to user we she/he moves along way, I could not find any documentation on its official side.Which method provides like picture2?

My map's settings as below code snippet

@Override
public void onMapReady(GoogleMap googleMap)
{
    this.googleMap = googleMap;

    googleMap.setMyLocationEnabled(true);
    googleMap.getUiSettings().setMapToolbarEnabled(false);
    googleMap.getUiSettings().setZoomControlsEnabled(false);
    googleMap.setOnMarkerClickListener(this);
}

When I triggers to focus on user current location

//there exist current Location
googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(currentLatitude,currentLongitude),16));

The output behaves like picture 1 , not picture 2.

picture1

picture2

0

There are 0 answers