Fix altitude handling

This commit is contained in:
Dave Conway-Jones 2021-06-04 15:34:24 +01:00
parent 9592153fe8
commit 9c38c4b43f
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
4 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
### Change Log for Node-RED Worldmap
- v2.15.1 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.2 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.0 - let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
- v2.14.0 - Let geojson features be clickable if added as overlay.
- v2.13.4 - Fix list of map choices to be in sync. Fix popup auto sizing.

View File

@ -11,7 +11,7 @@ map web page for plotting "things" on.
### Updates
- v2.15.1 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.2 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.0 - let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
- v2.14.0 - Let geojson features be clickable if added as overlay.
- v2.13.4 - Fix list of map choices to be in sync. Fix popup auto sizing.

View File

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "2.15.1",
"version": "2.15.2",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": {
"cgi": "0.3.1",

View File

@ -1753,13 +1753,13 @@ function setMarker(data) {
var reft = new RegExp('feet|ft','i');
var refm = new RegExp('metres|m','i');
if ( reft.test(""+data.alt) ) {
data.alt = (""+parseFloat(data.alt)).toFixed(2) + " ft";
data.alt = (parseFloat(data.alt)).toFixed(2) + " ft";
}
else if ( refm.test(""+data.alt) ) {
data.alt = (""+parseFloat(data.alt)).toFixed(2) + " m";
data.alt = (parseFloat(data.alt)).toFixed(2) + " m";
}
else {
data.alt = (""+parseFloat(data.alt)).toFixed(2);
data.alt = (parseFloat(data.alt)).toFixed(2);
}
}