@nuxt/scripts 2.0.0-beta.7 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devtools-client/200.html +1 -1
- package/dist/devtools-client/404.html +1 -1
- package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/afe20d38-a0b8-4d9f-be82-37b90ecac717.json +1 -0
- package/dist/devtools-client/_nuxt/{entry.-RqqMwHr.css → entry.CuI_2OaG.css} +1 -1
- package/dist/devtools-client/docs/index.html +1 -1
- package/dist/devtools-client/first-party/index.html +1 -1
- package/dist/devtools-client/index.html +1 -1
- package/dist/devtools-client/registry/index.html +1 -1
- package/dist/module.d.mts +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/MapLibre/ScriptMapLibreAttributionControl.d.vue.ts +7 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreAttributionControl.vue +42 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreAttributionControl.vue.d.ts +7 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreFullscreenControl.d.vue.ts +13 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreFullscreenControl.vue +27 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreFullscreenControl.vue.d.ts +13 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.d.vue.ts +12 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue +44 -8
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue.d.ts +12 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeolocateControl.d.vue.ts +25 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeolocateControl.vue +49 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreGeolocateControl.vue.d.ts +25 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue +10 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue +1 -4
- package/dist/runtime/components/MapLibre/ScriptMapLibreScaleControl.d.vue.ts +7 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreScaleControl.vue +25 -0
- package/dist/runtime/components/MapLibre/ScriptMapLibreScaleControl.vue.d.ts +7 -0
- package/dist/runtime/components/MapLibre/types.d.ts +92 -3
- package/dist/runtime/types.d.ts +1 -1
- package/dist/types-source.mjs +158 -3
- package/dist/types.d.mts +1 -1
- package/package.json +1 -1
- package/dist/devtools-client/_nuxt/builds/meta/7f4505e1-4a64-4e0a-b3dd-aa394b0cd7f2.json +0 -1
- /package/dist/devtools-client/_nuxt/{BQKaRBnk.js → BBRrg_AT.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/BBRrg_AT.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CuI_2OaG.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BBRrg_AT.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CIwvJvFr.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Car86Ubo.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/WbNXtEed.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Divy0_cA.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/QMsSHdby.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/ClT2ZYzs.js"><script type="module" src="/__nuxt-scripts/_nuxt/BBRrg_AT.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.BJ1JSMYb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DN3hUMR_.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.BBf0uW5X.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXEYGql4.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"afe20d38-a0b8-4d9f-be82-37b90ecac717",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789556028757,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/BBRrg_AT.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CuI_2OaG.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BBRrg_AT.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CIwvJvFr.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Car86Ubo.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/WbNXtEed.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Divy0_cA.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/QMsSHdby.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/ClT2ZYzs.js"><script type="module" src="/__nuxt-scripts/_nuxt/BBRrg_AT.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.BJ1JSMYb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DN3hUMR_.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.BBf0uW5X.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXEYGql4.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"afe20d38-a0b8-4d9f-be82-37b90ecac717",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789556028758,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/BBRrg_AT.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CuI_2OaG.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BBRrg_AT.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CIwvJvFr.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Car86Ubo.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/WbNXtEed.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Divy0_cA.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/QMsSHdby.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/ClT2ZYzs.js"><script type="module" src="/__nuxt-scripts/_nuxt/BBRrg_AT.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.BJ1JSMYb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DN3hUMR_.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.BBf0uW5X.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXEYGql4.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"afe20d38-a0b8-4d9f-be82-37b90ecac717",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789556028759,false]</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__nuxt-scripts/_nuxt/BBRrg_AT.js"}}</script><link rel="stylesheet" href="/__nuxt-scripts/_nuxt/entry.CuI_2OaG.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BBRrg_AT.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DK3Fl9T5.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/CIwvJvFr.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Car86Ubo.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/WbNXtEed.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/Divy0_cA.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/QMsSHdby.js"><link rel="modulepreload" as="script" crossorigin href="/__nuxt-scripts/_nuxt/ClT2ZYzs.js"><script type="module" src="/__nuxt-scripts/_nuxt/BBRrg_AT.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DMbpbO54.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/qhed-kSA.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BgS3c2Ky.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/VbXTXTou.js"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/BZCL-v6S.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-404.BJ1JSMYb.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DN3hUMR_.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt-scripts/_nuxt/error-500.BBf0uW5X.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt-scripts/_nuxt/DXEYGql4.js"><script>"use strict";(()=>{const o=window,e=document.documentElement,c=["dark","light"],s=getStorageValue("localStorage","nuxt-color-mode")||"system";let r=s==="system"?f():s;const l=e.getAttribute("data-color-mode-forced");l&&(r=l),i(r),o["__NUXT_COLOR_MODE__"]={preference:s,value:r,getColorScheme:f,addColorScheme:i,removeColorScheme:d};function i(t){const a=""+t+"",n="";e.classList?e.classList.add(a):e.className+=" "+a,n&&e.setAttribute("data-"+n,t)}function d(t){const a=""+t+"",n="";e.classList?e.classList.remove(a):e.className=e.className.replace(new RegExp(a,"g"),""),n&&e.removeAttribute("data-"+n)}function u(t){return o.matchMedia("(prefers-color-scheme"+t+")")}function f(){if(o.matchMedia&&u("").media!=="not all"){for(const t of c)if(u(":"+t).matches)return t}return"light"}})();function getStorageValue(o,e){switch(o){case"localStorage":try{return window.localStorage.getItem(e)}catch{return null}case"sessionStorage":try{return window.sessionStorage.getItem(e)}catch{return null}case"cookie":try{return getCookie(e)}catch{return null}default:return null}}function getCookie(o){const c=("; "+window.document.cookie).split("; "+o+"=");if(c.length===2){const s=c.pop();return s?s.split(";").shift():null}}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-scripts",buildId:"afe20d38-a0b8-4d9f-be82-37b90ecac717",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1789556028758,false]</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
import { FetchOptions } from 'ofetch';
|
|
3
|
-
export { ScriptMapLibreGeoJsonEmits, ScriptMapLibreGeoJsonLayer, ScriptMapLibreGeoJsonProps, ScriptMapLibreGeoJsonResource, ScriptMapLibreMapEmits, ScriptMapLibreMapExpose, ScriptMapLibreMapProps, ScriptMapLibreMapSlots, ScriptMapLibreMarkerEmits, ScriptMapLibreMarkerProps, ScriptMapLibreNavigationControlProps, ScriptMapLibrePopupEmits, ScriptMapLibrePopupProps } from '../dist/runtime/components/MapLibre/types.js';
|
|
3
|
+
export { ScriptMapLibreAttributionControlProps, ScriptMapLibreFullscreenControlEmits, ScriptMapLibreFullscreenControlProps, ScriptMapLibreGeoJsonEmits, ScriptMapLibreGeoJsonLayer, ScriptMapLibreGeoJsonProps, ScriptMapLibreGeoJsonResource, ScriptMapLibreGeolocateControlEmits, ScriptMapLibreGeolocateControlProps, ScriptMapLibreMapEmits, ScriptMapLibreMapExpose, ScriptMapLibreMapProps, ScriptMapLibreMapSlots, ScriptMapLibreMarkerEmits, ScriptMapLibreMarkerProps, ScriptMapLibreNavigationControlProps, ScriptMapLibrePopupEmits, ScriptMapLibrePopupProps, ScriptMapLibreScaleControlProps } from '../dist/runtime/components/MapLibre/types.js';
|
|
4
4
|
import { RegistryScripts, FirstPartyPrivacy, NuxtConfigScriptRegistry, NuxtUseScriptOptionsSerializable, NuxtUseScriptInput, ResolvedProxyAutoInject, ProxyConfig } from '../dist/runtime/types.js';
|
|
5
5
|
export { FirstPartyPrivacy } from '../dist/runtime/types.js';
|
|
6
6
|
|
package/dist/module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
import { FetchOptions } from 'ofetch';
|
|
3
|
-
export { ScriptMapLibreGeoJsonEmits, ScriptMapLibreGeoJsonLayer, ScriptMapLibreGeoJsonProps, ScriptMapLibreGeoJsonResource, ScriptMapLibreMapEmits, ScriptMapLibreMapExpose, ScriptMapLibreMapProps, ScriptMapLibreMapSlots, ScriptMapLibreMarkerEmits, ScriptMapLibreMarkerProps, ScriptMapLibreNavigationControlProps, ScriptMapLibrePopupEmits, ScriptMapLibrePopupProps } from '../dist/runtime/components/MapLibre/types.js';
|
|
3
|
+
export { ScriptMapLibreAttributionControlProps, ScriptMapLibreFullscreenControlEmits, ScriptMapLibreFullscreenControlProps, ScriptMapLibreGeoJsonEmits, ScriptMapLibreGeoJsonLayer, ScriptMapLibreGeoJsonProps, ScriptMapLibreGeoJsonResource, ScriptMapLibreGeolocateControlEmits, ScriptMapLibreGeolocateControlProps, ScriptMapLibreMapEmits, ScriptMapLibreMapExpose, ScriptMapLibreMapProps, ScriptMapLibreMapSlots, ScriptMapLibreMarkerEmits, ScriptMapLibreMarkerProps, ScriptMapLibreNavigationControlProps, ScriptMapLibrePopupEmits, ScriptMapLibrePopupProps, ScriptMapLibreScaleControlProps } from '../dist/runtime/components/MapLibre/types.js';
|
|
4
4
|
import { RegistryScripts, FirstPartyPrivacy, NuxtConfigScriptRegistry, NuxtUseScriptOptionsSerializable, NuxtUseScriptInput, ResolvedProxyAutoInject, ProxyConfig } from '../dist/runtime/types.js';
|
|
5
5
|
export { FirstPartyPrivacy } from '../dist/runtime/types.js';
|
|
6
6
|
|
package/dist/module.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreAttributionControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreAttributionControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.AttributionControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScriptMapLibreAttributionControlProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useMapLibreResource } from "./useMapLibreResource";
|
|
3
|
+
defineOptions({ render: () => null });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
position: { type: null, required: false },
|
|
6
|
+
options: { type: null, required: false }
|
|
7
|
+
});
|
|
8
|
+
let replaced = [];
|
|
9
|
+
function restore(map) {
|
|
10
|
+
for (const existing of replaced) {
|
|
11
|
+
if (!map.hasControl(existing))
|
|
12
|
+
map.addControl(existing);
|
|
13
|
+
}
|
|
14
|
+
replaced = [];
|
|
15
|
+
}
|
|
16
|
+
const control = useMapLibreResource({
|
|
17
|
+
create({ maplibre, map }) {
|
|
18
|
+
replaced = map._controls.filter((existing) => existing instanceof maplibre.AttributionControl);
|
|
19
|
+
const inherited = replaced[0]?.options;
|
|
20
|
+
const options = inherited || props.options ? { ...inherited, ...props.options, customAttribution: props.options?.customAttribution ?? inherited?.customAttribution } : void 0;
|
|
21
|
+
const instance = new maplibre.AttributionControl(options);
|
|
22
|
+
for (const existing of replaced)
|
|
23
|
+
map.removeControl(existing);
|
|
24
|
+
try {
|
|
25
|
+
map.addControl(instance, props.position);
|
|
26
|
+
} catch (error) {
|
|
27
|
+
restore(map);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
return instance;
|
|
31
|
+
},
|
|
32
|
+
cleanup(instance, { map }) {
|
|
33
|
+
if (map.hasControl(instance))
|
|
34
|
+
map.removeControl(instance);
|
|
35
|
+
if (map._removed)
|
|
36
|
+
replaced = [];
|
|
37
|
+
else
|
|
38
|
+
restore(map);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
defineExpose({ control });
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreAttributionControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreAttributionControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.AttributionControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScriptMapLibreAttributionControlProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreFullscreenControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreFullscreenControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.FullscreenControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
fullscreenstart: (event: MapLibre.FullscreenEvent) => any;
|
|
7
|
+
fullscreenend: (event: MapLibre.FullscreenEvent) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreFullscreenControlProps> & Readonly<{
|
|
9
|
+
onFullscreenstart?: ((event: MapLibre.FullscreenEvent) => any) | undefined;
|
|
10
|
+
onFullscreenend?: ((event: MapLibre.FullscreenEvent) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useMapLibreResource } from "./useMapLibreResource";
|
|
3
|
+
defineOptions({ render: () => null });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
position: { type: null, required: false },
|
|
6
|
+
options: { type: null, required: false }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["fullscreenstart", "fullscreenend"]);
|
|
9
|
+
const onFullscreenStart = (event) => emit("fullscreenstart", event);
|
|
10
|
+
const onFullscreenEnd = (event) => emit("fullscreenend", event);
|
|
11
|
+
const control = useMapLibreResource({
|
|
12
|
+
create({ maplibre, map }) {
|
|
13
|
+
const instance = new maplibre.FullscreenControl(props.options);
|
|
14
|
+
instance.on("fullscreenstart", onFullscreenStart);
|
|
15
|
+
instance.on("fullscreenend", onFullscreenEnd);
|
|
16
|
+
map.addControl(instance, props.position);
|
|
17
|
+
return instance;
|
|
18
|
+
},
|
|
19
|
+
cleanup(instance, { map }) {
|
|
20
|
+
instance.off("fullscreenstart", onFullscreenStart);
|
|
21
|
+
instance.off("fullscreenend", onFullscreenEnd);
|
|
22
|
+
if (map.hasControl(instance))
|
|
23
|
+
map.removeControl(instance);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
defineExpose({ control });
|
|
27
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreFullscreenControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreFullscreenControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.FullscreenControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
fullscreenstart: (event: MapLibre.FullscreenEvent) => any;
|
|
7
|
+
fullscreenend: (event: MapLibre.FullscreenEvent) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreFullscreenControlProps> & Readonly<{
|
|
9
|
+
onFullscreenstart?: ((event: MapLibre.FullscreenEvent) => any) | undefined;
|
|
10
|
+
onFullscreenend?: ((event: MapLibre.FullscreenEvent) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -8,11 +8,23 @@ declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreGeoJsonP
|
|
|
8
8
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
error: (error: Error) => any;
|
|
10
10
|
click: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
11
|
+
dblclick: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
11
12
|
mouseenter: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
12
13
|
mouseleave: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
14
|
+
mousemove: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
15
|
+
sourceready: (payload: {
|
|
16
|
+
map: MapLibreGl.Map;
|
|
17
|
+
sourceId: string;
|
|
18
|
+
}) => any;
|
|
13
19
|
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreGeoJsonProps> & Readonly<{
|
|
14
20
|
onError?: ((error: Error) => any) | undefined;
|
|
15
21
|
onClick?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
22
|
+
onDblclick?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
16
23
|
onMouseenter?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
17
24
|
onMouseleave?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
25
|
+
onMousemove?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
26
|
+
onSourceready?: ((payload: {
|
|
27
|
+
map: MapLibreGl.Map;
|
|
28
|
+
sourceId: string;
|
|
29
|
+
}) => any) | undefined;
|
|
18
30
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -13,7 +13,7 @@ const props = defineProps({
|
|
|
13
13
|
beforeId: { type: String, required: false },
|
|
14
14
|
cursor: { type: String, required: false }
|
|
15
15
|
});
|
|
16
|
-
const emit = defineEmits(["error", "click", "mouseenter", "mouseleave"]);
|
|
16
|
+
const emit = defineEmits(["error", "click", "dblclick", "mouseenter", "mousemove", "mouseleave", "sourceready"]);
|
|
17
17
|
let ownedLayerIds = [];
|
|
18
18
|
let ownedSourceId;
|
|
19
19
|
let appliedStructure;
|
|
@@ -26,6 +26,33 @@ let hoveredLayerKey = "";
|
|
|
26
26
|
let pendingHoverKey = "";
|
|
27
27
|
let isStyleMutable = false;
|
|
28
28
|
let hasPendingSync = false;
|
|
29
|
+
let capturedErrors;
|
|
30
|
+
function toError(event) {
|
|
31
|
+
return event.error instanceof Error ? event.error : new Error(event.error.message, { cause: event.error });
|
|
32
|
+
}
|
|
33
|
+
function applyStyleChange(change) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
capturedErrors = errors;
|
|
36
|
+
try {
|
|
37
|
+
change();
|
|
38
|
+
} finally {
|
|
39
|
+
capturedErrors = void 0;
|
|
40
|
+
}
|
|
41
|
+
if (errors.length === 1)
|
|
42
|
+
throw errors[0];
|
|
43
|
+
if (errors.length > 1)
|
|
44
|
+
throw new AggregateError(errors, errors.map((error) => error.message).join("\n"));
|
|
45
|
+
}
|
|
46
|
+
function onMapError(event) {
|
|
47
|
+
if (capturedErrors) {
|
|
48
|
+
capturedErrors.push(toError(event));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const isOwnSource = ownedSourceId !== void 0 && event.sourceId === ownedSourceId;
|
|
52
|
+
const isOwnLayer = event.layer?.id !== void 0 && ownedLayerIds.includes(event.layer.id);
|
|
53
|
+
if (isOwnSource || isOwnLayer)
|
|
54
|
+
reportMapLibreResourceError(toError(event), (failure) => emit("error", failure));
|
|
55
|
+
}
|
|
29
56
|
function layerStructure(layer) {
|
|
30
57
|
const structure = { ...layer };
|
|
31
58
|
delete structure.paint;
|
|
@@ -90,6 +117,10 @@ function bindLayerEvents(map, carryHover) {
|
|
|
90
117
|
const layerKey = layerIds.join("\n");
|
|
91
118
|
layerSubscriptions = [
|
|
92
119
|
map.on("click", layerIds, (event) => emit("click", event)),
|
|
120
|
+
// The emit must stay synchronous, so `event.preventDefault()` still stops
|
|
121
|
+
// MapLibre's double-click zoom.
|
|
122
|
+
map.on("dblclick", layerIds, (event) => emit("dblclick", event)),
|
|
123
|
+
map.on("mousemove", layerIds, (event) => emit("mousemove", event)),
|
|
93
124
|
map.on("mouseenter", layerIds, (event) => {
|
|
94
125
|
isPointerOverLayer = true;
|
|
95
126
|
hoveredLayerKey = layerKey;
|
|
@@ -132,18 +163,20 @@ function syncResources(map, carryHover = false) {
|
|
|
132
163
|
removeOwnedResources(map);
|
|
133
164
|
const sourceId = props.sourceId;
|
|
134
165
|
try {
|
|
135
|
-
map.addSource(sourceId, {
|
|
166
|
+
applyStyleChange(() => map.addSource(sourceId, {
|
|
136
167
|
...toRaw(props.sourceOptions),
|
|
137
168
|
type: "geojson",
|
|
138
169
|
data: toRaw(props.data)
|
|
139
|
-
});
|
|
170
|
+
}));
|
|
140
171
|
ownedSourceId = sourceId;
|
|
141
172
|
for (const layer of props.layers) {
|
|
142
173
|
const nextLayer = {
|
|
143
174
|
...toRaw(layer),
|
|
144
175
|
source: layer.source || sourceId
|
|
145
176
|
};
|
|
146
|
-
map.addLayer(nextLayer, props.beforeId);
|
|
177
|
+
applyStyleChange(() => map.addLayer(nextLayer, props.beforeId));
|
|
178
|
+
if (!map.getLayer(nextLayer.id))
|
|
179
|
+
throw new Error(`MapLibre did not add the layer "${nextLayer.id}".`);
|
|
147
180
|
ownedLayerIds.push(nextLayer.id);
|
|
148
181
|
}
|
|
149
182
|
appliedStructure = structureSignature();
|
|
@@ -154,6 +187,7 @@ function syncResources(map, carryHover = false) {
|
|
|
154
187
|
removeOwnedResources(map);
|
|
155
188
|
throw error;
|
|
156
189
|
}
|
|
190
|
+
emit("sourceready", { map, sourceId });
|
|
157
191
|
}
|
|
158
192
|
function applyStyleBlock(before, after, set) {
|
|
159
193
|
for (const name of /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)])) {
|
|
@@ -170,13 +204,13 @@ function updateLayerStyles(map) {
|
|
|
170
204
|
if (!before || !layerId || !map.getLayer(layerId))
|
|
171
205
|
return;
|
|
172
206
|
applyStyleBlock(before.paint, next.paint, (name, value) => {
|
|
173
|
-
map.setPaintProperty(layerId, name, value);
|
|
207
|
+
applyStyleChange(() => map.setPaintProperty(layerId, name, value));
|
|
174
208
|
});
|
|
175
209
|
applyStyleBlock(before.layout, next.layout, (name, value) => {
|
|
176
|
-
map.setLayoutProperty(layerId, name, value);
|
|
210
|
+
applyStyleChange(() => map.setLayoutProperty(layerId, name, value));
|
|
177
211
|
});
|
|
178
212
|
if (JSON.stringify(before.filter) !== JSON.stringify(next.filter))
|
|
179
|
-
map.setFilter(layerId, next.filter);
|
|
213
|
+
applyStyleChange(() => map.setFilter(layerId, next.filter));
|
|
180
214
|
});
|
|
181
215
|
if (isPointerOverLayer) {
|
|
182
216
|
isPointerOverLayer = false;
|
|
@@ -224,8 +258,9 @@ const geoJson = useMapLibreResource({
|
|
|
224
258
|
map.on("load", onLoad);
|
|
225
259
|
map.on("styledataloading", onStyleDataLoading);
|
|
226
260
|
map.on("idle", onIdle);
|
|
261
|
+
map.on("error", onMapError);
|
|
227
262
|
trySyncResources(map);
|
|
228
|
-
return { map, onLoad, onStyleLoad, onStyleDataLoading, onIdle };
|
|
263
|
+
return { map, onLoad, onStyleLoad, onStyleDataLoading, onIdle, onError: onMapError };
|
|
229
264
|
},
|
|
230
265
|
onError: (error) => emit("error", error),
|
|
231
266
|
cleanup(resource) {
|
|
@@ -233,6 +268,7 @@ const geoJson = useMapLibreResource({
|
|
|
233
268
|
resource.map.off("style.load", resource.onStyleLoad);
|
|
234
269
|
resource.map.off("styledataloading", resource.onStyleDataLoading);
|
|
235
270
|
resource.map.off("idle", resource.onIdle);
|
|
271
|
+
resource.map.off("error", resource.onError);
|
|
236
272
|
removeOwnedResources(resource.map);
|
|
237
273
|
}
|
|
238
274
|
});
|
|
@@ -8,11 +8,23 @@ declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreGeoJsonP
|
|
|
8
8
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
error: (error: Error) => any;
|
|
10
10
|
click: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
11
|
+
dblclick: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
11
12
|
mouseenter: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
12
13
|
mouseleave: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
14
|
+
mousemove: (event: MapLibreGl.MapLayerMouseEvent) => any;
|
|
15
|
+
sourceready: (payload: {
|
|
16
|
+
map: MapLibreGl.Map;
|
|
17
|
+
sourceId: string;
|
|
18
|
+
}) => any;
|
|
13
19
|
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreGeoJsonProps> & Readonly<{
|
|
14
20
|
onError?: ((error: Error) => any) | undefined;
|
|
15
21
|
onClick?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
22
|
+
onDblclick?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
16
23
|
onMouseenter?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
17
24
|
onMouseleave?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
25
|
+
onMousemove?: ((event: MapLibreGl.MapLayerMouseEvent) => any) | undefined;
|
|
26
|
+
onSourceready?: ((payload: {
|
|
27
|
+
map: MapLibreGl.Map;
|
|
28
|
+
sourceId: string;
|
|
29
|
+
}) => any) | undefined;
|
|
18
30
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreGeolocateControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreGeolocateControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.GeolocateControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
error: (event: MapLibre.GeolocateErrorEvent) => any;
|
|
7
|
+
geolocate: (event: MapLibre.GeolocatePositionEvent) => any;
|
|
8
|
+
outofmaxbounds: (event: MapLibre.GeolocatePositionEvent) => any;
|
|
9
|
+
trackuserlocationstart: (event: MapLibre.GeolocateEvent) => any;
|
|
10
|
+
trackuserlocationend: (event: MapLibre.GeolocateEvent) => any;
|
|
11
|
+
userlocationfocus: (event: MapLibre.GeolocateEvent) => any;
|
|
12
|
+
userlocationlostfocus: (event: MapLibre.GeolocateEvent) => any;
|
|
13
|
+
unavailable: (reason: "unsupported" | "permission-denied") => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreGeolocateControlProps> & Readonly<{
|
|
15
|
+
onError?: ((event: MapLibre.GeolocateErrorEvent) => any) | undefined;
|
|
16
|
+
onGeolocate?: ((event: MapLibre.GeolocatePositionEvent) => any) | undefined;
|
|
17
|
+
onOutofmaxbounds?: ((event: MapLibre.GeolocatePositionEvent) => any) | undefined;
|
|
18
|
+
onTrackuserlocationstart?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
19
|
+
onTrackuserlocationend?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
20
|
+
onUserlocationfocus?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
21
|
+
onUserlocationlostfocus?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
22
|
+
onUnavailable?: ((reason: "unsupported" | "permission-denied") => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useMapLibreResource } from "./useMapLibreResource";
|
|
3
|
+
defineOptions({ render: () => null });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
position: { type: null, required: false },
|
|
6
|
+
options: { type: null, required: false }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["geolocate", "error", "outofmaxbounds", "trackuserlocationstart", "trackuserlocationend", "userlocationfocus", "userlocationlostfocus", "unavailable"]);
|
|
9
|
+
const listeners = {
|
|
10
|
+
geolocate: (event) => emit("geolocate", event),
|
|
11
|
+
error: (event) => emit("error", event),
|
|
12
|
+
outofmaxbounds: (event) => emit("outofmaxbounds", event),
|
|
13
|
+
trackuserlocationstart: (event) => emit("trackuserlocationstart", event),
|
|
14
|
+
trackuserlocationend: (event) => emit("trackuserlocationend", event),
|
|
15
|
+
userlocationfocus: (event) => emit("userlocationfocus", event),
|
|
16
|
+
userlocationlostfocus: (event) => emit("userlocationlostfocus", event)
|
|
17
|
+
};
|
|
18
|
+
const eventNames = Object.keys(listeners);
|
|
19
|
+
async function readAvailability() {
|
|
20
|
+
if (!("geolocation" in navigator))
|
|
21
|
+
return "unsupported";
|
|
22
|
+
if (!navigator.permissions)
|
|
23
|
+
return "available";
|
|
24
|
+
const status = await navigator.permissions.query({ name: "geolocation" }).catch(() => {
|
|
25
|
+
return void 0;
|
|
26
|
+
});
|
|
27
|
+
return status?.state === "denied" ? "permission-denied" : "available";
|
|
28
|
+
}
|
|
29
|
+
const control = useMapLibreResource({
|
|
30
|
+
create({ maplibre, map }) {
|
|
31
|
+
const instance = new maplibre.GeolocateControl(props.options ?? {});
|
|
32
|
+
for (const name of eventNames)
|
|
33
|
+
instance.on(name, listeners[name]);
|
|
34
|
+
map.addControl(instance, props.position);
|
|
35
|
+
readAvailability().then((availability) => {
|
|
36
|
+
if (availability !== "available" && control.value === instance)
|
|
37
|
+
emit("unavailable", availability);
|
|
38
|
+
});
|
|
39
|
+
return instance;
|
|
40
|
+
},
|
|
41
|
+
cleanup(instance, { map }) {
|
|
42
|
+
for (const name of eventNames)
|
|
43
|
+
instance.off(name, listeners[name]);
|
|
44
|
+
if (map.hasControl(instance))
|
|
45
|
+
map.removeControl(instance);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
defineExpose({ control });
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreGeolocateControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreGeolocateControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.GeolocateControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
error: (event: MapLibre.GeolocateErrorEvent) => any;
|
|
7
|
+
geolocate: (event: MapLibre.GeolocatePositionEvent) => any;
|
|
8
|
+
outofmaxbounds: (event: MapLibre.GeolocatePositionEvent) => any;
|
|
9
|
+
trackuserlocationstart: (event: MapLibre.GeolocateEvent) => any;
|
|
10
|
+
trackuserlocationend: (event: MapLibre.GeolocateEvent) => any;
|
|
11
|
+
userlocationfocus: (event: MapLibre.GeolocateEvent) => any;
|
|
12
|
+
userlocationlostfocus: (event: MapLibre.GeolocateEvent) => any;
|
|
13
|
+
unavailable: (reason: "unsupported" | "permission-denied") => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<ScriptMapLibreGeolocateControlProps> & Readonly<{
|
|
15
|
+
onError?: ((event: MapLibre.GeolocateErrorEvent) => any) | undefined;
|
|
16
|
+
onGeolocate?: ((event: MapLibre.GeolocatePositionEvent) => any) | undefined;
|
|
17
|
+
onOutofmaxbounds?: ((event: MapLibre.GeolocatePositionEvent) => any) | undefined;
|
|
18
|
+
onTrackuserlocationstart?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
19
|
+
onTrackuserlocationend?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
20
|
+
onUserlocationfocus?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
21
|
+
onUserlocationlostfocus?: ((event: MapLibre.GeolocateEvent) => any) | undefined;
|
|
22
|
+
onUnavailable?: ((reason: "unsupported" | "permission-denied") => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -93,6 +93,15 @@ function bindMapEvents(instance) {
|
|
|
93
93
|
emit("error", error);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
function configureCanvasAccessibility(instance) {
|
|
97
|
+
const canvas = instance.getCanvas();
|
|
98
|
+
canvas.removeAttribute("role");
|
|
99
|
+
if (props.interactive && instance.keyboard.isEnabled())
|
|
100
|
+
return;
|
|
101
|
+
canvas.setAttribute("tabindex", "-1");
|
|
102
|
+
canvas.setAttribute("aria-hidden", "true");
|
|
103
|
+
canvas.removeAttribute("aria-label");
|
|
104
|
+
}
|
|
96
105
|
onMounted(() => {
|
|
97
106
|
onLoaded((instance) => {
|
|
98
107
|
if (isUnmounted || !mapEl.value)
|
|
@@ -110,6 +119,7 @@ onMounted(() => {
|
|
|
110
119
|
pitch: props.pitch,
|
|
111
120
|
interactive: props.interactive
|
|
112
121
|
});
|
|
122
|
+
configureCanvasAccessibility(mapInstance);
|
|
113
123
|
bindMapEvents(mapInstance);
|
|
114
124
|
map.value = mapInstance;
|
|
115
125
|
mapInstance.once("load", () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useMapLibreResource } from "./useMapLibreResource";
|
|
3
|
+
defineOptions({ render: () => null });
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
position: { type: null, required: false },
|
|
5
6
|
options: { type: null, required: false }
|
|
@@ -17,7 +18,3 @@ const control = useMapLibreResource({
|
|
|
17
18
|
});
|
|
18
19
|
defineExpose({ control });
|
|
19
20
|
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<!-- nuxt-scripts: MapLibre navigation control -->
|
|
23
|
-
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreScaleControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreScaleControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.ScaleControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScriptMapLibreScaleControlProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { watch } from "vue";
|
|
3
|
+
import { useMapLibreResource } from "./useMapLibreResource";
|
|
4
|
+
defineOptions({ render: () => null });
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
position: { type: null, required: false },
|
|
7
|
+
options: { type: null, required: false }
|
|
8
|
+
});
|
|
9
|
+
const control = useMapLibreResource({
|
|
10
|
+
create({ maplibre, map }) {
|
|
11
|
+
const instance = new maplibre.ScaleControl(props.options);
|
|
12
|
+
map.addControl(instance, props.position);
|
|
13
|
+
return instance;
|
|
14
|
+
},
|
|
15
|
+
cleanup(instance, { map }) {
|
|
16
|
+
if (map.hasControl(instance))
|
|
17
|
+
map.removeControl(instance);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
watch(() => props.options?.unit, (unit) => {
|
|
21
|
+
if (control.value && unit)
|
|
22
|
+
control.value.setUnit(unit);
|
|
23
|
+
});
|
|
24
|
+
defineExpose({ control });
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as MapLibre from 'maplibre-gl';
|
|
2
|
+
import type { ScriptMapLibreScaleControlProps } from './types.js';
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<ScriptMapLibreScaleControlProps, {
|
|
4
|
+
control: import("vue").ShallowRef<MapLibre.ScaleControl | undefined>;
|
|
5
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScriptMapLibreScaleControlProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|