Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Journey Recording using GPS Tracking

Hi Joe,

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

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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!

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Journey Recording using GPS Tracking

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.

abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

Journey Recording using GPS Tracking

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

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Journey Recording using GPS Tracking

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

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Journey Recording using GPS Tracking

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

abigdreamer
Posts: 0
Joined: Fri Jul 12, 2013 7:20 pm

Journey Recording using GPS Tracking

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.

Return to “Issues”