Thanks for a quick reply.
To correct a little bit - the method signature should be protected.
Also the component are by default stateless . I also refactored getJSinit()
method to remove some listeners or behaviours which case the statless nature
to change to stateful. This is because the class
AbstractAjaxBehavior has stateless hint set to false by default.
@Override
protected boolean getStatelessHint() {
return overlays.isEmpty();
}
//removed some behaviour which can cause stateful component
private String getJSinit()
{
StringBuffer js = new StringBuffer("new WicketMap2('" +
map.getMarkupId()
+ "');\n");
//Commented out as OverLayListner implements IBehaviour
//REMOVED js.append(overlayListener.getJSinit());
js.append(getJSsetCenter(getCenter()));
js.append(getJSsetZoom(getZoom()));
js.append(getJSsetDraggingEnabled(draggingEnabled));
js.append(getJSsetDoubleClickZoomEnabled(doubleClickZoomEnabled));
js.append(getJSsetScrollWheelZoomEnabled(scrollWheelZoomEnabled));
js.append(getJSsetGoogleBarEnabled(googleBarEnabled));
js.append(mapType.getJSsetMapType(this));
// Add the controls.
for (GControl control : controls)
{
js.append(control.getJSadd(this));
}
// Add the overlays.
for (GOverlay overlay : overlays)
{
js.append(overlay.getJSadd());
}
js.append(infoWindow.getJSinit());
//REMOVED for (Object behavior :
getBehaviors(GEventListenerBehavior.class))
// {
//
js.append(((GEventListenerBehavior)behavior).getJSaddListener());
// }
return js.toString();
}
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Google-map-without-GMap2-tp4194249p4194834.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]