JoachimRohde edited this page Aug 9, 2012 · 2 revisions

GMap3 Project

The GMap3 project offers a component to use Google Maps v3 within Wicket 6 applications.


Even though the code is based on which was forked from those components are not compatible!

Maven Artifacts

  • wicketstuff-gmap3
  • wicketstuff-gmap3-examples



At the time of this writing no stable release is available. You have to use the snapshot:




A simple map

        <div wicket:id="map">Map</div>
public class SimplePage extends WebPage

    public SimplePage()
        GMap map = new GMap("map");
        map.setCenter(new GLatLng(52.47649, 13.228573));        

Since version 3 the Google Maps API does not need an API-key anymore. Even though it is still supported by Google (for tracking) this component does NOT provide the possibility to pass a key at the moment.

The setXXXEnabled methods modifies the behavior and/or the appearance of the map. More setters of this kind are:

  • setDoubleClickZoomEnabled
  • setScrollWheelZoomEnabled
  • setDraggingEnabled
  • setMapTypeControlEnabled
  • setStreetViewControlEnabled
  • setZoomControlEnabled The names should be self explainable.

Adding markers with each click on the map

This example demonstrates how to add a marker to each position you click on. The HTML-file stays the same.

public class HomePage extends WebPage
    public HomePage()
        final GMap map = new GMap("map");
        map.add(new ClickListener()
            protected void onClick(AjaxRequestTarget target, GLatLng latLng)
                if (latLng != null)
                    map.addOverlay(new GMarker(new GMarkerOptions(map, latLng)));

Make sure that you add your map to the page before you apply any listeners!

A GMarker is only one overlay among others. Also available:

  • GGroundOverlay
  • GInfoWindow (since version 3 you can have more than one InfoWindow)
  • GPolygon
  • GPolyline

For more examples see the example-project. It covers nearly all methods provided by this component.

Source Code

master Branch

The component itself can be found under The examples under


Just like Wicket itself, GMap3 is licensed under Apache 2.0.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.