mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 16:19:48 +02:00
Fetch id-tagging-schema icons from the bleeding edge as well as the release versions when building data
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user