vue-maplibre-gl
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -6,2 +6,3 @@ import { CircleLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<CircleLayerSpecification["paint"]>; | ||
filter: PropType<CircleLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<CircleLayerSpecification["paint"]>; | ||
filter: PropType<CircleLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { FillLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<FillLayerSpecification["paint"]>; | ||
filter: PropType<FillLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<FillLayerSpecification["paint"]>; | ||
filter: PropType<FillLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { FillExtrusionLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<FillExtrusionLayerSpecification["paint"]>; | ||
filter: PropType<FillExtrusionLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<FillExtrusionLayerSpecification["paint"]>; | ||
filter: PropType<FillExtrusionLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { HeatmapLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<HeatmapLayerSpecification["paint"]>; | ||
filter: PropType<HeatmapLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<HeatmapLayerSpecification["paint"]>; | ||
filter: PropType<HeatmapLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { HillshadeLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<HillshadeLayerSpecification["paint"]>; | ||
filter: PropType<HillshadeLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<HillshadeLayerSpecification["paint"]>; | ||
filter: PropType<HillshadeLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { LineLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<LineLayerSpecification["paint"]>; | ||
filter: PropType<LineLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<LineLayerSpecification["paint"]>; | ||
filter: PropType<LineLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { RasterLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<RasterLayerSpecification["paint"]>; | ||
filter: PropType<RasterLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<RasterLayerSpecification["paint"]>; | ||
filter: PropType<RasterLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
@@ -6,2 +6,3 @@ import { SymbolLayerSpecification } from 'maplibre-gl'; | ||
paint: PropType<SymbolLayerSpecification["paint"]>; | ||
filter: PropType<SymbolLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -23,2 +24,3 @@ type: PropType<string>; | ||
paint: PropType<SymbolLayerSpecification["paint"]>; | ||
filter: PropType<SymbolLayerSpecification["filter"]>; | ||
layerId: { | ||
@@ -25,0 +27,0 @@ type: PropType<string>; |
/*! | ||
* vue-maplibre-gl v5.0.1 | ||
* vue-maplibre-gl v5.0.2 | ||
* (c) 2025 Volker Nauruhn | ||
@@ -7,5 +7,5 @@ * @license MIT | ||
var he = Object.defineProperty; | ||
var pe = (e, a, o) => a in e ? he(e, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[a] = o; | ||
var b = (e, a, o) => pe(e, typeof a != "symbol" ? a + "" : a, o); | ||
import { reactive as ee, defineComponent as p, markRaw as re, getCurrentInstance as I, shallowRef as X, ref as B, provide as z, watch as c, onMounted as ye, onBeforeUnmount as C, h as M, unref as K, nextTick as te, inject as h, createCommentVNode as O, Teleport as ue, warn as de, createTextVNode as le, isRef as V } from "vue"; | ||
var ye = (e, a, o) => a in e ? he(e, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[a] = o; | ||
var b = (e, a, o) => ye(e, typeof a != "symbol" ? a + "" : a, o); | ||
import { reactive as ee, defineComponent as y, markRaw as re, getCurrentInstance as I, shallowRef as X, ref as _, provide as B, watch as c, onMounted as pe, onBeforeUnmount as C, h as M, unref as K, nextTick as te, inject as h, createCommentVNode as O, Teleport as ue, warn as de, createTextVNode as le, isRef as V } from "vue"; | ||
import { Map as ve, AttributionControl as Se, FullscreenControl as be, GeolocateControl as Ae, NavigationControl as Oe, ScaleControl as Re, Marker as Le } from "maplibre-gl"; | ||
@@ -153,3 +153,3 @@ import Ee from "mitt"; | ||
const W = /* @__PURE__ */ new Map(), ce = Symbol("default"); | ||
function pt(e = ce) { | ||
function yt(e = ce) { | ||
let a = W.get(e); | ||
@@ -164,3 +164,3 @@ return a || (a = ee({ isLoaded: !1, isMounted: !1, language: null }), W.set(e, a)), a; | ||
const N = Symbol("map"), q = Symbol("isLoaded"), T = Symbol("isInitialized"), ae = Symbol("componentId"), oe = Symbol("sourceId"), me = Symbol("sourceLayerRegistry"), ne = Symbol("emitter"); | ||
function yt(e) { | ||
function pt(e) { | ||
return Object.keys(e); | ||
@@ -281,36 +281,36 @@ } | ||
if (Array.isArray(m) && m.length >= 2 && m[0].trim().toLowerCase() === "concat") { | ||
const y = m.slice(); | ||
const p = m.slice(); | ||
for (let u = 0; u < m.length; u += 1) { | ||
const i = m[u]; | ||
if ((typeof i == "string" || i instanceof String) && n.exec(i.toString())) { | ||
y[u] = f; | ||
p[u] = f; | ||
break; | ||
} else if (Array.isArray(i) && i.length >= 2 && i[0].trim().toLowerCase() === "get" && t.exec(i[1].toString())) { | ||
y[u] = f; | ||
p[u] = f; | ||
break; | ||
} else if (Array.isArray(i) && i.length === 4 && i[0].trim().toLowerCase() === "case") { | ||
y[u] = f; | ||
p[u] = f; | ||
break; | ||
} | ||
} | ||
e.setLayoutProperty(g.id, "text-field", y); | ||
e.setLayoutProperty(g.id, "text-field", p); | ||
} else if (Array.isArray(m) && m.length >= 2 && m[0].trim().toLowerCase() === "get" && t.exec(m[1].toString())) { | ||
const y = f; | ||
e.setLayoutProperty(g.id, "text-field", y); | ||
const p = f; | ||
e.setLayoutProperty(g.id, "text-field", p); | ||
} else if ((typeof m == "string" || m instanceof String) && n.exec(m.toString())) { | ||
const y = f; | ||
e.setLayoutProperty(g.id, "text-field", y); | ||
const p = f; | ||
e.setLayoutProperty(g.id, "text-field", p); | ||
} else if (Array.isArray(m) && m.length === 4 && m[0].trim().toLowerCase() === "case") { | ||
const y = f; | ||
e.setLayoutProperty(g.id, "text-field", y); | ||
const p = f; | ||
e.setLayoutProperty(g.id, "text-field", p); | ||
} else if ((typeof m == "string" || m instanceof String) && (R = l.exec(m.toString())) !== null) { | ||
const y = `{${v}}${R[3]}{name${R[4] || ""}}`; | ||
e.setLayoutProperty(g.id, "text-field", y); | ||
const p = `{${v}}${R[3]}{name${R[4] || ""}}`; | ||
e.setLayoutProperty(g.id, "text-field", p); | ||
} else if ((typeof m == "string" || m instanceof String) && (R = d.exec(m.toString())) !== null) { | ||
const y = `${R[1]}{${v}}${R[5]}`; | ||
e.setLayoutProperty(g.id, "text-field", y); | ||
const p = `${R[1]}{${v}}${R[5]}`; | ||
e.setLayoutProperty(g.id, "text-field", p); | ||
} | ||
} | ||
} | ||
const Ne = /* @__PURE__ */ p({ | ||
const Ne = /* @__PURE__ */ y({ | ||
name: "MglMap", | ||
@@ -436,5 +436,5 @@ props: { | ||
setup(e, a) { | ||
const o = re(I()), n = X(), t = X(), l = B(!1), d = B(!1), v = B(!1), f = /* @__PURE__ */ new Map(), A = Ee(), g = Ce(o, t, e.mapKey); | ||
const o = re(I()), n = X(), t = X(), l = _(!1), d = _(!1), v = _(!1), f = /* @__PURE__ */ new Map(), A = Ee(), g = Ce(o, t, e.mapKey); | ||
let L; | ||
z(N, t), z(q, d), z(T, l), z(ae, o.uid), z(oe, ""), z(ne, A), c(() => e.bearing, (i) => { | ||
B(N, t), B(q, d), B(T, l), B(ae, o.uid), B(oe, ""), B(ne, A), c(() => e.bearing, (i) => { | ||
var r; | ||
@@ -498,3 +498,3 @@ return i && ((r = t.value) == null ? void 0 : r.setBearing(i)); | ||
} | ||
async function y() { | ||
async function p() { | ||
g.isMounted = !1, g.isLoaded = !1, d.value = !1, t.value && (t.value.getCanvas().removeEventListener("webglcontextlost", u), t.value._controls.forEach((i) => { | ||
@@ -507,8 +507,8 @@ t.value.removeControl(i); | ||
function u() { | ||
y(), te(R); | ||
p(), te(R); | ||
} | ||
return ye(() => { | ||
return pe(() => { | ||
R(), t.value && (L = new ResizeObserver(Me(t.value.resize.bind(t.value), 100)), L.observe(n.value)); | ||
}), C(() => { | ||
L !== void 0 && (L.disconnect(), L = void 0), y(); | ||
L !== void 0 && (L.disconnect(), L = void 0), p(); | ||
}), a.expose({ map: t }), () => M( | ||
@@ -535,3 +535,3 @@ "div", | ||
} | ||
const xe = /* @__PURE__ */ p({ | ||
const xe = /* @__PURE__ */ y({ | ||
name: "MglAttributionControl", | ||
@@ -552,3 +552,3 @@ props: { | ||
} | ||
}), _ = class _ { | ||
}), z = class z { | ||
constructor(a, o) { | ||
@@ -568,8 +568,8 @@ b(this, "container"); | ||
setClasses(a) { | ||
a ? (this.container.classList.remove(_.CONTROL_CLASS), this.container.classList.remove(_.CONTROL_GROUP_CLASS)) : (this.container.classList.add(_.CONTROL_CLASS), this.container.classList.add(_.CONTROL_GROUP_CLASS)); | ||
a ? (this.container.classList.remove(z.CONTROL_CLASS), this.container.classList.remove(z.CONTROL_GROUP_CLASS)) : (this.container.classList.add(z.CONTROL_CLASS), this.container.classList.add(z.CONTROL_GROUP_CLASS)); | ||
} | ||
}; | ||
b(_, "CONTROL_CLASS", "maplibregl-ctrl"), b(_, "CONTROL_GROUP_CLASS", "maplibregl-ctrl-group"); | ||
let $ = _; | ||
const Ie = /* @__PURE__ */ p({ | ||
b(z, "CONTROL_CLASS", "maplibregl-ctrl"), b(z, "CONTROL_GROUP_CLASS", "maplibregl-ctrl-group"); | ||
let $ = z; | ||
const Ie = /* @__PURE__ */ y({ | ||
name: "MglCustomControl", | ||
@@ -588,3 +588,3 @@ props: { | ||
setup(e, { slots: a }) { | ||
const o = h(N), n = h(T), t = B(!1), l = new $(t, e.noClasses); | ||
const o = h(N), n = h(T), t = _(!1), l = new $(t, e.noClasses); | ||
return j(() => e.position, o, l), c(() => e.noClasses, (d) => l.setClasses(d)), C(() => { | ||
@@ -602,3 +602,3 @@ var d; | ||
} | ||
}), Te = /* @__PURE__ */ p({ | ||
}), Te = /* @__PURE__ */ y({ | ||
name: "MglFullscreenControl", | ||
@@ -698,3 +698,3 @@ props: { | ||
} | ||
const Pe = /* @__PURE__ */ p({ | ||
const Pe = /* @__PURE__ */ y({ | ||
name: "MglFrameRateControl", | ||
@@ -762,3 +762,3 @@ props: { | ||
} | ||
}), He = /* @__PURE__ */ p({ | ||
}), He = /* @__PURE__ */ y({ | ||
name: "MglGeolocationControl", | ||
@@ -807,3 +807,3 @@ props: { | ||
} | ||
}), ze = /* @__PURE__ */ p({ | ||
}), Be = /* @__PURE__ */ y({ | ||
name: "MglNavigationControl", | ||
@@ -831,3 +831,3 @@ props: { | ||
var ge = /* @__PURE__ */ ((e) => (e.IMPERIAL = "imperial", e.METRIC = "metric", e.NAUTICAL = "nautical", e))(ge || {}); | ||
const _e = Object.values(ge), Be = /* @__PURE__ */ p({ | ||
const ze = Object.values(ge), _e = /* @__PURE__ */ y({ | ||
name: "MglScaleControl", | ||
@@ -843,3 +843,3 @@ props: { | ||
default: "metric", | ||
validator: (e) => _e.indexOf(e) !== -1 | ||
validator: (e) => ze.indexOf(e) !== -1 | ||
} | ||
@@ -872,3 +872,3 @@ }, | ||
} | ||
}, Q = /* @__PURE__ */ p({ | ||
}, Q = /* @__PURE__ */ y({ | ||
name: "MglButton", | ||
@@ -890,3 +890,3 @@ props: { | ||
!e.path && e.type !== "text" && de("property `path` must be set on MaplibreButton"); | ||
const o = B(Z[e.type] || Z.default); | ||
const o = _(Z[e.type] || Z.default); | ||
return c(() => e.type, (n) => o.value = Z[n] || Z.default), () => { | ||
@@ -916,3 +916,3 @@ var n, t; | ||
} | ||
const ke = /* @__PURE__ */ p({ | ||
const ke = /* @__PURE__ */ y({ | ||
name: "MglStyleSwitchControl", | ||
@@ -940,3 +940,3 @@ props: { | ||
setup(e, { emit: a, slots: o }) { | ||
const n = h(N), t = h(T), l = h(q), d = h(ne), v = B(!1), f = B(e.isOpen === void 0 ? !1 : e.isOpen), A = X(e.modelValue === void 0 ? e.mapStyles.length ? e.mapStyles[0] : null : e.modelValue), g = new $(v, !1), L = y.bind(null, !1); | ||
const n = h(N), t = h(T), l = h(q), d = h(ne), v = _(!1), f = _(e.isOpen === void 0 ? !1 : e.isOpen), A = X(e.modelValue === void 0 ? e.mapStyles.length ? e.mapStyles[0] : null : e.modelValue), g = new $(v, !1), L = p.bind(null, !1); | ||
function m() { | ||
@@ -961,5 +961,5 @@ const u = n.value.getStyle().name; | ||
var i; | ||
((i = A.value) == null ? void 0 : i.name) !== u.name && (d.emit("styleSwitched", u), n.value.setStyle(u.style, { diff: !1 }), e.modelValue === void 0 && (A.value = u), a("update:modelValue", u), y(!1)); | ||
((i = A.value) == null ? void 0 : i.name) !== u.name && (d.emit("styleSwitched", u), n.value.setStyle(u.style, { diff: !1 }), e.modelValue === void 0 && (A.value = u), a("update:modelValue", u), p(!1)); | ||
} | ||
function y(u, i) { | ||
function p(u, i) { | ||
se(i) ? i.stopPropagation() : se(u) && u.stopPropagation(), !(e.isOpen !== void 0 && e.isOpen === u || f.value === u) && (e.isOpen === void 0 ? (f.value = typeof u == "boolean" ? u : !f.value, a("update:isOpen", f.value)) : a("update:isOpen", typeof u == "boolean" ? u : !e.isOpen)); | ||
@@ -972,3 +972,3 @@ } | ||
isOpen: f, | ||
toggleOpen: y, | ||
toggleOpen: p, | ||
setStyle: R, | ||
@@ -986,3 +986,3 @@ mapStyles: e.mapStyles, | ||
class: ["maplibregl-ctrl-icon maplibregl-style-switch", f.value ? "is-open" : ""], | ||
onClick: y.bind(null, !0) | ||
onClick: p.bind(null, !0) | ||
}), | ||
@@ -1017,3 +1017,3 @@ o.styleList ? o.styleList(u) : M( | ||
` | ||
}), Fe = /* @__PURE__ */ p({ | ||
}), Fe = /* @__PURE__ */ y({ | ||
name: "MglMarker", | ||
@@ -1048,3 +1048,3 @@ props: { | ||
let l = G.REFS.get(t); | ||
return l || (l = B(n ? null : void 0), G.REFS.set(t, l)), l; | ||
return l || (l = _(n ? null : void 0), G.REFS.set(t, l)), l; | ||
} | ||
@@ -1070,3 +1070,3 @@ }; | ||
const n = h(N), t = h(q), l = h(ne), d = h(ae), v = U.getSourceRef(d, e.sourceId), f = new De(); | ||
z(oe, e.sourceId), z(me, f); | ||
B(oe, e.sourceId), B(me, f); | ||
function A() { | ||
@@ -1086,3 +1086,3 @@ t.value && (n.value.addSource(e.sourceId, U.genSourceOpts(a, e, o)), v.value = n.value.getSource(e.sourceId)); | ||
coordinates: void 0 | ||
}), Ge = /* @__PURE__ */ p({ | ||
}), Ge = /* @__PURE__ */ y({ | ||
name: "MglCanvasSource", | ||
@@ -1124,3 +1124,3 @@ props: { | ||
filter: void 0 | ||
}), Ze = /* @__PURE__ */ p({ | ||
}), Ze = /* @__PURE__ */ y({ | ||
name: "MglGeoJsonSource", | ||
@@ -1161,3 +1161,3 @@ props: { | ||
coordinates: void 0 | ||
}), $e = /* @__PURE__ */ p({ | ||
}), $e = /* @__PURE__ */ y({ | ||
name: "MglImageSource", | ||
@@ -1193,3 +1193,3 @@ props: { | ||
volatile: void 0 | ||
}), Ke = /* @__PURE__ */ p({ | ||
}), Ke = /* @__PURE__ */ y({ | ||
name: "MglRasterSource", | ||
@@ -1233,3 +1233,3 @@ props: { | ||
baseShift: void 0 | ||
}), Je = /* @__PURE__ */ p({ | ||
}), Je = /* @__PURE__ */ y({ | ||
name: "MglRasterDemSource", | ||
@@ -1273,3 +1273,3 @@ props: { | ||
volatile: void 0 | ||
}), Qe = /* @__PURE__ */ p({ | ||
}), Qe = /* @__PURE__ */ y({ | ||
name: "MglVectorSource", | ||
@@ -1308,3 +1308,3 @@ props: { | ||
coordinates: void 0 | ||
}), tt = /* @__PURE__ */ p({ | ||
}), tt = /* @__PURE__ */ y({ | ||
name: "MglVideoSource", | ||
@@ -1414,7 +1414,7 @@ props: { | ||
L.unregisterUnmountHandler(o), m(); | ||
}), c([f, g], ([R, y]) => { | ||
R && (y || y === void 0) && (v.value.addLayer(S.genLayerOpts(o, e, n, d), n.before || void 0), t && S.registerLayerEvents(v.value, n.layerId, t.vnode)); | ||
}), c([f, g], ([R, p]) => { | ||
R && (p || p === void 0) && (v.value.addLayer(S.genLayerOpts(o, e, n, d), n.before || void 0), t && S.registerLayerEvents(v.value, n.layerId, t.vnode)); | ||
}, { immediate: !0 }), { map: v, isLoaded: f, source: g }; | ||
} | ||
const at = /* @__PURE__ */ p({ | ||
const at = /* @__PURE__ */ y({ | ||
name: "MglBackgroundLayer", | ||
@@ -1430,3 +1430,3 @@ props: { | ||
} | ||
}), ot = /* @__PURE__ */ p({ | ||
}), ot = /* @__PURE__ */ y({ | ||
name: "MglCircleLayer", | ||
@@ -1436,3 +1436,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1444,3 +1445,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), nt = /* @__PURE__ */ p({ | ||
}), nt = /* @__PURE__ */ y({ | ||
name: "MglFillLayer", | ||
@@ -1450,3 +1451,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1458,3 +1460,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), it = /* @__PURE__ */ p({ | ||
}), it = /* @__PURE__ */ y({ | ||
name: "MglFillExtrusionLayer", | ||
@@ -1464,3 +1466,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1472,3 +1475,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), rt = /* @__PURE__ */ p({ | ||
}), rt = /* @__PURE__ */ y({ | ||
name: "MglHeatmapLayer", | ||
@@ -1478,3 +1481,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1486,3 +1490,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), lt = /* @__PURE__ */ p({ | ||
}), lt = /* @__PURE__ */ y({ | ||
name: "MglHillshadeLayer", | ||
@@ -1492,3 +1496,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1500,3 +1505,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), st = /* @__PURE__ */ p({ | ||
}), st = /* @__PURE__ */ y({ | ||
name: "MglLineLayer", | ||
@@ -1506,3 +1511,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1514,3 +1520,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), ut = /* @__PURE__ */ p({ | ||
}), ut = /* @__PURE__ */ y({ | ||
name: "MglRasterLayer", | ||
@@ -1520,3 +1526,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1528,3 +1535,3 @@ emits: [...S.SHARED.emits], | ||
} | ||
}), dt = /* @__PURE__ */ p({ | ||
}), dt = /* @__PURE__ */ y({ | ||
name: "MglSymbolLayer", | ||
@@ -1534,3 +1541,4 @@ props: { | ||
layout: Object, | ||
paint: Object | ||
paint: Object, | ||
filter: [Boolean, Array] | ||
}, | ||
@@ -1562,7 +1570,7 @@ emits: [...S.SHARED.emits], | ||
MglMarker: Fe, | ||
MglNavigationControl: ze, | ||
MglNavigationControl: Be, | ||
MglRasterDemSource: Je, | ||
MglRasterLayer: ut, | ||
MglRasterSource: Ke, | ||
MglScaleControl: Be, | ||
MglScaleControl: _e, | ||
MglStyleSwitchControl: ke, | ||
@@ -1578,3 +1586,3 @@ MglSymbolLayer: dt, | ||
export { | ||
yt as AllOptions, | ||
pt as AllOptions, | ||
k as AllSourceOptions, | ||
@@ -1600,7 +1608,7 @@ xe as MglAttributionControl, | ||
Fe as MglMarker, | ||
ze as MglNavigationControl, | ||
Be as MglNavigationControl, | ||
Je as MglRasterDemSource, | ||
ut as MglRasterLayer, | ||
Ke as MglRasterSource, | ||
Be as MglScaleControl, | ||
_e as MglScaleControl, | ||
ke as MglStyleSwitchControl, | ||
@@ -1620,3 +1628,3 @@ dt as MglSymbolLayer, | ||
P as useDisposableLayer, | ||
pt as useMap, | ||
yt as useMap, | ||
j as usePositionWatcher, | ||
@@ -1623,0 +1631,0 @@ D as useSource |
/*! | ||
* vue-maplibre-gl v5.0.1 | ||
* vue-maplibre-gl v5.0.2 | ||
* (c) 2025 Volker Nauruhn | ||
* @license MIT | ||
*/ | ||
(function(s,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("maplibre-gl"),require("mitt")):typeof define=="function"&&define.amd?define(["exports","vue","maplibre-gl","mitt"],t):(s=typeof globalThis<"u"?globalThis:s||self,t(s.VueMaplibreGl={},s.Vue,s.maplibregl,s.mitt))})(this,function(s,t,N,Me){"use strict";var Ze=Object.defineProperty;var Ge=(s,t,N)=>t in s?Ze(s,t,{enumerable:!0,configurable:!0,writable:!0,value:N}):s[t]=N;var b=(s,t,N)=>Ge(s,typeof t!="symbol"?t+"":t,N);const d=t.reactive({style:"https://demotiles.maplibre.org/style.json",center:[0,0],zoom:1,trackResize:!1});function Ee(e,a=250,i=!1){let o;function n(){const c=arguments,m=()=>{o=void 0,i!==!0&&e.apply(this,c)};clearTimeout(o),i===!0&&o===void 0&&e.apply(this,c),o=window.setTimeout(m,a)}return n.cancel=()=>{clearTimeout(o)},n}class M{static createEventHandler(a,i,o,n){return(c={})=>o.emit(n,{type:c.type,map:i,component:a,event:c})}}b(M,"MAP_OPTION_KEYS",["attributionControl","bearing","bearingSnap","bounds","boxZoom","cancelPendingTileRequestsWhileZooming","canvasContextAttributes","center","centerClampedToGround","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","elevation","fadeDuration","fitBoundsOptions","hash","interactive","keyboard","locale","localIdeographFontFamily","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","refreshExpiredTiles","renderWorldCopies","roll","rollEnabled","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle","zoom","mapStyle"]),b(M,"MARKER_OPTION_KEYS",["element","offset","anchor","color","draggable","clickTolerance","rotation","rotationAlignment","pitchAlignment","scale"]),b(M,"MAP_EVENT_TYPES",["boxzoomcancel","boxzoomend","boxzoomstart","click","contextmenu","cooperativegestureprevented","data","dataabort","dataloading","dblclick","drag","dragend","dragstart","error","idle","load","mousedown","mousemove","mouseout","mouseover","mouseup","move","moveend","movestart","pitch","pitchend","pitchstart","projectiontransition","remove","render","resize","rotate","rotateend","rotatestart","sourcedata","sourcedataabort","sourcedataloading","styledata","styledataloading","styleimagemissing","terrain","tiledataloading","touchcancel","touchend","touchmove","touchstart","webglcontextlost","webglcontextrestored","wheel","zoom","zoomend","zoomstart"]);const k=new Map,$=Symbol("default");function we(e=$){let a=k.get(e);return a||(a=t.reactive({isLoaded:!1,isMounted:!1,language:null}),k.set(e,a)),a}function Ie(e,a,i=$){var n;let o=k.get(i);return o||(o=t.reactive({isLoaded:!1,isMounted:!1,language:null}),k.set(i,o)),o.isLoaded=!1,o.isMounted=!1,o.component=e,o.map=a.value,o.isLoaded=((n=a.value)==null?void 0:n.loaded())||!1,o}const L=Symbol("map"),B=Symbol("isLoaded"),E=Symbol("isInitialized"),V=Symbol("componentId"),U=Symbol("sourceId"),q=Symbol("sourceLayerRegistry"),F=Symbol("emitter");function ve(e){return Object.keys(e)}function T(e){return Object.keys(e)}const K={AUTO:"auto",STYLE_LOCK:"style_lock",LATIN:"latin",NON_LATIN:"nonlatin",LOCAL:"",ALBANIAN:"sq",AMHARIC:"am",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BASQUE:"eu",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CORSICAN:"co",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HINDI:"hi",HUNGARIAN:"hu",ICELANDIC:"is",INDONESIAN:"id",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",JAPANESE_HIRAGANA:"ja-Hira",JAPANESE_KANA:"ja_kana",JAPANESE_LATIN:"ja_rm",JAPANESE_2018:"ja-Latn",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",KOREAN_LATIN:"ko-Latn",KURDISH:"ku",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALAYALAM:"ml",MALTESE:"mt",NORWEGIAN:"no",OCCITAN:"oc",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SERBIAN_LATIN:"sr-Latn",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",TAMIL:"ta",TELUGU:"te",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"};new Set(Object.values(K)),new Set(Object.values(K));function Y(e,a){const i=e.getStyle().layers,o=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,n=/^\s*name\s*(:\s*(\S*))?\s*$/,c=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/,m=/^(.*)({\s*name\s*(:\s*(\S*))?\s*})(.*)$/,p=a?`name:${a}`:"name",g=["case",["has",p],["get",p],["get","name"]];for(let C=0;C<i.length;C+=1){const h=i[C],R=h.layout;if(!R||!R["text-field"])continue;const f=e.getLayoutProperty(h.id,"text-field");let A;if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="concat"){const y=f.slice();for(let u=0;u<f.length;u+=1){const r=f[u];if((typeof r=="string"||r instanceof String)&&o.exec(r.toString())){y[u]=g;break}else if(Array.isArray(r)&&r.length>=2&&r[0].trim().toLowerCase()==="get"&&n.exec(r[1].toString())){y[u]=g;break}else if(Array.isArray(r)&&r.length===4&&r[0].trim().toLowerCase()==="case"){y[u]=g;break}}e.setLayoutProperty(h.id,"text-field",y)}else if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="get"&&n.exec(f[1].toString())){const y=g;e.setLayoutProperty(h.id,"text-field",y)}else if((typeof f=="string"||f instanceof String)&&o.exec(f.toString())){const y=g;e.setLayoutProperty(h.id,"text-field",y)}else if(Array.isArray(f)&&f.length===4&&f[0].trim().toLowerCase()==="case"){const y=g;e.setLayoutProperty(h.id,"text-field",y)}else if((typeof f=="string"||f instanceof String)&&(A=c.exec(f.toString()))!==null){const y=`{${p}}${A[3]}{name${A[4]||""}}`;e.setLayoutProperty(h.id,"text-field",y)}else if((typeof f=="string"||f instanceof String)&&(A=m.exec(f.toString()))!==null){const y=`${A[1]}{${p}}${A[5]}`;e.setLayoutProperty(h.id,"text-field",y)}}}const J=t.defineComponent({name:"MglMap",props:{width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},attributionControl:{type:[Boolean,Object],default:()=>d.attributionControl},bearing:{type:Number,default:()=>d.bearing},bearingSnap:{type:Number,default:()=>d.bearingSnap},bounds:{type:[Array,Object],default:()=>d.bounds},boxZoom:{type:Boolean,default:()=>d.boxZoom},cancelPendingTileRequestsWhileZooming:{type:Boolean,default:()=>d.cancelPendingTileRequestsWhileZooming},canvasContextAttributes:{type:Object,default:()=>d.canvasContextAttributes},center:{type:[Array,Object],default:()=>d.center},centerClampedToGround:{type:Boolean,default:()=>d.centerClampedToGround},clickTolerance:{type:Number,default:()=>d.clickTolerance},collectResourceTiming:{type:Boolean,default:()=>d.collectResourceTiming},cooperativeGestures:{type:[Boolean,Object],default:()=>d.cooperativeGestures},crossSourceCollisions:{type:Boolean,default:()=>d.crossSourceCollisions},doubleClickZoom:{type:Boolean,default:()=>d.doubleClickZoom},dragPan:{type:Boolean,default:()=>d.dragPan},dragRotate:{type:Boolean,default:()=>d.dragRotate},elevation:{type:Number,default:()=>d.elevation},fadeDuration:{type:Number,default:()=>d.fadeDuration},fitBoundsOptions:{type:Object,default:()=>d.fitBoundsOptions},hash:{type:[Boolean,String],default:()=>d.hash},interactive:{type:Boolean,default:()=>d.interactive},keyboard:{type:Boolean,default:()=>d.keyboard},language:{type:String,default:()=>d.language||null},locale:{type:Object,default:()=>d.locale},localIdeographFontFamily:{type:String,default:()=>d.localIdeographFontFamily},logoPosition:{type:[String],default:()=>d.logoPosition},mapKey:{type:[String,Symbol]},maplibreLogo:{type:Boolean,default:()=>d.maplibreLogo},mapStyle:{type:[String,Object],default:()=>d.style},maxBounds:{type:[Array,Object],default:()=>d.maxBounds},maxCanvasSize:{type:Array,default:()=>d.maxCanvasSize},maxPitch:{type:Number,default:()=>d.maxPitch},maxTileCacheSize:{type:Number,default:()=>d.maxTileCacheSize},maxTileCacheZoomLevels:{type:Number,default:()=>d.maxTileCacheZoomLevels},maxZoom:{type:Number,default:()=>d.maxZoom},minPitch:{type:Number,default:()=>d.minPitch},minZoom:{type:Number,default:()=>d.minZoom},pitch:{type:Number,default:()=>d.pitch},pitchWithRotate:{type:Boolean,default:()=>d.pitchWithRotate},pixelRatio:{type:Number,default:()=>d.pixelRatio},refreshExpiredTiles:{type:Boolean,default:()=>d.refreshExpiredTiles},renderWorldCopies:{type:Boolean,default:()=>d.renderWorldCopies},roll:{type:Number,default:()=>d.roll},rollEnabled:{typed:Boolean,default:()=>d.rollEnabled},scrollZoom:{type:Boolean,default:()=>d.scrollZoom},touchPitch:{type:Boolean,default:()=>d.touchPitch},touchZoomRotate:{type:Boolean,default:()=>d.touchZoomRotate},trackResize:{type:Boolean,default:()=>d.trackResize},transformCameraUpdate:{type:Function,default:d.transformCameraUpdate},transformRequest:{type:Function,default:d.transformRequest},validateStyle:{type:Boolean,default:()=>d.validateStyle},zoom:{type:Number,default:()=>d.zoom}},emits:["map:boxzoomcancel","map:boxzoomend","map:boxzoomstart","map:click","map:contextmenu","map:cooperativegestureprevented","map:data","map:dataabort","map:dataloading","map:dblclick","map:drag","map:dragend","map:dragstart","map:error","map:idle","map:load","map:mousedown","map:mousemove","map:mouseout","map:mouseover","map:mouseup","map:move","map:moveend","map:movestart","map:pitch","map:pitchend","map:pitchstart","map:projectiontransition","map:remove","map:render","map:resize","map:rotate","map:rotateend","map:rotatestart","map:sourcedata","map:sourcedataabort","map:sourcedataloading","map:styledata","map:styledataloading","map:styleimagemissing","map:terrain","map:tiledataloading","map:touchcancel","map:touchend","map:touchmove","map:touchstart","map:webglcontextlost","map:webglcontextrestored","map:wheel","map:zoom","map:zoomend","map:zoomstart"],slots:Object,setup(e,a){const i=t.markRaw(t.getCurrentInstance()),o=t.shallowRef(),n=t.shallowRef(),c=t.ref(!1),m=t.ref(!1),p=t.ref(!1),g=new Map,C=Me(),h=Ie(i,n,e.mapKey);let R;t.provide(L,n),t.provide(B,m),t.provide(E,c),t.provide(V,i.uid),t.provide(U,""),t.provide(F,C),t.watch(()=>e.bearing,r=>{var l;return r&&((l=n.value)==null?void 0:l.setBearing(r))}),t.watch(()=>e.bounds,r=>{var l;return r&&((l=n.value)==null?void 0:l.fitBounds(r))}),t.watch(()=>e.center,r=>{var l;return r&&((l=n.value)==null?void 0:l.setCenter(r))}),t.watch(()=>e.maxBounds,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMaxBounds(r))}),t.watch(()=>e.maxPitch,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMaxPitch(r))}),t.watch(()=>e.maxZoom,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMaxZoom(r))}),t.watch(()=>e.minPitch,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMinPitch(r))}),t.watch(()=>e.minZoom,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMinZoom(r))}),t.watch(()=>e.pitch,r=>{var l;return r&&((l=n.value)==null?void 0:l.setPitch(r))}),t.watch(()=>e.renderWorldCopies,r=>{var l;return r&&((l=n.value)==null?void 0:l.setRenderWorldCopies(r))}),t.watch(()=>e.mapStyle,r=>{var l;return r&&((l=n.value)==null?void 0:l.setStyle(r))}),t.watch(()=>e.transformRequest,r=>{var l;return r&&((l=n.value)==null?void 0:l.setTransformRequest(r))}),t.watch(()=>e.zoom,r=>{var l;return r&&((l=n.value)==null?void 0:l.setZoom(r))}),t.watch(()=>e.language,r=>{p.value&&n.value&&h.language!==(r||null)&&(Y(n.value,r||""),h.language=r||null)}),t.watch(()=>h.language,r=>{p.value&&n.value&&Y(n.value,r||"")});function f(){p.value=!0,e.language?h.language=e.language:h.language&&Y(n.value,e.language||"")}function A(){h.isMounted=!0;const r=Object.keys(e).filter(l=>e[l]!==void 0&&M.MAP_OPTION_KEYS.indexOf(l)!==-1).reduce((l,H)=>(l[H==="mapStyle"?"style":H]=t.unref(e[H]),l),{container:o.value});if(n.value=t.markRaw(new N.Map(r)),h.map=n.value,c.value=!0,g.set("__load",()=>(m.value=!0,h.isLoaded=!0)),n.value.once("styledata",f),n.value.on("load",g.get("__load")),i.vnode.props){for(let l=0,H=M.MAP_EVENT_TYPES.length;l<H;l++)if(i.vnode.props["onMap:"+M.MAP_EVENT_TYPES[l]]){const Ne=M.createEventHandler(i,n.value,a,"map:"+M.MAP_EVENT_TYPES[l]);g.set(M.MAP_EVENT_TYPES[l],Ne),n.value.on(M.MAP_EVENT_TYPES[l],Ne)}}n.value.getCanvas().addEventListener("webglcontextlost",u)}async function y(){h.isMounted=!1,h.isLoaded=!1,m.value=!1,n.value&&(n.value.getCanvas().removeEventListener("webglcontextlost",u),n.value._controls.forEach(r=>{n.value.removeControl(r)}),c.value=!1,g.forEach((r,l)=>{n.value.off(l.startsWith("__")?l.substring(2):l,r)}),n.value.remove())}function u(){y(),t.nextTick(A)}return t.onMounted(()=>{A(),n.value&&(R=new ResizeObserver(Ee(n.value.resize.bind(n.value),100)),R.observe(o.value))}),t.onBeforeUnmount(()=>{R!==void 0&&(R.disconnect(),R=void 0),y()}),a.expose({map:n}),()=>t.h("div",{class:"mgl-container",style:{height:e.height,width:e.width}},[t.h("div",{ref:o,class:"mgl-wrapper"}),c.value&&a.slots.default?a.slots.default({}):void 0])}});var P=(e=>(e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_RIGHT="bottom-right",e))(P||{});const I=Object.values(P);function v(e,a,i){t.watch(e,o=>{var n,c;o&&I.indexOf(o)===-1||((n=a.value)!=null&&n.hasControl(i)&&a.value.removeControl(i),(c=a.value)==null||c.addControl(i,o))},{immediate:!0})}const X=t.defineComponent({name:"MglAttributionControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},compact:Boolean,customAttribution:[String,Array]},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.AttributionControl({compact:e.compact,customAttribution:e.customAttribution});v(()=>e.position,a,o),t.onBeforeUnmount(()=>i.value&&a.value.removeControl(o))},render(){}}),j=class j{constructor(a,i){b(this,"container");this.isAdded=a,this.container=document.createElement("div"),this.setClasses(i)}getDefaultPosition(){return P.TOP_LEFT}onAdd(){return t.nextTick(()=>this.isAdded.value=!0),this.container}onRemove(){this.isAdded.value=!1,this.container.remove()}setClasses(a){a?(this.container.classList.remove(j.CONTROL_CLASS),this.container.classList.remove(j.CONTROL_GROUP_CLASS)):(this.container.classList.add(j.CONTROL_CLASS),this.container.classList.add(j.CONTROL_GROUP_CLASS))}};b(j,"CONTROL_CLASS","maplibregl-ctrl"),b(j,"CONTROL_GROUP_CLASS","maplibregl-ctrl-group");let D=j;const Q=t.defineComponent({name:"MglCustomControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},noClasses:{type:Boolean,default:!1}},slots:Object,setup(e,{slots:a}){const i=t.inject(L),o=t.inject(E),n=t.ref(!1),c=new D(n,e.noClasses);return v(()=>e.position,i,c),t.watch(()=>e.noClasses,m=>c.setClasses(m)),t.onBeforeUnmount(()=>{var m;return o.value&&((m=i.value)==null?void 0:m.removeControl(c))}),()=>{var m;return n.value?t.h(t.Teleport,{to:c.container},(m=a.default)==null?void 0:m.call(a,{})):t.createCommentVNode("custom-component")}}}),ee=t.defineComponent({name:"MglFullscreenControl",props:{position:{type:String,default:P.TOP_RIGHT,validator:e=>I.indexOf(e)!==-1},container:{type:Object,default:null}},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.FullscreenControl({container:e.container||void 0});function n(){t.nextTick(()=>{var c;return(c=a.value)==null?void 0:c.resize()})}o.on("fullscreenstart",n),o.on("fullscreenend",n),v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var c;o.off("fullscreenstart",n),o.off("fullscreenend",n),i.value&&((c=a.value)==null||c.removeControl(o))})},render(){}});class Te{constructor(a="rgba(0,0,0,0.9)",i=4*window.devicePixelRatio,o="#7cf859",n="Monaco, Consolas, Courier, monospace",c=60*window.devicePixelRatio,m=90*window.devicePixelRatio,p=0,g=5*window.devicePixelRatio,C=100*window.devicePixelRatio){b(this,"frames",0);b(this,"totalTime",0);b(this,"totalFrames",0);b(this,"time",null);b(this,"map");b(this,"container");b(this,"readOutput");b(this,"canvas");b(this,"eventHandlers",new Map);this.background=a,this.barWidth=i,this.color=o,this.font=n,this.graphHeight=c,this.graphWidth=m,this.graphTop=p,this.graphRight=g,this.width=C}getDefaultPosition(){return P.TOP_RIGHT}onAdd(a){this.map=a;const i=this.container=document.createElement("div");return i.className="maplibregl-ctrl maplibregl-ctrl-fps",i.style.backgroundColor=this.background,i.style.borderRadius="6px",this.readOutput=document.createElement("div"),this.readOutput.style.color=this.color,this.readOutput.style.fontFamily=this.font,this.readOutput.style.padding="0 5px 5px",this.readOutput.style.fontSize="9px",this.readOutput.style.fontWeight="bold",this.readOutput.textContent="Waiting…",this.canvas=document.createElement("canvas"),this.canvas.className="maplibregl-ctrl-canvas",this.canvas.width=this.width,this.canvas.height=this.graphHeight,this.canvas.style.cssText=`width: ${this.width/window.devicePixelRatio}px; height: ${this.graphHeight/window.devicePixelRatio}px;`,i.appendChild(this.readOutput),i.appendChild(this.canvas),this.eventHandlers.set("movestart",this.onMoveStart.bind(this)),this.eventHandlers.set("moveend",this.onMoveEnd.bind(this)),this.map.on("movestart",this.eventHandlers.get("movestart")),this.map.on("moveend",this.eventHandlers.get("moveend")),this.container}onRemove(){this.map.off("movestart",this.eventHandlers.get("movestart")),this.map.off("moveend",this.eventHandlers.get("moveend")),this.eventHandlers.clear(),this.container.parentNode.removeChild(this.container),this.map=void 0}onMoveStart(){this.frames=0,this.time=performance.now(),this.eventHandlers.set("render",this.onRender.bind(this)),this.map.on("render",this.eventHandlers.get("render"))}onMoveEnd(){const a=performance.now();this.updateGraph(this.getFPS(a)),this.frames=0,this.time=null,this.map.off("render",this.eventHandlers.get("render"))}onRender(){if(this.time){this.frames++;const a=performance.now();a>=this.time+1e3&&(this.updateGraph(this.getFPS(a)),this.frames=0,this.time=performance.now())}}getFPS(a){return this.totalTime+=a-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(a-this.time))||0}updateGraph(a){const i=this.canvas.getContext("2d"),o=Math.round(1e3*this.totalFrames/this.totalTime)||0,n=(this.graphHeight,this.barWidth);i.fillStyle=this.background,i.globalAlpha=1,i.fillRect(0,0,this.graphWidth,this.graphTop),i.fillStyle=this.color,this.readOutput.textContent=`${a} FPS (${o} Avg)`,i.drawImage(this.canvas,this.graphRight+n,this.graphTop,this.graphWidth-n,this.graphHeight,this.graphRight,this.graphTop,this.graphWidth-n,this.graphHeight),i.fillRect(this.graphRight+this.graphWidth-n,this.graphTop,n,this.graphHeight),i.fillStyle=this.background,i.globalAlpha=.75,i.fillRect(this.graphRight+this.graphWidth-n,this.graphTop,n,(1-a/100)*this.graphHeight)}}const te=t.defineComponent({name:"MglFrameRateControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},background:{type:String,default:"rgba(0,0,0,0.9)"},barWidth:{type:Number,default:4*window.devicePixelRatio},color:{type:String,default:"#7cf859"},font:{type:String,default:"Monaco, Consolas, Courier, monospace"},graphHeight:{type:Number,default:60*window.devicePixelRatio},graphWidth:{type:Number,default:90*window.devicePixelRatio},graphTop:{type:Number,default:0},graphRight:{type:Number,default:5*window.devicePixelRatio},width:{type:Number,default:100*window.devicePixelRatio}},setup(e){const a=t.inject(L),i=t.inject(E),o=new Te(e.background,e.barWidth,e.color,e.font,e.graphHeight,e.graphWidth,e.graphTop,e.graphRight,e.width);v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}}),ne=t.defineComponent({name:"MglGeolocationControl",props:{position:{type:String,default:P.TOP_RIGHT,validator:e=>I.indexOf(e)!==-1},positionOptions:{type:Object,default:{enableHighAccuracy:!1,timeout:6e3}},fitBoundsOptions:{type:Object,default:{maxZoom:15}},trackUserLocation:{type:Boolean,default:!1},showAccuracyCircle:{type:Boolean,default:!0},showUserLocation:{type:Boolean,default:!0}},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.GeolocateControl({positionOptions:e.positionOptions,fitBoundsOptions:e.fitBoundsOptions,trackUserLocation:e.trackUserLocation,showAccuracyCircle:e.showAccuracyCircle,showUserLocation:e.showUserLocation});v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}}),ae=t.defineComponent({name:"MglNavigationControl",props:{position:{type:String,default:P.TOP_RIGHT,validator:e=>I.indexOf(e)!==-1},showCompass:{type:Boolean,default:!0},showZoom:{type:Boolean,default:!0},visualizePitch:Boolean},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.NavigationControl({showCompass:e.showCompass,showZoom:e.showZoom,visualizePitch:e.visualizePitch});v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}});var oe=(e=>(e.IMPERIAL="imperial",e.METRIC="metric",e.NAUTICAL="nautical",e))(oe||{});const Pe=Object.values(oe),ie=t.defineComponent({name:"MglScaleControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},maxWidth:{type:Number,default:100},unit:{type:String,default:"metric",validator:e=>Pe.indexOf(e)!==-1}},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.ScaleControl({maxWidth:e.maxWidth,unit:e.unit});v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}});var Z=(e=>(e.DEFAULT="default",e.TEXT="text",e.MDI="mdi",e.SIMPLE_ICON="simple-icons",e))(Z||{});const xe=Object.values(Z),G={text:void 0,mdi:{size:21,viewbox:"0 0 24 24"},"simple-icons":{size:21,viewbox:"0 0 24 24"},default:{size:0,viewbox:"0 0 0 0"}},W=t.defineComponent({name:"MglButton",props:{type:{type:String,default:"default",validator:e=>xe.indexOf(e)!==-1},path:{type:String},size:Number,viewbox:String},slots:Object,setup(e,{slots:a}){!e.path&&e.type!=="text"&&t.warn("property `path` must be set on MaplibreButton");const i=t.ref(G[e.type]||G.default);return t.watch(()=>e.type,o=>i.value=G[o]||G.default),()=>{var o,n;return e.type==="text"?t.h("button",{type:"button"},(o=a.default)==null?void 0:o.call(a,{})):t.h("button",{type:"button",class:"maplibregl-ctrl-icon"},[t.h("svg",{width:e.size||i.value.size,height:e.size||i.value.size,viewBox:e.viewbox||i.value.viewbox},t.h("path",{fill:"currentColor",d:e.path})),(n=a.default)==null?void 0:n.call(a,{})])}}});function re(e){return e&&!!e.stopPropagation}const le=t.defineComponent({name:"MglStyleSwitchControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},mapStyles:{type:Array,required:!0,default:[]},modelValue:{type:Object},isOpen:{type:Boolean,default:void 0}},slots:Object,emits:["update:modelValue","update:isOpen"],setup(e,{emit:a,slots:i}){const o=t.inject(L),n=t.inject(E),c=t.inject(B),m=t.inject(F),p=t.ref(!1),g=t.ref(e.isOpen===void 0?!1:e.isOpen),C=t.shallowRef(e.modelValue===void 0?e.mapStyles.length?e.mapStyles[0]:null:e.modelValue),h=new D(p,!1),R=y.bind(null,!1);function f(){const u=o.value.getStyle().name;for(let r=0,l=e.mapStyles.length;r<l;r++)if(e.mapStyles[r].name===u){A(e.mapStyles[r]);break}}t.watch(c,u=>{u&&f()},{immediate:!0}),o.value.on("style.load",f),document.addEventListener("click",R),v(()=>e.position,o,h),e.modelValue!==void 0&&t.watch(()=>e.modelValue,u=>{u!==void 0&&(C.value=u)}),e.isOpen!==void 0&&t.watch(()=>e.isOpen,u=>{u!==void 0&&(g.value=u)}),t.onBeforeUnmount(()=>{n.value&&(o.value.removeControl(h),o.value.off("style.load",f)),document.removeEventListener("click",R)});function A(u){var r;((r=C.value)==null?void 0:r.name)!==u.name&&(m.emit("styleSwitched",u),o.value.setStyle(u.style,{diff:!1}),e.modelValue===void 0&&(C.value=u),a("update:modelValue",u),y(!1))}function y(u,r){re(r)?r.stopPropagation():re(u)&&u.stopPropagation(),!(e.isOpen!==void 0&&e.isOpen===u||g.value===u)&&(e.isOpen===void 0?(g.value=typeof u=="boolean"?u:!g.value,a("update:isOpen",g.value)):a("update:isOpen",typeof u=="boolean"?u:!e.isOpen))}return()=>{if(!p.value)return t.createCommentVNode("style-switch-control");const u={isOpen:g,toggleOpen:y,setStyle:A,mapStyles:e.mapStyles,currentStyle:C};return t.h(t.Teleport,{to:h.container},i.default?i.default(u):[i.button?i.button(u):t.h(W,{type:Z.MDI,path:"M12,18.54L19.37,12.8L21,14.07L12,21.07L3,14.07L4.62,12.81L12,18.54M12,16L3,9L12,2L21,9L12,16M12,4.53L6.26,9L12,13.47L17.74,9L12,4.53Z",class:["maplibregl-ctrl-icon maplibregl-style-switch",g.value?"is-open":""],onClick:y.bind(null,!0)}),i.styleList?i.styleList(u):t.h("div",{class:["maplibregl-style-list",g.value?"is-open":""]},e.mapStyles.map(r=>{var l,H;return r.icon?t.h(W,{type:Z.MDI,path:r.icon.path,class:((l=C.value)==null?void 0:l.name)===r.name?"is-active":"",onClick:()=>A(r)},t.createTextVNode(r.label)):t.h("button",{type:"button",class:((H=C.value)==null?void 0:H.name)===r.name?"is-active":"",onClick:()=>A(r)},t.createTextVNode(r.label))}))])}},template:` | ||
(function(s,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("maplibre-gl"),require("mitt")):typeof define=="function"&&define.amd?define(["exports","vue","maplibre-gl","mitt"],t):(s=typeof globalThis<"u"?globalThis:s||self,t(s.VueMaplibreGl={},s.Vue,s.maplibregl,s.mitt))})(this,function(s,t,N,Me){"use strict";var Ze=Object.defineProperty;var Ge=(s,t,N)=>t in s?Ze(s,t,{enumerable:!0,configurable:!0,writable:!0,value:N}):s[t]=N;var b=(s,t,N)=>Ge(s,typeof t!="symbol"?t+"":t,N);const d=t.reactive({style:"https://demotiles.maplibre.org/style.json",center:[0,0],zoom:1,trackResize:!1});function Ee(e,a=250,i=!1){let o;function n(){const c=arguments,m=()=>{o=void 0,i!==!0&&e.apply(this,c)};clearTimeout(o),i===!0&&o===void 0&&e.apply(this,c),o=window.setTimeout(m,a)}return n.cancel=()=>{clearTimeout(o)},n}class M{static createEventHandler(a,i,o,n){return(c={})=>o.emit(n,{type:c.type,map:i,component:a,event:c})}}b(M,"MAP_OPTION_KEYS",["attributionControl","bearing","bearingSnap","bounds","boxZoom","cancelPendingTileRequestsWhileZooming","canvasContextAttributes","center","centerClampedToGround","clickTolerance","collectResourceTiming","cooperativeGestures","crossSourceCollisions","doubleClickZoom","dragPan","dragRotate","elevation","fadeDuration","fitBoundsOptions","hash","interactive","keyboard","locale","localIdeographFontFamily","logoPosition","maplibreLogo","maxBounds","maxCanvasSize","maxPitch","maxTileCacheSize","maxTileCacheZoomLevels","maxZoom","minPitch","minZoom","pitch","pitchWithRotate","pixelRatio","refreshExpiredTiles","renderWorldCopies","roll","rollEnabled","scrollZoom","touchPitch","touchZoomRotate","trackResize","transformCameraUpdate","transformRequest","validateStyle","zoom","mapStyle"]),b(M,"MARKER_OPTION_KEYS",["element","offset","anchor","color","draggable","clickTolerance","rotation","rotationAlignment","pitchAlignment","scale"]),b(M,"MAP_EVENT_TYPES",["boxzoomcancel","boxzoomend","boxzoomstart","click","contextmenu","cooperativegestureprevented","data","dataabort","dataloading","dblclick","drag","dragend","dragstart","error","idle","load","mousedown","mousemove","mouseout","mouseover","mouseup","move","moveend","movestart","pitch","pitchend","pitchstart","projectiontransition","remove","render","resize","rotate","rotateend","rotatestart","sourcedata","sourcedataabort","sourcedataloading","styledata","styledataloading","styleimagemissing","terrain","tiledataloading","touchcancel","touchend","touchmove","touchstart","webglcontextlost","webglcontextrestored","wheel","zoom","zoomend","zoomstart"]);const k=new Map,$=Symbol("default");function we(e=$){let a=k.get(e);return a||(a=t.reactive({isLoaded:!1,isMounted:!1,language:null}),k.set(e,a)),a}function Ie(e,a,i=$){var n;let o=k.get(i);return o||(o=t.reactive({isLoaded:!1,isMounted:!1,language:null}),k.set(i,o)),o.isLoaded=!1,o.isMounted=!1,o.component=e,o.map=a.value,o.isLoaded=((n=a.value)==null?void 0:n.loaded())||!1,o}const L=Symbol("map"),H=Symbol("isLoaded"),E=Symbol("isInitialized"),V=Symbol("componentId"),U=Symbol("sourceId"),q=Symbol("sourceLayerRegistry"),F=Symbol("emitter");function ve(e){return Object.keys(e)}function T(e){return Object.keys(e)}const K={AUTO:"auto",STYLE_LOCK:"style_lock",LATIN:"latin",NON_LATIN:"nonlatin",LOCAL:"",ALBANIAN:"sq",AMHARIC:"am",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BASQUE:"eu",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CORSICAN:"co",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HINDI:"hi",HUNGARIAN:"hu",ICELANDIC:"is",INDONESIAN:"id",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",JAPANESE_HIRAGANA:"ja-Hira",JAPANESE_KANA:"ja_kana",JAPANESE_LATIN:"ja_rm",JAPANESE_2018:"ja-Latn",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",KOREAN_LATIN:"ko-Latn",KURDISH:"ku",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALAYALAM:"ml",MALTESE:"mt",NORWEGIAN:"no",OCCITAN:"oc",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SERBIAN_LATIN:"sr-Latn",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",TAMIL:"ta",TELUGU:"te",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"};new Set(Object.values(K)),new Set(Object.values(K));function Y(e,a){const i=e.getStyle().layers,o=/^\s*{\s*name\s*(:\s*(\S*))?\s*}$/,n=/^\s*name\s*(:\s*(\S*))?\s*$/,c=/^\s*{\s*name\s*(:\s*(\S*))?\s*}(\s*){\s*name\s*(:\s*(\S*))?\s*}$/,m=/^(.*)({\s*name\s*(:\s*(\S*))?\s*})(.*)$/,p=a?`name:${a}`:"name",g=["case",["has",p],["get",p],["get","name"]];for(let A=0;A<i.length;A+=1){const h=i[A],R=h.layout;if(!R||!R["text-field"])continue;const f=e.getLayoutProperty(h.id,"text-field");let C;if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="concat"){const y=f.slice();for(let u=0;u<f.length;u+=1){const r=f[u];if((typeof r=="string"||r instanceof String)&&o.exec(r.toString())){y[u]=g;break}else if(Array.isArray(r)&&r.length>=2&&r[0].trim().toLowerCase()==="get"&&n.exec(r[1].toString())){y[u]=g;break}else if(Array.isArray(r)&&r.length===4&&r[0].trim().toLowerCase()==="case"){y[u]=g;break}}e.setLayoutProperty(h.id,"text-field",y)}else if(Array.isArray(f)&&f.length>=2&&f[0].trim().toLowerCase()==="get"&&n.exec(f[1].toString())){const y=g;e.setLayoutProperty(h.id,"text-field",y)}else if((typeof f=="string"||f instanceof String)&&o.exec(f.toString())){const y=g;e.setLayoutProperty(h.id,"text-field",y)}else if(Array.isArray(f)&&f.length===4&&f[0].trim().toLowerCase()==="case"){const y=g;e.setLayoutProperty(h.id,"text-field",y)}else if((typeof f=="string"||f instanceof String)&&(C=c.exec(f.toString()))!==null){const y=`{${p}}${C[3]}{name${C[4]||""}}`;e.setLayoutProperty(h.id,"text-field",y)}else if((typeof f=="string"||f instanceof String)&&(C=m.exec(f.toString()))!==null){const y=`${C[1]}{${p}}${C[5]}`;e.setLayoutProperty(h.id,"text-field",y)}}}const J=t.defineComponent({name:"MglMap",props:{width:{type:[Number,String],default:"100%"},height:{type:[Number,String],default:"100%"},attributionControl:{type:[Boolean,Object],default:()=>d.attributionControl},bearing:{type:Number,default:()=>d.bearing},bearingSnap:{type:Number,default:()=>d.bearingSnap},bounds:{type:[Array,Object],default:()=>d.bounds},boxZoom:{type:Boolean,default:()=>d.boxZoom},cancelPendingTileRequestsWhileZooming:{type:Boolean,default:()=>d.cancelPendingTileRequestsWhileZooming},canvasContextAttributes:{type:Object,default:()=>d.canvasContextAttributes},center:{type:[Array,Object],default:()=>d.center},centerClampedToGround:{type:Boolean,default:()=>d.centerClampedToGround},clickTolerance:{type:Number,default:()=>d.clickTolerance},collectResourceTiming:{type:Boolean,default:()=>d.collectResourceTiming},cooperativeGestures:{type:[Boolean,Object],default:()=>d.cooperativeGestures},crossSourceCollisions:{type:Boolean,default:()=>d.crossSourceCollisions},doubleClickZoom:{type:Boolean,default:()=>d.doubleClickZoom},dragPan:{type:Boolean,default:()=>d.dragPan},dragRotate:{type:Boolean,default:()=>d.dragRotate},elevation:{type:Number,default:()=>d.elevation},fadeDuration:{type:Number,default:()=>d.fadeDuration},fitBoundsOptions:{type:Object,default:()=>d.fitBoundsOptions},hash:{type:[Boolean,String],default:()=>d.hash},interactive:{type:Boolean,default:()=>d.interactive},keyboard:{type:Boolean,default:()=>d.keyboard},language:{type:String,default:()=>d.language||null},locale:{type:Object,default:()=>d.locale},localIdeographFontFamily:{type:String,default:()=>d.localIdeographFontFamily},logoPosition:{type:[String],default:()=>d.logoPosition},mapKey:{type:[String,Symbol]},maplibreLogo:{type:Boolean,default:()=>d.maplibreLogo},mapStyle:{type:[String,Object],default:()=>d.style},maxBounds:{type:[Array,Object],default:()=>d.maxBounds},maxCanvasSize:{type:Array,default:()=>d.maxCanvasSize},maxPitch:{type:Number,default:()=>d.maxPitch},maxTileCacheSize:{type:Number,default:()=>d.maxTileCacheSize},maxTileCacheZoomLevels:{type:Number,default:()=>d.maxTileCacheZoomLevels},maxZoom:{type:Number,default:()=>d.maxZoom},minPitch:{type:Number,default:()=>d.minPitch},minZoom:{type:Number,default:()=>d.minZoom},pitch:{type:Number,default:()=>d.pitch},pitchWithRotate:{type:Boolean,default:()=>d.pitchWithRotate},pixelRatio:{type:Number,default:()=>d.pixelRatio},refreshExpiredTiles:{type:Boolean,default:()=>d.refreshExpiredTiles},renderWorldCopies:{type:Boolean,default:()=>d.renderWorldCopies},roll:{type:Number,default:()=>d.roll},rollEnabled:{typed:Boolean,default:()=>d.rollEnabled},scrollZoom:{type:Boolean,default:()=>d.scrollZoom},touchPitch:{type:Boolean,default:()=>d.touchPitch},touchZoomRotate:{type:Boolean,default:()=>d.touchZoomRotate},trackResize:{type:Boolean,default:()=>d.trackResize},transformCameraUpdate:{type:Function,default:d.transformCameraUpdate},transformRequest:{type:Function,default:d.transformRequest},validateStyle:{type:Boolean,default:()=>d.validateStyle},zoom:{type:Number,default:()=>d.zoom}},emits:["map:boxzoomcancel","map:boxzoomend","map:boxzoomstart","map:click","map:contextmenu","map:cooperativegestureprevented","map:data","map:dataabort","map:dataloading","map:dblclick","map:drag","map:dragend","map:dragstart","map:error","map:idle","map:load","map:mousedown","map:mousemove","map:mouseout","map:mouseover","map:mouseup","map:move","map:moveend","map:movestart","map:pitch","map:pitchend","map:pitchstart","map:projectiontransition","map:remove","map:render","map:resize","map:rotate","map:rotateend","map:rotatestart","map:sourcedata","map:sourcedataabort","map:sourcedataloading","map:styledata","map:styledataloading","map:styleimagemissing","map:terrain","map:tiledataloading","map:touchcancel","map:touchend","map:touchmove","map:touchstart","map:webglcontextlost","map:webglcontextrestored","map:wheel","map:zoom","map:zoomend","map:zoomstart"],slots:Object,setup(e,a){const i=t.markRaw(t.getCurrentInstance()),o=t.shallowRef(),n=t.shallowRef(),c=t.ref(!1),m=t.ref(!1),p=t.ref(!1),g=new Map,A=Me(),h=Ie(i,n,e.mapKey);let R;t.provide(L,n),t.provide(H,m),t.provide(E,c),t.provide(V,i.uid),t.provide(U,""),t.provide(F,A),t.watch(()=>e.bearing,r=>{var l;return r&&((l=n.value)==null?void 0:l.setBearing(r))}),t.watch(()=>e.bounds,r=>{var l;return r&&((l=n.value)==null?void 0:l.fitBounds(r))}),t.watch(()=>e.center,r=>{var l;return r&&((l=n.value)==null?void 0:l.setCenter(r))}),t.watch(()=>e.maxBounds,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMaxBounds(r))}),t.watch(()=>e.maxPitch,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMaxPitch(r))}),t.watch(()=>e.maxZoom,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMaxZoom(r))}),t.watch(()=>e.minPitch,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMinPitch(r))}),t.watch(()=>e.minZoom,r=>{var l;return r&&((l=n.value)==null?void 0:l.setMinZoom(r))}),t.watch(()=>e.pitch,r=>{var l;return r&&((l=n.value)==null?void 0:l.setPitch(r))}),t.watch(()=>e.renderWorldCopies,r=>{var l;return r&&((l=n.value)==null?void 0:l.setRenderWorldCopies(r))}),t.watch(()=>e.mapStyle,r=>{var l;return r&&((l=n.value)==null?void 0:l.setStyle(r))}),t.watch(()=>e.transformRequest,r=>{var l;return r&&((l=n.value)==null?void 0:l.setTransformRequest(r))}),t.watch(()=>e.zoom,r=>{var l;return r&&((l=n.value)==null?void 0:l.setZoom(r))}),t.watch(()=>e.language,r=>{p.value&&n.value&&h.language!==(r||null)&&(Y(n.value,r||""),h.language=r||null)}),t.watch(()=>h.language,r=>{p.value&&n.value&&Y(n.value,r||"")});function f(){p.value=!0,e.language?h.language=e.language:h.language&&Y(n.value,e.language||"")}function C(){h.isMounted=!0;const r=Object.keys(e).filter(l=>e[l]!==void 0&&M.MAP_OPTION_KEYS.indexOf(l)!==-1).reduce((l,B)=>(l[B==="mapStyle"?"style":B]=t.unref(e[B]),l),{container:o.value});if(n.value=t.markRaw(new N.Map(r)),h.map=n.value,c.value=!0,g.set("__load",()=>(m.value=!0,h.isLoaded=!0)),n.value.once("styledata",f),n.value.on("load",g.get("__load")),i.vnode.props){for(let l=0,B=M.MAP_EVENT_TYPES.length;l<B;l++)if(i.vnode.props["onMap:"+M.MAP_EVENT_TYPES[l]]){const Ne=M.createEventHandler(i,n.value,a,"map:"+M.MAP_EVENT_TYPES[l]);g.set(M.MAP_EVENT_TYPES[l],Ne),n.value.on(M.MAP_EVENT_TYPES[l],Ne)}}n.value.getCanvas().addEventListener("webglcontextlost",u)}async function y(){h.isMounted=!1,h.isLoaded=!1,m.value=!1,n.value&&(n.value.getCanvas().removeEventListener("webglcontextlost",u),n.value._controls.forEach(r=>{n.value.removeControl(r)}),c.value=!1,g.forEach((r,l)=>{n.value.off(l.startsWith("__")?l.substring(2):l,r)}),n.value.remove())}function u(){y(),t.nextTick(C)}return t.onMounted(()=>{C(),n.value&&(R=new ResizeObserver(Ee(n.value.resize.bind(n.value),100)),R.observe(o.value))}),t.onBeforeUnmount(()=>{R!==void 0&&(R.disconnect(),R=void 0),y()}),a.expose({map:n}),()=>t.h("div",{class:"mgl-container",style:{height:e.height,width:e.width}},[t.h("div",{ref:o,class:"mgl-wrapper"}),c.value&&a.slots.default?a.slots.default({}):void 0])}});var P=(e=>(e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_RIGHT="bottom-right",e))(P||{});const I=Object.values(P);function v(e,a,i){t.watch(e,o=>{var n,c;o&&I.indexOf(o)===-1||((n=a.value)!=null&&n.hasControl(i)&&a.value.removeControl(i),(c=a.value)==null||c.addControl(i,o))},{immediate:!0})}const X=t.defineComponent({name:"MglAttributionControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},compact:Boolean,customAttribution:[String,Array]},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.AttributionControl({compact:e.compact,customAttribution:e.customAttribution});v(()=>e.position,a,o),t.onBeforeUnmount(()=>i.value&&a.value.removeControl(o))},render(){}}),j=class j{constructor(a,i){b(this,"container");this.isAdded=a,this.container=document.createElement("div"),this.setClasses(i)}getDefaultPosition(){return P.TOP_LEFT}onAdd(){return t.nextTick(()=>this.isAdded.value=!0),this.container}onRemove(){this.isAdded.value=!1,this.container.remove()}setClasses(a){a?(this.container.classList.remove(j.CONTROL_CLASS),this.container.classList.remove(j.CONTROL_GROUP_CLASS)):(this.container.classList.add(j.CONTROL_CLASS),this.container.classList.add(j.CONTROL_GROUP_CLASS))}};b(j,"CONTROL_CLASS","maplibregl-ctrl"),b(j,"CONTROL_GROUP_CLASS","maplibregl-ctrl-group");let D=j;const Q=t.defineComponent({name:"MglCustomControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},noClasses:{type:Boolean,default:!1}},slots:Object,setup(e,{slots:a}){const i=t.inject(L),o=t.inject(E),n=t.ref(!1),c=new D(n,e.noClasses);return v(()=>e.position,i,c),t.watch(()=>e.noClasses,m=>c.setClasses(m)),t.onBeforeUnmount(()=>{var m;return o.value&&((m=i.value)==null?void 0:m.removeControl(c))}),()=>{var m;return n.value?t.h(t.Teleport,{to:c.container},(m=a.default)==null?void 0:m.call(a,{})):t.createCommentVNode("custom-component")}}}),ee=t.defineComponent({name:"MglFullscreenControl",props:{position:{type:String,default:P.TOP_RIGHT,validator:e=>I.indexOf(e)!==-1},container:{type:Object,default:null}},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.FullscreenControl({container:e.container||void 0});function n(){t.nextTick(()=>{var c;return(c=a.value)==null?void 0:c.resize()})}o.on("fullscreenstart",n),o.on("fullscreenend",n),v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var c;o.off("fullscreenstart",n),o.off("fullscreenend",n),i.value&&((c=a.value)==null||c.removeControl(o))})},render(){}});class Te{constructor(a="rgba(0,0,0,0.9)",i=4*window.devicePixelRatio,o="#7cf859",n="Monaco, Consolas, Courier, monospace",c=60*window.devicePixelRatio,m=90*window.devicePixelRatio,p=0,g=5*window.devicePixelRatio,A=100*window.devicePixelRatio){b(this,"frames",0);b(this,"totalTime",0);b(this,"totalFrames",0);b(this,"time",null);b(this,"map");b(this,"container");b(this,"readOutput");b(this,"canvas");b(this,"eventHandlers",new Map);this.background=a,this.barWidth=i,this.color=o,this.font=n,this.graphHeight=c,this.graphWidth=m,this.graphTop=p,this.graphRight=g,this.width=A}getDefaultPosition(){return P.TOP_RIGHT}onAdd(a){this.map=a;const i=this.container=document.createElement("div");return i.className="maplibregl-ctrl maplibregl-ctrl-fps",i.style.backgroundColor=this.background,i.style.borderRadius="6px",this.readOutput=document.createElement("div"),this.readOutput.style.color=this.color,this.readOutput.style.fontFamily=this.font,this.readOutput.style.padding="0 5px 5px",this.readOutput.style.fontSize="9px",this.readOutput.style.fontWeight="bold",this.readOutput.textContent="Waiting…",this.canvas=document.createElement("canvas"),this.canvas.className="maplibregl-ctrl-canvas",this.canvas.width=this.width,this.canvas.height=this.graphHeight,this.canvas.style.cssText=`width: ${this.width/window.devicePixelRatio}px; height: ${this.graphHeight/window.devicePixelRatio}px;`,i.appendChild(this.readOutput),i.appendChild(this.canvas),this.eventHandlers.set("movestart",this.onMoveStart.bind(this)),this.eventHandlers.set("moveend",this.onMoveEnd.bind(this)),this.map.on("movestart",this.eventHandlers.get("movestart")),this.map.on("moveend",this.eventHandlers.get("moveend")),this.container}onRemove(){this.map.off("movestart",this.eventHandlers.get("movestart")),this.map.off("moveend",this.eventHandlers.get("moveend")),this.eventHandlers.clear(),this.container.parentNode.removeChild(this.container),this.map=void 0}onMoveStart(){this.frames=0,this.time=performance.now(),this.eventHandlers.set("render",this.onRender.bind(this)),this.map.on("render",this.eventHandlers.get("render"))}onMoveEnd(){const a=performance.now();this.updateGraph(this.getFPS(a)),this.frames=0,this.time=null,this.map.off("render",this.eventHandlers.get("render"))}onRender(){if(this.time){this.frames++;const a=performance.now();a>=this.time+1e3&&(this.updateGraph(this.getFPS(a)),this.frames=0,this.time=performance.now())}}getFPS(a){return this.totalTime+=a-this.time,this.totalFrames+=this.frames,Math.round(1e3*this.frames/(a-this.time))||0}updateGraph(a){const i=this.canvas.getContext("2d"),o=Math.round(1e3*this.totalFrames/this.totalTime)||0,n=(this.graphHeight,this.barWidth);i.fillStyle=this.background,i.globalAlpha=1,i.fillRect(0,0,this.graphWidth,this.graphTop),i.fillStyle=this.color,this.readOutput.textContent=`${a} FPS (${o} Avg)`,i.drawImage(this.canvas,this.graphRight+n,this.graphTop,this.graphWidth-n,this.graphHeight,this.graphRight,this.graphTop,this.graphWidth-n,this.graphHeight),i.fillRect(this.graphRight+this.graphWidth-n,this.graphTop,n,this.graphHeight),i.fillStyle=this.background,i.globalAlpha=.75,i.fillRect(this.graphRight+this.graphWidth-n,this.graphTop,n,(1-a/100)*this.graphHeight)}}const te=t.defineComponent({name:"MglFrameRateControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},background:{type:String,default:"rgba(0,0,0,0.9)"},barWidth:{type:Number,default:4*window.devicePixelRatio},color:{type:String,default:"#7cf859"},font:{type:String,default:"Monaco, Consolas, Courier, monospace"},graphHeight:{type:Number,default:60*window.devicePixelRatio},graphWidth:{type:Number,default:90*window.devicePixelRatio},graphTop:{type:Number,default:0},graphRight:{type:Number,default:5*window.devicePixelRatio},width:{type:Number,default:100*window.devicePixelRatio}},setup(e){const a=t.inject(L),i=t.inject(E),o=new Te(e.background,e.barWidth,e.color,e.font,e.graphHeight,e.graphWidth,e.graphTop,e.graphRight,e.width);v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}}),ne=t.defineComponent({name:"MglGeolocationControl",props:{position:{type:String,default:P.TOP_RIGHT,validator:e=>I.indexOf(e)!==-1},positionOptions:{type:Object,default:{enableHighAccuracy:!1,timeout:6e3}},fitBoundsOptions:{type:Object,default:{maxZoom:15}},trackUserLocation:{type:Boolean,default:!1},showAccuracyCircle:{type:Boolean,default:!0},showUserLocation:{type:Boolean,default:!0}},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.GeolocateControl({positionOptions:e.positionOptions,fitBoundsOptions:e.fitBoundsOptions,trackUserLocation:e.trackUserLocation,showAccuracyCircle:e.showAccuracyCircle,showUserLocation:e.showUserLocation});v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}}),ae=t.defineComponent({name:"MglNavigationControl",props:{position:{type:String,default:P.TOP_RIGHT,validator:e=>I.indexOf(e)!==-1},showCompass:{type:Boolean,default:!0},showZoom:{type:Boolean,default:!0},visualizePitch:Boolean},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.NavigationControl({showCompass:e.showCompass,showZoom:e.showZoom,visualizePitch:e.visualizePitch});v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}});var oe=(e=>(e.IMPERIAL="imperial",e.METRIC="metric",e.NAUTICAL="nautical",e))(oe||{});const Pe=Object.values(oe),ie=t.defineComponent({name:"MglScaleControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},maxWidth:{type:Number,default:100},unit:{type:String,default:"metric",validator:e=>Pe.indexOf(e)!==-1}},setup(e){const a=t.inject(L),i=t.inject(E),o=new N.ScaleControl({maxWidth:e.maxWidth,unit:e.unit});v(()=>e.position,a,o),t.onBeforeUnmount(()=>{var n;return i.value&&((n=a.value)==null?void 0:n.removeControl(o))})},render(){}});var Z=(e=>(e.DEFAULT="default",e.TEXT="text",e.MDI="mdi",e.SIMPLE_ICON="simple-icons",e))(Z||{});const xe=Object.values(Z),G={text:void 0,mdi:{size:21,viewbox:"0 0 24 24"},"simple-icons":{size:21,viewbox:"0 0 24 24"},default:{size:0,viewbox:"0 0 0 0"}},W=t.defineComponent({name:"MglButton",props:{type:{type:String,default:"default",validator:e=>xe.indexOf(e)!==-1},path:{type:String},size:Number,viewbox:String},slots:Object,setup(e,{slots:a}){!e.path&&e.type!=="text"&&t.warn("property `path` must be set on MaplibreButton");const i=t.ref(G[e.type]||G.default);return t.watch(()=>e.type,o=>i.value=G[o]||G.default),()=>{var o,n;return e.type==="text"?t.h("button",{type:"button"},(o=a.default)==null?void 0:o.call(a,{})):t.h("button",{type:"button",class:"maplibregl-ctrl-icon"},[t.h("svg",{width:e.size||i.value.size,height:e.size||i.value.size,viewBox:e.viewbox||i.value.viewbox},t.h("path",{fill:"currentColor",d:e.path})),(n=a.default)==null?void 0:n.call(a,{})])}}});function re(e){return e&&!!e.stopPropagation}const le=t.defineComponent({name:"MglStyleSwitchControl",props:{position:{type:String,validator:e=>I.indexOf(e)!==-1},mapStyles:{type:Array,required:!0,default:[]},modelValue:{type:Object},isOpen:{type:Boolean,default:void 0}},slots:Object,emits:["update:modelValue","update:isOpen"],setup(e,{emit:a,slots:i}){const o=t.inject(L),n=t.inject(E),c=t.inject(H),m=t.inject(F),p=t.ref(!1),g=t.ref(e.isOpen===void 0?!1:e.isOpen),A=t.shallowRef(e.modelValue===void 0?e.mapStyles.length?e.mapStyles[0]:null:e.modelValue),h=new D(p,!1),R=y.bind(null,!1);function f(){const u=o.value.getStyle().name;for(let r=0,l=e.mapStyles.length;r<l;r++)if(e.mapStyles[r].name===u){C(e.mapStyles[r]);break}}t.watch(c,u=>{u&&f()},{immediate:!0}),o.value.on("style.load",f),document.addEventListener("click",R),v(()=>e.position,o,h),e.modelValue!==void 0&&t.watch(()=>e.modelValue,u=>{u!==void 0&&(A.value=u)}),e.isOpen!==void 0&&t.watch(()=>e.isOpen,u=>{u!==void 0&&(g.value=u)}),t.onBeforeUnmount(()=>{n.value&&(o.value.removeControl(h),o.value.off("style.load",f)),document.removeEventListener("click",R)});function C(u){var r;((r=A.value)==null?void 0:r.name)!==u.name&&(m.emit("styleSwitched",u),o.value.setStyle(u.style,{diff:!1}),e.modelValue===void 0&&(A.value=u),a("update:modelValue",u),y(!1))}function y(u,r){re(r)?r.stopPropagation():re(u)&&u.stopPropagation(),!(e.isOpen!==void 0&&e.isOpen===u||g.value===u)&&(e.isOpen===void 0?(g.value=typeof u=="boolean"?u:!g.value,a("update:isOpen",g.value)):a("update:isOpen",typeof u=="boolean"?u:!e.isOpen))}return()=>{if(!p.value)return t.createCommentVNode("style-switch-control");const u={isOpen:g,toggleOpen:y,setStyle:C,mapStyles:e.mapStyles,currentStyle:A};return t.h(t.Teleport,{to:h.container},i.default?i.default(u):[i.button?i.button(u):t.h(W,{type:Z.MDI,path:"M12,18.54L19.37,12.8L21,14.07L12,21.07L3,14.07L4.62,12.81L12,18.54M12,16L3,9L12,2L21,9L12,16M12,4.53L6.26,9L12,13.47L17.74,9L12,4.53Z",class:["maplibregl-ctrl-icon maplibregl-style-switch",g.value?"is-open":""],onClick:y.bind(null,!0)}),i.styleList?i.styleList(u):t.h("div",{class:["maplibregl-style-list",g.value?"is-open":""]},e.mapStyles.map(r=>{var l,B;return r.icon?t.h(W,{type:Z.MDI,path:r.icon.path,class:((l=A.value)==null?void 0:l.name)===r.name?"is-active":"",onClick:()=>C(r)},t.createTextVNode(r.label)):t.h("button",{type:"button",class:((B=A.value)==null?void 0:B.name)===r.name?"is-active":"",onClick:()=>C(r)},t.createTextVNode(r.label))}))])}},template:` | ||
<slot> | ||
@@ -11,3 +11,3 @@ <slot name="button"></slot> | ||
</slot> | ||
`}),se=t.defineComponent({name:"MglMarker",props:{coordinates:{type:[Object,Array],required:!0},offset:[Object,Array],anchor:String,color:String,clickTolerance:Number,rotation:Number,rotationAlignment:String,pitchAlignment:String,scale:Number},setup(e){const a=t.inject(L),i=Object.keys(e).filter(n=>e[n]!==void 0&&M.MARKER_OPTION_KEYS.indexOf(n)!==-1).reduce((n,c)=>(n[c]=t.unref(e[c]),n),{}),o=new N.Marker(i);return o.setLngLat(e.coordinates).addTo(a.value),t.watch(()=>e.coordinates,n=>o.setLngLat(n)),t.watch(()=>e.offset,n=>o.setOffset(n||[0,0])),t.watch(()=>e.pitchAlignment,n=>o.setPitchAlignment(n||"auto")),t.watch(()=>e.rotationAlignment,n=>o.setRotationAlignment(n||"auto")),t.onBeforeUnmount(o.remove.bind(o)),{marker:o}},render(){}}),_=class _{static genSourceOpts(a,i,o){return Object.keys(i).filter(n=>i[n]!==void 0&&o.indexOf(n)!==-1).reduce((n,c)=>(n[c]=t.unref(i[c]),n),{type:a})}static getSourceRef(a,i){const o=typeof i=="string",n=String(a)+(o?i:"");let c=_.REFS.get(n);return c||(c=t.ref(o?null:void 0),_.REFS.set(n,c)),c}};b(_,"REFS",new Map);let z=_;class je{constructor(){b(this,"unmountHandlers",new Map)}registerUnmountHandler(a,i){this.unmountHandlers.set(a,i)}unregisterUnmountHandler(a){this.unmountHandlers.delete(a)}unmount(){this.unmountHandlers.forEach(a=>a())}}function x(e,a,i){const o=t.inject(L),n=t.inject(B),c=t.inject(F),m=t.inject(V),p=z.getSourceRef(m,e.sourceId),g=new je;t.provide(U,e.sourceId),t.provide(q,g);function C(){n.value&&(o.value.addSource(e.sourceId,z.genSourceOpts(a,e,i)),p.value=o.value.getSource(e.sourceId))}function h(){p.value=null}return t.watch(n,C,{immediate:!0}),o.value.on("style.load",C),c.on("styleSwitched",h),t.onBeforeUnmount(()=>{n.value&&(g.unmount(),o.value.removeSource(e.sourceId)),o.value.off("style.load",C),c.off("styleSwitched",h)}),p}const He=T({animate:void 0,canvas:void 0,coordinates:void 0}),ce=t.defineComponent({name:"MglCanvasSource",props:{sourceId:{type:String,required:!0},coordinates:Array,animate:Boolean,canvas:[Object,String]},slots:Object,setup(e,{slots:a}){const i=x(e,"canvas",He);return t.watch(t.isRef(e.coordinates)?e.coordinates:()=>e.coordinates,o=>{var n;(n=i.value)==null||n.setCoordinates(o)},{immediate:!0}),()=>[t.createCommentVNode("Canvas Source"),i.value&&a.default?a.default({}):void 0]}}),Be=T({data:void 0,maxzoom:void 0,attribution:void 0,buffer:void 0,tolerance:void 0,cluster:void 0,clusterRadius:void 0,clusterMaxZoom:void 0,clusterMinPoints:void 0,clusterProperties:void 0,lineMetrics:void 0,generateId:void 0,promoteId:void 0,filter:void 0}),de=t.defineComponent({name:"MglGeoJsonSource",props:{sourceId:{type:String,required:!0},data:[Object,String],maxzoom:Number,attribution:String,buffer:Number,tolerance:Number,cluster:[Number,Boolean],clusterRadius:Number,clusterMaxZoom:Number,clusterMinPoints:Number,clusterProperties:Object,lineMetrics:Boolean,generateId:Boolean,promoteId:[Object,String],filter:[Array,String,Object]},slots:Object,setup(e,{slots:a}){const i=x(e,"geojson",Be);return t.watch(t.isRef(e.data)?e.data:()=>e.data,o=>{var n;(n=i.value)==null||n.setData(o||{type:"FeatureCollection",features:[]})},{immediate:!0}),()=>[t.createCommentVNode("GeoJSON Source"),i.value&&a.default?a.default({}):void 0]}}),ze=T({url:void 0,coordinates:void 0}),ue=t.defineComponent({name:"MglImageSource",props:{sourceId:{type:String,required:!0},url:String,coordinates:Array},slots:Object,setup(e,{slots:a}){const i=x(e,"image",ze);return t.watch(t.isRef(e.coordinates)?e.coordinates:()=>e.coordinates,o=>{var n;(n=i.value)==null||n.setCoordinates(o)},{immediate:!0}),()=>[t.createCommentVNode("Image Source"),i.value&&a.default?a.default({}):void 0]}}),_e=T({url:void 0,tiles:void 0,bounds:void 0,minzoom:void 0,maxzoom:void 0,tileSize:void 0,scheme:void 0,attribution:void 0,volatile:void 0}),me=t.defineComponent({name:"MglRasterSource",props:{sourceId:{type:String,required:!0},url:String,tiles:Array,bounds:Array,minzoom:Number,maxzoom:Number,tileSize:Number,scheme:String,attribution:String,volatile:Boolean},slots:Object,setup(e,{slots:a}){const i=x(e,"raster",_e);return()=>[t.createCommentVNode("Raster Source"),i.value&&a.default?a.default({}):void 0]}}),ke=T({url:void 0,tiles:void 0,bounds:void 0,minzoom:void 0,maxzoom:void 0,tileSize:void 0,attribution:void 0,encoding:void 0,volatile:void 0,redFactor:void 0,blueFactor:void 0,greenFactor:void 0,baseShift:void 0}),fe=t.defineComponent({name:"MglRasterDemSource",props:{sourceId:{type:String,required:!0},url:String,tiles:Array,bounds:Array,minzoom:Number,maxzoom:Number,tileSize:Number,attribution:String,encoding:String,volatile:Boolean,redFactor:Number,blueFactor:Number,greenFactor:Number,baseShift:Number},slots:Object,setup(e,{slots:a}){const i=x(e,"raster-dem",ke);return()=>[t.createCommentVNode("RasterDem Source"),i.value&&a.default?a.default({}):void 0]}}),Ve=T({url:void 0,tiles:void 0,bounds:void 0,scheme:void 0,minzoom:void 0,maxzoom:void 0,attribution:void 0,promoteId:void 0,volatile:void 0}),ge=t.defineComponent({name:"MglVectorSource",props:{sourceId:{type:String,required:!0},url:String,tiles:Array,bounds:Array,scheme:String,minzoom:Number,maxzoom:Number,attribution:String,promoteId:[Object,String],volatile:Boolean},slots:Object,setup(e,{slots:a}){const i=x(e,"vector",Ve);return t.watch(t.isRef(e.tiles)?e.tiles:()=>e.tiles,o=>{var n;(n=i.value)==null||n.setTiles(o||[])},{immediate:!0}),t.watch(t.isRef(e.url)?e.url:()=>e.url,o=>{var n;(n=i.value)==null||n.setUrl(o||"")},{immediate:!0}),()=>[t.createCommentVNode("Vector Source"),i.value&&a.default?a.default({}):void 0]}}),Ue=T({urls:void 0,coordinates:void 0}),he=t.defineComponent({name:"MglVideoSource",props:{sourceId:{type:String,required:!0},urls:Array,coordinates:Array},slots:Object,setup(e,{slots:a}){const i=x(e,"video",Ue);return t.watch(t.isRef(e.coordinates)?e.coordinates:()=>e.coordinates,o=>{var n;(n=i.value)==null||n.setCoordinates(o)},{immediate:!0}),()=>[t.createCommentVNode("Video Source"),i.value&&a.default?a.default({}):void 0]}}),O=class O{static genLayerOpts(a,i,o,n){return Object.keys(o).filter(c=>o[c]!==void 0&&O.SOURCE_OPTS.indexOf(c)!==-1).reduce((c,m)=>(c[m==="sourceLayer"?"source-layer":m]=t.unref(o[m]),c),{type:i,source:o.source||n,id:a})}static registerLayerEvents(a,i,o){if(o.props)for(let n=0,c=O.LAYER_EVENTS.length;n<c;n++){const m="on"+O.LAYER_EVENTS[n].charAt(0).toUpperCase()+O.LAYER_EVENTS[n].substr(1);o.props[m]&&a.on(O.LAYER_EVENTS[n],i,o.props[m])}}static unregisterLayerEvents(a,i,o){if(o.props)for(let n=0,c=O.LAYER_EVENTS.length;n<c;n++){const m="on"+O.LAYER_EVENTS[n].charAt(0).toUpperCase()+O.LAYER_EVENTS[n].substr(1);o.props[m]&&a.off(O.LAYER_EVENTS[n],i,o.props[m])}}};b(O,"SOURCE_OPTS",["metadata","ref","source","sourceLayer","minzoom","maxzoom","interactive","filter","layout","paint"]),b(O,"LAYER_EVENTS",["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"]),b(O,"SHARED",{props:{layerId:{type:String,required:!0},source:[String,Object],metadata:[Object,Array,String,Number],sourceLayer:String,minzoom:Number,maxzoom:Number,interactive:Boolean,before:String},emits:["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"]});let S=O;function w(e,a,i,o,n){const c=t.inject(U),m=a||c;m||t.warn(`Layer (${i}): layer must be used inside source tag or source prop must be set`);const p=t.inject(L),g=t.inject(B),C=t.inject(V),h=z.getSourceRef(C,m),R=t.inject(q);function f(){g.value&&(n&&S.unregisterLayerEvents(p.value,i,n.vnode),p.value.getLayer(i)&&p.value.removeLayer(i))}return R.registerUnmountHandler(i,f),t.onBeforeUnmount(()=>{R.unregisterUnmountHandler(i),f()}),t.watch([g,h],([A,y])=>{A&&(y||y===void 0)&&(p.value.addLayer(S.genLayerOpts(i,e,o,m),o.before||void 0),n&&S.registerLayerEvents(p.value,o.layerId,n.vnode))},{immediate:!0}),{map:p,isLoaded:g,source:h}}const ye=t.defineComponent({name:"MglBackgroundLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){return w("background",e.source,e.layerId,e),()=>t.createCommentVNode("Background Layer")}}),pe=t.defineComponent({name:"MglCircleLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("circle",e.source,e.layerId,e,a),()=>t.createCommentVNode("Circle Layer")}}),Se=t.defineComponent({name:"MglFillLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("fill",e.source,e.layerId,e,a),()=>t.createCommentVNode("Fill Layer")}}),be=t.defineComponent({name:"MglFillExtrusionLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("fill-extrusion",e.source,e.layerId,e,a),()=>t.createCommentVNode("Fill Extrusion Layer")}}),Ce=t.defineComponent({name:"MglHeatmapLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("heatmap",e.source,e.layerId,e,a),()=>t.createCommentVNode("Heatmap Layer")}}),Ae=t.defineComponent({name:"MglHillshadeLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("hillshade",e.source,e.layerId,e,a),()=>t.createCommentVNode("Hillshade Layer")}}),Oe=t.defineComponent({name:"MglLineLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("line",e.source,e.layerId,e,a),()=>t.createCommentVNode("Line Layer")}}),Re=t.defineComponent({name:"MglRasterLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("raster",e.source,e.layerId,e,a),()=>t.createCommentVNode("Raster Layer")}}),Le=t.defineComponent({name:"MglSymbolLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("symbol",e.source,e.layerId,e,a),()=>t.createCommentVNode("Symbol Layer")}}),Fe=Object.freeze(Object.defineProperty({__proto__:null,MglAttributionControl:X,MglBackgroundLayer:ye,MglButton:W,MglCanvasSource:ce,MglCircleLayer:pe,MglCustomControl:Q,MglFillExtrusionLayer:be,MglFillLayer:Se,MglFrameRateControl:te,MglFullscreenControl:ee,MglGeoJsonSource:de,MglGeolocationControl:ne,MglHeatmapLayer:Ce,MglHillshadeLayer:Ae,MglImageSource:ue,MglLineLayer:Oe,MglMap:J,MglMarker:se,MglNavigationControl:ae,MglRasterDemSource:fe,MglRasterLayer:Re,MglRasterSource:me,MglScaleControl:ie,MglStyleSwitchControl:le,MglSymbolLayer:Le,MglVectorSource:ge,MglVideoSource:he},Symbol.toStringTag,{value:"Module"})),De=function(a){Object.entries(Fe).forEach(([i,o])=>{a.component(i,o)})};s.AllOptions=ve,s.AllSourceOptions=T,s.MglAttributionControl=X,s.MglBackgroundLayer=ye,s.MglButton=W,s.MglCanvasSource=ce,s.MglCircleLayer=pe,s.MglCustomControl=Q,s.MglDefaults=d,s.MglFillExtrusionLayer=be,s.MglFillLayer=Se,s.MglFrameRateControl=te,s.MglFullscreenControl=ee,s.MglGeoJsonSource=de,s.MglGeolocationControl=ne,s.MglHeatmapLayer=Ce,s.MglHillshadeLayer=Ae,s.MglImageSource=ue,s.MglLineLayer=Oe,s.MglMap=J,s.MglMarker=se,s.MglNavigationControl=ae,s.MglRasterDemSource=fe,s.MglRasterLayer=Re,s.MglRasterSource=me,s.MglScaleControl=ie,s.MglStyleSwitchControl=le,s.MglSymbolLayer=Le,s.MglVectorSource=ge,s.MglVideoSource=he,s.Position=P,s.componentIdSymbol=V,s.default=De,s.emitterSymbol=F,s.isInitializedSymbol=E,s.isLoadedSymbol=B,s.mapSymbol=L,s.sourceIdSymbol=U,s.sourceLayerRegistry=q,s.useDisposableLayer=w,s.useMap=we,s.usePositionWatcher=v,s.useSource=x,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
`}),se=t.defineComponent({name:"MglMarker",props:{coordinates:{type:[Object,Array],required:!0},offset:[Object,Array],anchor:String,color:String,clickTolerance:Number,rotation:Number,rotationAlignment:String,pitchAlignment:String,scale:Number},setup(e){const a=t.inject(L),i=Object.keys(e).filter(n=>e[n]!==void 0&&M.MARKER_OPTION_KEYS.indexOf(n)!==-1).reduce((n,c)=>(n[c]=t.unref(e[c]),n),{}),o=new N.Marker(i);return o.setLngLat(e.coordinates).addTo(a.value),t.watch(()=>e.coordinates,n=>o.setLngLat(n)),t.watch(()=>e.offset,n=>o.setOffset(n||[0,0])),t.watch(()=>e.pitchAlignment,n=>o.setPitchAlignment(n||"auto")),t.watch(()=>e.rotationAlignment,n=>o.setRotationAlignment(n||"auto")),t.onBeforeUnmount(o.remove.bind(o)),{marker:o}},render(){}}),_=class _{static genSourceOpts(a,i,o){return Object.keys(i).filter(n=>i[n]!==void 0&&o.indexOf(n)!==-1).reduce((n,c)=>(n[c]=t.unref(i[c]),n),{type:a})}static getSourceRef(a,i){const o=typeof i=="string",n=String(a)+(o?i:"");let c=_.REFS.get(n);return c||(c=t.ref(o?null:void 0),_.REFS.set(n,c)),c}};b(_,"REFS",new Map);let z=_;class je{constructor(){b(this,"unmountHandlers",new Map)}registerUnmountHandler(a,i){this.unmountHandlers.set(a,i)}unregisterUnmountHandler(a){this.unmountHandlers.delete(a)}unmount(){this.unmountHandlers.forEach(a=>a())}}function x(e,a,i){const o=t.inject(L),n=t.inject(H),c=t.inject(F),m=t.inject(V),p=z.getSourceRef(m,e.sourceId),g=new je;t.provide(U,e.sourceId),t.provide(q,g);function A(){n.value&&(o.value.addSource(e.sourceId,z.genSourceOpts(a,e,i)),p.value=o.value.getSource(e.sourceId))}function h(){p.value=null}return t.watch(n,A,{immediate:!0}),o.value.on("style.load",A),c.on("styleSwitched",h),t.onBeforeUnmount(()=>{n.value&&(g.unmount(),o.value.removeSource(e.sourceId)),o.value.off("style.load",A),c.off("styleSwitched",h)}),p}const Be=T({animate:void 0,canvas:void 0,coordinates:void 0}),ce=t.defineComponent({name:"MglCanvasSource",props:{sourceId:{type:String,required:!0},coordinates:Array,animate:Boolean,canvas:[Object,String]},slots:Object,setup(e,{slots:a}){const i=x(e,"canvas",Be);return t.watch(t.isRef(e.coordinates)?e.coordinates:()=>e.coordinates,o=>{var n;(n=i.value)==null||n.setCoordinates(o)},{immediate:!0}),()=>[t.createCommentVNode("Canvas Source"),i.value&&a.default?a.default({}):void 0]}}),He=T({data:void 0,maxzoom:void 0,attribution:void 0,buffer:void 0,tolerance:void 0,cluster:void 0,clusterRadius:void 0,clusterMaxZoom:void 0,clusterMinPoints:void 0,clusterProperties:void 0,lineMetrics:void 0,generateId:void 0,promoteId:void 0,filter:void 0}),de=t.defineComponent({name:"MglGeoJsonSource",props:{sourceId:{type:String,required:!0},data:[Object,String],maxzoom:Number,attribution:String,buffer:Number,tolerance:Number,cluster:[Number,Boolean],clusterRadius:Number,clusterMaxZoom:Number,clusterMinPoints:Number,clusterProperties:Object,lineMetrics:Boolean,generateId:Boolean,promoteId:[Object,String],filter:[Array,String,Object]},slots:Object,setup(e,{slots:a}){const i=x(e,"geojson",He);return t.watch(t.isRef(e.data)?e.data:()=>e.data,o=>{var n;(n=i.value)==null||n.setData(o||{type:"FeatureCollection",features:[]})},{immediate:!0}),()=>[t.createCommentVNode("GeoJSON Source"),i.value&&a.default?a.default({}):void 0]}}),ze=T({url:void 0,coordinates:void 0}),ue=t.defineComponent({name:"MglImageSource",props:{sourceId:{type:String,required:!0},url:String,coordinates:Array},slots:Object,setup(e,{slots:a}){const i=x(e,"image",ze);return t.watch(t.isRef(e.coordinates)?e.coordinates:()=>e.coordinates,o=>{var n;(n=i.value)==null||n.setCoordinates(o)},{immediate:!0}),()=>[t.createCommentVNode("Image Source"),i.value&&a.default?a.default({}):void 0]}}),_e=T({url:void 0,tiles:void 0,bounds:void 0,minzoom:void 0,maxzoom:void 0,tileSize:void 0,scheme:void 0,attribution:void 0,volatile:void 0}),me=t.defineComponent({name:"MglRasterSource",props:{sourceId:{type:String,required:!0},url:String,tiles:Array,bounds:Array,minzoom:Number,maxzoom:Number,tileSize:Number,scheme:String,attribution:String,volatile:Boolean},slots:Object,setup(e,{slots:a}){const i=x(e,"raster",_e);return()=>[t.createCommentVNode("Raster Source"),i.value&&a.default?a.default({}):void 0]}}),ke=T({url:void 0,tiles:void 0,bounds:void 0,minzoom:void 0,maxzoom:void 0,tileSize:void 0,attribution:void 0,encoding:void 0,volatile:void 0,redFactor:void 0,blueFactor:void 0,greenFactor:void 0,baseShift:void 0}),fe=t.defineComponent({name:"MglRasterDemSource",props:{sourceId:{type:String,required:!0},url:String,tiles:Array,bounds:Array,minzoom:Number,maxzoom:Number,tileSize:Number,attribution:String,encoding:String,volatile:Boolean,redFactor:Number,blueFactor:Number,greenFactor:Number,baseShift:Number},slots:Object,setup(e,{slots:a}){const i=x(e,"raster-dem",ke);return()=>[t.createCommentVNode("RasterDem Source"),i.value&&a.default?a.default({}):void 0]}}),Ve=T({url:void 0,tiles:void 0,bounds:void 0,scheme:void 0,minzoom:void 0,maxzoom:void 0,attribution:void 0,promoteId:void 0,volatile:void 0}),ge=t.defineComponent({name:"MglVectorSource",props:{sourceId:{type:String,required:!0},url:String,tiles:Array,bounds:Array,scheme:String,minzoom:Number,maxzoom:Number,attribution:String,promoteId:[Object,String],volatile:Boolean},slots:Object,setup(e,{slots:a}){const i=x(e,"vector",Ve);return t.watch(t.isRef(e.tiles)?e.tiles:()=>e.tiles,o=>{var n;(n=i.value)==null||n.setTiles(o||[])},{immediate:!0}),t.watch(t.isRef(e.url)?e.url:()=>e.url,o=>{var n;(n=i.value)==null||n.setUrl(o||"")},{immediate:!0}),()=>[t.createCommentVNode("Vector Source"),i.value&&a.default?a.default({}):void 0]}}),Ue=T({urls:void 0,coordinates:void 0}),he=t.defineComponent({name:"MglVideoSource",props:{sourceId:{type:String,required:!0},urls:Array,coordinates:Array},slots:Object,setup(e,{slots:a}){const i=x(e,"video",Ue);return t.watch(t.isRef(e.coordinates)?e.coordinates:()=>e.coordinates,o=>{var n;(n=i.value)==null||n.setCoordinates(o)},{immediate:!0}),()=>[t.createCommentVNode("Video Source"),i.value&&a.default?a.default({}):void 0]}}),O=class O{static genLayerOpts(a,i,o,n){return Object.keys(o).filter(c=>o[c]!==void 0&&O.SOURCE_OPTS.indexOf(c)!==-1).reduce((c,m)=>(c[m==="sourceLayer"?"source-layer":m]=t.unref(o[m]),c),{type:i,source:o.source||n,id:a})}static registerLayerEvents(a,i,o){if(o.props)for(let n=0,c=O.LAYER_EVENTS.length;n<c;n++){const m="on"+O.LAYER_EVENTS[n].charAt(0).toUpperCase()+O.LAYER_EVENTS[n].substr(1);o.props[m]&&a.on(O.LAYER_EVENTS[n],i,o.props[m])}}static unregisterLayerEvents(a,i,o){if(o.props)for(let n=0,c=O.LAYER_EVENTS.length;n<c;n++){const m="on"+O.LAYER_EVENTS[n].charAt(0).toUpperCase()+O.LAYER_EVENTS[n].substr(1);o.props[m]&&a.off(O.LAYER_EVENTS[n],i,o.props[m])}}};b(O,"SOURCE_OPTS",["metadata","ref","source","sourceLayer","minzoom","maxzoom","interactive","filter","layout","paint"]),b(O,"LAYER_EVENTS",["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"]),b(O,"SHARED",{props:{layerId:{type:String,required:!0},source:[String,Object],metadata:[Object,Array,String,Number],sourceLayer:String,minzoom:Number,maxzoom:Number,interactive:Boolean,before:String},emits:["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","touchstart","touchend","touchcancel"]});let S=O;function w(e,a,i,o,n){const c=t.inject(U),m=a||c;m||t.warn(`Layer (${i}): layer must be used inside source tag or source prop must be set`);const p=t.inject(L),g=t.inject(H),A=t.inject(V),h=z.getSourceRef(A,m),R=t.inject(q);function f(){g.value&&(n&&S.unregisterLayerEvents(p.value,i,n.vnode),p.value.getLayer(i)&&p.value.removeLayer(i))}return R.registerUnmountHandler(i,f),t.onBeforeUnmount(()=>{R.unregisterUnmountHandler(i),f()}),t.watch([g,h],([C,y])=>{C&&(y||y===void 0)&&(p.value.addLayer(S.genLayerOpts(i,e,o,m),o.before||void 0),n&&S.registerLayerEvents(p.value,o.layerId,n.vnode))},{immediate:!0}),{map:p,isLoaded:g,source:h}}const ye=t.defineComponent({name:"MglBackgroundLayer",props:{...S.SHARED.props,layout:Object,paint:Object},emits:[...S.SHARED.emits],setup(e){return w("background",e.source,e.layerId,e),()=>t.createCommentVNode("Background Layer")}}),pe=t.defineComponent({name:"MglCircleLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("circle",e.source,e.layerId,e,a),()=>t.createCommentVNode("Circle Layer")}}),Se=t.defineComponent({name:"MglFillLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("fill",e.source,e.layerId,e,a),()=>t.createCommentVNode("Fill Layer")}}),be=t.defineComponent({name:"MglFillExtrusionLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("fill-extrusion",e.source,e.layerId,e,a),()=>t.createCommentVNode("Fill Extrusion Layer")}}),Ae=t.defineComponent({name:"MglHeatmapLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("heatmap",e.source,e.layerId,e,a),()=>t.createCommentVNode("Heatmap Layer")}}),Ce=t.defineComponent({name:"MglHillshadeLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("hillshade",e.source,e.layerId,e,a),()=>t.createCommentVNode("Hillshade Layer")}}),Oe=t.defineComponent({name:"MglLineLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("line",e.source,e.layerId,e,a),()=>t.createCommentVNode("Line Layer")}}),Re=t.defineComponent({name:"MglRasterLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("raster",e.source,e.layerId,e,a),()=>t.createCommentVNode("Raster Layer")}}),Le=t.defineComponent({name:"MglSymbolLayer",props:{...S.SHARED.props,layout:Object,paint:Object,filter:[Boolean,Array]},emits:[...S.SHARED.emits],setup(e){const a=t.getCurrentInstance();return w("symbol",e.source,e.layerId,e,a),()=>t.createCommentVNode("Symbol Layer")}}),Fe=Object.freeze(Object.defineProperty({__proto__:null,MglAttributionControl:X,MglBackgroundLayer:ye,MglButton:W,MglCanvasSource:ce,MglCircleLayer:pe,MglCustomControl:Q,MglFillExtrusionLayer:be,MglFillLayer:Se,MglFrameRateControl:te,MglFullscreenControl:ee,MglGeoJsonSource:de,MglGeolocationControl:ne,MglHeatmapLayer:Ae,MglHillshadeLayer:Ce,MglImageSource:ue,MglLineLayer:Oe,MglMap:J,MglMarker:se,MglNavigationControl:ae,MglRasterDemSource:fe,MglRasterLayer:Re,MglRasterSource:me,MglScaleControl:ie,MglStyleSwitchControl:le,MglSymbolLayer:Le,MglVectorSource:ge,MglVideoSource:he},Symbol.toStringTag,{value:"Module"})),De=function(a){Object.entries(Fe).forEach(([i,o])=>{a.component(i,o)})};s.AllOptions=ve,s.AllSourceOptions=T,s.MglAttributionControl=X,s.MglBackgroundLayer=ye,s.MglButton=W,s.MglCanvasSource=ce,s.MglCircleLayer=pe,s.MglCustomControl=Q,s.MglDefaults=d,s.MglFillExtrusionLayer=be,s.MglFillLayer=Se,s.MglFrameRateControl=te,s.MglFullscreenControl=ee,s.MglGeoJsonSource=de,s.MglGeolocationControl=ne,s.MglHeatmapLayer=Ae,s.MglHillshadeLayer=Ce,s.MglImageSource=ue,s.MglLineLayer=Oe,s.MglMap=J,s.MglMarker=se,s.MglNavigationControl=ae,s.MglRasterDemSource=fe,s.MglRasterLayer=Re,s.MglRasterSource=me,s.MglScaleControl=ie,s.MglStyleSwitchControl=le,s.MglSymbolLayer=Le,s.MglVectorSource=ge,s.MglVideoSource=he,s.Position=P,s.componentIdSymbol=V,s.default=De,s.emitterSymbol=F,s.isInitializedSymbol=E,s.isLoadedSymbol=H,s.mapSymbol=L,s.sourceIdSymbol=U,s.sourceLayerRegistry=q,s.useDisposableLayer=w,s.useMap=we,s.usePositionWatcher=v,s.useSource=x,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
//# sourceMappingURL=vue-maplibre-gl.umd.js.map |
{ | ||
"name": "vue-maplibre-gl", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Vue 3 plugin for maplibre-gl", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<CircleLayerSpecification['layout']>, | ||
paint : Object as PropType<CircleLayerSpecification['paint']> | ||
paint : Object as PropType<CircleLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<CircleLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<FillLayerSpecification['layout']>, | ||
paint : Object as PropType<FillLayerSpecification['paint']> | ||
paint : Object as PropType<FillLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<FillLayerSpecification['filter']>, | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -12,2 +12,3 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
paint : Object as PropType<FillExtrusionLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<FillExtrusionLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<HeatmapLayerSpecification['layout']>, | ||
paint : Object as PropType<HeatmapLayerSpecification['paint']> | ||
paint : Object as PropType<HeatmapLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<HeatmapLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<HillshadeLayerSpecification['layout']>, | ||
paint : Object as PropType<HillshadeLayerSpecification['paint']> | ||
paint : Object as PropType<HillshadeLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<HillshadeLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<LineLayerSpecification['layout']>, | ||
paint : Object as PropType<LineLayerSpecification['paint']> | ||
paint : Object as PropType<LineLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<LineLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<RasterLayerSpecification['layout']>, | ||
paint : Object as PropType<RasterLayerSpecification['paint']> | ||
paint : Object as PropType<RasterLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<RasterLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
@@ -11,3 +11,4 @@ import { useDisposableLayer } from '@/composable/useDisposableLayer'; | ||
layout: Object as PropType<SymbolLayerSpecification['layout']>, | ||
paint : Object as PropType<SymbolLayerSpecification['paint']> | ||
paint : Object as PropType<SymbolLayerSpecification['paint']>, | ||
filter: [ Boolean, Array ] as PropType<SymbolLayerSpecification['filter']> | ||
}, | ||
@@ -14,0 +15,0 @@ emits: [ ...LayerLib.SHARED.emits ], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
555734
6260