From e47847c19ed0e3c0cec9cc5c0ee074e6e5408eb9 Mon Sep 17 00:00:00 2001 From: Greg Lonnon Date: Sun, 7 Mar 2010 17:21:23 -0700 Subject: [PATCH] fixed the maps refresh issue --- src/GoogleMapControl.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/GoogleMapControl.cpp b/src/GoogleMapControl.cpp index b748337f6..5185fd5c7 100644 --- a/src/GoogleMapControl.cpp +++ b/src/GoogleMapControl.cpp @@ -221,8 +221,6 @@ void GoogleMapControl::loadRide() { if(loadingPage == true) { - view->stop(); - loadingPage = false; return; } @@ -231,7 +229,19 @@ void GoogleMapControl::loadRide() createHtml(); newRideToLoad = false; loadingPage = true; - view->setHtml(QString(currentPage.str().c_str())); + + QString htmlFile(QDir::tempPath()); + htmlFile.append("/maps.html"); + QFile file(htmlFile); + file.remove(); + file.open(QIODevice::ReadWrite); + file.write(currentPage.str().c_str(),currentPage.str().length()); + file.flush(); + file.close(); + QString filename("file:///"); + filename.append(htmlFile); + QUrl url(filename); + view->load(url); } } @@ -302,17 +312,6 @@ void GoogleMapControl::createHtml() << "" << endl << "" << endl; -#define DEBUG_GMAPS 0 -#if DEBUG_GMAPS - QString htmlFile(QDir::tempPath()); - htmlFile.append("/maps.html"); - QFile file(htmlFile); - file.remove(); - file.open(QIODevice::ReadWrite); - file.write(oss.str().c_str(),oss.str().length()); - file.flush(); - file.close(); -#endif currentPage << oss.str(); }