UNPKG

gy-map

Version:

gy

1 lines 254 kB
"use strict";var t=Object.defineProperty,e=(e,i,n)=>(((e,i,n)=>{i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n})(e,"symbol"!=typeof i?i+"":i,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue-demi"),n=require("ol/style"),s=require("ol/layer/Vector"),r=require("ol/source/Vector"),o=require("ol/format/GeoJSON"),a=require("ol/geom/LineString"),l=require("ol/Feature"),h=require("ol/proj"),c=require("@turf/turf"),u=require("ol/geom"),d=require("ol/layer"),g=require("ol/Map"),f=require("ol/layer/Tile"),p=require("ol/source/XYZ"),m=require("ol/View"),_=require("ol/Overlay"),y=require("ol/interaction"),x=require("ol/source"),v=require("ol/events/condition"),S=require("ol/geom/Point"),w=t=>t&&"object"==typeof t&&"default"in t?t:{default:t};function C(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const b=w(s),I=w(r),M=w(o),R=w(a),E=w(l),A=C(c),k=w(g),L=w(f),T=w(p),F=w(m),O=w(_),P=w(S),D=52.35987755982988,G=3.141592653589793,N=6378245,W=.006693421622965943;function z(t,e){if(V(t,e))return[t,e];{let i=X(t-105,e-35),n=Y(t-105,e-35),s=e/180*G,r=Math.sin(s);r=1-W*r*r;let o=Math.sqrt(r);i=180*i/(N*(1-W)/(r*o)*G),n=180*n/(N/o*Math.cos(s)*G);return[t+n,e+i]}}function B(t,e){if(V(t,e))return[t,e];{let i=X(t-105,e-35),n=Y(t-105,e-35),s=e/180*G,r=Math.sin(s);r=1-W*r*r;let o=Math.sqrt(r);i=180*i/(N*(1-W)/(r*o)*G),n=180*n/(N/o*Math.cos(s)*G);return[2*t-(t+n),2*e-(e+i)]}}function Z(t,e){const i=function(t,e){let i=52.35987755982988,n=t-.0065,s=e-.006,r=Math.sqrt(n*n+s*s)-2e-5*Math.sin(s*i),o=Math.atan2(s,n)-3e-6*Math.cos(n*i);return[r*Math.cos(o),r*Math.sin(o)]}(t,e);return B(i[0],i[1])}function X(t,e){let i=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*G)+20*Math.sin(2*t*G))/3,i+=2*(20*Math.sin(e*G)+40*Math.sin(e/3*G))/3,i+=2*(160*Math.sin(e/12*G)+320*Math.sin(e*G/30))/3,i}function Y(t,e){let i=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return i+=2*(20*Math.sin(6*t*G)+20*Math.sin(2*t*G))/3,i+=2*(20*Math.sin(t*G)+40*Math.sin(t/3*G))/3,i+=2*(150*Math.sin(t/12*G)+300*Math.sin(t/30*G))/3,i}function V(t,e){return t<72.004||t>137.8347||e<.8293||e>55.8271||!1}let j="WGS84";const $=t=>{j=t},U=(t,e)=>Array.isArray(t)?U(t[0],t[1]):e?h.fromLonLat(q(t,e,j)):[],q=(t,e,i)=>(t=+t,e=+e,"GCJ02"===(i=i.toUpperCase())?B(t,e):"BD09"===i?Z(t,e):[t,e]),K={formatLonLatToPosition:U,flortAdd:(t,e)=>{let i,n,s;try{i=t.toString().split(".")[1].length}catch(r){i=0}try{n=e.toString().split(".")[1].length}catch(r){n=0}return s=Math.pow(10,Math.max(i,n)),Math.round(t*s+e*s)/s},gcj02towgs84:B,bd09towgs84:Z,wgs84tobd09:function(t,e){const i=z(t,e);return function(t,e){let i=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*D),n=Math.atan2(e,t)+3e-6*Math.cos(t*D);return[i*Math.cos(n)+.0065,i*Math.sin(n)+.006]}(i[0],i[1])},wgs84togcj02:z,lonlatToWGS84:(t,e,i)=>(t=+t,e=+e,"GCJ02"===(i=i.toUpperCase())?B(t,e):"BD09"===i?Z(t,e):[t,e]),wGS84ToLonlat:q,setMapLonLatType:$,getBufferArea:(t,e=200)=>{if(0===t.length||0===e)return[];let i;i=1===t.length?A.point(t[0]):t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]?A.polygon([t]):A.lineString(t);let n=A.buffer(i,e,{units:"meters"});return"Polygon"===n.geometry.type?n.geometry.coordinates[0]:"MultiPolygon"===n.geometry.type?n.geometry.coordinates[0][0]:[]}},H=i.defineComponent({name:"Gymap",props:{mapOpt:{type:Object,default:()=>({})},center:{type:Array,default:()=>[]},maplayerIndex:{type:Number,default:0},zoom:{type:Number,default:0},layerOpacity:{type:Number,default:1},mapId:{type:String,default:"map"},lonlatType:{type:String,default:"WGS84"},interactionsObj:{type:Object,default:()=>({})},isShowControls:{type:Boolean,default:!1}},setup(t){const e=Pc(t.mapId).value;$(t.lonlatType),i.onMounted((()=>{e.init(t.mapId,{...t.mapOpt,maplayerIndex:t.maplayerIndex,zoom:t.zoom,centerPoint:t.center,layerOpacity:t.layerOpacity,interactionsObj:t.interactionsObj,isShowControls:t.isShowControls})}));return i.watch((()=>t.zoom),(t=>{e&&e.zoomSetFun(t)})),i.watch((()=>t.maplayerIndex),(t=>{e&&e.changeMapLayer(t)})),i.watch((()=>t.center),(t=>{e&&e.changeCenterPoint(t)})),i.watch((()=>t.layerOpacity),(t=>{e&&e.setLayerOpacity(t)})),i.onBeforeUnmount((()=>{e&&e.destory()})),{id:t.mapId,gyMapObj:e,mouseenterFun:()=>{const e=document.getElementById(t.mapId);e&&e.focus()}}}});function J(t,e,i,n,s,r,o,a){var l,h="function"==typeof t?t.options:t;if(e&&(h.render=e,h.staticRenderFns=i,h._compiled=!0),n&&(h.functional=!0),r&&(h._scopeId="data-v-"+r),o?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=l):s&&(l=a?function(){s.call(this,(h.functional?this.parent:this).$root.$options.shadowRoot)}:s),l)if(h.functional){h._injectStyles=l;var c=h.render;h.render=function(t,e){return l.call(e),c(t,e)}}else{var u=h.beforeCreate;h.beforeCreate=u?[].concat(u,l):[l]}return{exports:t,options:h}}const Q={};var tt=J(H,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"map divMap",attrs:{id:t.mapId,tabindex:"0"},on:{mouseenter:t.mouseenterFun}},[t._t("default")],2)}),[],!1,et,"5c0faef4",null,null);function et(t){for(let e in Q)this[e]=Q[e]}const it=function(){return tt.exports}(),nt=i.defineComponent({name:"GymapHtml",props:{offset:{type:Array,default:()=>[0,0]},position:{type:Array,default:()=>[]},stopEvent:{type:Boolean,default:!0},className:{type:String,default:""},maxZoom:{type:Number,default:18},minZoom:{type:Number,default:0},mapId:{type:String,default:""}},setup(t){const e=i.ref(null),{proxy:n}=i.getCurrentInstance(),s=t.mapId||n.$parent.id,r=Pc(s).value,o=i.computed((()=>r&&r.mapFinish)),a=i.computed((()=>r&&r.zoom));let l=!1;i.watch(o,(()=>{d()}));let h=!1;const c=e=>{e>t.maxZoom||e<t.minZoom?(h=!0,u&&u.setPosition(void 0)):h&&(h=!1,g(t.position))};i.watch(a,(t=>{c(t)}));let u=null;const d=()=>{if(o.value&&!l){l=!0,u=r.drawHtmlToMap(e.value,{offset:t.offset,position:t.position,stopEvent:t.stopEvent,className:t.className}),c(a.value);const i=n.$parent.runTask;i&&i(u,t)}};i.onMounted((()=>{d()}));const g=t=>{let e=K.formatLonLatToPosition(t);u&&u.setPosition(e)};return i.watch((()=>t.position),(t=>{g(t),c(a.value)})),i.watch((()=>t.offset),(t=>{u&&u.setOffset(t)})),i.onBeforeUnmount((()=>{u&&r&&r.removeOverlay(u);const t=n.$parent.destory;t&&t()})),{htmlDom:e,mapId:s,gyMapObj:r,mapFinish:o}}});const st={};var rt=J(nt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{ref:"htmlDom",staticClass:"GymapHtml"},[t._t("default")],2)}),[],!1,ot,null,null,null);function ot(t){for(let e in st)this[e]=st[e]}const at=function(){return rt.exports}(),lt=i.defineComponent({name:"GymapPolygon",props:{positionList:{type:Array,default:()=>[]},className:{type:String},fillColor:{type:String,default:"rgba(0, 0, 255, 0.1)"},strokeColor:{type:String,default:""},strokeWidth:{type:Number,default:3},minZoom:{type:Number,default:1},maxZoom:{type:Number,default:18},opacity:{type:Number,default:1},mapId:{type:String,default:""}},emits:["clickFun"],setup(t,{emit:e}){const{proxy:s}=i.getCurrentInstance(),r=t.mapId||s.$parent.id,o=Pc(r),a=i.computed((()=>o.value&&o.value.mapFinish));let l=null,h=!1;i.watch(a,(()=>{d()})),i.onMounted((()=>{d()}));const c=()=>{const i=(()=>{let e=t.positionList,i=e[0],n=[];return n=i&&!Array.isArray(i[0])?[e]:e,n.map((t=>({type:"Feature",geometry:{type:"Polygon",coordinates:[t.map((t=>K.formatLonLatToPosition(t)))]}})))})();if(!i)return;const n={type:"FeatureCollection",crs:{type:"name",properties:{name:"EPSG:3857"}},features:i},s=new I.default({features:(new M.default).readFeatures(n)});let r=s.getFeatures()[0]||null;return r&&r.on("click",(t=>{e("clickFun",t)})),s},u=()=>new n.Style({stroke:t.strokeColor?new n.Stroke({color:t.strokeColor,width:t.strokeWidth}):null,fill:t.fillColor?new n.Fill({color:t.fillColor}):null}),d=()=>{if(!a.value||h)return;h=!0;const e=c();if(!e)return;const i=u();l=new b.default({source:e,style:[i],minZoom:t.minZoom,maxZoom:t.maxZoom,opacity:t.opacity}),o.value.map.addLayer(l)};i.watch((()=>t.positionList),(()=>{const t=c();t&&l&&l.setSource(t)}),{deep:!0}),i.watch([()=>t.strokeColor,()=>t.strokeWidth,()=>t.fillColor],(()=>{const t=u();l&&l.setStyle(t)})),i.watch((()=>t.opacity),(t=>{l&&l.setOpacity(t)})),i.watch((()=>t.minZoom),(t=>{l&&l.setMinZoom(t)})),i.watch((()=>t.maxZoom),(t=>{l&&l.setMaxZoom(t)}));i.onBeforeUnmount((()=>{l&&(o.value&&o.value.map.removeLayer(l),l=null)}))}});const ht={};var ct=J(lt,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,ut,null,null,null);function ut(t){for(let e in ht)this[e]=ht[e]}const dt=function(){return ct.exports}(),gt=i.defineComponent({name:"GymapLine",props:{positionList:{type:Array,default:()=>[]},strokeColor:{type:String,default:"blue"},strokeWidth:{type:Number,default:3},minZoom:{type:Number,default:1},maxZoom:{type:Number,default:18},opacity:{type:Number,default:1},arrow:{type:[Boolean,String],default:!1},arrowAnchor:{type:Array,default:()=>[.75,.5]},animate:{type:Boolean,default:!1},step:{type:Number,default:.001},loop:{type:Boolean,default:!1},arrowStep:{type:Number,default:20},mapId:{type:String,default:""}},emits:["clickFun"],setup(t,{emit:e}){const{proxy:s}=i.getCurrentInstance(),r=t.mapId||s.$parent.id,o=Pc(r),a=i.computed((()=>o.value&&o.value.mapFinish));let l=null,h=null,c=!1,u=null,d=null,g=null,f=[],p=null,m=0,_=null;i.watch(a,(()=>{S()})),i.onMounted((()=>{S()}));const y=t=>{let e=t.map((t=>K.formatLonLatToPosition(t)));return new R.default(e)},x=()=>{if(h=(()=>{let i=t.positionList;return t.animate&&(i=[]),g=y(i),_=new E.default({type:"lineStyle",geometry:g}),_.on("click",(t=>{e("clickFun",t)})),_})(),h.setStyle(u),h)return new I.default({features:[h]})},v=function(e){const i=e.getGeometry(),s=[new n.Style({stroke:new n.Stroke({color:t.strokeColor,width:t.strokeWidth})})];if(t.arrow){let e=0,r=t.step;r=Math.min(r,.01),i.forEachSegment((function(i,o){const a=o[0]-i[0],l=o[1]-i[1],h=Math.atan2(l,a);e++;let c=Math.min(t.arrowStep,1/r);if(!t.animate||e%(1/r/c)==0){let e=null;e="boolean"==typeof t.arrow?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAMAAACTKxybAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAHJQTFRF//////8A//8A/6pV/79A/8wz/9Ur/9Eu/8Q7/8wz/9It/8k2/9Eu/8o1/9Av/8o1/84x/8wz/8wz/8wz/8wz/8wz/8s0/8wz/8s0/8wz/8wz/8wz/8wz/8s0/8wz/8wz/8wz/8wz/8wz/8wz/8wz/8wzo2lg3QAAACV0Uk5TAAECAwQFBgsNDxETFhgbHUNGm6Ckqa2usrW+w8fLztLV1tnc9jtYQ+sAAABdSURBVAjXZc9HDsAwCARAp/fee+X/X8wesIQVbiMELEqVU6B0VS8tocZARGvE8Edoi1leD+0Jy+2gI2U5LXRmLLuB7pxl1dBT6N4Fzf+OnJHb5B2ZwMhmpDb+kZ9+tBQLxwwvvoMAAAAASUVORK5CYII=":t.arrow,s.push(new n.Style({geometry:new P.default(o),image:new n.Icon({src:e,anchor:t.arrowAnchor,rotateWithView:!0,rotation:-h})}))}}))}return s},S=()=>{if(!a.value||c)return;c=!0,u=v,A();const e=x();e&&(l=new b.default({source:e,minZoom:t.minZoom,maxZoom:t.maxZoom,opacity:t.opacity}),o.value.map.addLayer(l),t.animate&&(d=y(t.positionList),w()))},w=()=>{if(f.push(d.getCoordinateAt(Math.min(m,1))),C(),m>1)return A(),void(t.loop&&(f=[],m=0,w()));let e=t.step;e=Math.min(e,.01),m+=e,p=window.requestAnimationFrame(w)},C=()=>{let e=null;e=t.animate?new R.default(f):y(t.positionList),_&&_.setGeometry(e)},M=()=>{l&&(o.value&&o.value.map.removeLayer(l),l=null),A()},A=()=>{p&&window.cancelAnimationFrame(p)};i.watch((()=>t.positionList),(t=>{C()})),i.watch((()=>t.opacity),(t=>{l&&l.setOpacity(t)})),i.watch((()=>t.animate),(t=>{c=!1,M(),S()})),i.watch((()=>t.minZoom),(t=>{l&&l.setMinZoom(t)})),i.watch((()=>t.maxZoom),(t=>{l&&l.setMaxZoom(t)})),i.watch([()=>t.strokeColor,()=>t.strokeColor,()=>t.arrow],(()=>{u=v,h&&h.setStyle(u)})),i.onBeforeUnmount((()=>{M()}))}});const ft={};var pt=J(gt,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,mt,null,null,null);function mt(t){for(let e in ft)this[e]=ft[e]}const _t=function(){return pt.exports}(),yt=i.defineComponent({name:"GymapTask",props:{mapId:{type:String,default:""},positionList:{type:Array,default:()=>[]},loop:{type:Boolean,default:!1},step:{type:Number,default:.001},taskStatus:{type:String,default:"play"},delay:{type:Number,default:3e3},animateDataType:{type:String,default:"LONLAT"}},emits:["animate"],setup(t,{emit:e}){const{proxy:n}=i.getCurrentInstance(),s=t.mapId||n.$parent.id;let r,o=!0,a=!1,l=null,c=null;const u=(e,n)=>{o&&(a||(l||(l=i.watch((()=>n.position),(()=>{f=0,y()}))),c=e),"play"===t.taskStatus&&g(),0!==t.delay&&(r=setTimeout((()=>{g()}),t.delay)))};i.watch((()=>t.taskStatus),(t=>{"play"===t?g():"stop"===t?(f=0,_()):"pause"===t&&_()}));let d=null;const g=()=>{r&&(clearTimeout(r),r=null),(a||c)&&(p||(d||(d=(t=>{let e=t.map((t=>K.formatLonLatToPosition(t)));return new R.default(e)})(t.positionList)),m()))};let f=0,p=null;const m=()=>{let i=d.getCoordinateAt(Math.min(f,1));if(a||(c.geometry?c.geometry.setCoordinates(i):c.setPosition(i)),"LONLAT"===t.animateDataType&&(i=h.toLonLat(i)),e("animate",i,f),f>1)return _(),void(t.loop&&(f=0,m()));let n=t.step;f=K.flortAdd(f,n),p=window.requestAnimationFrame(m)},_=()=>{l&&l(),p&&window.cancelAnimationFrame(p),p=null},y=()=>{r&&(clearTimeout(r),r=null),_()};return i.onBeforeMount((()=>{let t=n.$slots.default;if(t){let t=n.$slots.default(),e=0;for(let i=0;i<t.length;i++){if("symbol"!=typeof t[i].type&&(e++,e>1)){o=!1;break}}}else t||(a=!0,u())})),i.onMounted((()=>{a&&u()})),{id:s,runTask:u,destory:y}}});const xt={};var vt=J(yt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",[t._t("default")],2)}),[],!1,St,null,null,null);function St(t){for(let e in xt)this[e]=xt[e]}const wt=function(){return vt.exports}();class Ct{constructor(t,n,s,r,o){e(this,"style"),e(this,"geometry"),e(this,"feature"),e(this,"mapId"),e(this,"source"),e(this,"layer"),e(this,"clusterSource"),e(this,"minZoom"),e(this,"maxZoom"),e(this,"olPositions"),e(this,"opacity"),e(this,"declutter"),e(this,"zIndex"),e(this,"stylesObj"),e(this,"gyMapObj"),e(this,"mapFinish"),e(this,"isDraw"),e(this,"emit"),e(this,"otherOpts"),this.style=void 0,this.geometry=void 0,this.feature=new E.default,this.mapId="",this.source=void 0,this.layer=null,this.clusterSource=r,this.otherOpts=o||{},this.minZoom=i.computed((()=>n.minZoom)),this.maxZoom=i.computed((()=>n.maxZoom)),this.opacity=i.computed((()=>n.opacity)),this.olPositions=i.computed((()=>n.position)),this.declutter=n.declutter,this.stylesObj=n,this.zIndex=void 0,this.gyMapObj=Pc(t),this.mapFinish=i.computed((()=>this.gyMapObj.value&&this.gyMapObj.value.mapFinish)),this.isDraw=!1,this.emit=s||null}init(){}draw(){this.geometry=this.getGeometry(),this.addFeature(),this.setStyle(),this.addSource(),this.addLayer(),this.addWatchFun(),this.addLayerToMap()}addFeature(){this.feature=new E.default({geometry:this.geometry}),this.feature.on("click",(t=>{this.emit&&this.emit("clickFun",t)}))}addSource(){this.source=new I.default({features:[this.feature]})}addLayer(){this.layer=new b.default({source:this.source,declutter:this.declutter,minZoom:this.minZoom.value,maxZoom:this.maxZoom.value,opacity:this.opacity.value})}addLayerToMap(){var t,e,i;if(!this.isDraw&&this.mapFinish.value){let n=this.otherOpts&&this.otherOpts.imageSource;if(n){let e=n.getFeatures()[0].getStyle(),i=null==(t=this.getStyle())?void 0:t.getText();e&&i&&e.setText(i)}else this.clusterSource?this.clusterSource.addFeature(this.feature):(this.isDraw=!0,null==(i=null==(e=this.gyMapObj.value)?void 0:e.map)||i.addLayer(this.layer))}}addWatchFun(){i.watch(this.mapFinish,(t=>{this.addLayerToMap()})),this.addLayerWatch(),this.addPropsWatch()}addLayerWatch(){i.watch(this.minZoom,(t=>{var e;null==(e=this.layer)||e.setMinZoom(t)})),i.watch(this.maxZoom,(t=>{var e;null==(e=this.layer)||e.setMaxZoom(t)})),i.watch(this.opacity,(t=>{var e;null==(e=this.layer)||e.setOpacity(t)})),i.watch(this.olPositions,(t=>{this.setGeoPosition(t)}))}addPropsWatch(){i.watch(this.stylesObj,(()=>{this.setStyle()}))}getGeometry(){}setGeoPosition(t){}getStyle(){}setStyle(){this.style=this.getStyle(),this.style&&this.feature&&this.feature.setStyle(this.style)}destory(){var t,e;null==(e=null==(t=this.gyMapObj.value)?void 0:t.map)||e.removeLayer(this.layer),this.layer=null,this.isDraw=!1}}const bt={isAuto:{type:Boolean,default:!1},declutter:{type:Boolean,default:!1},minZoom:{type:Number,default:1},maxZoom:{type:Number,default:18},opacity:{type:Number,default:1}};class It extends Ct{constructor(t,n,s,r,o){super(t,s,r,o),e(this,"position"),e(this,"fillColor"),e(this,"strokeColor"),e(this,"strokeWidth"),e(this,"lineDash"),e(this,"radius"),e(this,"scale"),e(this,"rotation"),e(this,"isAuto"),this.position=i.computed((()=>K.formatLonLatToPosition(n))),this.fillColor=i.computed((()=>s.fillColor)),this.strokeColor=i.computed((()=>s.strokeColor)),this.strokeWidth=i.computed((()=>s.strokeWidth)),this.radius=i.computed((()=>s.radius)),this.lineDash=i.computed((()=>s.lineDash)),this.scale=i.computed((()=>s.scale)),this.rotation=i.computed((()=>s.rotation)),this.isAuto=i.computed((()=>s.isAuto)),this.draw()}getGeometry(){return new u.Point(this.position.value)}setGeoPosition(t){this.geometry.setCoordinates(K.formatLonLatToPosition(t))}getStyle(){const t=new n.Style({image:new n.Circle({radius:this.radius.value||5,fill:this.fillColor.value?new n.Fill({color:this.fillColor.value}):void 0,stroke:this.strokeColor.value?new n.Stroke({color:this.strokeColor.value,width:this.strokeWidth.value}):void 0,scale:this.scale.value,rotation:this.rotation.value})});return this.isAuto.value?(e,i)=>(t.getImage().setScale(1/Math.pow(i,1)),t):t}}const Mt={...bt,position:{type:Array,default:()=>[]},fillColor:{type:String,default:""},strokeColor:{type:String,default:""},strokeWidth:{type:Number,default:3},scale:{type:[Number,Array],default:1},radius:{type:Number,default:5},rotation:{type:Number,default:0},mapId:{type:String,default:""}},Rt=i.defineComponent({name:"GymapCircle",props:{...Mt},emits:["clickFun"],setup(t,{emit:e}){const{proxy:n}=i.getCurrentInstance(),s=t.mapId||n.$parent.id,r=n.$parent.clusterSource,o=n.$parent.setParentStylesByLayer;let a=null;i.onMounted((()=>{a=new It(s,t.position,t,e,r);const i=n.$parent.runTask;i&&i(a,t),o&&o(a)}));i.onBeforeUnmount((()=>{null==a||a.destory(),a=null;const t=n.$parent.destory;t&&t()}))}});const Et={};var At=J(Rt,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,kt,null,null,null);function kt(t){for(let e in Et)this[e]=Et[e]}const Lt=function(){return At.exports}();class Tt extends Ct{constructor(t,n,s,r,o,a){super(t,s,r,o,a),e(this,"position"),e(this,"text"),e(this,"font"),e(this,"offsetX"),e(this,"offsetY"),e(this,"scale"),e(this,"rotation"),e(this,"textAlign"),e(this,"textBaseline"),e(this,"fillColor"),e(this,"strokeColor"),e(this,"strokeWidth"),e(this,"backgroundFillColor"),e(this,"backgroundStrokeColor"),e(this,"backgroundStrokeWidth"),e(this,"padding"),e(this,"isAuto"),this.position=i.computed((()=>n.length?K.formatLonLatToPosition(n):[])),this.text=i.computed((()=>s.text)),this.font=i.computed((()=>s.font)),this.offsetX=i.computed((()=>s.offsetX)),this.offsetY=i.computed((()=>s.offsetY)),this.scale=i.computed((()=>s.scale)),this.rotation=i.computed((()=>s.rotation)),this.textAlign=i.computed((()=>s.textAlign)),this.textBaseline=i.computed((()=>s.textBaseline)),this.fillColor=i.computed((()=>s.fillColor)),this.strokeColor=i.computed((()=>s.strokeColor)),this.strokeWidth=i.computed((()=>s.strokeWidth)),this.backgroundFillColor=i.computed((()=>s.backgroundFillColor)),this.backgroundStrokeColor=i.computed((()=>s.backgroundStrokeColor)),this.backgroundStrokeWidth=i.computed((()=>s.backgroundStrokeWidth)),this.padding=i.computed((()=>s.padding)),this.isAuto=i.computed((()=>s.isAuto)),this.draw()}getGeometry(){return new u.Point(this.position.value)}setGeoPosition(t){this.geometry.setCoordinates(K.formatLonLatToPosition(t))}getStyle(){const t=new n.Style({text:new n.Text({text:this.text.value,font:this.font.value,offsetX:this.offsetX.value,offsetY:this.offsetY.value,placement:"point",scale:this.scale.value,rotation:this.rotation.value,textAlign:this.textAlign.value,textBaseline:this.textBaseline.value,fill:this.fillColor.value?new n.Fill({color:this.fillColor.value}):void 0,stroke:this.strokeColor.value?new n.Stroke({color:this.strokeColor.value,width:this.strokeWidth.value}):void 0,backgroundFill:this.backgroundFillColor.value?new n.Fill({color:this.backgroundFillColor.value}):void 0,backgroundStroke:this.backgroundStrokeColor.value?new n.Stroke({color:this.backgroundStrokeColor.value,width:this.backgroundStrokeWidth.value}):void 0,padding:this.padding.value})});return this.isAuto.value?(e,i)=>(t.getText().setScale(1/Math.pow(i,1)),t):t}}const Ft={...bt,position:{type:Array,default:()=>[]},text:{type:String,default:""},font:{type:String,default:""},offsetX:{type:Number,default:0},offsetY:{type:Number,default:0},scale:{type:Number,default:1},rotation:{type:Number,default:0},textAlign:{type:String,default:""},textBaseline:{type:String,default:""},fillColor:{type:String,default:""},strokeColor:{type:String,default:""},strokeWidth:{type:Number,default:5},backgroundFillColor:{type:String,default:""},backgroundStrokeColor:{type:String,default:""},backgroundStrokeWidth:{type:Number,default:5},padding:{type:Array,default:()=>[0,0,0,0]},mapId:{type:String,default:""}},Ot=i.defineComponent({name:"GymapText",props:{...Ft},emits:["clickFun"],setup(t,{emit:e}){const{proxy:n}=i.getCurrentInstance(),s=t.mapId||n.$parent.id,r=n.$parent.clusterSource,o=n.$parent.imageSource,a=n.$parent.setParentStylesByLayer;let l=null;l=new Tt(s,t.position,t,e,r,{imageSource:o}),i.onMounted((()=>{const e=n.$parent.runTask;e&&e(l,t),a&&a(l)}));i.onBeforeUnmount((()=>{l.destory(),l=null;const t=n.$parent.destory;t&&t()}))}});const Pt={};var Dt=J(Ot,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,Gt,null,null,null);function Gt(t){for(let e in Pt)this[e]=Pt[e]}const Nt=function(){return Dt.exports}();class Wt extends Ct{constructor(t,n,s,r,o){super(t,s,r,o),e(this,"position"),e(this,"src"),e(this,"anchor"),e(this,"displacement"),e(this,"scale"),e(this,"rotation"),e(this,"isAuto"),this.position=i.computed((()=>K.formatLonLatToPosition(n))),this.src=i.computed((()=>s.src)),this.anchor=i.computed((()=>s.anchor)),this.displacement=i.computed((()=>s.displacement)),this.scale=i.computed((()=>s.scale)),this.rotation=i.computed((()=>s.rotation)),this.isAuto=i.computed((()=>s.isAuto)),this.draw()}getGeometry(){return new u.Point(this.position.value)}setGeoPosition(t){this.geometry.setCoordinates(K.formatLonLatToPosition(t))}getStyle(){const t=new n.Style({image:new n.Icon({crossOrigin:"anonymous",src:this.src.value,anchor:this.anchor.value,displacement:this.displacement.value,scale:this.scale.value,rotation:this.rotation.value})});return this.isAuto.value?(e,i)=>(t.getImage().setScale(1/Math.pow(i,1)),t):t}}const zt={...bt,position:{type:Array,default:()=>[]},src:{type:String,default:""},anchor:{type:Array,default:()=>[.5,.5]},displacement:{type:Array,default:()=>[0,0]},scale:{type:Number,default:1},rotation:{type:Number,default:0},mapId:{type:String,default:""}},Bt=i.defineComponent({name:"GymapImage",props:{...zt},emits:["clickFun"],setup(t,{emit:e,expose:n}){const s=i.ref(!1),{proxy:r}=i.getCurrentInstance(),o=t.mapId||r.$parent.id,a=r.$parent.clusterSource,l=r.$parent.setParentStylesByLayer;let h=null;h=new Wt(o,t.position,t,e,a);const c=h.source;i.onMounted((()=>{s.value=!0;const e=r.$parent.runTask;e&&e(h,t),l&&l(h)}));return i.onBeforeUnmount((()=>{h.destory(),h=null;const t=r.$parent.destory;t&&t()})),{id:o,imageSource:c,showSlot:s}}});const Zt={};var Xt=J(Bt,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",[t.showSlot?t._t("default"):t._e()],2)}),[],!1,Yt,null,null,null);function Yt(t){for(let e in Zt)this[e]=Zt[e]}const Vt=function(){return Xt.exports}(),jt=i.defineComponent({name:"GymapDraw",props:{canInsertVertexCondition:{type:Boolean,default:!0},drawTypeList:{type:Array,default:()=>["Point","LineString","Circle","Polygon"]},drawTypeCnameList:{type:Array,default:()=>["点","线","圆","多边形"]},btnBackground:{type:String,default:"rgb(102, 102, 102)"},btnColor:{type:String,default:"#fff"},btnActiveBackground:{type:String,default:"rgb(142, 142, 142)"},btnActiveColor:{type:String,default:"#fff"},deleteActiveBackground:{type:String,default:"rgb(28 137 189)"},deleteActiveColor:{type:String,default:"#fff"},fillColor:{type:String,default:"rgba(255, 255, 255, 0.2)"},strokeColor:{type:String,default:"#ffcc33"},strokeWidth:{type:Number,default:3},pointRadius:{type:Number,default:7}},emits:["drawFinish"],setup(t,{emit:e}){const n=i.ref(null),{proxy:s}=i.getCurrentInstance(),r=s.$parent.id,o=Pc(r),a=i.computed((()=>o.value&&o.value.mapFinish));let l=null,c=null,u=null,g=i.ref(null),f=null,p=!1;const m=i.ref("Point"),_=i.ref(""),S=i.computed((()=>g.value&&0!=g.value.getFeatures().length)),w=()=>{"start"!==_.value&&(_.value="start",g.value||(g.value=new x.Vector),p||(p=!0,f=new d.Vector({source:g.value,style:{"fill-color":t.fillColor,"stroke-color":t.strokeColor,"stroke-width":t.strokeWidth,"circle-radius":t.pointRadius,"circle-fill-color":t.strokeColor}}),o.value.map.addLayer(f),o.value.map.on("singleclick",(t=>{"delete"===_.value&&v.singleClick(t)&&o.value.map.forEachFeatureAtPixel(t.pixel,(t=>(f.getSource().removeFeature(t),S.value||w(),!0)),{hitTolerance:0})}))),l=new y.Draw({source:g.value,type:m.value}),c=new y.Snap({source:g.value}),u=new y.Modify({source:g.value,deleteCondition:t=>v.altKeyOnly(t)&&v.singleClick(t),insertVertexCondition:e=>t.canInsertVertexCondition,snapToPointer:!1}),o.value.map.addInteraction(u),o.value.map.addInteraction(l),o.value.map.addInteraction(c))},C=t=>{"end"!==_.value&&(_.value="end",I(),t&&b())},b=()=>{const t=g.value.getFeatures();let i=[];t.forEach((t=>{let e=t.getGeometry(),n=e.getType(),s=e.getCoordinates();switch(n){case"Circle":s=[e.getCenter()];break;case"Point":s=[s];break;case"Polygon":s=s[0]}let r=[];s.forEach((t=>{r.push(h.toLonLat(t))}));let o={coordinates:r,type:n};if("Circle"===n){let t=e.getRadius();o.radius=t}i.push(o)})),e("drawFinish",i)},I=()=>{o.value.map.removeInteraction(u),o.value.map.removeInteraction(l),o.value.map.removeInteraction(c)};return i.onMounted((()=>{n.value.style.setProperty("--btnBackground",t.btnBackground),n.value.style.setProperty("--btnColor",t.btnColor),n.value.style.setProperty("--deleteActiveBackground",t.deleteActiveBackground),n.value.style.setProperty("--deleteActiveColor",t.deleteActiveColor),n.value.style.setProperty("--btnActiveBackground",t.btnActiveBackground),n.value.style.setProperty("--btnActiveColor",t.btnActiveColor)})),i.onBeforeUnmount((()=>{I()})),{drawCon:n,drawType:m,status:_,gyMapObj:o,mapFinish:a,hasFeature:S,startDraw:w,deleteDraw:()=>{"start"===_.value&&C(),_.value="delete"},changeDrawType:t=>{m.value=t,"end"!==_.value&&(C(),w())},endDraw:C,submitData:b,destory:I}}});const $t={};var Ut=J(jt,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.mapFinish,expression:"mapFinish"}],ref:"drawCon",staticClass:"draw-btns-list"},[i("div",{directives:[{name:"show",rawName:"v-show",value:!t.status||"end"===t.status,expression:"!status || status === 'end'"}],staticClass:"draw-start draw-btn",on:{click:t.startDraw}},[t._v("开始绘制")]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.status&&"end"!==t.status,expression:"status && status !== 'end'"}],staticClass:"draw-type draw-btn draw-type-select"},[t._v(" 绘制类型 "),i("div",{staticClass:"draw-type-select-con"},t._l(t.drawTypeList,(function(e,n){return i("div",{key:"type"+n,class:["draw-type-option",{active:t.drawType===e}],on:{click:function(i){return t.changeDrawType(e)}}},[t._v(" "+t._s(t.drawTypeCnameList[n]||"待定")+" ")])})),0)]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.status&&"end"!==t.status,expression:"status && status !== 'end'"}],staticClass:"draw-end draw-btn",on:{click:function(e){return t.endDraw(!0)}}},[t._v("绘制完成")]),i("div",{directives:[{name:"show",rawName:"v-show",value:t.hasFeature&&t.status&&"end"!==t.status,expression:"hasFeature && (status && status !== 'end')"}],class:["draw-end","draw-btn",{active:"delete"===t.status}],on:{click:t.deleteDraw}},[t._v("删除图形 ")])])}),[],!1,qt,"408c15a3",null,null);function qt(t){for(let e in $t)this[e]=$t[e]}const Kt=function(){return Ut.exports}();class Ht extends Ct{constructor(t,n,s,r){super(t,s,r),e(this,"visible"),e(this,"gradien"),e(this,"radius"),e(this,"blur"),e(this,"weight"),e(this,"heatMapData"),e(this,"maxValue"),e(this,"minValue"),e(this,"subValue"),this.gradien=s.gradien,this.weight=s.weight,this.maxValue=s.maxValue,this.minValue=s.minValue,this.heatMapData=i.computed((()=>s.data)),this.visible=i.computed((()=>s.visible)),this.radius=i.computed((()=>s.radius)),this.blur=i.computed((()=>s.blur)),this.minZoom=i.computed((()=>s.minZoom)),this.maxZoom=i.computed((()=>s.maxZoom)),this.opacity=i.computed((()=>s.opacity)),this.subValue=0,this.formatMinMaxValue(),this.draw()}formatMinMaxValue(){this.minValue<0&&(this.subValue=Math.abs(this.minValue),this.minValue=0,this.maxValue=K.flortAdd(this.maxValue,this.subValue))}checkData(){if(0!==this.heatMapData.value.length){let t=this.heatMapData.value[0];return!!Array.isArray(t)&&!(t.length<3)}return!0}addFeature(){}addFeatures(){let t=[];return this.checkData()&&(t=this.heatMapData.value.map((t=>{let e=[t[0],t[1]];const i=new u.Point(K.formatLonLatToPosition(e));return new E.default({geometry:i,data:t})}))),t}addSource(){}addLayer(){let t=this.weight?t=>this.weight(t.get("data"),t):t=>{let e=(t.get("data")||[])[2];return 0!==this.subValue&&(e=K.flortAdd(e,this.subValue)),e>this.maxValue?1:e<this.minValue?0:e/this.maxValue},e=this.addFeatures(),i=new I.default({features:e});this.layer=new d.Heatmap({source:i,blur:this.blur.value,radius:this.radius.value,visible:this.visible.value,gradient:this.gradien,weight:t,minZoom:this.minZoom.value,maxZoom:this.maxZoom.value,opacity:this.opacity.value})}addLayerWatch(){i.watch(this.heatMapData,(t=>{this.destory(),this.addLayer(),this.addLayerToMap()})),i.watch(this.visible,(t=>{var e;null==(e=this.layer)||e.setVisible(t)})),i.watch(this.radius,(t=>{var e;null==(e=this.layer)||e.setRadius(t)})),i.watch(this.blur,(t=>{var e;null==(e=this.layer)||e.setBlur(t)})),i.watch(this.minZoom,(t=>{var e;null==(e=this.layer)||e.setMinZoom(t)})),i.watch(this.maxZoom,(t=>{var e;null==(e=this.layer)||e.setMaxZoom(t)})),i.watch(this.opacity,(t=>{var e;null==(e=this.layer)||e.setOpacity(t)}))}addPropsWatch(){i.watch(this.stylesObj,(()=>{}))}}const Jt={data:{type:Array,default:()=>[]},visible:{type:Boolean,default:!0},gradien:{type:Array,default:()=>["#00f","#0ff","#0f0","#ff0","#f00"]},radius:{type:Number,default:100},blur:{type:Number,default:100},maxValue:{type:Number,default:1},minValue:{type:Number,default:0},subValue:{type:Number,default:0},weight:{type:[String,Function],default:""},minZoom:{type:Number,default:1},maxZoom:{type:Number,default:18},opacity:{type:Number,default:1},mapId:{type:String,default:""}},Qt=i.defineComponent({name:"GymapHeat",props:{...Jt},setup(t){const{proxy:e}=i.getCurrentInstance(),n=t.mapId||e.$parent.id;let s=null;i.onMounted((()=>{s=new Ht(n,t.position,t)}));i.onBeforeUnmount((()=>{s.destory(),s=null}))}});const te={};var ee=J(Qt,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,ie,null,null,null);function ie(t){for(let e in te)this[e]=te[e]}const ne=function(){return ee.exports}(),se=i.defineComponent({name:"GymapLonlat",props:{showCon:{type:Boolean,default:!0},className:{type:String,default:""}},emits:["getLonlat"],setup(t,{emit:e}){const{proxy:n}=i.getCurrentInstance(),s=n.$parent.id,r=Pc(s),o=i.computed((()=>r.value&&r.value.mapFinish));const a=i.ref(""),l=t=>{let i=t.coordinate,n=h.toLonLat(i);a.value=n.join(","),e("getLonlat",a.value)},c=()=>{o.value&&r.value.map.on("click",l)};i.watch(o,(()=>{c()})),i.onMounted((()=>{c()}));return i.onBeforeUnmount((()=>{r.value.map&&r.value.map.un("click",l)})),{className:t.className,lonlat:a}}});const re={};var oe=J(se,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{directives:[{name:"show",rawName:"v-show",value:t.showCon,expression:"showCon"}],class:["GySjmapLonlat-con",t.className]},[t._v(" "+t._s(t.lonlat)+" ")])}),[],!1,ae,"f531d402",null,null);function ae(t){for(let e in re)this[e]=re[e]}const le=function(){return oe.exports}(),he="propertychange",ce="change",ue="click";const de=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function ge(t,e){return t>e?1:t<e?-1:0}function fe(t,e){return t<e?1:t>e?-1:0}function pe(t,e,i){if(t[0]<=e)return 0;const n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let s=1;s<n;++s){const n=t[s];if(n===e)return s;if(n<e)return i(e,t[s-1],n)>0?s-1:s}return n-1}if(i>0){for(let i=1;i<n;++i)if(t[i]<e)return i-1;return n-1}if(i<0){for(let i=1;i<n;++i)if(t[i]<=e)return i;return n-1}for(let s=1;s<n;++s){if(t[s]==e)return s;if(t[s]<e)return t[s-1]-e<e-t[s]?s-1:s}return n-1}function me(t,e,i){for(;e<i;){const n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function _e(t,e){const i=Array.isArray(e)?e:[e],n=i.length;for(let s=0;s<n;s++)t[t.length]=i[s]}function ye(t,e){const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function xe(){return!0}function ve(){}function Se(t){let e,i,n;return function(){const s=Array.prototype.slice.call(arguments);return i&&this===n&&ye(s,i)||(n=this,i=s,e=t.apply(this,arguments)),e}}function we(t){for(const e in t)delete t[e]}function Ce(t){let e;for(e in t)return!1;return!e}const be=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}};const Ie=class extends de{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e="string"==typeof t,i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const s=e?new be(t):t;s.target||(s.target=this.eventTarget_||this);const r=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});let a;i in r||(r[i]=0,o[i]=0),++r[i];for(let l=0,h=n.length;l<h;++l)if(a="handleEvent"in n[l]?n[l].handleEvent(s):n[l].call(this,s),!1===a||s.propagationStopped){a=!1;break}if(0===--r[i]){let t=o[i];for(delete o[i];t--;)this.removeEventListener(i,ve);delete r[i]}return a}disposeInternal(){this.listeners_&&we(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=ve,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}};function Me(t,e,i,n,s){if(s){const s=i;i=function(r){return t.removeEventListener(e,i),s.call(null!=n?n:this,r)}}else n&&n!==t&&(i=i.bind(n));const r={target:t,type:e,listener:i};return t.addEventListener(e,i),r}function Re(t,e,i,n){return Me(t,e,i,n,!0)}function Ee(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),we(t))}class Ae extends Ie{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ce)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let s=0;s<i;++s)n[s]=Me(this,t[s],e);return n}return Me(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let s=0;s<n;++s)i[s]=Re(this,t[s],e)}else i=Re(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)Ee(t[e]);else Ee(t)}(i);else if(Array.isArray(t))for(let n=0,s=t.length;n<s;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)}}Ae.prototype.on,Ae.prototype.once,Ae.prototype.un;const ke=Ae;function Le(){throw new Error("Unimplemented abstract method.")}let Te=0;function Fe(t){return t.ol_uid||(t.ol_uid=String(++Te))}class Oe extends be{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}const Pe=class extends ke{constructor(t){super(),this.on,this.once,this.un,Fe(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new Oe(i,t,e)),i=he,this.hasListener(i)&&this.dispatchEvent(new Oe(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],Ce(this.values_)&&(this.values_=null),e||this.notify(t,i)}}};function De(t,e){if(!t)throw new Error(e)}class Ge extends Pe{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new Ge(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Ee(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Me(t,ce,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;let e;if(Array.isArray(t))e=t;else{De("function"==typeof t.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`");e=[t]}return function(){return e}}(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}const Ne=Ge,We=0,ze=1,Be=2,Ze=4,Xe=8,Ye=16;function Ve(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function je(t,e,i){let n,s;return n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0,s=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0,n*n+s*s}function $e(t,e){return qe(t,e[0],e[1])}function Ue(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function qe(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function Ke(t,e){const i=t[0],n=t[1],s=t[2],r=t[3],o=e[0],a=e[1];let l=We;return o<i?l|=Ye:o>s&&(l|=Ze),a<n?l|=Xe:a>r&&(l|=Be),l===We&&(l=ze),l}function He(t,e,i,n,s){return s?(s[0]=t,s[1]=e,s[2]=i,s[3]=n,s):[t,e,i,n]}function Je(t){return He(1/0,1/0,-1/0,-1/0,t)}function Qe(t,e){const i=t[0],n=t[1];return He(i,n,i,n,e)}function ti(t,e,i,n,s){return ii(Je(s),t,e,i,n)}function ei(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ii(t,e,i,n,s){for(;i<n;i+=s)ni(t,e[i],e[i+1]);return t}function ni(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function si(t){return[t[0],t[1]]}function ri(t){return[t[2],t[1]]}function oi(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ai(t,e,i,n,s){const[r,o,a,l,h,c,u,d]=function(t,e,i,n){const s=e*n[0]/2,r=e*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=s*o,h=s*a,c=r*o,u=r*a,d=t[0],g=t[1];return[d-l+u,g-h-c,d-l-u,g-h+c,d+l-u,g+h+c,d+l+u,g+h-c,d-l+u,g-h-c]}(t,e,i,n);return He(Math.min(r,a,h,u),Math.min(o,l,c,d),Math.max(r,a,h,u),Math.max(o,l,c,d),s)}function li(t){return t[3]-t[1]}function hi(t){return[t[0],t[3]]}function ci(t){return[t[2],t[3]]}function ui(t){return t[2]-t[0]}function di(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function gi(t){return t[2]<t[0]||t[3]<t[1]}function fi(t,e){const i=e.getExtent(),n=oi(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const e=ui(i),s=Math.floor((n[0]-i[0])/e)*e;t[0]-=s,t[2]-=s}return t}function pi(t,e,i){return Math.min(Math.max(t,e),i)}function mi(t,e,i,n,s,r){const o=s-i,a=r-n;if(0!==o||0!==a){const l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=s,n=r):l>0&&(i+=o*l,n+=a*l)}return _i(t,e,i,n)}function _i(t,e,i,n){const s=i-t,r=n-e;return s*s+r*r}function yi(t){return 180*t/Math.PI}function xi(t){return t*Math.PI/180}function vi(t,e){const i=t%e;return i*e<0?i+e:i}function Si(t,e,i){return t+i*(e-t)}function wi(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function Ci(t,e,i){if(t>=e&&t<i)return t;const n=i-e;return((t-e)%n+n)%n+e}function bi(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Ii(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Mi(t,e){if(e.canWrapX()){const i=ui(e.getExtent()),n=function(t,e,i){const n=e.getExtent();let s=0;e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])&&(i=i||ui(n),s=Math.floor((t[0]-n[0])/i));return s}(t,e,i);n&&(t[0]-=n*i)}return t}const Ri={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};const Ei=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Ri[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}},Ai=6378137,ki=Math.PI*Ai,Li=[-ki,-ki,ki,ki],Ti=[-180,-85,180,85],Fi=Ai*Math.log(Math.tan(Math.PI/2));class Oi extends Ei{constructor(t){super({code:t,units:"m",extent:Li,global:!0,worldExtent:Ti,getPointResolution:function(t,e){return t/Math.cosh(e[1]/Ai)}})}}const Pi=[new Oi("EPSG:3857"),new Oi("EPSG:102100"),new Oi("EPSG:102113"),new Oi("EPSG:900913"),new Oi("http://www.opengis.net/def/crs/EPSG/0/3857"),new Oi("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Di(t,e,i,n){const s=t.length;i=i>1?i:2,n=null!=n?n:i,void 0===e&&(e=i>2?t.slice():new Array(s));for(let r=0;r<s;r+=n){e[r]=ki*t[r]/180;let i=Ai*Math.log(Math.tan(Math.PI*(+t[r+1]+90)/360));i>Fi?i=Fi:i<-Fi&&(i=-Fi),e[r+1]=i}return e}function Gi(t,e,i,n){const s=t.length;i=i>1?i:2,n=null!=n?n:i,void 0===e&&(e=i>2?t.slice():new Array(s));for(let r=0;r<s;r+=n)e[r]=180*t[r]/ki,e[r+1]=360*Math.atan(Math.exp(t[r+1]/Ai))/Math.PI-90;return e}const Ni=[-180,-90,180,90],Wi=6378137*Math.PI/180;class zi extends Ei{constructor(t,e){super({code:t,units:"degrees",extent:Ni,axisOrientation:e,global:!0,metersPerUnit:Wi,worldExtent:Ni})}}const Bi=[new zi("CRS:84"),new zi("EPSG:4326","neu"),new zi("urn:ogc:def:crs:OGC:1.3:CRS84"),new zi("urn:ogc:def:crs:OGC:2:84"),new zi("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new zi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new zi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Zi={};let Xi={};function Yi(t,e,i){const n=t.getCode(),s=e.getCode();n in Xi||(Xi[n]={}),Xi[n][s]=i}function Vi(t,e){return t in Xi&&e in Xi[t]?Xi[t][e]:null}const ji=.9996,$i=.00669438,Ui=$i*$i,qi=Ui*$i,Ki=$i/(1-$i),Hi=Math.sqrt(1-$i),Ji=(1-Hi)/(1+Hi),Qi=Ji*Ji,tn=Qi*Ji,en=tn*Ji,nn=en*Ji,sn=.9983242984503243,rn=15*Ui/256+45*qi/1024,on=35*qi/3072,an=1.5*Ji-27/32*tn+269/512*nn,ln=21/16*Qi-55/32*en,hn=151/96*tn-417/128*nn,cn=1097/512*en,un=6378137;function dn(t,e,i){const n=t-5e5,s=(i.north?e:e-1e7)/ji/(un*sn),r=s+an*Math.sin(2*s)+ln*Math.sin(4*s)+hn*Math.sin(6*s)+cn*Math.sin(8*s),o=Math.sin(r),a=o*o,l=Math.cos(r),h=o/l,c=h*h,u=c*c,d=1-$i*a,g=Math.sqrt(1-$i*a),f=Ki*l**2,p=f*f,m=n/(un/g*ji),_=m*m,y=_*m,x=y*m,v=x*m,S=r-h/((1-$i)/d)*(_/2-x/24*(5+3*c+10*f-4*p-9*Ki))+v*m/720*(61+90*c+298*f+45*u-252*Ki-3*p);let w=(m-y/6*(1+2*c+f)+v/120*(5-2*f+28*c-3*p+8*Ki+24*u))/l;return w=Ci(w+xi(fn(i.number)),-Math.PI,Math.PI),[yi(w),yi(S)]}function gn(t,e,i){t=Ci(t,-180,180),e<-80?e=-80:e>84&&(e=84);const n=xi(e),s=Math.sin(n),r=Math.cos(n),o=s/r,a=o*o,l=a*a,h=xi(t),c=xi(fn(i.number)),u=un/Math.sqrt(1-$i*s**2),d=Ki*r**2,g=r*Ci(h-c,-Math.PI,Math.PI),f=g*g,p=f*g,m=p*g,_=m*g,y=_*g,x=un*(sn*n-.002514607064228144*Math.sin(2*n)+rn*Math.sin(4*n)-on*Math.sin(6*n)),v=ji*u*(g+p/6*(1-a+d)+_/120*(5-18*a+l+72*d-58*Ki))+5e5;let S=ji*(x+u*o*(f/2+m/24*(5-a+9*d+4*d**2)+y/720*(61-58*a+l+600*d-330*Ki)));return i.north||(S+=1e7),[v,S]}function fn(t){return 6*(t-1)-180+3}const pn=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function mn(t){let e=0;for(const s of pn){const i=t.match(s);if(i){e=parseInt(i[1]);break}}if(!e)return null;let i=0,n=!1;return e>32700&&e<32761?i=e-32700:e>32600&&e<32661&&(n=!0,i=e-32600),i?{number:i,north:n}:null}function _n(t,e){return function(i,n,s,r){const o=i.length;s=s>1?s:2,r=null!=r?r:s,n||(n=s>2?i.slice():new Array(o));for(let a=0;a<o;a+=r){const s=i[a],r=i[a+1],o=t(s,r,e);n[a]=o[0],n[a+1]=o[1]}return n}}const yn=[function(t){const e=mn(t.getCode());return e?{forward:_n(gn,e),inverse:_n(dn,e)}:null}],xn=[function(t){return mn(t)?new Ei({code:t,units:"m"}):null}];let vn=!0;function Sn(t,e){if(void 0!==e)for(let i=0,n=t.length;i<n;++i)e[i]=t[i];else e=t.slice();return e}function wn(t){!function(t,e){Zi[t]=e}(t.getCode(),t),Yi(t,t,Sn)}function Cn(t){if("string"!=typeof t)return t;const e=Zi[i=t]||Zi[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null;var i;if(e)return e;for(const n of xn){const e=n(t);if(e)return e}return null}function bn(t){!function(t){t.forEach(wn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Yi(e,t,Sn)}))}))}function In(t,e){return t?"string"==typeof t?Cn(t):t:Cn(e)}function Mn(t,e){const i=t.getCode(),n=e.getCode();let s=Vi(i,n);if(s)return s;let r=null,o=null;for(const l of yn)r||(r=l(t)),o||(o=l(e));if(!r&&!o)return null;const a="EPSG:4326";if(o)if(r)s=Rn(r.inverse,o.forward);else{const t=Vi(i,a);t&&(s=Rn(t,o.forward))}else{const t=Vi(a,n);t&&(s=Rn(r.inverse,t))}return s&&(wn(t),wn(e),Yi(t,e,s)),s}function Rn(t,e){return function(i,n,s,r){return n=t(i,n,s,r),e(n,n,s,r)}}function En(t,e){return Mn(Cn(t),Cn(e))}function An(t,e){return t}function kn(t,e){return vn&&!Ii(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(vn=!1),t}function Ln(t,e){return t}function Tn(t,e){return t}var Fn,On,Pn;function Dn(t,e){const i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Gn(t,e,i,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return t[0]=n*h,t[1]=s*l,t[2]=-n*l,t[3]=s*h,t[4]=o*n*h-a*n*l+e,t[5]=o*s*l+a*s*h+i,t}bn(Pi),bn(Bi),Fn=Pi,On=Di,Pn=Gi,Bi.forEach((function(t){Fn.forEach((function(e){Yi(t,e,On),Yi(e,t,Pn)}))})),new Array(6);const Nn=[1e5,1e5,1e5,1e5,2,2];function Wn(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}function zn(t,e,i,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=e;l<i;l+=n){const e=t[l],i=t[l+1];r[a++]=s[0]*e+s[2]*i+s[4],r[a++]=s[1]*e+s[3]*i+s[5];for(let n=2;n<o;n++)r[a++]=t[l+n]}return r&&r.length!=a&&(r.length=a),r}function Bn(t,e,i,n,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],c=r[1];let u=0;for(let d=e;d<i;d+=n){const e=t[d]-h,i=t[d+1]-c;o[u++]=h+e*a-i*l,o[u++]=c+e*l+i*a;for(let s=d+2;s<d+n;++s)o[u++]=t[s]}return o&&o.length!=u&&(o.length=u),o}const Zn=[1,0,0,1,0,0],Xn=[NaN,NaN];const Yn=class extends Pe{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=Se(((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInte