mirror of
https://github.com/maputnik/editor.git
synced 2025-12-26 16:10:01 +00:00
Only replace glyphs key if a replacement exists.
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