DivOverlay
Defined in: leaflet/div_overlay.ts:50
Base model for Popup and Tooltip. Inherit from it for custom overlays like plugins.
Extends
Extended by
Methods
addEventParent()
addEventParent(
obj:LeafletEvented):this
Defined in: leaflet/leaflet_evented.ts:577
Adds an event parent - an Evented that will receive propagated events.
Parameters
| Parameter | Type |
|---|---|
obj |
LeafletEvented |
Returns
this
Inherited from
bindPopup()
bindPopup(
content:Popup|OverlayContent,options?:PopupOptions):this
Defined in: leaflet/layer.ts:295
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.
Parameters
| Parameter | Type |
|---|---|
content |
Popup | OverlayContent |
options? |
PopupOptions |
Returns
this
Inherited from
bindTooltip()
bindTooltip(
content:Tooltip|OverlayContent| (layer:Layer) =>OverlayContent,options?:TooltipOptions):this
Defined in: leaflet/layer.ts:429
Binds a tooltip 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.
Parameters
| Parameter | Type |
|---|---|
content |
Tooltip | OverlayContent | (layer: Layer) => OverlayContent |
options? |
TooltipOptions |
Returns
this
Inherited from
bringToBack()
bringToBack():
this
Defined in: leaflet/div_overlay.ts:301
Brings this overlay to the back of other overlays (in the same map pane).
Returns
this
bringToFront()
bringToFront():
this
Defined in: leaflet/div_overlay.ts:291
Brings this overlay in front of other overlays (in the same map pane).
Returns
this
close()
close():
this
Defined in: leaflet/div_overlay.ts:127
Closes the overlay.
Alternative to map.closePopup(popup)/.closeTooltip(tooltip)
and layer.closePopup()/.closeTooltip().
Returns
this
closePopup()
closePopup():
this
Defined in: leaflet/layer.ts:332
Closes the popup bound to this layer if it is open.
Returns
this
Inherited from
closeTooltip()
closeTooltip():
this
Defined in: leaflet/layer.ts:529
Closes the tooltip bound to this layer if it is open.
Returns
this
Inherited from
fire()
fire(
type:"loaded"| keyof LeafletEventHandlerFnMap |"contentupdate"|"addpoint"|"addline"|"addlayer"|"tileloaded"|"beforetiledeleted"|"alltilesloaded",data?:object,propagate?:boolean):this
Defined in: leaflet/leaflet_evented.ts:415
Fires an event of the specified type. You can optionally provide a data object — the first argument of the listener function will contain its properties. The event can optionally be propagated to event parents. The data argument may optionally include the sourceTarget property that is passed to the event.
Parameters
| Parameter | Type |
|---|---|
type |
"loaded" | keyof LeafletEventHandlerFnMap | "contentupdate" | "addpoint" | "addline" | "addlayer" | "tileloaded" | "beforetiledeleted" | "alltilesloaded" |
data? |
object |
propagate? |
boolean |
Returns
this
Inherited from
getAttribution()?
optionalgetAttribution():string
Defined in: leaflet/layer.ts:206
Classes deriving from Layer may implement this method.
This optional method should return a string containing HTML to be shown on the MapLibre Attribution control whenever the layer is visible.
Returns
string
Inherited from
getBounds()?
optionalgetBounds():LatLngBounds
Defined in: leaflet/layer.ts:675
Optionally implemented by child classes.
Returns
LatLngBounds
Inherited from
getCenter()?
optionalgetCenter():LatLng
Defined in: leaflet/layer.ts:685
Optionally implemented by child classes.
Returns
LatLng
Inherited from
getContent()
getContent():
OverlayContent
Defined in: leaflet/div_overlay.ts:227
Returns the content of the overlay.
Returns
OverlayContent
getElement()
getElement():
HTMLElement
Defined in: leaflet/div_overlay.ts:244
Returns the HTML container of the overlay.
Returns
HTMLElement
getLatLng()
getLatLng():
LatLng
Defined in: leaflet/div_overlay.ts:208
Returns the geographical point of the overlay.
Returns
LatLng
Overrides
getPane()
getPane(
name?:string):HTMLElement
Defined in: leaflet/layer.ts:154
Returns the HTMLElement representing the named pane on the map. If name is omitted, returns the pane for this layer.
Parameters
| Parameter | Type |
|---|---|
name? |
string |
Returns
HTMLElement
Inherited from
getPopup()
getPopup():
Popup
Defined in: leaflet/layer.ts:369
Returns the popup bound to this layer.
Returns
Inherited from
getTooltip()
getTooltip():
Tooltip
Defined in: leaflet/layer.ts:566
Returns the tooltip bound to this layer.
Returns
Inherited from
isOpen()
isOpen():
boolean
Defined in: leaflet/div_overlay.ts:284
Returns true when the overlay is visible on the map.
Returns
boolean
isPopupOpen()
isPopupOpen():
boolean
Defined in: leaflet/layer.ts:352
Returns true if the popup bound to this layer is currently open.
Returns
boolean
Inherited from
isTooltipOpen()
isTooltipOpen():
boolean
Defined in: leaflet/layer.ts:549
Returns true if the tooltip bound to this layer is currently open.
Returns
boolean
Inherited from
listens()
Call Signature
listens(
type:string,propagate?:boolean):boolean
Defined in: leaflet/leaflet_evented.ts:456
Returns true if a particular event type has any listeners attached to it.
The verification can optionally be propagated, it will return true if parents have the listener attached to it.
Parameters
| Parameter | Type |
|---|---|
type |
string |
propagate? |
boolean |
Returns
boolean
Inherited from
Call Signature
listens(
type:string,fn:Function,context?:object,propagate?:boolean):boolean
Defined in: leaflet/leaflet_evented.ts:457
Returns true if a particular event type has any listeners attached to it.
The verification can optionally be propagated, it will return true if parents have the listener attached to it.
Parameters
| Parameter | Type |
|---|---|
type |
string |
fn |
Function |
context? |
object |
propagate? |
boolean |
Returns
boolean
Inherited from
Call Signature
listens(
type:string,fn:boolean|Function,context:object,propagate:boolean):boolean
Defined in: leaflet/leaflet_evented.ts:458
Returns true if a particular event type has any listeners attached to it.
The verification can optionally be propagated, it will return true if parents have the listener attached to it.
Parameters
| Parameter | Type |
|---|---|
type |
string |
fn |
boolean | Function |
context |
object |
propagate |
boolean |
Returns
boolean
Inherited from
once()
Call Signature
once<
T>(type:T,fn:LeafletGlEventHandlerFnMap[T],context?:object):this
Defined in: leaflet/leaflet_evented.ts:543
Behaves as on, except the listener will only get fired once and then removed.
Type Parameters
| Type Parameter |
|---|
T extends "loaded" | keyof LeafletEventHandlerFnMap | "contentupdate" | "addpoint" | "addline" | "addlayer" | "tileloaded" | "beforetiledeleted" | "alltilesloaded" |
Parameters
| Parameter | Type |
|---|---|
type |
T |
fn |
LeafletGlEventHandlerFnMap[T] |
context? |
object |
Returns
this
Inherited from
Call Signature
once(
types:LeafletGlEventHandlerFnMap,context?:object):this
Defined in: leaflet/leaflet_evented.ts:548
Behaves as on, except the listener will only get fired once and then removed.
Parameters
| Parameter | Type |
|---|---|
types |
LeafletGlEventHandlerFnMap |
context? |
object |
Returns
this
Inherited from
openOn()
openOn(
map?:LeafletGlMap):this
Defined in: leaflet/div_overlay.ts:111
Adds the overlay to the map.
Alternative to map.openPopup(popup)/.openTooltip(tooltip).
Parameters
| Parameter | Type |
|---|---|
map? |
LeafletGlMap |
Returns
this
openPopup()
openPopup(
latlng?:LatLngExpression):this
Defined in: leaflet/layer.ts:317
Opens the bound popup at the specified latlng or at the default popup anchor if no latlng is passed.
Parameters
| Parameter | Type |
|---|---|
latlng? |
LatLngExpression |
Returns
this
Inherited from
openTooltip()
openTooltip(
latlng?:LatLng):this
Defined in: leaflet/layer.ts:509
Opens the bound tooltip at the specified latlng or at the default tooltip anchor if no latlng is passed.
Parameters
| Parameter | Type |
|---|---|
latlng? |
LatLng |
Returns
this
Inherited from
remove()
remove():
this
Defined in: leaflet/layer.ts:131
Removes the layer from the map it is currently active on.
Returns
this
Inherited from
removeEventParent()
removeEventParent(
obj:LeafletEvented):this
Defined in: leaflet/leaflet_evented.ts:586
Removes an event parent, so it will stop receiving propagated events.
Parameters
| Parameter | Type |
|---|---|
obj |
LeafletEvented |
Returns
this
Inherited from
removeFrom()
Call Signature
removeFrom(
map:LeafletGlMap):this
Defined in: leaflet/layer.ts:141
Removes the layer from the given map or LayerGroup.
Parameters
| Parameter | Type |
|---|---|
map |
LeafletGlMap |
Returns
this
Inherited from
Call Signature
removeFrom(
layerGroup:LayerGroup):this
Defined in: leaflet/layer.ts:142
Removes the layer from the given map or LayerGroup.
Parameters
| Parameter | Type |
|---|---|
layerGroup |
LayerGroup |
Returns
this
Inherited from
Call Signature
removeFrom(
obj:LeafletGlMap|LayerGroup):this
Defined in: leaflet/layer.ts:143
Removes the layer from the given map or LayerGroup.
Parameters
| Parameter | Type |
|---|---|
obj |
LeafletGlMap | LayerGroup |
Returns
this
Inherited from
setContent()
setContent(
content:OverlayContent):this
Defined in: leaflet/div_overlay.ts:235
Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function.
The function should return a String or HTMLElement to be used in the overlay.
Parameters
| Parameter | Type |
|---|---|
content |
OverlayContent |
Returns
this
setLatLng()
setLatLng(
latlng:LatLngExpression):this
Defined in: leaflet/div_overlay.ts:215
Sets the geographical point where the overlay will open.
Parameters
| Parameter | Type |
|---|---|
latlng |
LatLngExpression |
Returns
this
setPopupContent()
setPopupContent(
content:OverlayContent):this
Defined in: leaflet/layer.ts:359
Sets the content of the popup bound to this layer.
Parameters
| Parameter | Type |
|---|---|
content |
OverlayContent |
Returns
this
Inherited from
setStyle()?
optionalsetStyle(style:LayerStyle):this
Defined in: leaflet/layer.ts:195
Optional styling function for GeoJSNON.
Parameters
| Parameter | Type |
|---|---|
style |
LayerStyle |
Returns
this
Inherited from
setTooltipContent()
setTooltipContent(
content:OverlayContent):this
Defined in: leaflet/layer.ts:556
Sets the content of the tooltip bound to this layer.
Parameters
| Parameter | Type |
|---|---|
content |
OverlayContent |
Returns
this
Inherited from
toggle()
toggle(
layer?:Layer):this
Defined in: leaflet/div_overlay.ts:139
Opens or closes the overlay bound to layer depending on its current state.
Argument may be omitted only for overlay bound to layer.
Alternative to layer.togglePopup()/.toggleTooltip().
Parameters
| Parameter | Type |
|---|---|
layer? |
Layer |
Returns
this
togglePopup()
togglePopup():
this
Defined in: leaflet/layer.ts:342
Opens or closes the popup bound to this layer depending on its current state.
Returns
this
Inherited from
toggleTooltip()
toggleTooltip():
this
Defined in: leaflet/layer.ts:539
Opens or closes the tooltip bound to this layer depending on its current state.
Returns
this
Inherited from
unbindPopup()
unbindPopup():
this
Defined in: leaflet/layer.ts:276
Removes the popup previously bound with bindPopup.
Returns
this
Inherited from
unbindTooltip()
unbindTooltip():
this
Defined in: leaflet/layer.ts:455
Removes the tooltip previously bound with bindTooltip.
Returns
this
Inherited from
Properties
feature?
optionalfeature:Feature<Geometry, {[name:string]:any; }>
Defined in: leaflet/layer.ts:200
Optional geojson feature.