Index: src/java/wicket.properties
===================================================================
--- src/java/wicket.properties	(revision 1712)
+++ src/java/wicket.properties	(working copy)
@@ -1 +0,0 @@
-initializer=wicket.contrib.gmap.GMapInitializer
\ No newline at end of file
Index: src/java/wicket/contrib/gmap/GMarker.java
===================================================================
--- src/java/wicket/contrib/gmap/GMarker.java	(revision 1712)
+++ src/java/wicket/contrib/gmap/GMarker.java	(working copy)
@@ -1,49 +1,79 @@
 package wicket.contrib.gmap;
 
 import wicket.Component;
-import wicket.markup.html.WebComponent;
+import wicket.MarkupContainer;
 
 /**
  * Google Maps API's GMarker is represented by this class. Now you can set a
  * wicket component to be displayed within info window. The layout and the size
  * of the component is up to you, Actually the added component can be any wicket
  * component (even any container, panel or border) but not a wicket page. it can
- * be as big as you want as long as it looks good and fits into the page. There
- * is one restriction, the name of the component has to be "<b>gmarkerInfo</b>",
- * otherwise an exceptionn will be thrown.
+ * be as big as you want as long as it looks good and fits into the page.
  * 
+ * @param <T>
+ *            Wicket component
+ * 
  * @author Iulian-Corneliu Costan
  */
-public class GMarker extends Overlay
+public class GMarker<T extends Component> extends Overlay
 {
 	private static final long serialVersionUID = 1L;
 
-	private Component component;
 	private GIcon icon;
 
+	private ComponentFactory<T> componentFactory;
+	private T component;
+
 	/**
 	 * Creates an marker that will have an onClick event attached. When user
-	 * clicks on this marker, wicket <code>component</code> will be rendered.
+	 * clicks on this marker, wicket component created by the specified
+	 * {@code componentFactory} will be rendered.
 	 * 
 	 * @param point
 	 *            the point on the map where this marker will be anchored
-	 * @param component
-	 *            wicket component that needs to be rendered
+	 * @param componentFactory
+	 *            wicket component factory that needs to be rendered
 	 * @see GPoint
 	 */
-	public GMarker(GPoint point, Component component)
+	public GMarker(GPoint point, ComponentFactory<T> componentFactory)
 	{
 		super(point);
-		this.component = component;
+		this.componentFactory = componentFactory;
 	}
 
 	/**
-	 * Returns the attached wicket component.
+	 * Returns the wicket component.
 	 * 
-	 * @return component
+	 * @param parent
+	 *            The parent component. This argument must not be {@code null}.
+	 * @param wicketId
+	 *            The wicket id of the component. This argument must not be
+	 *            {@code null}.
+	 * 
+	 * @throws IllegalArgumentException
+	 *             Thrown if the one or both arguments are {@code null}.
+	 * @return component.
+	 * 
+	 * @since 2.0.0
 	 */
-	public Component getComponent()
+	public Component getComponent(MarkupContainer parent, String wicketId)
+			throws IllegalArgumentException
 	{
+		if (parent == null)
+		{
+			throw new IllegalArgumentException("[parent] argument must not be [null].");
+		}
+
+		if (wicketId == null)
+		{
+			throw new IllegalArgumentException("[wicketId] argument must not be [null].");
+		}
+
+		if (component == null)
+		{
+			component = componentFactory.createComponent(parent, wicketId);
+		}
+
 		return component;
 	}
 
Index: src/java/wicket/contrib/gmap/ComponentFactory.java
===================================================================
--- src/java/wicket/contrib/gmap/ComponentFactory.java	(revision 0)
+++ src/java/wicket/contrib/gmap/ComponentFactory.java	(revision 0)
@@ -0,0 +1,53 @@
+/*
+ * $Id: org.eclipse.jdt.ui.prefs 5004 2006-03-17 20:47:08 -0800 (Fri, 17 Mar
+ * 2006) eelco12 $ $Revision: 5004 $ $Date: 2006-03-17 20:47:08 -0800 (Fri, 17
+ * Mar 2006) $
+ * 
+ * ==============================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package wicket.contrib.gmap;
+
+import java.io.Serializable;
+
+import wicket.Component;
+import wicket.MarkupContainer;
+
+/**
+ * {@code ComponentFactory} responsibles to create a specific component.
+ * 
+ * @param <T>
+ *            Component type
+ * 
+ * @author Edward Yakop
+ * 
+ * @since 2.0.0
+ */
+public interface ComponentFactory<T extends Component> extends Serializable
+{
+	/**
+	 * Create component given the specified {@code parent} argument.
+	 * 
+	 * @param <V>
+	 *            The parent type.
+	 * @param parent
+	 *            The parent. This argument must not be {@code null}.
+	 * @param wicketId
+	 *            The wicket id of the created component. This argument must not be {@code null}.
+	 * 
+	 * @return The component.
+	 * 
+	 * @since 1.0.0
+	 */
+	<V extends MarkupContainer> T createComponent(V parent, String wicketId);
+}
Index: src/java/wicket/contrib/gmap/GMarkerContainer.java
===================================================================
--- src/java/wicket/contrib/gmap/GMarkerContainer.java	(revision 1712)
+++ src/java/wicket/contrib/gmap/GMarkerContainer.java	(working copy)
@@ -1,20 +1,19 @@
 /*
- * $Id$
- * $Revision$
- * $Date$
- *
- * ====================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
+ * $Id$ $Revision:
+ * 1572 $ $Date$
+ * 
+ * ==================================================================== Licensed
+ * under the Apache License, Version 2.0 (the "License"); you may not use this
+ * file except in compliance with the License. You may obtain a copy of the
+ * License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 package wicket.contrib.gmap;
 
@@ -28,55 +27,54 @@
  * <li> gmarker component</li>
  * <li> user's info component </li>
  * </ul>
- * and only one of them can be visible in the same time.
- * At very first time, page rendering time, gmarker component is rendered, the other one is hidden.
- *
+ * and only one of them can be visible in the same time. At very first time,
+ * page rendering time, gmarker component is rendered, the other one is hidden.
+ * 
  * @author Iulian-Corneliu Costan
  * @see GMapAjaxBehavior
  */
 class GMarkerContainer extends WebMarkupContainer
 {
 
-    private GMapAjaxBehavior behaviour;
-    
-    //todo quick hack
-    private String markupId;
+	private static final long serialVersionUID = 1L;
 
-    public GMarkerContainer(MarkupContainer parent, GMarker gmarker)
-    {
-        super(parent, ID);
-        this.markupId = gmarker.getOverlayId();
+	private GMapAjaxBehavior behaviour;
 
-        // todo name constraint
-        Component infoComponent = gmarker.getComponent();
-        if (INFO_COMPONENT_ID.equals(infoComponent.getId()))
-        {
-            infoComponent.setVisible(false);
-        }
-        else
-        {
-            throw new IllegalArgumentException("the ID of your component has to be \"" + INFO_COMPONENT_ID + "\"");
-        }
+	// todo quick hack
+	private String markupId;
 
-        behaviour = new GMapAjaxBehavior();
-        
-        add(behaviour);
-        new GMarkerComponent(this, gmarker, behaviour);
-    }
+	public GMarkerContainer(MarkupContainer parent, GMarker gmarker)
+	{
+		super(parent, ID);
+		this.markupId = gmarker.getOverlayId();
 
-    public void toggleVisibility()
-    {
-        get(GMarkerComponent.ID).setVisible(false);
-        get(INFO_COMPONENT_ID).setVisible(true);
-    }
-    
-    /**
-     * Return the DOM Id of the component that has to be updated.
-     */
-    public String getMarkupId() {
-    	return markupId;
-    }
+		// todo name constraint
+		Component infoComponent = gmarker.getComponent(this, INFO_COMPONENT_ID);
+		infoComponent.setVisible(false);
 
-    public static final String ID = "gmarkerContainer";
-    private static final String INFO_COMPONENT_ID = "gmarkerInfo";
+		behaviour = new GMapAjaxBehavior();
+		add(behaviour);
+
+		new GMarkerComponent(this, gmarker, behaviour);
+	}
+
+	public void toggleVisibility()
+	{
+		Component component = get(GMarkerComponent.ID);
+		component.setVisible(false);
+
+		component = get(INFO_COMPONENT_ID);
+		component.setVisible(true);
+	}
+
+	/**
+	 * Return the DOM Id of the component that has to be updated.
+	 */
+	public String getMarkupId()
+	{
+		return markupId;
+	}
+
+	public static final String ID = "gmarkerContainer";
+	private static final String INFO_COMPONENT_ID = "gmarkerInfo";
 }
Index: pom.xml
===================================================================
--- pom.xml	(revision 1712)
+++ pom.xml	(working copy)
@@ -4,7 +4,6 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>wicket-stuff</groupId>
     <artifactId>wicket-contrib-gmap</artifactId>
-    <packaging>jar</packaging>
     <version>2.0-SNAPSHOT</version>
     <name>Wicket Contrib GMap</name>
     <description>Examples GMap component.</description>
@@ -15,29 +14,22 @@
             <groupId>wicket</groupId>
             <artifactId>wicket</artifactId>
             <version>2.0-SNAPSHOT</version>
-            <type>jar</type>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
             <version>1.0.4</version>
-            <type>jar</type>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
             <version>1.2.11</version>
-            <type>jar</type>
-            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>3.8.1</version>
-            <type>jar</type>
-            <scope>compile</scope>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 
