fixes preferredMapStyleIndex
This commit is contained in:
@@ -461,10 +461,14 @@
|
|||||||
"https://basemaps.cartocdn.com/dark_all/1/0/0@2x.png",
|
"https://basemaps.cartocdn.com/dark_all/1/0/0@2x.png",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const preferredMapStyleIndex = mapStyles.findIndex(
|
let preferredMapStyleIndex = mapStyles.findIndex(
|
||||||
(s) => s.text === localStorage.getItem("layer"),
|
(s) => s.text === localStorage.getItem("layer"),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if(preferredMapStyleIndex == -1) {
|
||||||
|
preferredMapStyleIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
const finalMapOptions: M.MapOptions = {
|
const finalMapOptions: M.MapOptions = {
|
||||||
...{
|
...{
|
||||||
container: mapContainer,
|
container: mapContainer,
|
||||||
|
|||||||
Reference in New Issue
Block a user