Fix preset field validation during data build

Fix amenity/photo_booth preset
This commit is contained in:
Quincy Morgan
2019-02-19 08:32:42 -05:00
parent 9c2dd6d5bc
commit 3629f6b5b8
4 changed files with 9 additions and 9 deletions

View File

@@ -493,9 +493,11 @@ function validatePresetFields(presets, fields) {
var preset = presets[presetID];
// the keys for properties that contain arrays of field ids
var fieldKeys = ['fields', 'moreFields'];
for (var fieldsKey in fieldKeys) {
for (var fieldsKeyIndex in fieldKeys) {
var fieldsKey = fieldKeys[fieldsKeyIndex];
if (preset[fieldsKey]) {
for (var field in preset[fieldsKey]) {
for (var fieldIndex in preset[fieldsKey]) {
var field = preset[fieldsKey][fieldIndex];
if (fields[field] === undefined) {
var regexResult = betweenBracketsRegex.exec(field);
if (regexResult) {

View File

@@ -126,7 +126,7 @@
"amenity/payment_centre": {"icon": "maki-bank", "fields": ["name", "brand", "address", "building_area", "opening_hours", "payment_multi"], "moreFields": ["currency_multi", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "terms": ["check", "tax pay", "bill pay", "currency", "finance", "cash", "money"], "tags": {"amenity": "payment_centre"}, "name": "Payment Center"},
"amenity/payment_terminal": {"icon": "maki-bank", "fields": ["name", "brand", "address", "opening_hours", "payment_multi"], "moreFields": ["currency_multi", "wheelchair"], "geometry": ["point"], "terms": ["interactive kiosk", "ekiosk", "atm", "bill pay", "tax pay", "phone pay", "finance", "cash", "money transfer", "card"], "tags": {"amenity": "payment_terminal"}, "name": "Payment Terminal"},
"amenity/pharmacy": {"icon": "maki-pharmacy", "fields": ["name", "operator", "address", "building_area", "drive_through", "dispensing"], "moreFields": ["opening_hours", "payment_multi", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "tags": {"amenity": "pharmacy"}, "addTags": {"amenity": "pharmacy", "healthcare": "pharmacy"}, "removeTags": {"amenity": "pharmacy", "healthcare": "pharmacy"}, "reference": {"key": "amenity", "value": "pharmacy"}, "terms": ["apothecary", "drug store", "drugstore", "med*", "prescription"], "name": "Pharmacy Counter"},
"amenity/photo_booth": {"icon": "camera", "fields": ["payment_types", "operator", "wheelchair"], "geometry": ["point", "area"], "terms": ["photobooth", "photo", "booth", "kiosk", "camera"], "tags": {"amenity": "photo_booth"}, "name": "Photo Booth"},
"amenity/photo_booth": {"icon": "maki-attraction", "fields": ["name", "operator", "payment_multi", "wheelchair"], "geometry": ["point", "area"], "terms": ["photobooth", "photo", "booth", "kiosk", "camera"], "tags": {"amenity": "photo_booth"}, "name": "Photo Booth"},
"amenity/place_of_worship": {"icon": "maki-place-of-worship", "fields": ["name", "religion", "denomination", "address", "building_area", "service_times"], "moreFields": ["opening_hours", "internet_access", "internet_access/ssid", "website", "phone", "email", "fax", "wheelchair"], "geometry": ["point", "area"], "terms": ["abbey", "basilica", "bethel", "cathedral", "chancel", "chantry", "chapel", "church", "fold", "house of God", "house of prayer", "house of worship", "minster", "mission", "mosque", "oratory", "parish", "sacellum", "sanctuary", "shrine", "synagogue", "tabernacle", "temple"], "tags": {"amenity": "place_of_worship"}, "name": "Place of Worship"},
"amenity/place_of_worship/buddhist": {"icon": "maki-religious-buddhist", "fields": ["name", "religion", "denomination", "building_area", "address", "service_times"], "geometry": ["point", "area"], "terms": ["stupa", "vihara", "monastery", "temple", "pagoda", "zendo", "dojo"], "tags": {"amenity": "place_of_worship", "religion": "buddhist"}, "reference": {"key": "amenity", "value": "place_of_worship"}, "name": "Buddhist Temple"},
"amenity/place_of_worship/christian": {"icon": "maki-religious-christian", "fields": ["name", "religion", "denomination", "building_area", "address", "service_times"], "geometry": ["point", "area"], "terms": ["christian", "abbey", "basilica", "bethel", "cathedral", "chancel", "chantry", "chapel", "fold", "house of God", "house of prayer", "house of worship", "minster", "mission", "oratory", "parish", "sacellum", "sanctuary", "shrine", "tabernacle", "temple"], "tags": {"amenity": "place_of_worship", "religion": "christian"}, "reference": {"key": "amenity", "value": "place_of_worship"}, "name": "Christian Church"},

View File

@@ -1,8 +1,9 @@
{
"icon": "camera",
"icon": "maki-attraction",
"fields": [
"payment_types",
"name",
"operator",
"payment_multi",
"wheelchair"
],
"geometry": [
@@ -21,6 +22,3 @@
},
"name": "Photo Booth"
}

View File

@@ -129,7 +129,7 @@
{"key": "amenity", "value": "payment_centre", "description": "🄿 Payment Center", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/bank-15.svg?sanitize=true"},
{"key": "amenity", "value": "payment_terminal", "description": "🄿 Payment Terminal", "object_types": ["node"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/bank-15.svg?sanitize=true"},
{"key": "amenity", "value": "pharmacy", "description": "🄿 Pharmacy Counter", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/pharmacy-15.svg?sanitize=true"},
{"key": "amenity", "value": "photo_booth", "description": "🄿 Photo Booth", "object_types": ["node", "area"]},
{"key": "amenity", "value": "photo_booth", "description": "🄿 Photo Booth", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/attraction-15.svg?sanitize=true"},
{"key": "amenity", "value": "place_of_worship", "description": "🄿 Place of Worship", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/place-of-worship-15.svg?sanitize=true"},
{"key": "religion", "value": "buddhist", "description": "🄿 Buddhist Temple", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/religious-buddhist-15.svg?sanitize=true"},
{"key": "religion", "value": "christian", "description": "🄿 Christian Church", "object_types": ["node", "area"], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/religious-christian-15.svg?sanitize=true"},