@eox/layercontrol 1.5.0 → 1.7.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/dist/eox-layercontrol.js +7 -7
- package/dist/eox-layercontrol.umd.cjs +2 -2
- package/package.json +2 -2
- package/src/main.js +11 -3
- package/src/methods/layer-config/apply-updated-styles.js +1 -1
- package/types/main.d.ts +10 -3
- package/types/main.d.ts.map +1 -1
- package/types/methods/layer-config/apply-updated-styles.d.ts +7 -0
- package/types/methods/layer-config/apply-updated-styles.d.ts.map +1 -1
package/dist/eox-layercontrol.js
CHANGED
|
@@ -5862,8 +5862,11 @@ var ll = class extends k {
|
|
|
5862
5862
|
attribute: "show-layer-zoom-state",
|
|
5863
5863
|
type: Boolean
|
|
5864
5864
|
},
|
|
5865
|
-
tools: {
|
|
5866
|
-
addExternalLayers: {
|
|
5865
|
+
tools: { type: Array },
|
|
5866
|
+
addExternalLayers: {
|
|
5867
|
+
attribute: "add-external-layers",
|
|
5868
|
+
type: Boolean
|
|
5869
|
+
},
|
|
5867
5870
|
unstyled: { type: Boolean },
|
|
5868
5871
|
styleOverride: { type: String },
|
|
5869
5872
|
toolsAsList: { type: Boolean },
|
|
@@ -5875,10 +5878,7 @@ var ll = class extends k {
|
|
|
5875
5878
|
attribute: "tools-auto-expand",
|
|
5876
5879
|
type: Boolean
|
|
5877
5880
|
},
|
|
5878
|
-
customEditorInterfaces: {
|
|
5879
|
-
attribute: !1,
|
|
5880
|
-
type: Array
|
|
5881
|
-
}
|
|
5881
|
+
customEditorInterfaces: { type: Array }
|
|
5882
5882
|
};
|
|
5883
5883
|
#e;
|
|
5884
5884
|
constructor() {
|
|
@@ -6015,4 +6015,4 @@ var ll = class extends k {
|
|
|
6015
6015
|
};
|
|
6016
6016
|
customElements.define("eox-layercontrol", ll);
|
|
6017
6017
|
//#endregion
|
|
6018
|
-
export { ll as EOxLayerControl };
|
|
6018
|
+
export { ll as EOxLayerControl, yc as updateVectorLayerStyle };
|
|
@@ -969,7 +969,7 @@
|
|
|
969
969
|
letter-spacing: .0313rem;
|
|
970
970
|
}
|
|
971
971
|
${n}
|
|
972
|
-
`,document.head.appendChild(r)}},cl=e=>{let t;if(typeof e==`string`){let n=t=>t.querySelector(e);if(t=n(document),!t){let e=document.querySelectorAll(`html *`);for(let r=0;r<e.length&&!(e[r].shadowRoot&&(t=n(e[r].shadowRoot),t));r++);}}else t=e;return t},ll=e=>{let t=cl(e.for);return t&&t.map!==e.map&&(e.map=t.map),t};sl();var ul=class extends k{static properties={for:{type:String},idProperty:{attribute:`id-property`},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{
|
|
972
|
+
`,document.head.appendChild(r)}},cl=e=>{let t;if(typeof e==`string`){let n=t=>t.querySelector(e);if(t=n(document),!t){let e=document.querySelectorAll(`html *`);for(let r=0;r<e.length&&!(e[r].shadowRoot&&(t=n(e[r].shadowRoot),t));r++);}}else t=e;return t},ll=e=>{let t=cl(e.for);return t&&t.map!==e.map&&(e.map=t.map),t};sl();var ul=class extends k{static properties={for:{type:String},idProperty:{attribute:`id-property`},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{type:Array},addExternalLayers:{attribute:`add-external-layers`,type:Boolean},unstyled:{type:Boolean},styleOverride:{type:String},toolsAsList:{type:Boolean},globallyExclusiveLayers:{attribute:`globally-exclusive-layers`,type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},customEditorInterfaces:{type:Array}};#e;constructor(){super(),this.for=`eox-map`,this.idProperty=`id`,this.map=null,this.titleProperty=`title`,this.showLayerZoomState=!1,this.tools=[`info`,`opacity`,`datetime`,`config`,`remove`,`sort`],this.addExternalLayers=!1,this.unstyled=!1,this.styleOverride=``,this.toolsAsList=!1,this.globallyExclusiveLayers=!1,this.toolsAutoExpand=!1,this.customEditorInterfaces=[]}firstUpdated(){this.eoxMap=ll(this)}updated(e){e.has(`for`)&&(this.eoxMap=ll(this))}get eoxMap(){return this.#e}set eoxMap(e){let t=this.#e;this.#e=e,this.requestUpdate(`eoxMap`,t)}#t(e){ol(e,this),this.dispatchEvent(new CustomEvent(`layerchange`,{detail:e.detail}))}#n(e){this.dispatchEvent(new CustomEvent(`layerConfig:change`,{detail:e.detail}))}render(){let e=this.map?.getLayers().getArray(),t=e&&Pi(e,`layerControlOptional`,!0)?.length>0;return D`
|
|
973
973
|
<style>
|
|
974
974
|
${!this.unstyled&&this.#r}
|
|
975
975
|
${this.styleOverride}
|
|
@@ -1066,4 +1066,4 @@
|
|
|
1066
1066
|
summary > * {
|
|
1067
1067
|
pointer-events: all !important;
|
|
1068
1068
|
}
|
|
1069
|
-
`};customElements.define(`eox-layercontrol`,ul),e.EOxLayerControl=ul});
|
|
1069
|
+
`};customElements.define(`eox-layercontrol`,ul),e.EOxLayerControl=ul,e.updateVectorLayerStyle=bc});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eox/layercontrol",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@types/lodash.throttle": "^4.1.9",
|
|
12
12
|
"@types/sortablejs": "^1.15.1",
|
|
13
13
|
"ol": "^10.9.0",
|
|
14
|
-
"vite": "^8.0.
|
|
14
|
+
"vite": "^8.0.12"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"npm": ">=8.0.0",
|
package/src/main.js
CHANGED
|
@@ -36,6 +36,12 @@ addCommonStylesheet();
|
|
|
36
36
|
*
|
|
37
37
|
* For `eox-map` attributes/properties and emitted events, see below.
|
|
38
38
|
*
|
|
39
|
+
* ## Additional Helper Methods
|
|
40
|
+
*
|
|
41
|
+
* - `updateVectorLayerStyle`: Resolves a vector layer flat style object by substituting any `["var", "<key>"]` placeholders with values from its `variables` property; imitating OL WebGL flat style variable substitution `webglLayer.updateStyleVariables`.
|
|
42
|
+
*
|
|
43
|
+
* Usage: `import { updateVectorLayerStyle } from "@eox/layercontrol";`
|
|
44
|
+
*
|
|
39
45
|
* @element eox-layercontrol
|
|
40
46
|
*/
|
|
41
47
|
export class EOxLayerControl extends LitElement {
|
|
@@ -46,8 +52,8 @@ export class EOxLayerControl extends LitElement {
|
|
|
46
52
|
map: { attribute: false, state: true },
|
|
47
53
|
titleProperty: { attribute: "title-property", type: String },
|
|
48
54
|
showLayerZoomState: { attribute: "show-layer-zoom-state", type: Boolean },
|
|
49
|
-
tools: {
|
|
50
|
-
addExternalLayers: { attribute:
|
|
55
|
+
tools: { type: Array },
|
|
56
|
+
addExternalLayers: { attribute: "add-external-layers", type: Boolean },
|
|
51
57
|
unstyled: { type: Boolean },
|
|
52
58
|
styleOverride: { type: String },
|
|
53
59
|
toolsAsList: { type: Boolean },
|
|
@@ -59,7 +65,7 @@ export class EOxLayerControl extends LitElement {
|
|
|
59
65
|
attribute: "tools-auto-expand",
|
|
60
66
|
type: Boolean,
|
|
61
67
|
},
|
|
62
|
-
customEditorInterfaces: {
|
|
68
|
+
customEditorInterfaces: { type: Array },
|
|
63
69
|
};
|
|
64
70
|
|
|
65
71
|
/**
|
|
@@ -335,4 +341,6 @@ export class EOxLayerControl extends LitElement {
|
|
|
335
341
|
`;
|
|
336
342
|
}
|
|
337
343
|
|
|
344
|
+
export { updateVectorLayerStyle } from "./methods/layer-config/apply-updated-styles";
|
|
345
|
+
|
|
338
346
|
customElements.define("eox-layercontrol", EOxLayerControl);
|
|
@@ -69,7 +69,7 @@ export const flattenObject = (obj) => {
|
|
|
69
69
|
* @param {Record<string,any>} styles
|
|
70
70
|
* @returns
|
|
71
71
|
*/
|
|
72
|
-
function updateVectorLayerStyle(styles) {
|
|
72
|
+
export function updateVectorLayerStyle(styles) {
|
|
73
73
|
// pass back flat style if contained in config
|
|
74
74
|
let returnStyle = styles;
|
|
75
75
|
// Check if variables are defined and need to be "burned in" first
|
package/types/main.d.ts
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
*
|
|
22
22
|
* For `eox-map` attributes/properties and emitted events, see below.
|
|
23
23
|
*
|
|
24
|
+
* ## Additional Helper Methods
|
|
25
|
+
*
|
|
26
|
+
* - `updateVectorLayerStyle`: Resolves a vector layer flat style object by substituting any `["var", "<key>"]` placeholders with values from its `variables` property; imitating OL WebGL flat style variable substitution `webglLayer.updateStyleVariables`.
|
|
27
|
+
*
|
|
28
|
+
* Usage: `import { updateVectorLayerStyle } from "@eox/layercontrol";`
|
|
29
|
+
*
|
|
24
30
|
* @element eox-layercontrol
|
|
25
31
|
*/
|
|
26
32
|
export class EOxLayerControl extends LitElement {
|
|
@@ -44,10 +50,11 @@ export class EOxLayerControl extends LitElement {
|
|
|
44
50
|
type: BooleanConstructor;
|
|
45
51
|
};
|
|
46
52
|
tools: {
|
|
47
|
-
|
|
53
|
+
type: ArrayConstructor;
|
|
48
54
|
};
|
|
49
55
|
addExternalLayers: {
|
|
50
|
-
attribute:
|
|
56
|
+
attribute: string;
|
|
57
|
+
type: BooleanConstructor;
|
|
51
58
|
};
|
|
52
59
|
unstyled: {
|
|
53
60
|
type: BooleanConstructor;
|
|
@@ -67,7 +74,6 @@ export class EOxLayerControl extends LitElement {
|
|
|
67
74
|
type: BooleanConstructor;
|
|
68
75
|
};
|
|
69
76
|
customEditorInterfaces: {
|
|
70
|
-
attribute: boolean;
|
|
71
77
|
type: ArrayConstructor;
|
|
72
78
|
};
|
|
73
79
|
};
|
|
@@ -164,5 +170,6 @@ export class EOxLayerControl extends LitElement {
|
|
|
164
170
|
render(): import("lit-html").TemplateResult<1>;
|
|
165
171
|
#private;
|
|
166
172
|
}
|
|
173
|
+
export { updateVectorLayerStyle } from "./methods/layer-config/apply-updated-styles";
|
|
167
174
|
import { LitElement } from "lit";
|
|
168
175
|
//# sourceMappingURL=main.d.ts.map
|
package/types/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":"AAeA
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH;IAEE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBE;IAaA;;;;;OAKG;IACH,KAFU,SAAO,WAAW,CAER;IAEpB;;;;OAIG;IACH,mBAAsB;IAEtB;;;;;OAKG;IACH,KAHU,OAAO,IAAI,EAAE,GAAG,CAGX;IAEf;;;;OAIG;IACH,sBAA4B;IAE5B;;;;OAIG;IACH,4BAA+B;IAE/B;;;;OAIG;IACH,OAFU,KAAK,QAAQ,CAEiD;IAExE;;;;OAIG;IACH,2BAA8B;IAE9B;;;;OAIG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,sBAAuB;IAEvB;;;;OAIG;IACH,qBAAwB;IAExB;;;;OAIG;IACH,iCAAoC;IAEpC;;;;OAIG;IACH,yBAA4B;IAE5B;;;;;;OAMG;IACH,8BAAgC;IAGlC;;;OAGG;IACH,qBAEC;IAYD,uBAIC;IARD,kBAEC;IARD,sCAIC;IAoCD,+CAqEC;;CA+CF;;2BArVgC,KAAK"}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
* @param { import("../../components/layer-config").EOxLayerControlLayerConfig['layerConfig']} layerConfig
|
|
5
5
|
* */
|
|
6
6
|
export default function _default(jsonformOutput: Record<string, number>, layer: import("ol/layer/Layer").default, layerConfig: import("../../components/layer-config").EOxLayerControlLayerConfig["layerConfig"]): void;
|
|
7
|
+
/**
|
|
8
|
+
* updating the variables assigned in the layer style
|
|
9
|
+
* from the `styles.variables` property
|
|
10
|
+
* @param {Record<string,any>} styles
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export function updateVectorLayerStyle(styles: Record<string, any>): Record<string, any>;
|
|
7
14
|
export function flattenObject(obj: Record<string, any>): Record<string, any>;
|
|
8
15
|
//# sourceMappingURL=apply-updated-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-updated-styles.d.ts","sourceRoot":"","sources":["../../../src/methods/layer-config/apply-updated-styles.js"],"names":[],"mappings":"AAAA;;;;KAIK;AACL,iDAJW,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,SACpB,OAAO,gBAAgB,EAAE,OAAO,eAChC,OAAO,+BAA+B,EAAE,0BAA0B,CAAC,aAAa,CAAC,QA+B5F;
|
|
1
|
+
{"version":3,"file":"apply-updated-styles.d.ts","sourceRoot":"","sources":["../../../src/methods/layer-config/apply-updated-styles.js"],"names":[],"mappings":"AAAA;;;;KAIK;AACL,iDAJW,MAAM,CAAC,MAAM,EAAC,MAAM,CAAC,SACpB,OAAO,gBAAgB,EAAE,OAAO,eAChC,OAAO,+BAA+B,EAAE,0BAA0B,CAAC,aAAa,CAAC,QA+B5F;AA+BD;;;;;GAKG;AACH,+CAHW,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,uBA+B5B;AA5DM,mCAFI,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,uBA0B5B"}
|