L.Class powers the OOP facilities of Leaflet and is used to create
almost all of the Leaflet classes documented.
Methods
public addLayer( layer: T in L.LayerGroup<T extends ILayer> ) : LayerGroup
Defined in leaflet/leaflet.d.ts:1558
Adds a given layer to the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
LayerGroup
Defined in leaflet/leaflet.d.ts:1553
Adds the group of layers to the map.
Parameters
Returns
LayerGroup
public clearLayers( ) : LayerGroup
Defined in leaflet/leaflet.d.ts:1588
Removes all the layers from the group.
Returns
LayerGroup
public eachLayer( fn: (layer: T) => void , context?: any ) : LayerGroup
Defined in leaflet/leaflet.d.ts:1594
Iterates over the layers of the group, optionally specifying context of
the iterator function.
Parameters
fn: (layer: T) => void
context?: any optional
Returns
LayerGroup
public getLayer( id: string ) : T in L.LayerGroup<T extends ILayer>
Defined in leaflet/leaflet.d.ts:1578
Returns the layer with the given id.
Parameters
Returns
T in L.LayerGroup<T extends ILayer>
public getLayers( ) : Array<T extends L.ILayer>
Defined in leaflet/leaflet.d.ts:1583
Returns an array of all the layers added to the group.
Returns
Array<T extends L.ILayer>
public hasLayer( layer: T in L.LayerGroup<T extends ILayer> ) : boolean
Defined in leaflet/leaflet.d.ts:1573
Returns true if the given layer is currently added to the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
boolean
public onAdd( map: Map )
Defined in leaflet/leaflet.d.ts:1608
Should contain code that creates DOM elements for the overlay, adds them
to map panes where they should belong and puts listeners on relevant map events.
Called on map.addLayer(layer).
Parameters
public onRemove( map: Map )
Defined in leaflet/leaflet.d.ts:1614
Should contain all clean up code that removes the overlay's elements from
the DOM and removes listeners previously added in onAdd. Called on map.removeLayer(layer).
Parameters
public removeLayer( layer: T in L.LayerGroup<T extends ILayer> ) : LayerGroup
Defined in leaflet/leaflet.d.ts:1563
Removes a given layer from the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
LayerGroup
public removeLayer( id: string ) : LayerGroup
Defined in leaflet/leaflet.d.ts:1568
Removes a given layer of the given id from the group.
Parameters
Returns
LayerGroup
public toGeoJSON( ) : any
Defined in leaflet/leaflet.d.ts:1599
Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
Returns
any