Android: How do I set the zoom level of map view to 1 km radius around my current location?

although this answer is logical and i find it working but the results are not accurate i dont know why but i tired this approach and this technique is far more accurate.

1) Make a circle on object with desired radius

Circle circle = mGoogleMap.addCircle(new CircleOptions().center(new LatLng(latitude, longitude)).radius(getRadiusInMeters()).strokeColor(Color.RED));           
        circle.setVisible(true);
        getZoomLevel(circle);

2) Pass that object to this function and set the zoom level
Here’s a link

public int getZoomLevel(Circle circle) {
if (circle != null){
    double radius = circle.getRadius();
    double scale = radius / 500;
    zoomLevel =(int) (16 - Math.log(scale) / Math.log(2));
}
return zoomLevel;
}

Leave a Comment