12

I want to decrease the size of the markers when the zoom level of the map is increased. How can I achieve this?

dclipca
  • 1,739
  • 1
  • 16
  • 51

1 Answers1

19

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

Steve Bennett
  • 114,604
  • 39
  • 168
  • 219