aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/common/attributes/useCommonUserAttributes.js4
-rw-r--r--modern/src/map/core/MapView.js7
2 files changed, 9 insertions, 2 deletions
diff --git a/modern/src/common/attributes/useCommonUserAttributes.js b/modern/src/common/attributes/useCommonUserAttributes.js
index da19885e..1409c5ac 100644
--- a/modern/src/common/attributes/useCommonUserAttributes.js
+++ b/modern/src/common/attributes/useCommonUserAttributes.js
@@ -64,12 +64,12 @@ export default (t) => useMemo(() => ({
'web.selectZoom': {
name: t('attributeWebSelectZoom'),
type: 'number',
- },
+ }, */
'web.maxZoom': {
name: t('attributeWebMaxZoom'),
type: 'number',
},
- 'ui.hidePositionAttributes': {
+ /* 'ui.hidePositionAttributes': {
name: t('attributeUiHidePositionAttributes'),
type: 'string',
}, */
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;