First steps at supporting other map tile servers (#7)
This commit is contained in:
1 parent
32f147bdb6
commit
ac67a063c2
5 files changed
+177
-3
No files matched your search
@@ -18,10 +18,12 @@ export const zoom0 = 18;
|
||||
export interface MapScope {
|
||||
center: geoPoint;
|
||||
zoom: number;
|
||||
tileProvider: string;
|
||||
}
|
||||
var initialMapScope: MapScope = {
|
||||
center: { lat: -37.8403508, lon: 77.5539501 },
|
||||
zoom: 15,
|
||||
tileProvider: 'osm',
|
||||
};
|
||||
|
||||
// Derived properties
|
||||
@@ -197,6 +199,9 @@ const mapSlice = createSlice({
|
||||
name: 'map',
|
||||
initialState: initialMapState,
|
||||
reducers: {
|
||||
setTileProvider: (state, action) => {
|
||||
state.scope.tileProvider = action.payload;
|
||||
},
|
||||
resize: (state) => {
|
||||
evaluateStateFromScope(state);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user