feat: public/config.json

This commit is contained in:
ISA
2025-08-20 14:45:47 +02:00
parent 22692f8153
commit d68b17c382
5 changed files with 11 additions and 6 deletions

View File

@@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=true
# z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen # z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen
# basePath wird jetzt in public/config.json gepflegt # basePath wird jetzt in public/config.json gepflegt
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.1.327 NEXT_PUBLIC_APP_VERSION=1.1.328

View File

@@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=false
# basePath wird jetzt in public/config.json gepflegt # basePath wird jetzt in public/config.json gepflegt
# App-Versionsnummer # App-Versionsnummer
NEXT_PUBLIC_APP_VERSION=1.1.327 NEXT_PUBLIC_APP_VERSION=1.1.328

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "nodemap", "name": "nodemap",
"version": "1.1.327", "version": "1.1.328",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "nodemap", "name": "nodemap",
"version": "1.1.327", "version": "1.1.328",
"dependencies": { "dependencies": {
"@emotion/react": "^11.13.3", "@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0", "@emotion/styled": "^11.13.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "nodemap", "name": "nodemap",
"version": "1.1.327", "version": "1.1.328",
"dependencies": { "dependencies": {
"@emotion/react": "^11.13.3", "@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0", "@emotion/styled": "^11.13.0",

View File

@@ -13,7 +13,8 @@ export const initializeMap = (
setPolylineEventsDisabled, setPolylineEventsDisabled,
logError = false logError = false
) => { ) => {
const basePath = process.env.NEXT_PUBLIC_BASE_PATH; // basePath wird aus config.json geladen (siehe unten)
let basePath = undefined;
if ( if (
!mapContainer || !mapContainer ||
@@ -80,6 +81,10 @@ export const initializeMap = (
} }
} }
if (config) { if (config) {
// basePath aus config.json
if (typeof config.basePath === "string") {
basePath = config.basePath;
}
// Tile source // Tile source
if (config.tileSources && config.active && config.tileSources[config.active]) { if (config.tileSources && config.active && config.tileSources[config.active]) {
const tileSource = config.tileSources[config.active]; const tileSource = config.tileSources[config.active];