mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:21:18 +01:00
Only replace glyphs key if a replacement exists.
This commit is contained in:
parent
805133d10c
commit
7d0a985f1d
1 changed files with 6 additions and 3 deletions
|
@ -102,9 +102,12 @@ function replaceAccessTokens(mapStyle, opts={}) {
|
|||
})
|
||||
|
||||
if (mapStyle.glyphs && mapStyle.glyphs.match(/\.tilehosting\.com/)) {
|
||||
const newAccessToken = getAccessToken("openmaptiles", mapStyle, opts);
|
||||
if (newAccessToken) {
|
||||
changedStyle = {
|
||||
...changedStyle,
|
||||
glyphs: mapStyle.glyphs.replace('{key}', getAccessToken("openmaptiles", mapStyle, opts))
|
||||
glyphs: mapStyle.glyphs.replace('{key}', newAccessToken)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue