From 69edff39f0d618a30777669c866259611c9aa4aa Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Mon, 20 Jun 2022 11:19:59 +0200 Subject: [PATCH] fix missing vertex icon, improve fallback icons for untagged objects closes #9157 --- CHANGELOG.md | 2 ++ modules/ui/preset_icon.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b10a3f03..4fa13f378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :rocket: Presets * Disable taginfo suggestions for the `via` field ([#9140], thanks [@k-yle]) * Treat `surface=chipseal` as a paved surface ([#9139], thanks [@k-yle]) +* Better fallback icons for untagged points, vertices, lines and areas ([#9157]) #### :hammer: Development @@ -68,6 +69,7 @@ _Breaking developer changes, which may affect downstream projects or sites that [#9139]: https://github.com/openstreetmap/iD/pull/9139 [#9140]: https://github.com/openstreetmap/iD/pull/9140 [#9142]: https://github.com/openstreetmap/iD/pull/9142 +[#9157]: https://github.com/openstreetmap/iD/issues/9157 [@furkanmutlu]: https://github.com/furkanmutlu [@JackNUMBER]: https://github.com/JackNUMBER [@aaditya0000]: https://github.com/aaditya0000 diff --git a/modules/ui/preset_icon.js b/modules/ui/preset_icon.js index 1a2e85f4a..c9bf2866d 100644 --- a/modules/ui/preset_icon.js +++ b/modules/ui/preset_icon.js @@ -17,9 +17,10 @@ export function uiPresetIcon() { function getIcon(p, geom) { + if (p.isFallback && p.isFallback()) return geom === 'vertex' ? '' : 'iD-icon-' + p.id; if (p.icon) return p.icon; if (geom === 'line') return 'iD-other-line'; - if (geom === 'vertex') return p.isFallback() ? '' : 'temaki-vertex'; + if (geom === 'vertex') return 'temaki-vertex'; return 'maki-marker-stroked'; } @@ -386,7 +387,7 @@ export function uiPresetIcon() { const picon = getIcon(p, geom); const isCategory = !p.setTags; const drawPoint = false; - const drawVertex = picon !== null && geom === 'vertex' && (!isFallback); + const drawVertex = picon !== null && geom === 'vertex'; const drawLine = picon && geom === 'line' && !isFallback && !isCategory; const drawArea = picon && geom === 'area' && !isFallback && !isCategory; const drawRoute = picon && geom === 'route';