From 84307ebd1951930bf9bb434cce15c134e17f3e83 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 8 Jan 2022 12:04:33 +0000 Subject: [PATCH] fix circle/ellipse accuracy --- CHANGELOG.md | 1 + README.md | 1 + package.json | 2 +- worldmap/worldmap.js | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb39504..7b71318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Change Log for Node-RED Worldmap + - v2.24.1 - Fix ellipse accuracy. - v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193 - v2.23.5 - Fix addtoheatmap. Issue #192 - v2.23.4 - Fix opacity of area borders diff --git a/README.md b/README.md index aede9e0..b60dfdd 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ map web page for plotting "things" on. ### Updates +- v2.24.1 - Fix ellipse accuracy - v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193 - v2.23.5 - Fix addtoheatmap. Issue #192 - v2.23.4 - Fix opacity of area borders diff --git a/package.json b/package.json index 59f69df..05eaf18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "2.24.0", + "version": "2.24.1", "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/worldmap.js b/worldmap/worldmap.js index 0986d10..a0b467e 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -1465,7 +1465,8 @@ function setMarker(data) { if (data.hasOwnProperty("lat") && data.hasOwnProperty("lon")) { var polycirc; if (Array.isArray(data.radius)) { - polycirc = L.ellipse(new L.LatLng((data.lat*1), (data.lon*1)), [data.radius[0]*Math.cos(data.lat*Math.PI/180), data.radius[1]], data.tilt || 0, opt); + //polycirc = L.ellipse(new L.LatLng((data.lat*1), (data.lon*1)), [data.radius[0]*Math.cos(data.lat*Math.PI/180), data.radius[1]], data.tilt || 0, opt); + polycirc = L.ellipse(new L.LatLng((data.lat*1), (data.lon*1)), [data.radius[0], data.radius[1]], data.tilt || 0, opt); } else { polycirc = L.circle(new L.LatLng((data.lat*1), (data.lon*1)), data.radius*1, opt);