管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-16 dae8fb08b9ff7327da86ed249c9c97a87c90e6f2
src/components/mapol.vue
@@ -35,8 +35,8 @@
    <!--    </div>-->
    <div
      v-show="$store.state.isNaviget"
      class="sindagis-map-compass"
      style=" bottom: 130px; right: 35px;"
    >
      <span
        class="left"
@@ -98,17 +98,17 @@
    init2DMap() {
      var layerBase = [];
      if (!is_production) {
        // window.vectorLayer = new TileLayer({
        //   source: new XYZ({
        //     url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",
        //   }),
        // })
        window.vectorLayer = new TileLayer({
        var vectorLayer = new TileLayer({
          source: new XYZ({
            url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",
          }),
        })
        var imageLayer = new TileLayer({
          source: new XYZ({
            url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=6&x={x}&y={y}&z={z}",
          }),
        })
        layerBase = [vectorLayer]
        layerBase = [vectorLayer, imageLayer]
      }
      window.map = new Map({
        target: "mapol",
@@ -147,10 +147,10 @@
      // var scaleLine = new  ScaleLine({
      //   units: "metric"
      // });
      // map.addControl(scaleLine);
      var scaleLine = new ScaleLine({
        units: "metric"
      });
      map.addControl(scaleLine);
      map.on("moveend", function (e) {
        console.log(($(window).width() - $(".ol-scale-line-inner").width()) + "px");
@@ -297,14 +297,15 @@
}
.ol-scale-line {
  bottom: 55px !important;
  right: 130px !important;
}
.sindagis-map-compass {
  position: absolute;
  right: 50px;
  bottom: 90px;
  z-index: 5;
  right: 25px;
  width: 52px;
  height: 54px;
  background: url("../assets/img/compass.png") 0% 0% / 266px no-repeat;