/* azure-maps-spider-clusters Version: 0.0.1 MIT License - Copyright (c) Microsoft Corporation. */ !function(e,L){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var _,t,i,a=(_=L.internal.EventEmitter,r(t=o,i=_),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s),o.prototype.dispose=function(){var e=this,t=e._map,r=t.events,i=e._spiderFeatureLayer,a=e._layerClickEvent,s=e.hideSpiderCluster;r.remove("click",s),r.remove("movestart",s),r.remove("click",e._clusterLayer,a),r.remove("mouseleave",i,e._unhighlightStick),r.remove("mousemove",i,e._highlightStick),r.remove("click",i,a),r.remove("click",e._unclustedLayer,a),t.layers.remove(i),e._spiderFeatureLayer=null,t.layers.remove(e._spiderLineLayer),e._spiderLineLayer=null,e._spiderDataSource.clear(),t.sources.remove(e._spiderDataSource),e._spiderDataSource=null},o.prototype.getOptions=function(){return JSON.parse(JSON.stringify(this._options))},o.prototype.getLayers=function(){var e=this;return{clusterLayer:e._clusterLayer,unclustedLayer:e._unclustedLayer,spiderFeatureLayer:e._spiderFeatureLayer,spiderLineLayer:e._spiderLineLayer}},o.prototype.setOptions=function(e){var t=this,r=t._options;t.hideSpiderCluster(),e&&("number"==typeof e.circleSpiralSwitchover&&(r.circleSpiralSwitchover=e.circleSpiralSwitchover),"number"==typeof e.maxFeaturesInWeb&&(r.maxFeaturesInWeb=e.maxFeaturesInWeb),"number"==typeof e.minSpiralAngleSeperation&&(r.minSpiralAngleSeperation=e.minSpiralAngleSeperation),"number"==typeof e.spiralDistanceFactor&&(r.spiralDistanceFactor=e.spiralDistanceFactor),"number"==typeof e.minCircleLength&&(r.minCircleLength=e.minCircleLength),"boolean"==typeof e.closeWebOnPointClick&&(r.closeWebOnPointClick=e.closeWebOnPointClick),e.stickLayerOptions&&(r.stickLayerOptions=e.stickLayerOptions,t._spiderLineLayer.setOptions(e.stickLayerOptions)),"boolean"==typeof e.visible&&r.visible!==e.visible&&(r.visible=e.visible,t._spiderLineLayer.setOptions({visible:e.visible}),t._spiderFeatureLayer.setOptions({visible:e.visible})))},o.prototype.showSpiderCluster=function(v){var y=this,S=this,g=S._options,e=S._spiderDataSource.getShapes();if(v&&v.properties.cluster){var m=v.properties.cluster_id;if(0g.circleSpiralSwitchover;n?(t=g.minCircleLength/Math.PI,i=2*Math.PI*g.spiralDistanceFactor):(r=2*Math.PI/e.length,(t=g.spiralDistanceFactor/r/Math.PI/2*e.length)t._options.maxFeaturesInWeb?t._datasource.getClusterExpansionZoom(i.cluster_id).then(function(e){t._map.setCamera({center:r,zoom:e})}):t.showSpiderCluster(s)):(void 0!==i._parentId?a=t._datasource.getShapeById(i._parentId):t._currentCluster=null,a&&t._invokeEvent("featureSelected",{cluster:t._currentCluster,shape:a}),t._options.closeWebOnPointClick&&t.hideSpiderCluster()),e.preventDefault()}},o._highlightStick=function(e){var t=o;if(e&&e.shapes&&0