| | |
| | | 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); |
| | |
| | | // loading.close(); |
| | | // }); |
| | | }, |
| | | testSDKcluster() { |
| | | let clusterLayer1 = new SmartEarth.ClusterLayer(Viewer, { |
| | | style: "clustering", |
| | | }); |
| | | axios |
| | | .get( |
| | | window.gisBaseUrl + |
| | | "/gisserver/wfsserver/qiyelianqiye?version=1.3.0&request=GetFeature&format=json&typename=企业链企业" |
| | | ) |
| | | .then((res) => { |
| | | let positions = generatePosition(20000); |
| | | positions.forEach((item) => { |
| | | clusterLayer1.add(item, { |
| | | image: "./static/SmartEarthSDK/Workers/image/xzspj/qiye.png", |
| | | }); |
| | | }); |
| | | // res.data.features.forEach((item) => { |
| | | // clusterLayer1.add( |
| | | // new SmartEarth.Degrees( |
| | | // item.geometry.coordinates[0], |
| | | // item.geometry.coordinates[1] |
| | | // ), |
| | | // { |
| | | // name: `QY&${item.properties.ID}&${item.properties["QYMC"]}&${item.properties["DZ"]}&${item.properties["BZDZ"]}&${item.properties["XYDM"]}&${item.geometry.coordinates[0]}&${item.geometry.coordinates[1]}`, |
| | | // image: SmartEarthRootUrl + "Workers/image/mark.png", |
| | | // } |
| | | // ); |
| | | // }); |
| | | }); |
| | | }, |
| | | |
| | | //企业信息聚合 |
| | | qiyeCluster(treeNode) { |
| | | if (treeNode.checked == false) { |
| | |
| | | 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); |
| | |
| | | // } |
| | | // }); |
| | | }, |
| | | |
| | | testSDKcluster() { |
| | | let clusterLayer1 = new SmartEarth.ClusterLayer(Viewer, { |
| | | style: "clustering", |
| | | }); |
| | | axios |
| | | .get( |
| | | window.gisBaseUrl + |
| | | "/gisserver/wfsserver/qiyelianqiye?version=1.3.0&request=GetFeature&format=json&typename=企业链企业" |
| | | ) |
| | | .then((res) => { |
| | | let positions = generatePosition(20000); |
| | | positions.forEach((item) => { |
| | | clusterLayer1.add(item, { |
| | | image: "./static/SmartEarthSDK/Workers/image/xzspj/qiye.png", |
| | | }); |
| | | }); |
| | | // res.data.features.forEach((item) => { |
| | | // clusterLayer1.add( |
| | | // new SmartEarth.Degrees( |
| | | // item.geometry.coordinates[0], |
| | | // item.geometry.coordinates[1] |
| | | // ), |
| | | // { |
| | | // name: `QY&${item.properties.ID}&${item.properties["QYMC"]}&${item.properties["DZ"]}&${item.properties["BZDZ"]}&${item.properties["XYDM"]}&${item.geometry.coordinates[0]}&${item.geometry.coordinates[1]}`, |
| | | // image: SmartEarthRootUrl + "Workers/image/mark.png", |
| | | // } |
| | | // ); |
| | | // }); |
| | | }); |
| | | }, |
| | | // initCluster(treeNode) { |
| | | // let that = this; |
| | | // let imgUrl; |