3 次代碼提交 3402bc6d5d ... b9eb8e7c14

作者 SHA1 備註 提交日期
  wdq b9eb8e7c14 Merge branch 'lmx' of http://47.103.92.60:3003/skyversation/xujingtown_irflcmp_ui 9 月之前
  wdq e68fee0b0d 水面添加,popup弹窗样式 9 月之前
  DESKTOP-6LTVLN7\Liumouren c9a33c77a5 Merge branch 'master' of http://47.103.92.60:3003/skyversation/xujingtown_irflcmp_ui into lmx 9 月之前
共有 7 個文件被更改,包括 232 次插入120 次删除
  1. 15 6
      public/static/config/config.js
  2. 7 2
      src/components/Edge.vue
  3. 22 3
      src/components/Layers.vue
  4. 90 50
      src/components/Map.vue
  5. 20 3
      src/components/Popup.vue
  6. 76 54
      src/components/Schools.vue
  7. 2 2
      src/views/HomeView.vue

+ 15 - 6
public/static/config/config.js

@@ -2,7 +2,7 @@ var scriptObj = {
     main: "/static/plugins/skyscenery/SkyScenery.js",
     plugins: [
         "/static/plugins/skyscenery/plugins/CGCS2000ArcGisMapServerImageryProvider.js",
-        // "/static/plugins/skyscenery/plugins/Wall/DynamicWallMaterialProperty.js",
+        "/static/plugins/skyscenery/plugins/Wall/DynamicWallMaterialProperty.js",
         "/static/plugins/skyscenery/plugins/Wall/TrailLineMaterialProperty.js",
         "/static/plugins/skyscenery/plugins/Water.js",
         "/static/plugins/skyscenery/plugins/3DTiles/add3DTiles.js"
@@ -21,12 +21,21 @@ var oauthUrl = "http://121.43.55.7:10086"
 
 // 徐泾镇3DTiles偏移常量(通过调试工具得到)
 const PLTD_3DTILE_OPTIONS = {
-    rx: 0.07,
-    ry: -0.19,
+    // rx: 0.07,
+    // ry: -0.19,
+    // rz: 0,
+    // lon: 0,
+    // height: -0.8,
+    // lat: 0,
+    // scale: 1
+
+    rx: 0.,
+    ry: 0,
     rz: 0,
-    lon: 0,
-    height: -0.8,
-    lat: 0,
+    height: 5,
+    // lon: 0.000094,
+    lon: 0.00005,
+    lat: -0.000046,
     scale: 1
 };
 

+ 7 - 2
src/components/Edge.vue

@@ -296,7 +296,7 @@ export default {
             baseWaterColor: "#006ab4", // rgba颜色对象基础颜色的水。#00ffff,#00baff,#006ab4
             blendColor: "#006ab4", // 从水中混合到非水域时使用的rgba颜色对象。
             height: 0, // 水体下表面与地表之间的高度
-            extrudedHeight: 0, // 水体上表面与地表之间的高度
+            extrudedHeight: 0.3, // 水体上表面与地表之间的高度
             clampToGround: false, //是否贴地
             opacity: 0.7, //透明度
             image: "/static/image/water.png"
@@ -579,7 +579,7 @@ export default {
 <style lang="less" scoped>
 .edge {
   width: 420px;
-  background: #ffffff;
+  background: #00000080;
   padding-left: 15px;
   padding-right: 15px;
   border-radius: 50px;
@@ -588,6 +588,11 @@ export default {
     margin-left: 20px;
     vertical-align: top;
   }
+
+  .el-radio {
+    color: #ffffff;
+  }
+
   .info_container {
     height: 300px;
     overflow: hidden;

+ 22 - 3
src/components/Layers.vue

@@ -97,7 +97,7 @@ export default {
     ];
     arr = arr.map(function(item, index) {
       item.id = "layer" + index;
-      item.added = false;
+      item.added = true;
       item.show = true;
       return item;
     });
@@ -242,7 +242,16 @@ export default {
   },
   watch: {
     mapStatus(newVal, oldVal) {
-      // if (newVal) this.openClick();
+      if (newVal) {
+        setTimeout(() => {
+          this.addedChange(this.arr[0]);
+          this.addedChange(this.arr[1]);
+          this.addedChange(this.arr[2]);
+          this.addedChange(this.arr[3]);
+          this.addedChange(this.arr[4]);
+        }, 2000);
+        // this.openClick();
+      }
     }
   }
 };
@@ -251,10 +260,14 @@ export default {
 <style lang="less" scoped>
 .layer {
   width: 140px;
-  background: #ffffff;
+  background: #00000080;
   padding: 10px 15px;
   border-radius: 5px;
 
+  .title {
+    color: #ffffff;
+  }
+
   .el-switch {
     margin-left: 20px;
     vertical-align: top;
@@ -264,5 +277,11 @@ export default {
     overflow: hidden;
     overflow-y: auto;
   }
+  .el-checkbox {
+    color: #ffffff;
+    // :v-deep(.el-checkbox__label) {
+    //   color: #ffffff;
+    // }
+  }
 }
 </style>

+ 90 - 50
src/components/Map.vue

@@ -9,14 +9,14 @@ import Popup from "@/components/Popup.vue";
 export default {
   name: "Map",
   components: {
-    Popup,
+    Popup
   },
   data() {
     return {
       // viewer3DTiles实例《systemConfig.data3DTiles keys,tile》
       viewer3DTiles: {},
       // 3DTiles options集合《systemConfig.data3DTiles keys,options》
-      keysByOptions: {},
+      keysByOptions: {}
     };
   },
   mounted() {
@@ -40,13 +40,13 @@ export default {
       }
       fetch(oauthUrl + "/oauth/api/user/login", {
         method: "POST",
-        body: loginInfo,
+        body: loginInfo
       })
-        .then((resp) => resp.json())
-        .then((data) => {
+        .then(resp => resp.json())
+        .then(data => {
           SkySceneryConfig = {
             authUrl: oauthUrl,
-            token: data.message,
+            token: data.message
           };
           that.pushAllScripts();
         });
@@ -54,11 +54,11 @@ export default {
 
     pushAllScripts() {
       let that = this;
-      that.addScripts(scriptObj.main).then(function () {
-        let arr = scriptObj.plugins.map(function (src) {
+      that.addScripts(scriptObj.main).then(function() {
+        let arr = scriptObj.plugins.map(function(src) {
           return that.addScripts(src);
         });
-        Promise.all(arr).then(function () {
+        Promise.all(arr).then(function() {
           setTimeout(() => {
             if (SkyScenery) {
               that.creatMap();
@@ -80,15 +80,18 @@ export default {
         document.head.appendChild(script);
         if (script.readyState) {
           // IE
-          script.onreadystatechange = function () {
-            if (script.readyState === "loaded" || script.readyState === "complete") {
+          script.onreadystatechange = function() {
+            if (
+              script.readyState === "loaded" ||
+              script.readyState === "complete"
+            ) {
               script.onreadystatechange = null;
               resolve();
             }
           };
         } else {
           // 其他浏览器
-          script.onload = function () {
+          script.onload = function() {
             resolve();
           };
         }
@@ -114,7 +117,12 @@ export default {
             })("#ffffff00"),
             tileWidth: document.createElement("canvas").width,
             tileHeight: document.createElement("canvas").height,
-            rectangle: SkyScenery.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0),
+            rectangle: SkyScenery.Rectangle.fromDegrees(
+              -180.0,
+              -90.0,
+              180.0,
+              90.0
+            )
           }),
           fullscreenButton: false, //是否显示全屏按钮
           geocoder: false, //是否显示geocoder小器件,右上角查询按钮
@@ -126,14 +134,14 @@ export default {
           navigationHelpButton: false, //是否显示右上角的帮助按钮
           scene3DOnly: true, //如果设置为true,则所有几何图形以3D模式绘制以节约GPU资源
           infoBox: false, //是否显示点击要素之后显示的信息
-          shouldAnimate: false, //是否自动播放
+          shouldAnimate: false //是否自动播放
           // contextOptions: {
           //   requestWebgl1: true
           // }
         });
         setTimeout(() => {
           // 根据配置文件中的配置信息加载底图
-          systemConfig.imageryProviders.forEach((url) => {
+          systemConfig.imageryProviders.forEach(url => {
             that.loadTheWorldMapImage(url);
           });
 
@@ -142,34 +150,55 @@ export default {
           // viewer.scene.globe.baseColor = new SkyScenery.Color(1.0, 1.0, 1.0, 0.1);
           viewer.camera.setView({
             destination: SkyScenery.Cartesian3.fromDegrees(
-              121.28277083019914,
-              31.065009352291785,
-              12790.087231596899
+              // 121.28277083019914,
+              // 31.065009352291785,
+              // 12790.087231596899
+              121.2727827910952,
+              31.071842426999485,
+              11303.852617688039
             ), // 设置位置
             orientation: {
-              heading: SkyScenery.Math.toRadians(356.03124445628373), // 方向
-              pitch: SkyScenery.Math.toRadians(-45.31423437919367), // 倾斜角度
-              roll: SkyScenery.Math.toRadians(0.0047802614997811636)
+              heading: SkyScenery.Math.toRadians(0), // 方向
+              pitch: SkyScenery.Math.toRadians(-45), // 倾斜角度
+              roll: SkyScenery.Math.toRadians(0)
             }
           });
 
+          // 可以通过viewer.scene来访问场景对象进行进一步设置
+          viewer.scene.postProcessStages.fxaa.enabled = true; // 启用FXAA(快速近似抗锯齿)
+
           this.$store.commit("createdMap", true);
 
+          // // 遍历所有的3Dtiles
+          // for (let keys in this.keysByOptions) {
+          //   // 如果选中的话
+          //   // if (homeVs.length > 0 && homeVs.indexOf(keys) != -1) {
+          //   // } else {
+          //   //   this.hide3DTiles(keys);
+          //   // }
+          // }
+          this.add3DTiles(systemConfig.data3DTiles["徐泾镇"]["全部"], true);
+
           // 绑定点击事件
           let handler = new SkyScenery.ScreenSpaceEventHandler(viewer.canvas);
-          handler.setInputAction(function (movement) {
+          handler.setInputAction(function(movement) {
             var pick = viewer.scene.pick(movement.position); // 拾取鼠标所在的entity
             if (SkyScenery.defined(pick)) {
               let entity = pick.id;
               if (!entity) return;
-              if (entity.type && (entity.type == "layers" || entity.type == "edge")) {
+              if (
+                entity.type &&
+                (entity.type == "layers" || entity.type == "edge")
+              ) {
                 let cartesian = viewer.camera.pickEllipsoid(
                   movement.position,
                   viewer.scene.globe.ellipsoid
                 );
                 // 空间坐标转世界坐标(弧度)
                 if (!cartesian) return;
-                let cartographic = SkyScenery.Cartographic.fromCartesian(cartesian);
+                let cartographic = SkyScenery.Cartographic.fromCartesian(
+                  cartesian
+                );
                 if (!cartographic) return;
                 // 弧度转为角度(经纬度)
                 let lon = SkyScenery.Math.toDegrees(cartographic.longitude); // 经度值
@@ -222,7 +251,7 @@ export default {
       // );
       let layer = new SkyScenery.ArcGisMapServerImageryProvider({
         url:
-          "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer",
+          "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"
       });
       viewer.imageryLayers.addImageryProvider(layer);
     },
@@ -246,7 +275,7 @@ export default {
       //   }
       // };
 
-      SkyScenery.GeoJsonDataSource.load(url).then(function (dataSource) {
+      SkyScenery.GeoJsonDataSource.load(url).then(function(dataSource) {
         viewer.dataSources.add(dataSource);
         var entities = dataSource.entities.values;
         for (var i = 0; i < entities.length; i++) {
@@ -258,7 +287,7 @@ export default {
               width: 50,
               height: 50,
               pixelOffset: new SkyScenery.Cartesian2(0, -25),
-              heightReference: SkyScenery.HeightReference.CLAMP_TO_GROUND,
+              heightReference: SkyScenery.HeightReference.CLAMP_TO_GROUND
             });
           }
           if (entity.polyline) {
@@ -295,18 +324,20 @@ export default {
       return viewer.entities.add({
         name: "立体墙效果",
         wall: {
-          positions: positions.map(function (item) {
+          positions: positions.map(function(item) {
             return SkyScenery.Cartesian3.fromDegrees(item[0], item[1]);
           }),
           // 设置高度
           maximumHeights: new Array(positions.length).fill(options.maxH || 100),
           minimumHeights: new Array(positions.length).fill(0),
           material: new SkyScenery.DynamicWallMaterialProperty({
-            color: SkyScenery.Color.fromCssColorString(options.color || "#00c4ff80"), // "#"
+            color: SkyScenery.Color.fromCssColorString(
+              options.color || "#00c4ff80"
+            ), // "#"
             trailImage: "/static/image/color.png",
-            duration: options.duration || 3000, // 3000
-          }),
-        },
+            duration: options.duration || 3000 // 3000
+          })
+        }
       });
     },
 
@@ -325,12 +356,13 @@ export default {
         }
       } else {
         let option = {
-          url: this.keysByOptions[keys].url + "/tileset.json",
+          // url: this.keysByOptions[keys].url + "/tileset.json",
+          url: keys.url + "/tileset.json",
           skipLevelOfDetail: true, //开启跳级加载
           maximumMemoryUsage: 1024, //最大内存占用  推荐显存的一般
           preferLeaves: true,
           maximumScreenSpaceError: 16,
-          maximumNumberOfLoadedTiles: 2000,
+          maximumNumberOfLoadedTiles: 2000
         };
 
         // Common settings for the dynamicScreenSpaceError optimization
@@ -339,8 +371,7 @@ export default {
         //   option
         // );
         var tile = new SkyScenery.Cesium3DTileset(option);
-        // 可以通过viewer.scene来访问场景对象进行进一步设置
-        viewer.scene.postProcessStages.fxaa.enabled = true; // 启用FXAA(快速近似抗锯齿)
+
         viewer.scene.primitives.add(tile);
 
         // // 设置相机视角
@@ -348,17 +379,18 @@ export default {
         //   viewer.zoomTo(tile);
         // }
 
-        tile.readyPromise.then(function () {
-          // 设置相机视角
-          if (flyto) {
-            viewer.zoomTo(tile);
-          }
+        tile.readyPromise.then(function() {
+          // // 设置相机视角
+          // if (flyto) {
+          //   viewer.zoomTo(tile);
+          // }
         });
         this.viewer3DTiles[keys] = tile;
         setTimeout(() => {
           this.update3DTilesStyleByKeys(
             this.viewer3DTiles[keys],
-            Object.assign({}, this.keysByOptions[keys])
+            // Object.assign({}, this.keysByOptions[keys])
+            Object.assign({}, keys)
           );
         });
       }
@@ -368,7 +400,7 @@ export default {
      */
     update3DTilesStyleByKeys(tileset, options) {
       try {
-        tileset.readyPromise.then(function () {
+        tileset.readyPromise.then(function() {
           // 设置样式
           var cartographic = SkyScenery.Cartographic.fromCartesian(
             tileset.boundingSphere.center
@@ -438,7 +470,9 @@ export default {
       }
     },
     adjust3DTilesPosition(tileset, options) {
-      var cartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center);
+      var cartographic = Cesium.Cartographic.fromCartesian(
+        tileset.boundingSphere.center
+      );
       var lon = Cesium.Math.toDegrees(cartographic.longitude);
       var lat = Cesium.Math.toDegrees(cartographic.latitude);
       var height = cartographic.height;
@@ -460,19 +494,25 @@ export default {
       var m = tileset._root.transform;
 
       if (options.rx != 0) {
-        const mx = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options.rx));
+        const mx = Cesium.Matrix3.fromRotationX(
+          Cesium.Math.toRadians(options.rx)
+        );
         const rotate = Cesium.Matrix4.fromRotationTranslation(mx);
         Cesium.Matrix4.multiply(m, rotate, m);
       }
 
       if (options.ry != 0) {
-        const my = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(options.ry));
+        const my = Cesium.Matrix3.fromRotationY(
+          Cesium.Math.toRadians(options.ry)
+        );
         const rotate = Cesium.Matrix4.fromRotationTranslation(my);
         Cesium.Matrix4.multiply(m, rotate, m);
       }
 
       if (options.rz != 0) {
-        const mz = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(options.rz));
+        const mz = Cesium.Matrix3.fromRotationZ(
+          Cesium.Math.toRadians(options.rz)
+        );
         const rotate = Cesium.Matrix4.fromRotationTranslation(mz);
         Cesium.Matrix4.multiply(m, rotate, m);
       }
@@ -512,7 +552,7 @@ export default {
       if (this.$store.state.initMap) {
         // 暂存首页下拉框选中值
         let homeVs = [];
-        cascaderValue.forEach((item) => {
+        cascaderValue.forEach(item => {
           homeVs.push(item[0] + item[1]);
         });
         // 遍历所有的3Dtiles
@@ -529,8 +569,8 @@ export default {
           this.HomeHandleChangeCascader(cascaderValue);
         }, 1000);
       }
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 20 - 3
src/components/Popup.vue

@@ -61,7 +61,7 @@ export default {
       //   document.getElementById("popup_content").innerHTML = data.html || "";
       this.isShow = true;
       let html = "";
-      let properties = entity.data
+      let properties = entity.data;
       for (const key in properties) {
         if (Object.prototype.hasOwnProperty.call(properties, key)) {
           html += `<div>${key}: ${properties[key]}</div>`;
@@ -138,6 +138,22 @@ export default {
 
 <style lang="less" scoped>
 #stateShow {
+  /*滚动条样式*/
+  ::-webkit-scrollbar {
+    width: 8px;
+    height: 8px;
+  }
+
+  ::-webkit-scrollbar-thumb {
+    border-radius: 10px;
+    background: #dddddd;
+  }
+
+  ::-webkit-scrollbar-track {
+    border-radius: 10px;
+    background: #ffffff;
+  }
+
   position: absolute;
   z-index: 1;
   background: #ffffff;
@@ -157,8 +173,9 @@ export default {
     height: 200px;
 
     margin: 0;
-    color: #69ca62;
-    box-shadow: inset 0 0 0 1px rgba(105, 202, 98, 0.5);
+    // color: #69ca62;
+    color: #0081ef;
+    box-shadow: inset 0 0 0 1px #0080f080;
     padding: 5px;
     box-sizing: border-box;
     // background: rgba(0, 173, 181, 0.32);

+ 76 - 54
src/components/Schools.vue

@@ -1,12 +1,6 @@
 <template>
   <div class="schoolBox">
-    <el-drawer
-      append-to-body
-      v-model="dialogVisible"
-      title="学区查询"
-      direction="rtl"
-      size="40%"
-    >
+    <el-drawer append-to-body v-model="dialogVisible" title="学区查询" direction="rtl" size="40%">
       <!-- 搜索区域 -->
       <el-form :inline="true" :model="formInline" class="demo-form-inline">
         <el-form-item label="学校名称">
@@ -16,18 +10,15 @@
           <el-input v-model="formInline.cAddress" placeholder="请输入地址关键字" />
         </el-form-item>
         <el-form-item label="招生区域">
-          <el-input
-            v-model="formInline.cEnrollmentScope"
-            placeholder="请输入招生区域关键字"
-          />
+          <el-input v-model="formInline.cEnrollmentScope" placeholder="请输入招生区域关键字" />
         </el-form-item>
         <el-form-item>
           <el-button type="primary" @click="changePagination">搜索</el-button>
         </el-form-item>
       </el-form>
       <!-- table -->
-      <el-table :data="tableData" max-height="650"
-        ><el-table-column type="index" width="50" />
+      <el-table :data="tableData" max-height="650">
+        <el-table-column type="index" width="50" />
         <el-table-column property="title" label="学校名称" width="100" />
         <el-table-column property="c_address" label="地址" width="150" />
         <el-table-column label="招生区域">
@@ -40,9 +31,7 @@
 
         <el-table-column label="操作" width="150">
           <template #default="scope">
-            <el-button size="small" @click="flytoSchoolDataToMap(scope.row)"
-              >查看</el-button
-            >
+            <el-button size="small" @click="flytoSchoolDataToMap(scope.row)">查看</el-button>
             <!-- <el-button size="small" type="danger"></el-button> -->
           </template>
         </el-table-column>
@@ -60,6 +49,30 @@
     </el-drawer>
     <!-- 唤起弹窗 -->
     <el-button @click="dialogVisible = true">学区查询</el-button>
+    <!-- 清除 -->
+    <el-button style="padding-right: 8px;padding-left: 8px;" title="学区清空" @click="clean">
+      <svg
+        t="1726283280353"
+        class="icon"
+        viewBox="0 0 1024 1024"
+        version="1.1"
+        xmlns="http://www.w3.org/2000/svg"
+        p-id="4286"
+        width="20"
+        height="20"
+      >
+        <path
+          d="M814.29 136.567H207.664c-55.752 0-101.274 13.3-101.274 56.776v26.086h808.663v-26.086c0.511-42.965-45.011-56.776-100.763-56.776"
+          p-id="4287"
+          fill="#606266"
+        />
+        <path
+          d="M723.245 191.808l-19.948-140.66c-3.58-27.62-29.667-50.125-57.287-50.125H376.456c-28.132 0-53.707 22.505-57.799 50.126l-19.948 141.17c-3.58 27.621 15.856 22.506 43.477 22.506h337.07c28.133-0.511 47.57 4.604 43.989-23.017z m-360.6-28.643L377.99 51.66h265.463l15.344 111.505H362.645zM831.17 282.342H190.785c-36.827 0-64.959 30.177-61.378 67.005l55.24 607.648c3.58 36.827 36.316 67.005 73.655 67.005h505.35c36.828 0 70.074-30.178 73.655-67.005l55.24-607.137c3.58-36.827-24.04-67.516-61.378-67.516zM376.456 953.415H245.514l-43.476-592.816h174.418v592.816z m221.474 0H423.512V360.599H597.93v592.816z m177.487 0H646.01V360.599h172.883l-43.476 592.816z"
+          p-id="4288"
+          fill="#606266"
+        />
+      </svg>
+    </el-button>
   </div>
 </template>
 
@@ -79,7 +92,7 @@ export default {
       formInline: {
         title: "",
         cAddress: "",
-        cEnrollmentScope: "",
+        cEnrollmentScope: ""
       },
       // table 数据
       tableData: [],
@@ -91,12 +104,14 @@ export default {
       pagination: {
         currentPage: 1,
         pageSize: 10,
-        total: 0,
+        total: 0
       },
+      // 学校label
+      schoolTitleEntities: null,
       // 地图学校围墙
-      mapWallEntity: {},
+      mapWallEntity: [],
       // geojson数据源
-      geojsonDataSource: {},
+      geojsonDataSource: {}
     };
   },
   mounted() {
@@ -110,10 +125,10 @@ export default {
     // 初始化获取学校列表数据可修改为DMS在线获取
     getSchools() {
       fetch("/static/data/dmsSchoolList.json")
-        .then((resp) => resp.json())
-        .then((data) => {
+        .then(resp => resp.json())
+        .then(data => {
           if (data) {
-            data.forEach((element) => {
+            data.forEach(element => {
               element.c_geojson = JSON.parse(element.c_geojson);
             });
             this.pagination.total = data.length;
@@ -134,11 +149,12 @@ export default {
     },
     // 根据搜索条件和分页条件 改变 table 数据
     changePagination() {
-      let tableData_ = this.resData.filter((item) => {
+      let tableData_ = this.resData.filter(item => {
         return (
           item.title.indexOf(this.formInline.title) !== -1 &&
           item.c_address.indexOf(this.formInline.cAddress) !== -1 &&
-          item.c_enrollment_scope.indexOf(this.formInline.cEnrollmentScope) !== -1
+          item.c_enrollment_scope.indexOf(this.formInline.cEnrollmentScope) !==
+            -1
         );
       });
       this.pagination.total = tableData_.length;
@@ -176,22 +192,25 @@ export default {
       // }
       // 不存在的话要新建并定位
       // 添加围墙
-      this.mapWallEntity[data.title] = [];
-      data.c_geojson.features.forEach((feature) => {
+      this.mapWallEntity = [];
+      data.c_geojson.features.forEach(feature => {
         let wall = this.addDynamicWall(feature.geometry.coordinates[0], {
           maxH: 150,
           color: "#4CC8F5",
-          duration: 3000,
+          duration: 3000
         });
-        this.mapWallEntity[data.title].push(wall);
+        this.mapWallEntity.push(wall);
       });
       // 添加底面
-      SkyScenery.GeoJsonDataSource.load(data.c_geojson).then(function (dataSource) {
+      SkyScenery.GeoJsonDataSource.load(data.c_geojson).then(function(
+        dataSource
+      ) {
         var entities = dataSource.entities.values;
         for (var i = 0; i < entities.length; i++) {
           var entity = entities[i];
           if (entity.polygon) {
-            entity.polygon.heightReference = SkyScenery.HeightReference.CLAMP_TO_GROUND;
+            entity.polygon.heightReference =
+              SkyScenery.HeightReference.CLAMP_TO_GROUND;
             entity.polygon.perPositionHeight = true;
           }
           entity.type = "edge";
@@ -200,14 +219,14 @@ export default {
         that.geojsonDataSource[data.title] = dataSource;
       });
       // 添加学校定位c_latlon
-      console.log(data);
+      // console.log(data);
       let pointData = {
         type: "FeatureCollection",
         crs: {
           type: "name",
           properties: {
-            name: "urn:ogc:def:crs:OGC:1.3:CRS84",
-          },
+            name: "urn:ogc:def:crs:OGC:1.3:CRS84"
+          }
         },
         features: [
           {
@@ -217,14 +236,14 @@ export default {
               所属街镇: data.c_street_town,
               电话: data.c_phone,
               地址: data.c_address,
-              招生区域: data.c_enrollment_scope,
+              招生区域: data.c_enrollment_scope
             },
             geometry: {
               type: "Point",
-              coordinates: data.c_latlon.split(","),
-            },
-          },
-        ],
+              coordinates: data.c_latlon.split(",")
+            }
+          }
+        ]
       };
       // 添加学校名
       that.schoolTitleEntities = viewer.entities.add({
@@ -239,15 +258,15 @@ export default {
           outlineWidth: 5,
           outlineColor: SkyScenery.Color.BLACK,
           verticalOrigin: SkyScenery.VerticalOrigin.BOTTOM,
-          pixelOffset: new SkyScenery.Cartesian2(0, -50),
-        },
+          pixelOffset: new SkyScenery.Cartesian2(0, -50)
+        }
       });
       that.addGeoJson(
         pointData,
         {
           point: {
-            imgUrl: "/static/image/layer/point.png",
-          },
+            imgUrl: "/static/image/layer/point.png"
+          }
         },
         data.title
       );
@@ -261,14 +280,17 @@ export default {
         orientation: {
           heading: SkyScenery.Math.toRadians(356.03124515798294), // 方向
           pitch: SkyScenery.Math.toRadians(-90), // 倾斜角度
-          roll: SkyScenery.Math.toRadians(0.0047792745453184024),
-        },
+          roll: SkyScenery.Math.toRadians(0.0047792745453184024)
+        }
       });
     },
 
+    // 清空
+    clean() {},
+
     // 加载geojson数据
     addGeoJson(pointData, options, id) {
-      SkyScenery.GeoJsonDataSource.load(pointData).then(function (dataSource) {
+      SkyScenery.GeoJsonDataSource.load(pointData).then(function(dataSource) {
         viewer.dataSources.add(dataSource);
         var entities = dataSource.entities.values;
         for (var i = 0; i < entities.length; i++) {
@@ -280,7 +302,7 @@ export default {
               width: 50,
               height: 50,
               pixelOffset: new SkyScenery.Cartesian2(0, -25),
-              heightReference: SkyScenery.HeightReference.CLAMP_TO_GROUND,
+              heightReference: SkyScenery.HeightReference.CLAMP_TO_GROUND
             });
           }
           if (entity.polyline) {
@@ -295,7 +317,7 @@ export default {
             entity.polygon.height = 5;
             entity.polygon.material = new SkyScenery.ImageMaterialProperty({
               image: "/static/image/b2.png", // 图片路径
-              transparent: true, // 是否透明
+              transparent: true // 是否透明
             });
           }
           entity.type = "layers";
@@ -314,7 +336,7 @@ export default {
       return viewer.entities.add({
         name: "立体墙效果",
         wall: {
-          positions: positions.map(function (item) {
+          positions: positions.map(function(item) {
             return SkyScenery.Cartesian3.fromDegrees(item[0], item[1]);
           }),
           // 设置高度
@@ -323,12 +345,12 @@ export default {
           material: new SkyScenery.DynamicWallMaterialProperty({
             color: SkyScenery.Color.fromCssColorString(options.color), // "#"
             trailImage: "/static/image/color.png",
-            duration: options.duration || 3000, // 3000
-          }),
-        },
+            duration: options.duration || 3000 // 3000
+          })
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 2 - 2
src/views/HomeView.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="home">
-    <Header @changeDataPanel="changeDataPanel" />
     <Map ref="map" />
+    <Header @changeDataPanel="changeDataPanel" />
     <!-- 左侧图片区 -->
     <div class="home_LeftMainBox" :style="{ left: DataPanel ? '0' : '-450px' }">
       <img style="width: 450px; height: 50px" src="../assets/images/LT1.png" />
@@ -13,7 +13,7 @@
       <!-- 重点图层 -->
       <div class="home_LeftMainBox_pendant">
         <Layers />
-        <Schools style="margin-top: 10px" />
+        <!-- <Schools style="margin-top: 10px" /> -->
       </div>
     </div>
     <!-- 中上部分3DTiles控件 -->