wangzhe 8 months ago
parent
commit
d109e33770
1 changed files with 62 additions and 0 deletions
  1. 62 0
      screen-demo/src/views/templateInstance.vue

+ 62 - 0
screen-demo/src/views/templateInstance.vue

@@ -379,6 +379,33 @@ export default {
         this.trees = res.data
       })
     },
+//     startpick() {
+//       let _this = this;
+//       new CTMapOl.loadCesium({domId: 'map'}, (map) => {
+//         _this.viewer = map._viewer
+//       })
+//   // this.viewer = this.map._view
+//   //     console.log("this.map=",this.map)
+//       console.log("viewer=",this.viewer)
+//   this.CesiumEventHandlerclick = null
+//   if (this.CesiumEventHandlerclick) {
+//     this.endpick()
+//   }
+//       // this.CesiumEventHandlerclick = CTMapOl.thrdime.cameracontrol.startpickcood(this.viewer, (e, f) => {
+//       this.CesiumEventHandlerclick = new CTMapOl.thrdime.cameracontrol.startpickcood(this.viewer, (e, f) => {
+//     console.log(e, f)
+//     let dom1 = document.getElementById("coodlon")
+//     dom1.innerHTML = f.longitude / Math.PI * 180
+//         alert(dom1.innerHTML)
+//     let dom2 = document.getElementById("coodlat")
+//     dom2.innerHTML = f.latitude / Math.PI * 180
+//     let dom3 = document.getElementById("coodh")
+//     dom3.innerHTML = f.height
+//   })
+// },
+// endpick() {
+//   new CTMapOl.thrdime.cameracontrol.stoppickcood(this.viewer, this.CesiumEventHandlerclick)
+// },
     selfHistory(){
       //页面初始m, 历史城市数组=接口返回
       this.history.navigation.currentCity = null;
@@ -1573,6 +1600,41 @@ export default {
       this.targetId = targetId;
       this.mapInstance = e?.map || e;
 
+      // 折线
+      // let options = {
+      //   path: [[116.43, 55.92, 100], [117.43, 55.92, 50], [106.43, 29.92, 100000],[128.43, 55.92, 100000]],
+      //   zoomto: true,
+      //   strokeOpacity: 0.8,
+      // }
+      //
+      // new CTMapOl.cesiumComponent.Polyline(options)
+      // let _this = this;
+      // CTMapOl.loadCesium({domId: 'map'}, (map) => {
+      //   console.log("mapmapmap=",map)
+      //   _this.viewer = map._viewer
+      // })
+      // // this.viewer = this.map._view
+      // //     console.log("this.map=",this.map)
+      // console.log("viewer=",this.viewer)
+      // this.CesiumEventHandlerclick = null
+      // if (this.CesiumEventHandlerclick) {
+      //   this.endpick()
+      // }
+      // // window.CESIUM_BASE_URL = '../../public/cesium/Build/CesiumUnminified';
+      // // window.CESIUM_BASE_URL = '../../public/cesium/Build/Cesium';
+      // window.CESIUM_BASE_URL = '../../public/Cesium2/Cesium';
+      // this.CesiumEventHandlerclick = CTMapOl.thrdime.cameracontrol.startpickcood(this.viewer, (e, f) => {
+      //   console.log(e, f)
+      //   let dom1 = document.getElementById("coodlon")
+      //   dom1.innerHTML = f.longitude / Math.PI * 180
+      //   alert(dom1.innerHTML)
+      //   let dom2 = document.getElementById("coodlat")
+      //   dom2.innerHTML = f.latitude / Math.PI * 180
+      //   let dom3 = document.getElementById("coodh")
+      //   dom3.innerHTML = f.height
+      // })
+      // this.startpick()
+
       // 导航 路线规划
       // let option = {
       //   width: '8',