| | |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'viewer', |
| | | 'twoOrThree', |
| | | // 起点 |
| | | 'startingPoint', |
| | |
| | | // 初始化图标图层 |
| | | if (this.endLayer == null) { |
| | | this.endLayer = new global.DC.VectorLayer('endLayer') |
| | | this.viewer.addLayer(this.endLayer) |
| | | global.viewer.addLayer(this.endLayer) |
| | | } else { |
| | | this.endLayer.clear() |
| | | } |
| | |
| | | // 初始化图标图层 |
| | | if (this.startLayer == null) { |
| | | this.startLayer = new global.DC.VectorLayer('startLayer') |
| | | this.viewer.addLayer(this.startLayer) |
| | | global.viewer.addLayer(this.startLayer) |
| | | } else { |
| | | this.startLayer.clear() |
| | | } |
| | |
| | | // 关闭其他地图事件 |
| | | that.$store.commit('set_closeMapClick', true) |
| | | // 添加标记 |
| | | const tooltip = that.viewer.tooltip |
| | | const tooltip = global.viewer.tooltip |
| | | tooltip.enable = true |
| | | let title = '' |
| | | if (val == 'start') { |
| | |
| | | // 初始化图标图层 |
| | | if (this.startLayer == null) { |
| | | this.startLayer = new global.DC.VectorLayer('startLayer') |
| | | this.viewer.addLayer(this.startLayer) |
| | | global.viewer.addLayer(this.startLayer) |
| | | } else { |
| | | this.startLayer.clear() |
| | | } |
| | |
| | | // 初始化图标图层 |
| | | if (this.endLayer == null) { |
| | | this.endLayer = new global.DC.VectorLayer('endLayer') |
| | | this.viewer.addLayer(this.endLayer) |
| | | global.viewer.addLayer(this.endLayer) |
| | | } else { |
| | | this.endLayer.clear() |
| | | } |
| | | } |
| | | that.overChouse = false // 开启事件 |
| | | // 地图选点 |
| | | that.clicks = that.viewer.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | that.clicks = global.viewer.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | if (that.overChouse) { |
| | | return |
| | | } |
| | |
| | | // 开启其他地图事件 |
| | | that.$store.commit('set_closeMapClick', false) |
| | | }) |
| | | that.moves = that.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) => { |
| | | that.moves = global.viewer.on(global.DC.MouseEventType.MOUSE_MOVE, (e) => { |
| | | if (that.overChouse) { |
| | | return |
| | | } |
| | |
| | | |
| | | if (this.routeLayer == null) { |
| | | this.routeLayer = new global.DC.VectorLayer('navigation') |
| | | this.viewer.addLayer(this.routeLayer) |
| | | global.viewer.addLayer(this.routeLayer) |
| | | } else { |
| | | this.routeLayer.clear() |
| | | } |
| | |
| | | }) |
| | | this.routeLayer.addOverlay(polyline) |
| | | if (this.twoOrThree == '真三维') { |
| | | this.viewer.flyTo(this.routeLayer) |
| | | global.viewer.flyTo(this.routeLayer) |
| | | } else { |
| | | var longitude = null |
| | | var latitude = null |
| | |
| | | latitude = (endLat - startLat) / 2 + startLat |
| | | } |
| | | that.isOverRouter = true |
| | | this.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |
| | |
| | | this.routeLayer.addOverlay(polyline) |
| | | |
| | | if (this.twoOrThree == '真三维') { |
| | | this.viewer.flyTo(this.routeLayer) |
| | | global.viewer.flyTo(this.routeLayer) |
| | | } else { |
| | | var longitude = null |
| | | var latitude = null |
| | |
| | | latitude = (endLat - startLat) / 2 + startLat |
| | | } |
| | | that.isOverRouter = true |
| | | this.viewer.camera.setView({ |
| | | global.viewer.camera.setView({ |
| | | // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州 |
| | | // fromDegrees()方法,将经纬度和高程转换为世界坐标 |
| | | destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees( |