|
@@ -249,20 +249,21 @@
|
|
|
if (this.isAggregationMyGroup != undefined && this.isAggregationMyGroup != false) {
|
|
|
this.isAggregationMyGroup.clearLayers()
|
|
|
}
|
|
|
- this.map.removeLayer(this.isAggregationLayers)
|
|
|
- this.isAggregationLayers = []
|
|
|
- this.radiusLayers = []
|
|
|
- this.isAggregationLayers = window.L.markerClusterGroup({
|
|
|
- //设置为true时显示聚类所占据的范围
|
|
|
- showCoverageOnHover: true,
|
|
|
- //设置为true时会向低一级聚类缩放
|
|
|
- zoomToBoundsOnClick: true,
|
|
|
- //增加点位时增加聚合动画(否则会出问题)
|
|
|
- animateAddingMarkers: true,
|
|
|
- //最大缩放级别点击聚合图标展开图标
|
|
|
- spiderfyOnMaxZoom: true
|
|
|
- })
|
|
|
-
|
|
|
+ if(this.isAggregationLayers!=null&&this.isAggregationLayers.length>0){
|
|
|
+ this.map.removeLayer(this.isAggregationLayers)
|
|
|
+ this.isAggregationLayers = []
|
|
|
+ this.radiusLayers = []
|
|
|
+ this.isAggregationLayers = window.L.markerClusterGroup({
|
|
|
+ //设置为true时显示聚类所占据的范围
|
|
|
+ showCoverageOnHover: true,
|
|
|
+ //设置为true时会向低一级聚类缩放
|
|
|
+ zoomToBoundsOnClick: true,
|
|
|
+ //增加点位时增加聚合动画(否则会出问题)
|
|
|
+ animateAddingMarkers: true,
|
|
|
+ //最大缩放级别点击聚合图标展开图标
|
|
|
+ spiderfyOnMaxZoom: true
|
|
|
+ })
|
|
|
+ }
|
|
|
} else {
|
|
|
if (this.myGroup != undefined && this.myGroup != false) {
|
|
|
this.myGroup.clearLayers()
|