tidy geojson handling slughtly.
This commit is contained in:
parent
6234299fd4
commit
71a979b75d
@ -1,5 +1,6 @@
|
||||
### Change Log for Node-RED Worldmap
|
||||
|
||||
- v2.15.6 - Tidy up geoJson handling a bit more.
|
||||
- v2.15.5 - Fix SDIC icons to accept unicoded icons as labels.
|
||||
- v2.15.4 - Let clear heatmap command do what it says.
|
||||
- v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
|
||||
|
@ -11,6 +11,7 @@ map web page for plotting "things" on.
|
||||
|
||||
### Updates
|
||||
|
||||
- v2.15.6 - Tidy up geoJson handling a bit more.
|
||||
- v2.15.5 - Fix SDIC icons to accept unicoded icons as labels.
|
||||
- v2.15.4 - Let clear heatmap command do what it says.
|
||||
- v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-red-contrib-web-worldmap",
|
||||
"version": "2.15.5",
|
||||
"version": "2.15.6",
|
||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||
"dependencies": {
|
||||
"cgi": "0.3.1",
|
||||
|
@ -2526,8 +2526,14 @@ function doGeojson(n,g,l,o) {
|
||||
return L.marker(latlng, {title:feature.properties.title || "", icon:myMarker});
|
||||
}
|
||||
opt.onEachFeature = function (f,l) {
|
||||
if (f.properties) { l.bindPopup('<pre style="overflow-x: scroll">'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
|
||||
if (o.hasOwnProperty("clickable") && o.clickable === true) {
|
||||
if (f.properties && Object.keys(f.properties).length > 0) {
|
||||
var tx = JSON.stringify(f.properties,null,' ');
|
||||
if ( tx !== "{}") {
|
||||
l.bindPopup('<pre style="overflow-x: scroll">'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>');
|
||||
}
|
||||
}
|
||||
|
||||
if (o && o.hasOwnProperty("clickable") && o.clickable === true) {
|
||||
l.on('click', function (e) {
|
||||
ws.send(JSON.stringify({action:"clickgeo",name:n,type:f.type,properties:f.properties,geometry:f.geometry}));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user