diff --git a/mapobject/poi.go b/mapobject/poi.go index b46740b..0ec524d 100644 --- a/mapobject/poi.go +++ b/mapobject/poi.go @@ -18,6 +18,7 @@ func (this *PoiBlock) onMapObject(mbpos *types.MapBlockCoords, x, y, z int, bloc o.Attributes["name"] = md["name"] o.Attributes["category"] = md["category"] o.Attributes["url"] = md["url"] + o.Attributes["image"] = md["image"] o.Attributes["owner"] = md["owner"] o.Attributes["icon"] = md["icon"] o.Attributes["color"] = this.Color diff --git a/public/css/custom.css b/public/css/custom.css index 84029a1..d2da078 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -48,3 +48,8 @@ body { .player-popup div.info { grid-area: info; } + +.poi_image { + width: 100%; + height: auto; +} diff --git a/public/js/map/overlays/PoiOverlay.js b/public/js/map/overlays/PoiOverlay.js index 54ed746..d218fbb 100644 --- a/public/js/map/overlays/PoiOverlay.js +++ b/public/js/map/overlays/PoiOverlay.js @@ -20,18 +20,23 @@ export default AbstractIconOverlay.extend({ }, createPopup: function(poi){ + var innerHTML = ""; - if (poi.attributes.url) - { - return "" + - "

" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "


" + - "Owner: " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "
"; + if (poi.attributes.url) { + innerHTML += "" + + "

" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "

"; + } else { + innerHTML += "

" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "

"; } - else - { - return "

" + HtmlSanitizer.SanitizeHtml(poi.attributes.name) + "


" + - "Owner: " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "
"; + + if (poi.attributes.image) { + innerHTML += ""; } + + innerHTML += "
Owner: " + HtmlSanitizer.SanitizeHtml(poi.attributes.owner) + "
"; + + return innerHTML; }