From 052567c28d9285bbd8eb1429a375326444b6a5ff Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Fri, 10 Jul 2020 13:31:01 +0200 Subject: [PATCH] update Fr 10. Jul 13:31:01 CEST 2020 --- server/routing.js | 6 ++++++ views/dbrd.pug | 4 +++- views/overviews/overview_dbrd.pug | 12 ++++++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/server/routing.js b/server/routing.js index 12b51d6..23d60ad 100755 --- a/server/routing.js +++ b/server/routing.js @@ -150,6 +150,8 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, udp, saver title: 'Alarmmonitor', wachen_id: parmeter_id, data_wache: wache.name, + map_tile: app_cfg.public.map_tile, + map_attribution: app_cfg.public.map_attribution, app_id: app_cfg.global.app_id, user: req.user }); @@ -183,6 +185,8 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, udp, saver res.render('overviews/overview_dbrd', { public: app_cfg.public, title: 'Dashboard', + map_tile: app_cfg.public.map_tile, + map_attribution: app_cfg.public.map_attribution, user: req.user, dataSet: data }); @@ -199,6 +203,8 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, udp, saver public: app_cfg.public, title: 'Dashboard', dbrd_uuid: dbrd_uuid, + map_tile: app_cfg.public.map_tile, + map_attribution: app_cfg.public.map_attribution, app_id: app_cfg.global.app_id, user: req.user }); diff --git a/views/dbrd.pug b/views/dbrd.pug index b7bb1e2..d129676 100755 --- a/views/dbrd.pug +++ b/views/dbrd.pug @@ -9,7 +9,9 @@ block content include includes/master_dashboard script(src='/socket.io/socket.io.js') script(src='/js/leaflet.js') - script. + script. dbrd_uuid="#{dbrd_uuid}" + map_tile="#{map_tile}" + map_attribution="#{map_attribution}" client_id="#{app_id}" script(src='/js/client_dbrd.js') \ No newline at end of file diff --git a/views/overviews/overview_dbrd.pug b/views/overviews/overview_dbrd.pug index b3cb3dc..2502f3d 100755 --- a/views/overviews/overview_dbrd.pug +++ b/views/overviews/overview_dbrd.pug @@ -10,7 +10,7 @@ block content .col-12.p-3 .card.bg-dark .card-body.text-center.text-muted - h3 - wählen Sie ein Dashboard - + h3 - Dashboard- - each val, index in dataSet .col-12.col-xl-6.d-flex.align-self-stretch.p-3 .card.w-100 @@ -37,9 +37,8 @@ block content script(src='/js/leaflet.js') script. - // TODO: internen Kartendienst nutzen - // TODO: Kartendienst-Credit anzeigen - // var map_tile = !{JSON.stringify(public.map_tile).replace(/<\//g, '<\\/')} + var map_tile="#{map_tile}" + var map_attribution="#{map_attribution}" var data = !{JSON.stringify(dataSet).replace(/<\//g, '<\\/')} for (var i in data) { // Karte definieren @@ -48,8 +47,9 @@ block content }); // Layer der Karte mapLink = L.tileLayer( - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { - maxZoom: 12 + map_tile, { + maxZoom: 12, + attribution: map_attribution }).addTo(map); // Karte setzen var geojson = L.geoJSON(JSON.parse(data[i].wgs84_area)).addTo(map);