@@ -7,6 +7,10 @@ import type { PluginId as FullscreenPluginId } from '@/plugins/fullscreen'
77import type { useFullscreenStore as FullscreenStore } from '@/plugins/fullscreen/store'
88import type { resourcesEn as FullscreenResources } from '@/plugins/fullscreen/locales'
99
10+ import type { PluginId as GeoLocationPluginId } from '@/plugins/geoLocation'
11+ import type { useGeoLocationStore as GeoLocationStore } from '@/plugins/geoLocation/store'
12+ import type { resourcesEn as GeoLocationResources } from '@/plugins/geoLocation/locales'
13+
1014import type { PluginId as IconMenuPluginId } from '@/plugins/iconMenu'
1115import type { useIconMenuStore as IconMenuStore } from '@/plugins/iconMenu/store'
1216import type { resourcesEn as IconMenuResources } from '@/plugins/iconMenu/locales'
@@ -27,6 +31,38 @@ export interface PluginOptions {
2731 layoutTag ?: keyof typeof NineLayoutTag
2832}
2933
34+ interface BoundaryOptions {
35+ /**
36+ * ID of the vector layer to restrict requests to.
37+ * The layer must contain vectors. This is useful for restricted maps to avoid
38+ * selecting unfit coordinates.
39+ */
40+ layerId : string
41+
42+ /**
43+ * If the boundary layer check does not work due to loading or configuration
44+ * errors, style `'strict'` will disable the affected feature, and style
45+ * `'permissive'` will act as if no {@link layerId} was set.
46+ *
47+ * @defaultValue 'permissive'
48+ */
49+ onError ?: 'strict' | 'permissive'
50+
51+ /**
52+ * If the boundary layer check does not work due to loading or configuration
53+ * errors, style `'strict'` will disable the affected feature, and style
54+ * `'permissive'` will act as if no boundaryLayerId was set.
55+ * @defaultValue `'permissive'`
56+ */
57+ }
58+
59+ export interface LayerBoundPluginOptions extends PluginOptions {
60+ /**
61+ * Set to check whether something is within the layer's boundaries.
62+ */
63+ boundary ?: BoundaryOptions
64+ }
65+
3066export type PolarPluginStore <
3167 T extends {
3268 setupPlugin ?: ( ) => void
@@ -40,6 +76,7 @@ export type PolarPluginStore<
4076/** @internal */
4177export type BundledPluginId =
4278 | typeof FullscreenPluginId
79+ | typeof GeoLocationPluginId
4380 | typeof IconMenuPluginId
4481 | typeof LayerChooserPluginId
4582 | typeof LoadingIndicatorId
@@ -57,6 +94,7 @@ type GetPluginStore<
5794/** @internal */
5895export type BundledPluginStores < T extends BundledPluginId > =
5996 | GetPluginStore < T , typeof FullscreenPluginId , typeof FullscreenStore >
97+ | GetPluginStore < T , typeof GeoLocationPluginId , typeof GeoLocationStore >
6098 | GetPluginStore < T , typeof IconMenuPluginId , typeof IconMenuStore >
6199 | GetPluginStore < T , typeof LayerChooserPluginId , typeof LayerChooserStore >
62100 | GetPluginStore < T , typeof LoadingIndicatorId , typeof LoadingIndicatorStore >
@@ -71,6 +109,11 @@ type GetPluginResources<
71109/** @internal */
72110export type BundledPluginLocaleResources < T extends BundledPluginId > =
73111 | GetPluginResources < T , typeof FullscreenPluginId , typeof FullscreenResources >
112+ | GetPluginResources <
113+ T ,
114+ typeof GeoLocationPluginId ,
115+ typeof GeoLocationResources
116+ >
74117 | GetPluginResources < T , typeof IconMenuPluginId , typeof IconMenuResources >
75118 | GetPluginResources <
76119 T ,
0 commit comments