sync dropdown keys with address tags from id-tagging-schema

This commit is contained in:
Martin Raifer
2025-04-09 20:46:19 +02:00
parent eff2836427
commit 03a5aa5058
2 changed files with 21 additions and 16 deletions
-10
View File
@@ -134,10 +134,6 @@
["quarter", "neighbourhood"],
["block_number", "housenumber"]
],
"dropdowns": [
"postcode", "province", "county", "city", "suburb",
"quarter", "neighbourhood", "block_number"
],
"widths": {
"postcode": 0.3,
"province": 0.35,
@@ -212,9 +208,6 @@
["neighbourhood"],
["city", "state", "postcode"]
],
"dropdowns": [
"street", "neighbourhood", "city", "state", "postcode"
],
"widths": {
"street": 0.7,
"housenumber": 0.3,
@@ -238,9 +231,6 @@
["housename", "subdistrict"],
["district", "city", "postcode"]
],
"dropdowns": [
"street", "city", "subdistrict", "district", "postcode"
],
"widths": {
"street": 0.7,
"housenumber": 0.3,
+21 -6
View File
@@ -146,11 +146,26 @@ export function uiFieldAddress(field, context) {
}
}
var dropdowns = addressFormat.dropdowns || [
'city', 'county', 'country', 'district', 'hamlet',
'neighbourhood', 'place', 'postcode', 'province',
'quarter', 'state', 'street', 'street+place', 'subdistrict', 'suburb'
];
const dropdowns = new Set([
'block_number',
'city',
'country',
'county',
'district',
'floor',
'hamlet',
'neighbourhood',
'place',
'postcode',
'province',
'quarter',
'state',
'street',
'street+place',
'subdistrict',
'suburb',
'town'
]);
var widths = addressFormat.widths || {
housenumber: 1/5, unit: 1/5, street: 1/2, place: 1/2,
@@ -196,7 +211,7 @@ export function uiFieldAddress(field, context) {
function addDropdown(d) {
if (dropdowns.indexOf(d.id) === -1) return; // not a dropdown
if (!dropdowns.has(d.id)) return; // not a dropdown
var nearValues;
switch (d.id) {