Skip to content

Commit

Permalink
Mye navigering gir error Unhandled promise (#1304)
Browse files Browse the repository at this point in the history
La være å prøve å rendre et kart uten source (gjelder Natursystemene vi ikke får vise)
  • Loading branch information
bjornreppen authored Apr 11, 2019
1 parent 585396f commit b7ccb36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 15 additions & 0 deletions src/Kart/LeafletTangram/scene/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 0 additions & 13 deletions src/Kart/LeafletTangram/scene/visualisering/polygon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit b7ccb36

Please sign in to comment.