From 679679f3ec6336bded6962b3727da54347a35dc2 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Wed, 1 Aug 2018 10:51:02 -0400 Subject: [PATCH] include details for map markers --- views/peers.pug | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/views/peers.pug b/views/peers.pug index 6f56384..ec7e878 100644 --- a/views/peers.pug +++ b/views/peers.pug @@ -149,7 +149,17 @@ block endOfBody each ipAddress, index in peerIpSummary.ips - var ipDetails = peerIpSummary.detailsByIp[ipAddress]; if (ipDetails && ipDetails.latitude && ipDetails.longitude) - script L.marker([#{ipDetails.latitude}, #{ipDetails.longitude}]).addTo(mymap); + - var ipDetailsPopupHtml = "" + ipAddress + "
"; + if (ipDetails.city) + - var ipDetailsPopupHtml = ipDetailsPopupHtml + ipDetails.city + ", "; + + if (ipDetails.country_name) + - var ipDetailsPopupHtml = ipDetailsPopupHtml + ipDetails.country_name + " "; + + if (ipDetails.location && ipDetails.location.country_flag_emoji) + - var ipDetailsPopupHtml = ipDetailsPopupHtml + ipDetails.location.country_flag_emoji; + + script L.marker([#{ipDetails.latitude}, #{ipDetails.longitude}]).addTo(mymap).bindPopup("!{ipDetailsPopupHtml}");