From 2bb83196736f264b8fca89f7bdec965b1242c803 Mon Sep 17 00:00:00 2001 From: NatureFreshMilk Date: Tue, 14 May 2019 09:15:11 +0200 Subject: [PATCH] locator search --- server/static/js/search/SearchResult.js | 14 ++++++++++++++ server/static/js/search/SearchService.js | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/server/static/js/search/SearchResult.js b/server/static/js/search/SearchResult.js index 7dc4a82..fd3f47d 100644 --- a/server/static/js/search/SearchResult.js +++ b/server/static/js/search/SearchResult.js @@ -46,6 +46,20 @@ var SearchResult = { type = m("img", { src: "pics/bones_top.png" }); } + // locator + if (obj.type == "locator"){ + description = m("span", obj.attributes.name); + + var img = "pics/locator_beacon_level1.png" + + if (obj.attributes.level == "2") + img = "pics/locator_beacon_level2.png"; + else if (obj.attributes.level == "3") + img = "pics/locator_beacon_level3.png"; + + type = m("img", { src: img }); + } + // poi marker if (obj.type == "poi"){ description = m("span", obj.attributes.name); diff --git a/server/static/js/search/SearchService.js b/server/static/js/search/SearchService.js index 4ea19d2..fd59171 100644 --- a/server/static/js/search/SearchService.js +++ b/server/static/js/search/SearchService.js @@ -34,7 +34,8 @@ var SearchService = { searchFor("poi", "name", SearchStore.query), searchFor("train", "station", SearchStore.query), searchFor("travelnet", "station_name", SearchStore.query), - searchFor("bones", "owner", SearchStore.query) + searchFor("bones", "owner", SearchStore.query), + searchFor("locator", "name", SearchStore.query) ]; Promise.all(prom_list)