From f266593f9aa95c7c43a58d10b85837ba9e1f0625 Mon Sep 17 00:00:00 2001 From: 1F616EMO~nya Date: Sat, 10 Aug 2024 15:19:24 +0800 Subject: [PATCH] Add address for POIs (#404) * Add address for POIs * Add missing semicolon --- mapobject/poi.go | 1 + public/js/map/overlays/PoiOverlay.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mapobject/poi.go b/mapobject/poi.go index 0ec524d5..711e3d51 100644 --- a/mapobject/poi.go +++ b/mapobject/poi.go @@ -17,6 +17,7 @@ func (this *PoiBlock) onMapObject(mbpos *types.MapBlockCoords, x, y, z int, bloc o := mapobjectdb.NewMapObject(mbpos, x, y, z, "poi") o.Attributes["name"] = md["name"] o.Attributes["category"] = md["category"] + o.Attributes["addr"] = md["addr"] o.Attributes["url"] = md["url"] o.Attributes["image"] = md["image"] o.Attributes["owner"] = md["owner"] diff --git a/public/js/map/overlays/PoiOverlay.js b/public/js/map/overlays/PoiOverlay.js index 89cbbe9b..7f1cd763 100644 --- a/public/js/map/overlays/PoiOverlay.js +++ b/public/js/map/overlays/PoiOverlay.js @@ -35,7 +35,11 @@ export default AbstractIconOverlay.extend({ "\" crossorigin=\"anonymous\" referrerpolicy=\"origin-when-cross-origin\">"; } - innerHTML += "
Owner: " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "
"; + innerHTML += "
"; + if (poi.attributes.addr) { + innerHTML += "Address: " + HtmlSanitizer.SanitizeHtml(poi.attributes.addr) + "
"; + } + innerHTML += "Owner: " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "
"; return innerHTML; }