From 4a0776ccc94c5f7a62277cb052c1f6afadc4159a Mon Sep 17 00:00:00 2001 From: Sergey Markov Date: Tue, 10 Sep 2024 12:05:58 +0200 Subject: [PATCH] Added 24 limit for maximum zoom Signed-off-by: Sergey Markov --- src/utils/src/map-style-utils/mapbox-gl-style-editor.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/src/map-style-utils/mapbox-gl-style-editor.ts b/src/utils/src/map-style-utils/mapbox-gl-style-editor.ts index d4d12d2f36..ead8c72757 100644 --- a/src/utils/src/map-style-utils/mapbox-gl-style-editor.ts +++ b/src/utils/src/map-style-utils/mapbox-gl-style-editor.ts @@ -167,6 +167,12 @@ export function scaleMapStyleByResolution(mapboxStyle, scale) { // edit minzoom and maxzoom if (d.maxzoom) { d.maxzoom = Math.max(d.maxzoom + zoomOffset, 1); + + // The maximum zoom is 24 + // https://github.com/visgl/react-map-gl/blob/master/docs/api-reference/map.md#maxzoom-number-maxzoom + if (d.maxzoom > 24) { + d.maxzoom = 24; + } } if (d.minzoom) {