L.Class powers the OOP facilities of Leaflet and is used to create
almost all of the Leaflet classes documented.
Methods
public addEventListener( type: string , fn: (e: L.LeafletEvent) => void , context?: any ) : FeatureGroup
Parameters
type: string
fn: (e: L.LeafletEvent) => void
context?: any optional
Returns
FeatureGroup
public addEventListener( eventMap: any , context?: any ) : FeatureGroup
Parameters
eventMap: any
context?: any optional
Returns
FeatureGroup
public addLayer( layer: T in L.LayerGroup<T extends ILayer> ) : LayerGroup
Adds a given layer to the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
LayerGroup
public addLayer( layer: T in L.LayerGroup<T extends ILayer> ) : LayerGroup
Adds a given layer to the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
LayerGroup
public addOneTimeEventListener( type: string , fn: (e: L.LeafletEvent) => void , context?: any ) : FeatureGroup
Parameters
type: string
fn: (e: L.LeafletEvent) => void
context?: any optional
Returns
FeatureGroup
Adds the group of layers to the map.
Parameters
Returns
LayerGroup
Adds the group of layers to the map.
Parameters
Returns
LayerGroup
public bindPopup( htmlContent: string , options?: PopupOptions ) : FeatureGroup
Binds a popup with a particular HTML content to a click on any layer from the
group that has a bindPopup method.
Parameters
Returns
FeatureGroup
Brings the layer group to the bottom of all other layers.
Returns
FeatureGroup
Brings the layer group to the top of all other layers.
Returns
FeatureGroup
public eachLayer( fn: (layer: T) => void , context?: any ) : LayerGroup
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 eachLayer( fn: (layer: T) => void , context?: any ) : LayerGroup
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 fireEvent( type: string , data?: any ) : FeatureGroup
Parameters
type: string
data?: any optional
Returns
FeatureGroup
Returns the LatLngBounds of the Feature Group (created from bounds and coordinates
of its children).
Returns
LatLngBounds
Defined in mapbox/mapbox.d.ts:161
Gets the filter function for this data layer.
Returns
FilterFunction
public getGeoJSON( ) : any
Defined in mapbox/mapbox.d.ts:175
Get the contents of this layer as GeoJSON data.
Returns
any
public getLayer( id: string ) : T in L.LayerGroup<T extends ILayer>
Returns the layer with the given id.
Parameters
Returns
T in L.LayerGroup<T extends ILayer>
public getLayer( id: string ) : T in L.LayerGroup<T extends ILayer>
Returns the layer with the given id.
Parameters
Returns
T in L.LayerGroup<T extends ILayer>
public getLayers( ) : Array<T extends L.ILayer>
Returns an array of all the layers added to the group.
Returns
Array<T extends L.ILayer>
public getLayers( ) : Array<T extends L.ILayer>
Returns an array of all the layers added to the group.
Returns
Array<T extends L.ILayer>
public hasEventListeners( type: string ) : boolean
Parameters
Returns
boolean
public hasLayer( layer: T in L.LayerGroup<T extends ILayer> ) : boolean
Returns true if the given layer is currently added to the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
boolean
public hasLayer( layer: T in L.LayerGroup<T extends ILayer> ) : boolean
Returns true if the given layer is currently added to the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
boolean
public loadID( id: string ) : any
Defined in mapbox/mapbox.d.ts:151
Load marker GeoJSON data from a map with the given id on Mapbox.
Parameters
Returns
any
public loadURL( url: string ) : any
Defined in mapbox/mapbox.d.ts:146
Load GeoJSON data for this layer from the URL given by url.
Parameters
Returns
any
public off( type: string , fn?: (e: L.LeafletEvent) => void , context?: any ) : FeatureGroup
Parameters
type: string
fn?: (e: L.LeafletEvent) => void optional
context?: any optional
Returns
FeatureGroup
public off( eventMap?: any , context?: any ) : FeatureGroup
Parameters
eventMap?: any optional
context?: any optional
Returns
FeatureGroup
public on( type: string , fn: (e: L.LeafletEvent) => void , context?: any ) : FeatureGroup
Parameters
type: string
fn: (e: L.LeafletEvent) => void
context?: any optional
Returns
FeatureGroup
public on( eventMap: any , context?: any ) : FeatureGroup
Parameters
eventMap: any
context?: any optional
Returns
FeatureGroup
public onAdd( map: Map )
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 )
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 once( type: string , fn: (e: L.LeafletEvent) => void , context?: any ) : FeatureGroup
Parameters
type: string
fn: (e: L.LeafletEvent) => void
context?: any optional
Returns
FeatureGroup
public removeEventListener( type: string , fn?: (e: L.LeafletEvent) => void , context?: any ) : FeatureGroup
Parameters
type: string
fn?: (e: L.LeafletEvent) => void optional
context?: any optional
Returns
FeatureGroup
public removeEventListener( eventMap?: any , context?: any ) : FeatureGroup
Parameters
eventMap?: any optional
context?: any optional
Returns
FeatureGroup
public removeLayer( layer: T in L.LayerGroup<T extends ILayer> ) : LayerGroup
Removes a given layer from the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
LayerGroup
public removeLayer( id: string ) : LayerGroup
Removes a given layer of the given id from the group.
Parameters
Returns
LayerGroup
public removeLayer( layer: T in L.LayerGroup<T extends ILayer> ) : LayerGroup
Removes a given layer from the group.
Parameters
layer: T in L.LayerGroup<T extends ILayer>
Returns
LayerGroup
public removeLayer( id: string ) : LayerGroup
Removes a given layer of the given id from the group.
Parameters
Returns
LayerGroup
public setFilter( filter: FilterFunction ) : any
Defined in mapbox/mapbox.d.ts:156
Sets the filter function for this data layer.
Parameters
Returns
any
public setGeoJSON( geojson: any ) : FeatureLayer
Defined in mapbox/mapbox.d.ts:170
Set the contents of a markers layer: run the provided features through
the filter function and then through the factory function to create
elements for the map. If the layer already has features, they are
replaced with the new features. An empty array will clear the
layer of all features.
Parameters
Returns
FeatureLayer
Sets the given path options to each layer of the group that has a setStyle method.
Parameters
Returns
FeatureGroup
public toGeoJSON( ) : any
Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
Returns
any
public toGeoJSON( ) : any
Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection).
Returns
any