mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-28 23:40:23 +01:00
Special fontstacks.json handling for Tileserver GL
This commit is contained in:
parent
e5fbe3b74a
commit
404b53587f
1 changed files with 6 additions and 1 deletions
|
@ -21,7 +21,12 @@ function loadJSON(url, defaultValue, cb) {
|
|||
|
||||
export function downloadGlyphsMetadata(urlTemplate, cb) {
|
||||
if(!urlTemplate) return cb([])
|
||||
const url = urlTemplate.replace('{fontstack}/{range}.pbf', 'fontstacks.json')
|
||||
|
||||
// Special handling because Tileserver GL serves the fontstacks metadata differently
|
||||
// https://github.com/klokantech/tileserver-gl/pull/104
|
||||
let url = urlTemplate.replace('/fonts/{fontstack}/{range}.pbf', '/fontstacks.json')
|
||||
url = url.replace('{fontstack}/{range}.pbf', 'fontstacks.json')
|
||||
|
||||
loadJSON(url, [], cb)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue