@eox/layercontrol 1.7.0 → 1.8.1

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.
Files changed (36) hide show
  1. package/dist/eox-layercontrol.js +502 -431
  2. package/dist/eox-layercontrol.umd.cjs +48 -41
  3. package/package.json +5 -4
  4. package/src/components/layer-config.js +12 -2
  5. package/src/components/layer-group.js +4 -0
  6. package/src/components/layer-list.js +4 -0
  7. package/src/components/layer-tools.js +9 -0
  8. package/src/components/layer.js +9 -0
  9. package/src/enums/index.js +3 -0
  10. package/src/enums/stories/assets/colormaps.json +50 -0
  11. package/src/enums/stories/index.js +179 -6
  12. package/src/helpers/get-legend-config.js +30 -14
  13. package/src/helpers/get-start-vals.js +123 -42
  14. package/src/main.js +3 -0
  15. package/src/methods/layer-config/data-change.js +42 -31
  16. package/types/components/layer-config.d.ts +12 -0
  17. package/types/components/layer-config.d.ts.map +1 -1
  18. package/types/components/layer-group.d.ts +5 -0
  19. package/types/components/layer-group.d.ts.map +1 -1
  20. package/types/components/layer-list.d.ts +5 -0
  21. package/types/components/layer-list.d.ts.map +1 -1
  22. package/types/components/layer-tools.d.ts +10 -0
  23. package/types/components/layer-tools.d.ts.map +1 -1
  24. package/types/components/layer.d.ts +10 -0
  25. package/types/components/layer.d.ts.map +1 -1
  26. package/types/enums/index.d.ts +1 -1
  27. package/types/enums/stories/index.d.ts +442 -176
  28. package/types/enums/stories/index.d.ts.map +1 -1
  29. package/types/helpers/get-legend-config.d.ts +2 -1
  30. package/types/helpers/get-legend-config.d.ts.map +1 -1
  31. package/types/helpers/get-start-vals.d.ts +11 -8
  32. package/types/helpers/get-start-vals.d.ts.map +1 -1
  33. package/types/main.d.ts +5 -0
  34. package/types/main.d.ts.map +1 -1
  35. package/types/methods/layer-config/data-change.d.ts.map +1 -1
  36. package/src/enums/stories/assets/cropomhusc-feature-collection.json +0 -5274
@@ -1,33 +1,3 @@
1
- /**
2
- * Recursively traverses the schema object to extract startVals based on values of nested properties.
3
- *
4
- * @param {{[key: string]: any}} schema - The schema object to traverse.
5
- * @param {{[key: string]: any}} nestedValues - values of nested properties to extract startVals.
6
- * @returns {object} - Object containing the startVals.
7
- */
8
- export function getNestedStartVals(schema, nestedValues) {
9
- let startVals = {};
10
-
11
- for (const key in schema) {
12
- const type = schema[key].type;
13
- // Extract startVal based on type
14
- if (type && type !== "object" && nestedValues[key] !== undefined) {
15
- startVals[key] =
16
- type === "number" ? Number(nestedValues[key]) : nestedValues[key];
17
- } else if (typeof schema[key] === "object" && schema[key]?.properties) {
18
- // Recursively traverse nested properties
19
- const nestedStartVals = getNestedStartVals(
20
- schema[key].properties,
21
- nestedValues,
22
- );
23
- if (Object.keys(nestedStartVals).length > 0) {
24
- startVals[key] = nestedStartVals;
25
- }
26
- }
27
- }
28
- return startVals;
29
- }
30
-
31
1
  /**
32
2
  * Retrieves startVals from Query Params or style variables based on layer configuration.
33
3
  *
@@ -49,25 +19,136 @@ export function getStartVals(layer, layerConfig) {
49
19
  : layerConfig.style?.variables;
50
20
  if ((layerConfig.type === "style" || layerConfig.style) && styleVars) {
51
21
  nestedValues = styleVars;
52
-
53
- // @ts-expect-error TODO
54
- } else if (layer.getSource()?.getTileUrlFunction?.()) {
22
+ } else if (/** @type {any} */ (layer.getSource())?.getParams?.()) {
23
+ nestedValues = /** @type {any} */ (layer.getSource()).getParams();
24
+ } else if (
25
+ /** @type {import("ol/source").Source & { getTileUrlFunction: Function }} */ (
26
+ layer.getSource()
27
+ )?.getTileUrlFunction?.()
28
+ ) {
55
29
  // Extract query parameters from tile URL
56
- // @ts-expect-error TODO
57
- const url = new URL(layer.getSource().getTileUrlFunction()([0, 0, 0]));
58
-
59
- // Retrieve startVals based on schema and query parameters
60
- nestedValues = {};
61
- for (const [key, value] of url.searchParams.entries()) {
62
- const allValues = url.searchParams.getAll(key);
63
- nestedValues[key] = allValues.length > 1 ? allValues : value;
30
+ try {
31
+ const tileUrl =
32
+ /** @type {import("ol/source").Source & { getTileUrlFunction: Function }} */ (
33
+ layer.getSource()
34
+ ).getTileUrlFunction()([0, 0, 0]);
35
+ if (tileUrl) {
36
+ const url = new URL(tileUrl);
37
+ // Retrieve startVals based on schema and query parameters
38
+ nestedValues = {};
39
+ for (const [key, value] of url.searchParams.entries()) {
40
+ const allValues = url.searchParams.getAll(key);
41
+ nestedValues[key] = allValues.length > 1 ? allValues : value;
42
+ }
43
+ }
44
+ } catch (e) {
45
+ console.error("Error parsing start values from tile URL", e);
64
46
  }
65
47
  } else return null;
66
48
 
49
+ // fall back for schemas passed as a bare map of field definitions
50
+ const fieldSchemas = collectFieldSchemas(layerConfig.schema);
67
51
  const startVals = getNestedStartVals(
68
- layerConfig.schema?.properties || layerConfig.schema,
52
+ Object.keys(fieldSchemas).length ? fieldSchemas : layerConfig.schema,
69
53
  nestedValues,
54
+ layerConfig.schema,
70
55
  );
71
56
 
72
57
  return Object.keys(startVals).length ? startVals : null;
73
58
  }
59
+
60
+ /**
61
+ * Collects a schema's field definitions from `properties` and from `anyOf`/`oneOf`/`allOf`
62
+ * branches, resolving `$ref` branches against the root schema. json-editor uses those
63
+ * combinators for "pick one variant" forms, where `properties` alone is empty.
64
+ *
65
+ * @param {{[key: string]: any}} schema - The schema object to collect fields from.
66
+ * @param {{[key: string]: any}} [rootSchema] - The root schema `$ref`s resolve against.
67
+ * @param {Set<string>} [seenRefs] - Already-resolved refs, guards against circular `$ref`s.
68
+ * @returns {{[key: string]: any}} - Field definitions keyed by property name.
69
+ */
70
+ function collectFieldSchemas(
71
+ schema,
72
+ rootSchema = schema,
73
+ seenRefs = new Set(),
74
+ ) {
75
+ if (!schema || typeof schema !== "object") return {};
76
+
77
+ const fields = {};
78
+ if (typeof schema.$ref === "string" && !seenRefs.has(schema.$ref)) {
79
+ seenRefs.add(schema.$ref);
80
+ Object.assign(
81
+ fields,
82
+ collectFieldSchemas(
83
+ resolveLocalRef(schema.$ref, rootSchema),
84
+ rootSchema,
85
+ seenRefs,
86
+ ),
87
+ );
88
+ }
89
+ for (const key of ["anyOf", "oneOf", "allOf"]) {
90
+ if (Array.isArray(schema[key])) {
91
+ for (const branch of schema[key]) {
92
+ Object.assign(
93
+ fields,
94
+ collectFieldSchemas(branch, rootSchema, seenRefs),
95
+ );
96
+ }
97
+ }
98
+ }
99
+ // `properties` overlays last so constraint-only branch entries can't shadow real fields
100
+ return Object.assign(fields, schema.properties);
101
+ }
102
+
103
+ /**
104
+ * Recursively traverses the schema object to extract startVals based on values of nested properties.
105
+ *
106
+ * @param {{[key: string]: any}} schema - The schema object to traverse.
107
+ * @param {{[key: string]: any}} nestedValues - values of nested properties to extract startVals.
108
+ * @param {{[key: string]: any}} [rootSchema] - The root schema `$ref`s resolve against.
109
+ * @returns {object} - Object containing the startVals.
110
+ */
111
+ export function getNestedStartVals(schema, nestedValues, rootSchema = schema) {
112
+ let startVals = {};
113
+
114
+ for (const key in schema) {
115
+ const type = schema[key]?.type;
116
+ // Extract startVal based on type
117
+ if (type && type !== "object" && nestedValues[key] !== undefined) {
118
+ const value = ["number", "integer"].includes(type)
119
+ ? Number(nestedValues[key])
120
+ : nestedValues[key];
121
+ // keep the raw URL value instead of NaN (e.g. "auto" on a number field)
122
+ startVals[key] = Number.isNaN(value) ? nestedValues[key] : value;
123
+ } else {
124
+ // Recursively traverse nested properties
125
+ const nestedStartVals = getNestedStartVals(
126
+ collectFieldSchemas(schema[key], rootSchema),
127
+ nestedValues,
128
+ rootSchema,
129
+ );
130
+ if (Object.keys(nestedStartVals).length > 0) {
131
+ startVals[key] = nestedStartVals;
132
+ }
133
+ }
134
+ }
135
+ return startVals;
136
+ }
137
+
138
+ /**
139
+ * Resolves a local `$ref` pointer (e.g. `#/definitions/foo`) against the root schema.
140
+ *
141
+ * @param {string} ref - The `$ref` value.
142
+ * @param {{[key: string]: any}} rootSchema - The schema holding `definitions`/`$defs`.
143
+ * @returns {{[key: string]: any} | undefined} - The referenced schema, or undefined for external/unresolvable refs.
144
+ */
145
+ function resolveLocalRef(ref, rootSchema) {
146
+ if (!ref.startsWith("#/")) return undefined;
147
+ return ref
148
+ .slice(2)
149
+ .split("/")
150
+ .reduce(
151
+ (node, part) => node?.[part.replace(/~1/g, "/").replace(/~0/g, "~")],
152
+ rootSchema,
153
+ );
154
+ }
package/src/main.js CHANGED
@@ -65,6 +65,7 @@ export class EOxLayerControl extends LitElement {
65
65
  attribute: "tools-auto-expand",
66
66
  type: Boolean,
67
67
  },
68
+ colormapRegistry: { attribute: false, type: Object },
68
69
  customEditorInterfaces: { type: Array },
69
70
  };
70
71
 
@@ -173,6 +174,7 @@ export class EOxLayerControl extends LitElement {
173
174
  * @type {Array}
174
175
  */
175
176
  this.customEditorInterfaces = [];
177
+ this.colormapRegistry = null;
176
178
  }
177
179
 
178
180
  /**
@@ -270,6 +272,7 @@ export class EOxLayerControl extends LitElement {
270
272
  .toolsAsList=${this.toolsAsList}
271
273
  .globallyExclusiveLayers=${this.globallyExclusiveLayers}
272
274
  .toolsAutoExpand=${this.toolsAutoExpand}
275
+ .colormapRegistry=${this.colormapRegistry}
273
276
  .customEditorInterfaces=${this.customEditorInterfaces}
274
277
  @changed=${this.#handleLayerControlLayerListChange}
275
278
  @datetime:updated=${(evt) => handleDatetimeUpdate(evt, this)}
@@ -16,44 +16,47 @@ const dataChangeMethod = (data, tileUrlFunc, EOxLayerControlLayerConfig) => {
16
16
  // Checking if the layer's tile URL function exists.
17
17
  // If it does, set 'newTileUrlFunc' to the layer's tile URL function.
18
18
  // This step ensures the original tile URL function is preserved if 'tileUrlFunc' is not provided.
19
- // @ts-expect-error TODO
20
- if (EOxLayerControlLayerConfig.layer.getSource().getTileUrlFunction()) {
19
+ const source =
20
+ /** @type {import("ol/source").Source & { getTileUrlFunction: Function, setTileUrlFunction: Function, setKey: Function, updateParams: Function, _updatedUrl: string, getUrls: Function }} */ (
21
+ EOxLayerControlLayerConfig.layer.getSource()
22
+ );
23
+ if (source.updateParams) {
24
+ const updatedData = { ...data };
25
+ const removeProperties =
26
+ EOxLayerControlLayerConfig.layerConfig.schema?.options
27
+ ?.removeProperties ?? [];
28
+ removeProperties.forEach((prop) => delete updatedData[prop]);
29
+ source.updateParams(updatedData);
30
+ } else if (source.getTileUrlFunction && source.getTileUrlFunction()) {
21
31
  if (!newTileUrlFunc) {
22
- newTileUrlFunc = EOxLayerControlLayerConfig.layer
23
- .getSource()
24
- // @ts-expect-error TODO
25
- .getTileUrlFunction();
32
+ newTileUrlFunc = source.getTileUrlFunction();
26
33
  }
27
34
 
28
35
  // Setting a new tile URL function for the layer's source by applying updated data to the existing function.
29
- EOxLayerControlLayerConfig.layer
30
- .getSource()
31
- // @ts-expect-error TODO
32
- .setTileUrlFunction((...args) => {
33
- const url = new URL(newTileUrlFunc(...args));
34
- const removeProperties =
35
- EOxLayerControlLayerConfig.layerConfig.schema?.options
36
- ?.removeProperties ?? [];
36
+ source.setTileUrlFunction((...args) => {
37
+ const url = new URL(newTileUrlFunc(...args));
38
+ const removeProperties =
39
+ EOxLayerControlLayerConfig.layerConfig.schema?.options
40
+ ?.removeProperties ?? [];
37
41
 
38
- // Store the updated URL on the source for other components (like the globe) to use
39
- if (EOxLayerControlLayerConfig.layer.getSource() instanceof XYZ_ol) {
40
- // @ts-expect-error TODO
41
- EOxLayerControlLayerConfig.layer.getSource()._updatedUrl = updateUrl(
42
- /** @type {XYZ_ol} */ (
43
- EOxLayerControlLayerConfig.layer.getSource()
44
- ).getUrls()[0],
45
- data,
46
- );
47
- }
48
- // Remove unwanted properties from query parameters
49
- removeProperties.forEach((prop) => url.searchParams.delete(prop));
50
- return updateUrl(url.href, data);
51
- });
42
+ const updatedData = { ...data };
43
+ removeProperties.forEach((prop) => delete updatedData[prop]);
44
+
45
+ // Store the updated URL on the source for other components (like the globe) to use
46
+ if (source instanceof XYZ_ol) {
47
+ source._updatedUrl = updateUrl(
48
+ /** @type {XYZ_ol} */ (source).getUrls()[0],
49
+ updatedData,
50
+ );
51
+ }
52
+ // Remove unwanted properties from query parameters
53
+ removeProperties.forEach((prop) => url.searchParams.delete(prop));
54
+ return updateUrl(url.href, updatedData);
55
+ });
52
56
 
53
57
  // TODO: It's not advisable to access protected methods directly.
54
58
  // Setting a new key for the layer source to trigger a refresh.
55
- // @ts-expect-error TODO
56
- EOxLayerControlLayerConfig.layer.getSource().setKey(new Date());
59
+ source.setKey(new Date().toISOString());
57
60
  }
58
61
 
59
62
  const map = /** @type {import("../../../../map/src/main").EOxMap} */ (
@@ -62,10 +65,18 @@ const dataChangeMethod = (data, tileUrlFunc, EOxLayerControlLayerConfig) => {
62
65
  if (map) {
63
66
  const globe = map.globe;
64
67
  if (globe) {
68
+ const updatedData = { ...data };
69
+ const removeProperties =
70
+ EOxLayerControlLayerConfig.layerConfig.schema?.options
71
+ ?.removeProperties ?? [];
72
+ removeProperties.forEach((prop) => delete updatedData[prop]);
73
+
65
74
  const globusLayer = globe.planet.layers.filter(
66
75
  (l) => l.name == EOxLayerControlLayerConfig.layer.get("id"),
67
76
  )[0];
68
- globusLayer.setUrl(updateUrl(globusLayer.url, data));
77
+ if (globusLayer) {
78
+ globusLayer.setUrl(updateUrl(globusLayer.url, updatedData));
79
+ }
69
80
  window.eoxMapGlobe.refresh();
70
81
  }
71
82
  }
@@ -2,6 +2,7 @@
2
2
  * @typedef {Partial<import("./layer-legend").LegendConfig> & {
3
3
  * boundTo?:{key: string;value: string|number|boolean}
4
4
  * domainProperties: string[]
5
+ * rangeProperty?: string
5
6
  * }} layerConfigLegend
6
7
  **/
7
8
  /**
@@ -26,6 +27,10 @@ export class EOxLayerControlLayerConfig extends LitElement {
26
27
  layerConfig: {
27
28
  attribute: boolean;
28
29
  };
30
+ colormapRegistry: {
31
+ attribute: boolean;
32
+ type: ObjectConstructor;
33
+ };
29
34
  customEditorInterfaces: {
30
35
  attribute: boolean;
31
36
  type: ArrayConstructor;
@@ -84,6 +89,12 @@ export class EOxLayerControlLayerConfig extends LitElement {
84
89
  * @type {Array}
85
90
  */
86
91
  customEditorInterfaces: any[];
92
+ /**
93
+ * Optional colormap registry for dynamic legend updates
94
+ *
95
+ * @type {Record<string,string[]>}
96
+ */
97
+ colormapRegistry: Record<string, string[]>;
87
98
  /**
88
99
  * Renders a JSON form for configuration options of a layer.
89
100
  */
@@ -96,6 +107,7 @@ export type layerConfigLegend = Partial<import("./layer-legend").LegendConfig> &
96
107
  value: string | number | boolean;
97
108
  };
98
109
  domainProperties: string[];
110
+ rangeProperty?: string;
99
111
  };
100
112
  import { LitElement } from "lit";
101
113
  //# sourceMappingURL=layer-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layer-config.d.ts","sourceRoot":"","sources":["../../src/components/layer-config.js"],"names":[],"mappings":"AAOA;;;;;IAKI;AAEJ;;;;;;;GAOG;AACH;IAEE;;;;;;;;;;;;;;;;;MAME;IA0BA;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;;;;;;;OAUG;IACH,aARU;QACN,MAAM,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;QAC3B,KAAK,CAAC,EAAE,OAAO,oBAAoB,EAAE,KAAK,CAAA;QAC1C,MAAM,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;KAC/C,CAEkB;IAEvB;;OAEG;IACH,8DA8BW;QAAE,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;SAAE,CAAC;KAAE,WA9BuB;IAEjE;;;;;;OAMG;IACH,8BAAgC;IA+DlC;;OAEG;IACH,+CAkDC;;CA8BF;gCAjPY,OAAO,CAAC,OAAO,gBAAgB,EAAE,YAAY,CAAC,GAAG;IACvD,OAAO,CAAC,EAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAA,KAAK,EAAE,MAAM,GAAC,MAAM,GAAC,OAAO,CAAA;KAAC,CAAA;IACnD,gBAAgB,EAAE,MAAM,EAAE,CAAA;CAC1B;2BAX+B,KAAK"}
1
+ {"version":3,"file":"layer-config.d.ts","sourceRoot":"","sources":["../../src/components/layer-config.js"],"names":[],"mappings":"AAOA;;;;;;IAMI;AAEJ;;;;;;;GAOG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;MAOE;IA0BA;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;;;;;;;OAUG;IACH,aARU;QACN,MAAM,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;QAC3B,KAAK,CAAC,EAAE,OAAO,oBAAoB,EAAE,KAAK,CAAA;QAC1C,MAAM,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;KAC/C,CAEkB;IAEvB;;OAEG;IACH,8DAqCW;QAAE,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;SAAE,CAAC;KAAE,WArCuB;IAEjE;;;;;;OAMG;IACH,8BAAgC;IAEhC;;;;OAIG;IACH,kBAFU,MAAM,CAAC,MAAM,EAAC,MAAM,EAAE,CAAC,CAEL;IA+D9B;;OAEG;IACH,+CAmDC;;CA8BF;gCA3PY,OAAO,CAAC,OAAO,gBAAgB,EAAE,YAAY,CAAC,GAAG;IACvD,OAAO,CAAC,EAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAA,KAAK,EAAE,MAAM,GAAC,MAAM,GAAC,OAAO,CAAA;KAAC,CAAA;IACnD,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;2BAZ+B,KAAK"}
@@ -44,6 +44,10 @@ export class EOxLayerControlLayerGroup extends LitElement {
44
44
  attribute: string;
45
45
  type: BooleanConstructor;
46
46
  };
47
+ colormapRegistry: {
48
+ attribute: boolean;
49
+ type: ObjectConstructor;
50
+ };
47
51
  customEditorInterfaces: {
48
52
  attribute: boolean;
49
53
  type: ArrayConstructor;
@@ -124,6 +128,7 @@ export class EOxLayerControlLayerGroup extends LitElement {
124
128
  * @type {Array}
125
129
  */
126
130
  customEditorInterfaces: any[];
131
+ colormapRegistry: any;
127
132
  /**
128
133
  * Renders a layer control group with expandable details containing layers.
129
134
  */
@@ -1 +1 @@
1
- {"version":3,"file":"layer-group.d.ts","sourceRoot":"","sources":["../../src/components/layer-group.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBE;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,KAAK,CAAC,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,iCAAoC;IAEpC;;;;;;OAMG;IACH,8BAAgC;IAYlC;;OAEG;IACH,+CAkFC;;CA2BF;2BArPyC,KAAK"}
1
+ {"version":3,"file":"layer-group.d.ts","sourceRoot":"","sources":["../../src/components/layer-group.js"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBE;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,KAAK,CAAC,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,iCAAoC;IAEpC;;;;;;OAMG;IACH,8BAAgC;IAChC,sBAA4B;IAY9B;;OAEG;IACH,+CAoFC;;CA2BF;2BAzPyC,KAAK"}
@@ -43,6 +43,10 @@ export class EOxLayerControlLayerList extends LitElement {
43
43
  attribute: string;
44
44
  type: BooleanConstructor;
45
45
  };
46
+ colormapRegistry: {
47
+ attribute: boolean;
48
+ type: ObjectConstructor;
49
+ };
46
50
  customEditorInterfaces: {
47
51
  attribute: boolean;
48
52
  type: ArrayConstructor;
@@ -124,6 +128,7 @@ export class EOxLayerControlLayerList extends LitElement {
124
128
  * @type {Array}
125
129
  */
126
130
  customEditorInterfaces: any[];
131
+ colormapRegistry: any;
127
132
  /**
128
133
  * Executes specific logic after the initial render of the component.
129
134
  */
@@ -1 +1 @@
1
- {"version":3,"file":"layer-list.d.ts","sourceRoot":"","sources":["../../src/components/layer-list.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBE;IAKA;;;;OAIG;IACH,mBAAsB;IAEtB;;;;;OAKG;IACH,QAHU,OAAO,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,EAAE,KAAK,GAAG,OAAO,UAAU,EAAE,KAAK,CAAC,CAGpE;IAElB;;;;;OAKG;IACH,KAHU,OAAO,IAAI,EAAE,GAAG,CAGX;IAEf;;;;OAIG;IACH,OAFU,KAAK,CAAC,MAAM,CAAC,CAED;IAEtB;;;;OAIG;IACH,sBAA4B;IAE5B;;;;OAIG;IACH,4BAA+B;IAE/B;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,iCAAoC;IAEpC;;;;;;OAMG;IACH,8BAAgC;IAGlC;;OAEG;IACH,qBAEC;IASD;;;OAGG;IACH,+CA0EC;;CAqCF;2BA9PgC,KAAK"}
1
+ {"version":3,"file":"layer-list.d.ts","sourceRoot":"","sources":["../../src/components/layer-list.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBE;IAKA;;;;OAIG;IACH,mBAAsB;IAEtB;;;;;OAKG;IACH,QAHU,OAAO,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,EAAE,KAAK,GAAG,OAAO,UAAU,EAAE,KAAK,CAAC,CAGpE;IAElB;;;;;OAKG;IACH,KAHU,OAAO,IAAI,EAAE,GAAG,CAGX;IAEf;;;;OAIG;IACH,OAFU,KAAK,CAAC,MAAM,CAAC,CAED;IAEtB;;;;OAIG;IACH,sBAA4B;IAE5B;;;;OAIG;IACH,4BAA+B;IAE/B;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,iCAAoC;IAEpC;;;;;;OAMG;IACH,8BAAgC;IAChC,sBAA4B;IAG9B;;OAEG;IACH,qBAEC;IASD;;;OAGG;IACH,+CA4EC;;CAqCF;2BAlQgC,KAAK"}
@@ -33,6 +33,10 @@ export class EOxLayerControlLayerTools extends LitElement {
33
33
  embedded: {
34
34
  state: boolean;
35
35
  };
36
+ colormapRegistry: {
37
+ attribute: boolean;
38
+ type: ObjectConstructor;
39
+ };
36
40
  customEditorInterfaces: {
37
41
  attribute: boolean;
38
42
  type: ArrayConstructor;
@@ -90,6 +94,12 @@ export class EOxLayerControlLayerTools extends LitElement {
90
94
  * @type {Array}
91
95
  */
92
96
  customEditorInterfaces: any[];
97
+ /**
98
+ * Optional colormap registry for dynamic legend updates
99
+ *
100
+ * @type {Record<string,string[]>}
101
+ */
102
+ colormapRegistry: Record<string, string[]>;
93
103
  updated(changedProperties: any): void;
94
104
  _removeButton: (icon: any) => import("lit-html").HTMLTemplateResult;
95
105
  _sortButton: (icon: any) => import("lit-html").HTMLTemplateResult;
@@ -1 +1 @@
1
- {"version":3,"file":"layer-tools.d.ts","sourceRoot":"","sources":["../../src/components/layer-tools.js"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAaE;IAKA;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,OAFU,KAAK,CAAC,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,cAAiB;IAEjB;;;;OAIG;IACH,yBAA4B;IAW1B,kBAA4D;IAc9D;;;;;;OAMG;IACH,8BAAgC;IAUlC,sCAQC;IAmBD,gBAAiB,SAAI,2CAA8B;IAGnD,cAAe,SAAI,2CAA2C;IAE9D;;;;;;OAMG;IACH,UAAW,MAHA,MAGI,EAAE,SAAI,KAFR,OAAO,KAAK,EAAE,kBAAkB,CAEe;IAE5D,mBAAoB,UAAK,0CA6EvB;IAEF,+CA2DC;;CAgEF;2BA5XgC,KAAK"}
1
+ {"version":3,"file":"layer-tools.d.ts","sourceRoot":"","sources":["../../src/components/layer-tools.js"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAKA;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,OAFU,KAAK,CAAC,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,cAAiB;IAEjB;;;;OAIG;IACH,yBAA4B;IAW1B,kBAA4D;IAc9D;;;;;;OAMG;IACH,8BAAgC;IAEhC;;;;OAIG;IACH,kBAFU,MAAM,CAAC,MAAM,EAAC,MAAM,EAAE,CAAC,CAEL;IAU9B,sCAQC;IAmBD,gBAAiB,SAAI,2CAA8B;IAGnD,cAAe,SAAI,2CAA2C;IAE9D;;;;;;OAMG;IACH,UAAW,MAHA,MAGI,EAAE,SAAI,KAFR,OAAO,KAAK,EAAE,kBAAkB,CAEe;IAE5D,mBAAoB,UAAK,0CA8EvB;IAEF,+CA2DC;;CAgEF;2BArYgC,KAAK"}
@@ -44,6 +44,10 @@ export class EOxLayerControlLayer extends LitElement {
44
44
  attribute: string;
45
45
  type: BooleanConstructor;
46
46
  };
47
+ colormapRegistry: {
48
+ attribute: boolean;
49
+ type: ObjectConstructor;
50
+ };
47
51
  customEditorInterfaces: {
48
52
  attribute: boolean;
49
53
  type: ArrayConstructor;
@@ -131,6 +135,12 @@ export class EOxLayerControlLayer extends LitElement {
131
135
  * @type {Array}
132
136
  */
133
137
  customEditorInterfaces: any[];
138
+ /**
139
+ * Optional colormap registry for dynamic legend updates
140
+ *
141
+ * @type {Record<string,string[]>}
142
+ */
143
+ colormapRegistry: Record<string, string[]>;
134
144
  /**
135
145
  * Check and update layer zoom visibility at beginning
136
146
  * and register "change:resolution" ones at the beginning if `showLayerZoomState` is present
@@ -1 +1 @@
1
- {"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../src/components/layer.js"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBE;IAEF;;;;OAIG;IACH,wCAAsC;IAKpC;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,WAFU,MAAM,GAAC,SAAS,CAEA;IAE1B;;;;;OAKG;IACH,KAHU,OAAO,IAAI,EAAE,GAAG,CAGX;IAEf;;;;OAIG;IACH,sBAA4B;IAE5B;;;;OAIG;IACH,4BAA+B;IAE/B;;;;OAIG;IACH,OAFU,KAAK,CAAC,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,iCAAoC;IAEpC;;;;;;OAMG;IACH,8BAAgC;IAoBlC;;;OAGG;IACH,qBAEC;IAWD;;;;OAIG;IACH,+CAoNC;;CAuEF;2BA7cyC,KAAK"}
1
+ {"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../../src/components/layer.js"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBE;IAEF;;;;OAIG;IACH,wCAAsC;IAKpC;;;;;OAKG;IACH,OAHU,OAAO,UAAU,EAAE,KAAK,CAGjB;IAEjB;;;;OAIG;IACH,WAFU,MAAM,GAAC,SAAS,CAEA;IAE1B;;;;;OAKG;IACH,KAHU,OAAO,IAAI,EAAE,GAAG,CAGX;IAEf;;;;OAIG;IACH,sBAA4B;IAE5B;;;;OAIG;IACH,4BAA+B;IAE/B;;;;OAIG;IACH,OAFU,KAAK,CAAC,MAAM,CAAC,CAER;IAEf;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,yBAA4B;IAE5B;;;;OAIG;IACH,iCAAoC;IAEpC;;;;;;OAMG;IACH,8BAAgC;IAEhC;;;;OAIG;IACH,kBAFU,MAAM,CAAC,MAAM,EAAC,MAAM,EAAE,CAAC,CAEL;IAoB9B;;;OAGG;IACH,qBAEC;IAWD;;;;OAIG;IACH,+CAqNC;;CAuEF;2BAtdyC,KAAK"}
@@ -1,2 +1,2 @@
1
- export { STORIES_LAYER_S2, STORIES_LAYER_OSM, STORIES_LAYER_REGION, STORIES_LAYER_SENTINEL_HUB, STORIES_MAIN_MAP_LAYERS, STORIES_LAYERCONTROL_STYLE, STORIES_MAP_STYLE, STORIES_LAYER_EOX_CLOUDLESS_2021, STORIES_LAYER_EOX_CLOUDLESS_2020, STORIES_LAYER_EOX_CLOUDLESS_2019, STORIES_LAYER_DEFORESTED_BIOMASS, STORIES_LAYER_TERRAIN_LIGHT, STORIES_LAYER_VESSEL_DENSITY_CARGO, STORIES_LAYER_CROPOMHUSC2, STORIES_LAYER_SEE, STORIES_LAYER_POLARIS } from "./stories";
1
+ export { STORIES_LAYER_S2, STORIES_LAYER_OSM, STORIES_LAYER_REGION, STORIES_LAYER_SENTINEL_HUB, STORIES_MAIN_MAP_LAYERS, STORIES_LAYERCONTROL_STYLE, STORIES_MAP_STYLE, STORIES_LAYER_EOX_CLOUDLESS_2021, STORIES_LAYER_EOX_CLOUDLESS_2020, STORIES_LAYER_EOX_CLOUDLESS_2019, STORIES_LAYER_DEFORESTED_BIOMASS, STORIES_LAYER_TERRAIN_LIGHT, STORIES_LAYER_VESSEL_DENSITY_CARGO, STORIES_LAYER_CROPOMHUSC2, STORIES_LAYER_SEE, STORIES_LAYER_POLARIS, STORIES_LAYER_ESDL_DYNAMIC, STORIES_LAYER_JAXA_WMS, STORIES_LAYER_COPERNICUS_WMTS } from "./stories";
2
2
  //# sourceMappingURL=index.d.ts.map