fix circle/ellipse accuracy

This commit is contained in:
Dave Conway-Jones 2022-01-08 12:04:33 +00:00
parent 0fa462c4c0
commit 84307ebd19
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
4 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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",

View File

@ -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);