File tree 3 files changed +19
-8
lines changed
3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
- import type { KeysMatching , ObjectToFactory } from "@/types" ;
1
+ import type {
2
+ KeysMatching ,
3
+ LayerSwitcherOptions ,
4
+ ObjectToFactory ,
5
+ } from "@/types" ;
2
6
import type { Options } from "ol/layer/Layer" ;
3
7
import type { Source } from "ol/source" ;
4
8
import type VectorSource from "ol/source/Vector" ;
@@ -7,12 +11,14 @@ export type LayersCommonProps<T extends Source = VectorSource> = Partial<
7
11
Options < T >
8
12
> ;
9
13
10
- export const layersCommonDefaultProps : Options < Source > = {
11
- className : "ol-layer" ,
12
- opacity : 1 ,
13
- visible : true ,
14
- properties : ( ) => ( { } ) ,
15
- } ;
14
+ export const layersCommonDefaultProps : Options < Source > & LayerSwitcherOptions =
15
+ {
16
+ className : "ol-layer" ,
17
+ opacity : 1 ,
18
+ visible : true ,
19
+ properties : ( ) => ( { } ) ,
20
+ displayInLayerSwitcher : true ,
21
+ } ;
16
22
17
23
export function useDefaults <
18
24
T extends LayersCommonProps < S > ,
Original file line number Diff line number Diff line change @@ -30,11 +30,15 @@ defineOptions({
30
30
inheritAttrs: false ,
31
31
});
32
32
33
- type Props = Options & LayerSwitcherOptions ;
33
+ type Props = Options &
34
+ LayerSwitcherOptions & {
35
+ openInLayerSwitcher? : boolean ;
36
+ };
34
37
const props = withDefaults (defineProps <Props >(), {
35
38
opacity: 1 ,
36
39
visible: true ,
37
40
properties : () => ({}),
41
+ displayInLayerSwitcher: true ,
38
42
});
39
43
40
44
type Emits = CommonEvents &
Original file line number Diff line number Diff line change @@ -31,4 +31,5 @@ export type LayerSwitcherOptions = {
31
31
name ?: string ;
32
32
allwaysOnTop ?: boolean ; // typo in original code, see https://github.com/Viglino/ol-ext/issues/1128
33
33
baseLayer ?: boolean ;
34
+ displayInLayerSwitcher : boolean ;
34
35
} ;
You can’t perform that action at this time.
0 commit comments