Layer class

Inheritance
Implementers
Annotations
  • @JS('L.layer')

Constructors

Layer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventParent(Evented obj) Evented
Adds an event parent - an Evented that will receive propagated events
inherited
addTo(LeafletMap map) Layer
Adds the layer to the given map or layer group.
beforeAdd(LeafletMap map) Layer
Optional method. Called on map.addLayer(layer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.
bindPopup(Popup content) Layer
Binds a popup to the layer with the passed content and sets up the necessary event listeners. If a Function is passed it will receive the layer as the first argument and should return a String or HTMLElement
bindTooltip(String content, [TooltipOptions? options]) Tooltip
Binds a tooltip to the layer with the passed content and sets up the options>options?) necessary event listeners. If a Function is passed it will receive the layer as the first argument and should return a String or HTMLElement.
closePopup() Layer
Closes the popup bound to this layer if it is open.
closeTooltip() Layer
Closes the tooltip bound to this layer if it is open.
fire(String type, [dynamic data, bool? propagate]) Evented
Fires an event of the specified type. You can optionally provide an data object — the first argument of the listener function will contain its properties. The event can optionally be propagated to event parents.
inherited
getAttribution() String
Used by the attribution control, returns the attribution option.
getPane([String? name]) Element
Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer
getPopup() Popup
Returns the popup bound to this layer.
getTooltip() Tooltip
Returns the tooltip bound to this layer.
isPopupOpen() bool
Returns true if the popup bound to this layer is currently open.
isTooltipOpen() bool
Returns true if the tooltip bound to this layer is currently open.
listens(String type) bool
Returns true if a particular event type has any listeners attached to it.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String type, [Function? fn, dynamic context]) Evented
Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to on, you must pass the same context to off in order to remove the listener.
inherited
on(String type, Function fn, [dynamic context]) Evented
Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').
inherited
onAdd(LeafletMap map) Layer
Should contain code that creates DOM elements for the layer, adds them to map panes where they should belong and puts listeners on relevant map events. Called on map.addLayer(layer).
once(String type, Function fn, [dynamic context]) Evented
Behaves as on(…), except the listener will only get fired once and then removed.
inherited
onRemove(LeafletMap map) Layer
Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
openPopup([LatLng? latlng]) Layer
Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.
openTooltip([LatLng? latlng]) Layer
Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
remove() Layer
Removes the layer from the map it is currently active on.
removeEventParent(Evented obj) Evented
Removes an event parent, so it will stop receiving propagated events
inherited
removeFrom(LeafletMap map) Layer
Removes the layer from the given map
setPopupContent(Popup content) Layer
Sets the content of the popup bound to this layer.
setTooltipContent(String content) Layer
Sets the content of the tooltip bound to this layer.
togglePopup() Layer
Opens or closes the popup bound to this layer depending on its current state
toggleTooltip() Layer
Opens or closes the tooltip bound to this layer depending on its current state.
toString() String
A string representation of this object.
inherited
unbindPopup() Layer
Removes the popup previously bound with bindPopup.
unbindTooltip() Layer
Removes the tooltip previously bound with bindTooltip.

Operators

operator ==(Object other) bool
The equality operator.
inherited