Code example for LatLngBounds

Methods: contains

0
mListener.onLocationChanged( location );
 
            LatLngBounds bounds = this.map.getProjection().getVisibleRegion().latLngBounds;
 
            if(!bounds.contains(new LatLng(location.getLatitude(), location.getLongitude())))
            { 
                //Move the camera to the user's location once it's available! 
                map.animateCamera(CameraUpdateFactory.newLatLng(new LatLng(location.getLatitude(), location.getLongitude())));
            } 
        } 
    } 
 
    @Override 
    public void onStatusChanged(String provider, int status, Bundle extras) {
    } 
 
    @Override 
    public void onProviderEnabled(String provider) {
    } 
Experience pair programming with AI  Get Codota for Java