I'm unsure of how to use the Google Maps API service to render elevation data in the "altitude" label. Have I mapped the data correctly here?
To call upon the data, which I thought was stored in local storage, do I add a line of code on the "recordride" page show event along the lines of:
code
localStorage.altitude('altitude', Appery("altitude").text("Altitude: " + data.coords.elevation));/code in geolocation success and
codeAppery("altitude").text(localStorage.getItem('altitude'));/code
Will this give me data in the "altitude" label?
And how do I get the altitude data to graph in "panel_3" component on the "plot" page?
I'm very confused on how to do all of this. Can I simply copy the code on the "recordride" page and change the label names to redisplay the same data in different labels on the "plot" page with code like this?
codeAppery("errorLabel1").hide();
invokeTimes++;
Appery("dataLabel").html('Latitude: ' + data.coords.latitude + '<br>' +
'Longitude: ' + data.coords.longitude + '<br>' +
'Altitude: ' + data.coords.altitude + '<br>' +
'Accuracy: ' + data.coords.accuracy + '<br>' +
'Timestamp: ' + data.timestamp + '<br>');
if(!paused) {
if(oldTime != 0) {
var dist = findDistance(oldLat, oldLng, data.coords.latitude, data.coords.longitude);
totalDist += dist;
totalTime += data.timestamp - oldTime;
}
oldTime = data.timestamp;
oldLat = data.coords.latitude;
oldLng = data.coords.longitude;
Appery("totalDistLabel1").text("Distance: " + round(totalDist) + 'm');
Appery("totalTimeLabel1").text("Time: " + mSecToTime(totalTime));
if (totalTime>0) {
Appery("avrSpeedLabel1").text("Average speed: " + round(totalDist/(totalTime/(1000*3600))) + " m/h");
} else {
Appery("avrSpeedLabel1").text("Average speed: 0 m/h");
}
/code
Please clarify! Thanks for your help!