mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:01:16 +01:00
Merge pull request #388 from orangemug/fix/glyph-key-replace
Fix glyph key replace
This commit is contained in:
commit
9c07852b87
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/)) {
|
if (mapStyle.glyphs && mapStyle.glyphs.match(/\.tilehosting\.com/)) {
|
||||||
changedStyle = {
|
const newAccessToken = getAccessToken("openmaptiles", mapStyle, opts);
|
||||||
...changedStyle,
|
if (newAccessToken) {
|
||||||
glyphs: mapStyle.glyphs.replace('{key}', getAccessToken("openmaptiles", mapStyle, opts))
|
changedStyle = {
|
||||||
|
...changedStyle,
|
||||||
|
glyphs: mapStyle.glyphs.replace('{key}', newAccessToken)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue