/* esri-leaflet-heatmap - v2.0.1 - Wed Mar 09 2022 08:41:30 GMT-0600 (Central Standard Time)
 * Copyright (c) 2022 Environmental Systems Research Institute, Inc.
 * Apache-2.0 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("leaflet"),require("esri-leaflet")):"function"==typeof define&&define.amd?define(["exports","leaflet","esri-leaflet"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).L=e.L||{},e.L.esri=e.L.esri||{},e.L.esri.Heat={}),e.L,e.L.esri)}(this,(function(e,t,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=a(t),s="2.0.1",n=i.FeatureManager.extend({initialize:function(e){i.FeatureManager.prototype.initialize.call(this,e),e=r.default.setOptions(this,e),this._cache={},this._active={},this.heat=window.L.heatLayer([],e)},onAdd:function(e){i.FeatureManager.prototype.onAdd.call(this,e),this._map.addLayer(this.heat)},onRemove:function(e){i.FeatureManager.prototype.onRemove.call(this,e),this._map.removeLayer(this.heat)},createLayers:function(e){for(var t=e.length-1;t>=0;t--){var i=e[t],a=i.id,s=new r.default.LatLng(i.geometry.coordinates[1],i.geometry.coordinates[0]);this._cache[a]=s,!this._active[a]&&(!this.options.timeField||this.options.timeField&&this._featureWithinTimeRange(i))&&(this._active[a]=s,this.heat._latlngs.push(s))}this.heat.redraw()},addLayers:function(e){for(var t=e.length-1;t>=0;t--){var i=e[t];if(!this._active[i]){var a=this._cache[i];this.heat._latlngs.push(a),this._active[i]=a}}this.heat.redraw()},removeLayers:function(e,t){for(var i=[],a=e.length-1;a>=0;a--){var r=e[a];this._active[r]&&delete this._active[r],this._cache[r]&&t&&delete this._cache[r]}for(var s in this._active)i.push(this._active[s]);this.heat.setLatLngs(i)},setOptions:function(e){this.heat.setOptions(e)},redraw:function(){this.heat.redraw()}});function o(e){return new n(e)}e.FeatureLayer=n,e.VERSION=s,e.default=o,e.featureLayer=o,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=esri-leaflet-heatmap.js.map
