From 1c84359c953b0194e3dbf2f55802c03b118de8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Fri, 20 May 2022 22:02:48 +0200 Subject: [PATCH] Release version 0.0.7. --- dist/openlayers-indoorequal.umd.min.js | 4 +--- package.json | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/openlayers-indoorequal.umd.min.js b/dist/openlayers-indoorequal.umd.min.js index 1957346..f2e63e9 100644 --- a/dist/openlayers-indoorequal.umd.min.js +++ b/dist/openlayers-indoorequal.umd.min.js @@ -1,3 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).IndoorEqual={})}(this,(function(t){"use strict";var e=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),i="propertychange",r=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function n(t,e){return t>e?1:t0)},i.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var r=i.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[r]=h,++this.pendingRemovals_[t]):(i.splice(r,1),0===i.length&&delete this.listeners_[t]))}},i}(r),y="change",v="error",m="load";function x(t,e,i,r,n){if(r&&r!==t&&(i=i.bind(r)),n){var o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function w(t,e,i,r){return x(t,e,i,r,!0)}function S(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),c(t))}var T=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),C=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return T(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(y)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,r=new Array(i),n=0;n1?(i=n,r=o):l>0&&(i+=s*l,r+=a*l)}return $(t,e,i,r)}function $(t,e,i,r){var n=i-t,o=r-e;return n*n+o*o}function Q(t){return t*Math.PI/180}function tt(t,e){var i=t%e;return i*e<0?i+e:i}function et(t,e,i){return t+i*(e-t)}var it=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),rt=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var r=u({},e);return"object"==typeof e.properties&&(delete r.properties,u(r,e.properties)),r[B]=void 0!==e.opacity?e.opacity:1,D("number"==typeof r[B],64),r[X]=void 0===e.visible||e.visible,r[z]=e.zIndex,r[N]=void 0!==e.maxResolution?e.maxResolution:1/0,r[U]=void 0!==e.minResolution?e.minResolution:0,r[V]=void 0!==e.minZoom?e.minZoom:-1/0,r[Y]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,i.setProperties(r),i.state_=null,i}return it(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=K(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return b()},e.prototype.getLayerStatesArray=function(t){return b()},e.prototype.getExtent=function(){return this.get(W)},e.prototype.getMaxResolution=function(){return this.get(N)},e.prototype.getMinResolution=function(){return this.get(U)},e.prototype.getMinZoom=function(){return this.get(V)},e.prototype.getMaxZoom=function(){return this.get(Y)},e.prototype.getOpacity=function(){return this.get(B)},e.prototype.getSourceState=function(){return b()},e.prototype.getVisible=function(){return this.get(X)},e.prototype.getZIndex=function(){return this.get(z)},e.prototype.setExtent=function(t){this.set(W,t)},e.prototype.setMaxResolution=function(t){this.set(N,t)},e.prototype.setMinResolution=function(t){this.set(U,t)},e.prototype.setMaxZoom=function(t){this.set(Y,t)},e.prototype.setMinZoom=function(t){this.set(V,t)},e.prototype.setOpacity=function(t){D("number"==typeof t,64),this.set(B,t)},e.prototype.setVisible=function(t){this.set(X,t)},e.prototype.setZIndex=function(t){this.set(z,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(L),nt="prerender",ot="postrender",st="precompose",at="undefined",lt="loading",ht="ready",ut="error",ct=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ft=function(t){function e(e){var i=this,r=u({},e);delete r.source,(i=t.call(this,r)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Z,i.handleSourcePropertyChange_);var n=e.source?e.source:null;return i.setSource(n),i}return ct(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(Z)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():at},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(S(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=x(t,y,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(S(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(S(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=x(t,st,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);D(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=x(this,y,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Z,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(rt),pt=ft;function dt(t,e,i,r,n){gt(t,e,i||0,r||t.length-1,n||yt)}function gt(t,e,i,r,n){for(;r>i;){if(r-i>600){var o=r-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),h=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);gt(t,e,Math.max(i,Math.floor(e-s*l/o+h)),Math.min(r,Math.floor(e+(o-s)*l/o+h)),n)}var u=t[e],c=i,f=r;for(_t(t,i,e),n(t[r],u)>0&&_t(t,i,r);c0;)f--}0===n(t[i],u)?_t(t,i,f):_t(t,++f,r),f<=e&&(i=f+1),e<=f&&(r=f-1)}}function _t(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function yt(t,e){return te?1:0}class vt{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!Ot(t,e))return i;const r=this.toBBox,n=[];for(;e;){for(let o=0;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(r,n,e)}_split(t,e){const i=t[e],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);const o=this._chooseSplitIndex(i,n,r),s=Pt(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,xt(i,this.toBBox),xt(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,e){this.data=Pt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,xt(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let r,n=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=wt(t,0,s,this.toBBox),a=wt(t,s,i,this.toBBox),l=Rt(e,a),h=Et(e)+Et(a);l=e;r--){const e=t.children[r];St(s,t.leaf?n(e):e),a+=bt(s)}return a}_adjustParentBBoxes(t,e,i){for(let r=i;r>=0;r--)St(e[r],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():xt(t[i],this.toBBox)}}function mt(t,e,i){if(!i)return e.indexOf(t);for(let r=0;r=t.minX&&e.maxY>=t.minY}function Pt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function It(t,e,i,r,n){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((i-e)/r/2)*r;dt(t,s,e,i,n),o.push(e,s,s,i)}}var Lt=0,Mt=1,At=2,Dt=3;function kt(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Gt=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=kt(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return b()},t.prototype.getImage=function(t){return b()},t.prototype.getHitDetectionImage=function(){return b()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return b()},t.prototype.getImageSize=function(){return b()},t.prototype.getOrigin=function(){return b()},t.prototype.getSize=function(){return b()},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=kt(t)},t.prototype.listenImageChange=function(t){b()},t.prototype.load=function(){b()},t.prototype.unlistenImageChange=function(t){b()},t}(),jt=Gt,Bt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Xt=/^([a-z]*)$|^hsla?\(.*\)$/i;function Wt(t){return"string"==typeof t?t:Yt(t)}var zt=function(){var t={},e=0;return function(i){var r;if(t.hasOwnProperty(i))r=t[i];else{if(e>=1024){var n=0;for(var o in t)0==(3&n++)&&(delete t[o],--e)}r=function(t){var e,i,r,n,o;Xt.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t));if(Bt.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),n=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,r=(r<<4)+r,l&&(n=(n<<4)+n)),o=[e,i,r,n/255]}else 0==t.indexOf("rgba(")?Ut(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Ut(o)):D(!1,14);return o}(i),t[i]=r,++e}return r}}();function Nt(t){return Array.isArray(t)?t:zt(t)}function Ut(t){return t[0]=K(t[0]+.5|0,0,255),t[1]=K(t[1]+.5|0,0,255),t[2]=K(t[2]+.5|0,0,255),t[3]=K(t[3],0,1),t}function Yt(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+i+","+r+","+(void 0===t[3]?1:t[3])+")"}function Vt(t){return Array.isArray(t)?Yt(t):t}var Zt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";Zt.indexOf("firefox"),-1!==Zt.indexOf("safari")&&Zt.indexOf("chrom"),-1!==Zt.indexOf("webkit")&&Zt.indexOf("edge"),Zt.indexOf("macintosh");var Kt="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,qt="undefined"!=typeof Image&&Image.prototype.decode;function Ht(t,e,i,r){var n;return i&&i.length?n=i.shift():Kt?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",r)}function Jt(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}}();var $t=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Qt=["style","variant","weight","size","lineHeight","family"],te=function(t){var e=t.match($t);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,n=Qt.length;rn&&(l|=ii),ao&&(l|=ei),l===Qe&&(l=ti),l}function yi(){return[1/0,1/0,-1/0,-1/0]}function vi(t,e,i,r,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=r,n):[t,e,i,r]}function mi(t){return vi(1/0,1/0,-1/0,-1/0,t)}function xi(t,e){var i=t[0],r=t[1];return vi(i,r,i,r,e)}function wi(t,e,i,r,n){return Ci(mi(n),t,e,i,r)}function Si(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Ti(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Ci(t,e,i,r,n){for(;ie[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ji(t,e,i,r){var n=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;ac&&(this.instructions.push([$e.CUSTOM,c,o,t,i,Bi]),this.hitDetectionInstructions.push([$e.CUSTOM,c,o,t,r||i,Bi]));break;case Oe:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([$e.CUSTOM,c,o,t,i]),this.hitDetectionInstructions.push([$e.CUSTOM,c,o,t,r||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[$e.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[$e.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,r,n=e.length,s=-1;for(t=0;tthis.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[$e.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[$e.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,r=t.lineCap,n=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=r||n!=t.currentLineDash&&!a(t.currentLineDash,n)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=r,t.currentLineDash=n,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=l,t.currentMiterLimit=h)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[$e.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=(e=this.maxExtent,i?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i):e.slice()),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;ci(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}var e,i;return this.bufferedMaxExtent_},e}(oi),Ui=Ni,Yi=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Vi=function(t){function e(e,i,r,n){var o=t.call(this,e,i,r,n)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return Yi(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([$e.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([$e.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),r=t.getStride(),n=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([$e.DRAW_IMAGE,n,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([$e.DRAW_IMAGE,n,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),r=t.getSize(),n=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0]*this.imagePixelRatio_,this.originY_=s[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(Ui),Zi=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ki=function(t){function e(e,i,r,n){return t.call(this,e,i,r,n)||this}return Zi(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,r){var n=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,r,!1,!1),s=[$e.MOVE_TO_LINE_TO,n,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([$e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,oe,0],He);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(qe),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,r=i.strokeStyle,n=i.lineWidth;if(void 0!==r&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([$e.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],He);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=o.length;h0;){for(var c=h.pop(),f=h.pop(),p=0,d=t[f],g=t[f+1],_=t[c],y=t[c+1],v=f+r;vp&&(u=v,p=m)}p>n&&(l[(u-e)/r]=1,f+r0&&g>p)&&(d<0&&_0&&_>d)?(a=c,l=f):(o[s++]=a,o[s++]=l,h=a,u=l,a=c,l=f)}}return o[s++]=a,o[s++]=l,s}function $i(t,e,i,r,n,o,s,a){for(var l=0,h=i.length;lt&&(y>_&&(_=y,d=v,g=o),y=0,v=o-n)),s=a,u=f,c=p),l=m,h=x}return(y+=a)>_?[v,o]:[d,g]}var or,sr=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ar={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},lr=function(t){function e(e,i,r,n){var o=t.call(this,e,i,r,n)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return sr(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,r=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||r)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,h=t.getStride();if(n.placement!==rr||a!=Pe&&a!=Ae&&a!=Le&&a!=De){var u=n.overflow?null:[];switch(a){case Oe:case Me:l=t.getFlatCoordinates();break;case Pe:l=t.getFlatMidpoint();break;case Ge:l=t.getCenter();break;case Ae:l=t.getFlatMidpoints(),h=2;break;case Le:l=t.getFlatInteriorPoint(),n.overflow||u.push(l[2]/this.resolution),h=3;break;case De:var c=t.getFlatInteriorPoints();l=[];for(S=0,T=c.length;SF[2]}else E=x>b;var O,P=Math.PI,I=[],L=S+r===e;if(_=0,y=T,f=t[e=S],p=t[e+1],L){v(),O=Math.atan2(p-g,f-d),E&&(O+=O>0?-P:P);var M=(b+x)/2,A=(R+w)/2;return I[0]=[M,A,(C-o)/2,O,n],I}for(var D=0,k=n.length;D0?-P:P),void 0!==O){var j=G-O;if(j+=j>P?-2*P:j<-P?2*P:0,Math.abs(j)>s)return null}O=G;for(var B=D,X=0;Dt?t-l:n,x=o+h>e?e-h:o,w=p[3]+m*c[0]+p[1],S=p[0]+x*c[1]+p[2],T=y-p[3],C=v-p[0];return(d||0!==u)&&(Br[0]=T,zr[0]=T,Br[1]=C,Xr[1]=C,Xr[0]=T+w,Wr[0]=Xr[0],Wr[1]=C+S,zr[1]=Wr[1]),0!==u?(xr(_=Sr([1,0,0,1,0,0],i,r,1,1,u,-i,-r),Br),xr(_,Xr),xr(_,Wr),xr(_,zr),vi(Math.min(Br[0],Xr[0],Wr[0],zr[0]),Math.min(Br[1],Xr[1],Wr[1],zr[1]),Math.max(Br[0],Xr[0],Wr[0],zr[0]),Math.max(Br[1],Xr[1],Wr[1],zr[1]),jr)):vi(Math.min(T,T+w),Math.min(C,C+S),Math.max(T,T+w),Math.max(C,C+S),jr),f&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:jr[0],minY:jr[1],maxX:jr[2],maxY:jr[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,r,n,o,s){var a=!(!o&&!s),l=r.declutterBox,h=t.canvas,u=s?s[2]*r.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,Br,Xr,Wr,zr,o,s),we(t,r.canvasTransform,n,i,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=xr(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,i,r){var n=this.textStates[e],o=this.createLabel(t,e,r,i),s=this.strokeStates[i],a=this.pixelRatio,l=Yr(t,n.textAlign||le),h=ar[n.textBaseline||he],u=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*n.scale[0])+2*(.5-l)*u,anchorY:h*o.height/a+2*(.5-h)*u}},t.prototype.execute_=function(t,e,i,r,n,o,s,l){var h,u,c;this.pixelCoordinates_&&a(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Ar(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),u=this.renderedTransform_,c=i,u[0]=c[0],u[1]=c[1],u[2]=c[2],u[3]=c[3],u[4]=c[4],u[5]=c[5]);for(var f,p,d,g,_,y,v,m,x,w,S,T,C,E,b,R,F=0,O=r.length,P=0,I=0,L=0,M=null,A=null,D=this.coordinateCache_,k=this.viewRotation_,G=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},B=this.instructions!=r||this.overlaps?0:200;FB&&(this.fill_(t),I=0),L>B&&(t.stroke(),L=0),I||L||(t.beginPath(),g=NaN,_=NaN),++F;break;case $e.CIRCLE:var W=h[P=X[1]],z=h[P+1],N=h[P+2]-W,U=h[P+3]-z,Y=Math.sqrt(N*N+U*U);t.moveTo(W+Y,z),t.arc(W,z,Y,0,2*Math.PI,!0),++F;break;case $e.CLOSE_PATH:t.closePath(),++F;break;case $e.CUSTOM:P=X[1],f=X[2];var V=X[3],Z=X[4],K=6==X.length?X[5]:void 0;j.geometry=V,j.feature=C,F in D||(D[F]=[]);var q=D[F];K?K(h,P,f,2,q):(q[0]=h[P],q[1]=h[P+1],q.length=2),Z(q,j),++F;break;case $e.DRAW_IMAGE:P=X[1],f=X[2],m=X[3],p=X[4],d=X[5];var H=X[6],J=X[7],$=X[8],Q=X[9],tt=X[10],et=X[11],it=X[12],rt=X[13],nt=X[14];if(!m&&X.length>=19){x=X[18],w=X[19],S=X[20],T=X[21];var ot=this.drawLabelWithPointPlacement_(x,w,S,T);m=ot.label,X[3]=m;var st=X[22];p=(ot.anchorX-st)*this.pixelRatio,X[4]=p;var at=X[23];d=(ot.anchorY-at)*this.pixelRatio,X[5]=d,H=m.height,X[6]=H,rt=m.width,X[13]=rt}var lt=void 0;X.length>24&&(lt=X[24]);var ht=void 0,ut=void 0,ct=void 0;X.length>16?(ht=X[15],ut=X[16],ct=X[17]):(ht=ue,ut=!1,ct=!1),tt&&G?et+=k:tt||G||(et-=k);for(var ft=0;Pi)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+n)*e+(t+o))+3),n>0&&a.push(4*((t-n)*e+(t+o))+3),o>0&&(a.push(4*((t+n)*e+(t-o))+3),n>0&&a.push(4*((t-n)*e+(t-o))+3))}for(var l=[],h=(n=0,r.length);n0){if(!s||f!==Pr&&f!==Mr||-1!==s.indexOf(t)){var h=(p[n]-3)/4,u=r-h%a,d=r-(h/a|0),g=o(t,e,u*u+d*d);if(g)return g}c.clearRect(0,0,a,a);break}}var g,_,y,v,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(n),g=x.length-1;g>=0;--g){var w=x[g].toString();for(y=this.executorsByZIndex_[w],_=Kr.length-1;_>=0;--_)if(void 0!==(v=y[f=Kr[_]])&&(m=v.executeHitDetection(c,l,i,d,u)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],r=e[1],n=e[2],o=e[3],s=[i,r,i,o,n,o,n,r];return Ar(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return p(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,r,o,s,a){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(n),this.maxExtent_&&(t.save(),this.clip(t,i));var h,u,c,f,p,d,g=s||Kr;for(a&&l.reverse(),h=0,u=l.length;h1?i:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(r));for(var s=0;sun?a=un:a<-un&&(a=-un),o[s+1]=a}return o}function dn(t,e,i){var r=t.length,n=i>1?i:2,o=e;void 0===o&&(o=n>2?t.slice():new Array(r));for(var s=0;sr[2])){var o=i||ki(r);n=Math.floor((t[0]-r[0])/o)}return n}(t,e,i);r&&(t[0]-=r*i)}return t}function Fn(t,e,i){var r;if(void 0!==e){for(var n=0,o=t.length;nthis.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var r=lo(t,e,i);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,i,r){var n=lo(t,e,i);this.cache_[n]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),uo=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),co=function(t){function e(e,i,r,n){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=i,o.state=n,o}return uo(e,t),e.prototype.changed=function(){this.dispatchEvent(y)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return b()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){b()},e}(_),fo=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function po(t,e,i){var r=t;if(r.src&&qt){var n=r.decode(),o=!0;return n.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var s=[w(r,m,e),w(r,v,i)];return function(){s.forEach(S)}}!function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,r,Lt)||this;return a.src_=n,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Lt,a.imageLoadFunction_=s,a}fo(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Dt,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Li(this.extent)/this.image_.height),this.state=At,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Lt&&this.state!=Dt||(this.state=Mt,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=po(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Li(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(co);var go=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_o=null,yo=function(t){function e(e,i,r,n,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==n&&(a.image_.crossOrigin=n),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=r,a.src_=i,a.tainted_,a}return go(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===At){_o||(_o=Ht(1,1)),_o.drawImage(this.image_,0,0);try{_o.getImageData(0,0,1,1),this.tainted_=!1}catch(t){_o=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(y)},e.prototype.handleImageError_=function(){this.imageState_=Dt,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=At,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=Ht(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Lt){this.imageState_=Mt;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=po(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===At){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=Wt(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var r=i.getImageData(0,0,e.width,e.height),n=r.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=n.length;h0,6);var c=void 0!==r.src?Lt:At;return i.color_=void 0!==r.color?Nt(r.color):null,i.iconImage_=function(t,e,i,r,n,o){var s=ho.get(e,r,o);return s||(s=new yo(t,e,i,r,n,o),ho.set(e,r,o,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==r.offset?r.offset:[0,0],i.offsetOrigin_=void 0!==r.offsetOrigin?r.offsetOrigin:so,i.origin_=null,i.size_=void 0!==r.size?r.size:null,i}return vo(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==io||this.anchorYUnits_==io){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==io&&(t[0]*=e[0]),this.anchorYUnits_==io&&(t[1]*=e[1])}if(this.anchorOrigin_!=so){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ao&&this.anchorOrigin_!=oo||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=no&&this.anchorOrigin_!=oo||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=so){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=ao&&this.offsetOrigin_!=oo||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=no&&this.offsetOrigin_!=oo||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(y,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(y,t)},e}(jt),xo=mo,wo=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=kt(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Fe({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:ir,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=kt(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),So=wo,To=.5;function Co(t,e,i,r,o,s,a){var l=Ht(t[0]*To,t[1]*To);l.imageSmoothingEnabled=!1;for(var h=l.canvas,u=new eo(l,To,o,null,a),c=i.length,f=Math.floor(16777215/c),p={},d=1;d<=c;++d){var g=i[d-1],_=g.getStyleFunction()||r;if(r){var y=_(g,s);if(y){Array.isArray(y)||(y=[y]);for(var v="#"+("000000"+(d*f).toString(16)).slice(-6),m=0,x=y.length;mp[2];)y=g*++_,h.push(this.getRenderTransform(r,n,o,To,u,c,y).slice()),d-=g}this.hitDetectionImageData_=Co(i,h,this.renderedFeatures_,l.getStyleFunction(),a,n,o)}e(Eo(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,r,n){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,h=this.getLayer(),u={},c=function(t,e,i){var o=F(t),s=u[o];if(s){if(!0!==s&&i=i[2])){var n=ki(i),o=Math.floor((r[0]-i[0])/n)*n;t[0]-=o,t[2]-=o}return t}(m[0],u);T[0]x[0]&&T[2]>x[2]&&m.push([T[0]-w,T[1],T[2]-w,T[3]])}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==p&&this.renderedRenderOrder_==g&&di(this.wrappedRenderedExtent_,y))return a(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var C,E=new ur(Oo(c,f),y,c,f);this.getLayer().getDeclutter()&&(C=new ur(Oo(c,f),y,c,f));for(var b=0,R=m.length;b=0;s--)this.postProcessPasses_[s].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,e?i.ZERO:i.ONE_MINUS_SRC_ALPHA),i.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,i){var r=this.getGL(),n=e.getSize();r.bindFramebuffer(r.FRAMEBUFFER,e.getFramebuffer()),r.viewport(0,0,n[0],n[1]),r.bindTexture(r.TEXTURE_2D,e.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var i=this.getGL();this.getExtension("OES_element_index_uint");var r=i.UNSIGNED_INT,n=e-t,o=4*t;i.drawElements(i.TRIANGLES,n,r,o)},e.prototype.finalizeDraw=function(t){for(var e=0;ethis.size_[0]||e>=this.size_[1])return gs[0]=0,gs[1]=0,gs[2]=0,gs[3]=0,gs;this.readAll();var i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return gs[0]=this.data_[4*i],gs[1]=this.data_[4*i+1],gs[2]=this.data_[4*i+2],gs[3]=this.data_[4*i+3],gs},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}(),ys=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r1)a=i;else{if(f>0){for(var p=0;pn&&(n=h),o=a,s=l}return n}function ks(t,e,i,r,n){for(var o=0,s=i.length;o>1)],e))<0?a=r+1:(l=r,h=!o);return h?a:~a}(d,v);m<0?(h=(v-d[-m-2])/(d[-m-1]-d[-m-2]),l=e+(-m-2)*r):l=e+m*r}var x=a>1?a:2,w=s||new Array(x);for(g=0;g>1;no&&(h-a)*(o-l)-(n-a)*(u-l)>0&&s++:u<=o&&(h-a)*(o-l)-(n-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function Vs(t,e,i,r,n,o){if(0===i.length)return!1;if(!Ys(t,e,i[0],r,n,o))return!1;for(var s=1,a=i.length;s=n[0]&&o[2]<=n[2]||(o[1]>=n[1]&&o[3]<=n[3]||Ws(t,e,i,r,(function(t,e){return function(t,e,i){var r=!1,n=_i(t,e),o=_i(t,i);if(n===ti||o===ti)r=!0;else{var s=t[0],a=t[1],l=t[2],h=t[3],u=e[0],c=e[1],f=i[0],p=i[1],d=(p-c)/(f-u),g=void 0,_=void 0;o&ei&&!(n&ei)&&(r=(g=f-(p-h)/d)>=s&&g<=l),r||!(o&ii)||n&ii||(r=(_=p-(f-l)*d)>=a&&_<=h),r||!(o&ri)||n&ri||(r=(g=f-(p-a)/d)>=s&&g<=l),r||!(o&ni)||n&ni||(r=(_=p-(f-s)*d)>=a&&_<=h)}return r}(n,t,e)})))))}function Ks(t,e,i,r,n){if(!function(t,e,i,r,n){return!!(Zs(t,e,i,r,n)||Ys(t,e,i,r,n[0],n[1])||Ys(t,e,i,r,n[0],n[3])||Ys(t,e,i,r,n[2],n[1])||Ys(t,e,i,r,n[2],n[3]))}(t,e,i[0],r,n))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;ow&&Vs(t,e,i,r,u=(c+f)/2,g)&&(x=u,w=S),c=f}return isNaN(x)&&(x=o[s]),a?(a.push(x,g,w),a):[x,g,w]}function pa(t,e,i,r,n){for(var o=[],s=0,a=i.length;s0}function _a(t,e,i,r,n){for(var o=void 0!==n&&n,s=0,a=i.length;s */ -read:function(t,e,i,r,n){var o,s,a=8*n-r-1,l=(1<>1,u=-7,c=i?n-1:0,f=i?-1:1,p=t[e+c];for(c+=f,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=f,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+t[e+c],c+=f,u-=8);if(0===o)o=1-h;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=h}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,i,r,n,o){var s,a,l,h=8*o-n-1,u=(1<>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*l-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[i+p]=255&a,p+=d,a/=256,n-=8);for(s=s<0;t[i+p]=255&s,p+=d,s/=256,h-=8);t[i+p-d]|=128*g}},Ra=Oa,Fa=ba;function Oa(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Oa.Varint=0,Oa.Fixed64=1,Oa.Bytes=2,Oa.Fixed32=5;var Pa=4294967296,Ia=1/Pa,La="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ma(t){return t.type===Oa.Bytes?t.readVarint()+t.pos:t.pos+1}function Aa(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Da(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function ka(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Za(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Oa.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ya(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Za(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ya(this.buf,this.pos)+Ya(this.buf,this.pos+4)*Pa;return this.pos+=8,t},readSFixed64:function(){var t=Ya(this.buf,this.pos)+Za(this.buf,this.pos+4)*Pa;return this.pos+=8,t},readFloat:function(){var t=Fa.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Fa.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(n=o[i.pos++],r=(112&n)>>4,n<128)return Aa(t,r,e);if(n=o[i.pos++],r|=(127&n)<<3,n<128)return Aa(t,r,e);if(n=o[i.pos++],r|=(127&n)<<10,n<128)return Aa(t,r,e);if(n=o[i.pos++],r|=(127&n)<<17,n<128)return Aa(t,r,e);if(n=o[i.pos++],r|=(127&n)<<24,n<128)return Aa(t,r,e);if(n=o[i.pos++],r|=(1&n)<<31,n<128)return Aa(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&La?function(t,e,i){return La.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var r="",n=e;for(;n239?4:l>223?3:l>191?2:1;if(n+u>i)break;1===u?l<128&&(h=l):2===u?128==(192&(o=t[n+1]))&&(h=(31&l)<<6|63&o)<=127&&(h=null):3===u?(o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&((h=(15&l)<<12|(63&o)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===u&&(o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((h=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,u=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),n+=u}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Oa.Bytes)return t.push(this.readVarint(e));var i=Ma(this);for(t=t||[];this.pos127;);else if(e===Oa.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Oa.Fixed32)this.pos+=4;else{if(e!==Oa.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455||t<0?function(t,e){var i,r;t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var r,n,o=0;o55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Da(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Fa.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Fa.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i=128&&Da(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,Oa.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,ka,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ga,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Xa,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ja,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ba,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Wa,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,za,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Na,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Ua,e)},writeBytesField:function(t,e){this.writeTag(t,Oa.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Oa.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Oa.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Oa.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Oa.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Oa.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Oa.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Oa.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Oa.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Oa.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ka=[1,0,0,1,0,0],qa=function(){function t(t,e,i,r,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=r}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Oe?xi(this.flatCoordinates_):wi(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Pi(this.getExtent());this.flatInteriorPoints_=fa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Sa(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=pa(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=zs(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,i=this.ends_,r=0,n=i.length;r>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&h>u&&(r.push(h),u=h),i.push(a,l),h+=2):7===o?h>u&&(i.push(i[u],i[u+1]),h+=2):D(!1,59)}h>u&&(r.push(h),u=h)},e.prototype.createFeature_=function(t,e,i){var r,n=e.type;if(0===n)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var h=function(t,e){var i;1===t?i=1===e?Oe:Me:2===t?i=1===e?Pe:Ae:3===t&&(i=Le);return i}(n,l.length);if(this.featureClass_===Ha)(r=new this.featureClass_(h,a,l,s,o)).transform(i.dataProjection);else{var u=void 0;if(h==Le){for(var c=[],f=0,p=0,d=0,g=l.length;d1?new Ea(a,Yn,c):new wa(a,Yn,l)}else u=h===Oe?new ra(a,Yn):h===Pe?new Js(a,Yn):h===Le?new wa(a,Yn,l):h===Me?new sa(a,Yn):h===Ae?new ta(a,Yn,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var y=function(t,e,i){var r,n=i?In(i.featureProjection):null,o=i?In(i.dataProjection):null;if(r=n&&o&&!Dn(n,o)?(e?t.clone():t).transform(e?n:o,e?o:n):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);r===t&&(r=t.clone()),r.applyTransform((function(t){for(var e=0,i=t.length;e>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(r)}}function el(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var r=i.readVarint()+i.pos;i.posthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function ol(t,e,i,r,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=r,n):new nl(t,e,i,r)}var sl=nl;function al(t,e,i,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=i,r):[t,e,i]}function ll(t,e,i){return t+"/"+e+"/"+i}function hl(t){return ll(t[0],t[1],t[2])}function ul(t){return t.split("/").map(Number)}var cl=[0,0,0],fl=function(){function t(t){var e,i,r,o;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,D((e=this.resolutions_,i=!0,r=function(t,e){return e-t}||n,e.every((function(t,n){if(0===n)return!0;var o=r(e[n-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var s=0,a=this.resolutions_.length-1;s=this.minZoom;){if(e(a,2===this.zoomFactor_?ol(n=Math.floor(n/2),n,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]this.maxZoom||e0){for(n=1;n0?n-1:n:t[n-1]-et)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){b()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var r,n=e-i+1e3/60;return n>=this.transition_?1:(r=n/this.transition_,Math.pow(r,3))},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(_),wl=xl,Sl=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();var Tl,Cl=function(t){function e(e,i,r,n,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=n,a.src_=r,a.key=r,a.image_=new Image,null!==n&&(a.image_.crossOrigin=n),a.unlisten_=null,a.tileLoadFunction_=o,a}return Sl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=_l,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=yl,this.unlistenImage_(),this.image_=((t=Ht(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=_l:this.state=vl,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==yl&&(this.state=dl,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==dl&&(this.state=gl,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=po(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(wl),El=function(){function t(t,e,i,r,n,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Gn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&ki(r)==ki(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ki(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ki(this.targetProj_.getExtent()):null;var l=Ai(i),h=Di(i),u=Oi(i),c=Fi(i),f=this.transformInv_(l),p=this.transformInv_(h),d=this.transformInv_(u),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(H(Ri(i)/(o*o*256*256)))):0);if(this.addQuad_(l,h,u,c,f,p,d,g,_),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,i){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i.5&&u<1,p=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)p=ki(ui([t,e,i,r]))/this.targetWorldWidth_>.25||p;!f&&this.sourceProj_.isGlobal()&&u&&(p=u>.25||p)}if(!(!p&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Gi(h,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(n[0])&&isFinite(n[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)p=!0;else if(1!=(d=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!p){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(g),y=void 0;if(f)y=(tt(n[0],c)+tt(s[0],c))/2-tt(_[0],c);else y=(n[0]+s[0])/2-_[0];var v=(n[1]+s[1])/2-_[1];p=y*y+v*v>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var m=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(m),w=[(r[0]+t[0])/2,(r[1]+t[1])/2],S=this.transformInv_(w);this.addQuad_(t,e,m,w,n,o,x,S,l-1),this.addQuad_(w,m,i,r,S,x,s,a,l-1)}else{var T=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(T),E=[(i[0]+r[0])/2,(i[1]+r[1])/2],b=this.transformInv_(E);this.addQuad_(t,T,E,r,n,C,b,a,l-1),this.addQuad_(T,e,i,E,C,o,s,b,l-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,r,n,s,a),0==(14&d)&&this.addTriangle_(t,i,e,n,s,o),d&&(0==(13&d)&&this.addTriangle_(e,r,t,o,a,n),0==(7&d)&&this.addTriangle_(e,r,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,r){var n=e.source;Ti(t,n[0]),Ti(t,n[1]),Ti(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),bl={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Rl(t,e,i,r,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(r,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(i,n)),t.restore()}function Fl(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Ol(t,e,i,r){var n=jn(i,e,t),o=Ln(e,r,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||pi(l,n)){var h=Ln(t,o,n)/o;isFinite(h)&&h>0&&(o/=h)}return o}function Pl(t,e,i,r,n,o,s,a,l,h,c,f){var p=Ht(Math.round(i*t),Math.round(i*e));if(u(p,f),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var g=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var r,n;r=g,(n=t.extent)[0]r[2]&&(r[2]=n[2]),n[1]r[3]&&(r[3]=n[3])}));var _=ki(g),y=Li(g),v=Ht(Math.round(i*_/r),Math.round(i*y/r));u(v,f);var m=i/r;l.forEach((function(t,e,i){var r=t.extent[0]-g[0],n=-(t.extent[3]-g[3]),o=ki(t.extent),s=Li(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,r*m,n*m,o*m,s*m)}));var x=Ai(s);return a.getTriangles().forEach((function(t,e,n){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],c=s[1][1],_=s[2][0],y=s[2][1],m=d((a[0][0]-x[0])/o),w=d(-(a[0][1]-x[1])/o),S=d((a[1][0]-x[0])/o),T=d(-(a[1][1]-x[1])/o),C=d((a[2][0]-x[0])/o),E=d(-(a[2][1]-x[1])/o),b=l,R=h;l=0,h=0;var F=function(t){for(var e=t.length,i=0;in&&(n=s,r=o)}if(0===n)return null;var a=t[r];t[r]=t[i],t[i]=a;for(var l=i+1;l=0;f--){c[f]=t[f][e]/t[f][f];for(var p=f-1;p>=0;p--)t[p][e]-=t[p][f]*c[f]}return c}([[u-=b,c-=R,0,0,S-m],[_-=b,y-=R,0,0,C-m],[0,0,u,c,T-w],[0,0,_,y,E-w]]);if(F){if(p.save(),p.beginPath(),function(){if(void 0===Tl){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Rl(t,4,5,4,0),Rl(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Tl=Fl(e,0)||Fl(e,4)||Fl(e,8)}return Tl}()||f===bl){p.moveTo(S,T);for(var O=m-S,P=w-T,I=0;I<4;I++)p.lineTo(S+d((I+1)*O/4),T+d(I*P/3)),3!=I&&p.lineTo(S+d((I+1)*O/4),T+d((I+1)*P/3));p.lineTo(C,E)}else p.moveTo(S,T),p.lineTo(m,w),p.lineTo(C,E);p.clip(),p.transform(F[0],F[2],F[1],F[3],m,w),p.translate(g[0]-b,g[3]-R),p.scale(r/i,-r/i),p.drawImage(v.canvas,0,0),p.restore()}})),c&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var r=t.target,n=(r[0][0]-x[0])/o,s=-(r[0][1]-x[1])/o,a=(r[1][0]-x[0])/o,l=-(r[1][1]-x[1])/o,h=(r[2][0]-x[0])/o,u=-(r[2][1]-x[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(n,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}var Il=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ll=function(t){function e(e,i,r,n,o,s,a,l,h,u,c,f){var p=t.call(this,o,dl)||this;p.renderEdges_=void 0!==c&&c,p.contextOptions_=f,p.pixelRatio_=a,p.gutter_=l,p.canvas_=null,p.sourceTileGrid_=i,p.targetTileGrid_=n,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=n.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),_=p.sourceTileGrid_.getExtent(),y=g?Mi(d,g):d;if(0===Ri(y))return p.state=vl,p;var v=e.getExtent();v&&(_=_?Mi(_,v):v);var m=n.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,i,r){var n=Pi(i),o=Ol(t,e,n,r);return(!isFinite(o)||o<=0)&&bi(i,(function(i){return o=Ol(t,e,i,r),isFinite(o)&&o>0})),o}(e,r,y,m);if(!isFinite(x)||x<=0)return p.state=vl,p;var w=void 0!==u?u:.5;if(p.triangulation_=new El(e,r,y,_,x*w,m),0===p.triangulation_.getTriangles().length)return p.state=vl,p;p.sourceZ_=i.getZForResolution(x);var S=p.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(S[1]=K(S[1],_[1],_[3]),S[3]=K(S[3],_[1],_[3])):S=Mi(S,_)),Ri(S)){for(var T=i.getTileRangeForExtentAndZ(S,p.sourceZ_),C=T.minX;C<=T.maxX;C++)for(var E=T.minY;E<=T.maxY;E++){var b=h(p.sourceZ_,C,E,a);b&&p.sourceTiles_.push(b)}0===p.sourceTiles_.length&&(p.state=vl)}else p.state=vl;return p}return Il(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,r){e&&e.getState()==_l&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=yl;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Pl(r,n,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=_l}this.changed()},e.prototype.load=function(){if(this.state==dl){this.state=gl,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,r){var n=e.getState();if(n==dl||n==gl){t++;var o=x(e,y,(function(i){var r=e.getState();r!=_l&&r!=yl&&r!=vl||(S(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==dl&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(S),this.sourcesListenerKeys_=null},e}(wl),Ml=Ll,Al=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var i=this.entries_[t];return D(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return D(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){D(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}(),Dl=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),kl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dl(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=ul(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(hl(e.tileCoord)),e.release())}.bind(this))}},e}(Al),Gl=kl,jl="tileloadstart",Bl="tileloadend",Xl="tileloaderror",Wl=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();function zl(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Nl=function(t){function e(e){var i=t.call(this)||this;i.projection=In(e.projection),i.attributions_=zl(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:ht,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var r=i;return i.viewPromise_=new Promise((function(t,e){r.viewResolver=t,r.viewRejector=e})),i}return Wl(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return b()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=zl(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(L);function Ul(t){var e=t.getDefaultTileGrid();return e||(e=Zl(t),t.setDefaultTileGrid(e)),e}function Yl(t){var e=t||{},i=e.extent||In("EPSG:3857").getExtent(),r={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Vl(i,e.maxZoom,e.tileSize,e.maxResolution)};return new pl(r)}function Vl(t,e,i,r){for(var n=void 0!==e?e:42,o=Li(t),s=ki(t),a=kt(void 0!==i?i:256),l=r>0?r:Math.max(s/a[0],o/a[1]),h=n+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(r,n)}(t,r)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,r){},e}(Nl),Jl=function(t){function e(e,i){var r=t.call(this,e)||this;return r.tile=i,r}return ql(e,t),e}(e),$l=Hl;function Ql(t,e){var i=/\{z\}/g,r=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(r,s[1].toString()).replace(n,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return D(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function th(t,e){for(var i=t.length,r=new Array(i),n=0;n=200&&e.status<300){var i=void 0;try{i=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(i)}else this.handleTileJSONError()},e.prototype.onXHRError_=function(t){this.handleTileJSONError()},e.prototype.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,i=In("EPSG:4326"),r=this.getProjection();if(void 0!==t.bounds){var n=kn(i,r);e=ji(t.bounds,n)}var o=Kl(r),s=t.minzoom||0,a=Yl({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.tileSize_});if(this.tileGrid=a,this.tileUrlFunction=th(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:o;this.setAttributions((function(e){return Gi(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(ht)},e.prototype.handleTileJSONError=function(){this.setState(ut)},e}(ah),ch=uh,fh="add",ph="remove",dh=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),gh="length",_h=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.element=i,n.index=r,n}return dh(e,t),e}(e),yh=function(t){function e(e,i){var r=t.call(this)||this;r.on,r.once,r.un;var n=i||{};if(r.unique_=!!n.unique,r.array_=e||[],r.unique_)for(var o=0,s=r.array_.length;o0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e=200&&a.status<300){var r=e.getType(),l=void 0;r==Is||r==Ls?l=a.responseText:r==Ms?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==Ps&&(l=a.response),l?o(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}function wh(t,e){return function(i,r,n,o,s){var a=this;xh(t,e,i,r,n,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||h)}}var Sh=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Th=function(t){function e(e,i,r){var n=t.call(this,e)||this;return n.feature=i,n.features=r,n}return Sh(e,t),e}(e),Ch=function(t){function e(e){var i=this,r=e||{};(i=t.call(this,{attributions:r.attributions,projection:void 0,state:ht,wrapX:void 0===r.wrapX||r.wrapX})||this).on,i.once,i.un,i.loader_=h,i.format_=r.format,i.overlaps_=void 0===r.overlaps||r.overlaps,i.url_=r.url,void 0!==r.loader?i.loader_=r.loader:void 0!==i.url_&&(D(i.format_,7),i.loader_=wh(i.url_,i.format_)),i.strategy_=void 0!==r.strategy?r.strategy:mh;var n,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return i.featuresRtree_=s?new vh:null,i.loadedExtentsRtree_=new vh,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(n=r.features).getArray()),s||void 0!==n||(n=new yh(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==n&&i.bindFeaturesCollection_(n),i}return Sh(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=F(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var r=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Th(Go,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[x(e,y,this.handleFeatureChange_,this),x(e,i,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?i=!1:this.idIndex_[r.toString()]=e),i&&(D(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],r=[],n=0,o=t.length;n0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(Si(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=F(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=F(t);this.featureChangeKeys_[e].forEach(S),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Th(Xo,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){D(this.format_,7),this.url_=t,this.setLoader(wh(t,this.format_))},e}(Nl),Eh=Ch,bh=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Rh=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new sl(0,0,0,0),i}return bh(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),r=e.getUseInterimTilesOnError();return i==_l||i==vl||i==yl&&!r},e.prototype.getTile=function(t,e,i,r){var n=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,n,o);return a.getState()==yl&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(_l)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,i,r)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],r=t.viewState,o=r.projection,s=r.resolution,a=r.center,l=r.rotation,h=t.pixelRatio,c=this.getLayer(),f=c.getSource(),p=f.getRevision(),d=f.getTileGridForProjection(o),g=d.getZForResolution(s,f.zDirection),_=d.getResolution(g),y=t.extent,v=i.extent&&Xn(i.extent);v&&(y=Mi(y,Xn(i.extent)));var m=f.getTilePixelRatio(h),x=Math.round(t.size[0]*m),w=Math.round(t.size[1]*m);if(l){var S=Math.round(Math.sqrt(x*x+w*w));x=S,w=S}var T=_*x/2/m,C=_*w/2/m,E=[a[0]-T,a[1]-C,a[0]+T,a[1]+C],b=d.getTileRangeForExtentAndZ(y,g),R={};R[g]={};var O=this.createLoadedTileFinder(f,o,R),P=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var L=b.minX;L<=b.maxX;++L)for(var M=b.minY;M<=b.maxY;++M){var A=this.getTile(g,L,M,t);if(this.isDrawableTile(A)){var D=F(this);if(A.getState()==_l){R[g][A.tileCoord.toString()]=A;var k=A.inTransition(D);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0)}if(1===A.getAlpha(D,t.time))continue}var G=d.getTileCoordChildTileRange(A.tileCoord,I,P),j=!1;G&&(j=O(g+1,G)),j||d.forEachTileCoordParentTileRange(A.tileCoord,O,I,P)}var B=_/s;Sr(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,l,-x/2,-w/2);var X=Cr(this.pixelTransform);this.useContainer(e,X,i.opacity);var W=this.context,z=W.canvas;Tr(this.inversePixelTransform,this.pixelTransform),Sr(this.tempTransform,x/2,w/2,B,B,0,-x/2,-w/2),z.width!=x||z.height!=w?(z.width=x,z.height=w):this.containerReused||W.clearRect(0,0,x,w),v&&this.clipUnrotated(W,t,v),u(W,f.getContextOptions()),this.preRender(W,t),this.renderedTiles.length=0;var N,U,Y,V=Object.keys(R).map(Number);V.sort(n),1!==i.opacity||this.containerReused&&!f.getOpaque(t.viewState.projection)?(N=[],U=[]):V=V.reverse();for(var Z=V.length-1;Z>=0;--Z){var K=V[Z],q=f.getTilePixelSize(K,h,o),H=d.getResolution(K)/_,J=q[0]*H*B,$=q[1]*H*B,Q=d.getTileCoordForCoordAndZ(Ai(E),K),tt=d.getTileCoordExtent(Q),et=xr(this.tempTransform,[m*(tt[0]-E[0])/_,m*(E[3]-tt[3])/_]),it=m*f.getGutterForProjection(o),rt=R[K];for(var nt in rt){var ot=(A=rt[nt]).tileCoord,st=Q[1]-ot[1],at=Math.round(et[0]-(st-1)*J),lt=Q[2]-ot[2],ht=Math.round(et[1]-(lt-1)*$),ut=at-(L=Math.round(et[0]-st*J)),ct=ht-(M=Math.round(et[1]-lt*$)),ft=g===K;if(!(k=ft&&1!==A.getAlpha(F(this),t.time)))if(N){W.save(),Y=[L,M,L+ut,M,L+ut,M+ct,L,M+ct];for(var pt=0,dt=N.length;pt0)e([]);else{var _=Ai(u.getTileCoordExtent(r.wrappedTileCoord)),y=[(c[0]-_[0])/h,(_[1]-c[1])/h],v=r.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),m=r.hitDetectionImageData[o];if(!m&&!this.animatingOrInteracting_){var x=kt(u.getTileSize(u.getZForResolution(h))),w=this.renderedRotation_;m=Co(x,[this.getRenderTransform(u.getTileCoordCenter(r.wrappedTileCoord),h,0,To,x[0]*To,x[1]*To,0)],v,n.getStyleFunction(),u.getTileCoordExtent(r.wrappedTileCoord),r.getReplayState(n).renderedResolution,w),r.hitDetectionImageData[o]=m}e(Eo(y,v,m))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var r=t.viewHints,n=!(r[$r]||r[Qr]),o=this.renderedTiles,s=0,a=o.length;s=0;--u)h[u].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,r=e.viewState,n=r.center,o=r.resolution,s=r.rotation,a=e.size,l=Math.round(a[0]*i),h=Math.round(a[1]*i),u=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,f=u.getTileCoordExtent(t.wrappedTileCoord),p=u.getTileCoordExtent(c,this.tmpExtent)[0]-f[0];return vr(wr(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,o,s,i,l,h,p))},e.prototype.renderFrame=function(e,i){var r=e.viewHints,n=!(r[$r]||r[Qr]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),s=o.getRenderMode(),a=this.context,l=a.globalAlpha;a.globalAlpha=o.getOpacity();for(var h=Ah[s],u=e.viewState.rotation,c=this.renderedTiles,f=[],p=[],d=c.length-1;d>=0;--d)for(var g=c[d],_=this.getTileRenderTransform(g,e),y=g.executorGroups[F(o)],v=!1,m=0,x=y.length;m{const r=new ch({url:t});r.on("change",(function(){"ready"===r.getState()&&e(r)})),"ready"===r.getState()&&r.changed()}))}(t);return $h(e)}function tu(t){return new Xh({declutter:!0,...t})}function eu(t){return new Rs({maxZoom:17,gradient:["rgba(102, 103, 173, 0)","rgba(102, 103, 173, 0.2)","rgba(102, 103, 173, 0.7)"],...t})}var iu="postrender",ru=window&&window.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),nu=function(t){function e(e){var i=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),i.element=r||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return ru(e,t),e.prototype.disposeInternal=function(){Jt(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Jt(this.element);for(var e=0,i=this.listenerKeys.length;e=1.5?.5:1)?"@2x":"";let i=t+e+".json";var r;return{json:await(await fetch(i,{credentials:"same-origin"})).json(),png:await(r=t+e+".png",new Promise(((t,e)=>{const i=new Image;i.crossOrigin="anonymous",i.onload=function(){i.onload=null,t(i)},i.onerror=e,i.src=r})))}}function su(t,e,i){let r=null;return i&&ou(i).then((t=>{e.changed(),r=t})),function(e,i){const n=e.getProperties();return"area"===n.layer?function(t,e){const i=t.getProperties();if("level"===i.class)return;let r,n="#fdfcfa";return i.access&&["no","private"].includes(i.access)?n="#F2F1F0":i.is_poi&&"corridor"!==i.class?n="#D4EDFF":"room"===i.class&&(n="#fefee2"),["area","corridor","plaform"].includes(i.class)&&(r=new je({color:"#bfbfbf",width:1})),"column"===i.class&&(n="#bfbfbf"),["room","wall"].includes(i.class)&&(r=new je({color:"gray",width:2})),new Ne({fill:new Fe({color:n}),stroke:r})}(e):"transportation"===n.layer?new Ne({stroke:new je({color:"gray",width:2,lineDash:[4,7]})}):"area_name"===n.layer?function(t,e){return new Ne({text:new So({font:"13px Noto Sans Regular, sans-serif",text:t.getProperties().name,fill:new Fe({color:"#666"}),stroke:new je({color:"white",width:1})})})}(e):"poi"===n.layer?function(t,e,i,r){const n=t.getProperties();if(i.getView().getZoomForResolution(e)<19&&["waste_basket","information","vending_machine"].includes(n.class))return;let o;if(r){const t=r.json["indoorequal-"+n.subclass]||r.json["indoorequal-"+n.class];t&&(o=new xo({img:r.png,size:[t.width,t.height],offset:[t.x,t.y],imgSize:[r.png.width,r.png.height]}))}return new Ne({text:new So({font:"11px Noto Sans Regular, sans-serif",text:n.name,fill:new Fe({color:"#666"}),offsetY:18,stroke:new je({color:"white",width:1})}),image:o})}(e,i,t,r):void 0}}function au(t,e,i){var r,n,o,s,a;function l(){var h=Date.now()-s;h=0?r=setTimeout(l,e-h):(r=null,i||(a=t.apply(o,n),o=n=null))}null==e&&(e=100);var h=function(){o=this,n=arguments,s=Date.now();var h=i&&!r;return r||(r=setTimeout(l,e)),h&&(a=t.apply(o,n),o=n=null),a};return h.clear=function(){r&&(clearTimeout(r),r=null)},h.flush=function(){r&&(a=t.apply(o,n),o=n=null,clearTimeout(r),r=null)},h}au.debounce=au;var lu=au;t.LevelControl=class extends nu{constructor(t,e={}){const i=document.createElement("div");i.className="level-control ol-unselectable ol-control",super({element:i,target:e.target}),this.indoorEqual=t,this._renderNewLevels(),this.indoorEqual.on("change:levels",this._renderNewLevels.bind(this)),this.indoorEqual.on("change:level",this._renderNewLevels.bind(this))}_renderNewLevels(){this.element.innerHTML="";const t=this.indoorEqual.get("level");this.indoorEqual.get("levels").forEach((e=>{const i=document.createElement("button");t===e&&i.classList.add("level-control-active"),i.textContent=e,i.addEventListener("click",(()=>{this.indoorEqual.set("level",e)})),this.element.appendChild(i)}))}},t.default=class extends L{constructor(t,e={}){const i={url:"https://tiles.indoorequal.org/",defaultStyle:!0,spriteBaseUrl:null,heatmap:!0},r={...i,...e};if(r.url===i.url&&!r.apiKey)throw"You must register your apiKey at https://indoorequal.com before and set it as apiKey param.";super({levels:[],level:"0"}),this.map=t,this.url=r.url,this.apiKey=r.apiKey,this._createLayers(r.heatmap),this._loadSource(),this.styleFunction=r.defaultStyle?su(this.map,this.indoorLayer,r.spriteBaseUrl):null,this._changeLayerOnLevelChange(),this._setLayerStyle(),this._resetLevelOnLevelsChange()}setStyle(t){this.styleFunction=t}setHeatmapVisible(t){this.heatmapLayer.setVisible(t)}async _loadSource(){const t=this.apiKey?`?key=${this.apiKey}`:"";this.source=await Qh(`${this.url}${t}`),this.indoorLayer.setSource(this.source),this.heatmapLayer.setSource(function(t){const e=t.getTileGrid(),i=new Eh({loader(e,r,n,o,s){const a=()=>{const r=t.getFeaturesInExtent(e);i.clear(!0),i.addFeatures(r),o(r)};t.on("tileloadend",a),a()},loadingstrategy:(r=e,function(t,e,i){var n=r.getZForResolution(function(t,e){return t}(e)),o=r.getTileRangeForExtentAndZ(Xn(t),n),s=[],a=[n,0,0];for(a[1]=o.minX;a[1]<=o.maxX;++a[1])for(a[2]=o.minY;a[2]<=o.maxY;++a[2])s.push(Bn(r.getTileCoordExtent(a)));return s})});var r;return i}(this.source)),this._listenForLevels()}_createLayers(t){this.indoorLayer=tu(),this.heatmapLayer=eu({visible:t}),[this.indoorLayer,this.heatmapLayer].forEach((t=>{this.map.addLayer(t)}))}_listenForLevels(){const t=this.source,e=lu((()=>{const e=this.map.getView().calculateExtent(this.map.getSize()),i=t.getFeaturesInExtent(e);this.set("levels",function(t){const e=[];for(let i=0;it-e)).reverse()}(i))}),1e3);t.on("tileloadend",e),this.map.getView().on("change:center",e)}_changeLayerOnLevelChange(){this.on("change:level",(()=>{this.indoorLayer.changed()}))}_setLayerStyle(){this.indoorLayer.setStyle(((t,e)=>{if(t.getProperties().level===this.get("level"))return this.styleFunction&&this.styleFunction(t,e)}))}_resetLevelOnLevelsChange(){this.on("change:levels",(()=>{this.get("levels").includes(this.get("level"))||this.set("level","0")}))}},t.defaultStyle=su,t.getHeatmapLayer=eu,t.getLayer=tu,t.loadSourceFromTileJSON=Qh,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ol/Feature"),require("ol/layer/Heatmap"),require("ol/format/MVT"),require("ol/tilegrid/TileGrid"),require("ol/source/TileJSON"),require("ol/source/Vector"),require("ol/layer/VectorTile"),require("ol/source/VectorTile"),require("ol/proj"),require("ol/loadingstrategy"),require("ol/control"),require("ol/style"),require("ol/Object")):"function"==typeof define&&define.amd?define(["exports","ol/Feature","ol/layer/Heatmap","ol/format/MVT","ol/tilegrid/TileGrid","ol/source/TileJSON","ol/source/Vector","ol/layer/VectorTile","ol/source/VectorTile","ol/proj","ol/loadingstrategy","ol/control","ol/style","ol/Object"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IndoorEqual={},e.ol.Feature,e.ol.layer.Heatmap,e.ol.format.MVT,e.ol.tilegrid.TileGrid,e.ol.source.TileJSON,e.ol.source.Vector,e.ol.layer.VectorTile,e.ol.source.VectorTile,e.ol.proj,e.ol.loadingstrategy,e.ol.control,e.ol.style,e.ol.Object)}(this,(function(e,t,o,r,l,n,i,s,a,c,u,d,h,f){"use strict";function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=g(t),p=g(o),m=g(r),w=g(l),v=g(n),L=g(i),S=g(s),b=g(a),T=g(f);const q=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function x(e){const t=e.getTileJSON(),o=Array.isArray(t.tiles)?t.tiles:[t.tiles],r=e.getTileGrid(),l=function(e){const t=e.bounds;if(t){const e=c.fromLonLat([t[0],t[1]]),o=c.fromLonLat([t[2],t[3]]);return[e[0],e[1],o[0],o[1]]}}(t),n=t.minzoom,i=t.maxzoom;return new b.default({attributions:e.getAttributions(),format:new m.default({featureClass:y.default}),tileGrid:new w.default({origin:r.getOrigin(0),extent:l||r.getExtent(),minZoom:n,resolutions:q.slice(0,i+1),tileSize:512}),urls:o})}async function F(e){const t=await function(e){return new Promise(((t,o)=>{const r=new v.default({url:e});r.on("change",(function(){"ready"===r.getState()&&t(r)})),"ready"===r.getState()&&r.changed()}))}(e);return x(t)}function _(e){return new S.default({declutter:!0,...e})}function E(e){return new p.default({maxZoom:17,gradient:["rgba(102, 103, 173, 0)","rgba(102, 103, 173, 0.2)","rgba(102, 103, 173, 0.7)"],...e})}class V extends d.Control{constructor(e,t={}){const o=document.createElement("div");o.className="level-control ol-unselectable ol-control",super({element:o,target:t.target}),this.indoorEqual=e,this._renderNewLevels(),this.indoorEqual.on("change:levels",this._renderNewLevels.bind(this)),this.indoorEqual.on("change:level",this._renderNewLevels.bind(this))}_renderNewLevels(){this.element.innerHTML="";const e=this.indoorEqual.get("level");this.indoorEqual.get("levels").forEach((t=>{const o=document.createElement("button");e===t&&o.classList.add("level-control-active"),o.textContent=t,o.addEventListener("click",(()=>{this.indoorEqual.set("level",t)})),this.element.appendChild(o)}))}}async function O(e){const t=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"";let o=e+t+".json";var r;return{json:await(await fetch(o,{credentials:"same-origin"})).json(),png:await(r=e+t+".png",new Promise(((e,t)=>{const o=new Image;o.crossOrigin="anonymous",o.onload=function(){o.onload=null,e(o)},o.onerror=t,o.src=r})))}}function j(e,t,o){let r=null;return o&&O(o).then((e=>{t.changed(),r=e})),function(t,o){const l=t.getProperties();return"area"===l.layer?function(e,t){const o=e.getProperties();if("level"===o.class)return;let r,l="#fdfcfa";return o.access&&["no","private"].includes(o.access)?l="#F2F1F0":o.is_poi&&"corridor"!==o.class?l="#D4EDFF":"room"===o.class&&(l="#fefee2"),["area","corridor","plaform"].includes(o.class)&&(r=new h.Stroke({color:"#bfbfbf",width:1})),"column"===o.class&&(l="#bfbfbf"),["room","wall"].includes(o.class)&&(r=new h.Stroke({color:"gray",width:2})),new h.Style({fill:new h.Fill({color:l}),stroke:r})}(t):"transportation"===l.layer?new h.Style({stroke:new h.Stroke({color:"gray",width:2,lineDash:[4,7]})}):"area_name"===l.layer?function(e,t){return new h.Style({text:new h.Text({font:"13px Noto Sans Regular, sans-serif",text:e.getProperties().name,fill:new h.Fill({color:"#666"}),stroke:new h.Stroke({color:"white",width:1})})})}(t):"poi"===l.layer?function(e,t,o,r){const l=e.getProperties();if(o.getView().getZoomForResolution(t)<19&&["waste_basket","information","vending_machine"].includes(l.class))return;let n;if(r){const e=r.json["indoorequal-"+l.subclass]||r.json["indoorequal-"+l.class];e&&(n=new h.Icon({img:r.png,size:[e.width,e.height],offset:[e.x,e.y],imgSize:[r.png.width,r.png.height]}))}return new h.Style({text:new h.Text({font:"11px Noto Sans Regular, sans-serif",text:l.name,fill:new h.Fill({color:"#666"}),offsetY:18,stroke:new h.Stroke({color:"white",width:1})}),image:n})}(t,o,e,r):void 0}}function k(e,t,o){var r,l,n,i,s;function a(){var c=Date.now()-i;c=0?r=setTimeout(a,t-c):(r=null,o||(s=e.apply(n,l),n=l=null))}null==t&&(t=100);var c=function(){n=this,l=arguments,i=Date.now();var c=o&&!r;return r||(r=setTimeout(a,t)),c&&(s=e.apply(n,l),n=l=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(n,l),n=l=null,clearTimeout(r),r=null)},c}k.debounce=k;var N=k;class P extends T.default{constructor(e,t={}){const o={url:"https://tiles.indoorequal.org/",defaultStyle:!0,spriteBaseUrl:null,heatmap:!0},r={...o,...t};if(r.url===o.url&&!r.apiKey)throw"You must register your apiKey at https://indoorequal.com before and set it as apiKey param.";super({levels:[],level:"0"}),this.map=e,this.url=r.url,this.apiKey=r.apiKey,this._createLayers(r.heatmap),this._loadSource(),this.styleFunction=r.defaultStyle?j(this.map,this.indoorLayer,r.spriteBaseUrl):null,this._changeLayerOnLevelChange(),this._setLayerStyle(),this._resetLevelOnLevelsChange()}setStyle(e){this.styleFunction=e}setHeatmapVisible(e){this.heatmapLayer.setVisible(e)}async _loadSource(){const e=this.apiKey?`?key=${this.apiKey}`:"";this.source=await F(`${this.url}${e}`),this.indoorLayer.setSource(this.source),this.heatmapLayer.setSource(function(e){const t=e.getTileGrid(),o=new L.default({loader(t,r,l,n,i){const s=()=>{const r=e.getFeaturesInExtent(t);o.clear(!0),o.addFeatures(r),n(r)};e.on("tileloadend",s),s()},loadingstrategy:u.tile(t)});return o}(this.source)),this._listenForLevels()}_createLayers(e){this.indoorLayer=_(),this.heatmapLayer=E({visible:e}),[this.indoorLayer,this.heatmapLayer].forEach((e=>{this.map.addLayer(e)}))}_listenForLevels(){const e=this.source,t=N((()=>{const t=this.map.getView().calculateExtent(this.map.getSize()),o=e.getFeaturesInExtent(t);this.set("levels",function(e){const t=[];for(let o=0;oe-t)).reverse()}(o))}),1e3);e.on("tileloadend",t),this.map.getView().on("change:center",t)}_changeLayerOnLevelChange(){this.on("change:level",(()=>{this.indoorLayer.changed()}))}_setLayerStyle(){this.indoorLayer.setStyle(((e,t)=>{if(e.getProperties().level===this.get("level"))return this.styleFunction&&this.styleFunction(e,t)}))}_resetLevelOnLevelsChange(){this.on("change:levels",(()=>{this.get("levels").includes(this.get("level"))||this.set("level","0")}))}}e.LevelControl=V,e.default=P,e.defaultStyle=j,e.getHeatmapLayer=E,e.getLayer=_,e.loadSourceFromTileJSON=F,Object.defineProperty(e,"__esModule",{value:!0})})); diff --git a/package.json b/package.json index d2ed250..4a51a91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openlayers-indoorequal", - "version": "0.0.6", + "version": "0.0.7", "description": "Integrate indoor= into your OpenLayers map.", "repository": "https://github.com/indoorequal/openlayers-indoorequal", "author": "François de Metz",