mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 18:21:17 +01:00
Merge pull request #377 from orangemug/fix/glyphs-for-tilehosting
Updated regex to tilehosting.com
This commit is contained in:
commit
64e65dc7d3
1 changed files with 7 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue