北京经济技术开发区经开区虚拟城市项目-【前端】-Web
lixuliang
2023-11-15 f263e0396359ac7686e68ce0e1a2e2ef6419906d
src/components/map/viewer.vue
@@ -2,54 +2,30 @@
  <div>
    <div id="sdkContainer"></div>
    <div class="listBox" v-show="viewer1Show && !isLand">
      <ul>
        <li
          v-for="(item, index) in arr"
          :key="index"
          @click="changeLeftMap($event, item, index)"
        >
      <ul id="viewer_lsyx">
        <li v-for="(item, index) in arr" :key="index" @click="changeLeftMap($event, item, index)">
          {{ item }}
        </li>
      </ul>
    </div>
    <layerTreeTwoScreen v-if="layerTreeTwoScreen" />
    <!-- <div id="bottomInfo" v-html="bottomInfo"></div> -->
    <div
      id="switchImagerLayer"
      :style="{
    <div id="switchImagerLayer" :style="{
        transform: `scale(${scale}) translate(${offset},${offset})`,
        '-webkit-transform': `scale(${scale}) translate(${offset},${offset})`,
        '-moz-transform': `scale(${scale}) translate(${offset},${offset})`,
        '-o-transform': `scale(${scale}) translate(${offset},${offset})`,
        '-ms-transform': `scale(${scale}) translate(${offset},${offset})`,
      }"
    >
      <transition
        name="animate__animated animate__bounce"
        @click="switchImagerLayerShowOrHide"
        enter-active-class="animate__backInRight"
        leave-active-class="animate__backOutRight"
        appear
      >
    }">
      <transition name="animate__animated animate__bounce" @click="switchImagerLayerShowOrHide"
        enter-active-class="animate__backInRight" leave-active-class="animate__backOutRight" appear>
        <switchImagerLayer ref="switchImagerLayer" v-show="switchImagerLayer" />
      </transition>
      <img
        class="swichImg"
        @click="switchImagerLayerShowOrHide"
        :src="switchImage"
      />
      <img class="swichImg" @click="switchImagerLayerShowOrHide" :src="switchImage" />
      <div class="bgbox">
        <img
          class="swichImg"
          @click="switchImagerLayerShowOrHide"
          src="@/assets/img/new/shiliang.png"
        />
        <img
          class="swichImg bgbox"
          @click="switchImagerLayerShowOrHide"
          src="@/assets/img/new/shiliang.png"
        />
        <img class="swichImg" @click="switchImagerLayerShowOrHide" src="@/assets/img/new/shiliang.png" />
        <img class="swichImg bgbox" @click="switchImagerLayerShowOrHide" src="@/assets/img/new/shiliang.png" />
      </div>
    </div>
  </div>
@@ -101,11 +77,17 @@
    viewer1Show(newvalue, oldvalue) {
      if (!newvalue) {
        this.destroyImageLayer();
      } else {
        if (!this.isLand) {
          this.initLSYX();
        }
      }
    },
    isLand(newvalue, oldvalue) {
      if (newvalue) {
        this.destroyImageLayer();
      } else {
        this.initLSYX();
      }
    },
  },
@@ -279,6 +261,11 @@
        this.destroyImageLayer();
      }
    },
    initLSYX() {
      let ul = document.getElementById("viewer_lsyx");
      let lis = ul.getElementsByTagName('li');
      lis[19].click();
    },
    destroyImageLayer() {
      if (activeLi) {
        activeLi.classList.remove("active");
@@ -309,9 +296,14 @@
        nLayer = null;
      }
      nLayer = this.loadBJ54ImageLayer(year);
      if (!LWLayer) {
      if (!LWLayer||Viewer.imageryLayers.indexOf(LWLayer)<0) {
        if(LWLayer)
        {
          LWLayer.destroy();
        }
        LWLayer = this.loadBJ54LWLayer();
      }
    },
    loadBJ54LWLayer() {
      let url = "http://172.26.64.84/service/ImageEngine/picdis/abc";