Page 17 of 21

Journey Recording using GPS Tracking

Posted: Thu Oct 10, 2013 8:13 am
by Maryna Brodina

Hello! Working on it, but there are no news yet..


Journey Recording using GPS Tracking

Posted: Thu Oct 10, 2013 1:37 pm
by Maryna Brodina

Joe, you didn't change code as we suggested a few times above. You have to replace prepoints.push([(coordsArray{i}.time - startTime) / 1000 / 60, coordsArray.alt]);/pre with prepoints.push([(coordsArray.time - startTime) / 1000 / 60, coordsArray.alt]);/pre
Just to remind that custom JS code is outside the scope of our support. You must debug your custom code http://docs.appery.io/documentation/d...


Journey Recording using GPS Tracking

Posted: Sun Oct 20, 2013 7:53 pm
by Joe Paisley

Thanks Maryna! I've changed it. When I test the app in Google Chrome using Developer Tools, I get this in Console when I click "initialize" and the second is from clicking "view results." I'm assuming the value is null since there aren't any points being stored for it to render. Any thoughts?

Image


Journey Recording using GPS Tracking

Posted: Mon Oct 21, 2013 7:50 am
by Maryna Brodina

Hello! Google Chrome doesn't have GPS - it returns ones current position and after that doesn't refresh coordinates. That's why coordinates array is empty.


Journey Recording using GPS Tracking

Posted: Mon Oct 21, 2013 2:12 pm
by Joe Paisley

That's what I assumed, but I'm not sure how else to debug the app without Chrome. What's the next step? Look for errors in logcat in Eclipse? Or check for errors in jslint/jshint? Thanks Maryna!


Journey Recording using GPS Tracking

Posted: Mon Oct 21, 2013 2:32 pm
by Kateryna Grynko

Hi Joe,

1) jslint/jshint - doesn't display errors
2) Look for errors in logcat - is a possible option
3) You can test dummy data where it's possible. For example, on 'result' page read data not from localStorage variable, but paste a row with data in needed format. You can replace the following page codevar coordsArray = JSON.parse(localStorage.getItem("coordsArray"));/codewith:codevar coordsArray = JSON.parse('......');/code
where replace '......' with data in format you need them in localStorage.


Journey Recording using GPS Tracking

Posted: Tue Oct 29, 2013 5:24 am
by Joe Paisley

Good news! The average speed graph on the results page displays the data, and the second graph for altitude displays nothing. This is progress! If I recall, we never set up the local storage variable for the altitude data to be displayed or stored. So would that be something like adding this to geolocation success? code
Appery("altitude").text("Altitude: ft");/code
after code else {
Appery("avrSpeedLabel").text("Average speed: 0 m/h");
} /code

Do I need to change or add to any of the geolocation service mapping displayed below? Image
It's been a long time since we've set up the localStorage for the "Coordsarray" variable, what needs to happen for the "altitude" label on the "recordride" page, and for "plot2" to populate on the "results" page?

Thank you so very much for your help. I believe this project will be mostly finished after this major milestone!


Journey Recording using GPS Tracking

Posted: Tue Oct 29, 2013 6:51 pm
by Maryna Brodina

Hello! Please take a look at this reply https://getsatisfaction.com/apperyio/...


Journey Recording using GPS Tracking

Posted: Thu Oct 31, 2013 1:58 am
by Joe Paisley

Does that mean to removecodeAppery("altitude").text("Altitude: ft");/code?
My geolocation success event has the following code:codeAppery("errorLabel").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("totalDistLabel")&#46;text("Distance: " + round(totalDist) + 'm');
Appery("totalTimeLabel")&#46;text("Time: " + mSecToTime(totalTime));
if (totalTime>0) {
Appery("avrSpeedLabel")&#46;text("Average speed: " + round(totalDist&#47;(totalTime&#47;(1000*3600))) + " m&#47;h");
} else {
Appery("avrSpeedLabel")&#46;text("Average speed: 0 m&#47;h");
}

var coordsArray = [];
try {
coordsArray = JSON&#46;parse(localStorage&#46;getItem("coordsArray"));
if ({}&#46;toString&#46;call(coordsArray) !== "[object Array]") {
coordsArray = [];
}
}catch ( e ){
coordsArray = [];
}
var speed = totalTime!=0 ? round(totalDist&#47;(totalTime&#47;(1000*3600))) : 0;
var timeStamp = new Date(data&#46;timestamp)&#46;getTime();
coordsArray&#46;push({'time': timeStamp, 'lat': data&#46;coords&#46;latitude, 'lng': data&#46;coords&#46;longitude, 'speed': speed});
localStorage&#46;setItem("coordsArray", JSON&#46;stringify(coordsArray));
}
updateMarker(data&#46;coords&#46;latitude, data&#46;coords&#46;longitude);
coordsArray&#46;push({'time': timeStamp, 'lat': data&#46;coords&#46;latitude, 'lng': data&#46;coords&#46;longitude, 'alt': data&#46;coords&#46;altitude, 'speed': speed});/code And I think I'm getting this in logcat: Image
That's about where I click "view ride data." When I click, nothing happens. I don't navigate to "results" page. Did I add something incorrectly?


Journey Recording using GPS Tracking

Posted: Thu Oct 31, 2013 7:44 pm
by Maryna Brodina

Hello! Sorry for delay. We're working on it.