Fetch id-tagging-schema icons from the bleeding edge as well as the release versions when building data

This commit is contained in:
Quincy Morgan
2020-12-07 15:45:26 -05:00
parent 17cd39a6f7
commit 96d7631a3a
2 changed files with 10 additions and 7 deletions
+9 -7
View File
@@ -88,18 +88,20 @@ function buildData() {
minifyJSON('data/shortcuts.json', 'dist/data/shortcuts.min.json'),
minifyJSON('data/territory_languages.json', 'dist/data/territory_languages.min.json'),
Promise.all([
// Fetch the icons that are needed by the expected tagging schema version
fetch('https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@2/dist/presets.min.json'),
fetch('https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@2/dist/preset_categories.min.json'),
fetch('https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@2/dist/fields.min.json')
fetch('https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@2/dist/fields.min.json'),
// WARNING: we fetch the bleeding edge data too to make sure we're always hosting the
// latest icons, but note that the format could break at any time
fetch('https://raw.githubusercontent.com/openstreetmap/id-tagging-schema/main/dist/presets.min.json'),
fetch('https://raw.githubusercontent.com/openstreetmap/id-tagging-schema/main/dist/preset_categories.min.json'),
fetch('https://raw.githubusercontent.com/openstreetmap/id-tagging-schema/main/dist/fields.min.json')
])
.then(responses => Promise.all(responses.map(response => response.json())))
.then((results) => {
const presets = results[0];
const categories = results[1];
const fields = results[2];
// add icons for presets
[categories, fields, presets].forEach(function(data) {
// compile the icons used by all the presets
results.forEach(function(data) {
for (var key in data) {
var datum = data[key];
// fontawesome icon