Page 11 of 21

Journey Recording using GPS Tracking

Posted: Thu Jun 27, 2013 3:31 pm
by Joe Paisley

Would I add some code like this on the "jplot" page show, and simply change the label names in both the javascript and the names and coordinate the names of the labels with the javascript?

code
Appery("totalDistLabel1").text("Distance: " + round(totalDist) + ' km');
Appery("totalTimeLabel1").text("Time: " + mSecToTime(totalTime));
if (totalTime>0) {
Appery("avrSpeedLabel1").text("Average speed: " + round(totalDist/(totalTime/(1000*3600))) + " km/h");
} else {
Appery("avrSpeedLabel1").text("Average speed: 0 km/h");
}
}
/code

When I looked back on the javascript, I couldn't find where there was any mention of "altitude" in the javascript, and so the altitude value has never populated in the "altitude" label on the "recordride" page.

How could I go about putting the localStorage altitude data into a jplot graph too?

Thanks!


Journey Recording using GPS Tracking

Posted: Thu Jun 27, 2013 8:11 pm
by Maryna Brodina

Hello!
1) You don't use altitude in your code. If you want to use it to calculate speed you need to change code of distance calculation taking into account altitude, but it should be coded by you. You would need to search for more information online.
2) when you navigate to plot page from record ride page you should save to local storage variables label's valuescodelocalStorage.setItem('someName', Appery('labelName').text());/code
on plot page on Show event put that saved values to labels:
codeAppery("labelName").text(localStorage.getItem('someName'));/code


Journey Recording using GPS Tracking

Posted: Thu Jun 27, 2013 8:44 pm
by Joe Paisley

Thanks Marina! I'll try that code and report back with results. In the meantime, do you recommend any online resources to help me get started coding the altitude jplot line graph? I thought the altitude data was already being stored in localStorage?


Journey Recording using GPS Tracking

Posted: Thu Jun 27, 2013 8:45 pm
by Joe Paisley

Thanks Marina! I'll try that code and report back with results. In the meantime, do you recommend any online resources to help me get started coding the altitude jplot line graph? I thought the altitude data was already being stored in localStorage?


Journey Recording using GPS Tracking

Posted: Thu Jun 27, 2013 8:48 pm
by Maryna Brodina

Sorry, don't have any link to help you.


Journey Recording using GPS Tracking

Posted: Fri Jun 28, 2013 3:50 pm
by Joe Paisley

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?

Image

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")&#46;html('Latitude: ' + data&#46;coords&#46;latitude + '<br>' +
'Longitude: ' + data&#46;coords&#46;longitude + '<br>' +
'Altitude: ' + data&#46;coords&#46;altitude + '<br>' +
'Accuracy: ' + data&#46;coords&#46;accuracy + '<br>' +
'Timestamp: ' + data&#46;timestamp + '<br>');
if(!paused) {
if(oldTime != 0) {
var dist = findDistance(oldLat, oldLng, data&#46;coords&#46;latitude, data&#46;coords&#46;longitude);
totalDist += dist;
totalTime += data&#46;timestamp - oldTime;
}
oldTime = data&#46;timestamp;
oldLat = data&#46;coords&#46;latitude;
oldLng = data&#46;coords&#46;longitude;
Appery("totalDistLabel1")&#46;text("Distance: " + round(totalDist) + 'm');
Appery("totalTimeLabel1")&#46;text("Time: " + mSecToTime(totalTime));
if (totalTime>0) {
Appery("avrSpeedLabel1")&#46;text("Average speed: " + round(totalDist&#47;(totalTime&#47;(1000*3600))) + " m&#47;h");
} else {
Appery("avrSpeedLabel1")&#46;text("Average speed: 0 m&#47;h");
}
/code

Please clarify! Thanks for your help!


Journey Recording using GPS Tracking

Posted: Mon Jul 01, 2013 7:56 pm
by Kateryna Grynko

Dear Joe!

Unfortunately, the support team is not able to check your guesses for you every time. Please check them out yourself. This discussion has been shown many mechanisms of debugging and research. Also, we can not recount here the documentation for the third-party libraries that are available in the public domain.

Support team resolve issues and difficulties in the platform Appery.io, but not a problem in the user apps logic. App development involves having certain knowledge and understanding of the process of development and debugging.


Journey Recording using GPS Tracking

Posted: Wed Jul 03, 2013 2:39 am
by Joe Paisley

If the sort of assistance I've been receiving is outside of the domain of Appery support, I misunderstood the purpose of this discussion forum.


Journey Recording using GPS Tracking

Posted: Wed Jul 03, 2013 3:22 pm
by Kateryna Grynko

We are here to help, we just can't do everything for you. If something is not working as expected we long to help.


Journey Recording using GPS Tracking

Posted: Sat Jul 06, 2013 9:00 pm
by Joe Paisley

I have recently modified the "recordride" page to include the jplot chart and the Twitter and Facebook buttons. I'm still trying to figure out how to include an elevation chart, but now whatever I have done to my app, it will not navigate to any page from the starting "website" page. What have I managed to mess up? Image