kimshuye / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

Need a better error message / detection function for maps script load failure #101

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
r205

Detailed description:
Currently, when there is a problem loading the Maps API external script,
you usually get a strange error about GLatLng not being a constructor.  It
would be better if there was a method you could query to see if the maps
API loaded in hosted mode an error message said that the Maps API didn't
load when you try to instantiate a new Map.

Workaround if you have one:
a JSNI function to test for the existence of oneof the Maps API in the
namespace.

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by galgwt.reviews@gmail.com on 7 Apr 2008 at 12:06

GoogleCodeExporter commented 9 years ago
The attached patch offers a solution using a static method Maps.isInstalled().  
There
are serveral other issues that are intertwined so they are all in the same 
patch.
  - Adds a new "Maps.java" utility class that contains this static method.
  - LatLng() and MapWidget() check the Maps.isInstalled() and throw an exception if
it returns false.
  - HelloMaps explicitly checks isInstalled() and throws up an alert dialog.
  - The default center of the map is now LatLng(0,0) and zoom level 1 (issue 116). 
This helps a lot with the 'uninitialized' issue because previously a default 
LatLng
was created in a static initializer.  The default is now gone from the API.
  - SimpleDemo.java now creates a map with the default MapWidget constructor.
  - Basic unit tests were added for Maps.isInstalled and all MapWidget constructors

Original comment by galgwt.reviews@gmail.com on 3 Jun 2008 at 4:04

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 3 Jun 2008 at 4:07

GoogleCodeExporter commented 9 years ago
Committed in r305,306

Original comment by galgwt.reviews@gmail.com on 4 Jun 2008 at 8:19

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 13 Oct 2008 at 8:54

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 11 Dec 2008 at 3:08