riku
2025-02-13 660021a28de9b84b4362c171fdbbf89587f0c5af
src/utils/map/toolbox.js
@@ -1,6 +1,9 @@
/* eslint-disable no-undef */
import { map, satellite, controlbar } from './index_old';
// import '@/lib/jquery-3.5.1.min';
import { map, satellite } from './index_old';
import { useToolboxStore } from '@/stores/toolbox';
import { DialogUtil } from '@/utils/map/dialog';
const toolboxStore = useToolboxStore();
/**
 * 坐标拾取鼠标点击回调事件
@@ -41,7 +44,10 @@
   * @param {boolean} value
   */
  toggleFeatures(value) {
    value ? map.setFeatures(['bg', 'road', 'point', 'building']) : map.setFeatures(['bg', 'road']);
    value
      ? map.setFeatures(['bg', 'road', 'point', 'building'])
      : map.setFeatures(['bg', 'road']);
    toolboxStore.featuresStatus = value;
  },
  /**
@@ -50,6 +56,7 @@
   */
  toggleSatellite(value) {
    value ? satellite.show() : satellite.hide();
    toolboxStore.satelliteStatus = value;
  },
  /**
@@ -59,6 +66,7 @@
  toggleControlbar(value) {
    // value ? controlbar.show() : controlbar.hide();
    value ? $('.amap-controlbar').show() : $('.amap-controlbar').hide();
    toolboxStore.controlbarStatus = value;
  },
  /**
@@ -74,5 +82,25 @@
      _locationMarker = undefined;
      _locationText = undefined;
    }
    toolboxStore.coorPickStatus = value;
  },
  /**
   * 开关数据弹框
   */
  toggleDataDialogStatus(value) {
    toolboxStore.dataDialogStatus = value;
    if (value) {
      DialogUtil.openWindow();
    } else {
      DialogUtil.closeWindow();
    }
  },
  /**
   * 开关溯源清单
   */
  toggleSceneSearch(value) {
    toolboxStore.sceneSearchStatus = value;
  }
};