Page 13 of 21

Journey Recording using GPS Tracking

Posted: Wed Jul 17, 2013 6:41 pm
by Joe Paisley

Sorry about that Katya, I'm not sure what's going on (but what's new?) I've attached this screenshot, I don't think it really indicates anything. I've moved the jplot graph panels to the "results" page, and nothing shows up after I record a little data and then click on the "view and share data" button. Why might there be no graphs appearing on the "results" page?

Thank you so much. This app is nearly complete. All that needs to happen now is the graphs need to appear on the "results" page and there won't be much left to do, other than to fix bugs and glitches later on once the app is deployed on the various marketplaces. Image


Journey Recording using GPS Tracking

Posted: Wed Jul 17, 2013 8:06 pm
by Kateryna Grynko

Hi Joe,

Please follow the steps you did to add graphs in the beginning, but for the "results" page. Maybe you missed something.


Journey Recording using GPS Tracking

Posted: Mon Jul 22, 2013 11:28 pm
by Joe Paisley

Hi Katya,

I've tried to retrace the directions you so graciously provided me for the jplot graphs, and I'm not sure what I have wrong.

When I press the "view ride data" button, I don't navigate to the "results" page now. It looks like an "unexpected token var" in the logcat of Eclipse. The javascript I have on page show on "results" page is:
code

var coordsArray = localStorage.getItem("coordsArray");
var startTime = coordsArray[0].time;
var points = [];
for (var i=0; i<coordsArray&#46;length; i++){
points&#46;push([(coordsArray&#46;time - startTime) &#47; 1000, coordsArray&#46;speed]);
}
var plot = $&#46;jqplot('plot1', [points], {
series:[{showMarker:false}],
axes:{
xaxis:{
label:'Journey time (sec)',
labelRenderer: $&#46;jqplot&#46;CanvasAxisLabelRenderer
},
yaxis:{
label:'Speed (m&#47;h)',
labelRenderer: $&#46;jqplot&#46;CanvasAxisLabelRenderer

var plot = $&#46;jqplot('plot2', [points], {
series:[{showMarker:false}],
axes:{
xaxis:{
label:'Journey Time (minutes)',
labelRender: $&#46;jqplot&#46;CanvasAxisLabelRenderer},
yaxis:{
label:'Altitude (feet)',
labelRenderer: $jqplot&#46;CanvasAxisLabelRenderer}
}
})
}
}
});/code

JSLint produces this feedback:

Image

Do I need to define localStorage and/or put a value in the "var points = []" between the brackets?

And the panels on the page have the html code for "plot 1" and "plot 2."

Thank you so much for your help!


Journey Recording using GPS Tracking

Posted: Tue Jul 23, 2013 8:45 am
by Kateryna Grynko

Hi Joe,

Your code has an incorrect syntax.

Probably you can use the following code but I'm not sure:
precodevar coordsArray = localStorage&#46;getItem("coordsArray");
var startTime = coordsArray[0]&#46;time;
var points = [];
for (var i = 0; i < coordsArray&#46;length; i++) {
points&#46;push([(coordsArray&#46;time - startTime) &#47; 1000, coordsArray&#46;speed]);
}
var plot1 = $&#46;jqplot('plot1', [points], {
series: [{
showMarker: false
}],
axes: {
xaxis: {
label: 'Journey time (sec)',
labelRenderer: $&#46;jqplot&#46;CanvasAxisLabelRenderer
},
yaxis: {
label: 'Speed (m&#47;h)',
labelRenderer: $&#46;jqplot&#46;CanvasAxisLabelRenderer
}
}
});

var plot2 = $&#46;jqplot('plot2', [points], {
series: [{
showMarker: false
}],
axes: {
xaxis: {
label: 'Journey Time (minutes)',
labelRender: $&#46;jqplot&#46;CanvasAxisLabelRenderer
},
yaxis: {
label: 'Altitude (feet)',
labelRenderer: $jqplot&#46;CanvasAxisLabelRenderer
}
}
});/code/pre
Please note the changed variable names - "plot" was declared twice, now there are "plot1" and "plot2".

Find a way to set up JSLint to ignore the formatting of your code http://www.jslint.com/#JSLINT_OPTIONS

Better yet, you can use JSHint.


Journey Recording using GPS Tracking

Posted: Wed Jul 24, 2013 6:48 pm
by abigdreamer

There is a lot of great Info here. (thanks)


Journey Recording using GPS Tracking

Posted: Thu Jul 25, 2013 4:44 pm
by Joe Paisley

Good news! When I go to the "results" page, both jplot graphs show up, but neither have any data in them. I checked the logcat and it didn't display any errors. What could be causing this?

The JSHint utility yielded this on the "page show" event on "results" page.

Image

Once again, thanks immensely for the help. And I'm glad Mike found all of this info useful!


Journey Recording using GPS Tracking

Posted: Thu Jul 25, 2013 5:12 pm
by Maryna Brodina

Hi, JSLint doesn't show errors, please check console.


Journey Recording using GPS Tracking

Posted: Fri Jul 26, 2013 5:14 pm
by Joe Paisley

I'm not sure what to make of the console, I don't really see any errors. Any ideas?
Image


Journey Recording using GPS Tracking

Posted: Fri Jul 26, 2013 5:25 pm
by Maryna Brodina

Please run your app in browser and check if there are JS errors http://docs.appery.io/documentation/a...


Journey Recording using GPS Tracking

Posted: Fri Jul 26, 2013 5:41 pm
by abigdreamer

I would love to Play with this app (as a copy) I know that's asking a lot -- Just saying -- I'm 'abigdreamer' on twitter. Even a public URL would be a great start. Seems like a lot of work to get here so far.