From b7ccb36fbc8c863eee0e25e1cd9d31829c041b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Reppen?= Date: Thu, 11 Apr 2019 13:25:51 +0200 Subject: [PATCH] Mye navigering gir error Unhandled promise (#1304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La være å prøve å rendre et kart uten source (gjelder Natursystemene vi ikke får vise) --- src/Kart/LeafletTangram/scene/index.js | 15 +++++++++++++++ .../LeafletTangram/scene/visualisering/polygon.js | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Kart/LeafletTangram/scene/index.js b/src/Kart/LeafletTangram/scene/index.js index 69df267df..f104c9929 100644 --- a/src/Kart/LeafletTangram/scene/index.js +++ b/src/Kart/LeafletTangram/scene/index.js @@ -52,7 +52,22 @@ function opprettAktivtLag(lag, opplyst, config, viserKatalog) { } } +function sladd(url) { + if (!url) return false; + if (url.indexOf("Regional_naturvariasjon") >= 0) return false; + if (url.indexOf("Erosjon") >= 0) return false; + if (url.indexOf("Finmat") >= 0) return false; + if (url.indexOf("Sediment") >= 0) return false; + if (url.indexOf("Ultrama") >= 0) return false; + if (url.indexOf("Kalk") >= 0) return false; + if (url.indexOf("Natur_i_Norge/Natursystem") >= 0) return true; + return false; +} + function opprettEttLag(drawArgs, config) { + // MDIR-sladden + if (sladd(drawArgs.url)) return {}; + const renderer = draw[drawArgs.aktivtFormat]; const format = drawArgs.format[drawArgs.aktivtFormat]; drawArgs.format = format; diff --git a/src/Kart/LeafletTangram/scene/visualisering/polygon.js b/src/Kart/LeafletTangram/scene/visualisering/polygon.js index 3311193e1..97dbd6e22 100644 --- a/src/Kart/LeafletTangram/scene/visualisering/polygon.js +++ b/src/Kart/LeafletTangram/scene/visualisering/polygon.js @@ -79,20 +79,7 @@ function draw(args) { } function lagSource({ url, zoom }, { bbox }) { - if (sladd(url)) return {}; return sysconfig.createTileSource(url, "MVT", zoom, bbox); } -// MDIR-sladden -function sladd(url) { - if (url.indexOf("Regional_naturvariasjon") >= 0) return false; - if (url.indexOf("Erosjon") >= 0) return false; - if (url.indexOf("Finmat") >= 0) return false; - if (url.indexOf("Sediment") >= 0) return false; - if (url.indexOf("Ultrama") >= 0) return false; - if (url.indexOf("Kalk") >= 0) return false; - if (url.indexOf("Natur_i_Norge/Natursystem") >= 0) return true; - return false; -} - export default { drawAll, lagSource };