LayerGroup
Used to group several layers and handle them as one. If you add it to the map, any layers added or removed from the group will be added/removed on the map as well. Implements ILayer interface.
L.layerGroup([marker1, marker2])
.addLayer(polyline)
.addTo(map);
Creation
Factory | Description |
---|---|
L.layerGroup(
|
Create a layer group, optionally given an initial set of layers. |
Methods
Method | Returns | Description |
---|---|---|
addTo(
|
this |
Adds the group of layers to the map. |
addLayer(
|
this |
Adds a given layer to the group. |
removeLayer(
|
this |
Removes a given layer from the group. |
removeLayer(
|
this |
Removes a given layer of the given id from the group. |
hasLayer(
|
Boolean |
Returns true if the given layer is currently added to the group. |
getLayer(
|
ILayer |
Returns the layer with the given id. |
getLayers() |
Array |
Returns an array of all the layers added to the group. |
clearLayers() |
this |
Removes all the layers from the group. |
eachLayer(
|
this |
Iterates over the layers of the group, optionally specifying context of the iterator function.
|
toGeoJSON() |
Object |
Returns a GeoJSON representation of the layer group (GeoJSON FeatureCollection). |
v0.1.1335
- L.Wrld.themes
- Event objects
- WrldPoiApi
- L.Map
- L.Marker
- L.Popup
- L.TileLayer
- L.TileLayer.WMS
- L.TileLayer.Canvas
- L.ImageOverlay
- L.Path
- L.Polyline
- L.MultiPolyline
- L.Polygon
- L.MultiPolygon
- L.Rectangle
- L.Circle
- L.CircleMarker
- L.LayerGroup
- L.FeatureGroup
- L.GeoJson
- L.LatLng
- L.LatLngBounds
- L.Point
- L.Bounds
- L.Icon
- L.DivIcon
- L.Control
- L.Control.zoom
- L.Control.Attribution
- L.Control.Layers
- L.Control.Scale
- Events methods
- Event objects
- L.Class
- L.Browser
- L.Util
- L.Transformation
- L.LineUtil
- L.PolyUtil
- L.DomEvent
- L.DomUtil
- L.PosAnimation
- L.Draggable
- L.IHandler
- L.ILayer
- L.IControl
- L.IProjection
- L.ICRS
- Global Switches
- L.noConflict
- L.version
Themes
Events
Services (Optional)
Leaflet
Themes
L.Wrld.themes
Events
Event objects
Services (Optional)
WrldPoiApi
Leaflet
L.Map
L.Marker
L.Popup
L.TileLayer
L.TileLayer.WMS
L.TileLayer.Canvas
L.ImageOverlay
L.Path
L.Polyline
L.MultiPolyline
L.Polygon
L.MultiPolygon
L.Rectangle
L.Circle
L.CircleMarker
L.LayerGroup
L.FeatureGroup
L.GeoJson
L.LatLng
L.LatLngBounds
L.Point
L.Bounds
L.Icon
L.DivIcon
L.Control
L.Control.zoom
L.Control.Attribution
L.Control.Layers
L.Control.Scale
Events methods
Event objects
L.Class
L.Browser
L.Util
L.Transformation
L.LineUtil
L.PolyUtil
L.DomEvent
L.DomUtil
L.PosAnimation
L.Draggable
L.IHandler
L.ILayer
L.IControl
L.IProjection
L.ICRS
Global Switches
L.noConflict
L.version