So I’ve tried the simple map tutorials, and the samples that come in the pre-releaseed maps v3.8 I’m using GWT v2.4. No matter what I try I get this error:
onModuleLoad() threw an exception
Exception while loading module com.google.gwt.worldbrewers.client.WorldBrewers. See Development Mode for details.
then below says:
java.lang.reflect.InvocationTargetException
Then the original one that causes that is
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.google is undefined
Which was caused by this line:
LatLng myLatLng = LatLng.create(-34.397, 150.644);
The solution to this is trivial really because I get the same exception no matter what I comment out of this code:
LatLng myLatLng = LatLng.create(-34.397, 150.644);
MapOptions myOptions = MapOptions.create();
myOptions.setZoom(8.0);
myOptions.setCenter(myLatLng);
myOptions.setMapTypeId(MapTypeId.ROADMAP);
GoogleMap.create(Document.get().getElementById("map_canvas"), myOptions);
Can someone just show me some really really basic code that works and posts a marker?
When I delete all of the above code my program doesn’t break so its something there (which was from a tutorial).
It seems like the Google Maps JavaScript API hasn’t been loaded.
In the README for the gwt-maps-3.8.0 pre-release library, it has instructions on how to include the script file: