import g from "./constant.mjs";
const k = (l, e, t, c, a) => {
  if (l) {
    const r = [];
    if (t.forEach((o) => {
      var i;
      o.lng = o.value[0], o.lat = o.value[1], o.count = (i = o == null ? void 0 : o.value) == null ? void 0 : i[2], o.typeCode = (o == null ? void 0 : o.typeCode) || "A01";
      const v = o.resourceName || o.name, f = [o.lng, o.lat];
      o.image;
      const p = "url(http://zgdev.fxo2opt.com/document/shi/zv-hj-scene-amap2d/green.png)", s = document.createElement("div"), n = document.createElement("div");
      n.style.backgroundImage = p, n.style.backgroundPosition = "100% 100%", n.style.backgroundSize = "cover", n.style.backgroundPosition = "center center", n.style.display = "flex", n.style.alignItems = "flex-start", n.style.justifyContent = "center", n.style.width = "110px", n.style.height = "142px", n.style.position = "relative", n.style.top = "-106px", n.style.cursor = "pointer";
      const h = g.iconfont[o.typeCode], d = "#ffffff";
      o.homeImage || (s.className = "iconfont " + h, s.style.width = s.style.height = "32px", s.style.fontSize = "20px", s.style.color = d, s.style.position = "relative", s.style.top = "8px", s.style.display = "flex", s.style.alignItems = "center", s.style.justifyContent = "center", s.style.left = "-1px"), n.appendChild(s);
      const y = {
        extData: o,
        position: f,
        autoMove: !0,
        content: n,
        anchor: "bottom-center",
        // 将锚点设置为标记的底部中心点
        offset: new l.Pixel(0, 142)
        // 偏移量
      }, u = new l.Marker(y);
      u.setLabel({
        direction: "top",
        offset: new l.Pixel(0, -120),
        // 设置文本标注偏移量
        content: `<div class='hj__map-marker-label'>${v}</div>`
        // 设置文本标注内容
      }), r.push(u), u.on("click", () => {
        typeof a.clickCallback == "function" && a.clickCallback(o);
      }), u.on("mouseover", () => {
        typeof a.mouseoverCallback == "function" && a.mouseoverCallback(o);
      });
    }), r.length > 0)
      return e.add(r), r;
  }
}, M = (l, e) => {
  if (l.value) {
    const t = e.lng, c = e.lat;
    t && c ? l.value.setCenter([t, c]) : l.value.getAllOverlays("marker").forEach((a) => {
      a.getExtData().resourceId === e.resourceId && l.value.setCenter(a.getPosition());
    });
  }
}, b = (l, e, t) => {
  e.value && t.setMap(e.value);
}, C = (l, e, t) => {
  e.value && t.hide();
}, E = (l, e, t) => {
  e.value && (e.value.add(t), e.value.setFitView());
}, w = (l, e, t) => {
  e.value && t.hide();
}, A = (l, e, t) => {
  e.value && t.hide();
}, I = (l, e, t) => {
  e.value && t.hide();
}, S = (l, e) => {
  l.value && e.value.length > 0 && e.value.forEach((t) => {
    t.type === "locaPointLayer" && l.value.remove(t.value);
  });
}, D = (l, e) => {
  l.value && e.value.length > 0 && e.value.forEach((t) => {
    t.type === "breathRed" && l.value.remove(t.value);
  });
}, P = (l, e) => {
  l.value && e.value.length > 0 && e.value.forEach((t) => {
    t.type === "labelsLayer" && l.value.remove(t.value);
  });
}, j = (l, e) => {
  l.value && e.value.length > 0 && e.value.forEach((t) => {
    t.type === "markerLayer" && l.value.remove(t.value);
  });
}, z = (l, e, t) => {
  l.value && e.value.length > 0 && e.value.forEach((c) => {
    c.type === "labelsLayer" && c.value.setStyle({
      // 其他样式
      text: {
        style: {
          visible: !!t.value,
          opacity: t.value ? 1 : 0
        }
      }
    });
  });
};
export {
  P as clearLabelsLayer,
  S as clearLoadLocaDotLayers,
  j as clearMarkerLayer,
  D as clearRipplesScatter,
  w as hideLineMap,
  C as hideRoadMap,
  I as hideSmallMap,
  k as loadDotMap,
  E as loadLineMap,
  M as navigatorDot,
  z as showAndHideDotLabelMap,
  b as showRoadMap,
  A as showSmallMap
};
