From d649ba99ed333f4494949560a9b408b8cf1e8a1b Mon Sep 17 00:00:00 2001 From: efarooqui Date: Wed, 7 Oct 2020 17:41:09 -0700 Subject: [PATCH] Configuring maxbounds in config to allow pan to not snap out of center --- src/components/Map.jsx | 1 + src/store/initial.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Map.jsx b/src/components/Map.jsx index c0ab746..9271841 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -78,6 +78,7 @@ class Map extends React.Component { * Creates a Leaflet map and a tilelayer for the map background */ const { map: mapConf } = this.props.app + console.info(mapConf.maxBounds) const map = L.map(this.props.ui.dom.map) .setView(mapConf.anchor, mapConf.startZoom) diff --git a/src/store/initial.js b/src/store/initial.js index 7aa4090..8c2cfd6 100644 --- a/src/store/initial.js +++ b/src/store/initial.js @@ -48,8 +48,8 @@ const initial = { map: { anchor: [31.356397, 34.784818], startZoom: 11, - minZoom: 0, - maxZoom: 20, + minZoom: 2, + maxZoom: 16, bounds: null, maxBounds: [[180, -180], [-180, 180]], clusterRadius: 30