5.2. Gmap2

The gmap2 component renders a collection of objects in a Google map:

All that is required is for the object to implement Locatable interface, which in turn returns a Location value object:

package org.starobjects.wicket.view.gmap2.applib;

public interface Locatable {
    Location getLocation();
}

If deploying on localhost, no API key is required. However, internet deployments do require an key, which should be specified as an init-parameter for the Wicket filter in web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app ... >

  ...

  <filter>
    <filter-name>wicket.app</filter-name>
    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
    <init-param>
      <param-name>applicationClassName</param-name>
      <param-value>org.starobjects.wicket.viewer.app.WicketObjectsApplication</param-value>
    </init-param>
    <init-param>
      <param-name>GOOGLE_MAPS_API_KEY</param-name>
      <param-value>(key here)</param-value>
    </init-param>
  </filter>

</web-app>