You can check for the existence of google.maps as a way to see if the Google Maps library has been loaded, even before the exception is thrown and handle the situation right at the beginning. So rather than a full try-catch, you could do something like this:
if ( google.maps == undefined ) { /* run the non-connected code */ } else { /* run the connected code */ } On Apr 14, 3:10 am, Florian <hesselman...@googlemail.com> wrote: > Hello everyone, > > I have integrated Google Maps Api 3 in my app (Sencha Touch) but when > I'm offline (having no internet connection) and start the app the > following error is thrown: > file:///android_asset/www/app/views/map/MapView.js: Line 144 : > Uncaught ReferenceError: google is not defined > o 04-13 21:48:12.234: E/Web Console(1369): Uncaught ReferenceError: > google is not defined at > file:///android_asset/www/app/views/map/MapView.js:144 > > Actually I just wanna catch this error so that the whole app doenst > stop. But I'm not sure how, since the Google Maps Code is already used > in my index.html file: > <script type="text/javascript" src="http://maps.google.com/maps/api/js? > sensor=true"></script> > > Any tips or advices how/where to wrap an try&catch statement? > > Thanks in advance, > Florian -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.