New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-maplibre-gl

Package Overview
Dependencies
Maintainers
0
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-maplibre-gl - npm Package Compare versions

Comparing version 5.0.2 to 5.0.3

26

dist/types/components/map.component.d.ts
import { ValidLanguages } from '../types';
import { MapOptions } from 'maplibre-gl';
import { PropType, SlotsType } from 'vue';
export type FitBoundsOptions = MapOptions['fitBoundsOptions'] & {
useOnBoundsUpdate?: boolean;
};
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{

@@ -178,3 +181,3 @@ width: {

fitBoundsOptions: {
type: PropType<MapOptions["fitBoundsOptions"]>;
type: PropType<FitBoundsOptions>;
default: () => {

@@ -643,3 +646,3 @@ duration?: number | undefined;

fitBoundsOptions: {
type: PropType<MapOptions["fitBoundsOptions"]>;
type: PropType<FitBoundsOptions>;
default: () => {

@@ -1004,3 +1007,20 @@ duration?: number | undefined;

fadeDuration: number | undefined;
fitBoundsOptions: import('maplibre-gl').FitBoundsOptions | undefined;
fitBoundsOptions: import('maplibre-gl').AnimationOptions & import('maplibre-gl').CenterZoomBearing & {
pitch?: number;
roll?: number;
elevation?: number;
} & {
curve?: number;
minZoom?: number;
speed?: number;
screenSpeed?: number;
maxDuration?: number;
padding?: number | import('maplibre-gl').PaddingOptions;
} & {
linear?: boolean;
offset?: import('maplibre-gl').PointLike;
maxZoom?: number;
} & {
useOnBoundsUpdate?: boolean;
};
hash: string | boolean | undefined;

@@ -1007,0 +1027,0 @@ interactive: boolean | undefined;

156

dist/vue-maplibre-gl.es.js
/*!
* vue-maplibre-gl v5.0.2
* vue-maplibre-gl v5.0.3
* (c) 2025 Volker Nauruhn

@@ -9,3 +9,3 @@ * @license MIT

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 { reactive as ee, defineComponent as y, markRaw as re, getCurrentInstance as T, 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 U } 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";

@@ -31,3 +31,3 @@ import Ee from "mitt";

}
class x {
class I {
static createEventHandler(a, o, n, t) {

@@ -37,3 +37,3 @@ return (l = {}) => n.emit(t, { type: l.type, map: o, component: a, event: l });

}
b(x, "MAP_OPTION_KEYS", [
b(I, "MAP_OPTION_KEYS", [
"attributionControl",

@@ -89,3 +89,3 @@ "bearing",

"mapStyle"
]), b(x, "MARKER_OPTION_KEYS", [
]), b(I, "MARKER_OPTION_KEYS", [
"element",

@@ -101,3 +101,3 @@ "offset",

"scale"
]), b(x, "MAP_EVENT_TYPES", [
]), b(I, "MAP_EVENT_TYPES", [
"boxzoomcancel",

@@ -166,3 +166,3 @@ "boxzoomend",

}
const N = Symbol("map"), q = Symbol("isLoaded"), T = Symbol("isInitialized"), ae = Symbol("componentId"), oe = Symbol("sourceId"), me = Symbol("sourceLayerRegistry"), ne = Symbol("emitter");
const N = Symbol("map"), q = Symbol("isLoaded"), w = Symbol("isInitialized"), ae = Symbol("componentId"), oe = Symbol("sourceId"), me = Symbol("sourceLayerRegistry"), ne = Symbol("emitter");
function pt(e) {

@@ -438,10 +438,10 @@ return Object.keys(e);

setup(e, a) {
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);
const o = re(T()), n = X(), t = X(), l = _(!1), d = _(!1), v = _(!1), f = /* @__PURE__ */ new Map(), A = Ee(), g = Ce(o, t, e.mapKey);
let L;
B(N, t), B(q, d), B(T, l), B(ae, o.uid), B(oe, ""), B(ne, A), c(() => e.bearing, (i) => {
B(N, t), B(q, d), B(w, l), B(ae, o.uid), B(oe, ""), B(ne, A), c(() => e.bearing, (i) => {
var r;
return i && ((r = t.value) == null ? void 0 : r.setBearing(i));
}), c(() => e.bounds, (i) => {
var r;
return i && ((r = t.value) == null ? void 0 : r.fitBounds(i));
var r, x;
return i && ((x = t.value) == null ? void 0 : x.fitBounds(i, (r = e.fitBoundsOptions) != null && r.useOnBoundsUpdate ? e.fitBoundsOptions : void 0));
}), c(() => e.center, (i) => {

@@ -490,8 +490,8 @@ var r;

g.isMounted = !0;
const i = Object.keys(e).filter((r) => e[r] !== void 0 && x.MAP_OPTION_KEYS.indexOf(r) !== -1).reduce((r, H) => (r[H === "mapStyle" ? "style" : H] = K(e[H]), r), { container: n.value });
const i = Object.keys(e).filter((r) => e[r] !== void 0 && I.MAP_OPTION_KEYS.indexOf(r) !== -1).reduce((r, x) => (r[x === "mapStyle" ? "style" : x] = K(e[x]), r), { container: n.value });
if (t.value = re(new ve(i)), g.map = t.value, l.value = !0, f.set("__load", () => (d.value = !0, g.isLoaded = !0)), t.value.once("styledata", m), t.value.on("load", f.get("__load")), o.vnode.props) {
for (let r = 0, H = x.MAP_EVENT_TYPES.length; r < H; r++)
if (o.vnode.props["onMap:" + x.MAP_EVENT_TYPES[r]]) {
const ie = x.createEventHandler(o, t.value, a, "map:" + x.MAP_EVENT_TYPES[r]);
f.set(x.MAP_EVENT_TYPES[r], ie), t.value.on(x.MAP_EVENT_TYPES[r], ie);
for (let r = 0, x = I.MAP_EVENT_TYPES.length; r < x; r++)
if (o.vnode.props["onMap:" + I.MAP_EVENT_TYPES[r]]) {
const ie = I.createEventHandler(o, t.value, a, "map:" + I.MAP_EVENT_TYPES[r]);
f.set(I.MAP_EVENT_TYPES[r], ie), t.value.on(I.MAP_EVENT_TYPES[r], ie);
}

@@ -529,7 +529,7 @@ }

var F = /* @__PURE__ */ ((e) => (e.TOP_LEFT = "top-left", e.TOP_RIGHT = "top-right", e.BOTTOM_LEFT = "bottom-left", e.BOTTOM_RIGHT = "bottom-right", e))(F || {});
const w = Object.values(F);
const P = Object.values(F);
function j(e, a, o) {
c(e, (n) => {
var t, l;
n && w.indexOf(n) === -1 || ((t = a.value) != null && t.hasControl(o) && a.value.removeControl(o), (l = a.value) == null || l.addControl(o, n));
n && P.indexOf(n) === -1 || ((t = a.value) != null && t.hasControl(o) && a.value.removeControl(o), (l = a.value) == null || l.addControl(o, n));
}, { immediate: !0 });

@@ -542,3 +542,3 @@ }

type: String,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -549,3 +549,3 @@ compact: Boolean,

setup(e) {
const a = h(N), o = h(T), n = new Se({ compact: e.compact, customAttribution: e.customAttribution });
const a = h(N), o = h(w), n = new Se({ compact: e.compact, customAttribution: e.customAttribution });
j(() => e.position, a, n), C(() => o.value && a.value.removeControl(n));

@@ -580,3 +580,3 @@ },

type: String,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -590,3 +590,3 @@ noClasses: {

setup(e, { slots: a }) {
const o = h(N), n = h(T), t = _(!1), l = new $(t, e.noClasses);
const o = h(N), n = h(w), t = _(!1), l = new $(t, e.noClasses);
return j(() => e.position, o, l), c(() => e.noClasses, (d) => l.setClasses(d)), C(() => {

@@ -610,3 +610,3 @@ var d;

default: F.TOP_RIGHT,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -619,3 +619,3 @@ container: {

setup(e) {
const a = h(N), o = h(T), n = new be({ container: e.container || void 0 });
const a = h(N), o = h(w), n = new be({ container: e.container || void 0 });
function t() {

@@ -706,3 +706,3 @@ te(() => {

type: String,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -747,3 +747,3 @@ background: {

setup(e) {
const a = h(N), o = h(T), n = new we(
const a = h(N), o = h(w), n = new we(
e.background,

@@ -772,3 +772,3 @@ e.barWidth,

default: F.TOP_RIGHT,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -797,3 +797,3 @@ positionOptions: {

setup(e) {
const a = h(N), o = h(T), n = new Ae({
const a = h(N), o = h(w), n = new Ae({
positionOptions: e.positionOptions,

@@ -818,3 +818,3 @@ fitBoundsOptions: e.fitBoundsOptions,

default: F.TOP_RIGHT,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -826,3 +826,3 @@ showCompass: { type: Boolean, default: !0 },

setup(e) {
const a = h(N), o = h(T), n = new Oe({ showCompass: e.showCompass, showZoom: e.showZoom, visualizePitch: e.visualizePitch });
const a = h(N), o = h(w), n = new Oe({ showCompass: e.showCompass, showZoom: e.showZoom, visualizePitch: e.visualizePitch });
j(() => e.position, a, n), C(() => {

@@ -842,3 +842,3 @@ var t;

type: String,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -853,3 +853,3 @@ maxWidth: { type: Number, default: 100 },

setup(e) {
const a = h(N), o = h(T), n = new Re({ maxWidth: e.maxWidth, unit: e.unit });
const a = h(N), o = h(w), n = new Re({ maxWidth: e.maxWidth, unit: e.unit });
j(() => e.position, a, n), C(() => {

@@ -925,3 +925,3 @@ var t;

type: String,
validator: (e) => w.indexOf(e) !== -1
validator: (e) => P.indexOf(e) !== -1
},

@@ -944,3 +944,3 @@ mapStyles: {

setup(e, { emit: a, slots: o }) {
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);
const n = h(N), t = h(w), 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() {

@@ -994,3 +994,3 @@ const u = n.value.getStyle().name;

e.mapStyles.map((i) => {
var r, H;
var r, x;
return i.icon ? M(Q, {

@@ -1003,3 +1003,3 @@ type: Y.MDI,

type: "button",
class: ((H = A.value) == null ? void 0 : H.name) === i.name ? "is-active" : "",
class: ((x = A.value) == null ? void 0 : x.name) === i.name ? "is-active" : "",
onClick: () => R(i)

@@ -1038,3 +1038,3 @@ }, le(i.label));

setup(e) {
const a = h(N), o = Object.keys(e).filter((t) => e[t] !== void 0 && x.MARKER_OPTION_KEYS.indexOf(t) !== -1).reduce((t, l) => (t[l] = K(e[l]), t), {}), n = new Le(o);
const a = h(N), o = Object.keys(e).filter((t) => e[t] !== void 0 && I.MARKER_OPTION_KEYS.indexOf(t) !== -1).reduce((t, l) => (t[l] = K(e[l]), t), {}), n = new Le(o);
return n.setLngLat(e.coordinates).addTo(a.value), c(() => e.coordinates, (t) => n.setLngLat(t)), c(() => e.offset, (t) => n.setOffset(t || [0, 0])), c(() => e.pitchAlignment, (t) => n.setPitchAlignment(t || "auto")), c(() => e.rotationAlignment, (t) => n.setRotationAlignment(t || "auto")), C(n.remove.bind(n)), { marker: n };

@@ -1044,3 +1044,3 @@ },

}
}), G = class G {
}), V = class V {
static genSourceOpts(a, o, n) {

@@ -1051,8 +1051,8 @@ return Object.keys(o).filter((t) => o[t] !== void 0 && n.indexOf(t) !== -1).reduce((t, l) => (t[l] = K(o[l]), t), { type: a });

const n = typeof o == "string", t = String(a) + (n ? o : "");
let l = G.REFS.get(t);
return l || (l = _(n ? null : void 0), G.REFS.set(t, l)), l;
let l = V.REFS.get(t);
return l || (l = _(n ? null : void 0), V.REFS.set(t, l)), l;
}
};
b(G, "REFS", /* @__PURE__ */ new Map());
let U = G;
b(V, "REFS", /* @__PURE__ */ new Map());
let G = V;
class De {

@@ -1073,6 +1073,6 @@ constructor() {

function D(e, a, o) {
const n = h(N), t = h(q), l = h(ne), d = h(ae), v = U.getSourceRef(d, e.sourceId), f = new De();
const n = h(N), t = h(q), l = h(ne), d = h(ae), v = G.getSourceRef(d, e.sourceId), f = new De();
B(oe, e.sourceId), B(me, f);
function A() {
t.value && (n.value.addSource(e.sourceId, U.genSourceOpts(a, e, o)), v.value = n.value.getSource(e.sourceId));
t.value && (n.value.addSource(e.sourceId, G.genSourceOpts(a, e, o)), v.value = n.value.getSource(e.sourceId));
}

@@ -1086,7 +1086,7 @@ function g() {

}
const Ve = k({
const Ue = k({
animate: void 0,
canvas: void 0,
coordinates: void 0
}), Ge = /* @__PURE__ */ y({
}), Ve = /* @__PURE__ */ y({
name: "MglCanvasSource",

@@ -1104,4 +1104,4 @@ props: {

setup(e, { slots: a }) {
const o = D(e, "canvas", Ve);
return c(V(e.coordinates) ? e.coordinates : () => e.coordinates, (n) => {
const o = D(e, "canvas", Ue);
return c(U(e.coordinates) ? e.coordinates : () => e.coordinates, (n) => {
var t;

@@ -1114,3 +1114,3 @@ (t = o.value) == null || t.setCoordinates(n);

}
}), Ue = k({
}), Ge = k({
data: void 0,

@@ -1154,4 +1154,4 @@ maxzoom: void 0,

setup(e, { slots: a }) {
const o = D(e, "geojson", Ue);
return c(V(e.data) ? e.data : () => e.data, (n) => {
const o = D(e, "geojson", Ge);
return c(U(e.data) ? e.data : () => e.data, (n) => {
var t;

@@ -1180,3 +1180,3 @@ (t = o.value) == null || t.setData(n || { type: "FeatureCollection", features: [] });

const o = D(e, "image", We);
return c(V(e.coordinates) ? e.coordinates : () => e.coordinates, (n) => {
return c(U(e.coordinates) ? e.coordinates : () => e.coordinates, (n) => {
var t;

@@ -1297,6 +1297,6 @@ (t = o.value) == null || t.setCoordinates(n);

const o = D(e, "vector", Xe);
return c(V(e.tiles) ? e.tiles : () => e.tiles, (n) => {
return c(U(e.tiles) ? e.tiles : () => e.tiles, (n) => {
var t;
(t = o.value) == null || t.setTiles(n || []);
}, { immediate: !0 }), c(V(e.url) ? e.url : () => e.url, (n) => {
}, { immediate: !0 }), c(U(e.url) ? e.url : () => e.url, (n) => {
var t;

@@ -1325,3 +1325,3 @@ (t = o.value) == null || t.setUrl(n || "");

const o = D(e, "video", et);
return c(V(e.coordinates) ? e.coordinates : () => e.coordinates, (n) => {
return c(U(e.coordinates) ? e.coordinates : () => e.coordinates, (n) => {
var t;

@@ -1409,6 +1409,6 @@ (t = o.value) == null || t.setCoordinates(n);

let S = E;
function P(e, a, o, n, t) {
function H(e, a, o, n, t) {
const l = h(oe), d = a || l;
d || de(`Layer (${o}): layer must be used inside source tag or source prop must be set`);
const v = h(N), f = h(q), A = h(ae), g = U.getSourceRef(A, d), L = h(me);
const v = h(N), f = h(q), A = h(ae), g = G.getSourceRef(A, d), L = h(me);
function m() {

@@ -1432,3 +1432,3 @@ f.value && (t && S.unregisterLayerEvents(v.value, o, t.vnode), v.value.getLayer(o) && v.value.removeLayer(o));

setup(e) {
return P("background", e.source, e.layerId, e), () => O("Background Layer");
return H("background", e.source, e.layerId, e), () => O("Background Layer");
}

@@ -1445,4 +1445,4 @@ }), ot = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("circle", e.source, e.layerId, e, a), () => O("Circle Layer");
const a = T();
return H("circle", e.source, e.layerId, e, a), () => O("Circle Layer");
}

@@ -1459,4 +1459,4 @@ }), nt = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("fill", e.source, e.layerId, e, a), () => O("Fill Layer");
const a = T();
return H("fill", e.source, e.layerId, e, a), () => O("Fill Layer");
}

@@ -1473,4 +1473,4 @@ }), it = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("fill-extrusion", e.source, e.layerId, e, a), () => O("Fill Extrusion Layer");
const a = T();
return H("fill-extrusion", e.source, e.layerId, e, a), () => O("Fill Extrusion Layer");
}

@@ -1487,4 +1487,4 @@ }), rt = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("heatmap", e.source, e.layerId, e, a), () => O("Heatmap Layer");
const a = T();
return H("heatmap", e.source, e.layerId, e, a), () => O("Heatmap Layer");
}

@@ -1501,4 +1501,4 @@ }), lt = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("hillshade", e.source, e.layerId, e, a), () => O("Hillshade Layer");
const a = T();
return H("hillshade", e.source, e.layerId, e, a), () => O("Hillshade Layer");
}

@@ -1515,4 +1515,4 @@ }), st = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("line", e.source, e.layerId, e, a), () => O("Line Layer");
const a = T();
return H("line", e.source, e.layerId, e, a), () => O("Line Layer");
}

@@ -1529,4 +1529,4 @@ }), ut = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("raster", e.source, e.layerId, e, a), () => O("Raster Layer");
const a = T();
return H("raster", e.source, e.layerId, e, a), () => O("Raster Layer");
}

@@ -1543,4 +1543,4 @@ }), dt = /* @__PURE__ */ y({

setup(e) {
const a = I();
return P("symbol", e.source, e.layerId, e, a), () => O("Symbol Layer");
const a = T();
return H("symbol", e.source, e.layerId, e, a), () => O("Symbol Layer");
}

@@ -1552,3 +1552,3 @@ }), ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({

MglButton: Q,
MglCanvasSource: Ge,
MglCanvasSource: Ve,
MglCircleLayer: ot,

@@ -1588,3 +1588,3 @@ MglCustomControl: Ie,

Q as MglButton,
Ge as MglCanvasSource,
Ve as MglCanvasSource,
ot as MglCircleLayer,

@@ -1618,3 +1618,3 @@ Ie as MglCustomControl,

ne as emitterSymbol,
T as isInitializedSymbol,
w as isInitializedSymbol,
q as isLoadedSymbol,

@@ -1624,3 +1624,3 @@ N as mapSymbol,

me as sourceLayerRegistry,
P as useDisposableLayer,
H as useDisposableLayer,
yt as useMap,

@@ -1627,0 +1627,0 @@ j as usePositionWatcher,

/*!
* vue-maplibre-gl v5.0.2
* vue-maplibre-gl v5.0.3
* (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"),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:`
(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"),w=Symbol("isInitialized"),V=Symbol("componentId"),U=Symbol("sourceId"),q=Symbol("sourceLayerRegistry"),F=Symbol("emitter");function ve(e){return Object.keys(e)}function P(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(w,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,E;return r&&((E=n.value)==null?void 0:E.fitBounds(r,(l=e.fitBoundsOptions)!=null&&l.useOnBoundsUpdate?e.fitBoundsOptions:void 0))}),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,E)=>(l[E==="mapStyle"?"style":E]=t.unref(e[E]),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,E=M.MAP_EVENT_TYPES.length;l<E;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 x=(e=>(e.TOP_LEFT="top-left",e.TOP_RIGHT="top-right",e.BOTTOM_LEFT="bottom-left",e.BOTTOM_RIGHT="bottom-right",e))(x||{});const v=Object.values(x);function T(e,a,i){t.watch(e,o=>{var n,c;o&&v.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=>v.indexOf(e)!==-1},compact:Boolean,customAttribution:[String,Array]},setup(e){const a=t.inject(L),i=t.inject(w),o=new N.AttributionControl({compact:e.compact,customAttribution:e.customAttribution});T(()=>e.position,a,o),t.onBeforeUnmount(()=>i.value&&a.value.removeControl(o))},render(){}}),B=class B{constructor(a,i){b(this,"container");this.isAdded=a,this.container=document.createElement("div"),this.setClasses(i)}getDefaultPosition(){return x.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(B.CONTROL_CLASS),this.container.classList.remove(B.CONTROL_GROUP_CLASS)):(this.container.classList.add(B.CONTROL_CLASS),this.container.classList.add(B.CONTROL_GROUP_CLASS))}};b(B,"CONTROL_CLASS","maplibregl-ctrl"),b(B,"CONTROL_GROUP_CLASS","maplibregl-ctrl-group");let D=B;const Q=t.defineComponent({name:"MglCustomControl",props:{position:{type:String,validator:e=>v.indexOf(e)!==-1},noClasses:{type:Boolean,default:!1}},slots:Object,setup(e,{slots:a}){const i=t.inject(L),o=t.inject(w),n=t.ref(!1),c=new D(n,e.noClasses);return T(()=>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:x.TOP_RIGHT,validator:e=>v.indexOf(e)!==-1},container:{type:Object,default:null}},setup(e){const a=t.inject(L),i=t.inject(w),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),T(()=>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 x.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=>v.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(w),o=new Te(e.background,e.barWidth,e.color,e.font,e.graphHeight,e.graphWidth,e.graphTop,e.graphRight,e.width);T(()=>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:x.TOP_RIGHT,validator:e=>v.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(w),o=new N.GeolocateControl({positionOptions:e.positionOptions,fitBoundsOptions:e.fitBoundsOptions,trackUserLocation:e.trackUserLocation,showAccuracyCircle:e.showAccuracyCircle,showUserLocation:e.showUserLocation});T(()=>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:x.TOP_RIGHT,validator:e=>v.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(w),o=new N.NavigationControl({showCompass:e.showCompass,showZoom:e.showZoom,visualizePitch:e.visualizePitch});T(()=>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=>v.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(w),o=new N.ScaleControl({maxWidth:e.maxWidth,unit:e.unit});T(()=>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=>v.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(w),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),T(()=>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,E;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:((E=A.value)==null?void 0:E.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(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"}})});
`}),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 j(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=P({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=j(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=P({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=j(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=P({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=j(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=P({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=j(e,"raster",_e);return()=>[t.createCommentVNode("Raster Source"),i.value&&a.default?a.default({}):void 0]}}),ke=P({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=j(e,"raster-dem",ke);return()=>[t.createCommentVNode("RasterDem Source"),i.value&&a.default?a.default({}):void 0]}}),Ve=P({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=j(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=P({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=j(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 I(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 I("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 I("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 I("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 I("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 I("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 I("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 I("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 I("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 I("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=P,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=x,s.componentIdSymbol=V,s.default=De,s.emitterSymbol=F,s.isInitializedSymbol=w,s.isLoadedSymbol=H,s.mapSymbol=L,s.sourceIdSymbol=U,s.sourceLayerRegistry=q,s.useDisposableLayer=I,s.useMap=we,s.usePositionWatcher=T,s.useSource=j,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
//# sourceMappingURL=vue-maplibre-gl.umd.js.map
{
"name": "vue-maplibre-gl",
"version": "5.0.2",
"version": "5.0.3",
"description": "Vue 3 plugin for maplibre-gl",

@@ -5,0 +5,0 @@ "keywords": [

@@ -26,2 +26,4 @@ import { defaults } from '@/defaults';

export type FitBoundsOptions = MapOptions['fitBoundsOptions'] & { useOnBoundsUpdate?: boolean };
export default /*#__PURE__*/ defineComponent({

@@ -54,3 +56,3 @@ name : 'MglMap',

fadeDuration : { type: Number as PropType<MapOptions['fadeDuration']>, default: () => defaults.fadeDuration },
fitBoundsOptions : { type: Object as PropType<MapOptions['fitBoundsOptions']>, default: () => defaults.fitBoundsOptions },
fitBoundsOptions : { type: Object as PropType<FitBoundsOptions>, default: () => defaults.fitBoundsOptions },
hash : { type: [ Boolean, String ] as PropType<MapOptions['hash']>, default: () => defaults.hash },

@@ -130,3 +132,3 @@ interactive : { type: Boolean as PropType<MapOptions['interactive']>, default: () => defaults.interactive },

watch(() => props.bearing, v => v && map.value?.setBearing(v));
watch(() => props.bounds, v => v && map.value?.fitBounds(v));
watch(() => props.bounds, v => v && map.value?.fitBounds(v, props.fitBoundsOptions?.useOnBoundsUpdate ? props.fitBoundsOptions : undefined));
watch(() => props.center, v => v && map.value?.setCenter(v));

@@ -133,0 +135,0 @@ watch(() => props.maxBounds, v => v && map.value?.setMaxBounds(v));

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc