@geogirafe/lib-geoportal 1.2.0-dev.2847697588 → 1.2.0-dev.2853894139
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/components/advancedfilter/component.d.ts +2 -1
- package/components/advancedfilter/component.js +3 -2
- package/components/themes/component.d.ts +2 -2
- package/components/themes-mobile/theme/component.js +3 -2
- package/components/userpreferences/component.js +5 -10
- package/models/basemaps/basemap.d.ts +3 -3
- package/models/customtheme.d.ts +2 -1
- package/models/georama.d.ts +10 -0
- package/models/georama.js +1 -0
- package/models/gmf.d.ts +0 -1
- package/models/layerdefinitions.d.ts +13 -0
- package/models/layerdefinitions.js +1 -0
- package/models/layers/baselayer.d.ts +3 -2
- package/models/layers/grouplayer.d.ts +2 -1
- package/models/layers/layer.d.ts +2 -1
- package/models/layers/layercog.d.ts +4 -4
- package/models/layers/layercog.js +3 -3
- package/models/layers/layerlocalfile.d.ts +2 -1
- package/models/layers/layervectortiles.d.ts +2 -1
- package/models/layers/layerwms.d.ts +4 -4
- package/models/layers/layerwms.js +3 -3
- package/models/layers/layerwmts.d.ts +4 -4
- package/models/layers/layerwmts.js +3 -3
- package/models/layers/layerxyz.d.ts +4 -4
- package/models/layers/layerxyz.js +3 -3
- package/models/layers/themelayer.d.ts +2 -1
- package/models/main.d.ts +3 -1
- package/package.json +1 -1
- package/templates/public/about.json +1 -1
- package/tools/share/serializers/sharedtypes.d.ts +6 -5
- package/tools/state/state.d.ts +4 -3
- package/tools/themes/themeshelper.d.ts +3 -2
- package/tools/themes/themesmanager.js +1 -1
|
@@ -4,6 +4,7 @@ import ColumnAliasHelper from '../../tools/utils/aliases.js';
|
|
|
4
4
|
import IGirafePanel from '../../tools/state/igirafepanel.js';
|
|
5
5
|
import LayerFilterElement from './layerfilterelement.js';
|
|
6
6
|
import FilterConditionElement from './filterconditionelement.js';
|
|
7
|
+
import { LayerId } from '../../models/layerdefinitions.js';
|
|
7
8
|
declare class AdvancedFilterComponent extends GirafeHTMLElement implements IGirafePanel {
|
|
8
9
|
protected templateUrl: string | null;
|
|
9
10
|
protected styleUrls: string[] | null;
|
|
@@ -16,7 +17,7 @@ declare class AdvancedFilterComponent extends GirafeHTMLElement implements IGira
|
|
|
16
17
|
layers: LayerWms[];
|
|
17
18
|
layerFilterElements: LayerFilterElement[];
|
|
18
19
|
columnAliasHelper: ColumnAliasHelper;
|
|
19
|
-
layerIsRefreshing: Map<
|
|
20
|
+
layerIsRefreshing: Map<LayerId, boolean>;
|
|
20
21
|
private csvDownloader;
|
|
21
22
|
constructor();
|
|
22
23
|
render(): void;
|
|
@@ -185,8 +185,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
185
185
|
filterElement.addCondition();
|
|
186
186
|
this.render();
|
|
187
187
|
}
|
|
188
|
-
const layerId =
|
|
189
|
-
|
|
188
|
+
const layerId = e.target.value;
|
|
189
|
+
// Loose equality == is on purpose. layer.id can be of type number or string, but .value always returns a string
|
|
190
|
+
const layer = this.layers.find((l) => l.id == layerId);
|
|
190
191
|
if (filterElement.hasAppliedConditions()) {
|
|
191
192
|
// If the filter has already been applied to the layer, a new filter is created and the old one is deleted
|
|
192
193
|
const newFilter = new LayerFilterElement(this.context, this.columnAliasHelper, this.layerFilterElements.length);
|
|
@@ -13,9 +13,9 @@ declare class ThemeComponent extends GirafeHTMLElement {
|
|
|
13
13
|
activeThemeType: ThemeType;
|
|
14
14
|
clickOutsideContainer: HTMLElement | null;
|
|
15
15
|
get customThemes(): CustomTheme[];
|
|
16
|
-
get allThemes(): Record<
|
|
16
|
+
get allThemes(): Record<import("../../models/layerdefinitions.js").LayerId, ThemeLayer>;
|
|
17
17
|
get favoriteThemes(): (ThemeLayer | CustomTheme)[];
|
|
18
|
-
get activeThemes(): Record<
|
|
18
|
+
get activeThemes(): Record<import("../../models/layerdefinitions.js").LayerId, ThemeLayer> | (ThemeLayer | CustomTheme)[];
|
|
19
19
|
constructor();
|
|
20
20
|
registerEvents(): void;
|
|
21
21
|
render(): void;
|
|
@@ -28,8 +28,9 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
28
28
|
this.refreshTheme();
|
|
29
29
|
}
|
|
30
30
|
refreshTheme() {
|
|
31
|
-
const themeId =
|
|
32
|
-
|
|
31
|
+
const themeId = this.getAttribute('themeid');
|
|
32
|
+
// Loose equality == is on purpose. layer.id can be of type number or string, but getAttribute() always returns a string
|
|
33
|
+
const theme = this.state.layers.layersList.find((layer) => layer.id == themeId);
|
|
33
34
|
if (theme) {
|
|
34
35
|
this.theme = this.context.layerManager.getTreeItem(theme.treeItemId);
|
|
35
36
|
}
|
|
@@ -47,10 +47,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
47
47
|
}
|
|
48
48
|
}),
|
|
49
49
|
logLevel: new UserPreference('general.logLevel', null, 'system', 'select'),
|
|
50
|
-
theme: new UserPreference('themes.defaultTheme', 'theme', 'map', 'select', (themeName) =>
|
|
51
|
-
const themeId = Object.keys(this.state.themes._allThemes).find((themeKey) => this.state.themes._allThemes[Number(themeKey)].name === themeName);
|
|
52
|
-
return this.state.themes._allThemes[Number(themeId)];
|
|
53
|
-
}),
|
|
50
|
+
theme: new UserPreference('themes.defaultTheme', 'theme', 'map', 'select', (themeName) => Object.values(this.state.themes._allThemes).find((theme) => theme.name === themeName)),
|
|
54
51
|
basemap: new UserPreference('basemaps.defaultBasemap', 'activeBasemaps', 'map', 'select', (bsName) => {
|
|
55
52
|
const newDefaultBasemap = Object.values(this.state.basemaps).find((basemap) => basemap.name === bsName);
|
|
56
53
|
if (newDefaultBasemap?.opacity == 0) {
|
|
@@ -151,9 +148,8 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
151
148
|
}
|
|
152
149
|
this.refreshThemeOptions();
|
|
153
150
|
if (this.preferences.basemap) {
|
|
154
|
-
this.preferences.basemap.options = Object.
|
|
155
|
-
|
|
156
|
-
return { label: baseMapName, value: baseMapName };
|
|
151
|
+
this.preferences.basemap.options = Object.values(this.state.basemaps).map((basemap) => {
|
|
152
|
+
return { label: basemap.name, value: basemap.name };
|
|
157
153
|
});
|
|
158
154
|
}
|
|
159
155
|
if (this.preferences.selectionComponent) {
|
|
@@ -198,9 +194,8 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
|
|
|
198
194
|
return;
|
|
199
195
|
}
|
|
200
196
|
let defaultThemes = [{ label: '-', value: '' }];
|
|
201
|
-
Object.
|
|
202
|
-
|
|
203
|
-
defaultThemes.push({ label: themeName, value: themeName });
|
|
197
|
+
Object.values(this.state.themes._allThemes).forEach((theme) => {
|
|
198
|
+
defaultThemes.push({ label: theme.name, value: theme.name });
|
|
204
199
|
});
|
|
205
200
|
defaultThemes = defaultThemes.sort((a, b) => a.label.toUpperCase().localeCompare(b.label.toUpperCase()));
|
|
206
201
|
const customThemes = this.context.customThemesManager.customThemes.map((ct) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { GMFBackgroundLayer } from '../gmf.js';
|
|
2
1
|
import BaseLayer from '../layers/baselayer.js';
|
|
2
|
+
import { BasemapDefinition, LayerId } from '../layerdefinitions.js';
|
|
3
3
|
declare class Basemap {
|
|
4
|
-
id:
|
|
4
|
+
id: LayerId;
|
|
5
5
|
name: string;
|
|
6
6
|
thumbnail: string;
|
|
7
7
|
opacity: number;
|
|
8
8
|
layersList: BaseLayer[];
|
|
9
|
-
constructor(elem:
|
|
9
|
+
constructor(elem: BasemapDefinition, opacity?: number);
|
|
10
10
|
get projection(): string | undefined;
|
|
11
11
|
get opacityDisabled(): boolean;
|
|
12
12
|
}
|
package/models/customtheme.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GMFTreeItem, GMFTheme } from './gmf.js';
|
|
2
|
+
/**
|
|
3
|
+
* These are the interfaces for a Georama backend that differ from GMF
|
|
4
|
+
*/
|
|
5
|
+
export interface GeoramaTreeItem extends Omit<GMFTreeItem, 'id'> {
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GeoramaTheme extends Omit<GMFTheme, 'id'> {
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/gmf.d.ts
CHANGED
|
@@ -75,7 +75,6 @@ export interface GMFTheme {
|
|
|
75
75
|
export interface GMFGroup extends GMFTreeItem {
|
|
76
76
|
children: GMFTreeItem[];
|
|
77
77
|
}
|
|
78
|
-
export type GMFBackgroundLayer = GMFTreeItem;
|
|
79
78
|
export type GMFServerOgcType = 'mapserver' | 'qgisserver' | 'georama' | 'geoserver' | 'arcgis' | 'other';
|
|
80
79
|
export interface GMFServerOgc {
|
|
81
80
|
url: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GMFTheme, GMFTreeItem } from './gmf.js';
|
|
2
|
+
import { GeoramaTheme, GeoramaTreeItem } from './georama.js';
|
|
3
|
+
/**
|
|
4
|
+
* Unified interfaces for layer definitions from different backends.
|
|
5
|
+
*/
|
|
6
|
+
export type LayerId = number | string;
|
|
7
|
+
export interface TreeItemDefinition extends Omit<GMFTreeItem, 'id'>, Omit<GeoramaTreeItem, 'id'> {
|
|
8
|
+
id: LayerId;
|
|
9
|
+
}
|
|
10
|
+
export interface ThemeDefinition extends Omit<GMFTheme, 'id'>, Omit<GeoramaTheme, 'id'> {
|
|
11
|
+
id: LayerId;
|
|
12
|
+
}
|
|
13
|
+
export type BasemapDefinition = TreeItemDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import GroupLayer from './grouplayer.js';
|
|
2
2
|
import ThemeLayer from './themelayer.js';
|
|
3
|
+
import { LayerId } from '../layerdefinitions.js';
|
|
3
4
|
type BaseLayerOptions = {
|
|
4
5
|
isDefaultChecked?: boolean;
|
|
5
6
|
disclaimer?: string;
|
|
6
7
|
metadataUrl?: string;
|
|
7
8
|
};
|
|
8
9
|
declare abstract class BaseLayer {
|
|
9
|
-
id:
|
|
10
|
+
id: LayerId;
|
|
10
11
|
treeItemId: string;
|
|
11
12
|
name: string;
|
|
12
13
|
order: number;
|
|
@@ -27,6 +28,6 @@ declare abstract class BaseLayer {
|
|
|
27
28
|
abstract get inactive(): boolean;
|
|
28
29
|
abstract clone(): BaseLayer;
|
|
29
30
|
parent?: ThemeLayer | GroupLayer;
|
|
30
|
-
constructor(id:
|
|
31
|
+
constructor(id: LayerId, name: string, order: number, options?: BaseLayerOptions);
|
|
31
32
|
}
|
|
32
33
|
export default BaseLayer;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BaseLayer from './baselayer.js';
|
|
2
|
+
import { LayerId } from '../layerdefinitions.js';
|
|
2
3
|
import ILayerWithTime from './ilayerwithtime.js';
|
|
3
4
|
import ITimeOptions from '../../tools/time/itimeoptions.js';
|
|
4
5
|
export type GroupLayerOptions = {
|
|
@@ -21,7 +22,7 @@ declare class GroupLayer extends BaseLayer implements ILayerWithTime {
|
|
|
21
22
|
timeAttribute?: string;
|
|
22
23
|
timeRestriction?: string;
|
|
23
24
|
children: BaseLayer[];
|
|
24
|
-
constructor(id:
|
|
25
|
+
constructor(id: LayerId, name: string, order: number, options?: GroupLayerOptions);
|
|
25
26
|
clone(): GroupLayer;
|
|
26
27
|
get active(): boolean;
|
|
27
28
|
get inactive(): boolean;
|
package/models/layers/layer.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import BaseLayer from './baselayer.js';
|
|
2
2
|
import GroupLayer from './grouplayer.js';
|
|
3
3
|
import ThemeLayer from './themelayer.js';
|
|
4
|
+
import { LayerId } from '../layerdefinitions.js';
|
|
4
5
|
type LayerOptions = {
|
|
5
6
|
isDefaultChecked?: boolean;
|
|
6
7
|
disclaimer?: string;
|
|
@@ -15,7 +16,7 @@ declare abstract class Layer extends BaseLayer {
|
|
|
15
16
|
swiped: 'left' | 'right' | 'no';
|
|
16
17
|
isLegendExpanded: boolean;
|
|
17
18
|
parent: ThemeLayer | GroupLayer;
|
|
18
|
-
constructor(id:
|
|
19
|
+
constructor(id: LayerId, name: string, order: number, options?: LayerOptions);
|
|
19
20
|
get isTransparent(): boolean;
|
|
20
21
|
get hasValidOpacity(): boolean;
|
|
21
22
|
get active(): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayerId, TreeItemDefinition } from '../layerdefinitions.js';
|
|
2
2
|
import Layer from './layer.js';
|
|
3
3
|
type LayerCogTilesOptions = {
|
|
4
4
|
isDefaultChecked?: boolean;
|
|
@@ -9,9 +9,9 @@ type LayerCogTilesOptions = {
|
|
|
9
9
|
};
|
|
10
10
|
declare class LayerCog extends Layer {
|
|
11
11
|
source: string;
|
|
12
|
-
constructor(id:
|
|
12
|
+
constructor(id: LayerId, name: string, order: number, source: string, options?: TreeItemDefinition | LayerCogTilesOptions);
|
|
13
13
|
clone(): LayerCog;
|
|
14
|
-
private static
|
|
15
|
-
private static
|
|
14
|
+
private static isTreeItemDefinition;
|
|
15
|
+
private static getOptionsFromDefinition;
|
|
16
16
|
}
|
|
17
17
|
export default LayerCog;
|
|
@@ -10,7 +10,7 @@ class LayerCog extends Layer {
|
|
|
10
10
|
source;
|
|
11
11
|
constructor(id, name, order, source, options) {
|
|
12
12
|
let opts = options ?? {};
|
|
13
|
-
opts = LayerCog.
|
|
13
|
+
opts = LayerCog.isTreeItemDefinition(opts) ? LayerCog.getOptionsFromDefinition(opts) : opts;
|
|
14
14
|
super(id, name, order, opts);
|
|
15
15
|
this.source = source;
|
|
16
16
|
}
|
|
@@ -26,10 +26,10 @@ class LayerCog extends Layer {
|
|
|
26
26
|
clonedObject.activeState = this.activeState;
|
|
27
27
|
return clonedObject;
|
|
28
28
|
}
|
|
29
|
-
static
|
|
29
|
+
static isTreeItemDefinition(options) {
|
|
30
30
|
return 'id' in options;
|
|
31
31
|
}
|
|
32
|
-
static
|
|
32
|
+
static getOptionsFromDefinition(options) {
|
|
33
33
|
return {
|
|
34
34
|
isDefaultChecked: options.metadata?.isChecked,
|
|
35
35
|
metadataUrl: options.metadata?.metadataUrl,
|
|
@@ -3,6 +3,7 @@ import Layer from './layer.js';
|
|
|
3
3
|
import Geometry from 'ol/geom/Geometry.js';
|
|
4
4
|
import { Extent } from 'ol/extent.js';
|
|
5
5
|
import ILayerWithLegend from './ilayerwithlegend.js';
|
|
6
|
+
import { LayerId } from '../layerdefinitions.js';
|
|
6
7
|
declare class LayerLocalFile extends Layer implements ILayerWithLegend {
|
|
7
8
|
_features: Feature<Geometry>[];
|
|
8
9
|
lastModifiedDate: string;
|
|
@@ -12,7 +13,7 @@ declare class LayerLocalFile extends Layer implements ILayerWithLegend {
|
|
|
12
13
|
extent: Extent;
|
|
13
14
|
private readonly file;
|
|
14
15
|
private readonly locale;
|
|
15
|
-
constructor(id:
|
|
16
|
+
constructor(id: LayerId, order: number, file: File, features: Feature<Geometry>[], extent: Extent, locale: string, options?: {
|
|
16
17
|
isDefaultChecked?: boolean;
|
|
17
18
|
});
|
|
18
19
|
clone(): LayerLocalFile;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Layer from './layer.js';
|
|
2
|
+
import { LayerId } from '../layerdefinitions.js';
|
|
2
3
|
type LayerVectorTilesOptions = {
|
|
3
4
|
projection?: string;
|
|
4
5
|
layerName?: string;
|
|
@@ -12,7 +13,7 @@ declare class LayerVectorTiles extends Layer {
|
|
|
12
13
|
style: string;
|
|
13
14
|
layerName?: string;
|
|
14
15
|
projection?: string;
|
|
15
|
-
constructor(id:
|
|
16
|
+
constructor(id: LayerId, name: string, order: number, style: string, options?: LayerVectorTilesOptions);
|
|
16
17
|
clone(): LayerVectorTiles;
|
|
17
18
|
}
|
|
18
19
|
export default LayerVectorTiles;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import WfsFilter from '../../tools/wfs/wfsfilter.js';
|
|
2
|
-
import {
|
|
2
|
+
import { LayerId, TreeItemDefinition } from '../layerdefinitions.js';
|
|
3
3
|
import ServerOgc from '../serverogc.js';
|
|
4
4
|
import ILayerWithFilter from './ilayerwithfilter.js';
|
|
5
5
|
import ILayerWithLegend from './ilayerwithlegend.js';
|
|
@@ -70,7 +70,7 @@ declare class LayerWms extends Layer implements ILayerWithLegend, ILayerWithFilt
|
|
|
70
70
|
timeAttribute?: string;
|
|
71
71
|
enumeratedAttributes?: string[];
|
|
72
72
|
editable?: string;
|
|
73
|
-
constructor(id:
|
|
73
|
+
constructor(id: LayerId, name: string, order: number, ogcServer: ServerOgc, options?: TreeItemDefinition | LayerWmsOptions);
|
|
74
74
|
clone(): LayerWms;
|
|
75
75
|
static isResolutionRangeRestricted(minResolution: number | undefined, maxResolution: number | undefined): boolean | 0 | undefined;
|
|
76
76
|
hasRestrictedResolution(): boolean | 0 | undefined;
|
|
@@ -82,8 +82,8 @@ declare class LayerWms extends Layer implements ILayerWithLegend, ILayerWithFilt
|
|
|
82
82
|
get serverUniqueQueryId(): string;
|
|
83
83
|
get wfsQueryable(): boolean;
|
|
84
84
|
get wmsQueryableOnly(): boolean;
|
|
85
|
-
private static
|
|
86
|
-
private static
|
|
85
|
+
private static isTreeItemDefinition;
|
|
86
|
+
private static getOptionsFromDefinition;
|
|
87
87
|
private static getDefaultWmsInfoFormat;
|
|
88
88
|
}
|
|
89
89
|
export default LayerWms;
|
|
@@ -44,7 +44,7 @@ class LayerWms extends Layer {
|
|
|
44
44
|
editable;
|
|
45
45
|
constructor(id, name, order, ogcServer, options) {
|
|
46
46
|
let opts = options ?? {};
|
|
47
|
-
opts = LayerWms.
|
|
47
|
+
opts = LayerWms.isTreeItemDefinition(opts) ? LayerWms.getOptionsFromDefinition(opts) : opts;
|
|
48
48
|
super(id, name, order, opts);
|
|
49
49
|
this.ogcServer = ogcServer;
|
|
50
50
|
this.minResolution = opts?.minResolution;
|
|
@@ -152,10 +152,10 @@ class LayerWms extends Layer {
|
|
|
152
152
|
get wmsQueryableOnly() {
|
|
153
153
|
return this.queryable && !this.ogcServer.wfsSupport;
|
|
154
154
|
}
|
|
155
|
-
static
|
|
155
|
+
static isTreeItemDefinition(options) {
|
|
156
156
|
return 'id' in options;
|
|
157
157
|
}
|
|
158
|
-
static
|
|
158
|
+
static getOptionsFromDefinition(options) {
|
|
159
159
|
const opts = {
|
|
160
160
|
isDefaultChecked: options.metadata?.isChecked,
|
|
161
161
|
metadataUrl: options.metadata?.metadataUrl,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayerId, TreeItemDefinition } from '../layerdefinitions.js';
|
|
2
2
|
import ServerOgc from '../serverogc.js';
|
|
3
3
|
import ILayerWithLegend from './ilayerwithlegend.js';
|
|
4
4
|
import Layer from './layer.js';
|
|
@@ -48,12 +48,12 @@ declare class LayerWmts extends Layer implements ILayerWithLegend {
|
|
|
48
48
|
hiDPILegendImages?: Record<string, string>;
|
|
49
49
|
/** Linked ol layer, starting with an underscore to not be part of the proxy. **/
|
|
50
50
|
_olayer?: TileLayer<WMTS>;
|
|
51
|
-
constructor(id:
|
|
51
|
+
constructor(id: LayerId, name: string, order: number, url: string, layer: string, options?: TreeItemDefinition | LayerWmtsOptions, ogcServer?: ServerOgc);
|
|
52
52
|
clone(): LayerWmts;
|
|
53
53
|
get layerUniqueId(): string;
|
|
54
54
|
hasRestrictedResolution(): boolean | 0 | undefined;
|
|
55
55
|
isVisibleAtResolution(resolution: number): boolean;
|
|
56
|
-
private static
|
|
57
|
-
private static
|
|
56
|
+
private static isTreeItemDefinition;
|
|
57
|
+
private static getOptionsFromDefinition;
|
|
58
58
|
}
|
|
59
59
|
export default LayerWmts;
|
|
@@ -39,7 +39,7 @@ class LayerWmts extends Layer {
|
|
|
39
39
|
_olayer;
|
|
40
40
|
constructor(id, name, order, url, layer, options, ogcServer) {
|
|
41
41
|
let opts = options ?? {};
|
|
42
|
-
opts = LayerWmts.
|
|
42
|
+
opts = LayerWmts.isTreeItemDefinition(opts) ? LayerWmts.getOptionsFromDefinition(opts) : opts;
|
|
43
43
|
super(id, name, order, opts);
|
|
44
44
|
this.url = url;
|
|
45
45
|
this.layer = layer;
|
|
@@ -102,10 +102,10 @@ class LayerWmts extends Layer {
|
|
|
102
102
|
}
|
|
103
103
|
return resolution >= (this.minResolution ?? -1) && resolution <= (this.maxResolution ?? Infinity);
|
|
104
104
|
}
|
|
105
|
-
static
|
|
105
|
+
static isTreeItemDefinition(options) {
|
|
106
106
|
return 'id' in options;
|
|
107
107
|
}
|
|
108
|
-
static
|
|
108
|
+
static getOptionsFromDefinition(options) {
|
|
109
109
|
return {
|
|
110
110
|
isDefaultChecked: options.metadata?.isChecked,
|
|
111
111
|
metadataUrl: options.metadata?.metadataUrl,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LayerId, TreeItemDefinition } from '../layerdefinitions.js';
|
|
2
2
|
import Layer from './layer.js';
|
|
3
3
|
type LayerXYZTilesOptions = {
|
|
4
4
|
isDefaultChecked?: boolean;
|
|
@@ -9,9 +9,9 @@ type LayerXYZTilesOptions = {
|
|
|
9
9
|
};
|
|
10
10
|
declare class LayerXYZ extends Layer {
|
|
11
11
|
source: string;
|
|
12
|
-
constructor(id:
|
|
12
|
+
constructor(id: LayerId, name: string, order: number, source: string, options?: TreeItemDefinition | LayerXYZTilesOptions);
|
|
13
13
|
clone(): LayerXYZ;
|
|
14
|
-
private static
|
|
15
|
-
private static
|
|
14
|
+
private static isTreeItemDefinition;
|
|
15
|
+
private static getOptionsFromDefinition;
|
|
16
16
|
}
|
|
17
17
|
export default LayerXYZ;
|
|
@@ -10,7 +10,7 @@ class LayerXYZ extends Layer {
|
|
|
10
10
|
source;
|
|
11
11
|
constructor(id, name, order, source, options) {
|
|
12
12
|
let opts = options ?? {};
|
|
13
|
-
opts = LayerXYZ.
|
|
13
|
+
opts = LayerXYZ.isTreeItemDefinition(opts) ? LayerXYZ.getOptionsFromDefinition(opts) : opts;
|
|
14
14
|
super(id, name, order, opts);
|
|
15
15
|
this.source = source;
|
|
16
16
|
}
|
|
@@ -26,10 +26,10 @@ class LayerXYZ extends Layer {
|
|
|
26
26
|
clonedObject.activeState = this.activeState;
|
|
27
27
|
return clonedObject;
|
|
28
28
|
}
|
|
29
|
-
static
|
|
29
|
+
static isTreeItemDefinition(options) {
|
|
30
30
|
return 'id' in options;
|
|
31
31
|
}
|
|
32
|
-
static
|
|
32
|
+
static getOptionsFromDefinition(options) {
|
|
33
33
|
return {
|
|
34
34
|
isDefaultChecked: options.metadata?.isChecked,
|
|
35
35
|
metadataUrl: options.metadata?.metadataUrl,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BaseLayer from './baselayer.js';
|
|
2
2
|
import { Coordinate } from 'ol/coordinate.js';
|
|
3
|
+
import { LayerId } from '../layerdefinitions.js';
|
|
3
4
|
export type ThemeLayerOptions = {
|
|
4
5
|
isDefaultChecked?: boolean;
|
|
5
6
|
disclaimer?: string;
|
|
@@ -15,7 +16,7 @@ declare class ThemeLayer extends BaseLayer {
|
|
|
15
16
|
location?: Coordinate;
|
|
16
17
|
zoom?: number;
|
|
17
18
|
children: BaseLayer[];
|
|
18
|
-
constructor(id:
|
|
19
|
+
constructor(id: LayerId, name: string, order: number, icon?: string, options?: ThemeLayerOptions);
|
|
19
20
|
clone(): ThemeLayer;
|
|
20
21
|
get active(): boolean;
|
|
21
22
|
get inactive(): boolean;
|
package/models/main.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ export { default as BasemapSwisstopoVectorTiles } from './basemaps/basemapswisst
|
|
|
5
5
|
export { default as CustomTheme } from './customtheme.js';
|
|
6
6
|
export type { FilterOperator, AttributeTypeGroup, LogicalFilterOperator } from './filter.js';
|
|
7
7
|
export { filterOperatorValues, filterOperators, isFilterOperator, isValuelessFilterOperator, isTwoSidedFilterOperator, isListFilterOperator, operatorsByAttributeTypeGroup, logicalFilterOperators, isLogicalFilterOperator } from './filter.js';
|
|
8
|
-
export type {
|
|
8
|
+
export type { GeoramaTreeItem, GeoramaTheme } from './georama.js';
|
|
9
|
+
export type { GMFMetadata, GMFChildLayer, GMFTreeItem, GMFThemeFunctionality, GMFThemeFunctionalities, GMFTheme, GMFGroup, GMFServerOgcType, GMFServerOgc, GMFServerOgcAttributes, GMFServerOgcObjectAttributes, GMFServerOgcColumnAttributes } from './gmf.js';
|
|
10
|
+
export type { LayerId, TreeItemDefinition, ThemeDefinition, BasemapDefinition } from './layerdefinitions.js';
|
|
9
11
|
export { default as BaseLayer } from './layers/baselayer.js';
|
|
10
12
|
export type { GroupLayerOptions } from './layers/grouplayer.js';
|
|
11
13
|
export { default as GroupLayer } from './layers/grouplayer.js';
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.2.0-dev.
|
|
1
|
+
{"version":"1.2.0-dev.2853894139", "build":"2853894139", "date":"16/09/2026"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FilterOperator, LogicalFilterOperator } from '../../../models/filter.js';
|
|
2
2
|
import { GMFServerOgcType } from '../../../models/gmf.js';
|
|
3
|
+
import { LayerId } from '../../../models/layerdefinitions.js';
|
|
3
4
|
export type SharedFilterCondition = {
|
|
4
5
|
property: string;
|
|
5
6
|
propertyType?: string;
|
|
@@ -14,7 +15,7 @@ export type SharedFilter = {
|
|
|
14
15
|
};
|
|
15
16
|
export type SharedLayer = SharedInternalTheme | SharedInternalGroup | SharedInternalLayer | SharedExternalTheme | SharedExternalLayer;
|
|
16
17
|
export type SharedInternalTheme = {
|
|
17
|
-
id:
|
|
18
|
+
id: LayerId;
|
|
18
19
|
order: number;
|
|
19
20
|
checked: number;
|
|
20
21
|
isExpanded: number;
|
|
@@ -25,7 +26,7 @@ export type SharedInternalTheme = {
|
|
|
25
26
|
* And should forcefully be added to the layer tree because the user just didn't know this layer when he has created this shared state
|
|
26
27
|
* Or if it was explicitly removed from the user, and then we won't have to display it again
|
|
27
28
|
*/
|
|
28
|
-
excludedChildrenIds:
|
|
29
|
+
excludedChildrenIds: Array<LayerId>;
|
|
29
30
|
/**
|
|
30
31
|
* When configuring the share with "preferNames=true", the name of the layer will be used to generate the sahred state
|
|
31
32
|
* instead of the ID. But in this case, we also have to share the type os the layer, because tha layer name can be
|
|
@@ -38,7 +39,7 @@ export type SharedInternalTheme = {
|
|
|
38
39
|
excludedChildrenNames: string[];
|
|
39
40
|
};
|
|
40
41
|
export type SharedInternalGroup = {
|
|
41
|
-
id:
|
|
42
|
+
id: LayerId;
|
|
42
43
|
order: number;
|
|
43
44
|
checked: number;
|
|
44
45
|
isExpanded: number;
|
|
@@ -50,7 +51,7 @@ export type SharedInternalGroup = {
|
|
|
50
51
|
excludedChildrenNames: string[];
|
|
51
52
|
};
|
|
52
53
|
export type SharedInternalLayer = {
|
|
53
|
-
id:
|
|
54
|
+
id: LayerId;
|
|
54
55
|
order: number;
|
|
55
56
|
checked: number;
|
|
56
57
|
isExpanded: number;
|
|
@@ -87,7 +88,7 @@ export type SharedExternalLayer = {
|
|
|
87
88
|
swiped?: 'left' | 'right' | 'no';
|
|
88
89
|
};
|
|
89
90
|
export type SharedBasemap = {
|
|
90
|
-
id:
|
|
91
|
+
id: LayerId;
|
|
91
92
|
name: string;
|
|
92
93
|
opacity: number;
|
|
93
94
|
};
|
package/tools/state/state.d.ts
CHANGED
|
@@ -13,9 +13,10 @@ import ObjectSelection from './objectselection.js';
|
|
|
13
13
|
import type Theme from '../../models/theme.js';
|
|
14
14
|
import GraphicalInterface from './graphicalInterface.js';
|
|
15
15
|
import { GMFThemeFunctionalities, GMFThemeFunctionality } from '../../models/gmf.js';
|
|
16
|
+
import { LayerId } from '../../models/layerdefinitions.js';
|
|
16
17
|
export type ThemesConfig = {
|
|
17
|
-
_allThemes: Record<
|
|
18
|
-
_allFunctionalities: Record<
|
|
18
|
+
_allThemes: Record<LayerId, ThemeLayer>;
|
|
19
|
+
_allFunctionalities: Record<LayerId, GMFThemeFunctionalities>;
|
|
19
20
|
isLoaded: boolean;
|
|
20
21
|
lastSelectedTheme: ThemeLayer | CustomTheme | null;
|
|
21
22
|
};
|
|
@@ -101,7 +102,7 @@ export default class State {
|
|
|
101
102
|
*/
|
|
102
103
|
themes: ThemesConfig;
|
|
103
104
|
functionalities: Record<string, GMFThemeFunctionality>;
|
|
104
|
-
basemaps: Record<
|
|
105
|
+
basemaps: Record<LayerId, Basemap>;
|
|
105
106
|
ogcServers: Record<string, ServerOgc>;
|
|
106
107
|
activeBasemaps: Basemap[];
|
|
107
108
|
projection: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import GirafeSingleton from '../../base/GirafeSingleton.js';
|
|
2
2
|
import BaseLayer from '../../models/layers/baselayer.js';
|
|
3
|
+
import { LayerId } from '../../models/layerdefinitions.js';
|
|
3
4
|
import GroupLayer from '../../models/layers/grouplayer.js';
|
|
4
5
|
import Layer from '../../models/layers/layer.js';
|
|
5
6
|
import ThemeLayer from '../../models/layers/themelayer.js';
|
|
@@ -10,8 +11,8 @@ export type LayerTreeChanges = {
|
|
|
10
11
|
export default class ThemesHelper extends GirafeSingleton {
|
|
11
12
|
initializeSingleton(): void;
|
|
12
13
|
private get state();
|
|
13
|
-
findBaseLayerById(layerId:
|
|
14
|
-
findBaseLayerRecursiveById(layers: BaseLayer[], layerId:
|
|
14
|
+
findBaseLayerById(layerId: LayerId): BaseLayer;
|
|
15
|
+
findBaseLayerRecursiveById(layers: BaseLayer[], layerId: LayerId): BaseLayer | null;
|
|
15
16
|
findThemeByName(themename: string): ThemeLayer | null;
|
|
16
17
|
findGroupByName(groupname: string): GroupLayer | null;
|
|
17
18
|
findLayerByName(layername: string): Layer | null;
|