@eox/layercontrol 0.22.0 → 0.24.0
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/README.md +4 -0
- package/dist/eox-layercontrol.js +836 -839
- package/dist/eox-layercontrol.umd.cjs +119 -122
- package/package.json +24 -17
- package/src/components/add-layers.js +416 -0
- package/src/components/layer-config.js +212 -0
- package/src/components/layer-datetime.js +128 -0
- package/src/components/layer-group.js +193 -0
- package/src/components/layer-legend.js +135 -0
- package/src/components/layer-list.js +209 -0
- package/src/components/layer-tools.js +353 -0
- package/src/components/layer.js +244 -0
- package/src/components/optional-list.js +124 -0
- package/src/components/tab-sliders.js +0 -0
- package/src/components/tools-items.js +199 -0
- package/src/enums/index.js +16 -0
- package/src/enums/stories/assets/cropomhusc-feature-collection.json +5274 -0
- package/src/enums/stories/index.js +536 -0
- package/src/helpers/check-properties.js +41 -0
- package/src/helpers/clean-json-input.js +29 -0
- package/src/helpers/create-sortable.js +104 -0
- package/src/helpers/detect-map-url-type.js +20 -0
- package/src/helpers/fetch-capabilities.js +32 -0
- package/src/helpers/filter-layers.js +45 -0
- package/src/helpers/get-layer-type.js +35 -0
- package/src/helpers/get-legend-config.js +25 -0
- package/src/helpers/get-start-vals.js +73 -0
- package/src/helpers/hide-layers-based-on-property.js +11 -0
- package/src/helpers/index.js +22 -0
- package/src/helpers/is-layer-json-valid.js +19 -0
- package/src/helpers/is-layer-visible-based-on-zoom-state.js +31 -0
- package/src/helpers/is-layer-zoom-state-req.js +17 -0
- package/src/helpers/is-map-url-valid.js +22 -0
- package/src/helpers/layer-tools.js +82 -0
- package/src/helpers/update-url.js +32 -0
- package/src/main.js +269 -0
- package/src/methods/add-layer/add-layer.js +33 -0
- package/src/methods/add-layer/index.js +8 -0
- package/src/methods/add-layer/json-input-change.js +15 -0
- package/src/methods/add-layer/open-close-tab.js +21 -0
- package/src/methods/add-layer/url-input-change.js +17 -0
- package/src/methods/add-layer/url-layer.js +37 -0
- package/src/methods/add-layer/wms-search-url.js +44 -0
- package/src/methods/layer/first-updated.js +65 -0
- package/src/methods/layer/index.js +4 -0
- package/src/methods/layer/input-click.js +43 -0
- package/src/methods/layer-config/apply-updated-styles.js +98 -0
- package/src/methods/layer-config/data-change.js +44 -0
- package/src/methods/layer-config/index.js +7 -0
- package/src/methods/layer-list/first-updated.js +55 -0
- package/src/methods/layer-list/index.js +3 -0
- package/src/methods/layercontrol/first-update.js +22 -0
- package/src/methods/layercontrol/index.js +4 -0
- package/src/methods/layercontrol/layer-list-change.js +23 -0
- package/src/methods/optional-list/add-to-list.js +44 -0
- package/src/methods/optional-list/index.js +3 -0
- package/types/layercontrol/src/components/add-layers.d.ts +80 -0
- package/types/layercontrol/src/components/add-layers.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer-config.d.ts +82 -0
- package/types/layercontrol/src/components/layer-config.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer-datetime.d.ts +66 -0
- package/types/layercontrol/src/components/layer-datetime.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer-group.d.ts +103 -0
- package/types/layercontrol/src/components/layer-group.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer-legend.d.ts +83 -0
- package/types/layercontrol/src/components/layer-legend.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer-list.d.ts +108 -0
- package/types/layercontrol/src/components/layer-list.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer-tools.d.ts +72 -0
- package/types/layercontrol/src/components/layer-tools.d.ts.map +1 -0
- package/types/layercontrol/src/components/layer.d.ts +108 -0
- package/types/layercontrol/src/components/layer.d.ts.map +1 -0
- package/types/layercontrol/src/components/optional-list.d.ts +68 -0
- package/types/layercontrol/src/components/optional-list.d.ts.map +1 -0
- package/types/layercontrol/src/components/tab-sliders.d.ts +1 -0
- package/types/layercontrol/src/components/tab-sliders.d.ts.map +1 -0
- package/types/layercontrol/src/components/tools-items.d.ts +61 -0
- package/types/layercontrol/src/components/tools-items.d.ts.map +1 -0
- package/types/layercontrol/src/enums/index.d.ts +2 -0
- package/types/layercontrol/src/enums/index.d.ts.map +1 -0
- package/types/layercontrol/src/enums/stories/index.d.ts +549 -0
- package/types/layercontrol/src/enums/stories/index.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/check-properties.d.ts +11 -0
- package/types/layercontrol/src/helpers/check-properties.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/clean-json-input.d.ts +8 -0
- package/types/layercontrol/src/helpers/clean-json-input.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/create-sortable.d.ts +11 -0
- package/types/layercontrol/src/helpers/create-sortable.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/detect-map-url-type.d.ts +8 -0
- package/types/layercontrol/src/helpers/detect-map-url-type.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/fetch-capabilities.d.ts +10 -0
- package/types/layercontrol/src/helpers/fetch-capabilities.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/filter-layers.d.ts +10 -0
- package/types/layercontrol/src/helpers/filter-layers.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/get-layer-type.d.ts +9 -0
- package/types/layercontrol/src/helpers/get-layer-type.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/get-legend-config.d.ts +20 -0
- package/types/layercontrol/src/helpers/get-legend-config.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/get-start-vals.d.ts +21 -0
- package/types/layercontrol/src/helpers/get-start-vals.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/hide-layers-based-on-property.d.ts +2 -0
- package/types/layercontrol/src/helpers/hide-layers-based-on-property.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/index.d.ts +17 -0
- package/types/layercontrol/src/helpers/index.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/is-layer-json-valid.d.ts +7 -0
- package/types/layercontrol/src/helpers/is-layer-json-valid.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/is-layer-visible-based-on-zoom-state.d.ts +11 -0
- package/types/layercontrol/src/helpers/is-layer-visible-based-on-zoom-state.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/is-layer-zoom-state-req.d.ts +9 -0
- package/types/layercontrol/src/helpers/is-layer-zoom-state-req.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/is-map-url-valid.d.ts +8 -0
- package/types/layercontrol/src/helpers/is-map-url-valid.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/layer-tools.d.ts +6 -0
- package/types/layercontrol/src/helpers/layer-tools.d.ts.map +1 -0
- package/types/layercontrol/src/helpers/update-url.d.ts +9 -0
- package/types/layercontrol/src/helpers/update-url.d.ts.map +1 -0
- package/types/layercontrol/src/main.d.ts +149 -0
- package/types/layercontrol/src/main.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/add-layer.d.ts +10 -0
- package/types/layercontrol/src/methods/add-layer/add-layer.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/index.d.ts +7 -0
- package/types/layercontrol/src/methods/add-layer/index.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/json-input-change.d.ts +13 -0
- package/types/layercontrol/src/methods/add-layer/json-input-change.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/open-close-tab.d.ts +10 -0
- package/types/layercontrol/src/methods/add-layer/open-close-tab.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/url-input-change.d.ts +10 -0
- package/types/layercontrol/src/methods/add-layer/url-input-change.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/url-layer.d.ts +12 -0
- package/types/layercontrol/src/methods/add-layer/url-layer.d.ts.map +1 -0
- package/types/layercontrol/src/methods/add-layer/wms-search-url.d.ts +11 -0
- package/types/layercontrol/src/methods/add-layer/wms-search-url.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer/first-updated.d.ts +9 -0
- package/types/layercontrol/src/methods/layer/first-updated.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer/index.d.ts +3 -0
- package/types/layercontrol/src/methods/layer/index.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer/input-click.d.ts +13 -0
- package/types/layercontrol/src/methods/layer/input-click.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer-config/apply-updated-styles.d.ts +8 -0
- package/types/layercontrol/src/methods/layer-config/apply-updated-styles.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer-config/data-change.d.ts +14 -0
- package/types/layercontrol/src/methods/layer-config/data-change.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer-config/index.d.ts +3 -0
- package/types/layercontrol/src/methods/layer-config/index.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer-list/first-updated.d.ts +9 -0
- package/types/layercontrol/src/methods/layer-list/first-updated.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layer-list/index.d.ts +2 -0
- package/types/layercontrol/src/methods/layer-list/index.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layercontrol/first-update.d.ts +10 -0
- package/types/layercontrol/src/methods/layercontrol/first-update.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layercontrol/index.d.ts +3 -0
- package/types/layercontrol/src/methods/layercontrol/index.d.ts.map +1 -0
- package/types/layercontrol/src/methods/layercontrol/layer-list-change.d.ts +11 -0
- package/types/layercontrol/src/methods/layercontrol/layer-list-change.d.ts.map +1 -0
- package/types/layercontrol/src/methods/optional-list/add-to-list.d.ts +8 -0
- package/types/layercontrol/src/methods/optional-list/add-to-list.d.ts.map +1 -0
- package/types/layercontrol/src/methods/optional-list/index.d.ts +2 -0
- package/types/layercontrol/src/methods/optional-list/index.d.ts.map +1 -0
- package/types/map/src/components/compare.d.ts +31 -0
- package/types/map/src/components/compare.d.ts.map +1 -0
- package/types/map/src/components/tooltip.d.ts +36 -0
- package/types/map/src/components/tooltip.d.ts.map +1 -0
- package/types/map/src/controls/controls.d.ts +27 -0
- package/types/map/src/controls/controls.d.ts.map +1 -0
- package/types/map/src/controls/geo-location.d.ts +41 -0
- package/types/map/src/controls/geo-location.d.ts.map +1 -0
- package/types/map/src/controls/loading-indicator.d.ts +20 -0
- package/types/map/src/controls/loading-indicator.d.ts.map +1 -0
- package/types/map/src/enums/index.d.ts +2 -0
- package/types/map/src/enums/index.d.ts.map +1 -0
- package/types/map/src/enums/map.d.ts +5 -0
- package/types/map/src/enums/map.d.ts.map +1 -0
- package/types/map/src/helpers/add-new-feature.d.ts +14 -0
- package/types/map/src/helpers/add-new-feature.d.ts.map +1 -0
- package/types/map/src/helpers/cancel-animation.d.ts +7 -0
- package/types/map/src/helpers/cancel-animation.d.ts.map +1 -0
- package/types/map/src/helpers/center.d.ts +12 -0
- package/types/map/src/helpers/center.d.ts.map +1 -0
- package/types/map/src/helpers/coordinates-roughly-equals.d.ts +12 -0
- package/types/map/src/helpers/coordinates-roughly-equals.d.ts.map +1 -0
- package/types/map/src/helpers/draw.d.ts +22 -0
- package/types/map/src/helpers/draw.d.ts.map +1 -0
- package/types/map/src/helpers/generate.d.ts +30 -0
- package/types/map/src/helpers/generate.d.ts.map +1 -0
- package/types/map/src/helpers/index.d.ts +16 -0
- package/types/map/src/helpers/index.d.ts.map +1 -0
- package/types/map/src/helpers/interactions.d.ts +16 -0
- package/types/map/src/helpers/interactions.d.ts.map +1 -0
- package/types/map/src/helpers/layer.d.ts +24 -0
- package/types/map/src/helpers/layer.d.ts.map +1 -0
- package/types/map/src/helpers/parse-feature.d.ts +8 -0
- package/types/map/src/helpers/parse-feature.d.ts.map +1 -0
- package/types/map/src/helpers/parse-text.d.ts +33 -0
- package/types/map/src/helpers/parse-text.d.ts.map +1 -0
- package/types/map/src/helpers/register-projection-from-code.d.ts +8 -0
- package/types/map/src/helpers/register-projection-from-code.d.ts.map +1 -0
- package/types/map/src/helpers/register-projection.d.ts +11 -0
- package/types/map/src/helpers/register-projection.d.ts.map +1 -0
- package/types/map/src/helpers/select.d.ts +77 -0
- package/types/map/src/helpers/select.d.ts.map +1 -0
- package/types/map/src/helpers/tile-grid.d.ts +14 -0
- package/types/map/src/helpers/tile-grid.d.ts.map +1 -0
- package/types/map/src/helpers/transform.d.ts +19 -0
- package/types/map/src/helpers/transform.d.ts.map +1 -0
- package/types/map/src/main.d.ts +337 -0
- package/types/map/src/main.d.ts.map +1 -0
- package/types/map/src/methods/map/add-update-layer.d.ts +13 -0
- package/types/map/src/methods/map/add-update-layer.d.ts.map +1 -0
- package/types/map/src/methods/map/animate-to-state.d.ts +7 -0
- package/types/map/src/methods/map/animate-to-state.d.ts.map +1 -0
- package/types/map/src/methods/map/first-updated.d.ts +9 -0
- package/types/map/src/methods/map/first-updated.d.ts.map +1 -0
- package/types/map/src/methods/map/getters.d.ts +15 -0
- package/types/map/src/methods/map/getters.d.ts.map +1 -0
- package/types/map/src/methods/map/index.d.ts +7 -0
- package/types/map/src/methods/map/index.d.ts.map +1 -0
- package/types/map/src/methods/map/remove.d.ts +22 -0
- package/types/map/src/methods/map/remove.d.ts.map +1 -0
- package/types/map/src/methods/map/setters.d.ts +82 -0
- package/types/map/src/methods/map/setters.d.ts.map +1 -0
- package/types/map/types.d.ts +146 -0
- package/types/map/types.d.ts.map +1 -0
- package/test/_mockMap.js +0 -154
- package/test/cases/general/check-layer-legend.js +0 -67
- package/test/cases/general/check-layer-size.js +0 -25
- package/test/cases/general/check-pre-open-layer-tools.js +0 -26
- package/test/cases/general/check-pre-open-section.js +0 -29
- package/test/cases/general/disable-drag.js +0 -26
- package/test/cases/general/empty-groups.js +0 -41
- package/test/cases/general/exclusive-layers.js +0 -35
- package/test/cases/general/hide-layers.js +0 -23
- package/test/cases/general/index.js +0 -10
- package/test/cases/general/render-optional-layer.js +0 -31
- package/test/cases/general/show-layer-title.js +0 -23
- package/test/cases/layer-update/add-external-layer.js +0 -96
- package/test/cases/layer-update/add-layer-from-optional.js +0 -51
- package/test/cases/layer-update/check-if-layer-pushed-to-group.js +0 -33
- package/test/cases/layer-update/check-layer-changed-event.js +0 -29
- package/test/cases/layer-update/check-layer-is-pushed-to-root.js +0 -22
- package/test/cases/layer-update/check-layer-removed-from-group.js +0 -33
- package/test/cases/layer-update/check-layer-removed-from-root.js +0 -27
- package/test/cases/layer-update/check-layer-size-after-multiple-calls.js +0 -34
- package/test/cases/layer-update/check-layer-zoom-state.js +0 -54
- package/test/cases/layer-update/index.js +0 -9
- package/test/general.cy.js +0 -61
- package/test/layersUpdate.cy.js +0 -72
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export type DrawOptions = Omit<import("ol/interaction/Draw").Options, "type"> & {
|
|
2
|
+
id: string | number;
|
|
3
|
+
type: "Point" | "LineString" | "Polygon" | "Circle" | "Box";
|
|
4
|
+
modify?: boolean;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
geometryFunction?: import("ol/interaction/Draw").GeometryFunction;
|
|
7
|
+
};
|
|
8
|
+
export type layerType = "Group" | "Heatmap" | "Image" | "Layer" | "Tile" | "Vector" | "VectorImage" | "VectorTile";
|
|
9
|
+
export type sourceType = "BingMaps" | "Cluster" | "GeoTIFF" | "IIIF" | "Image" | "ImageCanvas" | "ImageStatic" | "ImageWMS" | "OSM" | "Raster" | "StadiaMaps" | "Tile" | "TileArcGISRest" | "TileDebug" | "TileImage" | "TileJSON" | "TileWMS" | "UrlTile" | "Vector" | "VectorTile" | "WMTS" | "XYZ" | "WMTSCapabilities";
|
|
10
|
+
export type VectorOrVectorTileLayer = import("ol/layer").Vector | import("ol/layer").VectorTile;
|
|
11
|
+
export type AnyLayerWithSource = import("ol/layer/Base").default | import("ol/layer/BaseImage").default<import("ol/source/Image").default, import("ol/renderer/canvas/ImageLayer").default> | import("ol/layer/Tile").default<import("ol/source/Tile").default> | VectorOrVectorTileLayer;
|
|
12
|
+
export type AnyLayer = AnyLayerWithSource | import("ol/layer/Group").default;
|
|
13
|
+
export type formatWithOptions = {
|
|
14
|
+
type: string;
|
|
15
|
+
dataProjection?: string;
|
|
16
|
+
featureProjection?: string;
|
|
17
|
+
};
|
|
18
|
+
export type EOxInteraction = {
|
|
19
|
+
type: "draw" | "select";
|
|
20
|
+
options: DrawOptions | SelectOptions;
|
|
21
|
+
};
|
|
22
|
+
export type EoxLayer = {
|
|
23
|
+
type: layerType;
|
|
24
|
+
properties?: object & {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
minZoom?: number;
|
|
28
|
+
maxZoom?: number;
|
|
29
|
+
minResolution?: number;
|
|
30
|
+
maxResolution?: number;
|
|
31
|
+
opacity?: number;
|
|
32
|
+
visible?: boolean;
|
|
33
|
+
source?: {
|
|
34
|
+
type: sourceType;
|
|
35
|
+
format?: string | formatWithOptions;
|
|
36
|
+
tileGrid?: object;
|
|
37
|
+
projection?: import("ol/proj").ProjectionLike;
|
|
38
|
+
};
|
|
39
|
+
layers?: Array<EoxLayer>;
|
|
40
|
+
style?: import("ol/style/flat").FlatStyleLike;
|
|
41
|
+
interactions?: Array<EOxInteraction>;
|
|
42
|
+
zIndex?: number;
|
|
43
|
+
renderMode?: "vector" | "vectorImage";
|
|
44
|
+
};
|
|
45
|
+
export type SelectLayer = import("ol/layer/VectorTile").default | import("ol/layer/Vector").default;
|
|
46
|
+
export type SelectOptions = Omit<import("ol/interaction/Select").Options, "condition"> & {
|
|
47
|
+
id: string | number;
|
|
48
|
+
idProperty?: string;
|
|
49
|
+
condition: "click" | "pointermove";
|
|
50
|
+
layer?: EoxLayer;
|
|
51
|
+
style?: import("ol/style/flat.js").FlatStyleLike;
|
|
52
|
+
overlay?: import("ol/Overlay").Options;
|
|
53
|
+
active?: boolean;
|
|
54
|
+
panIn?: boolean;
|
|
55
|
+
modify?: boolean;
|
|
56
|
+
type?: string;
|
|
57
|
+
geometryFunction?: import("ol/interaction/Draw").GeometryFunction;
|
|
58
|
+
};
|
|
59
|
+
export type ControlOptions = import("ol/control/Control").Options;
|
|
60
|
+
export type GeolocationOptions = import("ol/control/Control").Options & {
|
|
61
|
+
/**
|
|
62
|
+
* @property {import("ol/style/flat.js").FlatStyleLike} style style definition of the position feature.
|
|
63
|
+
*/
|
|
64
|
+
style?: import("ol/style/flat.js").FlatStyleLike;
|
|
65
|
+
/**
|
|
66
|
+
* @property {boolean} centerWhenReady will pan the view to the user-location on the first position update.
|
|
67
|
+
*/
|
|
68
|
+
centerWhenReady?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* @property {boolean} highAccuracy enables high accuracy of geolocator. Required for tracking the heading.
|
|
71
|
+
*/
|
|
72
|
+
highAccuracy?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @property {boolean} trackAccuracy tracks accuracy and displays it as a circle underneath the position feature.
|
|
75
|
+
*/
|
|
76
|
+
trackAccuracy?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* @property {boolean} trackHeading tracks heading and sets it as 'heading'-property on the position feature.
|
|
79
|
+
* "highAccuracy" must be set in order to track heading.
|
|
80
|
+
*/
|
|
81
|
+
trackHeading?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @property {string} buttonIcon image src of control element icon
|
|
84
|
+
*/
|
|
85
|
+
buttonIcon?: string;
|
|
86
|
+
};
|
|
87
|
+
export type LoadingIndicatorType = "small" | "fullscreen";
|
|
88
|
+
export type LoadingIndicatorOptions = import("ol/control/Control").Options & {
|
|
89
|
+
/**
|
|
90
|
+
* @property {string} spinnerSvg svg to be used as spinner icon
|
|
91
|
+
*/
|
|
92
|
+
spinnerSvg?: string;
|
|
93
|
+
/**
|
|
94
|
+
* @property {Number} opacity opacity, defaults to 1
|
|
95
|
+
*/
|
|
96
|
+
opacity?: number;
|
|
97
|
+
/**
|
|
98
|
+
* @property {LoadingIndicatorType} type type of appearance. Small button style of fullscreen style. Defaults to button style.
|
|
99
|
+
*/
|
|
100
|
+
type?: LoadingIndicatorType;
|
|
101
|
+
};
|
|
102
|
+
export type ControlType = "Attribution" | "FullScreen" | "MousePosition" | "OverviewMap" | "Rotate" | "ScaleLine" | "ZoomSlider" | "ZoomToExtent" | "Zoom" | "Geolocation" | "LoadingIndicator";
|
|
103
|
+
export type ControlDictionary = {
|
|
104
|
+
[key in ControlType]?: object;
|
|
105
|
+
};
|
|
106
|
+
export type AttributionLike = import("ol/source/Source").AttributionLike | string | Array<string>;
|
|
107
|
+
export type ProjectionLike = import("ol/proj").ProjectionLike;
|
|
108
|
+
export type FlatGeoBufOptions = {
|
|
109
|
+
url: string;
|
|
110
|
+
attributions?: import("ol/source/Source").AttributionLike;
|
|
111
|
+
wrapX?: boolean;
|
|
112
|
+
};
|
|
113
|
+
export type WMTSCapabilitiesOptions = {
|
|
114
|
+
url: string;
|
|
115
|
+
layer: string;
|
|
116
|
+
attributions?: import("ol/source/Source").AttributionLike;
|
|
117
|
+
attributionsCollapsible?: boolean;
|
|
118
|
+
cacheSize?: number;
|
|
119
|
+
crossOrigin?: null | string;
|
|
120
|
+
interpolate?: boolean;
|
|
121
|
+
projection?: import("ol/proj").ProjectionLike;
|
|
122
|
+
transition?: number;
|
|
123
|
+
key?: string;
|
|
124
|
+
tilePixelRatio?: number;
|
|
125
|
+
zDirection?: number;
|
|
126
|
+
wrapX?: boolean;
|
|
127
|
+
dimensions: object;
|
|
128
|
+
version: string;
|
|
129
|
+
};
|
|
130
|
+
export type HTMLElementEvent<T extends HTMLElement> = Event & {
|
|
131
|
+
target: T;
|
|
132
|
+
};
|
|
133
|
+
export type EOxAnimationOptions = import("ol/View").AnimationOptions & import("ol/View").FitOptions;
|
|
134
|
+
export type ConfigObject = {
|
|
135
|
+
controls: ControlDictionary;
|
|
136
|
+
layers: Array<EoxLayer>;
|
|
137
|
+
view: {
|
|
138
|
+
center: Array<number>;
|
|
139
|
+
zoom: number;
|
|
140
|
+
zoomExtent?: import("ol/extent").Extent;
|
|
141
|
+
projection?: ProjectionLike;
|
|
142
|
+
};
|
|
143
|
+
preventScroll: boolean;
|
|
144
|
+
animationOptions?: EOxAnimationOptions;
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../map/types.ts"],"names":[],"mappings":"A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M,gBAAgB,CAAC,CAAC,SAAS,WAAW,IAAI,KAAK,GAAG;IAC5D,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,SAAS,EAAE,gBAAgB,GAClE,OAAO,SAAS,EAAE,UAAU,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,IAAI,EAAE;QACJ,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,OAAO,WAAW,EAAE,MAAM,CAAC;QACxC,UAAU,CAAC,EAAE,cAAc,CAAC;KAC7B,CAAC;IACF,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;CACxC,CAAC"}
|
package/test/_mockMap.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
class MockLayer {
|
|
2
|
-
constructor(layer) {
|
|
3
|
-
Object.keys(layer).forEach((k) => {
|
|
4
|
-
if (k === "properties") {
|
|
5
|
-
this.properties = {
|
|
6
|
-
...this.properties,
|
|
7
|
-
...layer.properties,
|
|
8
|
-
};
|
|
9
|
-
} else {
|
|
10
|
-
this[k] = layer[k];
|
|
11
|
-
}
|
|
12
|
-
if (layer.layers) {
|
|
13
|
-
this.layers = new MockCollection(layer.layers);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
get(prop) {
|
|
18
|
-
return this.properties[prop] || this[prop];
|
|
19
|
-
}
|
|
20
|
-
getLayers() {
|
|
21
|
-
return this.layers || new MockCollection([]);
|
|
22
|
-
}
|
|
23
|
-
getOpacity() {
|
|
24
|
-
return this.opacity;
|
|
25
|
-
}
|
|
26
|
-
getVisible() {
|
|
27
|
-
return this.visible;
|
|
28
|
-
}
|
|
29
|
-
layers;
|
|
30
|
-
opacity = 1;
|
|
31
|
-
properties = {
|
|
32
|
-
id: "foo",
|
|
33
|
-
title: "layer",
|
|
34
|
-
};
|
|
35
|
-
minZoom = -Infinity;
|
|
36
|
-
maxZoom = Infinity;
|
|
37
|
-
set(prop, value) {
|
|
38
|
-
this.properties[prop] = value;
|
|
39
|
-
}
|
|
40
|
-
setVisible(visible) {
|
|
41
|
-
this.visible = visible;
|
|
42
|
-
}
|
|
43
|
-
visible = true;
|
|
44
|
-
events = {
|
|
45
|
-
["change"]: () => undefined,
|
|
46
|
-
};
|
|
47
|
-
on = (event, fun) => (this.events = { [event]: fun });
|
|
48
|
-
un = (event, fun) => {
|
|
49
|
-
if (this.events[event] == fun) {
|
|
50
|
-
delete this.events[event];
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
class MockCollection {
|
|
56
|
-
constructor(layers) {
|
|
57
|
-
this.layers = layers.map((l) => new MockLayer(l));
|
|
58
|
-
setTimeout(() => {
|
|
59
|
-
this.events["change:length"]();
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
events = {
|
|
63
|
-
["change:length"]: () => undefined,
|
|
64
|
-
};
|
|
65
|
-
getArray = () => {
|
|
66
|
-
return this.layers;
|
|
67
|
-
};
|
|
68
|
-
layers = [];
|
|
69
|
-
on = (event, fun) => (this.events = { [event]: fun });
|
|
70
|
-
un = (event, fun) => {
|
|
71
|
-
if (this.events[event] == fun) {
|
|
72
|
-
delete this.events[event];
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
hasListener = (event) => event in this.events;
|
|
76
|
-
pop() {
|
|
77
|
-
this.layers.pop();
|
|
78
|
-
this.events["change:length"]();
|
|
79
|
-
}
|
|
80
|
-
push(newLayer) {
|
|
81
|
-
this.layers.push(new MockLayer(newLayer));
|
|
82
|
-
this.events["change:length"]();
|
|
83
|
-
}
|
|
84
|
-
remove(layer) {
|
|
85
|
-
layer = new MockLayer(layer);
|
|
86
|
-
const i = this.layers.indexOf(layer);
|
|
87
|
-
if (i) {
|
|
88
|
-
this.layers.splice(i, 1);
|
|
89
|
-
return layer;
|
|
90
|
-
} else {
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
removeAt(index) {
|
|
95
|
-
this.layers = [...this.layers.slice(index)];
|
|
96
|
-
}
|
|
97
|
-
insertAt(index, layer) {
|
|
98
|
-
layer = new MockLayer(layer);
|
|
99
|
-
this.layers = [
|
|
100
|
-
...this.layers.slice(0, index),
|
|
101
|
-
layer,
|
|
102
|
-
...this.layers.slice(index),
|
|
103
|
-
];
|
|
104
|
-
}
|
|
105
|
-
getLength() {
|
|
106
|
-
return this.layers.length;
|
|
107
|
-
}
|
|
108
|
-
forEach(func) {
|
|
109
|
-
this.layers.forEach(func);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export class MockMap extends HTMLElement {
|
|
114
|
-
constructor() {
|
|
115
|
-
super();
|
|
116
|
-
}
|
|
117
|
-
layers;
|
|
118
|
-
events = {
|
|
119
|
-
"change:resolution": [],
|
|
120
|
-
};
|
|
121
|
-
map = {
|
|
122
|
-
getInteractions: () => ({
|
|
123
|
-
getArray: () => [{}],
|
|
124
|
-
}),
|
|
125
|
-
getLayers: () => {
|
|
126
|
-
if (this.layers) {
|
|
127
|
-
return this.layers;
|
|
128
|
-
} else {
|
|
129
|
-
return new MockCollection([]);
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
getEvents: () => this.events,
|
|
133
|
-
getView: () => ({
|
|
134
|
-
getZoom: () => this.zoom,
|
|
135
|
-
on: (type, listener) => {
|
|
136
|
-
this.events = {
|
|
137
|
-
...this.events,
|
|
138
|
-
[type]: [...this.events[type], listener],
|
|
139
|
-
};
|
|
140
|
-
},
|
|
141
|
-
}),
|
|
142
|
-
};
|
|
143
|
-
zoom = 1;
|
|
144
|
-
setZoom = (z) => {
|
|
145
|
-
this.zoom = z;
|
|
146
|
-
};
|
|
147
|
-
addOrUpdateLayer = (json) => {
|
|
148
|
-
this.setLayers([json]);
|
|
149
|
-
};
|
|
150
|
-
setLayers = (layers) => {
|
|
151
|
-
this.layers = new MockCollection(layers.reverse());
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
customElements.define("mock-map", MockMap);
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import "color-legend-element";
|
|
2
|
-
|
|
3
|
-
export const checkLayerLegend = () => {
|
|
4
|
-
const legendLayer = {
|
|
5
|
-
properties: {
|
|
6
|
-
title: "Legend test",
|
|
7
|
-
layerLegend: {
|
|
8
|
-
title: "Legend title",
|
|
9
|
-
range: ["green", "red"],
|
|
10
|
-
domain: [0, 1],
|
|
11
|
-
ticks: 4,
|
|
12
|
-
tickValues: [0, 0.2, 0.4, 0.8],
|
|
13
|
-
width: 460,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
cy.get("eox-layercontrol").then(($el) => {
|
|
19
|
-
const layerControlEl = $el[0];
|
|
20
|
-
layerControlEl.tools = ["legend"];
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
cy.get("mock-map").then(($el) => {
|
|
24
|
-
// Accessing the mock map element
|
|
25
|
-
const mockMap = $el[0];
|
|
26
|
-
// Setting layers
|
|
27
|
-
mockMap.setLayers([legendLayer]);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
cy.get("eox-layercontrol")
|
|
31
|
-
.shadow()
|
|
32
|
-
.within(() => {
|
|
33
|
-
// check if the legend element exists
|
|
34
|
-
cy.get("color-legend")
|
|
35
|
-
.should("exist")
|
|
36
|
-
.shadow()
|
|
37
|
-
.within(() => {
|
|
38
|
-
// check if rendered legend title is equal to the configured title
|
|
39
|
-
cy.get("p.legend-title").then(($el) => {
|
|
40
|
-
expect($el[0].textContent).equal(
|
|
41
|
-
legendLayer.properties.layerLegend.title
|
|
42
|
-
);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// check if the image (grandient) is rendered
|
|
46
|
-
cy.get("image").should("exist");
|
|
47
|
-
|
|
48
|
-
// check if the numbers of ticks rendered are equal to the configured ticks
|
|
49
|
-
cy.get("line").then(($el) => {
|
|
50
|
-
expect($el.length).equals(legendLayer.properties.layerLegend.ticks);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// check if the rendered tick values are the same as the values configured
|
|
54
|
-
const stringTickValues =
|
|
55
|
-
legendLayer.properties.layerLegend.tickValues.map((val) =>
|
|
56
|
-
val.toFixed(1).toString()
|
|
57
|
-
);
|
|
58
|
-
cy.get("text").then(($el) => {
|
|
59
|
-
$el.each((_idx, el) => {
|
|
60
|
-
expect(stringTickValues).include(el.textContent);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default checkLayerLegend;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Function to check the rendered size and visibility of layers in the LayerControl
|
|
2
|
-
const checkLayerSize = () => {
|
|
3
|
-
// Set up the layers in the mock map - visibility: true, visibility: false
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers, one visible and one hidden
|
|
8
|
-
mockMap.setLayers([{ visible: true }, { visible: false }]);
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
// Verifying layer rendering in the LayerControl component
|
|
12
|
-
cy.get("eox-layercontrol")
|
|
13
|
-
.shadow()
|
|
14
|
-
.within(() => {
|
|
15
|
-
// Checking if the correct number of layers are rendered
|
|
16
|
-
cy.get(".layers").find("li").should("have.length", 2);
|
|
17
|
-
|
|
18
|
-
// Verifying the number of checked checkboxes (visible layers)
|
|
19
|
-
cy.get(".layers")
|
|
20
|
-
.find("input[type=checkbox]:checked")
|
|
21
|
-
.should("have.length", 1);
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default checkLayerSize;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Function to check if the layer tools section opens when 'layerControlToolsExpand' is true
|
|
2
|
-
const checkPreOpenLayerTools = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers: one visible and another with layerControlToolsExpand: true
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{ visible: true },
|
|
10
|
-
{
|
|
11
|
-
properties: { layerControlToolsExpand: true },
|
|
12
|
-
layers: [{ visible: true }],
|
|
13
|
-
},
|
|
14
|
-
]);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// Verify if the tools section opens within the LayerControl component
|
|
18
|
-
cy.get("eox-layercontrol")
|
|
19
|
-
.shadow()
|
|
20
|
-
.within(() => {
|
|
21
|
-
// Checking if the details tag with class 'tools' is visible (open)
|
|
22
|
-
cy.get("details[open].tools").should("be.visible");
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default checkPreOpenLayerTools;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Function to check if a section opens when 'layerControlExpand' is true
|
|
2
|
-
const checkPreOpenSection = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers: one visible and another with layerControlExpand: true
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{
|
|
10
|
-
properties: { layerControlExpand: undefined },
|
|
11
|
-
layers: [{ visible: true }],
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
properties: { layerControlExpand: true },
|
|
15
|
-
layers: [{ visible: true }],
|
|
16
|
-
},
|
|
17
|
-
]);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// Verify if the section opens within the LayerControl component
|
|
21
|
-
cy.get("eox-layercontrol")
|
|
22
|
-
.shadow()
|
|
23
|
-
.within(() => {
|
|
24
|
-
// Checking if a details tag (any open section) exists
|
|
25
|
-
cy.get("details[open]").should("have.length", 1);
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default checkPreOpenSection;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Function to simulate disabling the drag handle for a layer
|
|
2
|
-
const disableDrag = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers: one visible and another with layerControlDisable: true
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{ visible: true },
|
|
10
|
-
{ properties: { layerControlDisable: true } },
|
|
11
|
-
]);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Verify the effect on the LayerControl
|
|
15
|
-
cy.get("eox-layercontrol")
|
|
16
|
-
.shadow()
|
|
17
|
-
.within(() => {
|
|
18
|
-
// Clicking on the summary (representing the disabled layer)
|
|
19
|
-
cy.get(".tools summary").click({ multiple: true });
|
|
20
|
-
|
|
21
|
-
// Verifying the visibility of the drag handle
|
|
22
|
-
cy.get(".drag-handle.disabled").should("have.length", 1);
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default disableDrag;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Function to simulate "empty" groups within the LayerControl
|
|
2
|
-
const emptyGroup = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layer groups: one with visible layers and another one with hidden layers
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{
|
|
10
|
-
layers: [
|
|
11
|
-
{ properties: { layerControlHide: false } },
|
|
12
|
-
{ properties: { layerControlHide: false } },
|
|
13
|
-
],
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
layers: [
|
|
17
|
-
{ properties: { layerControlHide: true } },
|
|
18
|
-
{ properties: { layerControlHide: true } },
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
]);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// Verify the effect on the LayerControl
|
|
25
|
-
cy.get("eox-layercontrol")
|
|
26
|
-
.shadow()
|
|
27
|
-
.within(() => {
|
|
28
|
-
cy.get("summary").then(($els) => {
|
|
29
|
-
const control = $els[0];
|
|
30
|
-
const test = $els[6];
|
|
31
|
-
const checkDisplay = (el) =>
|
|
32
|
-
el.ownerDocument.defaultView
|
|
33
|
-
.getComputedStyle(el, "before")
|
|
34
|
-
.getPropertyValue("display");
|
|
35
|
-
expect(checkDisplay(control)).to.eq("block");
|
|
36
|
-
expect(checkDisplay(test)).to.eq("none");
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default emptyGroup;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Function to simulate exclusive layers and groups within the LayerControl
|
|
2
|
-
const exclusiveLayers = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers and a group with layerControlExclusive
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{ properties: { id: "a", layerControlExclusive: true }, visible: true },
|
|
10
|
-
{ properties: { id: "b", layerControlExclusive: true }, visible: false },
|
|
11
|
-
{
|
|
12
|
-
type: "Group",
|
|
13
|
-
properties: {
|
|
14
|
-
id: "c",
|
|
15
|
-
layerControlExclusive: true,
|
|
16
|
-
layerControlExpand: true,
|
|
17
|
-
},
|
|
18
|
-
layers: [{ properties: { id: "d", visible: true } }],
|
|
19
|
-
visible: false,
|
|
20
|
-
},
|
|
21
|
-
]);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// Verify the effect on the LayerControl
|
|
25
|
-
cy.get("eox-layercontrol")
|
|
26
|
-
.shadow()
|
|
27
|
-
.within(() => {
|
|
28
|
-
// Checking the number of checked radio inputs in the LayerControl
|
|
29
|
-
cy.get("ul").find("input[type=radio]:checked").should("have.length", 1);
|
|
30
|
-
cy.get("ul").find("input[type=radio]:not(:checked)").last().click();
|
|
31
|
-
cy.get("ul").find("input[type=radio]:checked").should("have.length", 1);
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export default exclusiveLayers;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Function to simulate hiding layers within the LayerControl
|
|
2
|
-
const hideLayers = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers: one visible and another marked with layerControlHide: true
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{ visible: true },
|
|
10
|
-
{ properties: { layerControlHide: true } },
|
|
11
|
-
]);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Verify the effect on the LayerControl
|
|
15
|
-
cy.get("eox-layercontrol")
|
|
16
|
-
.shadow()
|
|
17
|
-
.within(() => {
|
|
18
|
-
// Checking the number of list items in the LayerControl
|
|
19
|
-
cy.get("ul").find("li").should("have.length", 1);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default hideLayers;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as checkLayerSize } from "./check-layer-size";
|
|
2
|
-
export { default as checkPreOpenLayerTools } from "./check-pre-open-layer-tools";
|
|
3
|
-
export { default as checkLayerLegend } from "./check-layer-legend";
|
|
4
|
-
export { default as checkPreOpenSection } from "./check-pre-open-section";
|
|
5
|
-
export { default as disableDrag } from "./disable-drag";
|
|
6
|
-
export { default as exclusiveLayers } from "./exclusive-layers";
|
|
7
|
-
export { default as hideLayers } from "./hide-layers";
|
|
8
|
-
export { default as emptyGroup } from "./empty-groups";
|
|
9
|
-
export { default as renderOptionalLayer } from "./render-optional-layer";
|
|
10
|
-
export { default as showCorrectLayerTitle } from "./show-layer-title";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Function to simulate rendering an optional layer within the LayerControl
|
|
2
|
-
const renderOptionalLayer = () => {
|
|
3
|
-
// Set up the layers in the mock map
|
|
4
|
-
cy.get("mock-map").then(($el) => {
|
|
5
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
6
|
-
|
|
7
|
-
// Setting layers: one visible and another marked with layerControlOptional: true
|
|
8
|
-
mockMap.setLayers([
|
|
9
|
-
{ visible: true },
|
|
10
|
-
{ properties: { layerControlOptional: true } },
|
|
11
|
-
]);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
// Verify the effect on the LayerControl
|
|
15
|
-
cy.get("eox-layercontrol")
|
|
16
|
-
.shadow()
|
|
17
|
-
.within(() => {
|
|
18
|
-
// Checking for the existence of the optional layers dropdown
|
|
19
|
-
cy.get("[data-cy='optionalLayers']").should("exist");
|
|
20
|
-
|
|
21
|
-
// Verifying the presence of a selectable option in the dropdown
|
|
22
|
-
cy.get("[data-cy='optionalLayers']")
|
|
23
|
-
.find("option:not([disabled])")
|
|
24
|
-
.should("have.length", 1);
|
|
25
|
-
|
|
26
|
-
// Checking for the existence of a button related to the optional layers
|
|
27
|
-
cy.get("[data-cy='optionalLayers']").siblings("button").should("exist");
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default renderOptionalLayer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const showCorrectLayerTitle = () => {
|
|
2
|
-
// Set up the layers in the mock map
|
|
3
|
-
cy.get("mock-map").then(($el) => {
|
|
4
|
-
const mockMap = $el[0]; // Accessing the mock map element
|
|
5
|
-
|
|
6
|
-
// Setting titles for two layers
|
|
7
|
-
mockMap.setLayers([
|
|
8
|
-
{ properties: { title: "foo" } },
|
|
9
|
-
{ properties: { title: "bar" } },
|
|
10
|
-
]);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Verify the displayed titles in the LayerControl
|
|
14
|
-
cy.get("eox-layercontrol")
|
|
15
|
-
.shadow()
|
|
16
|
-
.within(() => {
|
|
17
|
-
// Check for the presence of titles within layers
|
|
18
|
-
cy.get(".layer").find(".title").contains("foo");
|
|
19
|
-
cy.get(".layer").find(".title").contains("bar");
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default showCorrectLayerTitle;
|