public final class Marker extends ILayer
Constructor and Description |
---|
Marker(LatLng latLng)
Instantiates a Marker object given a geographical point.
|
Marker(LatLng latLng,
MarkerOptions options)
Instantiates a Marker object given a geographical point and an options
object.
|
Modifier and Type | Method and Description |
---|---|
Marker |
addDragEndListener(DragEndEvent.Type type,
DragEndListener listener)
Adds a drag end listener to a particular drag end event type of the
object.
|
Marker |
addEventListener(Event.Type type,
EventListener listener)
Adds a event listener to a particular event type of the object.
|
Marker |
addMouseListener(MouseEvent.Type type,
MouseListener listener)
Adds a mouse listener to a particular mouse event type of the object.
|
Marker |
addPopupListener(PopupEvent.Type type,
PopupListener listener)
Adds a popup listener to a particular popup event type of the object.
|
void |
addTo(Map map)
Adds the marker to the map.
|
Marker |
bindPopup(Popup popup)
Binds a popup to a click on this marker.
|
Marker |
bindPopup(Popup popup,
PopupOptions options)
Binds a popup with a particular popup configuration options to a click on
this marker.
|
Marker |
bindPopup(String html)
Binds a popup with a particular HTML content to a click on this marker.
|
Marker |
clearAllEventListeners()
Removes all listeners to all events on the object.
|
Marker |
closePopup()
Closes the bound popup of the marker if it's opened.
|
LatLng |
getLatLng()
Returns the current geographical position of the marker.
|
Popup |
getPopup()
Returns the popup previously bound by the
bindPopup method. |
Marker |
openPopup()
Opens the popup previously bound by the
bindPopup method. |
Marker |
removeDragEndListener(DragEndEvent.Type type,
DragEndListener listener)
Removes a drag end listener to a particular drag end event type of the
object.
|
Marker |
removeEventListener(Event.Type type,
EventListener listener)
Removes a event listener to a particular event type of the object.
|
Marker |
removeMouseListener(MouseEvent.Type type,
MouseListener listener)
Removes a mouse listener to a particular mouse event type of the object.
|
Marker |
removePopupListener(PopupEvent.Type type,
PopupListener listener)
Removes a popup listener to a particular popup event type of the object.
|
void |
setIcon(Icon icon)
Changes the marker icon.
|
void |
setLatLng(LatLng latlng)
Changes the marker position to the given point.
|
void |
setOpacity(double opacity)
Changes the opacity of the marker.
|
Marker |
setPopupContent(String html)
Sets an HTML content of the popup of this marker.
|
void |
setZIndexOffset(double offset)
Changes the zIndex offset of the marker.
|
Marker |
togglePopup()
Toggles the popup previously bound by the
bindPopup method. |
Marker |
unbindPopup()
Unbinds the popup previously bound to the marker with
bindPopup . |
void |
update()
Updates the marker position.
|
public Marker(LatLng latLng)
latLng
- geographical locationpublic Marker(LatLng latLng, MarkerOptions options)
latLng
- geographical locationoptions
- marker configuration optionspublic Marker addMouseListener(MouseEvent.Type type, MouseListener listener)
type
- The mouse event type. The types CLICK, DBLCLICK, MOUSEDOWN,
MOUSEOVER, MOUSEOUT, and CONTEXTMENU are supported.listener
- The registered listener.public Marker addEventListener(Event.Type type, EventListener listener)
type
- The event type. The types DRAGSTART, DRAG, MOVE, ADD and
REMOVE are supported.listener
- The registered listener.public Marker addDragEndListener(DragEndEvent.Type type, DragEndListener listener)
type
- The drag end event type. The type DRAGEND is supported.listener
- The registered listener.public Marker addPopupListener(PopupEvent.Type type, PopupListener listener)
type
- The popup event type. The types POPUPOPEN and POPUPCLOSE are
supported.listener
- The registered listener.public Marker removeMouseListener(MouseEvent.Type type, MouseListener listener)
type
- The mouse event type. The types CLICK, DBLCLICK, MOUSEDOWN,
MOUSEOVER, MOUSEOUT, and CONTEXTMENU are supported.listener
- The registered listener.public Marker removeEventListener(Event.Type type, EventListener listener)
type
- The event type. The types DRAGSTART, DRAG, MOVE, ADD and
REMOVE are supported.listener
- The registered listener.public Marker removeDragEndListener(DragEndEvent.Type type, DragEndListener listener)
type
- The drag end event type. The type DRAGEND is supported.listener
- The registered listener.public Marker removePopupListener(PopupEvent.Type type, PopupListener listener)
type
- The popup event type. The types POPUPOPEN and POPUPCLOSE are
supported.listener
- The registered listener.public Marker clearAllEventListeners()
public void addTo(Map map)
map
- The mappublic LatLng getLatLng()
public void setLatLng(LatLng latlng)
latlng
- location of the markerpublic void setIcon(Icon icon)
icon
- marker iconpublic void setZIndexOffset(double offset)
offset
- zIndex offset of the markerpublic void setOpacity(double opacity)
opacity
- opacity of the markerpublic void update()
public Marker bindPopup(String html)
openPopup
method.html
- HTML content of the popuppublic Marker bindPopup(Popup popup)
openPopup
method.popup
- popup objectpublic Marker bindPopup(Popup popup, PopupOptions options)
openPopup
method.popup
- popup objectoptions
- popup configuration optionspublic Marker unbindPopup()
bindPopup
.public Marker openPopup()
bindPopup
method.public Popup getPopup()
bindPopup
method.public Marker closePopup()
public Marker togglePopup()
bindPopup
method.Copyright © 2017. All rights reserved.