#14 show description on map in tooltip on area

This commit is contained in:
Philip Schell 2019-06-27 11:22:52 +02:00
parent 7be6245ed3
commit c4dbea12b3
2 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@
* *
### Bugfixes ### Bugfixes
* Implement #13 fixing issue with port when using proxy * Implement #13 fixing issue with port when using proxy
* Implement #14 show description on map in tooltip on area
### Changes ### Changes
* *

View File

@ -69,7 +69,11 @@ function GetGeoLayer() {
}, },
onEachFeature: function (feature, layer) { onEachFeature: function (feature, layer) {
if (feature.geometry.type === "Polygon" || (feature.geometry.type === "Point" && feature.properties.hasOwnProperty("icon"))) { if (feature.geometry.type === "Polygon" || (feature.geometry.type === "Point" && feature.properties.hasOwnProperty("icon"))) {
layer.bindPopup(feature.properties.name); var text = "<b>"+feature.properties.name+"</b>";
if (feature.properties.hasOwnProperty("description")) {
text = text + "<br>" + feature.properties.description;
}
layer.bindPopup(text);
} }
}, },
pointToLayer: function (geoJsonPoint, latlng) { pointToLayer: function (geoJsonPoint, latlng) {