From c4dbea12b3f5ee48a17e89a674e5adddeedad1cb Mon Sep 17 00:00:00 2001 From: Philip Schell Date: Thu, 27 Jun 2019 11:22:52 +0200 Subject: [PATCH] #14 show description on map in tooltip on area --- CHANGELOG | 1 + Lora-Map/resources/js/map.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index c753726..c3e77e9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ * ### Bugfixes * Implement #13 fixing issue with port when using proxy +* Implement #14 show description on map in tooltip on area ### Changes * diff --git a/Lora-Map/resources/js/map.js b/Lora-Map/resources/js/map.js index 226b4f0..d3bcf38 100644 --- a/Lora-Map/resources/js/map.js +++ b/Lora-Map/resources/js/map.js @@ -69,7 +69,11 @@ function GetGeoLayer() { }, onEachFeature: function (feature, layer) { if (feature.geometry.type === "Polygon" || (feature.geometry.type === "Point" && feature.properties.hasOwnProperty("icon"))) { - layer.bindPopup(feature.properties.name); + var text = ""+feature.properties.name+""; + if (feature.properties.hasOwnProperty("description")) { + text = text + "
" + feature.properties.description; + } + layer.bindPopup(text); } }, pointToLayer: function (geoJsonPoint, latlng) {