mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:11:15 +01:00
Added additional guard
As checking the key name is 'openmaptiles' isn't a guarantee
This commit is contained in:
parent
5ce57d0803
commit
7d5927bbc8
1 changed files with 1 additions and 0 deletions
|
@ -57,6 +57,7 @@ function indexOfLayer(layers, layerId) {
|
|||
function replaceAccessToken(mapStyle) {
|
||||
const omtSource = mapStyle.sources.openmaptiles
|
||||
if(!omtSource) return mapStyle
|
||||
if(!omtSource.hasOwnProperty("url")) return mapStyle
|
||||
|
||||
const metadata = mapStyle.metadata || {}
|
||||
const accessToken = metadata['maputnik:openmaptiles_access_token'] || tokens.openmaptiles
|
||||
|
|
Loading…
Reference in a new issue