aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/core/MapView.js
diff options
context:
space:
mode:
authorBoubrid Ihab <boubrid.ihab@gmail.com>2022-06-21 23:59:43 +0100
committerBoubrid Ihab <boubrid.ihab@gmail.com>2022-06-21 23:59:43 +0100
commit0e1686decab32ebed5b7af3e37d381ad8b5ee5c4 (patch)
tree7053ce6c0ea051f6b77f1966d0dc418f1094a9da /modern/src/map/core/MapView.js
parented45e941141c7ea2f0fc767946e23e476546c67d (diff)
downloadtrackermap-web-0e1686decab32ebed5b7af3e37d381ad8b5ee5c4.tar.gz
trackermap-web-0e1686decab32ebed5b7af3e37d381ad8b5ee5c4.tar.bz2
trackermap-web-0e1686decab32ebed5b7af3e37d381ad8b5ee5c4.zip
check if maxZoom has value before using it
Diffstat (limited to 'modern/src/map/core/MapView.js')
-rw-r--r--modern/src/map/core/MapView.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/modern/src/map/core/MapView.js b/modern/src/map/core/MapView.js
index 38191a94..98865157 100644
--- a/modern/src/map/core/MapView.js
+++ b/modern/src/map/core/MapView.js
@@ -81,7 +81,9 @@ const MapView = ({ children }) => {
const maxZoom = useAttributePreference('web.maxZoom');
useEffect(() => {
- map.setMaxZoom(maxZoom);
+ if (maxZoom) {
+ map.setMaxZoom(maxZoom);
+ }
}, [maxZoom]);
useEffect(() => {