yangyin
2024-11-22 d11280d353ddd8daf8bfcdd2d3fe711114ee7597
src/model/map/GaoDeMap.ts
@@ -1,5 +1,5 @@
import AMapLoader from '@amap/amap-jsapi-loader';
import _ from 'lodash';
import { defaultsDeep } from 'lodash-es';
export type AMapInstance = typeof AMap;
export type GaoDePosition = [number, number];
export type GaoDeMapOption = {
@@ -34,7 +34,7 @@
   map: AMap.Map;
   private viewBound: AMap.Bounds;
   async init(option: GaoDeMapOption) {
      const gaoDeOption = _.defaultsDeep(option, {
      const gaoDeOption = defaultsDeep(option, {
         key: '3627ed9deaac2622e26a7169f0c36b1b', // 申请好的Web端开发者Key,首次调用 load 时必填
         version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
         plugins: [
@@ -74,7 +74,6 @@
       */
      container.querySelector('.amap-logo').style.opacity = 0;
      container.querySelector('.amap-copyright').style.opacity = 0;
   }
   zoomToRect(southWest: GaoDePosition, northEast: GaoDePosition) {
@@ -95,7 +94,7 @@
   }
   addMarkerLayer(dataList: LabelMarkerData[], option: MarkerLayerOption) {
      const markerLayerOption = _.defaultsDeep(option, {
      const markerLayerOption = defaultsDeep(option, {
         layerOpt: {
            zooms: [3, 20],
            zIndex: 1000,