From af9577204563ee6204dbaab847f88a37da57b49a Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Fri, 3 May 2019 08:20:03 +0200 Subject: [PATCH] wip support for colored pois with icons in search result --- server/static/js/search/SearchResult.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/static/js/search/SearchResult.js b/server/static/js/search/SearchResult.js index d7da451..272390e 100644 --- a/server/static/js/search/SearchResult.js +++ b/server/static/js/search/SearchResult.js @@ -40,7 +40,13 @@ var SearchResult = { if (obj.type == "poi"){ description = m("span", obj.attributes.name); - type = m("img", { src: "css/images/marker-icon.png" }); + + var color = obj.attributes.color || "blue"; + var icon = obj.attributes.icon || "home"; + + type = m("div", { class: "awesome-marker awesome-marker-icon-" + color }, [ + m("i", { class: "fa fa-" + icon }) + ]); } if (obj.type == "shop") {