| | |
| | | window.mapapi.getView().getZoom() == |
| | | window.mapapi.getView().getMaxZoom() |
| | | ) { |
| | | console.log("max"); |
| | | |
| | | clusterSource.setDistance(0); |
| | | } else { |
| | | clusterSource.setDistance(40); |
| | |
| | | window.mapapi.getView().getZoom() == |
| | | window.mapapi.getView().getMaxZoom() |
| | | ) { |
| | | console.log("max"); |
| | | |
| | | clusterSource.setDistance(0); |
| | | } else { |
| | | clusterSource.setDistance(40); |
| | |
| | | window.mapapi.removeLayer(window.jkspclusterLayer); |
| | | window.mapapi.addLayer(window.qiyeclusterLayer); |
| | | loading.close(); |
| | | //监听最大层级 聚合距离为0 取消聚合 |
| | | window.mapapi.getView().on("change:resolution", function (event) { |
| | | if ( |
| | | window.mapapi.getView().getZoom() == |
| | | window.mapapi.getView().getMaxZoom() |
| | | ) { |
| | | clusterSource.setDistance(0); |
| | | // clusterSource.getSource().clear() |
| | | // console.log("企业"); |
| | | } else { |
| | | clusterSource.setDistance(40); |
| | | } |
| | | }); |
| | | }); |
| | | // 监听地图单击事件 |
| | | // window.mapapi.on("singleclick", function (e) { |
| | | // var pixel = window.mapapi.getEventPixel(e.originalEvent); |
| | |
| | | // cluster.billboard.height = 40; |
| | | // } |
| | | // }); |
| | | }, |
| | | }, |
| | | |
| | | testSDKcluster() { |
| | | let clusterLayer1 = new SmartEarth.ClusterLayer(Viewer, { |