|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.maps.client.overlay.Overlay
com.google.gwt.maps.client.overlay.Overlay.ConcreteOverlay
com.google.gwt.maps.client.overlay.Marker
public class Marker
Marks a position on the map. It extends the ConcreteOverlay class and thus is added to the map using the MapWidget.addOverlay() method. A marker object has a point, which is the geographical position where the marker is anchored on the map, and an icon. If the icon is not set in the constructor, the default icon Icon.DEFAULT_ICON is used. After it is added to a map, the info window of that map can be opened through the marker. The marker object will fire mouse events and InfoWindow events.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.maps.client.overlay.Overlay |
---|
Overlay.ConcreteOverlay |
Field Summary |
---|
Fields inherited from class com.google.gwt.maps.client.overlay.Overlay |
---|
jsoPeer |
Constructor Summary | |
---|---|
Marker(LatLng point)
Create a new marker at the specified point using default options. |
|
Marker(LatLng point,
MarkerOptions options)
Create a new marker at the specified point using the supplied options overrides. |
Method Summary | |
---|---|
void |
addMarkerClickHandler(MarkerClickHandler handler)
This event is fired when the marker icon was clicked. |
void |
addMarkerDoubleClickHandler(MarkerDoubleClickHandler handler)
This event is fired when the marker icon was double-clicked. |
void |
addMarkerDragEndHandler(MarkerDragEndHandler handler)
If the marker is enabled for dragging, this event is fired when the marker ceases to be dragged. |
void |
addMarkerDragHandler(MarkerDragHandler handler)
If the marker is enabled for dragging, this event is fired when the marker is being dragged. |
void |
addMarkerDragStartHandler(MarkerDragStartHandler handler)
If the marker is enabled for dragging, this event is fired when the marker dragging begins. |
void |
addMarkerInfoWindowBeforeCloseHandler(MarkerInfoWindowBeforeCloseHandler handler)
This event is fired before the info window of the map that was opened through this marker is closed. |
void |
addMarkerInfoWindowCloseHandler(MarkerInfoWindowCloseHandler handler)
This event is fired when the info window of the map that was opened through this marker is closed. |
void |
addMarkerInfoWindowOpenHandler(MarkerInfoWindowOpenHandler handler)
This event is fired when the info window of the map was opened through this marker. |
void |
addMarkerMouseDownHandler(MarkerMouseDownHandler handler)
This event is fired when the DOM "mousedown" event is fired on the marker icon. |
void |
addMarkerMouseOutHandler(MarkerMouseOutHandler handler)
This event is fired when the mouse leaves the area of the marker icon. |
void |
addMarkerMouseOverHandler(MarkerMouseOverHandler handler)
This event is fired when the mouse enters the area of the marker icon. |
void |
addMarkerMouseUpHandler(MarkerMouseUpHandler handler)
This event is fired for the DOM "mouseup" on the marker. |
void |
addMarkerRemoveHandler(MarkerRemoveHandler handler)
This event is fired when the marker is removed from the map, using MapWidget.removeOverlay(com.google.gwt.maps.client.overlay.Overlay) or
MapWidget.clearOverlays() . |
void |
addMarkerVisibilityChangedHandler(MarkerVisibilityChangedHandler handler)
This event is fired when the visibility of the marker is changed (i.e. |
void |
closeInfoWindow()
Closes the info window only if it belongs to this marker. |
Icon |
getIcon()
|
LatLng |
getLatLng()
Returns the geographical coordinates at which this marker is anchored, as set by the constructor or by setLatLng(LatLng) . |
LatLng |
getPoint()
Deprecated. |
java.lang.String |
getTitle()
Returns the title of this marker, as set by the constructor via the MarkerOptions.setTitle(String) method. |
boolean |
isDraggable()
See if this Marker was created as a draggable marker type, that is, the draggable option was set in MarkerOptions when it was constructed. |
boolean |
isDraggingEnabled()
Returns true if this marker is not only a draggable type of
marker. |
boolean |
isVisible()
Returns true if the marker is currently visible on the map. |
void |
removeMarkerClickHandler(MarkerClickHandler handler)
Removes a single handler of this map previously added with addMarkerClickHandler(MarkerClickHandler) . |
void |
removeMarkerDoubleClickHandler(MarkerDoubleClickHandler handler)
Removes a single handler of this map previously added with addMarkerDoubleClickHandler(MarkerDoubleClickHandler) . |
void |
removeMarkerDragEndHandler(MarkerDragEndHandler handler)
Removes a single handler of this map previously added with addMarkerDragEndHandler(MarkerDragEndHandler) . |
void |
removeMarkerDragHandler(MarkerDragHandler handler)
Removes a single handler of this map previously added with addMarkerDragHandler(MarkerDragHandler) . |
void |
removeMarkerDragStartHandler(MarkerDragStartHandler handler)
Removes a single handler of this map previously added with addMarkerDragStartHandler(MarkerDragStartHandler) . |
void |
removeMarkerInfoWindowBeforeCloseHandler(MarkerInfoWindowBeforeCloseHandler handler)
Removes a single handler of this map previously added with addMarkerInfoWindowBeforeCloseHandler(MarkerInfoWindowBeforeCloseHandler)
. |
void |
removeMarkerInfoWindowCloseHandler(MarkerInfoWindowCloseHandler handler)
Removes a single handler of this map previously added with addMarkerInfoWindowCloseHandler(MarkerInfoWindowCloseHandler)
. |
void |
removeMarkerInfoWindowOpenHandler(MarkerInfoWindowOpenHandler handler)
Removes a single handler of this map previously added with addMarkerInfoWindowOpenHandler(MarkerInfoWindowOpenHandler) . |
void |
removeMarkerMouseDownHandler(MarkerMouseDownHandler handler)
Removes a single handler of this map previously added with addMarkerMouseDownHandler(MarkerMouseDownHandler) . |
void |
removeMarkerMouseOutHandler(MarkerMouseOutHandler handler)
Removes a single handler of this map previously added with addMarkerMouseOutHandler(MarkerMouseOutHandler) . |
void |
removeMarkerMouseOverHandler(MarkerMouseOverHandler handler)
Removes a single handler of this map previously added with addMarkerMouseOverHandler(MarkerMouseOverHandler) . |
void |
removeMarkerMouseUpHandler(MarkerMouseUpHandler handler)
Removes a single handler of this map previously added with addMarkerMouseUpHandler(MarkerMouseUpHandler) . |
void |
removeMarkerRemoveHandler(MarkerRemoveHandler handler)
Removes a single handler of this map previously added with addMarkerRemoveHandler(MarkerRemoveHandler) . |
void |
removeMarkerVisibilityChangedHandler(MarkerVisibilityChangedHandler handler)
Removes a single handler of this map previously added with addMarkerVisibilityChangedHandler(MarkerVisibilityChangedHandler)
. |
void |
setDraggingEnabled(boolean value)
Allow this marker to be dragged. |
void |
setImage(java.lang.String url)
Use an image for this marker. |
void |
setLatLng(LatLng point)
Sets the geographical coordinates of the point at which this marker is anchored. |
void |
setPoint(LatLng point)
Deprecated. |
void |
setVisible(boolean visible)
Toggle the visibility of the Marker on the map it is associated with. |
void |
showMapBlowup()
Opens the map info window over the icon of the marker. |
void |
showMapBlowup(InfoWindowContent content)
Opens the map info window over the icon of the marker. |
Methods inherited from class com.google.gwt.maps.client.overlay.Overlay.ConcreteOverlay |
---|
copy, initialize, redraw, remove |
Methods inherited from class com.google.gwt.maps.client.overlay.Overlay |
---|
getZIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Marker(LatLng point)
MapWidget
with the
MapWidget.addOverlay(Overlay)
method.
point
- The point to create the new marker.public Marker(LatLng point, MarkerOptions options)
MapWidget
with the
MapWidget.addOverlay(Overlay)
method.
point
- The point to create the new marker.options
- Use settings in this object to override the Marker defaults.Method Detail |
---|
public void addMarkerClickHandler(MarkerClickHandler handler)
handler
- the handler to call when this event fires.public void addMarkerDoubleClickHandler(MarkerDoubleClickHandler handler)
handler
- the handler to call when this event fires.public void addMarkerDragEndHandler(MarkerDragEndHandler handler)
handler
- the handler to call when this event fires.public void addMarkerDragHandler(MarkerDragHandler handler)
handler
- the handler to call when this event fires.public void addMarkerDragStartHandler(MarkerDragStartHandler handler)
handler
- the handler to call when this event fires.public void addMarkerInfoWindowBeforeCloseHandler(MarkerInfoWindowBeforeCloseHandler handler)
handler
- the handler to call when this event fires.public void addMarkerInfoWindowCloseHandler(MarkerInfoWindowCloseHandler handler)
MarkerInfoWindowBeforeCloseHandler
is fired before this event.
handler
- the handler to call when this event fires.public void addMarkerInfoWindowOpenHandler(MarkerInfoWindowOpenHandler handler)
handler
- the handler to call when this event fires.public void addMarkerMouseDownHandler(MarkerMouseDownHandler handler)
handler
- the handler to call when this event fires.public void addMarkerMouseOutHandler(MarkerMouseOutHandler handler)
handler
- the handler to call when this event fires.public void addMarkerMouseOverHandler(MarkerMouseOverHandler handler)
handler
- the handler to call when this event fires.public void addMarkerMouseUpHandler(MarkerMouseUpHandler handler)
handler
- the handler to call when this event fires.public void addMarkerRemoveHandler(MarkerRemoveHandler handler)
MapWidget.removeOverlay(com.google.gwt.maps.client.overlay.Overlay)
or
MapWidget.clearOverlays()
.
handler
- the handler to call when this event fires.public void addMarkerVisibilityChangedHandler(MarkerVisibilityChangedHandler handler)
visible
parameter refers to the state of the marker after the
visibility change has happened.
handler
- the handler to call when this event fires.public void closeInfoWindow()
public Icon getIcon()
public LatLng getLatLng()
setLatLng(LatLng)
.
@Deprecated public LatLng getPoint()
public java.lang.String getTitle()
MarkerOptions.setTitle(String)
method. Returns null
if
no title is passed in.
public boolean isDraggable()
true
if the marker was initialized as a draggable type
of markerpublic boolean isDraggingEnabled()
true
if this marker is not only a draggable type of
marker.
true
if the marker can currently be draggedisDraggable()
,
setDraggingEnabled(boolean)
public boolean isVisible()
true
if the marker is currently visible on the map.
true
if the marker is currently visible on the map.public void removeMarkerClickHandler(MarkerClickHandler handler)
addMarkerClickHandler(MarkerClickHandler)
.
handler
- the handler to removepublic void removeMarkerDoubleClickHandler(MarkerDoubleClickHandler handler)
addMarkerDoubleClickHandler(MarkerDoubleClickHandler)
.
handler
- the handler to removepublic void removeMarkerDragEndHandler(MarkerDragEndHandler handler)
addMarkerDragEndHandler(MarkerDragEndHandler)
.
handler
- the handler to removepublic void removeMarkerDragHandler(MarkerDragHandler handler)
addMarkerDragHandler(MarkerDragHandler)
.
handler
- the handler to removepublic void removeMarkerDragStartHandler(MarkerDragStartHandler handler)
addMarkerDragStartHandler(MarkerDragStartHandler)
.
handler
- the handler to removepublic void removeMarkerInfoWindowBeforeCloseHandler(MarkerInfoWindowBeforeCloseHandler handler)
addMarkerInfoWindowBeforeCloseHandler(MarkerInfoWindowBeforeCloseHandler)
.
handler
- the handler to removepublic void removeMarkerInfoWindowCloseHandler(MarkerInfoWindowCloseHandler handler)
addMarkerInfoWindowCloseHandler(MarkerInfoWindowCloseHandler)
.
handler
- the handler to removepublic void removeMarkerInfoWindowOpenHandler(MarkerInfoWindowOpenHandler handler)
addMarkerInfoWindowOpenHandler(MarkerInfoWindowOpenHandler)
.
handler
- the handler to removepublic void removeMarkerMouseDownHandler(MarkerMouseDownHandler handler)
addMarkerMouseDownHandler(MarkerMouseDownHandler)
.
handler
- the handler to removepublic void removeMarkerMouseOutHandler(MarkerMouseOutHandler handler)
addMarkerMouseOutHandler(MarkerMouseOutHandler)
.
handler
- the handler to removepublic void removeMarkerMouseOverHandler(MarkerMouseOverHandler handler)
addMarkerMouseOverHandler(MarkerMouseOverHandler)
.
handler
- the handler to removepublic void removeMarkerMouseUpHandler(MarkerMouseUpHandler handler)
addMarkerMouseUpHandler(MarkerMouseUpHandler)
.
handler
- the handler to removepublic void removeMarkerRemoveHandler(MarkerRemoveHandler handler)
addMarkerRemoveHandler(MarkerRemoveHandler)
.
handler
- the handler to removepublic void removeMarkerVisibilityChangedHandler(MarkerVisibilityChangedHandler handler)
addMarkerVisibilityChangedHandler(MarkerVisibilityChangedHandler)
.
handler
- the handler to removepublic void setDraggingEnabled(boolean value)
MarkerOptions.setDraggable(boolean)
option.
value
- true
to allow the marker to be dragged.public void setImage(java.lang.String url)
url
- The URL to the image to display.public void setLatLng(LatLng point)
point
- the geographical coordinates at which this marker is anchored.@Deprecated public void setPoint(LatLng point)
point
- position to move the marker to.public void setVisible(boolean visible)
visible
- set to true
to make the marker visible.public void showMapBlowup()
public void showMapBlowup(InfoWindowContent content)
zoomLevel
and mapType
in the InfoWindowContent
are applicable.
content
- overridden settings of zoomLevel
or
mapType
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |