@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,44 @@
|
|
|
1
|
+
import { updateUrl } from "../../helpers";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This function 'dataChange' is designed to handle changes in data within a layer configuration.
|
|
5
|
+
* And creates a new a tileUrlFunction
|
|
6
|
+
*
|
|
7
|
+
* @param {{[key: string]: any}} data - The updated data to be applied to the layer.
|
|
8
|
+
* @param {Function} tileUrlFunc - The function generating the tile URL for the layer.
|
|
9
|
+
* @param {import("../../components/layer-config").EOxLayerControlLayerConfig} EOxLayerControlLayerConfig - Instance of EOxLayerControlLayer.
|
|
10
|
+
* @return {Function} - New function generating the tile URL for the layer.
|
|
11
|
+
*/
|
|
12
|
+
const dataChangeMethod = (data, tileUrlFunc, EOxLayerControlLayerConfig) => {
|
|
13
|
+
let newTileUrlFunc = tileUrlFunc; // Placeholder for the updated tile URL function.
|
|
14
|
+
|
|
15
|
+
// Checking if the layer's tile URL function exists.
|
|
16
|
+
// If it does, set 'newTileUrlFunc' to the layer's tile URL function.
|
|
17
|
+
// This step ensures the original tile URL function is preserved if 'tileUrlFunc' is not provided.
|
|
18
|
+
// @ts-expect-error TODO
|
|
19
|
+
if (EOxLayerControlLayerConfig.layer.getSource().getTileUrlFunction()) {
|
|
20
|
+
if (!newTileUrlFunc) {
|
|
21
|
+
newTileUrlFunc = EOxLayerControlLayerConfig.layer
|
|
22
|
+
.getSource()
|
|
23
|
+
// @ts-expect-error TODO
|
|
24
|
+
.getTileUrlFunction();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Setting a new tile URL function for the layer's source by applying updated data to the existing function.
|
|
28
|
+
EOxLayerControlLayerConfig.layer
|
|
29
|
+
.getSource()
|
|
30
|
+
// @ts-expect-error TODO
|
|
31
|
+
.setTileUrlFunction((...args) =>
|
|
32
|
+
updateUrl(newTileUrlFunc(...args), data),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
// TODO: It's not advisable to access protected methods directly.
|
|
36
|
+
// Setting a new key for the layer source to trigger a refresh.
|
|
37
|
+
// @ts-expect-error TODO
|
|
38
|
+
EOxLayerControlLayerConfig.layer.getSource().setKey(new Date());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return newTileUrlFunc;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default dataChangeMethod;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Importing methods from respective files and exporting them
|
|
2
|
+
|
|
3
|
+
export { default as dataChangeMethod } from "./data-change"; // Handles data change with help of new tile url function
|
|
4
|
+
export {
|
|
5
|
+
default as applyUpdatedStyles,
|
|
6
|
+
flattenObject,
|
|
7
|
+
} from "./apply-updated-styles"; // Extracts values of layer styles variables from the jsonform output
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Importing helper functions from the 'helpers' directory
|
|
2
|
+
import { checkProperties, createSortable } from "../../helpers";
|
|
3
|
+
import _debounce from "lodash.debounce";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Handles initial settings and event triggers upon the component's first update.
|
|
7
|
+
* Handles updating and triggering events when the layers change length upon component update.
|
|
8
|
+
*
|
|
9
|
+
* @param {import("../../components/layer-list").EOxLayerControlLayerList} EOxLayerControlLayerList - The EOxLayerControlLayerList object containing layers.
|
|
10
|
+
*/
|
|
11
|
+
const firstUpdatedMethod = (EOxLayerControlLayerList) => {
|
|
12
|
+
// Destructuring properties from the EOxLayerControlLayerList object
|
|
13
|
+
const { layers, idProperty, titleProperty, renderRoot } =
|
|
14
|
+
EOxLayerControlLayerList;
|
|
15
|
+
|
|
16
|
+
// Debounced function for handling changes in layers' length
|
|
17
|
+
const debHandleLayersChangeLength = _debounce(() => {
|
|
18
|
+
EOxLayerControlLayerList.requestUpdate();
|
|
19
|
+
EOxLayerControlLayerList.dispatchEvent(
|
|
20
|
+
new CustomEvent("changed", { bubbles: true }),
|
|
21
|
+
);
|
|
22
|
+
}, 50);
|
|
23
|
+
|
|
24
|
+
// Function to handle changes in layers' length
|
|
25
|
+
const handleLayersChangeLength = () => debHandleLayersChangeLength();
|
|
26
|
+
|
|
27
|
+
// If layers do not exist, exit the function
|
|
28
|
+
if (!layers) return;
|
|
29
|
+
|
|
30
|
+
// Unregister previous listeners to prevent duplicates
|
|
31
|
+
if (layers.hasListener("change:length"))
|
|
32
|
+
layers?.un("change:length", handleLayersChangeLength);
|
|
33
|
+
|
|
34
|
+
// Register a listener for changes in the layers' length
|
|
35
|
+
layers.on("change:length", handleLayersChangeLength);
|
|
36
|
+
|
|
37
|
+
// Checking if layers exist
|
|
38
|
+
if (layers) {
|
|
39
|
+
// Selecting the unordered list element from the renderRoot
|
|
40
|
+
const element = renderRoot.querySelector("ul");
|
|
41
|
+
|
|
42
|
+
// Checking properties of the layers
|
|
43
|
+
checkProperties(
|
|
44
|
+
layers,
|
|
45
|
+
idProperty,
|
|
46
|
+
titleProperty,
|
|
47
|
+
EOxLayerControlLayerList,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// Creating a sortable list using helper function createSortable
|
|
51
|
+
createSortable(element, layers, idProperty, EOxLayerControlLayerList);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default firstUpdatedMethod;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getElement } from "@eox/elements-utils";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Retrieves the EOxMap element based on the provided selector in EOxLayerControl's 'for' property.
|
|
5
|
+
* Updates the EOxLayerControl's map property based on the target element's map.
|
|
6
|
+
*
|
|
7
|
+
* @param {import("../../main").EOxLayerControl} EOxLayerControl - The EOxLayerControl element.
|
|
8
|
+
* @returns {import("@eox/map/main").EOxMap | null} The EOxMap element or null if not found.
|
|
9
|
+
*/
|
|
10
|
+
const firstUpdatedMethod = (EOxLayerControl) => {
|
|
11
|
+
const foundElement = getElement(EOxLayerControl.for);
|
|
12
|
+
|
|
13
|
+
// Check if the element exists and its map property differs from EOxLayerControl.map
|
|
14
|
+
if (foundElement && foundElement.map !== EOxLayerControl.map) {
|
|
15
|
+
// Update the EOxLayerControl's map property
|
|
16
|
+
EOxLayerControl.map = foundElement.map;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return foundElement;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default firstUpdatedMethod;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Importing methods from respective files and exporting them
|
|
2
|
+
|
|
3
|
+
export { default as layerListChangeMethod } from "./layer-list-change"; // Handles changes in the layer list within the EOxLayerControl component.
|
|
4
|
+
export { default as firstUpdatedMethod } from "./first-update"; // Initial settings and event triggers upon the component's first update.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Triggers an update request for the EOxLayerControl and optional list elements upon a layer list change event.
|
|
3
|
+
*
|
|
4
|
+
* @param {CustomEvent & { target: Element }} evt - The custom event containing the target element.
|
|
5
|
+
* @param {import("../../main").EOxLayerControl} EOxLayerControl - The EOxLayerControl element.
|
|
6
|
+
*/
|
|
7
|
+
const layerListChangeMethod = (evt, EOxLayerControl) => {
|
|
8
|
+
// Request an update for the EOxLayerControl
|
|
9
|
+
EOxLayerControl.requestUpdate();
|
|
10
|
+
|
|
11
|
+
// Check if the event target matches the specified element tag
|
|
12
|
+
if (evt.target.tagName === "EOX-LAYERCONTROL-LAYER-TOOLS") {
|
|
13
|
+
const optionalListEl = EOxLayerControl.renderRoot.querySelector(
|
|
14
|
+
"eox-layercontrol-optional-list",
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// Request an update for the optional list element if found
|
|
18
|
+
/** * @type {Element & { requestUpdate: function }} */
|
|
19
|
+
(optionalListEl)?.requestUpdate();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default layerListChangeMethod;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { filterLayers } from "../../helpers";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Adds the selected layer to the optional list in the layer control.
|
|
5
|
+
*
|
|
6
|
+
* @param {import("../../components/optional-list").EOxLayerControlOptionalList} EOxLayerControlOptionalList - The optional list component.
|
|
7
|
+
*/
|
|
8
|
+
const addToListMethod = (EOxLayerControlOptionalList) => {
|
|
9
|
+
// Get the selected layer based on the value from the dropdown
|
|
10
|
+
/** @type HTMLInputElement*/
|
|
11
|
+
const optionalSelect = EOxLayerControlOptionalList.querySelector(
|
|
12
|
+
"select[name=optional]",
|
|
13
|
+
);
|
|
14
|
+
const selectedValue = optionalSelect ? optionalSelect.value : null;
|
|
15
|
+
|
|
16
|
+
const selectedLayer = filterLayers(
|
|
17
|
+
EOxLayerControlOptionalList.layers.getArray(),
|
|
18
|
+
"layerControlOptional",
|
|
19
|
+
true,
|
|
20
|
+
).find(
|
|
21
|
+
(layer) =>
|
|
22
|
+
// @ts-expect-error TODO
|
|
23
|
+
(layer.get(EOxLayerControlOptionalList.idProperty) || layer.ol_uid) ===
|
|
24
|
+
selectedValue,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Update visibility and dispatch 'changed' event
|
|
28
|
+
selectedLayer?.set("layerControlOptional", false);
|
|
29
|
+
selectedLayer?.setVisible(true);
|
|
30
|
+
EOxLayerControlOptionalList.dispatchEvent(
|
|
31
|
+
new CustomEvent("changed", { bubbles: true }),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Update related components
|
|
35
|
+
EOxLayerControlOptionalList.renderRoot.parentNode
|
|
36
|
+
.querySelectorAll("eox-layercontrol-layer-list")
|
|
37
|
+
.forEach((layerList) =>
|
|
38
|
+
/** @type {import("lit").LitElement} */ (layerList).requestUpdate(),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
EOxLayerControlOptionalList.requestUpdate();
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default addToListMethod;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EOxLayerControlAddLayers is a class that extends LitElement and provides functionalities
|
|
3
|
+
* for managing layers on an OpenLayers map within an EOxMap context.
|
|
4
|
+
* It allows users to add WMS or XYZ layers to the map using URLs or JSON data.
|
|
5
|
+
* The class provides input fields to handle URLs and JSON, along with methods
|
|
6
|
+
* to validate and process the input for adding layers dynamically to the map.
|
|
7
|
+
*
|
|
8
|
+
* @element eox-layercontrol-add-layers
|
|
9
|
+
* @extends LitElement
|
|
10
|
+
*/
|
|
11
|
+
export class EOxLayerControlAddLayers extends LitElement {
|
|
12
|
+
static properties: {
|
|
13
|
+
eoxMap: {
|
|
14
|
+
attribute: boolean;
|
|
15
|
+
state: boolean;
|
|
16
|
+
};
|
|
17
|
+
unstyled: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
};
|
|
20
|
+
noShadow: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* State for URL Input for WMS/XYZ URLs
|
|
26
|
+
*
|
|
27
|
+
* @type {String}
|
|
28
|
+
*/
|
|
29
|
+
urlInput: string;
|
|
30
|
+
/**
|
|
31
|
+
* State for JSON Textarea - For EOxMap JSON
|
|
32
|
+
*
|
|
33
|
+
* @type {String}
|
|
34
|
+
*/
|
|
35
|
+
jsonInput: string;
|
|
36
|
+
/**
|
|
37
|
+
* State for add layer - consist of url/json
|
|
38
|
+
*
|
|
39
|
+
* @type {"url" | "json" | null}
|
|
40
|
+
*/
|
|
41
|
+
open: "url" | "json" | null;
|
|
42
|
+
/**
|
|
43
|
+
* Loader state when search is triggered
|
|
44
|
+
*
|
|
45
|
+
* @type {Boolean}
|
|
46
|
+
*/
|
|
47
|
+
searchLoad: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* State for `WMS Capabilities JSON`
|
|
50
|
+
*
|
|
51
|
+
* @type {import("wms-capabilities").WMSCapabilitiesJSON}
|
|
52
|
+
*/
|
|
53
|
+
wmsCapabilities: import("wms-capabilities").WMSCapabilitiesJSON;
|
|
54
|
+
/**
|
|
55
|
+
* Instance of `eox-map` which is a wrapper for the OL
|
|
56
|
+
*
|
|
57
|
+
* @type {import("@eox/map/main").EOxMap}
|
|
58
|
+
*/
|
|
59
|
+
eoxMap: any;
|
|
60
|
+
/**
|
|
61
|
+
* Render the element without additional styles
|
|
62
|
+
*
|
|
63
|
+
* @type {Boolean}
|
|
64
|
+
*/
|
|
65
|
+
unstyled: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Renders the element without a shadow root
|
|
68
|
+
*
|
|
69
|
+
* @type {Boolean}
|
|
70
|
+
*/
|
|
71
|
+
noShadow: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Renders the EOx Layer Control component with tabbed interface for URL and JSON.
|
|
74
|
+
* Handles input fields, search, and addition of layers.
|
|
75
|
+
*/
|
|
76
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
77
|
+
#private;
|
|
78
|
+
}
|
|
79
|
+
import { LitElement } from "lit";
|
|
80
|
+
//# sourceMappingURL=add-layers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-layers.d.ts","sourceRoot":"","sources":["../../../../src/components/add-layers.js"],"names":[],"mappings":"AAaA;;;;;;;;;GASG;AACH;IAEE;;;;;;;;;;;MAIE;IAEF;;;;OAIG;IACH,iBAAgB;IAEhB;;;;OAIG;IACH,kBAAiB;IAEjB;;;;OAIG;IACH,MAFU,KAAK,GAAG,MAAM,GAAG,IAAI,CAEnB;IAEZ;;;;OAIG;IACH,oBAAmB;IAEnB;;;;OAIG;IACH,iBAFU,OAAO,kBAAkB,EAAE,mBAAmB,CAEjC;IAKrB;;;;OAIG;IACH,YAAkB;IAElB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAiEvB;;;OAGG;IACH,+CAgHC;;CAgJF;2BA7ZyC,KAAK"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `EOxLayerControlLayerConfig` is a component that handles configuration options for layers using eox-jsonform.
|
|
3
|
+
* It allows users to input data, modify layer settings, and update the UI based on those settings.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @element eox-layercontrol-layerconfig
|
|
7
|
+
* @extends LitElement
|
|
8
|
+
*/
|
|
9
|
+
export class EOxLayerControlLayerConfig extends LitElement {
|
|
10
|
+
static properties: {
|
|
11
|
+
layer: {
|
|
12
|
+
attribute: boolean;
|
|
13
|
+
};
|
|
14
|
+
unstyled: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
};
|
|
17
|
+
noShadow: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
};
|
|
20
|
+
layerConfig: {
|
|
21
|
+
attribute: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The native OL layer
|
|
26
|
+
*
|
|
27
|
+
* @type {import("ol/layer").Layer}
|
|
28
|
+
* @see {@link https://openlayers.org/en/latest/apidoc/module-ol_layer_Layer-Layer.html}
|
|
29
|
+
*/
|
|
30
|
+
layer: import("ol/layer").Layer;
|
|
31
|
+
/**
|
|
32
|
+
* Render the element without additional styles
|
|
33
|
+
*
|
|
34
|
+
* @type {Boolean}
|
|
35
|
+
*/
|
|
36
|
+
unstyled: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Renders the element without a shadow root
|
|
39
|
+
*
|
|
40
|
+
* @type {Boolean}
|
|
41
|
+
*/
|
|
42
|
+
noShadow: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Layer config for eox-jsonform
|
|
45
|
+
*
|
|
46
|
+
* @type {{
|
|
47
|
+
* schema: Record<string,any>;
|
|
48
|
+
* element: string;
|
|
49
|
+
* type?:"tileUrl"|"style";
|
|
50
|
+
* style?:import("ol/layer/WebGLTile").Style
|
|
51
|
+
* legend?: Partial<import("./layer-legend").LegendConfig> & {
|
|
52
|
+
* range:string[];
|
|
53
|
+
* domainProperties:string[]
|
|
54
|
+
* }
|
|
55
|
+
* }}
|
|
56
|
+
*/
|
|
57
|
+
layerConfig: {
|
|
58
|
+
schema: Record<string, any>;
|
|
59
|
+
element: string;
|
|
60
|
+
type?: "tileUrl" | "style";
|
|
61
|
+
style?: import("ol/layer/WebGLTile").Style;
|
|
62
|
+
legend?: Partial<import("./layer-legend").LegendConfig> & {
|
|
63
|
+
range: string[];
|
|
64
|
+
domainProperties: string[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Throttle #handleDataChange() by 1000 milliseconds
|
|
69
|
+
*/
|
|
70
|
+
throttleDataChange: import("lodash").DebouncedFuncLeading<(e: {
|
|
71
|
+
detail: {
|
|
72
|
+
value: string;
|
|
73
|
+
};
|
|
74
|
+
}) => void>;
|
|
75
|
+
/**
|
|
76
|
+
* Renders a JSON form for configuration options of a layer.
|
|
77
|
+
*/
|
|
78
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
79
|
+
#private;
|
|
80
|
+
}
|
|
81
|
+
import { LitElement } from "lit";
|
|
82
|
+
//# sourceMappingURL=layer-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-config.d.ts","sourceRoot":"","sources":["../../../../src/components/layer-config.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH;IAEE;;;;;;;;;;;;;MAKE;IA0BA;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;;;;;;;;;;OAaG;IACH,aAXU;QACT,MAAS,EAAE,OAAO,MAAM,EAAC,GAAG,CAAC,CAAC;QAC9B,OAAU,EAAE,MAAM,CAAC;QACnB,IAAO,CAAC,EAAC,SAAS,GAAC,OAAO,CAAC;QAC3B,KAAQ,CAAC,EAAC,OAAO,oBAAoB,EAAE,KAAK,CAAA;QAC5C,MAAS,CAAC,EAAE,QAAQ,OAAO,gBAAgB,EAAE,YAAY,CAAC,GAAG;YAC7D,KAAW,EAAC,MAAM,EAAE,CAAC;YACrB,gBAAsB,EAAC,MAAM,EAAE,CAAA;SACzB,CAAA;KACF,CAEkB;IAEvB;;OAEG;IACH,8DAqBW;QAAE,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;SAAE,CAAC;KAAE,WArBuB;IAsDnE;;OAEG;IACH,+CAgDC;;CAYF;2BA9MqC,KAAK"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `EOxLayerControlLayerDatetime` is a component that handles date time options for layers using eox-timecontrol.
|
|
3
|
+
* It triggers an event of the currently selected datetime value; allowing users to show and update a specific layer for a specific time.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @element eox-layercontrol-layer-datetime
|
|
7
|
+
* @extends LitElement
|
|
8
|
+
*/
|
|
9
|
+
export class EOxLayerControlLayerDatetime extends LitElement {
|
|
10
|
+
static properties: {
|
|
11
|
+
unstyled: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
};
|
|
14
|
+
noShadow: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
};
|
|
17
|
+
layerDatetime: {
|
|
18
|
+
attribute: boolean;
|
|
19
|
+
};
|
|
20
|
+
layer: {
|
|
21
|
+
attribute: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Render the element without additional styles
|
|
26
|
+
*
|
|
27
|
+
* @type {Boolean}
|
|
28
|
+
*/
|
|
29
|
+
unstyled: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Renders the element without a shadow root
|
|
32
|
+
*
|
|
33
|
+
* @type {Boolean}
|
|
34
|
+
*/
|
|
35
|
+
noShadow: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Layer config for eox-jsonform
|
|
38
|
+
*
|
|
39
|
+
* @type {{
|
|
40
|
+
* disablePlay?: boolean;
|
|
41
|
+
* slider?: boolean;
|
|
42
|
+
* currentStep: string|number;
|
|
43
|
+
* controlValues: (string|number)[]
|
|
44
|
+
* }}
|
|
45
|
+
*/
|
|
46
|
+
layerDatetime: {
|
|
47
|
+
disablePlay?: boolean;
|
|
48
|
+
slider?: boolean;
|
|
49
|
+
currentStep: string | number;
|
|
50
|
+
controlValues: (string | number)[];
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The native OL layer
|
|
54
|
+
*
|
|
55
|
+
* @type {import("ol/layer").Layer}
|
|
56
|
+
* @see {@link https://openlayers.org/en/latest/apidoc/module-ol_layer_Layer-Layer.html}
|
|
57
|
+
*/
|
|
58
|
+
layer: import("ol/layer").Layer;
|
|
59
|
+
/**
|
|
60
|
+
* Renders a Time Control for datetime options of a layer.
|
|
61
|
+
*/
|
|
62
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
63
|
+
#private;
|
|
64
|
+
}
|
|
65
|
+
import { LitElement } from "lit";
|
|
66
|
+
//# sourceMappingURL=layer-datetime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-datetime.d.ts","sourceRoot":"","sources":["../../../../src/components/layer-datetime.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH;IAEE;;;;;;;;;;;;;MAKE;IAKA;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;;;;;;OASG;IACH,eAPU;QACT,WAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,MAAU,CAAC,EAAE,OAAO,CAAC;QACrB,WAAe,EAAE,MAAM,GAAC,MAAM,CAAC;QAC/B,aAAiB,EAAE,CAAC,MAAM,GAAC,MAAM,CAAC,EAAE,CAAA;KACjC,CAEqB;IAEzB;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IA+BnB;;OAEG;IACH,+CA6BC;;CAIF;2BA1HgC,KAAK"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom element representing a group of layers within a layer control.
|
|
3
|
+
* Handles rendering a layer control group with expandable details containing layers.
|
|
4
|
+
*
|
|
5
|
+
* @element eox-layercontrol-layer-group
|
|
6
|
+
* @extends LitElement
|
|
7
|
+
*/
|
|
8
|
+
export class EOxLayerControlLayerGroup extends LitElement {
|
|
9
|
+
static properties: {
|
|
10
|
+
group: {
|
|
11
|
+
attribute: boolean;
|
|
12
|
+
};
|
|
13
|
+
idProperty: {
|
|
14
|
+
attribute: string;
|
|
15
|
+
};
|
|
16
|
+
map: {
|
|
17
|
+
attribute: boolean;
|
|
18
|
+
state: boolean;
|
|
19
|
+
};
|
|
20
|
+
titleProperty: {
|
|
21
|
+
attribute: string;
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
};
|
|
24
|
+
showLayerZoomState: {
|
|
25
|
+
attribute: string;
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
};
|
|
28
|
+
tools: {
|
|
29
|
+
attribute: boolean;
|
|
30
|
+
};
|
|
31
|
+
unstyled: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
};
|
|
34
|
+
noShadow: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
};
|
|
37
|
+
toolsAsList: {
|
|
38
|
+
type: BooleanConstructor;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The native OL layer group
|
|
43
|
+
*
|
|
44
|
+
* @type {import("ol/layer").Group}
|
|
45
|
+
* @see {@link https://openlayers.org/en/latest/apidoc/module-ol_layer_Group-LayerGroup.html}
|
|
46
|
+
*/
|
|
47
|
+
group: import("ol/layer").Group;
|
|
48
|
+
/**
|
|
49
|
+
* The layer id property
|
|
50
|
+
*
|
|
51
|
+
* @type {String}
|
|
52
|
+
*/
|
|
53
|
+
idProperty: string;
|
|
54
|
+
/**
|
|
55
|
+
* The native OL map
|
|
56
|
+
* @type {import("ol").Map}
|
|
57
|
+
* @see {@link https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html}
|
|
58
|
+
*/
|
|
59
|
+
map: import("ol").Map;
|
|
60
|
+
/**
|
|
61
|
+
* The layer title property
|
|
62
|
+
*
|
|
63
|
+
* @type {String}
|
|
64
|
+
*/
|
|
65
|
+
titleProperty: string;
|
|
66
|
+
/**
|
|
67
|
+
* Show layer state based on zoom level or not
|
|
68
|
+
*
|
|
69
|
+
* @type {Boolean}
|
|
70
|
+
*/
|
|
71
|
+
showLayerZoomState: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Represents an array of tools.
|
|
74
|
+
*
|
|
75
|
+
* @type {Array<string>}
|
|
76
|
+
*/
|
|
77
|
+
tools: Array<string>;
|
|
78
|
+
/**
|
|
79
|
+
* Render the element without additional styles
|
|
80
|
+
*
|
|
81
|
+
* @type {Boolean}
|
|
82
|
+
*/
|
|
83
|
+
unstyled: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Renders the element without a shadow root
|
|
86
|
+
*
|
|
87
|
+
* @type {Boolean}
|
|
88
|
+
*/
|
|
89
|
+
noShadow: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* If enabled, the tools section will be rendered as list.
|
|
92
|
+
*
|
|
93
|
+
* @type {Boolean}
|
|
94
|
+
*/
|
|
95
|
+
toolsAsList: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Renders a layer control group with expandable details containing layers.
|
|
98
|
+
*/
|
|
99
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
100
|
+
#private;
|
|
101
|
+
}
|
|
102
|
+
import { LitElement } from "lit";
|
|
103
|
+
//# sourceMappingURL=layer-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-group.d.ts","sourceRoot":"","sources":["../../../../src/components/layer-group.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAUE;IAKA;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,mBAAsB;IAEtB;;;;OAIG;IACH,KAHU,OAAO,IAAI,EAAE,GAAG,CAGX;IAEf;;;;OAIG;IACH,sBAA4B;IAE5B;;;;OAIG;IACH,4BAA+B;IAE/B;;;;OAIG;IACH,OAFU,MAAM,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAY1B;;OAEG;IACH,+CAoDC;;CA4BF;2BA3LyC,KAAK"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legend configurations
|
|
3
|
+
*
|
|
4
|
+
* @typedef {{
|
|
5
|
+
* domain:import("color-legend-element").ColorLegendElement["domain"]
|
|
6
|
+
* width?:number;
|
|
7
|
+
* range:string[];
|
|
8
|
+
* title?:string;
|
|
9
|
+
* tickFormat?:import("color-legend-element").ColorLegendElement["tickFormat"]
|
|
10
|
+
* ticks?:import("color-legend-element").ColorLegendElement["ticks"]
|
|
11
|
+
* tickValues?:import("color-legend-element").ColorLegendElement["tickValues"]
|
|
12
|
+
* scaleType?:import("color-legend-element").ColorLegendElement["scaleType"]
|
|
13
|
+
* markType?:import("color-legend-element").ColorLegendElement["markType"]
|
|
14
|
+
* }} LegendConfig
|
|
15
|
+
**/
|
|
16
|
+
/**
|
|
17
|
+
* `EOxLayerControlLayerLegend` is a component that handles creating a legend from a range of colors & the domain of the color values.
|
|
18
|
+
*
|
|
19
|
+
* @element eox-layercontrol-layer-datetime
|
|
20
|
+
* @extends LitElement
|
|
21
|
+
*/
|
|
22
|
+
export class EOxLayerControlLayerLegend extends LitElement {
|
|
23
|
+
static properties: {
|
|
24
|
+
unstyled: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
};
|
|
27
|
+
noShadow: {
|
|
28
|
+
type: BooleanConstructor;
|
|
29
|
+
};
|
|
30
|
+
layerLegend: {
|
|
31
|
+
attribute: boolean;
|
|
32
|
+
};
|
|
33
|
+
layer: {
|
|
34
|
+
attribute: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Render the element without additional styles
|
|
39
|
+
*
|
|
40
|
+
* @type {Boolean}
|
|
41
|
+
*/
|
|
42
|
+
unstyled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Renders the element without a shadow root
|
|
45
|
+
*
|
|
46
|
+
* @type {Boolean}
|
|
47
|
+
*/
|
|
48
|
+
noShadow: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Legend configurations
|
|
51
|
+
* @type {LegendConfig}
|
|
52
|
+
* @see {@link https://clhenrick.github.io/color-legend-element/}
|
|
53
|
+
*/
|
|
54
|
+
layerLegend: LegendConfig;
|
|
55
|
+
/**
|
|
56
|
+
* The native OL layer
|
|
57
|
+
*
|
|
58
|
+
* @type {import("ol/layer").Layer}
|
|
59
|
+
* @see {@link https://openlayers.org/en/latest/apidoc/module-ol_layer_Layer-Layer.html}
|
|
60
|
+
*/
|
|
61
|
+
layer: import("ol/layer").Layer;
|
|
62
|
+
/**
|
|
63
|
+
* Renders a Time Control for datetime options of a layer.
|
|
64
|
+
*/
|
|
65
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
66
|
+
#private;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Legend configurations
|
|
70
|
+
*/
|
|
71
|
+
export type LegendConfig = {
|
|
72
|
+
domain: import("color-legend-element").ColorLegendElement["domain"];
|
|
73
|
+
width?: number;
|
|
74
|
+
range: string[];
|
|
75
|
+
title?: string;
|
|
76
|
+
tickFormat?: import("color-legend-element").ColorLegendElement["tickFormat"];
|
|
77
|
+
ticks?: import("color-legend-element").ColorLegendElement["ticks"];
|
|
78
|
+
tickValues?: import("color-legend-element").ColorLegendElement["tickValues"];
|
|
79
|
+
scaleType?: import("color-legend-element").ColorLegendElement["scaleType"];
|
|
80
|
+
markType?: import("color-legend-element").ColorLegendElement["markType"];
|
|
81
|
+
};
|
|
82
|
+
import { LitElement } from "lit";
|
|
83
|
+
//# sourceMappingURL=layer-legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-legend.d.ts","sourceRoot":"","sources":["../../../../src/components/layer-legend.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;IAcI;AAEJ;;;;;GAKG;AACH;IAEE;;;;;;;;;;;;;MAKE;IAKA;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,aAHU,YAAY,CAGC;IAEvB;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAUnB;;OAEG;IACH,+CAkCC;;CAiBF;;;;2BA1HY;IACZ,MAAU,EAAC,OAAO,sBAAsB,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACtE,KAAS,CAAC,EAAC,MAAM,CAAC;IAClB,KAAS,EAAC,MAAM,EAAE,CAAC;IACnB,KAAS,CAAC,EAAC,MAAM,CAAC;IAClB,UAAc,CAAC,EAAC,OAAO,sBAAsB,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAA;IAC/E,KAAS,CAAC,EAAC,OAAO,sBAAsB,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAA;IACrE,UAAc,CAAC,EAAC,OAAO,sBAAsB,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAA;IAC/E,SAAa,CAAC,EAAC,OAAO,sBAAsB,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAA;IAC7E,QAAY,CAAC,EAAC,OAAO,sBAAsB,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAA;CACxE;2BAjBkC,KAAK"}
|