So, let's say you want the radius of the overlay circle to be a fixed size (relative to the screen pixels), for example, 1/10 of the screen width (at current magnification).
// compute width of visible region // get lat-lng of left and right points LatLng left = googleMap.getProjection().getVisibleRegion().farLeft; LatLng right = googleMap.getProjection().getVisibleRegion().farRight; // compute distance between points float[] results = new float[1]; Location.distanceBetween(left.latitude, left.longitude,right.latitude,right.longitude, results); // scale to desired relative radius size float scaledRadius = results[0] * 0.10F; // and use that for radius - taken from OP code and use 'scaledRadius' final GroundOverlay circle = googleMap.addGroundOverlay(new GroundOverlayOptions() .position(latLng, scaledRadius).image(BitmapDescriptorFactory.fromBitmap(bitmap)));
In this example, the width is used as the scale axis, but you can use the height or diagonal (using different projection points).
The use of "far" can be replaced by "near" - it is used to take into account the slope, so you have to experiment.
So, now your resource value is a scaling factor, and not an absolute radius value - therefore, for this example, you should set the resource value to 0.10F and use it where it is hardcoded above.
If you want the impulse (and overlay) to work after / during scaling, you will need to update the overlay circle width (circle.setWidth (scaledRadius)) using the onCameraIdle event - using the same calculation as above for scaledRadius, for example:
public void onCameraIdle() { if (circle != null) {
source share