Rev 2108 | Blame | Compare with Previous | Last modification | View Log | RSS feed
Google Maps V3 Bindings for GWTThis software is distributed under the Apache 2.0 license.See the file COPYING for more details.For more information on this project, see:http://code.google.com/p/gwt-google-apisContents:gwt-maps-<version>.jar Add this library to your GWT projectjavadoc/ Javadoc generated from the APIsamples/ Short examples that show how to use the API.For support, try the gwt-google-apis Google group.If you think you have found a bug, see the online Issue tracker==================================================================Instructions for using EclipseThese instructions requireGWT 2.4 or higher http://code.google.com/webtoolkitGoogle Plugin for Eclipse http://code.google.com/eclipseJava JDK 1.5 or higher http://java.sun.com/---------- General Instructions ---------------------------------To work with the API in Eclipse, First create a 'Web Application' projectusing the Google Plugin for Eclipse with Google Web Toolkit enabled.This should create a new directory in your workspace for the project anda war/WEB-INF/lib directory. The gwt-maps.jar file need to be copied therethen refresh your project in Eclipse.In Eclipse, add the gwt-maps.jar file to the build path, for example:Project-> Properties-> Java Build Path-> Libraries-> Select gwt-maps.jarNext, open to your entry point's .gwt.xml file and add the line:<inherits name="com.google.maps.gwt.GoogleMaps" />Finally, you need to do one of two things to load the API onapplication startup:1) Update your host file to include the following script tag:<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=SENSOR_TRUE_OR_FALSE"></script>Where the sensor value is either "true" or "false" depending on if youare hooked up to a location sensing device. See the Maps API documentationat http://developers.google.com/maps/documentation/javascript/tutorial2) Load the API through the AjaxLoader library. See the sample"MapsSimpleAjaxLoader.java" for an example. The AjaxLoader library isbundled with the gwt-maps.jar distribution. You will need to addthe following line to your gwt module definition:<inherits name="com.google.gwt.ajaxloader.AjaxLoader" />---------- Running a Sample ----------------------------------------These instructions describe how to take one of the distributed samplesand run them in Eclipse using GWT's DevMode. This assumes you are alreadyconfigured Eclipse with the Google Plugin for Eclipse and have runthrough the GWT tutorials before.Start by create a new Web Application Project. Uncheck the checkbox box toinstall template code so that you start with an empty project.Recursively copy in the sample code into the 'src' directory of your newproject. Your src tree should now have the directoriescom/google/maps/gwt/samples/...Add the gwt-maps.jar to war/WEB-INF/lib and add it to the Java build pathof your project as mentioned in "General Instructions" above.Choose the sample you'd like to run. We'll use MapGeolocation.java as anexample.Find MapGeolocoation.java in the tree, then find the corresponding .html filefor it in one of the 'public' directories. In this case its'map_geolocation.html'.Copy the .html file down into the 'war' directory.Open up the .html file and look at the module name. To be compatiblewith the Google Plugin for Eclipse, you'll need to edit the src attribute'map_geolocation.nocache.js' and prepend the module name:<script type="text/javascript" language="javascript"src="map_geolocation/map_geolocation.nocache.js"></script>Next, you'll need to create a GWT module1) Create a new GWT module using:File--> New--> Other...--> Google Web Toolkit--> Module2) Choose the module name to match the name in the .html file. In ourexample, that would be map_geolocation. The package should be onelevel up from the location of the .java file:Package: com.google.maps.gwt.samples.basicsModule name: map_geolocationInherited Modules: com.google.gwt.user.Usercom.google.maps.gwt.GoogleMaps3) Open the new module and add make the following modifications:Add a 'rename-to' attribute to the module start tag<module rename-to="map_geolocation" />Add in the .java sample as an entry point<entry-pointclass="com.google.maps.gwt.samples.basics.client.MapGeolocation" />Finally, you are ready to launch the sample! Right click on thenew map_geolocation.gwt.xml module and run the sample:Run As--> Web ApplicationChoose the web page you copied down (map_gelocation.html) if prompted.