fix: prevent ReferenceError and avoid loading local config layers for non-default projects to avoid wrong project startup zoom
Deploy Standortplaner / deploy (push) Successful in 17s
Details
Deploy Standortplaner / deploy (push) Successful in 17s
Details
This commit is contained in:
parent
a92b054645
commit
330a7a5a0a
12
app.js
12
app.js
|
|
@ -1208,6 +1208,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
};
|
||||
|
||||
try {
|
||||
const projId = getProjektId();
|
||||
|
||||
// Priority 1: Use globalThis.BAKED_DATA if available (Standalone Mode)
|
||||
if (globalThis.BAKED_DATA) {
|
||||
// Support both old format (direct layers) and new format (with mapping/statuses)
|
||||
|
|
@ -1222,14 +1224,16 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
}
|
||||
|
||||
// Priority 2: Use globalThis.LAYER_CONFIG (Script-based config) or remote config
|
||||
const layers = await resolveLayerConfig(isLocalFile, statusEl);
|
||||
if (layers) {
|
||||
await loadConfigLayers(layers);
|
||||
// Only load local config layers if the project is the default (bwsamern-ohne)
|
||||
if (projId.toLowerCase() === 'bwsamern-ohne') {
|
||||
const layers = await resolveLayerConfig(isLocalFile, statusEl);
|
||||
if (layers) {
|
||||
await loadConfigLayers(layers);
|
||||
}
|
||||
}
|
||||
|
||||
// ALKIS aus Datenbank IMMER laden
|
||||
console.log("Lade ALKIS-Layer aus Datenbank...");
|
||||
const projId = getProjektId();
|
||||
const alkisResp = await fetch(`/api/layers/alkis?project=${encodeURIComponent(projId)}`).catch(err => {
|
||||
console.error("Netzwerkfehler beim Laden des ALKIS-Layers:", err);
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue