@mapbox-vue3/env-layers
Version:
Mapbox Vue3 Component Library Env Layers
26 lines (25 loc) • 680 B
JavaScript
import { defineComponent as s, onBeforeUnmount as c, openBlock as m, createElementBlock as p } from "vue";
import { useMapCreated as i } from "@mapbox-vue3/core";
import _ from "@mapbox-web/deck-gl-extension";
import { snowLayerProps as d } from "./snow-layer.mjs";
const f = { class: "mb-snow-layer" }, l = {
name: "MbSnowLayer"
}, b = s({
...l,
props: d,
setup(r) {
const t = r;
let o;
const a = () => {
const e = n();
o = new _.SnowLayer(t.id), e.addLayer(o);
}, { getMapboxInstance: n } = i(a);
return c(() => {
const e = n();
o && e.removeLayer(t.id);
}), (e, u) => (m(), p("i", f));
}
});
export {
b as default
};