mirror of
https://github.com/maputnik/editor.git
synced 2026-07-27 08:17:26 +00:00
Special fontstacks.json handling for Tileserver GL
This commit is contained in:
@@ -21,7 +21,12 @@ function loadJSON(url, defaultValue, cb) {
|
|||||||
|
|
||||||
export function downloadGlyphsMetadata(urlTemplate, cb) {
|
export function downloadGlyphsMetadata(urlTemplate, cb) {
|
||||||
if(!urlTemplate) return 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)
|
loadJSON(url, [], cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user