diff --git a/data/presets.yaml b/data/presets.yaml index f9649c76e..934fa7784 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1730,6 +1730,9 @@ en: traffic_calming: # traffic_calming=* label: Type + traffic_sign: + # traffic_sign=* + label: Traffic Sign traffic_signals: # traffic_signals=* label: Type @@ -6079,6 +6082,36 @@ en: name: Speed Table # 'terms: flat top,hump,speed,slow' terms: '' + traffic_sign: + # traffic_sign=* + name: Traffic Sign + # 'terms: road,highway' + terms: '' + traffic_sign/city_limit: + # traffic_sign=city_limit + name: City Limit Sign + # 'terms: town,village,hamlet,boundary,edge,border,road,highway' + terms: '' + traffic_sign/city_limit_vertex: + # traffic_sign=city_limit + name: City Limit Sign + # 'terms: town,village,hamlet,boundary,edge,border,road,highway' + terms: '' + traffic_sign/maxspeed: + # traffic_sign=maxspeed + name: Speed Limit Sign + # 'terms: max speed,maximum speed,road,highway' + terms: '' + traffic_sign/maxspeed_vertex: + # traffic_sign=maxspeed + name: Speed Limit Sign + # 'terms: max speed,maximum speed,road,highway' + terms: '' + traffic_sign_vertex: + # traffic_sign=* + name: Traffic Sign + # 'terms: road,highway' + terms: '' type/boundary: # type=boundary name: Boundary diff --git a/data/presets/fields.json b/data/presets/fields.json index 4a809e965..db1fd4660 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -301,6 +301,7 @@ "tracktype": {"key": "tracktype", "type": "combo", "label": "Track Type", "placeholder": "Solid, Mostly Solid, Soft...", "strings": {"options": {"grade1": "Solid: paved or heavily compacted hardcore surface", "grade2": "Mostly Solid: gravel/rock with some soft material mixed in", "grade3": "Even mixture of hard and soft materials", "grade4": "Mostly Soft: soil/sand/grass with some hard material mixed in", "grade5": "Soft: soil/sand/grass"}}}, "trade": {"key": "trade", "type": "typeCombo", "label": "Type"}, "traffic_calming": {"key": "traffic_calming", "type": "typeCombo", "label": "Type"}, + "traffic_sign": {"key": "traffic_sign", "type": "typeCombo", "label": "Traffic Sign"}, "traffic_signals": {"key": "traffic_signals", "type": "combo", "label": "Type", "default": "signal"}, "traffic_signals/direction": {"key": "traffic_signals:direction", "type": "combo", "label": "Direction", "strings": {"options": {"forward": "Forward", "backward": "Backward", "both": "Both / All"}}}, "trail_visibility": {"key": "trail_visibility", "type": "combo", "label": "Trail Visibility", "placeholder": "Excellent, Good, Bad...", "strings": {"options": {"excellent": "Excellent: unambiguous path or markers everywhere", "good": "Good: markers visible, sometimes require searching", "intermediate": "Intermediate: few markers, path mostly visible", "bad": "Bad: no markers, path sometimes invisible/pathless", "horrible": "Horrible: often pathless, some orientation skills required", "no": "No: pathless, excellent orientation skills required"}}}, diff --git a/data/presets/fields/traffic_sign.json b/data/presets/fields/traffic_sign.json new file mode 100644 index 000000000..99b255e55 --- /dev/null +++ b/data/presets/fields/traffic_sign.json @@ -0,0 +1,5 @@ +{ + "key": "traffic_sign", + "type": "typeCombo", + "label": "Traffic Sign" +} diff --git a/data/presets/presets.json b/data/presets/presets.json index 1279817ff..de376a149 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -926,6 +926,12 @@ "traffic_calming/island": {"icon": "temaki-diamond", "geometry": ["vertex"], "terms": ["circle", "roundabout", "slow"], "tags": {"traffic_calming": "island"}, "name": "Traffic Island"}, "traffic_calming/rumble_strip": {"icon": "temaki-diamond", "fields": ["direction_vertex"], "geometry": ["vertex", "line"], "terms": ["audible lines", "sleeper lines", "growlers"], "tags": {"traffic_calming": "rumble_strip"}, "name": "Rumble Strip"}, "traffic_calming/table": {"icon": "temaki-diamond", "fields": ["surface"], "geometry": ["vertex"], "tags": {"traffic_calming": "table"}, "terms": ["flat top", "hump", "speed", "slow"], "name": "Speed Table"}, + "traffic_sign_vertex": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction_vertex"], "geometry": ["vertex"], "tags": {"traffic_sign": "*"}, "terms": ["road", "highway"], "name": "Traffic Sign"}, + "traffic_sign": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction"], "geometry": ["point"], "tags": {"traffic_sign": "*"}, "terms": ["road", "highway"], "name": "Traffic Sign"}, + "traffic_sign/city_limit_vertex": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction_vertex", "name"], "geometry": ["vertex"], "tags": {"traffic_sign": "city_limit"}, "terms": ["town", "village", "hamlet", "boundary", "edge", "border", "road", "highway"], "name": "City Limit Sign"}, + "traffic_sign/city_limit": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction", "name"], "geometry": ["point"], "tags": {"traffic_sign": "city_limit"}, "terms": ["town", "village", "hamlet", "boundary", "edge", "border", "road", "highway"], "name": "City Limit Sign"}, + "traffic_sign/maxspeed_vertex": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction_vertex", "maxspeed"], "geometry": ["vertex"], "tags": {"traffic_sign": "maxspeed"}, "terms": ["max speed", "maximum speed", "road", "highway"], "name": "Speed Limit Sign"}, + "traffic_sign/maxspeed": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction", "maxspeed"], "geometry": ["point"], "tags": {"traffic_sign": "maxspeed"}, "terms": ["max speed", "maximum speed", "road", "highway"], "name": "Speed Limit Sign"}, "type/multipolygon": {"icon": "iD-multipolygon", "geometry": ["area", "relation"], "tags": {"type": "multipolygon"}, "removeTags": {}, "name": "Multipolygon", "searchable": false, "matchScore": 0.1}, "type/boundary": {"icon": "iD-boundary", "fields": ["name", "boundary"], "geometry": ["relation"], "tags": {"type": "boundary"}, "name": "Boundary"}, "type/boundary/administrative": {"icon": "iD-boundary", "fields": ["name", "admin_level"], "geometry": ["relation"], "tags": {"type": "boundary", "boundary": "administrative"}, "reference": {"key": "boundary", "value": "administrative"}, "name": "Administrative Boundary"}, diff --git a/data/presets/presets/traffic_sign.json b/data/presets/presets/traffic_sign.json new file mode 100644 index 000000000..444e77e13 --- /dev/null +++ b/data/presets/presets/traffic_sign.json @@ -0,0 +1,18 @@ +{ + "icon": "maki-square-stroked", + "fields": [ + "traffic_sign", + "direction" + ], + "geometry": [ + "point" + ], + "tags": { + "traffic_sign": "*" + }, + "terms": [ + "road", + "highway" + ], + "name": "Traffic Sign" +} diff --git a/data/presets/presets/traffic_sign/city_limit.json b/data/presets/presets/traffic_sign/city_limit.json new file mode 100644 index 000000000..bf32228f6 --- /dev/null +++ b/data/presets/presets/traffic_sign/city_limit.json @@ -0,0 +1,25 @@ +{ + "icon": "maki-square-stroked", + "fields": [ + "traffic_sign", + "direction", + "name" + ], + "geometry": [ + "point" + ], + "tags": { + "traffic_sign": "city_limit" + }, + "terms": [ + "town", + "village", + "hamlet", + "boundary", + "edge", + "border", + "road", + "highway" + ], + "name": "City Limit Sign" +} diff --git a/data/presets/presets/traffic_sign/city_limit_vertex.json b/data/presets/presets/traffic_sign/city_limit_vertex.json new file mode 100644 index 000000000..89984f740 --- /dev/null +++ b/data/presets/presets/traffic_sign/city_limit_vertex.json @@ -0,0 +1,25 @@ +{ + "icon": "maki-square-stroked", + "fields": [ + "traffic_sign", + "direction_vertex", + "name" + ], + "geometry": [ + "vertex" + ], + "tags": { + "traffic_sign": "city_limit" + }, + "terms": [ + "town", + "village", + "hamlet", + "boundary", + "edge", + "border", + "road", + "highway" + ], + "name": "City Limit Sign" +} diff --git a/data/presets/presets/traffic_sign/maxspeed.json b/data/presets/presets/traffic_sign/maxspeed.json new file mode 100644 index 000000000..1845a779d --- /dev/null +++ b/data/presets/presets/traffic_sign/maxspeed.json @@ -0,0 +1,21 @@ +{ + "icon": "maki-square-stroked", + "fields": [ + "traffic_sign", + "direction", + "maxspeed" + ], + "geometry": [ + "point" + ], + "tags": { + "traffic_sign": "maxspeed" + }, + "terms": [ + "max speed", + "maximum speed", + "road", + "highway" + ], + "name": "Speed Limit Sign" +} diff --git a/data/presets/presets/traffic_sign/maxspeed_vertex.json b/data/presets/presets/traffic_sign/maxspeed_vertex.json new file mode 100644 index 000000000..ecc5cb71b --- /dev/null +++ b/data/presets/presets/traffic_sign/maxspeed_vertex.json @@ -0,0 +1,21 @@ +{ + "icon": "maki-square-stroked", + "fields": [ + "traffic_sign", + "direction_vertex", + "maxspeed" + ], + "geometry": [ + "vertex" + ], + "tags": { + "traffic_sign": "maxspeed" + }, + "terms": [ + "max speed", + "maximum speed", + "road", + "highway" + ], + "name": "Speed Limit Sign" +} diff --git a/data/presets/presets/traffic_sign_vertex.json b/data/presets/presets/traffic_sign_vertex.json new file mode 100644 index 000000000..8c1841a40 --- /dev/null +++ b/data/presets/presets/traffic_sign_vertex.json @@ -0,0 +1,18 @@ +{ + "icon": "maki-square-stroked", + "fields": [ + "traffic_sign", + "direction_vertex" + ], + "geometry": [ + "vertex" + ], + "tags": { + "traffic_sign": "*" + }, + "terms": [ + "road", + "highway" + ], + "name": "Traffic Sign" +} diff --git a/data/taginfo.json b/data/taginfo.json index 82ac1505c..eadb71c0f 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -6073,6 +6073,26 @@ "object_types": ["node", "way"], "icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/diamond.svg?sanitize=true" }, + { + "key": "traffic_sign", + "description": "Traffic Sign", + "object_types": ["node"], + "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/square-stroked-15.svg?sanitize=true" + }, + { + "key": "traffic_sign", + "value": "city_limit", + "description": "City Limit Sign", + "object_types": ["node"], + "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/square-stroked-15.svg?sanitize=true" + }, + { + "key": "traffic_sign", + "value": "maxspeed", + "description": "Speed Limit Sign", + "object_types": ["node"], + "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/square-stroked-15.svg?sanitize=true" + }, { "key": "type", "value": "multipolygon", diff --git a/dist/locales/en.json b/dist/locales/en.json index 568d3977e..153ff053c 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -2903,6 +2903,9 @@ "traffic_calming": { "label": "Type" }, + "traffic_sign": { + "label": "Traffic Sign" + }, "traffic_signals": { "label": "Type" }, @@ -6749,6 +6752,30 @@ "name": "Speed Table", "terms": "flat top,hump,speed,slow" }, + "traffic_sign_vertex": { + "name": "Traffic Sign", + "terms": "road,highway" + }, + "traffic_sign": { + "name": "Traffic Sign", + "terms": "road,highway" + }, + "traffic_sign/city_limit_vertex": { + "name": "City Limit Sign", + "terms": "town,village,hamlet,boundary,edge,border,road,highway" + }, + "traffic_sign/city_limit": { + "name": "City Limit Sign", + "terms": "town,village,hamlet,boundary,edge,border,road,highway" + }, + "traffic_sign/maxspeed_vertex": { + "name": "Speed Limit Sign", + "terms": "max speed,maximum speed,road,highway" + }, + "traffic_sign/maxspeed": { + "name": "Speed Limit Sign", + "terms": "max speed,maximum speed,road,highway" + }, "type/multipolygon": { "name": "Multipolygon", "terms": "" diff --git a/modules/ui/fields/maxspeed.js b/modules/ui/fields/maxspeed.js index fb0e5c2ed..92f9ef7c1 100644 --- a/modules/ui/fields/maxspeed.js +++ b/modules/ui/fields/maxspeed.js @@ -49,8 +49,14 @@ export function uiFieldMaxspeed(field, context) { .on('change', change) .on('blur', change); - var childNodes = context.graph().childNodes(context.entity(entity.id)), + var loc; + if (entity.type === 'node') { + loc = entity.loc; + } + else { + var childNodes = context.graph().childNodes(context.entity(entity.id)); loc = childNodes[~~(childNodes.length/2)].loc; + } isImperial = _some(dataImperial.features, function(f) { return _some(f.geometry.coordinates, function(d) {