mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Fix missing default map layer when user settings are not set
This commit is contained in:
parent
cde5af7c24
commit
d3aa3bd067
2 changed files with 11 additions and 2 deletions
|
|
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- Fixed a bug where user could not be deleted due to counter cache on points. #1818
|
||||
- Introduce apt-get upgrade before installing new packages in the docker image to prevent vulnerabilities. #1793
|
||||
- Fixed time shift when creating visits manually. #1679
|
||||
- Provide default map layer if user settings are not set.
|
||||
|
||||
# [0.33.0] - 2025-09-29
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,17 @@ export function createAllMapLayers(map, selectedLayerName, selfHosted) {
|
|||
const layers = {};
|
||||
const mapsConfig = selfHosted === "true" ? rasterMapsConfig : vectorMapsConfig;
|
||||
|
||||
// Determine the default layer based on self-hosted mode
|
||||
const defaultLayerName = selfHosted === "true" ? "OpenStreetMap" : "Light";
|
||||
|
||||
// If selectedLayerName is null/undefined or doesn't exist in config, use default
|
||||
const layerToSelect = selectedLayerName && mapsConfig[selectedLayerName]
|
||||
? selectedLayerName
|
||||
: defaultLayerName;
|
||||
|
||||
Object.keys(mapsConfig).forEach(layerKey => {
|
||||
// Create the layer and add it to the map if it's the user's selected layer
|
||||
const layer = createMapLayer(map, selectedLayerName, layerKey, selfHosted);
|
||||
// Create the layer and add it to the map if it's the selected/default layer
|
||||
const layer = createMapLayer(map, layerToSelect, layerKey, selfHosted);
|
||||
layers[layerKey] = layer;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue