mirror of
https://github.com/maputnik/editor.git
synced 2026-01-08 06:20:00 +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/)) {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user