public class GMap extends org.apache.wicket.markup.html.panel.Panel implements GOverlayContainer
Modifier and Type | Class and Description |
---|---|
class |
GMap.OverlayListener |
class |
GMap.PanDirectionBehavior |
class |
GMap.SetCenterBehavior |
class |
GMap.SetMapTypeBehavior |
class |
GMap.SetZoomBehavior |
class |
GMap.ZoomInBehavior |
class |
GMap.ZoomOutBehavior |
Modifier and Type | Field and Description |
---|---|
protected org.apache.wicket.markup.html.WebMarkupContainer |
map |
ENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING
Constructor and Description |
---|
GMap(String id)
Construct.
|
GMap(String id,
boolean sensor) |
GMap(String id,
GMapHeaderContributor headerContrib)
Construct.
|
Modifier and Type | Method and Description |
---|---|
GMap |
addOverlay(GOverlay overlay)
Add an overlay.
|
void |
fitMarkers(List<GLatLng> markersToShow) |
void |
fitMarkers(List<GLatLng> markersToShow,
boolean showMarkersForPoints) |
void |
fitMarkers(List<GLatLng> markersToShow,
boolean showMarkersForPoints,
double zoomAdjustment)
Makes the map zoom out and centre around all the GLatLng points in markersToShow.
|
GLatLngBounds |
getBounds() |
GLatLng |
getCenter() |
String |
getJSinit()
Generates the JavaScript used to instantiate this GMap3 as an JavaScript class on the client side.
|
String |
getJSinvoke(String invocation)
Convenience method for generating a JavaScript call on this GMap with the given invocation.
|
String |
getJsReference()
Build a reference in JS-Scope.
|
String |
getMapId() |
GMapType |
getMapType() |
int |
getMaxZoom() |
int |
getMinZoom() |
protected GMap.OverlayListener |
getOverlayListener() |
List<GOverlay> |
getOverlays() |
CharSequence |
getTriggerEventScript(String event)
Returns the script for triggering an event on map.
|
CharSequence |
getTriggerResizeScript() |
int |
getZoom() |
boolean |
isDoubleClickZoomEnabled()
Is the function zooming-by-doubleclick enabled?
Disabled by default.
|
boolean |
isDraggingEnabled()
Is dragging allowed? Enabled by default.
|
boolean |
isFailSilently() |
boolean |
isMapTypeControlEnabled()
Is the map type control enabled?
Enabled by default.
|
boolean |
isMarkerClusterEnabled() |
boolean |
isPanControlEnabled()
Is the pan control enabled?
Enabled by default.
|
boolean |
isScaleControlEnabled()
Is the scale control enabled?
Disabled by default.
|
boolean |
isScrollWheelZoomEnabled()
Is the function zooming-by-mousewheel enabled?
Disabled by default.
|
boolean |
isStreetViewControlEnabled()
Is the StreetView control enabled?
Disabled by default.
|
boolean |
isZoomControlEnabled()
Is the zoom control enabled?
Enabled by default.
|
protected void |
onBeforeRender() |
void |
panTo(GLatLng center)
Changes the center point of the map to the given point.
|
GMap |
removeAllOverlays()
Clear all overlays.
|
GMap |
removeOverlay(GOverlay overlay)
Remove an overlay.
|
void |
renderHead(org.apache.wicket.markup.head.IHeaderResponse response) |
void |
setBounds(GLatLngBounds bounds) |
void |
setCenter(GLatLng center)
Set the center.
|
void |
setDoubleClickZoomEnabled(boolean enabled)
Sets if zooming-by-doubleclicking should be allowed or not.
|
void |
setDraggingEnabled(boolean enabled)
Sets if dragging should be allowed or not.
|
void |
setFailSilently(boolean failSilently) |
void |
setMapType(GMapType mapType)
Sets the map type which should be used.
|
void |
setMapTypeControlEnabled(boolean enabled)
Sets if the map type control should be visible or not.
|
void |
setMarkerCluster(GMarkerCluster markerCluster) |
void |
setMaxZoom(int level)
Sets a new maxZoom limit.
|
void |
setMinZoom(int level)
Sets a new minZoom limit.
|
void |
setOverlays(List<GOverlay> overlays) |
void |
setPanControlEnabled(boolean enabled)
Sets if the pan control should be visible or not.
|
void |
setScaleControlEnabled(boolean enabled)
Sets if the scale control should be visible or not.
|
void |
setScrollWheelZoomEnabled(boolean enabled)
Sets if zooming-by-mousewheel should be allowed or not.
|
void |
setStreetViewControlEnabled(boolean enabled)
Sets if the StreeView control should be visible or not.
|
void |
setZoom(int level)
Sets a new zoom level.
|
void |
setZoomControlEnabled(boolean enabled)
Sets if the zoom control should be visible or not.
|
void |
update()
Update state from a request to an AJAX target.
|
getRegionMarkup, newMarkupSourcingStrategy
getWebPage, getWebRequest, getWebResponse, getWebSession
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onDetach, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, 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, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, 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
public GMap(String id)
id
- wicket idpublic GMap(String id, boolean sensor)
public GMap(String id, GMapHeaderContributor headerContrib)
id
- headerContrib
- protected GMap.OverlayListener getOverlayListener()
public String getMapId()
protected void onBeforeRender()
onBeforeRender
in class org.apache.wicket.Component
public void renderHead(org.apache.wicket.markup.head.IHeaderResponse response)
renderHead
in interface org.apache.wicket.markup.html.IHeaderContributor
renderHead
in class org.apache.wicket.Component
public GMap addOverlay(GOverlay overlay)
addOverlay
in interface GOverlayContainer
overlay
- overlay to addGOverlayContainer.addOverlay(GOverlay)
public GMap removeOverlay(GOverlay overlay)
removeOverlay
in interface GOverlayContainer
overlay
- overlay to removeGOverlayContainer.removeOverlay(GOverlay)
public GMap removeAllOverlays()
removeAllOverlays
in interface GOverlayContainer
GOverlayContainer.removeAllOverlays()
public List<GOverlay> getOverlays()
getOverlays
in interface GOverlayContainer
GOverlayContainer.getOverlays()
public GLatLngBounds getBounds()
public void setBounds(GLatLngBounds bounds)
public CharSequence getTriggerEventScript(String event)
event
- public CharSequence getTriggerResizeScript()
public void setDraggingEnabled(boolean enabled)
enabled
- true if dragging should be allowed, false otherwisepublic boolean isDraggingEnabled()
public void setDoubleClickZoomEnabled(boolean enabled)
enabled
- true if zooming-by-doubleclicking should be allowed, false otherwisepublic boolean isDoubleClickZoomEnabled()
public void setScrollWheelZoomEnabled(boolean enabled)
enabled
- true if zooming-by-mousewheel should be allowed, false otherwisepublic boolean isScrollWheelZoomEnabled()
public boolean isStreetViewControlEnabled()
public void setStreetViewControlEnabled(boolean enabled)
enabled
- true if StreetView should be allowed, false otherwisepublic boolean isZoomControlEnabled()
public void setZoomControlEnabled(boolean enabled)
enabled
- true if the zoom-control should be enabled, false otherwisepublic boolean isMapTypeControlEnabled()
public void setMapTypeControlEnabled(boolean enabled)
enabled
- true if you want the user to have the possibility to
change the map type, false otherwisepublic boolean isScaleControlEnabled()
public void setScaleControlEnabled(boolean enabled)
enabled
- true if the scale-control should be enabled, false otherwisepublic boolean isPanControlEnabled()
public void setPanControlEnabled(boolean enabled)
enabled
- true if the pan-control should be enabled, false otherwisepublic void setMapType(GMapType mapType)
mapType
- the map typeGMapType
public int getZoom()
public int getMinZoom()
public int getMaxZoom()
public void setZoom(int level)
level
- the new zoom levelpublic void setMinZoom(int level)
level
- the new minZoom levelpublic void setMaxZoom(int level)
level
- the new maxZoom levelpublic GLatLng getCenter()
public void setCenter(GLatLng center)
center
- center to setpublic void panTo(GLatLng center)
center
- the new center of the mappublic void setMarkerCluster(GMarkerCluster markerCluster)
public boolean isMarkerClusterEnabled()
public String getJSinit()
public String getJSinvoke(String invocation)
invocation
- The JavaScript call to invoke on this GMap.public String getJsReference()
public void fitMarkers(List<GLatLng> markersToShow)
fitMarkers(List, boolean, double)
public void fitMarkers(List<GLatLng> markersToShow, boolean showMarkersForPoints)
fitMarkers(List, boolean, double)
public void fitMarkers(List<GLatLng> markersToShow, boolean showMarkersForPoints, double zoomAdjustment)
Makes the map zoom out and centre around all the GLatLng points in markersToShow.
Big ups to Doug Leeper for the code.
markersToShow
- the points to centre around.showMarkersForPoints
- if true, will also add basic markers to the map for each point focused on. Just a simple convenience
method - you will probably want to turn this off so that you can show more information with each
marker when clicked etc.public void update()
public boolean isFailSilently()
public void setFailSilently(boolean failSilently)
Copyright © 2015. All rights reserved.