leaflet-boundsawarelayergroup
Advanced tools
Comparing version 1.0.0 to 1.1.0
/* | ||
leaflet-boundsawarelayergroup - 1.0.0, Leaflet.LayerGroup plugin to render only layers in the current map bounds | ||
leaflet-boundsawarelayergroup - 1.1.0, Leaflet.LayerGroup plugin to render only layers in the current map bounds | ||
git://github.com/brandoncopeland/Leaflet.boundsAwareLayerGroup.git | ||
@@ -18,5 +18,4 @@ (c) 2013 Brandon Copeland <br@ndoncopeland.com> | ||
L.LayerGroup.include({ | ||
options: defaultOptions, | ||
initialize: function (layers, options) { | ||
L.setOptions(this, defaultOptions); | ||
L.setOptions(this, options); | ||
@@ -23,0 +22,0 @@ |
/* | ||
leaflet-boundsawarelayergroup - 1.0.0, Leaflet.LayerGroup plugin to render only layers in the current map bounds | ||
leaflet-boundsawarelayergroup - 1.1.0, Leaflet.LayerGroup plugin to render only layers in the current map bounds | ||
git://github.com/brandoncopeland/Leaflet.boundsAwareLayerGroup.git | ||
@@ -8,2 +8,2 @@ (c) 2013 Brandon Copeland <br@ndoncopeland.com> | ||
*/ | ||
!function(a){var b={makeBoundsAware:!1},c=a.LayerGroup.prototype.initialize;a.LayerGroup.include({options:b,initialize:function(b,d){a.setOptions(this,d),c.call(this,b)},addLayer:function(a){var b=this.getLayerId(a);return this._layers[b]=a,this._map&&(this.options.makeBoundsAware===!0?this._addForBounds([a],this._map):this._map.addLayer(a)),this},onAdd:function(a){this._map=a,this.options.makeBoundsAware===!0?(this._addForBounds(this._layers,a),a.on("moveend",function(){this._addForBounds(this._layers,a)},this)):this.eachLayer(a.addLayer,a)},_addForBounds:function(a,b){var c,d,e,f=b.getBounds();for(e in a)d=a[e],c=!0,"function"==typeof d.getLatLng?f.contains(d.getLatLng())||(c=!1):"function"==typeof d.getBounds&&(f.intersects(d.getBounds())||(c=!1)),c?b.addLayer(d):b.removeLayer(d)}}),a.layerGroup=function(b,c){return new a.LayerGroup(b,c)},a.featureGroup=function(b,c){return new a.FeatureGroup(b,c)}}(L); | ||
!function(a){var b={makeBoundsAware:!1},c=a.LayerGroup.prototype.initialize;a.LayerGroup.include({initialize:function(d,e){a.setOptions(this,b),a.setOptions(this,e),c.call(this,d)},addLayer:function(a){var b=this.getLayerId(a);return this._layers[b]=a,this._map&&(this.options.makeBoundsAware===!0?this._addForBounds([a],this._map):this._map.addLayer(a)),this},onAdd:function(a){this._map=a,this.options.makeBoundsAware===!0?(this._addForBounds(this._layers,a),a.on("moveend",function(){this._addForBounds(this._layers,a)},this)):this.eachLayer(a.addLayer,a)},_addForBounds:function(a,b){var c,d,e,f=b.getBounds();for(e in a)d=a[e],c=!0,"function"==typeof d.getLatLng?f.contains(d.getLatLng())||(c=!1):"function"==typeof d.getBounds&&(f.intersects(d.getBounds())||(c=!1)),c?b.addLayer(d):b.removeLayer(d)}}),a.layerGroup=function(b,c){return new a.LayerGroup(b,c)},a.featureGroup=function(b,c){return new a.FeatureGroup(b,c)}}(L); |
{ | ||
"name": "leaflet-boundsawarelayergroup", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Leaflet.LayerGroup plugin to render only layers in the current map bounds", | ||
@@ -5,0 +5,0 @@ "main": "dist/leaflet.boundsawarelayergroup.js", |
@@ -8,5 +8,4 @@ var defaultOptions = { | ||
L.LayerGroup.include({ | ||
options: defaultOptions, | ||
initialize: function (layers, options) { | ||
L.setOptions(this, defaultOptions); | ||
L.setOptions(this, options); | ||
@@ -13,0 +12,0 @@ |
18807