mirror of
https://github.com/maputnik/editor.git
synced 2026-06-30 02:57:26 +00:00
Updated regex to tilehosting.com, partial revert of #367
This commit is contained in:
+7
-3
@@ -92,9 +92,6 @@ function replaceSourceAccessToken(mapStyle, sourceName, opts={}) {
|
|||||||
...mapStyle,
|
...mapStyle,
|
||||||
sources: changedSources
|
sources: changedSources
|
||||||
}
|
}
|
||||||
if (mapStyle.glyphs) {
|
|
||||||
changedStyle.glyphs = changedStyle.glyphs.replace('{key}', accessToken)
|
|
||||||
}
|
|
||||||
return changedStyle
|
return changedStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +102,13 @@ function replaceAccessTokens(mapStyle, opts={}) {
|
|||||||
changedStyle = replaceSourceAccessToken(changedStyle, sourceName, opts);
|
changedStyle = replaceSourceAccessToken(changedStyle, sourceName, opts);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (mapStyle.glyphs && mapStyle.glyphs.match(/\.tilehosting\.com/)) {
|
||||||
|
changedStyle = {
|
||||||
|
...changedStyle,
|
||||||
|
glyphs: mapStyle.glyphs.replace('{key}', getAccessToken("openmaptiles", mapStyle, opts))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return changedStyle
|
return changedStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user