Merge pull request #1300 from rvlasveld/add_hasLayer_to_layerGroup

Add has layer to layer group
This commit is contained in:
Vladimir Agafonkin 2013-01-21 14:29:07 -08:00
commit 140cace2a7

View File

@ -40,6 +40,13 @@ L.LayerGroup = L.Class.extend({
return this;
},
hasLayer: function (layer) {
if (!layer) { return false; }
var id = L.stamp(layer);
return this._layers.hasOwnProperty(id);
},
clearLayers: function () {
this.eachLayer(this.removeLayer, this);
return this;