|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WCompositeWidget
eu.webtoolkit.jwt.WGoogleMap
public class WGoogleMap
A widget that displays a google map.
This widget uses the online Google Maps server to display a map. It exposes a part of the google maps API.
This widget supports both version 2 and version 3 of the Google Maps API. The version 2 API is used by default, to enable the version 3 API, use the constructor's version argument.
To use the map on a public server you will need to obtain a key. The widget
will look for this key as the configuration property
"google_api_key". If this configuration property has
not been set, it will use a key that is suitable for localhost.
Styling through CSS is not applicable.
Contributed by: Richard Ulrich.
| Nested Class Summary | |
|---|---|
static class |
WGoogleMap.ApiVersion
ApiVersion. |
static class |
WGoogleMap.Coordinate
A geographical coordinate (latitude/longitude). |
static class |
WGoogleMap.MapTypeControl
MapTypeControl. |
| Field Summary |
|---|
| Fields inherited from class eu.webtoolkit.jwt.WWidget |
|---|
WT_GETPS_JS |
| Constructor Summary | |
|---|---|
WGoogleMap()
Creates a map widget with optionally a parent argument. |
|
WGoogleMap(WContainerWidget parent)
Creates a map widget with optionally a parent argument. |
|
WGoogleMap(WGoogleMap.ApiVersion version)
Creates a map widget with a version and optionally a parent argument. |
|
WGoogleMap(WGoogleMap.ApiVersion version,
WContainerWidget parent)
Creates a map widget with a version and optionally a parent argument. |
|
| Method Summary | |
|---|---|
void |
addCircle(WGoogleMap.Coordinate center,
double radius,
WColor strokeColor,
int strokeWidth)
Adds a circle to the map. |
void |
addCircle(WGoogleMap.Coordinate center,
double radius,
WColor strokeColor,
int strokeWidth,
WColor fillColor)
Adds a circle to the map. |
void |
addIconMarker(WGoogleMap.Coordinate pos,
java.lang.String iconURL)
Adds a icon marker overlay to the map. |
void |
addMarker(WGoogleMap.Coordinate pos)
Adds a marker overlay to the map. |
void |
addPolyline(java.util.List<WGoogleMap.Coordinate> points)
Adds a polyline overlay to the map. |
void |
addPolyline(java.util.List<WGoogleMap.Coordinate> points,
WColor color)
Adds a polyline overlay to the map. |
void |
addPolyline(java.util.List<WGoogleMap.Coordinate> points,
WColor color,
int width)
Adds a polyline overlay to the map. |
void |
addPolyline(java.util.List<WGoogleMap.Coordinate> points,
WColor color,
int width,
double opacity)
Adds a polyline overlay to the map. |
void |
checkResize()
Deprecated. the map is resized automatically when necessary |
void |
clearOverlays()
Removes all overlays from the map. |
JSignal1<WGoogleMap.Coordinate> |
clicked()
The click event. |
void |
disableDoubleClickZoom()
Disables double click to zoom in and out. |
void |
disableDragging()
Disables the dragging of the map. |
void |
disableGoogleBar()
Disables the GoogleBar integrated search control. |
void |
disableScrollWheelZoom()
Disables zooming using a mouse's scroll wheel. |
protected void |
doGmJavaScript(java.lang.String jscode)
Execute a piece of JavaScript that manipulates the map. |
JSignal1<WGoogleMap.Coordinate> |
doubleClicked()
The double click event. |
void |
enableDoubleClickZoom()
Enables double click to zoom in and out (enabled by default). |
void |
enableDragging()
Enables the dragging of the map (enabled by default). |
void |
enableGoogleBar()
Enables the GoogleBar, an integrated search control, on the map. |
void |
enableScrollWheelZoom()
Enables zooming using a mouse's scroll wheel. |
WGoogleMap.ApiVersion |
getApiVersion()
Return the used Google Maps API version. |
JSignal1<WGoogleMap.Coordinate> |
mouseMoved()
This event is fired when the user moves the mouse inside the map. |
void |
openInfoWindow(WGoogleMap.Coordinate pos,
java.lang.CharSequence myHtml)
Opens a text bubble with html text at a specific location. |
void |
panTo(WGoogleMap.Coordinate center)
Changes the center point of the map to the given point. |
void |
remove()
Destructor. |
void |
returnToSavedPosition()
Restores the map view that was saved by savePosition(). |
void |
savePosition()
Stores the current map position and zoom level. |
void |
setCenter(WGoogleMap.Coordinate center)
Sets the map view to the given center. |
void |
setCenter(WGoogleMap.Coordinate center,
int zoom)
Sets the map view to the given center and zoom level. |
void |
setMapTypeControl(WGoogleMap.MapTypeControl type)
Sets the map type control. |
void |
setZoom(int level)
Sets the zoom level to the given new value. |
void |
zoomIn()
Increments zoom level by one. |
void |
zoomOut()
Decrements zoom level by one. |
void |
zoomWindow(WGoogleMap.Coordinate topLeft,
WGoogleMap.Coordinate rightBottom)
Zooms the map to a region defined by a bounding box. |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, createJavaScript, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isExposed, isLayoutSizeAware, isRendered, layoutSizeChanged, positionAt, positionAt, removeStyleClass, resize, scheduleRender, scheduleRerender, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WGoogleMap(WGoogleMap.ApiVersion version,
WContainerWidget parent)
public WGoogleMap(WGoogleMap.ApiVersion version)
Calls
this(version, (WContainerWidget)null)
public WGoogleMap(WContainerWidget parent)
public WGoogleMap()
Calls this((WContainerWidget)null)
| Method Detail |
|---|
public void remove()
remove in class WCompositeWidgetWContainerWidget.removeWidget(WWidget widget)public void addMarker(WGoogleMap.Coordinate pos)
public void addPolyline(java.util.List<WGoogleMap.Coordinate> points,
WColor color,
int width,
double opacity)
Specify a value between 0.0 and 1.0 for the opacity or set the alpha value in the color.
public final void addPolyline(java.util.List<WGoogleMap.Coordinate> points)
Calls
addPolyline(points, WColor.red, 2, 1.0)
public final void addPolyline(java.util.List<WGoogleMap.Coordinate> points,
WColor color)
Calls
addPolyline(points, color, 2, 1.0)
public final void addPolyline(java.util.List<WGoogleMap.Coordinate> points,
WColor color,
int width)
Calls
addPolyline(points, color, width, 1.0)
public void addCircle(WGoogleMap.Coordinate center,
double radius,
WColor strokeColor,
int strokeWidth,
WColor fillColor)
The stroke and fill opacity can be configured respectively in the strokeColor and fillColor. This feature is only supported by the Google Maps API version 3.
public final void addCircle(WGoogleMap.Coordinate center,
double radius,
WColor strokeColor,
int strokeWidth)
Calls
addCircle(center, radius, strokeColor, strokeWidth, new WColor())
public void addIconMarker(WGoogleMap.Coordinate pos,
java.lang.String iconURL)
public void clearOverlays()
public void openInfoWindow(WGoogleMap.Coordinate pos,
java.lang.CharSequence myHtml)
public void setCenter(WGoogleMap.Coordinate center)
public void setCenter(WGoogleMap.Coordinate center,
int zoom)
public void panTo(WGoogleMap.Coordinate center)
If the point is already visible in the current map view, change the center in a smooth animation.
public void zoomWindow(WGoogleMap.Coordinate topLeft,
WGoogleMap.Coordinate rightBottom)
public void setZoom(int level)
public void zoomIn()
public void zoomOut()
public void savePosition()
You can later restore this position using
returnToSavedPosition().
public void returnToSavedPosition()
savePosition().
public void checkResize()
Call this method after the size of the container DOM object has changed, so that the map can adjust itself to fit the new size.
public void enableDragging()
public void disableDragging()
public void enableDoubleClickZoom()
public void disableDoubleClickZoom()
public void enableGoogleBar()
When enabled, this control takes the place of the default Powered By Google logo.
This control is initially disabled.
Note: This functionality is no longer available in the Google Maps API v3.
public void disableGoogleBar()
When disabled, the default Powered by Google logo occupies the position formerly containing this control. Note that this control is already disabled by default.
Note: This functionality is no longer available in the Google Maps API v3.
public void enableScrollWheelZoom()
Scroll wheel zoom is disabled by default.
public void disableScrollWheelZoom()
Scroll wheel zoom is disabled by default.
public void setMapTypeControl(WGoogleMap.MapTypeControl type)
The control allows selecting and switching between supported map types via buttons.
public JSignal1<WGoogleMap.Coordinate> clicked()
This event is fired when the user clicks on the map with the mouse.
public JSignal1<WGoogleMap.Coordinate> doubleClicked()
This event is fired when a double click is done on the map.
public JSignal1<WGoogleMap.Coordinate> mouseMoved()
public WGoogleMap.ApiVersion getApiVersion()
protected void doGmJavaScript(java.lang.String jscode)
This is like WCompositeWidget#doJavaScript() but delays the javascript until the map
has been loaded.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||