diff options
author | Boubrid Ihab <boubrid.ihab@gmail.com> | 2022-06-21 23:59:43 +0100 |
---|---|---|
committer | Boubrid Ihab <boubrid.ihab@gmail.com> | 2022-06-21 23:59:43 +0100 |
commit | 0e1686decab32ebed5b7af3e37d381ad8b5ee5c4 (patch) | |
tree | 7053ce6c0ea051f6b77f1966d0dc418f1094a9da /modern/src/map/core/MapView.js | |
parent | ed45e941141c7ea2f0fc767946e23e476546c67d (diff) | |
download | trackermap-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.js | 4 |
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(() => { |