diff --git a/CHANGELOG.md b/CHANGELOG.md index 21cd3ee..6c0379f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Change Log for Node-RED Worldmap + - v2.42.2 - More KML and GEOJson drag drop fixes - v2.42.1 - Remove extraneous debug logging, fix KMZ icons - v2.42.0 - Add handling for TAK type spots, waypoints, alerts, sensors. Better KML/KMZ handling. - v2.41.0 - Bump leaflet libs to latest stable (1.9.4) diff --git a/README.md b/README.md index 6bac28d..b33abf0 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D% ### Updates +- v2.42.2 - More KML and GEOJson drag drop fixes - v2.42.1 - Remove extraneous debug logging, fix KMZ icons - v2.42.0 - Add handling for TAK type spots, waypoints, alerts, sensors. Better KML/KMZ handling. - v2.41.0 - Bump leaflet libs to latest stable (1.9.4) diff --git a/package.json b/package.json index 9ac10b6..a999b90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "2.42.1", + "version": "2.42.2", "description": "A Node-RED node to provide a web page of a world map for plotting things on.", "dependencies": { "@turf/bezier-spline": "~6.5.0", diff --git a/worldmap/leaflet/leaflet-kmz.js b/worldmap/leaflet/leaflet-kmz.js index d9e3e4b..1b09389 100644 --- a/worldmap/leaflet/leaflet-kmz.js +++ b/worldmap/leaflet/leaflet-kmz.js @@ -140,6 +140,9 @@ text = new TextDecoder(encoding[1]).decode(data); } } + else { + text = text.substr(text.indexOf('<')); + } return text ? (new DOMParser()).parseFromString(text, 'text/xml') : document.implementation.createDocument(null, "kml");} function unzip(folder) { @@ -265,6 +268,7 @@ // TODO: handle L.svg renderer within the L.KMZMarker class? }, style: (feature) => { + // console.log("FEATSTYLE",feature) var styles = {}; var prop = feature.properties; @@ -289,16 +293,18 @@ return styles; }, onEachFeature: (feature, layer) => { - if (!this.options.ballon) return; + // console.log("POP",feature.properties) + //if (!this.options.ballon) return; var prop = feature.properties; - var name = prop.name || ""; - var desc = prop.description || ""; + var name = (prop.name || "").trim(); + var desc = (prop.description || "").trim(); + var p = '