From 51c9307fd62bd97913716d16c27a750a98c1b3a4 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 13 Jan 2022 11:43:52 +0800
Subject: [PATCH] +

---
 src/views/hd/hd.vue         |    4 ++--
 src/components/map/main.vue |   41 +++++++++++++++++++++++++++++++++++++----
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/src/components/map/main.vue b/src/components/map/main.vue
index 54afb5d..f987143 100644
--- a/src/components/map/main.vue
+++ b/src/components/map/main.vue
@@ -143,6 +143,7 @@
 // // 用来添加相关文字描述的
 // import Text from "ol/style/Text";
 // // import Fill from "ol/style/Fill";
+// import Cesium from "libs/Cesium/Cesium.js";
 
 export default {
   name: "Map",
@@ -167,6 +168,11 @@
         source: new VectorSource(),
       }),
       peopleLineAddlayer: new VectorLayer({
+        // 图标图层
+        zIndex: 22,
+        source: new VectorSource(),
+      }),
+      beginsPoint: new VectorLayer({
         // 图标图层
         zIndex: 22,
         source: new VectorSource(),
@@ -255,11 +261,17 @@
 
     var view = ol2d.getView();
 
+    // let provider = new Cesium.UrlTemplateImageryProvider({
+    //   url: "/wp/{z}/{x}/{y}.png",
+    //   fileExtension: "png",
+    // });
+    // view.imageryLayers.addImageryProvider(provider);
+
     // view.setCenter([115.85883507433789, 28.708432053474827])
-    view.setCenter([114.03841654, 27.62919726]);
+    view.setCenter([114.03928791, 27.62954732]);
 
     //
-    view.setZoom(13);
+    view.setZoom(16);
     this.view = view;
     const ol3d = new OLCesium({ map: window.ol2d });
     window.ol3d = ol3d;
@@ -268,12 +280,33 @@
     ol2d.addLayer(this.peopleAddlayer);
     ol2d.addLayer(this.carAddlayer);
     ol2d.addLayer(this.peopleLineAddlayer);
+    ol2d.addLayer(this.beginsPoint);
     // this.addLines()
+    that.addNewLine();
+
+    return;
+    let that = this;
+    that.beginsPoint.getSource().clear();
+    let iconFeature = new OlFeature({
+      geometry: new OlGeomPoint([114.03928791, 27.62954732]), //绘制图形(点)
+    });
+    iconFeature.setStyle(
+      new OlStyleStyle({
+        image: new OlStyleIcon({
+          scale: 0.5,
+          offset: [0, 5],
+          offsetOrigin: "bottom",
+          //透明度
+          opacity: 1,
+          //图片路径
+          src: "img/dingwei/dingwei4.png",
+        }),
+      })
+    );
+    that.beginsPoint.getSource().addFeature(iconFeature);
 
     //监听鼠标位置
-    var that = this;
     //
-    that.addNewLine();
   },
   methods: {
     init(val, num, value, fromView) {
diff --git a/src/views/hd/hd.vue b/src/views/hd/hd.vue
index 681d5e7..0786d39 100644
--- a/src/views/hd/hd.vue
+++ b/src/views/hd/hd.vue
@@ -20,7 +20,7 @@
       @refresh-change="refreshChange"
       @on-load="onLoad"
     >
-      <template slot="menuLeft">
+      <!-- <template slot="menuLeft">
         <el-button
           type="danger"
           size="small"
@@ -30,7 +30,7 @@
           @click="handleDelete"
           >删 除
         </el-button>
-      </template>
+      </template> -->
       <template slot-scope="{ type, disabled }" slot="lineForm">
         <!-- <div class="mapClassMain" style="width: 100%; height: 400px">
           <Map ref="modalForm" />

--
Gitblit v1.9.3