@eox/itemfilter 0.11.1 → 0.11.2
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-itemfilter.js
CHANGED
|
@@ -5623,7 +5623,7 @@ let Lr = class extends _e {
|
|
|
5623
5623
|
}
|
|
5624
5624
|
];
|
|
5625
5625
|
this.eoxMap = this.renderRoot.querySelector("eox-map"), setTimeout(() => {
|
|
5626
|
-
this.eoxMap.
|
|
5626
|
+
this.eoxMap.layers = t;
|
|
5627
5627
|
const e = (r) => {
|
|
5628
5628
|
const i = new CustomEvent("filter", {
|
|
5629
5629
|
detail: {
|
|
@@ -726,7 +726,7 @@ eox-itemfilter-expandcontainer button.reset-icon:before {
|
|
|
726
726
|
.geometry=${(t=this.filterObject.state)==null?void 0:t.geometry}
|
|
727
727
|
@filter="${e=>{this.filterObject.state.geometry=e.detail.geometry,this.filterObject.dirty=!0,this.filterObject.stringifiedState="Polygon",this.dispatchEvent(new CustomEvent("filter"))}}"
|
|
728
728
|
></eox-itemfilter-spatial>
|
|
729
|
-
`})}};nr([J()],yi.prototype,"filterObject",2),yi=nr([ke("eox-itemfilter-spatial")],yi);let _r=class extends _e{render(){return Y`<eox-map part="map" style="height: 400px"></eox-map>`}firstUpdated(){this.setup()}setup(){const t=[{type:"Vector",properties:{id:"draw"},source:{type:"Vector",...this.geometry&&{format:"GeoJSON"},...this.geometry&&{url:this.createFeatureUrl(this.geometry)}},zIndex:1,interactions:[{type:"draw",options:{id:"drawInteraction",type:"Box",modify:!0}}]},{type:"Tile",source:{type:"XYZ",url:"https://s2maps-tiles.eu/wmts/1.0.0/osm_3857/default/g/{z}/{y}/{x}.jpg",attribution:"{ OSM: Data © OpenStreetMap contributors and others, Rendering © EOX }"}}];this.eoxMap=this.renderRoot.querySelector("eox-map"),setTimeout(()=>{this.eoxMap.
|
|
729
|
+
`})}};nr([J()],yi.prototype,"filterObject",2),yi=nr([ke("eox-itemfilter-spatial")],yi);let _r=class extends _e{render(){return Y`<eox-map part="map" style="height: 400px"></eox-map>`}firstUpdated(){this.setup()}setup(){const t=[{type:"Vector",properties:{id:"draw"},source:{type:"Vector",...this.geometry&&{format:"GeoJSON"},...this.geometry&&{url:this.createFeatureUrl(this.geometry)}},zIndex:1,interactions:[{type:"draw",options:{id:"drawInteraction",type:"Box",modify:!0}}]},{type:"Tile",source:{type:"XYZ",url:"https://s2maps-tiles.eu/wmts/1.0.0/osm_3857/default/g/{z}/{y}/{x}.jpg",attribution:"{ OSM: Data © OpenStreetMap contributors and others, Rendering © EOX }"}}];this.eoxMap=this.renderRoot.querySelector("eox-map"),setTimeout(()=>{this.eoxMap.layers=t;const e=r=>{const i=new CustomEvent("filter",{detail:{geometry:{type:"Polygon",coordinates:r.getGeometry().clone().transform("EPSG:3857","EPSG:4326").getCoordinates()}}});this.dispatchEvent(i)};this.eoxMap.interactions.drawInteraction.on("drawend",r=>{e(r.feature),this.eoxMap.removeInteraction("drawInteraction")}),this.eoxMap.interactions.drawInteraction_modify.on("modifyend",r=>{e(r.features.getArray()[0])})},1e3)}createFeatureUrl(t){return`data:text/json,${encodeURIComponent(JSON.stringify({type:"FeatureCollection",features:[{type:"Feature",properties:null,geometry:t}]}))}`}reset(){var e;const t=this.eoxMap.getLayerById("draw").getSource();((e=t.getFeatures())==null?void 0:e.length)>0&&(t.clear(),this.eoxMap.removeInteraction("drawInteraction_modify"),this.setup())}};nr([J()],_r.prototype,"geometry",2),nr([Ue()],_r.prototype,"eoxMap",2),_r=nr([ke("eox-itemfilter-spatial-filter")],_r);var Na=Object.defineProperty,Ba=Object.getOwnPropertyDescriptor,ms=(t,e,r,i)=>{for(var n=i>1?void 0:i?Ba(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=(i?o(e,r,n):o(n))||n);return i&&n&&Na(e,r,n),n};let vi=class extends _e{constructor(){super(...arguments),this.inputHandler=()=>{const t=this.renderRoot.querySelector("input[type='text']");this.filterObject.keys.forEach(e=>{this.filterObject.state[e]=t.value}),this.filterObject.dirty=!0,this.filterObject.stringifiedState=t.value,this.dispatchEvent(new CustomEvent("filter"))},this.debouncedInputHandler=Xn(this.inputHandler,500,{leading:!0})}reset(){const t=this.renderRoot.querySelector("input[type='text']");t.value="",Ct(this.filterObject),this.filterObject.dirty=!1,this.requestUpdate()}createRenderRoot(){return this}render(){return de(this.filterObject,()=>Y`
|
|
730
730
|
<style>
|
|
731
731
|
input {
|
|
732
732
|
max-height: 100%;
|