scrapper / postrunner

Application to manage FIT files such as those produced by Garmin fitness devices
GNU General Public License v2.0
62 stars 14 forks source link

map not showing #3

Closed davidwul closed 7 years ago

davidwul commented 8 years ago

Hello, I'm using postrunner with fenix 3 HR and it is working great on linux/windows (thanks!). Only caveat is the map. It is not displaying on the html page redered. Is there something I can do to troubleshoot this issue?

scrapper commented 8 years ago

Are you using version 0.6.0? Earlier version were using the MapQuest service that is no longer available.

davidwul commented 8 years ago

Yes latest version 0.6.0 installed 2 weeks ago.

scrapper commented 8 years ago

Do you know how to enable the debug console in your web browser? If so, please look for error messages. The map rendering is done with openlayers. You can normally find it in .postrunner/html/openlayers/ol.js. It might not be there or not accessible for some reason.

davidwul commented 8 years ago

Here is the only error. (see screenshot) ol.js seems to be loaded.

debug_console

davidwul commented 8 years ago

Problem is still active, I dig a little deeper. If I move pr_trackview_init_xy() after the declaration of the div map (

) then everything is showing. I'm far from being a web expert. but it make some sense as the pr_trackview_init_xy() is sending the result in the div map. I'm still puzzled why this would work on yours ? Any hint?

scrapper commented 8 years ago

I'm not sure I can follow you here. pr_trackview_init_xy() is called via after all HTML elements and scripts have been loaded. There may be a script race, but I don't see it. I've made some changes to the code and pushed it into the git repo. Please try to see if that fixes your problem.

davidwul commented 8 years ago

You're right, the onload in the body tag is reloading the scripts after the content of the page. I updated the code, without more success. But while testing, the order in the postrunner_init function seems to matter. If I move the pr_trackview_init_xy in the first position, then it's showing. Would this help?

marchom commented 7 years ago

I'm hitting the same issue even though pr_trackview_init_xy() has been moved before _map(). Fresh install on linux. Following in the same train of thought, I moved pr_trackview_init_xy() to the first position in the postrunner_init() and all seems well.

tajuma commented 7 years ago

The issue is that readCookie is undefined and the postrunner_init function bails out on error before getting into pr_tracview_init_xy (and why it works if called before others).

Quick and dirty fix is to define a dummy version in HTMLBuilder#initialize (HTMLBuilder.rb) as

          @init_script = create_node('script', <<EOT
function readCookie() { return false; }
function postrunner_init() {
};
EOT
scrapper commented 7 years ago

readCookie() is defined in postrunner.js which is properly included. I can't think of any reason why it's not defined when postrunner_init() is called. Can you try to move the line

to the top right after the tag, please? Does that fix the problem for you?

tajuma commented 7 years ago

Hmm, can't find postrunner.js in the repo.

/tmp % git clone https://github.com/scrapper/postrunner.git
Cloning into 'postrunner'...
remote: Counting objects: 2697, done.
remote: Total 2697 (delta 0), reused 0 (delta 0), pack-reused 2697
Receiving objects: 100% (2697/2697), 5.29 MiB | 888.00 KiB/s, done.
Resolving deltas: 100% (984/984), done.
Checking connectivity... done.
/tmp % find postrunner -name postrunner.js
/tmp % 

In misc/postrunner directory there is only trackview.js.

Does postrunner.js get generated somehow during install as I can't find it from ~/.postrunner/html/postrunner either?

scrapper commented 7 years ago

Ups. >:S That explains why I can't reproduce the problem. Sorry, I screwed this one up! I've added the file to the repo now. Please let me know if that fixes the issue and I'll do an official release.

tajuma commented 7 years ago

Now it works. Thanks!

scrapper commented 7 years ago

Great news! Thanks. Fixed in release 0.7.0 now.