Adding a check to reevaluate the map if min/max zoom levels are different in choosen tile servers.
This commit is contained in:
parent
59fbe4aa3f
commit
d71881dc02
|
@ -212,6 +212,12 @@ const mapSlice = createSlice({
|
||||||
reducers: {
|
reducers: {
|
||||||
setTileProvider: (state, action) => {
|
setTileProvider: (state, action) => {
|
||||||
state.scope.tileProvider = action.payload;
|
state.scope.tileProvider = action.payload;
|
||||||
|
if (
|
||||||
|
state.tiles.zoom < tileProviders[state.scope.tileProvider].minZoom ||
|
||||||
|
state.tiles.zoom > tileProviders[state.scope.tileProvider].maxZoom
|
||||||
|
) {
|
||||||
|
evaluateStateFromScope(state);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
resize: (state) => {
|
resize: (state) => {
|
||||||
evaluateStateFromScope(state);
|
evaluateStateFromScope(state);
|
||||||
|
|
Loading…
Reference in New Issue