管道基础大数据平台系统开发-【前端】-新系統界面
TreeWish
2023-02-07 d3f9feb20237dec5215b9fd338f719725f406b1e
二维比例尺&指北针功能修改
已修改3个文件
53 ■■■■■ 文件已修改
public/index.html 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/lang/zh.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/index.html
@@ -42,21 +42,38 @@
        border-radius: 2px;
      }
      .ol-full-screen {
        display: none;
        position: absolute;
        right: 0.5em;
        top: 0.5em;
      }
      .ol-rotate {
        display: none;
        position: absolute;
        top: 3em;
        right: 0.5em;
        transition: opacity 0.25s linear, visibility 0s linear;
      }
      .ol-scale-line {
        display: none;
        right: 0.3em;
        bottom: 0.5em;
        position: absolute;
      }
      .ol-scale-line-inner {
        /* padding: 5px 10px; */
        color: rgb(102, 102, 102);
        font-weight: bold;
        background-color: #fff;
        text-align: center;
        border-radius: 5px;
      }
      .ol-zoom {
        display: none;
        right: 0.3em;
        bottom: 3em;
        position: absolute;
      }
    </style>
  </head>
src/assets/lang/zh.js
@@ -470,6 +470,7 @@
    areasurvey: "面积测量",
    volummeasure: "体积测量",
    point: "点",
    textLabel: '文本点',
    line: "线",
    rectangle: "矩形",
    polygon: "多边形",
src/views/Synthesis/LeftMenu.vue
@@ -285,6 +285,12 @@
            css: "twoMenu_imge81",
          },
          {
            id: "h8",
            label: "synthesis.textLabel",
            name: "文本点",
            css: "twoMenu_imge81",
          },
          {
            id: "h2",
            label: "synthesis.line",
            name: "线",
@@ -427,6 +433,9 @@
          sgworld.Creator.SimpleGraphic.clear()
          break
        case "h8":
          sgworld.Creator.createSimpleGraphic("label", {}, function (entity) {})
          break
      }
    },
    handleSaveClick() {
@@ -474,6 +483,7 @@
        let files = evt.target.files
        if (files.length > 0) {
          let file = evt.target.files[0]
          // sgworld.Creator.addKmlLayer('kml数据', file, true);
          let fileReader = new FileReader()
          fileReader.readAsDataURL(file)
          fileReader.onload = () => {
@@ -482,6 +492,7 @@
              canvas: sgworld.Viewer.scene.canvas,
              clampToGround: true,
            }
            files
            var geocachePromise = Cesium.KmlDataSource.load(
              fileReader.result,
              kmlOptions
@@ -491,8 +502,8 @@
              for (var i = 0; i < geocacheEntities.length; i++) {
                var entity = geocacheEntities[i]
                sgworld.Viewer.entities.add(entity)
                console.log("entity", entity)
              }
            })
            // sgworld.Viewer.dataSources
@@ -1069,10 +1080,32 @@
        case "b7": //比例尺
          this.isRuler = !this.isRuler
          window.sgworld.navControl("scale", this.isRuler)
          let scale = document.querySelector(".ol-scale-line")
          let zoomCtrl = document.querySelector(".ol-zoom")
          if (!this.isRuler) {
            scale.style.display = "none"
            zoomCtrl.style.display = "none"
          } else {
            scale.style.display = "block"
            zoomCtrl.style.display = "block"
          }
          break
        case "b8": //指北针
          this.isNaviget = !this.isNaviget
          window.sgworld.navControl("nav", this.isNaviget)
          let rotate = document.querySelector(".ol-rotate")
          let fullscreen = document.querySelector(".ol-full-screen")
          if (!this.isNaviget) {
            rotate.style.display = "none"
            fullscreen.style.display = "none"
          } else {
            rotate.style.display = "block"
            fullscreen.style.display = "block"
          }
          break
        case "b9": //地下模式
          this.UndergroundMode = !this.UndergroundMode