Skip to content

Commit

Permalink
added multiple tileLayer subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
Eskild Skov Pedersen committed Oct 2, 2020
1 parent 54f5957 commit 90d8776
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const localStorage = window.localStorage
const map = L.map('map', { zoomControl: false })
const attributionKartverket =
'<a href="http://www.kartverket.no/">Kartverket</a>'
const subdomainsKartverket = ['opencache', 'opencache2', 'opencache3']

const attributionNVE = '<a href="https://www.nve.no/">NVE</a>'

// hack: https://github.com/makinacorpus/Leaflet.FileLayer/issues/60
Expand All @@ -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
}
)

Expand Down

0 comments on commit 90d8776

Please sign in to comment.