Leaflet API reference

Map

Methods

Methods for Layers and Controls

Method Returns Description
hasLayer(<Layer> layer) Boolean

Returns true if the given layer is currently added to the map

eachLayer(<Function> fn, <Object> context?) this

Iterates over the layers of the map, optionally specifying context of the iterator function.

map.eachLayer(function(layer){
    layer.bindPopup('Hello');
});