From 90d87761457c35826a57429517e91b78eaf8395d Mon Sep 17 00:00:00 2001 From: Eskild Skov Pedersen Date: Fri, 2 Oct 2020 21:13:20 +0200 Subject: [PATCH] added multiple tileLayer subdomains --- src/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 651ce08..17001ee 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,8 @@ const localStorage = window.localStorage const map = L.map('map', { zoomControl: false }) const attributionKartverket = 'Kartverket' +const subdomainsKartverket = ['opencache', 'opencache2', 'opencache3'] + const attributionNVE = 'NVE' // hack: https://github.com/makinacorpus/Leaflet.FileLayer/issues/60 @@ -28,16 +30,18 @@ let activeOverlay let selectedRouteLayer const rasterBaseMap = L.tileLayer( - 'https://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=toporaster4&zoom={z}&x={x}&y={y}', + 'https://{s}.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=toporaster4&zoom={z}&x={x}&y={y}', { - attribution: attributionKartverket + attribution: attributionKartverket, + subdomains: subdomainsKartverket } ) const vectorBaseMap = L.tileLayer( - 'https://opencache.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}', + 'https://{s}.statkart.no/gatekeeper/gk/gk.open_gmaps?layers=topo4&zoom={z}&x={x}&y={y}', { - attribution: attributionKartverket + attribution: attributionKartverket, + subdomains: subdomainsKartverket } )