mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-16 12:55:13 +03:00
MP version 1.8
This commit is contained in:
parent
2fb3cacf9a
commit
0087e53f57
2 changed files with 11 additions and 8 deletions
|
@ -138,7 +138,6 @@ let Waypoint = function (number, action, lat, lon, alt=0, p1=0, p2=0, p3=0, endM
|
|||
|
||||
self.getElevation = async function (globalSettings) {
|
||||
let elevation;
|
||||
console.log('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+self.getLatMap()+','+self.getLonMap()+'&heights=ellipsoid&key='+globalSettings.mapApiKey);
|
||||
if (globalSettings.mapProviderType == 'bing') {
|
||||
const response = await fetch('http://dev.virtualearth.net/REST/v1/Elevation/List?points='+self.getLatMap()+','+self.getLonMap()+'&heights=ellipsoid&key='+globalSettings.mapApiKey);
|
||||
const myJson = await response.json();
|
||||
|
@ -147,8 +146,6 @@ let Waypoint = function (number, action, lat, lon, alt=0, p1=0, p2=0, p3=0, endM
|
|||
else {
|
||||
elevation = "NA";
|
||||
}
|
||||
//$('#elevationValueAtWP').text(elevation);
|
||||
console.log("getElevation");
|
||||
return elevation;
|
||||
}
|
||||
|
||||
|
|
|
@ -1720,8 +1720,12 @@ TABS.mission_control.initialize = function (callback) {
|
|||
selectedMarker.setP3( $('#pointP3').prop("checked") ? 1.0 : 0.0);
|
||||
console.log($('#pointP3').prop("checked"));
|
||||
if ($('#pointP3').prop("checked")) {
|
||||
selectedMarker.getElevation(globalSettings);
|
||||
$('#elevationAtWP').fadeIn(300);
|
||||
(async () => {
|
||||
const elevationAtWP = await selectedMarker.getElevation(globalSettings);
|
||||
$('#elevationValueAtWP').text(elevationAtWP);
|
||||
$('#elevationAtWP').fadeIn(300);
|
||||
})()
|
||||
|
||||
}
|
||||
else {
|
||||
$('#elevationAtWP').fadeOut(300);
|
||||
|
@ -2165,7 +2169,9 @@ TABS.mission_control.initialize = function (callback) {
|
|||
function plotElevation() {
|
||||
(async () => {
|
||||
const [lengthMission, totalMissionDistance, samples, elevation, altPoint2measure, namePoint2measure, refPoint2measure] = await mission.getElevation(globalSettings);
|
||||
|
||||
console.log(elevation);
|
||||
console.log(totalMissionDistance);
|
||||
console.log(Array.from(Array(samples), (_,i)=> i*totalMissionDistance/samples));
|
||||
var trace_WGS84 = {
|
||||
x: Array.from(Array(samples), (_,i)=> i*totalMissionDistance/samples),
|
||||
y: elevation,
|
||||
|
@ -2176,10 +2182,10 @@ TABS.mission_control.initialize = function (callback) {
|
|||
color: '#ff7f0e',
|
||||
},
|
||||
};
|
||||
|
||||
console.log(altPoint2measure.map((x,i) => x / 100 + HOME.getAlt()*refPoint2measure[i]));
|
||||
var trace_missionHeight = {
|
||||
x: lengthMission,
|
||||
y: altPoint2measure.map(x => x / 100 + HOME.getAlt()) ,
|
||||
y: altPoint2measure.map((x,i) => x / 100 + HOME.getAlt()*(1-refPoint2measure[i])) ,
|
||||
type: 'scatter',
|
||||
mode: 'lines+markers+text',
|
||||
name: 'Mission altitude',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue