I'm using Google Maps v3 in my sencha touch 1.x app, that offers an online and offline mode. My problem is now, that the Google Maps v3 API is only usable when having the following code in my index.html:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
But because I'm using an app that can also be startet when offline (when no Wifi/UMTS is available), the Google Code in the index.html isnt loaded when the app starts offline. So when I go online then (having WifI again) and resume to my app, I cant use any Google Map components because it wasnt loaded at the start in the index.html.
So here my question, is it possible to add the javascript code for Google Maps to the index.html file while the app is already running or is it possible to reload the Google Maps API somehow? Right now I only see the way that I always have to restart the whole app to make the map usable this way.
Thanks in advance, Florian
I'm not familiar with Sencha, but you can load the API asynchronously as well. See the developer documentation. I presume that you can use the Sencha framework to test for offline/online. So if you load the page, it's offline, then test again and it's online, you should load the API via the approach outlined in the documentation here: