aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/core/MapView.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-06-21 16:24:36 -0700
committerGitHub <noreply@github.com>2022-06-21 16:24:36 -0700
commit9f03571e5c6bd532ac177615066f830e1c8939e3 (patch)
treecbbb1c03fe639ca7e043b636f5e1e31c387c629e /modern/src/map/core/MapView.js
parent6360be5047ef7a932522113e7c51b6f265d8d9b7 (diff)
parent0e1686decab32ebed5b7af3e37d381ad8b5ee5c4 (diff)
downloadtrackermap-web-9f03571e5c6bd532ac177615066f830e1c8939e3.tar.gz
trackermap-web-9f03571e5c6bd532ac177615066f830e1c8939e3.tar.bz2
trackermap-web-9f03571e5c6bd532ac177615066f830e1c8939e3.zip
Merge pull request #966 from BIhab/add-maxzoom-feature
feature: max zoom on map
Diffstat (limited to 'modern/src/map/core/MapView.js')
-rw-r--r--modern/src/map/core/MapView.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/modern/src/map/core/MapView.js b/modern/src/map/core/MapView.js
index 20e84185..98865157 100644
--- a/modern/src/map/core/MapView.js
+++ b/modern/src/map/core/MapView.js
@@ -78,6 +78,13 @@ const MapView = ({ children }) => {
const [activeMapStyles] = usePersistedState('activeMapStyles', ['locationIqStreets', 'osm', 'carto']);
const [defaultMapStyle] = usePersistedState('selectedMapStyle', 'locationIqStreets');
const mapboxAccessToken = useAttributePreference('mapboxAccessToken');
+ const maxZoom = useAttributePreference('web.maxZoom');
+
+ useEffect(() => {
+ if (maxZoom) {
+ map.setMaxZoom(maxZoom);
+ }
+ }, [maxZoom]);
useEffect(() => {
maplibregl.accessToken = mapboxAccessToken;