import { defineComponent as d, onMounted as h, openBlock as u, createElementBlock as p } from "vue";
import * as r from "echarts";
import "echarts-gl";
import g from "./china.mjs";
const y = {
  class: "container",
  id: "container"
}, b = d({ name: "EMapLines3D" }), w = /* @__PURE__ */ d({
  ...b,
  setup(S) {
    new Promise((a, e) => {
      let t = new XMLHttpRequest();
      t.open("get", "./china.json"), t.onreadystatechange = (f) => {
        t.readyState === 4 && t.status === 200 && a(t.response);
      }, t.send();
    });
    let l = null;
    h(() => {
      r.registerMap("china", g), l = r.init(document.getElementById("container")), c("china");
    });
    let m = [
      {
        name: "\u56DB\u5DDD\u7701",
        value: 111,
        regionHeight: 10,
        label: {},
        itemStyle: {
          color: "blue"
        },
        emphasis: {}
      }
    ], i = [
      [110.379257, 34.600612],
      [117.348611, 40.581141]
    ], n = "", s = null;
    function c(a) {
      s = {
        backgroundColor: "#fff",
        tooltip: {
          show: !0
        },
        center: [115.97, 29.71],
        legend: {
          show: !0
        },
        geo3D: {
          show: !1,
          map: a,
          name: "geo3D1",
          boxWidth: 100,
          boxHeight: 10,
          boxDepth: "auto",
          regionHeight: 3,
          instancing: !0,
          label: {
            show: !0,
            distance: 10,
            formatter: (e) => (n == e.name && (n = ""), e.name ? e.name : " "),
            color: "#fff",
            fontSize: 12,
            fontFamily: "sans-serif",
            fontWeight: 400,
            borderWidth: 0,
            borderColor: "#fff"
          },
          emphasis: {
            label: {
              show: !0,
              distance: 10,
              formatter: (e) => (n = e.name, e.name ? e.name : " "),
              textStyle: {
                color: "#fff",
                fontSize: 20,
                fontFamily: "sans-serif",
                fontWeight: 400,
                borderWidth: 0,
                borderColor: "#fff"
              }
            },
            itemStyle: {
              color: "red",
              opacity: 1
            }
          },
          itemStyle: {
            color: "#144a69",
            opacity: 1,
            borderWidth: 1,
            borderColor: "#06767c"
          },
          viewControl: {
            projection: "perspective",
            zoomSensitivity: 0,
            panSensitivity: 0,
            panMouseButton: "left",
            rotateMouseButton: "right",
            distance: 100,
            minDistance: 40,
            maxDistance: 400,
            orthographicSize: 100,
            maxOrthographicSize: 400,
            minOrthographicSize: 20,
            alpha: 40,
            beta: 0,
            center: [0, 0, 0],
            minAlpha: 40,
            maxAlpha: 40,
            minBeta: 0,
            maxBeta: 0
          },
          zlevel: 2
        },
        series: [
          {
            type: "lines3D",
            name: "lines1",
            coordinateSystem: "geo3D",
            geo3DIndex: 1,
            zlevel: 12,
            polyline: !1,
            effect: {
              show: !0,
              period: 2,
              trailLength: 1,
              trailWidth: 2,
              trailColor: "red",
              trailOpacity: 1,
              symbolSize: 30,
              symbol: "./\u98DE\u673A.png"
            },
            lineStyle: {
              color: "rgba(255, 200, 113, 1)",
              width: 2,
              opacity: 0
            },
            data: [
              {
                coords: [i[1], i[0]],
                value: 100,
                lineStyle: {
                  color: "gray",
                  width: 2,
                  opacity: 0
                }
              },
              {
                coords: [[113.594461107, 24.8029603119], i[0]],
                value: 100,
                lineStyle: {}
              }
            ],
            silent: !1
          },
          {
            type: "scatter3D",
            name: "\u6563\u70B9",
            coordinateSystem: "geo3D",
            geo3DIndex: 1,
            zlevel: 3,
            symbol: "circle",
            symbolSize: 20,
            itemStyle: {
              color: [1, 1, 1, 1],
              opacity: 0.7,
              borderWidth: 2,
              borderColor: "#fff"
            },
            label: {
              show: !0,
              distance: 5,
              position: "top",
              formatter: (e) => (console.log(e), e.data[3]),
              textStyle: {
                color: "red",
                fontFamily: "sans-serif",
                fontSize: 14,
                fontWeight: "normal"
              }
            },
            emphasis: {
              itemStyle: {},
              label: {}
            },
            data: [
              [...i[1], 0, 100],
              [113.594461107, 24.8029603119, 0, 100],
              [...i[0], 0, 100]
            ],
            blendMode: "source-over",
            silent: !1
          },
          {
            type: "map3D",
            name: "MAP",
            map: a,
            boxWidth: 100,
            boxHeight: 10,
            boxDepth: "auto",
            regionHeight: 3,
            instancing: !0,
            label: {
              show: !0,
              distance: 10,
              formatter: (e) => e.data.name ? e.data.name : " ",
              textStyle: {
                color: "#fff",
                fontSize: 12,
                fontFamily: "sans-serif",
                fontWeight: 400,
                borderWidth: 0,
                borderColor: "#fff"
              }
            },
            itemStyle: {
              color: "#144a69",
              opacity: 1,
              borderWidth: 1,
              borderColor: "#06767c"
            },
            emphasis: {
              label: {
                show: !0,
                distance: 10,
                formatter: (e) => e.data.name ? e.data.name : " ",
                textStyle: {
                  color: "#fff",
                  fontSize: 12,
                  fontFamily: "sans-serif",
                  fontWeight: 400,
                  borderWidth: 0,
                  borderColor: "#fff"
                }
              },
              itemStyle: {
                color: "red",
                opacity: 1
              }
            },
            temporalSuperSampling: {
              enable: "auto"
            },
            viewControl: {
              projection: "perspective",
              zoomSensitivity: 0,
              panSensitivity: 0,
              panMouseButton: "left",
              rotateMouseButton: "right",
              distance: 100,
              minDistance: 40,
              maxDistance: 400,
              orthographicSize: 100,
              maxOrthographicSize: 400,
              minOrthographicSize: 20,
              alpha: 40,
              beta: 0,
              center: [0, 0, 0],
              minAlpha: 40,
              maxAlpha: 40,
              minBeta: 0,
              maxBeta: 0
            },
            zlevel: 10,
            left: "auto",
            top: "auto",
            right: "auto",
            bottom: "auto",
            width: "auto",
            height: "auto",
            data: m
          }
        ]
      }, l.setOption(s), l.on("click", function(e) {
        console.log(e, n), n === "\u56DB\u5DDD\u7701" && new Promise((t, f) => {
          let o = new XMLHttpRequest();
          o.open("get", "https://geo.datav.aliyun.com/areas_v3/bound/510000_full.json"), o.onreadystatechange = (D) => {
            o.readyState === 4 && o.status === 200 && t(o.response);
          }, o.send();
        }).then((t) => {
          r.init(document.getElementById("container")).dispose(), l = r.init(document.getElementById("container")), r.registerMap("sichuan", t), s = null, c("sichuan");
        });
      });
    }
    return (a, e) => (u(), p("div", y));
  }
});
export {
  w as default
};
