From 69397a09dd9d0c28ba71a1bf2d3eee95e4a68401 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Fri, 11 Sep 2015 21:24:56 +0200 Subject: [PATCH] fix: live map had ugly html on hover over dot --- wdocs/last/functions.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/wdocs/last/functions.js b/wdocs/last/functions.js index 163d002..712372a 100644 --- a/wdocs/last/functions.js +++ b/wdocs/last/functions.js @@ -48,16 +48,20 @@ function refreshmarkers(m) { function map_marker(loc) { var id = loc.topic.replace(/\//g, '-'); - var d; + var htmldesc; + var shortdesc; if (loc.addr && loc.topic) { - d = loc.topic + " " + loc.addr; - d = "" + loc.topic.split('/')[2] + "
" + loc.addr; + htmldesc = loc.topic + " " + loc.addr; + htmldesc = "" + loc.topic.split('/')[2] + "
" + loc.addr; + shortdesc = loc.topic.split('/')[2] + " " + loc.addr; } else { - d = loc.lat + ", " + loc.lon; + htmldesc = loc.lat + ", " + loc.lon; + shortdesc = htmldesc; } - loc.description = d; + loc.description = shortdesc; + loc.htmldesc = htmldesc; if (markers.hasOwnProperty(id)) { clog("UPD", id, JSON.stringify(loc)); @@ -67,7 +71,7 @@ function map_marker(loc) m.setTitle(loc.description); /* Grab the InfoWindow of this marker and change content */ - m['infowindow'].setContent(loc.description); + m['infowindow'].setContent(loc.htmldesc); if (livemarkers) { refreshmarkers(m); } @@ -94,7 +98,7 @@ function map_marker(loc) /* Create a new InfoWindow for this marker, and add listener */ m['infowindow'] = new google.maps.InfoWindow({ - content: loc.description + content: loc.htmldesc }); google.maps.event.addListener(m, "click", function(e) { this['infowindow'].open(map, this);