fix geocode result classifications

use nominatim's "class" property instead of "type" for result
classifications when "type" is "yes". Happens for "bridge"s,
"tunnel"s, etc.
This commit is contained in:
tyr
2013-12-29 18:44:30 +01:00
committed by Aaron Lidman
parent 8535bbc57c
commit a8184afff2

View File

@@ -112,7 +112,8 @@ iD.ui.FeatureList = function(context) {
result.push({
id: iD.Entity.id.fromOSM(d.osm_type, d.osm_id),
geometry: d.osm_type === 'relation' ? 'relation' : d.osm_type === 'way' ? 'line' : 'point',
type: (d.type.charAt(0).toUpperCase() + d.type.slice(1)).replace('_', ' '),
type: d.type !== 'yes' ? (d.type.charAt(0).toUpperCase() + d.type.slice(1)).replace('_', ' ')
: (d.class.charAt(0).toUpperCase() + d.class.slice(1)).replace('_', ' '),
name: d.display_name,
extent: new iD.geo.Extent(
[parseFloat(d.boundingbox[3]), parseFloat(d.boundingbox[0])],