Compare commits

..

3 Commits

Author SHA1 Message Date
orangemug
f1ddf4e57e 1.5.0-beta3 2018-09-03 21:17:50 +01:00
Orange Mug
64e65dc7d3 Merge pull request #377 from orangemug/fix/glyphs-for-tilehosting
Updated regex to tilehosting.com
2018-09-03 21:15:01 +01:00
orangemug
1e07a88aed Updated regex to tilehosting.com, partial revert of #367 2018-09-03 21:02:38 +01:00
3 changed files with 9 additions and 5 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "maputnik",
"version": "1.5.0-beta2",
"version": "1.5.0-beta3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "maputnik",
"version": "1.5.0-beta2",
"version": "1.5.0-beta3",
"description": "A MapboxGL visual style editor",
"main": "''",
"scripts": {

View File

@@ -92,9 +92,6 @@ function replaceSourceAccessToken(mapStyle, sourceName, opts={}) {
...mapStyle,
sources: changedSources
}
if (mapStyle.glyphs) {
changedStyle.glyphs = changedStyle.glyphs.replace('{key}', accessToken)
}
return changedStyle
}
@@ -105,6 +102,13 @@ function replaceAccessTokens(mapStyle, 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
}