import { defineComponent as F, watch as L, createElementBlock as ve, openBlock as ye, normalizeClass as fe, unref as _, createElementVNode as be, shallowRef as I, ref as f, onMounted as ge, onUnmounted as he } from "vue";
import Me from "@amap/amap-jsapi-loader";
import "axios";
import { nanoid as Le } from "nanoid";
import { heatMapData as ke, hideHeatMap as we } from "./heatMap.mjs";
import { navigatorDot as ze, loadDotMap as N, showAndHideDotLabelMap as T, clearRipplesScatter as Ee, clearLoadLocaDotLayers as Ce, clearLabelsLayer as Se, clearMarkerLayer as xe, showRoadMap as Oe, hideRoadMap as De, loadLineMap as Ae, hideLineMap as Ie, showSmallMap as Te, hideSmallMap as Be, trackPlay as Pe } from "./dotMap.mjs";
import "../../text-text-basic/index.mjs";
import "../../text-table-basic/index.mjs";
import "../../chart-other-gauge/index.mjs";
import "../../chart-other-gauge-stage/index.mjs";
import "../../chart-other-gauge-grade/index.mjs";
import "../../chart-other-word-cloud/index.mjs";
import "../../chart-other-liquidfill/index.mjs";
import "../../chart-other-funnel/index.mjs";
import "../../chart-other-force/index.mjs";
import "../../chart-other-radar/index.mjs";
import "../../chart-other-funnel-split/index.mjs";
import "../../chart-other-funnel-contrast/index.mjs";
import "../../chart-other-candlestick-basic/index.mjs";
import "../../chart-other-candlestick-shanghai/index.mjs";
import "../../chart-other-candlestick-demo/index.mjs";
import "../../chart-other-heatmap/index.mjs";
import "../../chart-other-force2/index.mjs";
import "../../chart-other-graph-basic/index.mjs";
import "../../chart-other-graph-basic2/index.mjs";
import "../../chart-other-graph-calendar/index.mjs";
import "../../chart-other-tree-line/index.mjs";
import "../../chart-other-treemap-basic/index.mjs";
import "../../chart-other-sunburst-basic/index.mjs";
import "../../chart-other-sunburst-basic2/index.mjs";
import "../../chart-other-sunburst-basic3/index.mjs";
import "../../chart-other-sunburst-basic4/index.mjs";
import "../../chart-other-sunburst-book/index.mjs";
import "../../chart-other-sunburst-radius/index.mjs";
import "../../chart-other-sunburst-flavors/index.mjs";
import "../../chart-other-parallel-basic/index.mjs";
import "../../chart-other-parallel-mul/index.mjs";
import "../../chart-other-circular-graph/index.mjs";
import "../../map-earth-basic/index.mjs";
import "../../map-earth-cool-tech/index.mjs";
import "../../map-earth-particle/index.mjs";
import "../../map-earth-hacker/index.mjs";
import "../../map-earth-fly-line/index.mjs";
import "../../chart-other-grid-percentage/index.mjs";
import "../../chart-other-radar-stack/index.mjs";
import "../../chart-other-funnel2/index.mjs";
import "../../chart-other-label-gauge/index.mjs";
import "../../chart-other-theme-river/index.mjs";
import "../../chart-other-tree/index.mjs";
import "../../chart-other-treemap/index.mjs";
import "../../commons-product-model/index.mjs";
import "../../commons-vr-photo/index.mjs";
import "../../commons-vr-video/index.mjs";
import "../../commons-three-loader/index.mjs";
import "../../commons-three-loader3/index.mjs";
import "../../commons-loop-iterator/index.mjs";
import "../../commons-gaussian-splatting-view/index.mjs";
import "../../commons-babylon/index.mjs";
import "../../commons-svg/index.mjs";
import "../../commons-weather/index.mjs";
import "../../commons-weather-dynamic/index.mjs";
import "../../media-wavesurfer/index.mjs";
import "../../interaction-tabs/index.mjs";
import "../../interaction-tabs2/index.mjs";
import "../../interaction-button/index.mjs";
import "../../interaction-button-image/index.mjs";
import "../../interaction-select/index.mjs";
import "../../interaction-input/index.mjs";
import "../../interaction-radio/index.mjs";
import "../../interaction-slider/index.mjs";
import "../../interaction-switch/index.mjs";
import "../../interaction-data-picker/index.mjs";
import "../../interaction-button-refresh/index.mjs";
import "../../media-image/index.mjs";
import "../../text-title/index.mjs";
import "../../commons-qrcode/index.mjs";
import "../../media-video/index.mjs";
import "../../media-audio/index.mjs";
import "../../text-real-time/index.mjs";
import "../../media-carousel/index.mjs";
import "../../media-carousel-slides/index.mjs";
import "../../media-iframe-carousel/index.mjs";
import "../../media-iframe/index.mjs";
import "../../media-m3u8/index.mjs";
import "../../media-m3u8-dynamic/index.mjs";
import "../../media-audio-dynamic/index.mjs";
import "../../media-video-dynamic/index.mjs";
import "../../media-image-dynamic/index.mjs";
import "../../media-iframe-dynamic/index.mjs";
import "../../media-flv/index.mjs";
import "../../commons-echarts/index.mjs";
import "../../text-over-number/index.mjs";
import "../../text-table-scroll/index.mjs";
import "../../text-carousel/index.mjs";
import "../../text-row-scroll/index.mjs";
import "../../text-text-dynamic/index.mjs";
import "../../text-count-down/index.mjs";
import "../../graphical-circle/index.mjs";
import "../../graphical-diamond/index.mjs";
import "../../graphical-hexagon/index.mjs";
import "../../graphical-isosceles-triangle/index.mjs";
import "../../graphical-pentagon/index.mjs";
import "../../graphical-rect/index.mjs";
import "../../graphical-right-triangle/index.mjs";
import "../../scene-map3d/index.mjs";
import "../../scene-amap2d/index.mjs";
import "../../scene-amap3d/index.mjs";
import "../../scene-vr/index.mjs";
import "../../scene-unity-iframe/index.mjs";
import "../../scene-unity-webgl/index.mjs";
import "../../scene-ue-iframe/index.mjs";
import "../../scene-ue-shj/index.mjs";
import "../../scene-default/index.mjs";
import "../../interaction/tabs/index.mjs";
import "../../interaction/tabs-icon/index.mjs";
import "../../interaction/button/index.mjs";
import "../../interaction/date-picker/src/date-picker/index.mjs";
import "../../interaction/date-picker/src/date-picker-range/index.mjs";
import "../../text/list/index.mjs";
import "../../chart/src/bar/basic/index.mjs";
import "../../chart/src/bar/animation/index.mjs";
import "../../chart/src/bar/contrast/index.mjs";
import "../../chart/src/bar/contrast2/index.mjs";
import "../../chart/src/bar/contrast3/index.mjs";
import "../../chart/src/bar/gradient-column-chart/index.mjs";
import "../../chart/src/bar/horizontal/index.mjs";
import "../../chart/src/bar/horizontal-stack/index.mjs";
import "../../chart/src/bar/line-bar/index.mjs";
import "../../chart/src/bar/line-bar2/index.mjs";
import "../../chart/src/bar/loop/index.mjs";
import "../../chart/src/bar/mini/index.mjs";
import "../../chart/src/bar/polar/index.mjs";
import "../../chart/src/bar/polar-stack/index.mjs";
import "../../chart/src/bar/polar2/index.mjs";
import "../../chart/src/bar/radius-circle/index.mjs";
import "../../chart/src/bar/rank/index.mjs";
import "../../chart/src/bar/segmented-progress/index.mjs";
import "../../chart/src/bar/spire/index.mjs";
import "../../chart/src/bar/stack/index.mjs";
import "../../chart/src/bar/stack-line/index.mjs";
import "../../chart/src/bar/stack2/index.mjs";
import "../../chart/src/bar/stack3/index.mjs";
import "../../chart/src/bar/staggered/index.mjs";
import "../../chart/src/bar/three/index.mjs";
import "../../chart/src/bar/waterfall/index.mjs";
import "../../chart/src/bar/zebra/index.mjs";
import "../../chart/src/line/area-gradient/index.mjs";
import "../../chart/src/line/area-highlight/index.mjs";
import "../../chart/src/line/area-highlight2/index.mjs";
import "../../chart/src/line/basic/index.mjs";
import "../../chart/src/line/bump/index.mjs";
import "../../chart/src/line/dashed/index.mjs";
import "../../chart/src/line/ladder/index.mjs";
import "../../chart/src/line/logarithm/index.mjs";
import "../../chart/src/line/multix/index.mjs";
import "../../chart/src/line/polar-double/index.mjs";
import "../../chart/src/line/rain-flow/index.mjs";
import "../../chart/src/line/scale/index.mjs";
import "../../chart/src/line/smooth/index.mjs";
import "../../chart/src/line/smooth-area/index.mjs";
import "../../chart/src/line/stack/index.mjs";
import "../../chart/src/line/stack-area/index.mjs";
import "../../chart/src/line/temp/index.mjs";
import "../../chart/src/line/vertical/index.mjs";
import "../../chart/src/map/basic/index.mjs";
import "../../chart/src/map/bmap-basic/index.mjs";
import "../../chart/src/map/bmap-heatmap/index.mjs";
import "../../chart/src/map/bmap-rich/index.mjs";
import "../../chart/src/map/customize/index.mjs";
import "../../chart/src/map/lines/index.mjs";
import "../../chart/src/map/scatter/index.mjs";
import "../../chart/src/pie/3d/index.mjs";
import "../../chart/src/pie/basic/index.mjs";
import "../../chart/src/pie/basic2/index.mjs";
import "../../chart/src/pie/customized/index.mjs";
import "../../chart/src/pie/index/index.mjs";
import "../../chart/src/pie/interval/index.mjs";
import "../../chart/src/pie/legend-scroll/index.mjs";
import "../../chart/src/pie/radius/index.mjs";
import "../../chart/src/pie/rose/index.mjs";
import "../../chart/src/pie/round/index.mjs";
import "../../chart/src/pie/sunburst/index.mjs";
import "../../chart/src/scatter/basic/index.mjs";
import "../../chart/src/scatter/basic2/index.mjs";
import "../../chart/src/scatter/bubble/index.mjs";
import "../../chart/src/scatter/ripples/index.mjs";
import "../../commons/custom-component-render/index.mjs";
import "../zv-hj-tree-list/index.mjs";
import "../zv-hj-model-resource/index.mjs";
import "../zv-hj-one-map-config/index.mjs";
import "../zv-hj-video-control/index.mjs";
import "../zv-hj-video-page/index.mjs";
import "../zv-hj-password-input/index.mjs";
import "../zv-hj-carousel/index.mjs";
import "../zv-hj-video-monitor/index.mjs";
import "./index.mjs";
import "../zv-hj-scene-amap3d/index.mjs";
import "../zv-hj-person-face/index.mjs";
import "../zv-hj-resource-type-phone/index.mjs";
import "../zv-hj-tree-list-phone/index.mjs";
import "../zv-hj-video-page-phone/index.mjs";
import "../zv-hj-model-resource-phone/index.mjs";
import "../zv-hj-bottom-suspend/index.mjs";
import "../zv-hj-pagination/index.mjs";
import "../zv-hj-password-input-phone/index.mjs";
/* empty css                           */
/* empty css                                  */
import { SHJDatasourceV2 as He } from "../../../plugins/datasource/index.mjs";
import { SHJParseEvent as u } from "../../../plugins/event/index.mjs";
import "lodash";
import { HJLYDatasourceApi as V } from "../../../plugins/datasource/hjly/index.mjs";
const Re = F({ name: "zv-hj-scene-amap2d" }), Br = /* @__PURE__ */ F({
  ...Re,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  emits: [
    "amap2d-scene-success",
    "amap2d-scene-zoomstart",
    "amap2d-scene-zoomend",
    "amap2d-scene-mapclick",
    "amap2d-scene-dragstart",
    "amap2d-scene-dragging",
    "amap2d-scene-dragend",
    "amap2d-label-click",
    "amap2d-scene-label-layer-click",
    "amap2d-scene-label-layer-mouseover",
    "amap2d-scene-label-layer-mouseout",
    "amap2d-scene-track-click",
    "amap2d-scene-track-mouseover",
    "amap2d-scene-track-mouseout"
  ],
  setup(G, { expose: Z, emit: U }) {
    const o = G, d = U;
    u.parseEvents(o.useEvents, "on-page-loaded", null);
    const j = () => {
      const e = I(), m = I(), P = f(!1), k = f(!0), g = I([]), C = f([]), S = f(), x = f(), O = f(), h = f(), H = f(), M = f(), z = f(), w = f(), n = f(), D = f(), R = (t) => {
        o.sources && o.sources.length > 0 && He.parse({
          tId: o.uuid,
          sources: o.sources,
          callback: (a) => {
            try {
              n.value = a.data[0].data[0].data[0], t(a);
            } catch {
            }
          }
        });
      }, ee = (t) => {
        window._AMapSecurityConfig = {
          securityJsCode: t.basic.securityJsCode
        }, Me.load({
          key: t.basic.key,
          // 申请好的Web端开发者Key，首次调用 load 时必填
          version: "2.0",
          // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
          Loca: {
            version: "2.0.0"
          },
          plugins: [
            "AMap.ControlBar",
            "AMap.ToolBar",
            "AMap.Scale",
            "AMap.HeatMap",
            "AMap.GeoJSON",
            "AMap.ImageLayer",
            "AMap.TileLayer",
            "AMap.Polyline"
          ]
        }).then((a) => {
          h.value = a;
          const r = new h.value.createDefaultLayer({
            visible: !0,
            // 是否可见
            opacity: 1,
            // 透明度
            zIndex: 0
            // 叠加层级
          });
          e.value = new a.Map("zerov-amap-2d", {
            rotateEnable: t.config.rotateEnable,
            // 是否开启地图旋转交互 鼠标右键 + 鼠标画圈移动 或 键盘Ctrl + 鼠标画圈移动
            pitchEnable: t.config.pitchEnable,
            // 是否开启地图倾斜交互 鼠标右键 + 鼠标上下移动或键盘Ctrl + 鼠标上下移动
            zoomEnable: t.config.zoomEnable,
            dragEnable: t.config.dragEnable,
            zoom: t.config.zoom,
            // 初始化地图层级
            viewMode: "2D",
            // 开启3D视图,默认为关闭
            zooms: t.config.zooms,
            // 地图显示的缩放级别范围
            center: t.config.center,
            // 初始地图中心经纬度
            mapStyle: t.config.mapStyle,
            features: t.config.features,
            layers: [r]
          }), m.value = new window.Loca.Container({
            map: e.value
          }), O.value = new h.value.Scale({
            visible: t.config.plugin.scale.visible,
            position: {
              left: t.config.plugin.scale.position.left + "px",
              bottom: t.config.plugin.scale.position.bottom + "px"
            }
          }), e.value.addControl(O.value), S.value = new a.ControlBar({
            visible: t.config.plugin.controlBar.visible,
            showControlButton: t.config.plugin.controlBar.showControlButton,
            position: {
              right: t.config.plugin.controlBar.position.right + "px",
              top: t.config.plugin.controlBar.position.top + "px"
            }
          }), e.value.addControl(S.value), x.value = new a.ToolBar({
            visible: t.config.plugin.toolBar.visible,
            position: {
              left: t.config.plugin.toolBar.position.left + "px",
              top: t.config.plugin.toolBar.position.top + "px"
            }
          }), e.value.addControl(x.value);
          const s = e.value.getLayers();
          for (let l = 0; l < s.length; l++)
            (s[l].type === "sketchTileLayer" || s[l]._opts.type === "sketchImageLayer") && e.value.removeLayer(s[l]);
          if (t.sketchTile) {
            const l = te(t.sketchTile);
            l && e.value.addLayer(l);
          }
          if (t.sketchImage) {
            const l = oe(t.sketchImage);
            l && e.value.addLayer(l);
          }
          e.value.on("complete", () => {
            setTimeout(() => {
              var y;
              P.value = !0, d("amap2d-scene-success"), u.parseEvents(
                o.useEvents,
                "amap2d-scene-success",
                null
              );
              const l = f({
                clickCallback: (i) => {
                  d("amap2d-scene-label-layer-click", i), u.parseEvents(
                    o.useEvents,
                    "amap2d-scene-label-layer-click",
                    i
                  );
                },
                mouseoverCallback: (i) => {
                  d("amap2d-scene-label-layer-mouseover", i), u.parseEvents(
                    o.useEvents,
                    "amap2d-scene-label-layer-mouseover",
                    i
                  );
                },
                mouseoutCallback: (i) => {
                  d("amap2d-scene-label-layer-mouseout", i), u.parseEvents(
                    o.useEvents,
                    "amap2d-scene-label-layer-mouseout",
                    i
                  );
                }
              });
              (y = C.value) != null && y.length && (w.value = N(
                a,
                e.value,
                C.value,
                l,
                null
              ), g.value.push({
                type: "markerLayer",
                value: w
              }));
            }, 666);
          }), e.value.on("zoomstart", () => {
            d("amap2d-scene-zoomstart"), u.parseEvents(
              o.useEvents,
              "amap2d-scene-zoomstart",
              null
            );
          }), e.value.on("zoomend", () => {
            d("amap2d-scene-zoomend"), u.parseEvents(
              o.useEvents,
              "amap2d-scene-zoomend",
              null
            );
          }), e.value.on("click", (l) => {
            d("amap2d-scene-mapclick", l.lnglat), u.parseEvents(
              o.useEvents,
              "amap2d-scene-mapclick",
              l.lnglat
            );
          }), e.value.on("dragstart", (l) => {
            d("amap2d-scene-dragstart", l.lnglat), u.parseEvents(
              o.useEvents,
              "amap2d-scene-dragstart",
              l.lnglat
            );
          }), e.value.on("dragend", (l) => {
            d("amap2d-scene-dragend", l.lnglat), u.parseEvents(
              o.useEvents,
              "amap2d-scene-dragend",
              l.lnglat
            );
          });
        }).catch((a) => {
        });
      }, W = (t) => {
        t.config.apiTag && R(function(a) {
          const r = f({ ...t });
          if (r.value.basic.securityJsCode = n.value.mapSecurityJsCode, r.value.basic.key = n.value.mapKey, r.value.config.zoom = n.value.bestMapZoom, r.value.config.zooms = [
            n.value.minMapLevel,
            n.value.maxMapLevel
          ], r.value.config.center = [
            n.value.centerLng,
            n.value.centerLat
          ], n.value.layerName) {
            const s = f();
            s.value = "https://zgdev.fxo2opt.com", r.value.sketchTile.url = `${s.value}/hjly/map/${n.value.layerName}/{z}/{x}/{y}.png`, r.value.sketchTile.bounds = [
              [n.value.leftBottomLng, n.value.leftBottomLat],
              [n.value.rightTopLng, n.value.rightTopLat]
            ], r.value.sketchTile.zooms = r.value.config.zooms, r.value.sketchImage = null;
          } else n.value.mapUrl ? (r.value.sketchImage.url = n.value.mapUrl, r.value.sketchImage.bounds = [
            [n.value.leftBottomLng, n.value.leftBottomLat],
            [n.value.rightTopLng, n.value.rightTopLat]
          ], r.value.sketchImage.zooms = r.value.config.zooms, r.value.sketchTile = null) : (r.value.sketchImage = null, r.value.sketchTile = null);
          (!D.value || !D.value.basic) && (D.value = r.value, ee(r.value));
        });
      }, ae = (t, a) => {
        const r = h.value, s = f(), l = f({
          clickCallback: (p) => {
            d("amap2d-scene-label-layer-click", p), u.parseEvents(
              o.useEvents,
              "amap2d-scene-label-layer-click",
              p
            );
          },
          mouseoverCallback: (p) => {
            d("amap2d-scene-label-layer-mouseover", p), u.parseEvents(
              o.useEvents,
              "amap2d-scene-label-layer-mouseover",
              p
            );
          },
          mouseoutCallback: (p) => {
            d("amap2d-scene-label-layer-mouseout", p), u.parseEvents(
              o.useEvents,
              "amap2d-scene-label-layer-mouseout",
              p
            );
          }
        }), y = t && t.data || ke(), i = t.type;
        if (i === "navigatorDot" && ze(e, t), i === "loadHeatMap" ? (s.value = a.heatmap, re(r, s.value, y)) : i === "hideHeatMap" && we(H.value), i === "loadDotMap" ? (s.value = a.labelslayer, V.loadHomeResourceMap({
          pointType: n.value.pointType || "0",
          typeId: [n.value.typeId || 1],
          homeMapId: n.value.homeMapId || "1",
          mapPositionShowType: n.value.mapPositionShowType
        }).then((p) => {
          let c = p.data;
          if (n.value.resourceListFilter && (c = c == null ? void 0 : c.filter((b) => b.resourceName.indexOf(n.value.resourceListFilter) > -1)), c && !w.value) {
            if (e.value)
              C.value = null;
            else {
              C.value = c;
              return;
            }
            w.value = N(
              r,
              e.value,
              c,
              s,
              l.value
            ), g.value.push({
              type: "markerLayer",
              value: w.value
            });
          }
        })) : i === "dotlayers" ? (s.value = a.dotlayers, le(
          window.Loca,
          s.value,
          A(y)
        )) : i === "scatter" ? (s.value = a.scatter, ie(
          window.Loca,
          s.value,
          A(y)
        )) : i === "labelsLayer" ? (s.value = a.labelslayer, se(window.Loca, s.value, A(y)), T(m, g, k)) : i === "clearDotMap" && (Ee(m, g), Ce(m, g), Se(m, g), xe(e, g), w.value = null), i === "showDotLabelMap" ? (k.value = !0, T(m, g, k)) : i === "hideDotLabelMap" && (k.value = !1, T(m, g, k)), i === "showRoadMap" ? M.value ? M.value.show() : (M.value = new r.TileLayer.Traffic({
          autoRefresh: !0,
          // 是否自动刷新，默认为false
          interval: 180,
          // 刷新间隔，默认180s
          zIndex: 210
        }), Oe(r, e, M.value)) : i === "hideRoadMap" && De(r, e, M.value), i === "loadLineMap") {
          const p = [];
          y.forEach((c) => {
            c.lng && c.lat && p.push([c.lng, c.lat]);
          }), !z.value && p.length > 0 ? (z.value = new r.Polyline({
            path: p,
            strokeWeight: 3,
            strokeOpacity: 1,
            strokeColor: "yellow"
          }), Ae(r, e, z.value)) : z.value.show();
        } else i === "hideLineMap" && Ie(r, e, z.value);
        if (i === "showSmallMap" ? Te(r, e.value, M.value) : i === "hideSmallMap" && Be(r, e.value, M.value), i === "trackPlay") {
          const p = {
            clickCallback: (c) => {
              d("amap2d-scene-track-click", c), u.parseEvents(o.useEvents, "amap2d-scene-track-click", c);
            },
            mouseoverCallback: (c) => {
              d("amap2d-scene-track-mouseover", c), u.parseEvents(o.useEvents, "amap2d-scene-track-mouseover", c);
            },
            mouseoutCallback: (c) => {
              d("amap2d-scene-track-mouseout", c), u.parseEvents(o.useEvents, "amap2d-scene-track-mouseout", c);
            }
          };
          Pe(r, e.value, n.value.trackDataList, a, p, V);
        }
      }, te = (t) => {
        try {
          return new h.value.TileLayer({
            bounds: new h.value.Bounds(
              t.bounds[0],
              t.bounds[1]
            ),
            getTileUrl: function(r, s, l) {
              try {
                return t.url.replace("{z}", l).replace("{x}", r).replace("{y}", s);
              } catch {
              }
            },
            type: "sketchTileLayer",
            tileSize: t.tileSize,
            opacity: t.opacity,
            zIndex: t.zIndex,
            zooms: t.zooms
          });
        } catch {
        }
        return null;
      }, oe = (t) => {
        try {
          return new h.value.ImageLayer({
            bounds: new h.value.Bounds(
              t.bounds[0],
              // 左下  手绘图左下相对于地图的经纬度
              t.bounds[1]
              // 右上  手绘图右上相对于地图的经纬度
            ),
            type: "sketchImageLayer",
            opacity: t.opacity,
            url: t.url,
            zIndex: t.zIndex,
            zooms: t.zooms
            // 设置可见级别，[最小级别，最大级别]
          });
        } catch {
        }
        return null;
      }, re = (t, a, r) => {
        var s;
        try {
          const l = new t.HeatMap(e.value, {
            radius: 100,
            // 给定半径
            opacity: a.opacity,
            gradient: {
              0.3: "blue",
              0.5: "rgb(117,211,248)",
              0.7: "rgb(0, 255, 0)",
              0.9: "#ffea00",
              1: "red"
            },
            zIndex: 1e6
          }), y = [], i = [], p = ((s = r == null ? void 0 : r.data) == null ? void 0 : s.filter((b) => b.value[1] > 0 && b.value[0] > 0)) || [];
          p.forEach((b, J) => {
            y.push({
              count: b.value[2],
              lng: b.value[0],
              lat: b.value[1]
            }), i.push({
              count: b.value[2]
            });
          }), H.value = l;
          const c = p.map((b) => Math.log(b.value[2] + 1));
          y.forEach((b, J) => {
            b.count = c[J];
          }), setTimeout(() => {
            l.setDataSet({
              data: y
            });
          }, 0);
        } catch {
        }
      }, le = (t, a, r) => {
        try {
          const s = new t.GeoJSONSource({
            data: r
          }), l = new t.PointLayer({
            zIndex: a.zIndex,
            blend: a.blend,
            visible: a.visible,
            opacity: a.opacity
          }), y = {
            radius: a.style.radius,
            unit: a.style.unit,
            color: a.style.color,
            borderWidth: a.style.borderWidth,
            blurWidth: a.style.blurWidth,
            borderColor: a.style.borderColor
          };
          l.setSource(s), l.setStyle(y), m.value.add(l), g.value.push({
            type: "locaPointLayer",
            value: l
          }), l.addAnimate({
            key: a.animate.key,
            value: a.animate.value,
            duration: a.animate.duration,
            easing: a.animate.easing,
            transform: a.animate.transform,
            random: a.animate.random,
            delay: a.animate.delay,
            yoyo: a.animate.yoyo,
            repeat: a.animate.repeat
          });
        } catch {
        }
      }, ie = (t, a, r) => {
        try {
          const s = new t.GeoJSONSource({
            data: r
          }), l = new t.ScatterLayer({
            loca: m.value,
            zIndex: a.zIndex,
            opacity: a.opacity,
            visible: a.visible,
            zooms: a.zooms
          });
          l.setSource(s), l.setStyle({
            unit: a.style.unit,
            size: a.style.size,
            borderWidth: a.style.borderWidth,
            texture: a.style.texture,
            duration: a.style.duration,
            animate: a.style.animate
          }), m.value.animate.start(), g.value.push({
            type: "breathRed",
            value: l
          });
        } catch {
        }
      }, se = (t, a, r) => {
        try {
          const s = new t.GeoJSONSource({
            data: r
          }), l = new t.LabelsLayer({
            eventSupport: !0,
            visible: a.visible,
            zooms: a.zooms,
            opacity: a.opacity,
            collision: a.collision,
            allowCollision: a.allowCollision,
            zIndex: a.zIndex
          });
          l.setSource(s), l.setStyle({
            icon: {
              image: a.icon.image,
              size: a.icon.size,
              clipOrigin: a.icon.clipOrigin,
              offset: a.icon.offset,
              anchor: a.icon.anchor
            },
            text: {
              // 每项配置都可使用回调函数来动态配置
              content: (y, i) => i.properties[a.text.content],
              zooms: a.text.zooms,
              offset: a.text.offset,
              direction: a.text.direction,
              style: {
                fontSize: a.text.style.fontSize,
                fillColor: a.text.style.fillColor,
                strokeColor: a.text.style.strokeColor,
                strokeWidth: a.text.style.strokeWidth,
                padding: a.text.style.padding,
                backgroundColor: a.text.style.backgroundColor,
                borderColor: a.text.style.borderColor,
                borderWidth: a.text.style.borderWidth,
                fold: a.text.style.fold,
                fontWeight: a.text.style.fontWeight
              }
            }
          }), l.on("complete", () => {
            const y = l.getLabelsLayer().getAllOverlays();
            for (const i of y)
              i.on("click", (p) => {
                d("amap2d-scene-label-layer-click", p), u.parseEvents(
                  o.useEvents,
                  "amap2d-scene-label-layer-click",
                  p
                );
              }), i.on("mouseover", (p) => {
                d("amap2d-scene-label-layer-mouseover", p), u.parseEvents(
                  o.useEvents,
                  "amap2d-scene-label-layer-mouseover",
                  p
                );
              }), i.on("mouseout", (p) => {
                d("amap2d-scene-label-layer-mouseout", p), u.parseEvents(
                  o.useEvents,
                  "amap2d-scene-label-layer-mouseout",
                  p
                );
              });
          }), m.value.add(l), g.value.push({
            type: "labelsLayer",
            value: l
          });
        } catch {
        }
      }, A = (t) => {
        const a = {
          type: "FeatureCollection",
          features: []
        };
        return t.forEach((r, s) => {
          const l = {
            type: "Feature",
            id: Le(),
            properties: {
              name: r.name || "",
              _draw_type: "point"
            },
            geometry: {
              type: "Point",
              coordinates: r.value
            }
          };
          a.features.push(l);
        }), a;
      }, pe = (t) => {
        e.value && (e.value.setFeatures(t.config.features), e.value.setStatus({
          dragEnable: t.config.dragEnable,
          zoomEnable: t.config.zoomEnable,
          rotateEnable: t.config.rotateEnable
        }), t.config.plugin.scale.visible ? O.value.show() : O.value.hide(), t.config.plugin.toolBar.visible ? x.value.show() : x.value.hide(), t.config.plugin.controlBar.visible ? S.value.show() : S.value.hide());
      }, ne = () => {
        e.value && (e.value.clearMap(), m.value.clear(), R(h.value));
      }, ce = (t) => {
        e.value && e.value.setMapStyle(t.config.mapStyle);
      }, me = (t) => {
        e.value && e.value.setZoom(t.config.zoom, !1, 200);
      }, ue = (t) => {
        e.value && e.value.setCenter(t.config.center, !1, 200);
      }, de = () => {
        e.value && (e.value.clearMap(), e.value.destroy(), e.value = null, m.value && (m.value.clear(), m.value.destroy(), m.value = null));
      };
      return ge(() => {
        setTimeout(() => {
          W(o.basicOption);
        }, 0);
      }), he(() => de()), {
        initAMap2d: W,
        updateAMapStyle: ce,
        updateAMapConfig: pe,
        updateAMapComponents: ne,
        updateAMapZoom: me,
        updateAMapCenter: ue,
        amap2d: e,
        loading: P,
        AMapPrototype: h,
        showLable: k,
        renderComponentsV2: ae
      };
    }, {
      initAMap2d: E,
      updateAMapStyle: $,
      updateAMapConfig: B,
      updateAMapComponents: K,
      updateAMapZoom: Y,
      updateAMapCenter: q,
      loading: Q,
      showLable: X,
      renderComponentsV2: v
    } = j();
    return L(
      () => o.basicOption.config,
      () => {
        B(o.basicOption);
      },
      { deep: !0 }
    ), L(
      () => o.basicOption.config.zoom,
      () => {
        Y(o.basicOption);
      },
      { deep: !0 }
    ), L(
      () => o.basicOption.config.center,
      () => {
        q(o.basicOption);
      },
      { deep: !0 }
    ), L(
      () => o.basicOption.widgets,
      () => {
        K();
      },
      { deep: !0 }
    ), L(
      () => o.basicOption.config.mapStyle,
      () => {
        $(o.basicOption);
      },
      { deep: !0 }
    ), L(
      () => o.basicOption.basic,
      () => {
        E(o.basicOption);
      },
      { deep: !0 }
    ), L(
      () => o.sources,
      () => {
        E(o.basicOption);
      },
      { deep: !0 }
    ), Z({
      refresh: () => E(o.basicOption),
      refreshView: () => B(o.basicOption),
      refreshData: () => E(o.basicOption),
      refreshMapLayer: (e, m) => v(e, o.basicOption),
      // 定位点位
      navigatorDot: (e) => {
        e.type = "navigatorDot", v(e, o.basicOption);
      },
      // 清除点位
      clearDotMap: (e) => {
        (!e || e === 1 || e === 2) && (e = {}), e.type = "clearDotMap", v(e, o.basicOption);
      },
      // 打点热力图
      loadHeatMap: (e) => {
        e.type = "loadHeatMap", v(e, o.basicOption);
      },
      // 隐藏热力图点位
      hideHeatMap: (e) => {
        e.type = "hideHeatMap", v(e, o.basicOption);
      },
      // 打点方法1
      loadDotlayers: (e) => {
        e.type = "dotlayers", v(e, o.basicOption);
      },
      // 打点方法2
      loadScatter: (e) => {
        e.type = "scatter", v(e, o.basicOption);
      },
      // 打点方法3
      loadLabelsLayer: (e) => {
        e.type = "labelsLayer", v(e, o.basicOption);
      },
      // 打点方法4
      loadDotMap: (e) => {
        (!e || e === 1 || e === 2) && (e = {}), e.type = "loadDotMap", v(e, o.basicOption);
      },
      // 行走路线
      loadLineMap: (e) => {
        e.type = "loadLineMap", v(e, o.basicOption);
      },
      hideLineMap: (e) => {
        e.type = "hideLineMap", v(e, o.basicOption);
      },
      // 显示资源名称
      showDotLabelMap: (e) => {
        e.type = "showDotLabelMap", v(e, o.basicOption);
      },
      // 隐藏资源名称
      hideDotLabelMap: (e) => {
        e.type = "hideDotLabelMap", v(e, o.basicOption);
      },
      // 开启实时路况
      showRoadMap: (e) => {
        e.type = "showRoadMap", v(e, o.basicOption);
      },
      // 隐藏实时路况
      hideRoadMap: (e) => {
        e.type = "hideRoadMap", v(e, o.basicOption);
      },
      // 打开小地图
      showSmallMap: (e) => {
        e.type = "showSmallMap", v(e, o.basicOption);
      },
      // 隐藏小地图
      hideSmallMap: (e) => {
        e.type = "hideSmallMap", v(e, o.basicOption);
      },
      // 轨迹回放
      trackPlay: (e) => {
        e.type = "trackPlay", v(e, o.basicOption);
      }
    }), (e, m) => (ye(), ve("div", {
      class: fe(["amap-2d-wrap", { show: _(Q), "amap-2d-show": _(X) }])
    }, m[0] || (m[0] = [
      be("div", {
        id: "zerov-amap-2d",
        class: "zerov-amap-container"
      }, null, -1)
    ]), 2));
  }
});
export {
  Br as default
};
