Marker
Class for creating markers on the map.
new constructor
(map, options)
Example:
const marker = new mapgl.Marker(map, {
coordinates: map.getCenter()
});
Parameters
Methods
Class for creating markers on the map.
(map, options)
Example:
const marker = new mapgl.Marker(map, {
coordinates: map.getCenter()
});
()
Destroys the marker.
void
(type, data?)
Calls all event listeners with event type type
type
K
Event type
data?
DynamicObjectEventTable<Marker>[K]
Data transferred to events
this
()
Returns current marker center in geographical coordinates [longitude, latitude]
.
number[]
()
Returns a clockwise rotation angle of the marker icon in degrees.
number
()
Hides the marker.
this
(type, listener)
Removes event listener registered with on
type
K
Event type
listener
(ev: DynamicObjectEventTable<Marker>[K]) => void
Event handler
this
(type, listener)
Registers event listener
type
K
Event type
listener
(ev: DynamicObjectEventTable<Marker>[K]) => void
Event handler
this
(type, listener)
Registers event listener which will be called once
type
K
Event type
listener
(ev: DynamicObjectEventTable<Marker>[K]) => void
Event handler
this
(coordinates)
Sets the geographical center of the marker.
coordinates
number[]
Coordinates [longitude, latitude]
where the center of the marker should be set.
this
(iconOptions?)
Sets the hover icon of the marker. If you pass empty options, the current hover just will be deleted.
(iconOptions)
Sets the icon of the marker.
(labelOptions?)
Sets the label of the marker. If you pass an empty label, the current one just will be deleted.
(angle)
Sets the clockwise rotation of the icon.
angle
number
Angle in degrees.
this
()
Displays hidden marker.
this