| | |
| | | mounted() { |
| | | store.setNavigatorShow(false); |
| | | store.setMapToolShow(false); |
| | | // window.mapapi.getView().setCenter(ol.proj.fromLonLat([4.606512, 2.621472])); |
| | | window.mapapi.getView().setCenter(ol.proj.fromLonLat([116.505348, 39.795592])); |
| | | window.mapapi.getView().setCenter(ol.proj.fromLonLat([4.606512, 2.621472])); |
| | | // window.mapapi.getView().setCenter(ol.proj.fromLonLat([116.505348, 39.795592])); |
| | | addHistoryLayer(this.currentValue); |
| | | if (_GLOBAL.GPSMarker) { |
| | | window.mapapi.removeLayer(_GLOBAL.GPSMarker); |
| | |
| | | // 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) { |
| | |
| | | // cluster.billboard.height = 40; |
| | | // } |
| | | // }); |
| | | }, |
| | | |
| | | 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; |
| | |
| | | loadBaseMap, |
| | | loadGeoMap, |
| | | listenDirection, |
| | | getCurrentPosition |
| | | getCurrentPosition, |
| | | } from "@/utils/tool"; |
| | | // import Map from "ol/Map.js"; |
| | | // import TileLayer from "ol/layer/Tile.js"; |
| | |
| | | state: store.history, |
| | | }; |
| | | }, |
| | | created() { }, |
| | | created() {}, |
| | | mounted() { |
| | | this.$nextTick(function () { |
| | | ol.Map.prototype.getLayerByName = function (name) { |
| | |
| | | let width = projectionExtent |
| | | ? ol.extent.getWidth(projectionExtent) |
| | | : ol.extent.getWidth( |
| | | ol.extent.applyTransform([-180.0, -90.0, 180.0, 90.0], fromLonLat) |
| | | ); |
| | | ol.extent.applyTransform([-180.0, -90.0, 180.0, 90.0], fromLonLat) |
| | | ); |
| | | |
| | | let resolutions = []; |
| | | let matrixIds = []; |
| | |
| | | }); |
| | | |
| | | window.mapapi = map; |
| | | window.layersArray = window.mapapi.getLayers(); |
| | | // addImageLayer(); |
| | | // addAnnotationLayer(); |
| | | window.mapapi.getView().setZoom(14); |
| | |
| | | console.log(window.gisBaseUrl); |
| | | Axios.get( |
| | | window.gisBaseUrl + |
| | | "/gisserver/wfsserver/qiyelianqiye?version=1.3.0&request=GetFeature&format=json&typename=企业链企业" |
| | | "/gisserver/wfsserver/qiyelianqiye?version=1.3.0&request=GetFeature&format=json&typename=企业链企业" |
| | | ).then((res) => { |
| | | console.log(res); |
| | | }); |
| | |
| | | tileSize: 512 |
| | | }), |
| | | }); |
| | | window.mapapi.addLayer(_GLOBAL.ImageLayer); |
| | | // window.mapapi.addLayer(_GLOBAL.ImageLayer); |
| | | layersArray.insertAt(1, _GLOBAL.ImageLayer); |
| | | } |
| | | |
| | | //加载白色地图 |
| | |
| | | }, |
| | | }), |
| | | }); |
| | | window.mapapi.addLayer(_GLOBAL.baseMap) |
| | | // window.mapapi.addLayer(_GLOBAL.baseMap) |
| | | layersArray.insertAt(1, _GLOBAL.baseMap); |
| | | |
| | | } |
| | | |
| | |
| | | url: ` https://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}`, |
| | | }), |
| | | }); |
| | | window.mapapi.addLayer(_GLOBAL.geoMap); |
| | | |
| | | // window.mapapi.addLayer(_GLOBAL.geoMap); |
| | | layersArray.insertAt(1, _GLOBAL.geoMap); |
| | | } |
| | | |
| | | |