Gwt Google maps

In case you want google maps in your gwt application you can use the
gwt-google-maps-v3 since gwt-google-apis is currently alpha.

You need to add the gwt-maps.jar on the build path but also you have to add the same jar at the WEB-INF/lib directory

And of course inside your module configuration file you need to add

<inherits name="com.google.maps.gwt.GoogleMaps" />

Then you are ready to go.


private GoogleMap placeMap;
private Marker placeMarker;

public void onModuleLoad() {

RootPanel rootPanel = RootPanel.get("main");
	
final MapOptions myOptions = MapOptions.create();
myOptions.setZoom(14.0);
myOptions.setMapTypeId(MapTypeId.ROADMAP);
LatLng myLatLng = LatLng.create(-34.397, 150.644);
myOptions.setCenter(myLatLng);
placeMap = GoogleMap.create(rootPanel.getElement(),myOptions);

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s