mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 17:52:55 +00:00
Make field reference more flexible
Will need to support {"rtype": "restriction"} for turn
restriction field.
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
"bicycle",
|
||||
"horse"
|
||||
],
|
||||
"referenceKey": "access",
|
||||
"reference": {
|
||||
"key": "access"
|
||||
},
|
||||
"type": "access",
|
||||
"label": "Access",
|
||||
"placeholder": "Unknown",
|
||||
@@ -66,7 +68,9 @@
|
||||
"addr:city",
|
||||
"addr:postcode"
|
||||
],
|
||||
"referenceKey": "addr",
|
||||
"reference": {
|
||||
"key": "addr"
|
||||
},
|
||||
"icon": "address",
|
||||
"universal": true,
|
||||
"label": "Address",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"keys": ["access", "foot", "motor_vehicle", "bicycle", "horse"],
|
||||
"referenceKey": "access",
|
||||
"reference": {"key": "access"},
|
||||
"type": "access",
|
||||
"label": "Access",
|
||||
"placeholder": "Unknown",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"addr:city",
|
||||
"addr:postcode"
|
||||
],
|
||||
"referenceKey": "addr",
|
||||
"reference": {"key": "addr"},
|
||||
"icon": "address",
|
||||
"universal": true,
|
||||
"label": "Address",
|
||||
|
||||
@@ -14,9 +14,35 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"referenceKey": {
|
||||
"description": "Tag key which should be used to get taginfo documentation for (to be used when a field manages multiple tags)",
|
||||
"type": "string"
|
||||
"reference": {
|
||||
"description": "Taginfo documentation parameters (to be used when a field manages multiple tags)",
|
||||
"type": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"description": "For documentation of a key",
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"value": {
|
||||
"description": "For documentation of a tag (key and value)",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"rtype": {
|
||||
"description": "For documentation of a relation type",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"description": "Type of field",
|
||||
|
||||
@@ -134,8 +134,7 @@ iD.ui.preset = function(context) {
|
||||
return field.present();
|
||||
})
|
||||
.each(function(field) {
|
||||
var key = field.referenceKey || field.key,
|
||||
reference = iD.ui.TagReference({key: key});
|
||||
var reference = iD.ui.TagReference(field.reference || {key: field.key});
|
||||
|
||||
if (state === 'hover') {
|
||||
reference.showing(false);
|
||||
|
||||
Reference in New Issue
Block a user