org.wicketstuff.openlayers
Class OpenLayersMap

java.lang.Object
  extended by org.apache.wicket.Component
      extended by org.apache.wicket.MarkupContainer
          extended by org.apache.wicket.markup.html.WebMarkupContainer
              extended by org.apache.wicket.markup.html.panel.Panel
                  extended by org.wicketstuff.openlayers.OpenLayersMap
All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IConverterLocator, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable, IOpenLayersMap

public class OpenLayersMap
extends Panel
implements IOpenLayersMap

Wicket component to embed Openlayers Maps into your pages.

See Also:
Serialized Form

Nested Class Summary
 class OpenLayersMap.PanDirectionBehavior
           
 class OpenLayersMap.SetCenterBehavior
           
 class OpenLayersMap.SetZoomBehavior
           
 class OpenLayersMap.ZoomInBehavior
           
 class OpenLayersMap.ZoomOutBehavior
           
 
Field Summary
 
Fields inherited from class org.apache.wicket.markup.html.panel.Panel
PANEL
 
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER
 
Constructor Summary
  OpenLayersMap(String id)
           
  OpenLayersMap(String id, boolean developmentMode)
          Constructs a map with a default layer : "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0"
  OpenLayersMap(String id, boolean developmentMode, List<Layer> defaultLayers, HashMap<String,String> options)
          Construct.
  OpenLayersMap(String id, boolean developmentMode, List<Layer> defaultLayers, HashMap<String,String> options, List<Overlay> overlays)
           
  OpenLayersMap(String id, boolean developmentMode, List<Layer> defaultLayers, HashMap<String,String> options, List<Overlay> overlays, PopupListener popupListener)
           
  OpenLayersMap(String id, List<Layer> defaultLayers, HashMap<String,String> options)
           
  OpenLayersMap(String id, List<Layer> defaultLayers, HashMap<String,String> options, List<Overlay> overlays)
           
  OpenLayersMap(String id, List<Layer> defaultLayers, HashMap<String,String> options, List<Overlay> overlays, PopupListener popupListener)
           
protected OpenLayersMap(String id, OpenLayersMapHeaderContributor headerContrib, List<Overlay> overlays, List<Layer> defaultLayers, HashMap<String,String> options)
          Popups up the window as default! is protected to allow subclasses to override the HeaderContributor that is used.
 
Method Summary
 OpenLayersMap addControl(IJavascriptComponent control)
          Add a control.
 OpenLayersMap addOverlay(Overlay overlay)
          Add an overlay.
 OpenLayersMap clearOverlays()
          Clear all overlays.
 Bounds getBounds()
           
 String getBusinessLogicProjection()
           
 PopupListener getCallbackListener()
           
 LonLat getCenter()
           
 List<IJavascriptComponent> getControls()
           
 InfoWindow getInfoWindow()
           
protected  String getJSinit()
          Generates the JavaScript used to instantiate this OpenlayersMap as an JavaScript class on the client side.
 String getJSInstance()
           
 String getJSinvoke(String invocation)
          Convenience method for generating a JavaScript call on this Openlayermap with the given invocation.
 String getJSinvokeNoLineEnd(String invocation)
           
 List<Layer> getLayers()
           
 List<Overlay> getOverlays()
           
 Integer getZoom()
           
 boolean isExternalControls()
           
protected  void onRender()
           
 OpenLayersMap removeControl(IJavascriptComponent control)
          Remove a control.
 OpenLayersMap removeOverlay(Overlay overlay)
          Remove an overlay.
 void setBounds(Bounds bounds)
           
 void setBusinessLogicProjection(String businessLogicProjection)
           
 void setCenter(LonLat center)
           
 void setCenter(LonLat center, Integer zoom)
          Set the center.
 void setExternalControls(boolean externalControls)
           
 void setInfoWindow(InfoWindow infoWindow)
           
 void setLayers(List<Layer> layers)
           
 void setOverlays(List<Overlay> overlays)
           
 void setShowMarkersInLayerSwitcher(boolean showMarkersInLayerSwitcher)
           
 void setZoom(Integer level)
           
 void update(AjaxRequestTarget target)
          Update state from a request to an AJAX target.
 
Methods inherited from class org.apache.wicket.markup.html.panel.Panel
newMarkupSourcingStrategy
 
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebPage, getWebRequest, getWebResponse, getWebSession
 
Methods inherited from class org.apache.wicket.MarkupContainer
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
 
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenLayersMap

public OpenLayersMap(String id,
                     boolean developmentMode)
Constructs a map with a default layer : "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0"

Parameters:
id -

OpenLayersMap

public OpenLayersMap(String id)

OpenLayersMap

public OpenLayersMap(String id,
                     boolean developmentMode,
                     List<Layer> defaultLayers,
                     HashMap<String,String> options)
Construct.

Parameters:
id -

OpenLayersMap

public OpenLayersMap(String id,
                     List<Layer> defaultLayers,
                     HashMap<String,String> options)

OpenLayersMap

public OpenLayersMap(String id,
                     boolean developmentMode,
                     List<Layer> defaultLayers,
                     HashMap<String,String> options,
                     List<Overlay> overlays)

OpenLayersMap

public OpenLayersMap(String id,
                     List<Layer> defaultLayers,
                     HashMap<String,String> options,
                     List<Overlay> overlays)

OpenLayersMap

public OpenLayersMap(String id,
                     List<Layer> defaultLayers,
                     HashMap<String,String> options,
                     List<Overlay> overlays,
                     PopupListener popupListener)

OpenLayersMap

public OpenLayersMap(String id,
                     boolean developmentMode,
                     List<Layer> defaultLayers,
                     HashMap<String,String> options,
                     List<Overlay> overlays,
                     PopupListener popupListener)

OpenLayersMap

protected OpenLayersMap(String id,
                        OpenLayersMapHeaderContributor headerContrib,
                        List<Overlay> overlays,
                        List<Layer> defaultLayers,
                        HashMap<String,String> options)
Popups up the window as default! is protected to allow subclasses to override the HeaderContributor that is used. @see OpenLayersMapHeaderContributor

Parameters:
id -
headerContrib -
overlays -
Method Detail

addControl

public OpenLayersMap addControl(IJavascriptComponent control)
Add a control.

Specified by:
addControl in interface IOpenLayersMap
Parameters:
control - control to add
Returns:
This

addOverlay

public OpenLayersMap addOverlay(Overlay overlay)
Add an overlay.

Specified by:
addOverlay in interface IOpenLayersMap
Parameters:
overlay - overlay to add
Returns:
This

clearOverlays

public OpenLayersMap clearOverlays()
Clear all overlays.

Specified by:
clearOverlays in interface IOpenLayersMap
Returns:
This

getBounds

public Bounds getBounds()
Specified by:
getBounds in interface IOpenLayersMap

getCallbackListener

public PopupListener getCallbackListener()

getCenter

public LonLat getCenter()
Specified by:
getCenter in interface IOpenLayersMap

getControls

public List<IJavascriptComponent> getControls()
Specified by:
getControls in interface IOpenLayersMap

getJSinit

protected String getJSinit()
Generates the JavaScript used to instantiate this OpenlayersMap as an JavaScript class on the client side.

Returns:
The generated JavaScript

getJSInstance

public String getJSInstance()
Specified by:
getJSInstance in interface IOpenLayersMap

getJSinvoke

public String getJSinvoke(String invocation)
Convenience method for generating a JavaScript call on this Openlayermap with the given invocation.

Specified by:
getJSinvoke in interface IOpenLayersMap
Parameters:
invocation - The JavaScript call to invoke on this Openlayermap.
Returns:
The generated JavaScript.

getJSinvokeNoLineEnd

public String getJSinvokeNoLineEnd(String invocation)
Specified by:
getJSinvokeNoLineEnd in interface IOpenLayersMap

getLayers

public List<Layer> getLayers()
Specified by:
getLayers in interface IOpenLayersMap

getOverlays

public List<Overlay> getOverlays()
Specified by:
getOverlays in interface IOpenLayersMap

getZoom

public Integer getZoom()
Specified by:
getZoom in interface IOpenLayersMap

isExternalControls

public boolean isExternalControls()
Specified by:
isExternalControls in interface IOpenLayersMap

removeControl

public OpenLayersMap removeControl(IJavascriptComponent control)
Remove a control.

Specified by:
removeControl in interface IOpenLayersMap
Parameters:
control - control to remove
Returns:
This

removeOverlay

public OpenLayersMap removeOverlay(Overlay overlay)
Remove an overlay.

Specified by:
removeOverlay in interface IOpenLayersMap
Parameters:
overlay - overlay to remove
Returns:
This

setCenter

public void setCenter(LonLat center,
                      Integer zoom)
Set the center.

Specified by:
setCenter in interface IOpenLayersMap
Parameters:
center - center to set

setExternalControls

public void setExternalControls(boolean externalControls)
Specified by:
setExternalControls in interface IOpenLayersMap

setLayers

public void setLayers(List<Layer> layers)
Specified by:
setLayers in interface IOpenLayersMap

setOverlays

public void setOverlays(List<Overlay> overlays)
Specified by:
setOverlays in interface IOpenLayersMap

setZoom

public void setZoom(Integer level)
Specified by:
setZoom in interface IOpenLayersMap

update

public void update(AjaxRequestTarget target)
Update state from a request to an AJAX target.

Specified by:
update in interface IOpenLayersMap

setInfoWindow

public void setInfoWindow(InfoWindow infoWindow)

getInfoWindow

public InfoWindow getInfoWindow()

onRender

protected void onRender()
Overrides:
onRender in class MarkupContainer
See Also:
org.apache.wicket.MarkupContainer#onRender(org.apache.wicket.markup.MarkupStream)

setBounds

public void setBounds(Bounds bounds)
Specified by:
setBounds in interface IOpenLayersMap

setCenter

public void setCenter(LonLat center)
Specified by:
setCenter in interface IOpenLayersMap

setShowMarkersInLayerSwitcher

public void setShowMarkersInLayerSwitcher(boolean showMarkersInLayerSwitcher)
Parameters:
showMarkersInLayerSwitcher - if true the internal markers layer will be visible in the OpenLayers.Control.LayerSwitcher Default is true. Set to false to hide the markers layer from the LayerSwitcher.

setBusinessLogicProjection

public void setBusinessLogicProjection(String businessLogicProjection)
Specified by:
setBusinessLogicProjection in interface IOpenLayersMap

getBusinessLogicProjection

public String getBusinessLogicProjection()
Specified by:
getBusinessLogicProjection in interface IOpenLayersMap


Copyright © 2008-2012. All Rights Reserved.