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 } )