mirror of
https://github.com/maputnik/editor.git
synced 2025-12-24 23:20:00 +00:00
Added additional guard
As checking the key name is 'openmaptiles' isn't a guarantee
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user