UNPKG

@mapbox-vue3/env-layers

Version:

Mapbox Vue3 Component Library Env Layers

26 lines (25 loc) 680 B
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 { rainLayerProps as d } from "./rain-layer.mjs"; const f = { class: "mb-rain-layer" }, l = { name: "MbRainLayer" }, k = s({ ...l, props: d, setup(n) { const t = n; let o; const a = () => { const e = r(); o = new _.RainLayer(t.id), e.addLayer(o); }, { getMapboxInstance: r } = i(a); return c(() => { const e = r(); o && e.removeLayer(t.id); }), (e, u) => (m(), p("i", f)); } }); export { k as default };