I have lot of markers on my map. Zooming in each marker shows me a position. but zooming out the markers are overlapping each other and it is more difficult do determine the position of a marker.
Is there a way to scale the marker image depending on the zoom factor?
You can change the zoom level of the map using simple steps. Step 1 Go to Add or Edit Map page . Step 2 Select 'Default zoom level' in the 'Map Information section'. Step 3 click save map and see the changes.
The shortcut is simple: just double-tap the maps interface, but instead of lifting your finger after the second tap (the shortcut for zooming in), you leave it touching the screen. Then a swipe up zooms out, and a swipe down zooms in.
Depends on how you draw your marker. If your marker is just a bitmap/drawable, simply use matrix.postScale()
Matrix matrix = new Matrix();
matrix.postScale(2f, 2f); // douple the size
canvas.drawBitmap(mBitmap, matrix, mPaint);
Markers do not change size based on zoom. Use GroundOverlays if you desire this effect. src
GoogleMap map = ...; // get a map.
BitmapDescriptor image = ...; // get an image.
LatLngBounds bounds = ...; // get a bounds
// Adds a ground overlay with 50% transparency.
GroundOverlay groundOverlay = map.addGroundOverlay(new GroundOverlayOptions()
.image(image)
.positionFromBounds(bounds)
.transparency(0.5));
A ground overlay is an image that is fixed to a map and scales with the map zoom. Please see the API for more info
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With