|
@@ -168,7 +168,9 @@
|
|
<progress :max="80" :value="96" class="progress"></progress>
|
|
<progress :max="80" :value="96" class="progress"></progress>
|
|
</div>
|
|
</div>
|
|
<!-- echarts 图表容器 -->
|
|
<!-- echarts 图表容器 -->
|
|
|
|
+ <!-- 经纬度实时拾取 -->
|
|
</div>
|
|
</div>
|
|
|
|
+ <p><b><span id="mouse-position"></span></b></p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -236,6 +238,8 @@ import { Style, Icon } from "ol/style";
|
|
import VectorSource from "ol/source/Vector";
|
|
import VectorSource from "ol/source/Vector";
|
|
import { Point } from "ol/geom";
|
|
import { Point } from "ol/geom";
|
|
import * as echarts from "echarts";
|
|
import * as echarts from "echarts";
|
|
|
|
+import { format } from 'ol/coordinate'
|
|
|
|
+import MousePosition from 'ol/control/MousePosition.js'
|
|
|
|
|
|
import CTMapOl from "@ct/ct_map_ol";
|
|
import CTMapOl from "@ct/ct_map_ol";
|
|
export default {
|
|
export default {
|
|
@@ -284,6 +288,7 @@ export default {
|
|
total: 0,
|
|
total: 0,
|
|
timeX: [],
|
|
timeX: [],
|
|
list:[],
|
|
list:[],
|
|
|
|
+ // activeMode: "satellite", // 默认地图图层类型
|
|
activeMode: "satellite", // 默认地图图层类型
|
|
activeMode: "satellite", // 默认地图图层类型
|
|
modes: ["basic", "satellite", "3D"], // 可切换地图图层类型
|
|
modes: ["basic", "satellite", "3D"], // 可切换地图图层类型
|
|
extraOptions: {}, // 地图实例化扩展参数
|
|
extraOptions: {}, // 地图实例化扩展参数
|
|
@@ -377,7 +382,7 @@ export default {
|
|
// },
|
|
// },
|
|
loadOptions(node, resolve) {
|
|
loadOptions(node, resolve) {
|
|
if (node.level > 2) return resolve([]); // Adjust the maximum level allowed for selection
|
|
if (node.level > 2) return resolve([]); // Adjust the maximum level allowed for selection
|
|
- if (!this.isLoading && node.data.id) {
|
|
|
|
|
|
+ if (!this.isLoading && node.data && node.data.id) {
|
|
this.setValue(node)
|
|
this.setValue(node)
|
|
this.isLoading = true;
|
|
this.isLoading = true;
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -1661,7 +1666,7 @@ export default {
|
|
// zoomto: true,
|
|
// zoomto: true,
|
|
// strokeOpacity: 0.8,
|
|
// strokeOpacity: 0.8,
|
|
// }
|
|
// }
|
|
- //
|
|
|
|
|
|
+ // //
|
|
// new CTMapOl.cesiumComponent.Polyline(options)
|
|
// new CTMapOl.cesiumComponent.Polyline(options)
|
|
// let _this = this;
|
|
// let _this = this;
|
|
// CTMapOl.loadCesium({domId: 'map'}, (map) => {
|
|
// CTMapOl.loadCesium({domId: 'map'}, (map) => {
|
|
@@ -1678,6 +1683,7 @@ export default {
|
|
// // window.CESIUM_BASE_URL = '../../public/cesium/Build/CesiumUnminified';
|
|
// // window.CESIUM_BASE_URL = '../../public/cesium/Build/CesiumUnminified';
|
|
// // window.CESIUM_BASE_URL = '../../public/cesium/Build/Cesium';
|
|
// // window.CESIUM_BASE_URL = '../../public/cesium/Build/Cesium';
|
|
// window.CESIUM_BASE_URL = '../../public/Cesium2/Cesium';
|
|
// window.CESIUM_BASE_URL = '../../public/Cesium2/Cesium';
|
|
|
|
+ // window.CESIUM_BASE_URL = '/cesium/Build/CesiumUnminified';
|
|
// this.CesiumEventHandlerclick = CTMapOl.thrdime.cameracontrol.startpickcood(this.viewer, (e, f) => {
|
|
// this.CesiumEventHandlerclick = CTMapOl.thrdime.cameracontrol.startpickcood(this.viewer, (e, f) => {
|
|
// console.log(e, f)
|
|
// console.log(e, f)
|
|
// let dom1 = document.getElementById("coodlon")
|
|
// let dom1 = document.getElementById("coodlon")
|
|
@@ -1688,6 +1694,43 @@ export default {
|
|
// let dom3 = document.getElementById("coodh")
|
|
// let dom3 = document.getElementById("coodh")
|
|
// dom3.innerHTML = f.height
|
|
// dom3.innerHTML = f.height
|
|
// })
|
|
// })
|
|
|
|
+ // 不要在 data 中定义 location 变量,无需响应式
|
|
|
|
+ // let _this = this;
|
|
|
|
+ // this.$nextTick(() => {
|
|
|
|
+ // // alert(_this.map.map)
|
|
|
|
+ // console.log("_this.map.map=", _this.map.map)
|
|
|
|
+ // _this.map.map.on('mousemove', (e) => {
|
|
|
|
+ // console.log("e=", e)
|
|
|
|
+ // // console.log("f=", f)
|
|
|
|
+ // })
|
|
|
|
+ // _this.location = new CTMapOl.extend.ToolLocation(_this.map.map, {
|
|
|
|
+ // onPick: coords => {
|
|
|
|
+ // alert(coords[0])
|
|
|
|
+ // // this.longitude = coords[0]
|
|
|
|
+ // // this.latitude = coords[1]
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // let latitude; // 纬度
|
|
|
|
+ const mousePositionControl = new MousePosition({
|
|
|
|
+ coordinateFormat: function(coordinate) {
|
|
|
|
+ // console.log("coordinate=", coordinate)
|
|
|
|
+ // console.log("coordinate h=", h)
|
|
|
|
+ return format(coordinate, '经度: {x} 纬度: {y} 海拔: 0', 6)
|
|
|
|
+ },
|
|
|
|
+ projection: 'EPSG:4326', // 定义投影
|
|
|
|
+ className: 'bottom-mouse-position', // 控件的CSS类名
|
|
|
|
+ target: document.getElementById('mouse-position'), // 将控件渲染在该DOM元素中
|
|
|
|
+ undefinedHTML: ' '// 鼠标离开地图时,显示空格
|
|
|
|
+ })
|
|
|
|
+ // 添加控件到地图
|
|
|
|
+ this.map.map.addControl(mousePositionControl)
|
|
|
|
+ // let longitude; // 经度
|
|
|
|
+ // let altitude; // 海拔
|
|
|
|
+ // alert("before call")
|
|
|
|
+ // console.log("_this.location=",_this.location)
|
|
|
|
+ // _this.location.pick();
|
|
|
|
+ // });
|
|
|
|
+
|
|
// this.startpick()
|
|
// this.startpick()
|
|
|
|
|
|
// 导航 路线规划
|
|
// 导航 路线规划
|
|
@@ -1832,6 +1875,7 @@ export default {
|
|
switchMap(e) {
|
|
switchMap(e) {
|
|
this.mapType = e; // 地图图层类型
|
|
this.mapType = e; // 地图图层类型
|
|
this.activeMode = e; // 地图图层类型
|
|
this.activeMode = e; // 地图图层类型
|
|
|
|
+
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|