diff --git a/dist/L.Deflate.js b/dist/L.Deflate.js index 5cd177d..79a88b2 100644 --- a/dist/L.Deflate.js +++ b/dist/L.Deflate.js @@ -1 +1 @@ -"use strict";L.Layer.include({_originalRemove:L.Layer.prototype.remove,remove:function(){if(this.marker){this.marker.remove()}return this._originalRemove()}});L.Map.include({_originalRemoveLayer:L.Map.prototype.removeLayer,removeLayer:function(layer){if(layer.marker){layer.marker.remove()}return this._originalRemoveLayer(layer)}});L.Deflate=L.FeatureGroup.extend({options:{minSize:10,markerCluster:false,markerOptions:{},markerClusterOptions:{},markerType:L.marker},initialize:function(options){L.Util.setOptions(this,options);this._layers=[];this._needsPrepping=[];this._featureLayer=this._getFeatureLayer(options)},_getFeatureLayer:function(){if(this.options.markerLayer){return this.options.markerLayer}if(this.options.markerCluster){console.warn("The options markerCluster and markerClusterOptions will be removed in the next major version of Leaflet.Deflate. Use the markerLayer option to inject a MarkerClusterGroup instance.");return L.markerClusterGroup(this.options.markerClusterOptions)}return L.featureGroup(this.options)},_getBounds:function(path){if(path instanceof L.Circle){path.addTo(this._map);const bounds=path.getBounds();this._map.removeLayer(path);return bounds}return path.getBounds()},_isCollapsed:function(path,zoom){const bounds=path.computedBounds;const northEastPixels=this._map.project(bounds.getNorthEast(),zoom);const southWestPixels=this._map.project(bounds.getSouthWest(),zoom);const width=Math.abs(northEastPixels.x-southWestPixels.x);const height=Math.abs(southWestPixels.y-northEastPixels.y);return height