File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Expand file tree Collapse file tree 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" ;
26import type { Options } from "ol/layer/Layer" ;
37import type { Source } from "ol/source" ;
48import type VectorSource from "ol/source/Vector" ;
@@ -7,12 +11,14 @@ export type LayersCommonProps<T extends Source = VectorSource> = Partial<
711 Options < T >
812> ;
913
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+ } ;
1622
1723export function useDefaults <
1824 T extends LayersCommonProps < S > ,
Original file line number Diff line number Diff line change @@ -30,11 +30,15 @@ defineOptions({
3030 inheritAttrs: false ,
3131});
3232
33- type Props = Options & LayerSwitcherOptions ;
33+ type Props = Options &
34+ LayerSwitcherOptions & {
35+ openInLayerSwitcher? : boolean ;
36+ };
3437const props = withDefaults (defineProps <Props >(), {
3538 opacity: 1 ,
3639 visible: true ,
3740 properties : () => ({}),
41+ displayInLayerSwitcher: true ,
3842});
3943
4044type Emits = CommonEvents &
Original file line number Diff line number Diff line change @@ -31,4 +31,5 @@ export type LayerSwitcherOptions = {
3131 name ?: string ;
3232 allwaysOnTop ?: boolean ; // typo in original code, see https://github.com/Viglino/ol-ext/issues/1128
3333 baseLayer ?: boolean ;
34+ displayInLayerSwitcher : boolean ;
3435} ;
You can’t perform that action at this time.
0 commit comments