From 799e20f9d44aa2d76243f899b7a4b6f43864ffe5 Mon Sep 17 00:00:00 2001 From: Chris Schlaeger Date: Sun, 23 Oct 2016 13:45:21 +0200 Subject: Fix: Some users report that the map wasn't rendered. While the actual root cause is still unknown, this is an attempt to fix it. --- lib/postrunner/TrackView.rb | 9 ++++++--- lib/postrunner/ViewFrame.rb | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/postrunner/TrackView.rb b/lib/postrunner/TrackView.rb index ff1f0be..3500972 100644 --- a/lib/postrunner/TrackView.rb +++ b/lib/postrunner/TrackView.rb @@ -39,16 +39,19 @@ module PostRunner doc.link({ 'rel' => 'stylesheet', 'href' => 'openlayers/ol.css', 'type' => 'text/css' }) - doc.script({ 'src' => 'openlayers/ol.js' }) - doc.script({ 'src' => 'postrunner/trackview.js' }) + doc.script({ 'language' => 'javascript', 'type' => 'text/javascript', + 'src' => 'openlayers/ol.js' }) + doc.script({ 'language' => 'javascript', 'type' => 'text/javascript', + 'src' => 'postrunner/trackview.js' }) } doc.script(java_script) - doc.body_init_script('pr_trackview_init_xy()') } ViewFrame.new('map', 'Map', 600, nil, true) { doc.div({ 'id' => 'map', 'class' => 'trackmap' }) }.to_html(doc) + + doc.body_init_script('pr_trackview_init_xy();') end private diff --git a/lib/postrunner/ViewFrame.rb b/lib/postrunner/ViewFrame.rb index aa416d0..635d297 100644 --- a/lib/postrunner/ViewFrame.rb +++ b/lib/postrunner/ViewFrame.rb @@ -40,7 +40,8 @@ module PostRunner # Add the necessary style sheet snippets to the document head. doc.head { doc.style(style) - doc.script({ 'src' => 'postrunner/postrunner.js' }) + doc.script({ 'language' => 'javascript', 'type' => 'text/javascript', + 'src' => 'postrunner/postrunner.js' }) } } doc.head { -- cgit v1.2.3