I want to decrease the size of the markers when the zoom level of the map is increased. How can I achieve this?
A zoom level or scale is a number that defines how large or small the contents of a map appear in a map view . Scale is a ratio between measurements on a map view and measurements in the real-world.
A bounding box is a mechanism for describing a particular area of a map.
You can use the interpolate
expression with the zoom
expression, along these lines:
"icon-size": ['interpolate', ['linear'], ['zoom'], 10, 1, 15, 0.5]
Documentation here: https://docs.mapbox.com/mapbox-gl-js/style-spec/expressions/#ramps-scales-curves
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