@eox/layercontrol 0.13.0 → 0.13.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.
package/dist/eox-layercontrol.js
CHANGED
|
@@ -17767,9 +17767,9 @@ class Mu extends Sr {
|
|
|
17767
17767
|
constructor() {
|
|
17768
17768
|
super();
|
|
17769
17769
|
// Initializes '_removeButton' invoking 'removeButton' function with 'this' context.
|
|
17770
|
-
Ge(this, "_removeButton", af(this));
|
|
17770
|
+
Ge(this, "_removeButton", () => af(this));
|
|
17771
17771
|
// Initializes '_sortButton' invoking 'sortButton' function with 'unstyled' property as a parameter.
|
|
17772
|
-
Ge(this, "_sortButton", sf(this.unstyled));
|
|
17772
|
+
Ge(this, "_sortButton", () => sf(this.unstyled));
|
|
17773
17773
|
/**
|
|
17774
17774
|
* Initializes '_button' as a function accepting 'tool' parameter to generate a Button.
|
|
17775
17775
|
* Uses 'this.unstyled' as a context parameter for Button generation.
|
|
@@ -17944,8 +17944,8 @@ class Mu extends Sr {
|
|
|
17944
17944
|
@changed=${() => this.requestUpdate()}
|
|
17945
17945
|
></eox-layercontrol-layerconfig>
|
|
17946
17946
|
</div>
|
|
17947
|
-
<div slot="remove-icon">${this._removeButton}</div>
|
|
17948
|
-
<div slot="sort-icon">${this._sortButton}</div>
|
|
17947
|
+
<div slot="remove-icon">${this._removeButton()}</div>
|
|
17948
|
+
<div slot="sort-icon">${this._sortButton()}</div>
|
|
17949
17949
|
</eox-layercontrol-tabs>
|
|
17950
17950
|
</details>
|
|
17951
17951
|
`;
|
|
@@ -18627,7 +18627,7 @@ class Gu extends Sr {
|
|
|
18627
18627
|
/**
|
|
18628
18628
|
* Handles tab changes by invoking the 'openCloseTabMethod'.
|
|
18629
18629
|
*
|
|
18630
|
-
* @param {
|
|
18630
|
+
* @param {"url" | "json" | null} tab - The tab identifier triggering the method.
|
|
18631
18631
|
*/
|
|
18632
18632
|
ae(this, xo);
|
|
18633
18633
|
/**
|
|
@@ -18660,7 +18660,14 @@ class Gu extends Sr {
|
|
|
18660
18660
|
* @type {import("wms-capabilities").WMSCapabilitiesJSON}
|
|
18661
18661
|
*/
|
|
18662
18662
|
Ge(this, "wmsCapabilities", null);
|
|
18663
|
-
ae(this, js,
|
|
18663
|
+
ae(this, js, `
|
|
18664
|
+
.eox-add-layer-main .open {
|
|
18665
|
+
position: relative;
|
|
18666
|
+
}
|
|
18667
|
+
.eox-add-layer-main .close {
|
|
18668
|
+
display: none;
|
|
18669
|
+
}
|
|
18670
|
+
`);
|
|
18664
18671
|
ae(this, Os, `
|
|
18665
18672
|
.eox-add {
|
|
18666
18673
|
background: #f0f2f5;
|
|
@@ -18838,7 +18845,9 @@ class Gu extends Sr {
|
|
|
18838
18845
|
<button
|
|
18839
18846
|
class="add-icon icon"
|
|
18840
18847
|
@click=${() => Qe(this, xo, Za).call(this, this.open ? null : "url")}
|
|
18841
|
-
|
|
18848
|
+
>
|
|
18849
|
+
${this.unstyled ? "Add Layer" : ""}
|
|
18850
|
+
</button>
|
|
18842
18851
|
</div>
|
|
18843
18852
|
<div class="eox-add ${p}">
|
|
18844
18853
|
${b ? se`
|
|
@@ -18858,6 +18867,7 @@ class Gu extends Sr {
|
|
|
18858
18867
|
disabled=${E}
|
|
18859
18868
|
@click=${Qe(this, _s, Zu)}
|
|
18860
18869
|
>
|
|
18870
|
+
${this.unstyled ? "Search" : ""}
|
|
18861
18871
|
</button>
|
|
18862
18872
|
</div>
|
|
18863
18873
|
|
|
@@ -18876,7 +18886,9 @@ class Gu extends Sr {
|
|
|
18876
18886
|
//@ts-ignore
|
|
18877
18887
|
Qe(this, ca, Ul).call(this, y)
|
|
18878
18888
|
)}
|
|
18879
|
-
|
|
18889
|
+
>
|
|
18890
|
+
${this.unstyled ? "+" : ""}
|
|
18891
|
+
</button>
|
|
18880
18892
|
</li>
|
|
18881
18893
|
`;
|
|
18882
18894
|
}
|
|
@@ -18896,7 +18908,9 @@ class Gu extends Sr {
|
|
|
18896
18908
|
class="add-layer-icon json-add-layer"
|
|
18897
18909
|
disabled=${_p(this.jsonInput) ? je : !0}
|
|
18898
18910
|
@click=${Qe(this, xs, Ju)}
|
|
18899
|
-
|
|
18911
|
+
>
|
|
18912
|
+
${this.unstyled ? "Add JSON" : ""}
|
|
18913
|
+
</button>
|
|
18900
18914
|
`}
|
|
18901
18915
|
</div>
|
|
18902
18916
|
</div>
|
|
@@ -473,7 +473,7 @@ button.small {
|
|
|
473
473
|
padding: 12.4px;
|
|
474
474
|
font-size: .75rem;
|
|
475
475
|
}
|
|
476
|
-
`;class vu extends jr{constructor(){super();Xe(this,"_removeButton",Yd(this));Xe(this,"_sortButton",Xd(this.unstyled));Xe(this,"_button",p=>Jd(p,this.unstyled));se(this,Ga,"");se(this,Wa,`
|
|
476
|
+
`;class vu extends jr{constructor(){super();Xe(this,"_removeButton",()=>Yd(this));Xe(this,"_sortButton",()=>Xd(this.unstyled));Xe(this,"_button",p=>Jd(p,this.unstyled));se(this,Ga,"");se(this,Wa,`
|
|
477
477
|
${lp}
|
|
478
478
|
${hu}
|
|
479
479
|
${hl}
|
|
@@ -619,8 +619,8 @@ button.small {
|
|
|
619
619
|
@changed=${()=>this.requestUpdate()}
|
|
620
620
|
></eox-layercontrol-layerconfig>
|
|
621
621
|
</div>
|
|
622
|
-
<div slot="remove-icon">${this._removeButton}</div>
|
|
623
|
-
<div slot="sort-icon">${this._sortButton}</div>
|
|
622
|
+
<div slot="remove-icon">${this._removeButton()}</div>
|
|
623
|
+
<div slot="sort-icon">${this._sortButton()}</div>
|
|
624
624
|
</eox-layercontrol-tabs>
|
|
625
625
|
</details>
|
|
626
626
|
`})}
|
|
@@ -839,7 +839,14 @@ button.small {
|
|
|
839
839
|
|
|
840
840
|
<!-- Button to handle adding layers -->
|
|
841
841
|
<button @click="${rr(this,es,Zu)}">add</button>
|
|
842
|
-
`}}es=new WeakSet,Zu=function(){Lp(this)},Xe(ju,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},titleProperty:{attribute:"title-property",type:String},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-optional-list",ju);const Rp=(m,s)=>{s.jsonInput=m.target.value,s.requestUpdate()},Ou=m=>{const s=JSON.parse(`{"data":${Nc(m.jsonInput)}}`);Array.isArray(s.data)?s.data.forEach(p=>{m.eoxMap.addOrUpdateLayer(p)}):m.eoxMap.addOrUpdateLayer(s.data),m.jsonInput=null,m.requestUpdate()},Ip=(m,s)=>{s.urlInput=m.target.value,s.requestUpdate()};async function Bp(m){const s=m.urlInput;if(m.wmsCapabilities=null,m.searchLoad=!0,m.requestUpdate(),!s)return!1;if(Gs(s)==="XYZ")return{Name:s};try{const p=await ud(s);m.wmsCapabilities=p}catch{}finally{m.searchLoad=!1,m.requestUpdate()}return!1}const Dp=(m,s)=>{const{Name:p}=m,b=Gs(s.urlInput)||"XYZ",_={type:"Tile",properties:{id:p,title:p},source:{type:b,url:s.urlInput,params:{LAYERS:p}}};s.jsonInput=JSON.stringify(_)},Np=(m,s)=>{s.open=m||null,s.urlInput=null,s.jsonInput=null,s.wmsCapabilities=null,s.requestUpdate()};class Eu extends jr{constructor(){super();se(this,rs);se(this,ns);se(this,ta);se(this,is);se(this,os);se(this,Hi);Xe(this,"urlInput",null);Xe(this,"jsonInput",null);Xe(this,"open",null);Xe(this,"searchLoad",!1);Xe(this,"wmsCapabilities",null);se(this,as
|
|
842
|
+
`}}es=new WeakSet,Zu=function(){Lp(this)},Xe(ju,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},titleProperty:{attribute:"title-property",type:String},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-optional-list",ju);const Rp=(m,s)=>{s.jsonInput=m.target.value,s.requestUpdate()},Ou=m=>{const s=JSON.parse(`{"data":${Nc(m.jsonInput)}}`);Array.isArray(s.data)?s.data.forEach(p=>{m.eoxMap.addOrUpdateLayer(p)}):m.eoxMap.addOrUpdateLayer(s.data),m.jsonInput=null,m.requestUpdate()},Ip=(m,s)=>{s.urlInput=m.target.value,s.requestUpdate()};async function Bp(m){const s=m.urlInput;if(m.wmsCapabilities=null,m.searchLoad=!0,m.requestUpdate(),!s)return!1;if(Gs(s)==="XYZ")return{Name:s};try{const p=await ud(s);m.wmsCapabilities=p}catch{}finally{m.searchLoad=!1,m.requestUpdate()}return!1}const Dp=(m,s)=>{const{Name:p}=m,b=Gs(s.urlInput)||"XYZ",_={type:"Tile",properties:{id:p,title:p},source:{type:b,url:s.urlInput,params:{LAYERS:p}}};s.jsonInput=JSON.stringify(_)},Np=(m,s)=>{s.open=m||null,s.urlInput=null,s.jsonInput=null,s.wmsCapabilities=null,s.requestUpdate()};class Eu extends jr{constructor(){super();se(this,rs);se(this,ns);se(this,ta);se(this,is);se(this,os);se(this,Hi);Xe(this,"urlInput",null);Xe(this,"jsonInput",null);Xe(this,"open",null);Xe(this,"searchLoad",!1);Xe(this,"wmsCapabilities",null);se(this,as,`
|
|
843
|
+
.eox-add-layer-main .open {
|
|
844
|
+
position: relative;
|
|
845
|
+
}
|
|
846
|
+
.eox-add-layer-main .close {
|
|
847
|
+
display: none;
|
|
848
|
+
}
|
|
849
|
+
`);se(this,ss,`
|
|
843
850
|
.eox-add {
|
|
844
851
|
background: #f0f2f5;
|
|
845
852
|
border-top: 1px solid #0041701a;
|
|
@@ -999,7 +1006,9 @@ button.small {
|
|
|
999
1006
|
<button
|
|
1000
1007
|
class="add-icon icon"
|
|
1001
1008
|
@click=${()=>rr(this,Hi,Ls).call(this,this.open?null:"url")}
|
|
1002
|
-
|
|
1009
|
+
>
|
|
1010
|
+
${this.unstyled?"Add Layer":""}
|
|
1011
|
+
</button>
|
|
1003
1012
|
</div>
|
|
1004
1013
|
<div class="eox-add ${p}">
|
|
1005
1014
|
${b?ae`
|
|
@@ -1019,6 +1028,7 @@ button.small {
|
|
|
1019
1028
|
disabled=${E}
|
|
1020
1029
|
@click=${rr(this,ns,Yu)}
|
|
1021
1030
|
>
|
|
1031
|
+
${this.unstyled?"Search":""}
|
|
1022
1032
|
</button>
|
|
1023
1033
|
</div>
|
|
1024
1034
|
|
|
@@ -1031,7 +1041,9 @@ button.small {
|
|
|
1031
1041
|
<button
|
|
1032
1042
|
class="add-layer-icon icon"
|
|
1033
1043
|
@click=${()=>rr(this,ta,oc).call(this,y)}
|
|
1034
|
-
|
|
1044
|
+
>
|
|
1045
|
+
${this.unstyled?"+":""}
|
|
1046
|
+
</button>
|
|
1035
1047
|
</li>
|
|
1036
1048
|
`})}
|
|
1037
1049
|
</ul>`:je}
|
|
@@ -1049,7 +1061,9 @@ button.small {
|
|
|
1049
1061
|
class="add-layer-icon json-add-layer"
|
|
1050
1062
|
disabled=${dd(this.jsonInput)?je:!0}
|
|
1051
1063
|
@click=${rr(this,is,Xu)}
|
|
1052
|
-
|
|
1064
|
+
>
|
|
1065
|
+
${this.unstyled?"Add JSON":""}
|
|
1066
|
+
</button>
|
|
1053
1067
|
`}
|
|
1054
1068
|
</div>
|
|
1055
1069
|
</div>
|
package/package.json
CHANGED
|
@@ -52,7 +52,8 @@ const addExternalLayers = () => {
|
|
|
52
52
|
`{ type: "Tile", properties: { id: "WIND", title: "WIND", }, source: { type: "TileWMS", url: "//services.sentinel-hub.com/ogc/wms/0635c213-17a1-48ee-aef7-9d1731695a54", params: { LAYERS: "AWS_VIS_WIND_V_10M", }, }, maxZoom: 9, }`,
|
|
53
53
|
{ parseSpecialCharSequences: false }
|
|
54
54
|
);
|
|
55
|
-
cy.get(".json-add-layer").click();
|
|
55
|
+
cy.get(".json-add-layer").as("jsonbtn").click();
|
|
56
|
+
cy.get("@jsonbtn").should("be.disabled");
|
|
56
57
|
});
|
|
57
58
|
});
|
|
58
59
|
|