From 8f272f25082cd2f2cf1afcde715361e9e0305564 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 24 May 2013 11:26:12 -0700 Subject: [PATCH] Special case multipolygon preset icon Multipolygons have geometry === "area", so normally wouldn't trigger a 'preset-icon-relation' class. This preset usually matches only in the case where the tags are on the outer way and the multipolygon itself is untagged. Otherwise, a more specific area preset will match. --- data/presets/presets.json | 1 + data/presets/presets/type/multipolygon.json | 1 + js/id/ui/preset_icon.js | 7 +++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/data/presets/presets.json b/data/presets/presets.json index 09ca90c89..7d37644bd 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -4489,6 +4489,7 @@ }, "type/multipolygon": { "geometry": [ + "area", "relation" ], "tags": { diff --git a/data/presets/presets/type/multipolygon.json b/data/presets/presets/type/multipolygon.json index f5220bb8c..bc6c4296b 100644 --- a/data/presets/presets/type/multipolygon.json +++ b/data/presets/presets/type/multipolygon.json @@ -1,5 +1,6 @@ { "geometry": [ + "area", "relation" ], "tags": { diff --git a/js/id/ui/preset_icon.js b/js/id/ui/preset_icon.js index 668049971..4739241fa 100644 --- a/js/id/ui/preset_icon.js +++ b/js/id/ui/preset_icon.js @@ -16,9 +16,12 @@ iD.ui.PresetIcon = function(geometry) { var icon = preset.icon || fallbackIcon, klass = 'feature-' + icon + ' preset-icon'; - icon = iD.data.featureIcons[icon]; - if (icon && icon[geometry]) { + var featureicon = iD.data.featureIcons[icon]; + if (featureicon && featureicon[geometry]) { klass += ' preset-icon-' + geometry; + } else if (icon === 'multipolygon') { + // Special case (geometry === 'area') + klass += ' preset-icon-relation'; } return klass;