better geojson marker handling
This commit is contained in:
parent
7de292d666
commit
c4d020cea1
@ -1,6 +1,6 @@
|
|||||||
### Change Log for Node-RED Worldmap
|
### Change Log for Node-RED Worldmap
|
||||||
|
|
||||||
- v2.3.12 - Fix geoson feature properties fill color
|
- v2.3.13 - Fix geoson feature properties fill color, and better marker handling
|
||||||
- v2.3.11 - Better editing of drawing layer, add OpenTopoMap, and better Esri satellite
|
- v2.3.11 - Better editing of drawing layer, add OpenTopoMap, and better Esri satellite
|
||||||
- v2.3.10 - Improve geojson layer and name handling.
|
- v2.3.10 - Improve geojson layer and name handling.
|
||||||
- v2.3.8 - Fix fa-marker offset to improve accuracy.
|
- v2.3.8 - Fix fa-marker offset to improve accuracy.
|
||||||
|
@ -11,7 +11,7 @@ map web page for plotting "things" on.
|
|||||||
|
|
||||||
### Updates
|
### Updates
|
||||||
|
|
||||||
- v2.3.12 - Fix geoson feature properties fill color
|
- v2.3.13 - Fix geoson feature properties fill color, and better marker handling
|
||||||
- v2.3.11 - Better editing of drawing layer, add OpenTopoMap, and better Esri satellite
|
- v2.3.11 - Better editing of drawing layer, add OpenTopoMap, and better Esri satellite
|
||||||
- v2.3.10 - Improve geojson layer and name handling.
|
- v2.3.10 - Improve geojson layer and name handling.
|
||||||
- v2.3.8 - Fix fa-marker offset to improve accuracy.
|
- v2.3.8 - Fix fa-marker offset to improve accuracy.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-contrib-web-worldmap",
|
"name": "node-red-contrib-web-worldmap",
|
||||||
"version": "2.3.12",
|
"version": "2.3.13",
|
||||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cgi": "0.3.1",
|
"cgi": "0.3.1",
|
||||||
|
@ -2094,6 +2094,11 @@ function doGeojson(n,g,l,o) {
|
|||||||
st.weight = feature.properties["stroke-width"] || st.weight;
|
st.weight = feature.properties["stroke-width"] || st.weight;
|
||||||
st.fillColor = feature.properties["fill-color"] || feature.properties["fill"] || st.fillColor;
|
st.fillColor = feature.properties["fill-color"] || feature.properties["fill"] || st.fillColor;
|
||||||
st.fillOpacity = feature.properties["fill-opacity"] || st.fillOpacity;
|
st.fillOpacity = feature.properties["fill-opacity"] || st.fillOpacity;
|
||||||
|
delete feature.properties["stroke"];
|
||||||
|
delete feature.properties["stroke-width"];
|
||||||
|
delete feature.properties["fill-color"];
|
||||||
|
delete feature.properties["fill"];
|
||||||
|
delete feature.properties["fill-opacity"];
|
||||||
}
|
}
|
||||||
if (feature.hasOwnProperty("style")) {
|
if (feature.hasOwnProperty("style")) {
|
||||||
//console.log("GSTYLE", feature.style)
|
//console.log("GSTYLE", feature.style)
|
||||||
@ -2107,6 +2112,21 @@ function doGeojson(n,g,l,o) {
|
|||||||
}
|
}
|
||||||
return st;
|
return st;
|
||||||
}}
|
}}
|
||||||
|
opt.pointToLayer = function (feature, latlng) {
|
||||||
|
var myMarker = L.VectorMarkers.icon({
|
||||||
|
icon: feature.properties["marker-symbol"] || "circle",
|
||||||
|
markerColor: (feature.properties["marker-color"] || "#910000"),
|
||||||
|
prefix: 'fa',
|
||||||
|
iconColor: 'white'
|
||||||
|
});
|
||||||
|
if (!feature.properties.hasOwnProperty("title")) {
|
||||||
|
feature.properties.title = feature.properties["marker-symbol"];
|
||||||
|
}
|
||||||
|
delete feature.properties["marker-symbol"];
|
||||||
|
delete feature.properties["marker-color"];
|
||||||
|
delete feature.properties["marker-size"];
|
||||||
|
return L.marker(latlng, {title:feature.properties.title || "", icon:myMarker,});
|
||||||
|
}
|
||||||
opt.onEachFeature = function (f,l) {
|
opt.onEachFeature = function (f,l) {
|
||||||
if (f.properties) { l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
|
if (f.properties) { l.bindPopup('<pre>'+JSON.stringify(f.properties,null,' ').replace(/[\{\}"]/g,'')+'</pre>'); }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user