Fix for geojson multipoint icons

This commit is contained in:
Dave Conway-Jones 2023-07-28 09:16:35 +01:00
parent 9fc059ca4c
commit 21d3ab4f95
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,6 @@
### Change Log for Node-RED Worldmap
- v2.38.1 - Fix for geojson multipoint icons.
- v2.38.0 - Return client headers as part of connect message.
- v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
- v2.37.3 - Fix hang on layer change

View File

@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
### Updates
- v2.38.1 - Fix for geojson multipoint icons.
- v2.38.0 - Return client headers as part of connect message.
- v2.37.4 - Fix sessionid specific data not to be sent on reload/refresh
- v2.37.3 - Fix hang on layer change

View File

@ -2795,7 +2795,7 @@ function doCommand(cmd) {
// handle any incoming GEOJSON directly - may style badly
function doGeojson(n,g,l,o) {
//console.log("GEOJSON",n,g,l,o)
// console.log("GEOJSON",n,g,l,o)
var lay = l ?? g.name ?? "unknown";
// if (!basemaps[lay]) {
var opt = { style: function(feature) {
@ -2867,9 +2867,11 @@ function doGeojson(n,g,l,o) {
if (feature.properties.hasOwnProperty("url")) {
feature.properties.url = "<a target='_new' href='"+feature.properties.url+"'>"+feature.properties.url+"</a>";
}
delete feature.properties["marker-symbol"];
delete feature.properties["marker-color"];
delete feature.properties["marker-size"];
if (feature.geometry.hasOwnProperty("type") && feature.geometry.type !== "MultiPoint") {
delete feature.properties["marker-symbol"];
delete feature.properties["marker-color"];
delete feature.properties["marker-size"];
}
var nf = {title:feature.properties.title, name:feature.properties.name};
feature.properties = Object.assign(nf, feature.properties);
return L.marker(latlng, {title:feature.properties.title ?? "", icon:myMarker});