| | |
| | | import * as turf from "@turf/turf"; |
| | | import WKT from "terraformer-wkt-parser"; |
| | | import rightServer from "./rightServer"; |
| | | import config from "./config"; |
| | | // import config from "../../../../public/config/config"; |
| | | import CryptoJS from "crypto-js"; |
| | | // import { Store } from "vuex"; |
| | | import store from "@/store"; |
| | |
| | | polyline: SmartEarth.Cesium.Color.fromCssColorString("#ffff0050"), |
| | | polygon: SmartEarth.Cesium.Color.fromCssColorString("#ffff0050"), |
| | | }, |
| | | exportSquare: null, |
| | | topTools(res) { |
| | | this.toolFlag = res.id; |
| | | switch (res.id) { |
| | |
| | | if (this.localPoint) { |
| | | this.setLocalPositionClose(); |
| | | } |
| | | var position = { |
| | | X: parseFloat(res.lon), |
| | | Y: parseFloat(res.lat), |
| | | Altitude: parseFloat(res.alt), |
| | | }; |
| | | this.localPoint = window.sgworld.Creator.CreateImageLabel( |
| | | position, |
| | | config.StaticFileBaseUrl + "/Workers/image/mark.png", |
| | | {}, |
| | | 0, |
| | | "标签点" |
| | | ); |
| | | var id = this.localPoint.item.id; |
| | | window.sgworld.Navigate.flyToObj(this.localPoint.item); |
| | | // var position = { |
| | | // X: parseFloat(res.lon), |
| | | // Y: parseFloat(res.lat), |
| | | // Altitude: parseFloat(res.alt), |
| | | // }; |
| | | // this.localPoint = window.sgworld.Creator.CreateImageLabel( |
| | | // position, |
| | | // config.StaticFileBaseUrl + "/Workers/image/mark.png", |
| | | // {}, |
| | | // 0, |
| | | // "标签点" |
| | | // ); |
| | | // var id = this.localPoint.item.id; |
| | | // window.sgworld.Navigate.flyToObj(this.localPoint.item); |
| | | this.localPoint = window.Viewer.entities.add({ |
| | | name: '坐标定位', |
| | | position: Cesium.Cartesian3.fromDegrees(parseFloat(res.lon), parseFloat(res.lat), res.alt == null ? parseFloat(res.alt) : 0), |
| | | billboard: { |
| | | image: config.StaticFileBaseUrl + '/Workers/image/location.png', |
| | | // 设置贴地 |
| | | heightReference: Cesium.Color.CORNFLOWERBLUE.withAlpha(0.4), |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | scale: 5.0, |
| | | }, |
| | | }); |
| | | this.setViewerFlyTo(this.localPoint) |
| | | }, |
| | | setLocalPositionClose() { |
| | | this.localPoint.deleteObject(); |
| | | this.localPoint = null; |
| | | if (this.localPoint) { |
| | | // this.localPoint.deleteObject(); |
| | | window.Viewer.entities.remove(this.localPoint) |
| | | this.localPoint = null; |
| | | } |
| | | |
| | | }, |
| | | //坡度分析 |
| | | setSlopeMap() { |
| | |
| | | fabric: { |
| | | type: "ElevationRamp", |
| | | uniforms: { |
| | | image: config.StaticFileBaseUrl + "/Assets/Images/color.png", |
| | | image: config.StaticFileBaseUrl + "Assets/Images/color.png", |
| | | minimumHeight: -10000, |
| | | maximumHeight: 10000, |
| | | }, |
| | |
| | | case "l3": //在线制图 |
| | | store.state.isShowMap = true; |
| | | this.setThematicMap(); |
| | | |
| | | break; |
| | | case "l4": |
| | | store.state.isShowMap = true; |
| | |
| | | }, |
| | | thematicTools(res) { |
| | | switch (res.id) { |
| | | case "t1": |
| | | store.state.setLayerManager = !store.state.setLayerManager; |
| | | break; |
| | | case "t2": |
| | | this.createSimpleGraphic("rectangle", "square"); |
| | | break; |
| | | case "t3": |
| | | this.delRectangle(); |
| | | break; |
| | | case "t4": |
| | | store.state.setExportList = !store.state.setExportList |
| | | break; |
| | | } |
| | | }, |
| | |
| | | var east1 = ss[2]; |
| | | var north1 = ss[3]; |
| | | var south1 = ss[1]; |
| | | this.exportSquare = ss; |
| | | var geometry = Cesium.Rectangle.fromDegrees(west1, south1, east1, north1); |
| | | |
| | | |
| | | |
| | | Viewer.camera.setView({ |
| | | destination: Cesium.Rectangle.fromDegrees(west, south, east, north), |
| | | }); |
| | |
| | | // var handle = new SmartEarth.Cesium.ScreenSpaceEventHandler( |
| | | // earthCtrl.viewer.scene.canvas |
| | | // ); |
| | | |
| | | }, |
| | | |
| | | //坐标定位 |
| | |
| | | window.rightViewer.scene.skyAtmosphere.show = false; |
| | | const compass = document.getElementsByClassName("bottom_btn")[0]; |
| | | compass.style.right = "calc(50% + 70px)"; |
| | | compass.style.positions = "absolute"; |
| | | store.state.doubleMap = true; |
| | | setTimeout(() => { |
| | | window.functionGetLayer({ |
| | |
| | | //空间查询属性定位 |
| | | spaceLocation(res) { |
| | | var name = '空间查询'; |
| | | debugger |
| | | |
| | | this.setClearLocation(name); |
| | | switch (res.type) { |
| | | case 'MultiPolygon': |
| | |
| | | outlineColor: Cesium.Color.DODGERBLUE, |
| | | } |
| | | }); |
| | | window.Viewer.flyTo(locationPolygonEntity, { |
| | | duration: 5, |
| | | offset: new SmartEarth.Cesium.HeadingPitchRange(0.0, SmartEarth.Cesium.Math.toRadians(-20.0)) |
| | | }); |
| | | this.setViewerFlyTo(locationPolygonEntity) |
| | | }, |
| | | setLocationPoint(res, name) { |
| | | const position = window.Viewer.entities.add({ |
| | |
| | | // 设置贴地 |
| | | heightReference: Cesium.Color.CORNFLOWERBLUE.withAlpha(0.4), |
| | | verticalOrigin: Cesium.VerticalOrigin.BOTTOM, |
| | | scale: 5.0, |
| | | scale: 1.0, |
| | | }, |
| | | }); |
| | | window.Viewer.flyTo(position, { |
| | | duration: 5, |
| | | offset: new SmartEarth.Cesium.HeadingPitchRange(0.0, SmartEarth.Cesium.Math.toRadians(-20.0)) |
| | | |
| | | this.setViewerFlyTo(position) |
| | | }, |
| | | setViewerFlyTo(entity) { |
| | | |
| | | window.Viewer.flyTo(entity, { |
| | | offset: { |
| | | heading: Cesium.Math.toRadians(0.0), |
| | | pitch: Cesium.Math.toRadians(-45), |
| | | range: 40000 |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | setLocationLine(res, name) { |
| | | var position = []; |
| | | |
| | |
| | | |
| | | }, |
| | | }) |
| | | window.Viewer.flyTo(polyline, { |
| | | duration: 5, |
| | | offset: new SmartEarth.Cesium.HeadingPitchRange(0.0, SmartEarth.Cesium.Math.toRadians(-20.0)) |
| | | }); |
| | | this.setViewerFlyTo(polyline) |
| | | } |
| | | |
| | | }; |