vue-tianditu2
Version:
40 lines (39 loc) • 1.25 kB
JavaScript
import p from "mitt";
import { defineComponent as u, ref as f, provide as r, h as d, onMounted as c } from "vue";
import { useApiLoader as s } from "../use/apiLoader.mjs";
import { useEvent as v } from "../use/event.mjs";
import { EVENTS as l, PROPS as h, NATIVE_EVENTS as E } from "./use/const.mjs";
import { useInit as M } from "./use/init.mjs";
import { useWatch as T } from "./use/watch.mjs";
import { useControls as g } from "./use/controls.mjs";
const A = u({
name: "TdtMap",
props: h,
emits: l,
setup(e, { emit: i, slots: a }) {
const t = f(), m = p();
r("mapRoot", t), r("mapEmitter", m);
const o = d("div", {
class: "tdt-map",
style: "width:100%;height:100%",
id: e.mid
});
return c(async () => {
await s(e.loadConfig), t.value = M(e, o.el), v({ events: E, emit: i, instance: t.value }), T({ props: e, instance: t.value }), g(e, t.value, i), i("init", t.value), m.emit("mapInit", t.value);
}), () => {
var n;
return d(
"div",
{
class: "tdt-map-container",
style: "width:100%;height:100%"
},
[o, (n = a.default) == null ? void 0 : n.call(a)]
);
};
}
});
export {
A as TdtMap
};
//# sourceMappingURL=index.mjs.map