mirror of
https://github.com/maputnik/editor.git
synced 2026-02-01 10:10:01 +00:00
Merge pull request #388 from orangemug/fix/glyph-key-replace
Fix glyph key replace
This commit is contained in:
@@ -102,9 +102,12 @@ function replaceAccessTokens(mapStyle, opts={}) {
|
||||
})
|
||||
|
||||
if (mapStyle.glyphs && mapStyle.glyphs.match(/\.tilehosting\.com/)) {
|
||||
changedStyle = {
|
||||
...changedStyle,
|
||||
glyphs: mapStyle.glyphs.replace('{key}', getAccessToken("openmaptiles", mapStyle, opts))
|
||||
const newAccessToken = getAccessToken("openmaptiles", mapStyle, opts);
|
||||
if (newAccessToken) {
|
||||
changedStyle = {
|
||||
...changedStyle,
|
||||
glyphs: mapStyle.glyphs.replace('{key}', newAccessToken)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user