tweak greatcircle readme

This commit is contained in:
Dave Conway-Jones 2022-01-02 16:02:02 +00:00
parent 80e944afa8
commit 0fa462c4c0
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 2 additions and 2 deletions

View File

@ -134,7 +134,7 @@ If the payload also includes a property `fit:true` the map will zoom to fit the
Finally if a **greatcircle** property is set containing an array of two coordinates then an arc Finally if a **greatcircle** property is set containing an array of two coordinates then an arc
following the great circle between the two co-ordinates is plotted. following the great circle between the two co-ordinates is plotted.
msg.payload = {name:"GC1", greatcircle:[ [51.464,0], [25.76,-80.18] ] } msg.payload = {name:"GC1", color:"#ff00ff", greatcircle:[ [51.464,0], [25.76,-80.18] ] }
There are extra optional properties you can specify - see Options below. There are extra optional properties you can specify - see Options below.

View File

@ -1446,7 +1446,7 @@ function setMarker(data) {
} }
if (data.hasOwnProperty("greatcircle") && Array.isArray(data.greatcircle) && data.greatcircle.length === 2) { if (data.hasOwnProperty("greatcircle") && Array.isArray(data.greatcircle) && data.greatcircle.length === 2) {
delete opt.fill; delete opt.fill;
opt.vertices = 500; opt.vertices = opt.vertices || 100;
if (!data.hasOwnProperty("weight")) { opt.weight = 3; } //Standard settings different for lines if (!data.hasOwnProperty("weight")) { opt.weight = 3; } //Standard settings different for lines
if (!data.hasOwnProperty("opacity")) { opt.opacity = 0.8; } if (!data.hasOwnProperty("opacity")) { opt.opacity = 0.8; }
var greatc = L.Polyline.Arc(data.greatcircle[0], data.greatcircle[1], opt); var greatc = L.Polyline.Arc(data.greatcircle[0], data.greatcircle[1], opt);