From 17520d82ed64a4a9fb40ba0030abff1ba97e79d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Thu, 30 Sep 2021 19:43:10 +0200 Subject: [PATCH] Release version 0.0.3. --- dist/openlayers-indoorequal.cjs.js | 18 ++++++++---------- dist/openlayers-indoorequal.esm.js | 14 ++++++-------- dist/openlayers-indoorequal.umd.min.js | 4 ++-- package.json | 2 +- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/dist/openlayers-indoorequal.cjs.js b/dist/openlayers-indoorequal.cjs.js index 3fa28dd..609662a 100644 --- a/dist/openlayers-indoorequal.cjs.js +++ b/dist/openlayers-indoorequal.cjs.js @@ -6,12 +6,12 @@ var VectorTileLayer = require('ol/layer/VectorTile'); var VectorTileSource = require('ol/source/VectorTile'); var TileJSON = require('ol/source/TileJSON'); var MVT = require('ol/format/MVT'); -var proj_js = require('ol/proj.js'); -var TileGrid = require('ol/tilegrid/TileGrid.js'); +var proj = require('ol/proj'); +var TileGrid = require('ol/tilegrid/TileGrid'); var control = require('ol/control'); var BaseObject = require('ol/Object'); var Style = require('ol/style/Style'); -var Fill = require('ol/style/Fill.js'); +var Fill = require('ol/style/Fill'); var Stroke = require('ol/style/Stroke'); var Text = require('ol/style/Text'); @@ -188,8 +188,8 @@ function extentFromTileJSON(tileJSON) { var bounds = tileJSON.bounds; if (bounds) { - var ll = proj_js.fromLonLat([bounds[0], bounds[1]]); - var tr = proj_js.fromLonLat([bounds[2], bounds[3]]); + var ll = proj.fromLonLat([bounds[0], bounds[1]]); + var tr = proj.fromLonLat([bounds[2], bounds[3]]); return [ll[0], ll[1], tr[0], tr[1]]; } } @@ -254,7 +254,7 @@ function getLayer(url, options) { * A control to display the available levels * @param {IndoorEqual} indoorEqual the IndoorEqual instance * @param {object} options - * @param {url} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport. + * @param {string} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport. * @return {LevelControl} `this` */ @@ -364,9 +364,7 @@ function areaLayer(feature, resolution) { } if (properties.layer === 'area' && properties["class"] === 'column') { - stroke = new Fill__default["default"]({ - color: '#bfbfbf' - }); + color = '#bfbfbf'; } if (properties.layer === 'area' && ['room', 'wall'].includes(properties["class"])) { @@ -440,7 +438,7 @@ function defaultStyle(feature, resolution) { * Load the indoor= source and layers in your map. * @param {object} map the OpenLayers instance of the map * @param {object} options - * @param {url} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/). + * @param {string} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/). * @param {string} [options.apiKey] The API key if you use the default tile URL (get your free key at [indoorequal.com](https://indoorequal.com)). * @fires change:levels * @fires change:level diff --git a/dist/openlayers-indoorequal.esm.js b/dist/openlayers-indoorequal.esm.js index c451072..023f34e 100644 --- a/dist/openlayers-indoorequal.esm.js +++ b/dist/openlayers-indoorequal.esm.js @@ -2,12 +2,12 @@ import VectorTileLayer from 'ol/layer/VectorTile'; import VectorTileSource from 'ol/source/VectorTile'; import TileJSON from 'ol/source/TileJSON'; import MVT from 'ol/format/MVT'; -import { fromLonLat } from 'ol/proj.js'; -import TileGrid from 'ol/tilegrid/TileGrid.js'; +import { fromLonLat } from 'ol/proj'; +import TileGrid from 'ol/tilegrid/TileGrid'; import { Control } from 'ol/control'; import BaseObject from 'ol/Object'; import Style from 'ol/style/Style'; -import Fill from 'ol/style/Fill.js'; +import Fill from 'ol/style/Fill'; import Stroke from 'ol/style/Stroke'; import Text from 'ol/style/Text'; @@ -237,7 +237,7 @@ function getLayer(url, options) { * A control to display the available levels * @param {IndoorEqual} indoorEqual the IndoorEqual instance * @param {object} options - * @param {url} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport. + * @param {string} [options.target] Specify a target if you want the control to be rendered outside of the map's viewport. * @return {LevelControl} `this` */ @@ -347,9 +347,7 @@ function areaLayer(feature, resolution) { } if (properties.layer === 'area' && properties["class"] === 'column') { - stroke = new Fill({ - color: '#bfbfbf' - }); + color = '#bfbfbf'; } if (properties.layer === 'area' && ['room', 'wall'].includes(properties["class"])) { @@ -423,7 +421,7 @@ function defaultStyle(feature, resolution) { * Load the indoor= source and layers in your map. * @param {object} map the OpenLayers instance of the map * @param {object} options - * @param {url} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/). + * @param {string} [options.url] Override the default tiles URL (https://tiles.indoorequal.org/). * @param {string} [options.apiKey] The API key if you use the default tile URL (get your free key at [indoorequal.com](https://indoorequal.com)). * @fires change:levels * @fires change:level diff --git a/dist/openlayers-indoorequal.umd.min.js b/dist/openlayers-indoorequal.umd.min.js index acd2dbb..c52213c 100644 --- a/dist/openlayers-indoorequal.umd.min.js +++ b/dist/openlayers-indoorequal.umd.min.js @@ -1,3 +1,3 @@ -!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";function e(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function i(t){for(var i=1;it.length)&&(e=t.length);for(var i=0,n=new Array(e);ie?1:t0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=C,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(v),R="change",I="error",M="load";function k(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){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 L(t,e,i,n){return k(t,e,i,n,!0)}function j(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),b(t))}var A=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),D=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 A(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(R)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;r1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return at(t,e,i,n)}function at(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function lt(t){return t*Math.PI/180}function ht(t,e){var i=t%e;return i*e<0?i+e:i}function ut(t,e,i){return t+i*(e-t)}var ct=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ft=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var r=T({},e);return"object"===n(e.properties)&&(delete r.properties,T(r,e.properties)),r[V]=void 0!==e.opacity?e.opacity:1,it("number"==typeof r[V],64),r[Z]=void 0===e.visible||e.visible,r[U]=e.zIndex,r[q]=void 0!==e.maxResolution?e.maxResolution:1/0,r[J]=void 0!==e.minResolution?e.minResolution:0,r[Q]=void 0!==e.minZoom?e.minZoom:-1/0,r[H]=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 ct(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=nt(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 W()},e.prototype.getLayerStatesArray=function(t){return W()},e.prototype.getExtent=function(){return this.get(K)},e.prototype.getMaxResolution=function(){return this.get(q)},e.prototype.getMinResolution=function(){return this.get(J)},e.prototype.getMinZoom=function(){return this.get(Q)},e.prototype.getMaxZoom=function(){return this.get(H)},e.prototype.getOpacity=function(){return this.get(V)},e.prototype.getSourceState=function(){return W()},e.prototype.getVisible=function(){return this.get(Z)},e.prototype.getZIndex=function(){return this.get(U)},e.prototype.setExtent=function(t){this.set(K,t)},e.prototype.setMaxResolution=function(t){this.set(q,t)},e.prototype.setMinResolution=function(t){this.set(J,t)},e.prototype.setMaxZoom=function(t){this.set(H,t)},e.prototype.setMinZoom=function(t){this.set(Q,t)},e.prototype.setOpacity=function(t){it("number"==typeof t,64),this.set(V,t)},e.prototype.setVisible=function(t){this.set(Z,t)},e.prototype.setZIndex=function(t){this.set(U,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(N),pt="prerender",dt="postrender",gt="precompose",_t="undefined",yt="loading",vt="ready",mt="error",xt=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),St=function(t){function e(e){var i=this,n=T({},e);delete n.source,(i=t.call(this,n)||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($,i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return xt(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($)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():_t},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(j(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=k(t,R,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_&&(j(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(j(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=k(t,gt,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);it(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=k(this,R,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set($,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}(ft);function wt(t,e,i,n,r){Ct(t,e,i||0,n||t.length-1,r||bt)}function Ct(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-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);Ct(t,e,Math.max(i,Math.floor(e-s*l/o+h)),Math.min(n,Math.floor(e+(o-s)*l/o+h)),r)}var u=t[e],c=i,f=n;for(Tt(t,i,e),r(t[n],u)>0&&Tt(t,i,n);c0;)f--}0===r(t[i],u)?Tt(t,i,f):Tt(t,++f,n),f<=e&&(i=f+1),e<=f&&(n=f-1)}}function Tt(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function bt(t,e){return te?1:0}var Ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;r(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}return s(t,[{key:"all",value:function(){return this._all(this.data,[])}},{key:"search",value:function(t){var e=this.data,i=[];if(!At(t,e))return i;for(var n=this.toBBox,r=[];e;){for(var o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}},{key:"_split",value:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),s=Dt(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,Ft(i,this.toBBox),Ft(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}},{key:"_splitRoot",value:function(t,e){this.data=Dt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ft(this.data,this.toBBox)}},{key:"_chooseSplitIndex",value:function(t,e,i){for(var n,r,o,s,a,l,h,u=1/0,c=1/0,f=e;f<=i-e;f++){var p=Pt(t,0,f,this.toBBox),d=Pt(t,f,i,this.toBBox),g=(r=p,o=d,s=void 0,a=void 0,l=void 0,h=void 0,s=Math.max(r.minX,o.minX),a=Math.max(r.minY,o.minY),l=Math.min(r.maxX,o.maxX),h=Math.min(r.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-a)),_=kt(p)+kt(d);g=e;u--){var c=t.children[u];Rt(s,t.leaf?r(c):c),a+=Lt(s)}return a}},{key:"_adjustParentBBoxes",value:function(t,e,i){for(var n=i;n>=0;n--)Rt(e[n],t)}},{key:"_condense",value:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Ft(t[i],this.toBBox)}}]),t}();function Et(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function Dt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gt(t,e,i,n,r){for(var o=[e,i];o.length;)if(!((i=o.pop())-(e=o.pop())<=n)){var s=e+Math.ceil((i-e)/n/2)*n;wt(t,s,e,i,r),o.push(e,s,s,i)}}var Wt=0,Xt=1,Yt=2,zt=3;function Bt(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Nt=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Bt(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 W()},t.prototype.getImage=function(t){return W()},t.prototype.getHitDetectionImage=function(){return W()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return W()},t.prototype.getImageSize=function(){return W()},t.prototype.getOrigin=function(){return W()},t.prototype.getSize=function(){return W()},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_=Bt(t)},t.prototype.listenImageChange=function(t){W()},t.prototype.load=function(){W()},t.prototype.unlistenImageChange=function(t){W()},t}(),Vt=Nt,Zt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Kt=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ut(t){return"string"==typeof t?t:Qt(t)}var qt=function(){var t={},e=0;return function(i){var n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){var r=0;for(var o in t)0==(3&r++)&&(delete t[o],--e)}n=function(t){var e,i,n,r,o;Kt.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(Zt.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),n=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?Ht(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Ht(o)):it(!1,14);return o}(i),t[i]=n,++e}return n}}();function Jt(t){return Array.isArray(t)?t:qt(t)}function Ht(t){return t[0]=nt(t[0]+.5|0,0,255),t[1]=nt(t[1]+.5|0,0,255),t[2]=nt(t[2]+.5|0,0,255),t[3]=nt(t[3],0,1),t}function Qt(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function $t(t){return Array.isArray(t)?Qt(t):t}var te="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";te.indexOf("firefox"),-1!==te.indexOf("safari")&&te.indexOf("chrom"),-1!==te.indexOf("webkit")&&te.indexOf("edge"),te.indexOf("macintosh");var ee="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ie="undefined"!=typeof Image&&Image.prototype.decode;function ne(t,e,i,n){var r;return i&&i.length?r=i.shift():ee?r=new OffscreenCanvas(t||300,e||300):(r=document.createElement("canvas")).style.all="unset",t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function re(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 oe=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"),se=["style","variant","weight","size","lineHeight","family"],ae=function(t){var e=t.match(oe);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,r=se.length;nr&&(l|=hi),ao&&(l|=li),l===si&&(l=ai),l}function Ti(){return[1/0,1/0,-1/0,-1/0]}function bi(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function Oi(t){return bi(1/0,1/0,-1/0,-1/0,t)}function Ei(t,e){var i=t[0],n=t[1];return bi(i,n,i,n,e)}function Fi(t,e,i,n,r){return Ii(Oi(r),t,e,i,n)}function Pi(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Ri(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Ii(t,e,i,n,r){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Vi(t,e,i,n){var r=[];if(n>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;au&&this.instructions.push([oi.CUSTOM,u,r,t,i,Zi])):l==Ae&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([oi.CUSTOM,u,r,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[oi.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[oi.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,n,r=e.length,o=-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=[oi.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[oi.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,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!w(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},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=[oi.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;vi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}var e,i;return this.bufferedMaxExtent_},e}(fi),Hi=Ji,Qi=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$i=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||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 Qi(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([oi.DRAW_IMAGE,r,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([oi.DRAW_IMAGE,r,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(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([oi.DRAW_IMAGE,r,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([oi.DRAW_IMAGE,r,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(),n=t.getSize(),r=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_=r,this.image_=o,this.height_=n[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_=n[0],this.declutterImageWithText_=e},e}(Hi),tn=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),en=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return tn(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[oi.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([oi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,fe,0],ni);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(ii),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([oi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ni);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+n;vp&&(u=v,p=m)}p>r&&(l[(u-e)/n]=1,f+n0&&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 sn(t,e,i,n,r,o,s,a){for(var l=0,h=i.length;lt&&(y>_&&(_=y,d=v,g=o),y=0,v=o-r)),s=a,u=f,c=p),l=m,h=x}return(y+=a)>_?[v,o]:[d,g]}var pn,dn=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gn={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},_n=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||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 dn(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_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,h=t.getStride();if(r.placement!==cn||a!=De&&a!=Ye&&a!=We&&a!=ze){var u=r.overflow?null:[];switch(a){case Ae:case Xe:l=t.getFlatCoordinates();break;case De:l=t.getFlatMidpoint();break;case Ne:l=t.getCenter();break;case Ye:l=t.getFlatMidpoints(),h=2;break;case We:l=t.getFlatInteriorPoint(),r.overflow||u.push(l[2]/this.resolution),h=3;break;case ze:var c=t.getFlatInteriorPoints();l=[];for(w=0,C=c.length;wF[2]}else b=x>O;var P,R=Math.PI,I=[],M=w+n===e;if(_=0,y=C,f=t[e=w],p=t[e+1],M){v(),P=Math.atan2(p-g,f-d),b&&(P+=P>0?-R:R);var k=(O+x)/2,L=(E+S)/2;return I[0]=[k,L,(T-o)/2,P,r],I}for(var j=0,A=r.length;j0?-R:R),void 0!==P){var G=D-P;if(G+=G>R?-2*R:G<-R?2*R:0,Math.abs(G)>s)return null}P=D;for(var W=j,X=0;jt?t-l:r,x=o+h>e?e-h:o,S=p[3]+m*c[0]+p[1],w=p[0]+x*c[1]+p[2],C=y-p[3],T=v-p[0];return(d||0!==u)&&(Dn[0]=C,Xn[0]=C,Dn[1]=T,Gn[1]=T,Gn[0]=C+S,Wn[0]=Gn[0],Wn[1]=T+w,Xn[1]=Wn[1]),0!==u?(Pn(_=In([1,0,0,1,0,0],i,n,1,1,u,-i,-n),Dn),Pn(_,Gn),Pn(_,Wn),Pn(_,Xn),bi(Math.min(Dn[0],Gn[0],Wn[0],Xn[0]),Math.min(Dn[1],Gn[1],Wn[1],Xn[1]),Math.max(Dn[0],Gn[0],Wn[0],Xn[0]),Math.max(Dn[1],Gn[1],Wn[1],Xn[1]),An)):bi(Math.min(C,C+S),Math.min(T,T+w),Math.max(C,C+S),Math.max(T,T+w),An),f&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:An[0],minY:An[1],maxX:An[2],maxY:An[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,r,o,s){var a=!(!o&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.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,Dn,Gn,Wn,Xn,o,s),Fe(t,n.canvasTransform,r,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Pn(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,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=Bn(t,r.textAlign||ge),h=gn[r.textBaseline||_e],u=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*u,anchorY:h*o.height/a+2*(.5-h)*u}},t.prototype.execute_=function(t,e,i,n,r,o,s,a){var l,h,u;this.pixelCoordinates_&&w(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Mn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),h=this.renderedTransform_,u=i,h[0]=u[0],h[1]=u[1],h[2]=u[2],h[3]=u[3],h[4]=u[4],h[5]=u[5]);for(var c,f,p,d,g,_,y,v,m,x,S,C,T,b,O,E,F=0,P=n.length,R=0,I=0,M=0,k=null,L=null,j=this.coordinateCache_,A=this.viewRotation_,D=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},W=this.instructions!=n||this.overlaps?0:200;FW&&(this.fill_(t),I=0),M>W&&(t.stroke(),M=0),I||M||(t.beginPath(),d=NaN,g=NaN),++F;break;case oi.CIRCLE:var Y=l[R=X[1]],z=l[R+1],B=l[R+2]-Y,N=l[R+3]-z,V=Math.sqrt(B*B+N*N);t.moveTo(Y+V,z),t.arc(Y,z,V,0,2*Math.PI,!0),++F;break;case oi.CLOSE_PATH:t.closePath(),++F;break;case oi.CUSTOM:R=X[1],c=X[2];var Z=X[3],K=X[4],U=6==X.length?X[5]:void 0;G.geometry=Z,G.feature=T,F in j||(j[F]=[]);var q=j[F];U?U(l,R,c,2,q):(q[0]=l[R],q[1]=l[R+1],q.length=2),K(q,G),++F;break;case oi.DRAW_IMAGE:R=X[1],c=X[2],v=X[3],f=X[4],p=X[5];var J=X[6],H=X[7],Q=X[8],$=X[9],tt=X[10],et=X[11],it=X[12],nt=X[13],rt=X[14];if(!v&&X.length>=19){m=X[18],x=X[19],S=X[20],C=X[21];var ot=this.drawLabelWithPointPlacement_(m,x,S,C);v=ot.label,X[3]=v;var st=X[22];f=(ot.anchorX-st)*this.pixelRatio,X[4]=f;var at=X[23];p=(ot.anchorY-at)*this.pixelRatio,X[5]=p,J=v.height,X[6]=J,nt=v.width,X[13]=nt}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=ye,ut=!1,ct=!1),tt&&D?et+=A:tt||D||(et-=A);for(var ft=0;Ri)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+r)*e+(t+o))+3),r>0&&a.push(4*((t-r)*e+(t+o))+3),o>0&&(a.push(4*((t+r)*e+(t-o))+3),r>0&&a.push(4*((t-r)*e+(t-o))+3))}for(var l=[],h=(r=0,n.length);r0){if(!o||c!==Sn&&c!==Tn||-1!==o.indexOf(t)){var h=(f[a]-3)/4,p=n-h%s,d=n-(h/s|0),g=r(t,e,p*p+d*d);if(g)return g}u.clearRect(0,0,s,s);break}}var d,g,_,y,v,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(m),d=x.length-1;d>=0;--d){var S=x[d].toString();for(_=this.executorsByZIndex_[S],g=Zn.length-1;g>=0;--g)if(void 0!==(y=_[c=Zn[g]])&&(v=y.executeHitDetection(u,a,i,p,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Mn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return O(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(m),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,f,p,d=o||Zn;for(s&&a.reverse(),l=0,h=a.length;lthis.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 rr(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new nr(t,e,i,n)}var or=nr,sr=0,ar=1,lr=2,hr=3,ur=4,cr={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},fr={};fr[cr.RADIANS]=6370997/(2*Math.PI),fr[cr.DEGREES]=2*Math.PI*6370997/360,fr[cr.FEET]=.3048,fr[cr.METERS]=1,fr[cr.USFEET]=1200/3937;var pr=cr,dr=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||fr[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),gr=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_r=6378137,yr=Math.PI*_r,vr=[-yr,-yr,yr,yr],mr=[-180,-85,180,85],xr=_r*Math.log(Math.tan(Math.PI/2)),Sr=function(t){function e(e){return t.call(this,{code:e,units:pr.METERS,extent:vr,global:!0,worldExtent:mr,getPointResolution:function(t,e){return t/rt(e[1]/_r)}})||this}return gr(e,t),e}(dr),wr=[new Sr("EPSG:3857"),new Sr("EPSG:102100"),new Sr("EPSG:102113"),new Sr("EPSG:900913"),new Sr("http://www.opengis.net/def/crs/EPSG/0/3857"),new Sr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Cr(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;sxr?a=xr:a<-xr&&(a=-xr),o[s+1]=a}return o}function Tr(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;sn[2])){var o=i||Bi(n);r=Math.floor((t[0]-n[0])/o)}return r}(t,e,i);n&&(t[0]-=n*i)}return t}function Gr(t,e,i){var n;if(void 0!==e){for(var r=0,o=t.length;r0&&(this.newTiles_=!0):a.setState(lr)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),f=u.getTileGridForProjection(r),p=f.getZForResolution(o,u.zDirection),d=f.getResolution(p),g=t.extent,_=i.extent&&qr(i.extent);_&&(g=Xi(g,qr(i.extent)));var y=u.getTilePixelRatio(l),v=Math.round(t.size[0]*y),x=Math.round(t.size[1]*y);if(a){var S=Math.round(Math.sqrt(v*v+x*x));v=S,x=S}var w=d*v/2/y,C=d*x/2/y,b=[s[0]-w,s[1]-C,s[0]+w,s[1]+C],O=f.getTileRangeForExtentAndZ(g,p),E={};E[p]={};var F=this.createLoadedTileFinder(u,r,E),P=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var I=O.minX;I<=O.maxX;++I)for(var M=O.minY;M<=O.maxY;++M){var k=this.getTile(p,I,M,t);if(this.isDrawableTile(k)){var L=Y(this);if(k.getState()==lr){E[p][k.tileCoord.toString()]=k;var j=k.inTransition(L);this.newTiles_||!j&&-1!==this.renderedTiles.indexOf(k)||(this.newTiles_=!0)}if(1===k.getAlpha(L,t.time))continue}var A=f.getTileCoordChildTileRange(k.tileCoord,R,P),D=!1;A&&(D=F(p+1,A)),D||f.forEachTileCoordParentTileRange(k.tileCoord,F,R,P)}var G=d/o;In(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-x/2);var W=function(t){var e="matrix("+t.join(", ")+")";if(ee)return e;var i=pn||(pn=document.createElement("div"));return i.style.transform=e,i.style.transform}(this.pixelTransform);this.useContainer(e,W,i.opacity);var X=this.context,z=X.canvas;!function(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];it(0!==n,32);var r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],h=e[5];t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=r/n,t[4]=(s*h-a*l)/n,t[5]=-(r*h-o*l)/n}(this.inversePixelTransform,this.pixelTransform),In(this.tempTransform,v/2,x/2,G,G,0,-v/2,-x/2),z.width!=v||z.height!=x?(z.width=v,z.height=x):this.containerReused||X.clearRect(0,0,v,x),_&&this.clipUnrotated(X,t,_),T(X,u.getContextOptions()),this.preRender(X,t),this.renderedTiles.length=0;var B,N,V,Z=Object.keys(E).map(Number);Z.sort(m),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(B=[],N=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var U=Z[K],q=u.getTilePixelSize(U,l,r),J=f.getResolution(U)/d,H=q[0]*J*G,Q=q[1]*J*G,$=f.getTileCoordForCoordAndZ(Yi(b),U),tt=f.getTileCoordExtent($),et=Pn(this.tempTransform,[y*(tt[0]-b[0])/d,y*(b[3]-tt[3])/d]),nt=y*u.getGutterForProjection(r),rt=E[U];for(var ot in rt){var st=(k=rt[ot]).tileCoord,at=$[1]-st[1],lt=Math.round(et[0]-(at-1)*H),ht=$[2]-st[2],ut=Math.round(et[1]-(ht-1)*Q),ct=lt-(I=Math.round(et[0]-at*H)),ft=ut-(M=Math.round(et[1]-ht*Q)),pt=p===U;if(!(j=pt&&1!==k.getAlpha(Y(this),t.time)))if(B){X.save(),V=[I,M,I+ct,M,I+ct,M+ft,I,M+ft];for(var dt=0,gt=B.length;dtthis.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 n=Oo(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=Oo(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),Fo=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Po=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=i,o.state=r,o}return Fo(e,t),e.prototype.changed=function(){this.dispatchEvent(R)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return W()},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(){W()},e}(P),Ro=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Io(t,e,i){var n=t;if(n.src&&ie){var r=n.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var s=[L(n,M,e),L(n,I,i)];return function(){s.forEach(j)}}!function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,Wt)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Wt,a.imageLoadFunction_=s,a}Ro(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=zt,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Wi(this.extent)/this.image_.height),this.state=Yt,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Wt&&this.state!=zt||(this.state=Xt,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Io(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Wi(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Po);var Mo=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ko=null,Lo=function(t){function e(e,i,n,r,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==r&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=n,a.src_=i,a.tainted_,a}return Mo(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Yt){ko||(ko=ne(1,1)),ko.drawImage(this.image_,0,0);try{ko.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ko=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(R)},e.prototype.handleImageError_=function(){this.imageState_=zt,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Yt,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=ne(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_==Wt){this.imageState_=Xt;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Io(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){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=Ut(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 n=i.getImageData(0,0,e.width,e.height),r=n.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=r.length;h0,6);var c=void 0!==n.src?Wt:Yt;return i.color_=void 0!==n.color?Jt(n.color):null,i.iconImage_=function(t,e,i,n,r,o){var s=Eo.get(e,n,o);return s||(s=new Lo(t,e,i,n,r,o),Eo.set(e,n,o,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:To,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return jo(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_==xo||this.anchorYUnits_==xo){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==xo&&(t[0]*=e[0]),this.anchorYUnits_==xo&&(t[1]*=e[1])}if(this.anchorOrigin_!=To){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=bo&&this.anchorOrigin_!=Co||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=wo&&this.anchorOrigin_!=Co||(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_!=To){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=bo&&this.offsetOrigin_!=Co||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=wo&&this.offsetOrigin_!=Co||(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(R,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(R,t)},e}(Vt),Do=Ao,Go=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_=Bt(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 je({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:un,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_=Bt(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}(),Wo=Go,Xo=.5;var Yo={Point:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Yt)return;var l=t.getBuilder(i.getZIndex(),Sn);l.setImageStyle(s,o),l.drawPoint(e,n)}if(a&&a.getText()){var h=t.getBuilder(i.getZIndex(),Tn);h.setTextStyle(a,o),h.drawText(e,n)}},LineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),wn);s.setFillStrokeStyle(null,o),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),Tn);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Cn);a.setFillStrokeStyle(o,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(r||t).getBuilder(i.getZIndex(),Tn);h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Yt)return;var l=t.getBuilder(i.getZIndex(),Sn);l.setImageStyle(s,o),l.drawMultiPoint(e,n)}if(a&&a.getText()){var h=(r||t).getBuilder(i.getZIndex(),Tn);h.setTextStyle(a,o),h.drawText(e,n)}},MultiLineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),wn);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),Tn);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(s||o){var a=t.getBuilder(i.getZIndex(),Cn);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(r||t).getBuilder(i.getZIndex(),Tn);h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,r){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o0)e([]);else{var _=Yi(u.getTileCoordExtent(n.wrappedTileCoord)),y=[(c[0]-_[0])/h,(_[1]-c[1])/h],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=n.hitDetectionImageData[o];if(!x&&!this.animatingOrInteracting_){var S=Bt(u.getTileSize(u.getZForResolution(h))),w=this.renderedRotation_;x=function(t,e,i,n,r,o,s){var a=ne(t[0]*Xo,t[1]*Xo);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new mo(a,Xo,r,null,s),u=i.length,c=Math.floor(16777215/u),f={},p=1;p<=u;++p){var d=i[p-1],g=d.getStyleFunction()||n;if(n){var _=g(d,o);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(p*c).toString(16)).slice(-6),v=0,x=_.length;v=0;--u)h[u].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,r,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,n=e.viewState,r=n.center,o=n.resolution,s=n.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 En(Rn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(r,o,s,i,l,h,p))},e.prototype.renderFrame=function(e,i){var n=e.viewHints,r=!(n[io]||n[no]);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=Ko[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[Y(o)],v=!1,m=0,x=y.length;mt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){W()},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 n,r=e-i+1e3/60;return r>=this.transition_?1:(n=r/this.transition_,Math.pow(n,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}(P),is=es,ns=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),rs=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.extent=null,a.format_=r,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=n,a.key=n,a}return ns(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==sr&&(this.setState(ar),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(hr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(lr)},e.prototype.setLoader=function(t){this.loader_=t},e}(is),os=rs,ss=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 it(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 it(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){it(!(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}();function as(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function ls(t,e,i){return t+"/"+e+"/"+i}function hs(t){return ls(t[0],t[1],t[2])}function us(t){return t.split("/").map(Number)}var cs=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return cs(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=us(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(hs(e.tileCoord)),e.release())}.bind(this))}},e}(ss),ps=fs,ds="tileloadstart",gs="tileloadend",_s="tileloaderror",ys=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function vs(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var ms=function(t){function e(e){var i=t.call(this)||this;i.projection=Yr(e.projection),i.attributions_=vs(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:vt,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var n=i;return i.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),i}return ys(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 W()},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_=vs(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(N),xs=[0,0,0],Ss=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,it((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||m,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?rr(r=Math.floor(r/2),r,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(r=1;r0?r-1:r:t[r-1]-e0?n:Math.max(s/a[0],o/a[1]),h=r+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(n,r)}(t,n)?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,n){},e}(ms),Rs=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Fs(e,t),e}(_),Is=Ps;function Ms(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return it(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function ks(t,e){for(var i=t.length,n=new Array(i),r=0;r=200&&a.status<300){var n=e.getType(),l=void 0;n==Xs||n==Ys?l=a.responseText:n==zs?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==Ws&&(l=a.response),l?o(e.readFeatures(l,{extent:i,featureProjection:r}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}var Zs=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var Ks,Us=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=r,a.src_=n,a.key=n,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return Zs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=lr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=hr,this.unlistenImage_(),this.image_=((t=ne(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=lr:this.state=ur,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==hr&&(this.state=sr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==sr&&(this.state=ar,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Io(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(is),qs=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Kr(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_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Bi(n)==Bi(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Bi(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Bi(this.targetProj_.getExtent()):null;var l=Yi(i),h=zi(i),u=Ai(i),c=ji(i),f=this.transformInv_(l),p=this.transformInv_(h),d=this.transformInv_(u),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(ot(Li(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=Bi(yi([t,e,i,n]))/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]))||Ni(h,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(r[0])&&isFinite(r[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(r[0])&&isFinite(r[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=(ht(r[0],c)+ht(s[0],c))/2-ht(_[0],c);else y=(r[0]+s[0])/2-_[0];var v=(r[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),S=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(S);this.addQuad_(t,e,m,S,r,o,x,w,l-1),this.addQuad_(S,m,i,n,w,x,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(C),b=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(b);this.addQuad_(t,C,b,n,r,T,O,a,l-1),this.addQuad_(C,e,i,b,T,o,s,O,l-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,n,r,s,a),0==(14&d)&&this.addTriangle_(t,i,e,r,s,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,a,r),0==(7&d)&&this.addTriangle_(e,n,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,n){var r=e.source;Ri(t,r[0]),Ri(t,r[1]),Ri(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Js={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Hs(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function Qs(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function $s(t,e,i,n){var r=Ur(i,e,t),o=zr(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||xi(l,r)){var h=zr(t,o,r)/o;isFinite(h)&&h>0&&(o/=h)}return o}function ta(t,e,i,n,r,o,s,a,l,h,u,c){var f=ne(Math.round(i*t),Math.round(i*e));if(T(f,c),0===l.length)return f.canvas;function p(t){return Math.round(t*i)/i}f.scale(i,i),f.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,r;n=d,(r=t.extent)[0]n[2]&&(n[2]=r[2]),r[1]n[3]&&(n[3]=r[3])}));var g=Bi(d),_=Wi(d),y=ne(Math.round(i*g/n),Math.round(i*_/n));T(y,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=Bi(t.extent),s=Wi(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*v,r*v,o*v,s*v)}));var m=Yi(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=p((a[0][0]-m[0])/o),S=p(-(a[0][1]-m[1])/o),w=p((a[1][0]-m[0])/o),C=p(-(a[1][1]-m[1])/o),T=p((a[2][0]-m[0])/o),b=p(-(a[2][1]-m[1])/o),O=l,E=h;l=0,h=0;var F=function(t){for(var e=t.length,i=0;ir&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=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-=O,g-=E,0,0,w-x],[_-=O,v-=E,0,0,T-x],[0,0,u,g,C-S],[0,0,_,v,b-S]]);if(F){if(f.save(),f.beginPath(),function(){if(void 0===Ks){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Hs(t,4,5,4,0),Hs(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Ks=Qs(e,0)||Qs(e,4)||Qs(e,8)}return Ks}()||c===Js){f.moveTo(w,C);for(var P=x-w,R=S-C,I=0;I<4;I++)f.lineTo(w+p((I+1)*P/4),C+p(I*R/3)),3!=I&&f.lineTo(w+p((I+1)*P/4),C+p((I+1)*R/3));f.lineTo(T,b)}else f.moveTo(w,C),f.lineTo(x,S),f.lineTo(T,b);f.clip(),f.transform(F[0],F[2],F[1],F[3],x,S),f.translate(d[0]-O,d[3]-E),f.scale(n/i,-n/i),f.drawImage(y.canvas,0,0),f.restore()}})),u&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-m[0])/o,s=-(n[0][1]-m[1])/o,a=(n[1][0]-m[0])/o,l=-(n[1][1]-m[1])/o,h=(n[2][0]-m[0])/o,u=-(n[2][1]-m[1])/o;f.beginPath(),f.moveTo(a,l),f.lineTo(r,s),f.lineTo(h,u),f.closePath(),f.stroke()})),f.restore()),f.canvas}var ea=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ia=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f){var p=t.call(this,o,sr)||this;p.renderEdges_=void 0!==c&&c,p.contextOptions_=f,p.pixelRatio_=a,p.gutter_=l,p.canvas_=null,p.sourceTileGrid_=i,p.targetTileGrid_=r,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=r.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),_=p.sourceTileGrid_.getExtent(),y=g?Xi(d,g):d;if(0===Li(y))return p.state=ur,p;var v=e.getExtent();v&&(_=_?Xi(_,v):v);var m=r.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=Di(i),o=$s(t,e,r,n);return(!isFinite(o)||o<=0)&&ki(i,(function(i){return o=$s(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,y,m);if(!isFinite(x)||x<=0)return p.state=ur,p;var S=void 0!==u?u:.5;if(p.triangulation_=new qs(e,n,y,_,x*S,m),0===p.triangulation_.getTriangles().length)return p.state=ur,p;p.sourceZ_=i.getZForResolution(x);var w=p.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(w[1]=nt(w[1],_[1],_[3]),w[3]=nt(w[3],_[1],_[3])):w=Xi(w,_)),Li(w)){for(var C=i.getTileRangeForExtentAndZ(w,p.sourceZ_),T=C.minX;T<=C.maxX;T++)for(var b=C.minY;b<=C.maxY;b++){var O=h(p.sourceZ_,T,b,a);O&&p.sourceTiles_.push(O)}0===p.sourceTiles_.length&&(p.state=ur)}else p.state=ur;return p}return ea(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==lr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=hr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="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_=ta(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=lr}this.changed()},e.prototype.load=function(){if(this.state==sr){this.state=ar,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==sr||r==ar){t++;var o=k(e,R,(function(i){var n=e.getState();n!=lr&&n!=hr&&n!=ur||(j(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()==sr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(j),this.sourcesListenerKeys_=null},e}(is),na=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ra=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:oa,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Us,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?Js:void 0,i.renderReprojectionEdges_=!1,i}return na(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Vr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Vr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Vr(e,t)){var i=Y(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Cs(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Vr(e,t))return this.tileCache;var i=Y(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new ps(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,h=new this.tileClass(s,void 0!==l?sr:ur,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(R,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!Vr(o,r)){var s=this.getTileCacheForProjection(r),a=[t,e,i],l=void 0,h=hs(a);s.containsKey(h)&&(l=s.get(h));var u=this.getKey();if(l&&l.key==u)return l;var c=this.getTileGridForProjection(o),f=this.getTileGridForProjection(r),p=this.getTileCoordForTileUrlFunction(a,r),d=new ia(o,c,r,f,a,p,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return d.key=u,l?(d.interimTile=l,d.refreshInterimChain(),s.replace(h,d)):s.set(h,d),d}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=ls(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==sr?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Yr(t);if(i){var n=Y(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(js);function oa(t,e){t.getImage().src=e}var sa=ra,aa=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(t){function e(e){var i=this,n="Unexpected response status: "+e.status;return(i=t.call(this,n)||this).name="ResponseError",i.response=e,i}aa(e,t)}(Error),function(t){function e(e){var i=t.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=e,i}aa(e,t)}(Error);var la=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ha=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:Yr("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:yt,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this;if(i.tileJSON_=null,i.tileSize_=e.tileSize,e.url)if(e.jsonp)!function(t,e,i,n){var r=document.createElement("script"),o="olc_"+Y(e);function s(){delete window[o],r.parentNode.removeChild(r)}r.async=!0,r.src=t+(-1==t.indexOf("?")?"?":"&")+(n||"callback")+"="+o;var a=setTimeout((function(){s(),i&&i()}),1e4);window[o]=function(t){clearTimeout(a),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(r)}(e.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var n=new XMLHttpRequest;n.addEventListener("load",i.onXHRLoad_.bind(i)),n.addEventListener("error",i.onXHRError_.bind(i)),n.open("GET",e.url),n.send()}else e.tileJSON?i.handleTileJSONResponse(e.tileJSON):it(!1,51);return i}return la(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=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=Yr("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var r=Zr(i,n);e=Vi(t.bounds,r)}var o=Es(n),s=t.minzoom||0,a=Ts({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.tileSize_});if(this.tileGrid=a,this.tileUrlFunction=ks(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:o;this.setAttributions((function(e){return Ni(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(vt)},e.prototype.handleTileJSONError=function(){this.setState(mt)},e}(sa),ua=ha,ca=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var n=e.dataProjection?Yr(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===pr.TILE_PIXELS&&(n=Yr(n)).setWorldExtent(e.extent),i={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return T({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return W()},t.prototype.readFeature=function(t,e){return W()},t.prototype.readFeatures=function(t,e){return W()},t.prototype.readGeometry=function(t,e){return W()},t.prototype.readProjection=function(t){return W()},t.prototype.writeFeature=function(t,e){return W()},t.prototype.writeFeatures=function(t,e){return W()},t.prototype.writeGeometry=function(t,e){return W()},t}();function fa(t,e,i,n,r,o,s){var a,l=t[e],h=t[e+1],u=t[i]-l,c=t[i+1]-h;if(0===u&&0===c)a=e;else{var f=((r-l)*u+(o-h)*c)/(u*u+c*c);if(f>1)a=i;else{if(f>0){for(var p=0;pr&&(r=h),o=a,s=l}return r}function da(t,e,i,n,r){for(var o=0,s=i.length;o>1)],e))<0?s=n+1:(a=n,l=!r);return l?s:~s}(p,y);v<0?(l=(y-p[-v-2])/(p[-v-1]-p[-v-2]),a=e+(-v-2)*n):a=e+v*n}var x=s>1?s:2,S=o||new Array(x);for(d=0;d>1;ro&&(h-a)*(o-l)-(r-a)*(u-l)>0&&s++:u<=o&&(h-a)*(o-l)-(r-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function Ta(t,e,i,n,r,o){if(0===i.length)return!1;if(!Ca(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;s=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||ma(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=Ci(t,e),o=Ci(t,i);if(r===ai||o===ai)n=!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&li&&!(r&li)&&(n=(g=f-(p-h)/d)>=s&&g<=l),n||!(o&hi)||r&hi||(n=(_=p-(f-l)*d)>=a&&_<=h),n||!(o&ui)||r&ui||(n=(g=f-(p-a)/d)>=s&&g<=l),n||!(o&ci)||r&ci||(n=(_=p-(f-s)*d)>=a&&_<=h)}return n}(r,t,e)})))))}function Oa(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(ba(t,e,i,n,r)||Ca(t,e,i,n,r[0],r[1])||Ca(t,e,i,n,r[0],r[3])||Ca(t,e,i,n,r[2],r[1])||Ca(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;oS&&Ta(t,e,i,n,h=(u+c)/2,d)&&(x=h,S=w),u=c}return isNaN(x)&&(x=r[o]),s?(s.push(x,d,S),s):[x,d,S]}function Va(t,e,i,n,r){for(var o=[],s=0,a=i.length;s0}function Ua(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;st.length)&&(e=t.length);for(var i=0,n=new Array(e);ie?1:t0)},e.prototype.removeEventListener=function(t,e){var i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=C,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(v),R="change",I="error",M="load";function k(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){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 L(t,e,i,n){return k(t,e,i,n,!0)}function j(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),b(t))}var A=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),D=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 A(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(R)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;r1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return at(t,e,i,n)}function at(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function lt(t){return t*Math.PI/180}function ht(t,e){var i=t%e;return i*e<0?i+e:i}function ut(t,e,i){return t+i*(e-t)}var 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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ft=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var r=T({},e);return"object"===n(e.properties)&&(delete r.properties,T(r,e.properties)),r[V]=void 0!==e.opacity?e.opacity:1,it("number"==typeof r[V],64),r[Z]=void 0===e.visible||e.visible,r[U]=e.zIndex,r[q]=void 0!==e.maxResolution?e.maxResolution:1/0,r[J]=void 0!==e.minResolution?e.minResolution:0,r[Q]=void 0!==e.minZoom?e.minZoom:-1/0,r[H]=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 ct(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=nt(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 W()},e.prototype.getLayerStatesArray=function(t){return W()},e.prototype.getExtent=function(){return this.get(K)},e.prototype.getMaxResolution=function(){return this.get(q)},e.prototype.getMinResolution=function(){return this.get(J)},e.prototype.getMinZoom=function(){return this.get(Q)},e.prototype.getMaxZoom=function(){return this.get(H)},e.prototype.getOpacity=function(){return this.get(V)},e.prototype.getSourceState=function(){return W()},e.prototype.getVisible=function(){return this.get(Z)},e.prototype.getZIndex=function(){return this.get(U)},e.prototype.setExtent=function(t){this.set(K,t)},e.prototype.setMaxResolution=function(t){this.set(q,t)},e.prototype.setMinResolution=function(t){this.set(J,t)},e.prototype.setMaxZoom=function(t){this.set(H,t)},e.prototype.setMinZoom=function(t){this.set(Q,t)},e.prototype.setOpacity=function(t){it("number"==typeof t,64),this.set(V,t)},e.prototype.setVisible=function(t){this.set(Z,t)},e.prototype.setZIndex=function(t){this.set(U,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(N),pt="prerender",dt="postrender",gt="precompose",_t="undefined",yt="loading",vt="ready",mt="error",xt=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wt=function(t){function e(e){var i=this,n=T({},e);delete n.source,(i=t.call(this,n)||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($,i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return xt(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($)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():_t},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(j(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=k(t,R,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_&&(j(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(j(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=k(t,gt,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);it(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=k(this,R,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set($,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}(ft);function St(t,e,i,n,r){Ct(t,e,i||0,n||t.length-1,r||bt)}function Ct(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-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);Ct(t,e,Math.max(i,Math.floor(e-s*l/o+h)),Math.min(n,Math.floor(e+(o-s)*l/o+h)),r)}var u=t[e],c=i,f=n;for(Tt(t,i,e),r(t[n],u)>0&&Tt(t,i,n);c0;)f--}0===r(t[i],u)?Tt(t,i,f):Tt(t,++f,n),f<=e&&(i=f+1),e<=f&&(n=f-1)}}function Tt(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function bt(t,e){return te?1:0}var Ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:9;r(this,t),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}return s(t,[{key:"all",value:function(){return this._all(this.data,[])}},{key:"search",value:function(t){var e=this.data,i=[];if(!At(t,e))return i;for(var n=this.toBBox,r=[];e;){for(var o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}},{key:"_split",value:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var o=this._chooseSplitIndex(i,r,n),s=Dt(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,Ft(i,this.toBBox),Ft(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}},{key:"_splitRoot",value:function(t,e){this.data=Dt([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ft(this.data,this.toBBox)}},{key:"_chooseSplitIndex",value:function(t,e,i){for(var n,r,o,s,a,l,h,u=1/0,c=1/0,f=e;f<=i-e;f++){var p=Pt(t,0,f,this.toBBox),d=Pt(t,f,i,this.toBBox),g=(r=p,o=d,s=void 0,a=void 0,l=void 0,h=void 0,s=Math.max(r.minX,o.minX),a=Math.max(r.minY,o.minY),l=Math.min(r.maxX,o.maxX),h=Math.min(r.maxY,o.maxY),Math.max(0,l-s)*Math.max(0,h-a)),_=kt(p)+kt(d);g=e;u--){var c=t.children[u];Rt(s,t.leaf?r(c):c),a+=Lt(s)}return a}},{key:"_adjustParentBBoxes",value:function(t,e,i){for(var n=i;n>=0;n--)Rt(e[n],t)}},{key:"_condense",value:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Ft(t[i],this.toBBox)}}]),t}();function Et(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function Dt(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Gt(t,e,i,n,r){for(var o=[e,i];o.length;)if(!((i=o.pop())-(e=o.pop())<=n)){var s=e+Math.ceil((i-e)/n/2)*n;St(t,s,e,i,r),o.push(e,s,s,i)}}var Wt=0,Xt=1,Yt=2,zt=3;function Bt(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Nt=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Bt(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 W()},t.prototype.getImage=function(t){return W()},t.prototype.getHitDetectionImage=function(){return W()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return W()},t.prototype.getImageSize=function(){return W()},t.prototype.getOrigin=function(){return W()},t.prototype.getSize=function(){return W()},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_=Bt(t)},t.prototype.listenImageChange=function(t){W()},t.prototype.load=function(){W()},t.prototype.unlistenImageChange=function(t){W()},t}(),Vt=Nt,Zt=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Kt=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ut(t){return"string"==typeof t?t:Qt(t)}var qt=function(){var t={},e=0;return function(i){var n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){var r=0;for(var o in t)0==(3&r++)&&(delete t[o],--e)}n=function(t){var e,i,n,r,o;Kt.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(Zt.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),n=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?Ht(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Ht(o)):it(!1,14);return o}(i),t[i]=n,++e}return n}}();function Jt(t){return Array.isArray(t)?t:qt(t)}function Ht(t){return t[0]=nt(t[0]+.5|0,0,255),t[1]=nt(t[1]+.5|0,0,255),t[2]=nt(t[2]+.5|0,0,255),t[3]=nt(t[3],0,1),t}function Qt(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function $t(t){return Array.isArray(t)?Qt(t):t}var te="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";te.indexOf("firefox"),-1!==te.indexOf("safari")&&te.indexOf("chrom"),-1!==te.indexOf("webkit")&&te.indexOf("edge"),te.indexOf("macintosh");var ee="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ie="undefined"!=typeof Image&&Image.prototype.decode;function ne(t,e,i,n){var r;return i&&i.length?r=i.shift():ee?r=new OffscreenCanvas(t||300,e||300):(r=document.createElement("canvas")).style.all="unset",t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function re(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 oe=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"),se=["style","variant","weight","size","lineHeight","family"],ae=function(t){var e=t.match(oe);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,r=se.length;nr&&(l|=hi),ao&&(l|=li),l===si&&(l=ai),l}function Ti(){return[1/0,1/0,-1/0,-1/0]}function bi(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function Oi(t){return bi(1/0,1/0,-1/0,-1/0,t)}function Ei(t,e){var i=t[0],n=t[1];return bi(i,n,i,n,e)}function Fi(t,e,i,n,r){return Ii(Oi(r),t,e,i,n)}function Pi(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Ri(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function Ii(t,e,i,n,r){for(;ie[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Vi(t,e,i,n){var r=[];if(n>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;au&&this.instructions.push([oi.CUSTOM,u,r,t,i,Zi])):l==Ae&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([oi.CUSTOM,u,r,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[oi.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[oi.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,n,r=e.length,o=-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=[oi.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[oi.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,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!S(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},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=[oi.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;vi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}var e,i;return this.bufferedMaxExtent_},e}(fi),Hi=Ji,Qi=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$i=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||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 Qi(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([oi.DRAW_IMAGE,r,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([oi.DRAW_IMAGE,r,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(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([oi.DRAW_IMAGE,r,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([oi.DRAW_IMAGE,r,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(),n=t.getSize(),r=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_=r,this.image_=o,this.height_=n[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_=n[0],this.declutterImageWithText_=e},e}(Hi),tn=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),en=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return tn(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[oi.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([oi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,fe,0],ni);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(ii),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([oi.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ni);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+n;vp&&(u=v,p=m)}p>r&&(l[(u-e)/n]=1,f+n0&&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 sn(t,e,i,n,r,o,s,a){for(var l=0,h=i.length;lt&&(y>_&&(_=y,d=v,g=o),y=0,v=o-r)),s=a,u=f,c=p),l=m,h=x}return(y+=a)>_?[v,o]:[d,g]}var pn,dn=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gn={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},_n=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||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 dn(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_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,h=t.getStride();if(r.placement!==cn||a!=De&&a!=Ye&&a!=We&&a!=ze){var u=r.overflow?null:[];switch(a){case Ae:case Xe:l=t.getFlatCoordinates();break;case De:l=t.getFlatMidpoint();break;case Ne:l=t.getCenter();break;case Ye:l=t.getFlatMidpoints(),h=2;break;case We:l=t.getFlatInteriorPoint(),r.overflow||u.push(l[2]/this.resolution),h=3;break;case ze:var c=t.getFlatInteriorPoints();l=[];for(S=0,C=c.length;SF[2]}else b=x>O;var P,R=Math.PI,I=[],M=S+n===e;if(_=0,y=C,f=t[e=S],p=t[e+1],M){v(),P=Math.atan2(p-g,f-d),b&&(P+=P>0?-R:R);var k=(O+x)/2,L=(E+w)/2;return I[0]=[k,L,(T-o)/2,P,r],I}for(var j=0,A=r.length;j0?-R:R),void 0!==P){var G=D-P;if(G+=G>R?-2*R:G<-R?2*R:0,Math.abs(G)>s)return null}P=D;for(var W=j,X=0;jt?t-l:r,x=o+h>e?e-h:o,w=p[3]+m*c[0]+p[1],S=p[0]+x*c[1]+p[2],C=y-p[3],T=v-p[0];return(d||0!==u)&&(Dn[0]=C,Xn[0]=C,Dn[1]=T,Gn[1]=T,Gn[0]=C+w,Wn[0]=Gn[0],Wn[1]=T+S,Xn[1]=Wn[1]),0!==u?(Pn(_=In([1,0,0,1,0,0],i,n,1,1,u,-i,-n),Dn),Pn(_,Gn),Pn(_,Wn),Pn(_,Xn),bi(Math.min(Dn[0],Gn[0],Wn[0],Xn[0]),Math.min(Dn[1],Gn[1],Wn[1],Xn[1]),Math.max(Dn[0],Gn[0],Wn[0],Xn[0]),Math.max(Dn[1],Gn[1],Wn[1],Xn[1]),An)):bi(Math.min(C,C+w),Math.min(T,T+S),Math.max(C,C+w),Math.max(T,T+S),An),f&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:An[0],minY:An[1],maxX:An[2],maxY:An[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,r,o,s){var a=!(!o&&!s),l=n.declutterBox,h=t.canvas,u=s?s[2]*n.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,Dn,Gn,Wn,Xn,o,s),Fe(t,n.canvasTransform,r,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=Pn(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,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=Bn(t,r.textAlign||ge),h=gn[r.textBaseline||_e],u=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*u,anchorY:h*o.height/a+2*(.5-h)*u}},t.prototype.execute_=function(t,e,i,n,r,o,s,a){var l,h,u;this.pixelCoordinates_&&S(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Mn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),h=this.renderedTransform_,u=i,h[0]=u[0],h[1]=u[1],h[2]=u[2],h[3]=u[3],h[4]=u[4],h[5]=u[5]);for(var c,f,p,d,g,_,y,v,m,x,w,C,T,b,O,E,F=0,P=n.length,R=0,I=0,M=0,k=null,L=null,j=this.coordinateCache_,A=this.viewRotation_,D=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:A},W=this.instructions!=n||this.overlaps?0:200;FW&&(this.fill_(t),I=0),M>W&&(t.stroke(),M=0),I||M||(t.beginPath(),d=NaN,g=NaN),++F;break;case oi.CIRCLE:var Y=l[R=X[1]],z=l[R+1],B=l[R+2]-Y,N=l[R+3]-z,V=Math.sqrt(B*B+N*N);t.moveTo(Y+V,z),t.arc(Y,z,V,0,2*Math.PI,!0),++F;break;case oi.CLOSE_PATH:t.closePath(),++F;break;case oi.CUSTOM:R=X[1],c=X[2];var Z=X[3],K=X[4],U=6==X.length?X[5]:void 0;G.geometry=Z,G.feature=T,F in j||(j[F]=[]);var q=j[F];U?U(l,R,c,2,q):(q[0]=l[R],q[1]=l[R+1],q.length=2),K(q,G),++F;break;case oi.DRAW_IMAGE:R=X[1],c=X[2],v=X[3],f=X[4],p=X[5];var J=X[6],H=X[7],Q=X[8],$=X[9],tt=X[10],et=X[11],it=X[12],nt=X[13],rt=X[14];if(!v&&X.length>=19){m=X[18],x=X[19],w=X[20],C=X[21];var ot=this.drawLabelWithPointPlacement_(m,x,w,C);v=ot.label,X[3]=v;var st=X[22];f=(ot.anchorX-st)*this.pixelRatio,X[4]=f;var at=X[23];p=(ot.anchorY-at)*this.pixelRatio,X[5]=p,J=v.height,X[6]=J,nt=v.width,X[13]=nt}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=ye,ut=!1,ct=!1),tt&&D?et+=A:tt||D||(et-=A);for(var ft=0;Ri)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+r)*e+(t+o))+3),r>0&&a.push(4*((t-r)*e+(t+o))+3),o>0&&(a.push(4*((t+r)*e+(t-o))+3),r>0&&a.push(4*((t-r)*e+(t-o))+3))}for(var l=[],h=(r=0,n.length);r0){if(!o||c!==wn&&c!==Tn||-1!==o.indexOf(t)){var h=(f[a]-3)/4,p=n-h%s,d=n-(h/s|0),g=r(t,e,p*p+d*d);if(g)return g}u.clearRect(0,0,s,s);break}}var d,g,_,y,v,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(m),d=x.length-1;d>=0;--d){var w=x[d].toString();for(_=this.executorsByZIndex_[w],g=Zn.length-1;g>=0;--g)if(void 0!==(y=_[c=Zn[g]])&&(v=y.executeHitDetection(u,a,i,p,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Mn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return O(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(m),this.maxExtent_&&(t.save(),this.clip(t,i));var l,h,u,c,f,p,d=o||Zn;for(s&&a.reverse(),l=0,h=a.length;lthis.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 rr(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new nr(t,e,i,n)}var or=nr,sr=0,ar=1,lr=2,hr=3,ur=4,cr={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},fr={};fr[cr.RADIANS]=6370997/(2*Math.PI),fr[cr.DEGREES]=2*Math.PI*6370997/360,fr[cr.FEET]=.3048,fr[cr.METERS]=1,fr[cr.USFEET]=1200/3937;var pr=cr,dr=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||fr[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}(),gr=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_r=6378137,yr=Math.PI*_r,vr=[-yr,-yr,yr,yr],mr=[-180,-85,180,85],xr=_r*Math.log(Math.tan(Math.PI/2)),wr=function(t){function e(e){return t.call(this,{code:e,units:pr.METERS,extent:vr,global:!0,worldExtent:mr,getPointResolution:function(t,e){return t/rt(e[1]/_r)}})||this}return gr(e,t),e}(dr),Sr=[new wr("EPSG:3857"),new wr("EPSG:102100"),new wr("EPSG:102113"),new wr("EPSG:900913"),new wr("http://www.opengis.net/def/crs/EPSG/0/3857"),new wr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Cr(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;sxr?a=xr:a<-xr&&(a=-xr),o[s+1]=a}return o}function Tr(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;sn[2])){var o=i||Bi(n);r=Math.floor((t[0]-n[0])/o)}return r}(t,e,i);n&&(t[0]-=n*i)}return t}function Gr(t,e,i){var n;if(void 0!==e){for(var r=0,o=t.length;r0&&(this.newTiles_=!0):a.setState(lr)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),f=u.getTileGridForProjection(r),p=f.getZForResolution(o,u.zDirection),d=f.getResolution(p),g=t.extent,_=i.extent&&qr(i.extent);_&&(g=Xi(g,qr(i.extent)));var y=u.getTilePixelRatio(l),v=Math.round(t.size[0]*y),x=Math.round(t.size[1]*y);if(a){var w=Math.round(Math.sqrt(v*v+x*x));v=w,x=w}var S=d*v/2/y,C=d*x/2/y,b=[s[0]-S,s[1]-C,s[0]+S,s[1]+C],O=f.getTileRangeForExtentAndZ(g,p),E={};E[p]={};var F=this.createLoadedTileFinder(u,r,E),P=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var I=O.minX;I<=O.maxX;++I)for(var M=O.minY;M<=O.maxY;++M){var k=this.getTile(p,I,M,t);if(this.isDrawableTile(k)){var L=Y(this);if(k.getState()==lr){E[p][k.tileCoord.toString()]=k;var j=k.inTransition(L);this.newTiles_||!j&&-1!==this.renderedTiles.indexOf(k)||(this.newTiles_=!0)}if(1===k.getAlpha(L,t.time))continue}var A=f.getTileCoordChildTileRange(k.tileCoord,R,P),D=!1;A&&(D=F(p+1,A)),D||f.forEachTileCoordParentTileRange(k.tileCoord,F,R,P)}var G=d/o;In(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-x/2);var W=function(t){var e="matrix("+t.join(", ")+")";if(ee)return e;var i=pn||(pn=document.createElement("div"));return i.style.transform=e,i.style.transform}(this.pixelTransform);this.useContainer(e,W,i.opacity);var X=this.context,z=X.canvas;!function(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];it(0!==n,32);var r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],h=e[5];t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=r/n,t[4]=(s*h-a*l)/n,t[5]=-(r*h-o*l)/n}(this.inversePixelTransform,this.pixelTransform),In(this.tempTransform,v/2,x/2,G,G,0,-v/2,-x/2),z.width!=v||z.height!=x?(z.width=v,z.height=x):this.containerReused||X.clearRect(0,0,v,x),_&&this.clipUnrotated(X,t,_),T(X,u.getContextOptions()),this.preRender(X,t),this.renderedTiles.length=0;var B,N,V,Z=Object.keys(E).map(Number);Z.sort(m),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(B=[],N=[]):Z=Z.reverse();for(var K=Z.length-1;K>=0;--K){var U=Z[K],q=u.getTilePixelSize(U,l,r),J=f.getResolution(U)/d,H=q[0]*J*G,Q=q[1]*J*G,$=f.getTileCoordForCoordAndZ(Yi(b),U),tt=f.getTileCoordExtent($),et=Pn(this.tempTransform,[y*(tt[0]-b[0])/d,y*(b[3]-tt[3])/d]),nt=y*u.getGutterForProjection(r),rt=E[U];for(var ot in rt){var st=(k=rt[ot]).tileCoord,at=$[1]-st[1],lt=Math.round(et[0]-(at-1)*H),ht=$[2]-st[2],ut=Math.round(et[1]-(ht-1)*Q),ct=lt-(I=Math.round(et[0]-at*H)),ft=ut-(M=Math.round(et[1]-ht*Q)),pt=p===U;if(!(j=pt&&1!==k.getAlpha(Y(this),t.time)))if(B){X.save(),V=[I,M,I+ct,M,I+ct,M+ft,I,M+ft];for(var dt=0,gt=B.length;dtthis.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 n=Oo(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=Oo(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Po=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=i,o.state=r,o}return Fo(e,t),e.prototype.changed=function(){this.dispatchEvent(R)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return W()},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(){W()},e}(P),Ro=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Io(t,e,i){var n=t;if(n.src&&ie){var r=n.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var s=[L(n,M,e),L(n,I,i)];return function(){s.forEach(j)}}!function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,Wt)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Wt,a.imageLoadFunction_=s,a}Ro(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=zt,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Wi(this.extent)/this.image_.height),this.state=Yt,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Wt&&this.state!=zt||(this.state=Xt,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Io(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Wi(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Po);var Mo=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ko=null,Lo=function(t){function e(e,i,n,r,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==r&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=n,a.src_=i,a.tainted_,a}return Mo(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Yt){ko||(ko=ne(1,1)),ko.drawImage(this.image_,0,0);try{ko.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ko=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(R)},e.prototype.handleImageError_=function(){this.imageState_=zt,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Yt,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=ne(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_==Wt){this.imageState_=Xt;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Io(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){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=Ut(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 n=i.getImageData(0,0,e.width,e.height),r=n.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=r.length;h0,6);var c=void 0!==n.src?Wt:Yt;return i.color_=void 0!==n.color?Jt(n.color):null,i.iconImage_=function(t,e,i,n,r,o){var s=Eo.get(e,n,o);return s||(s=new Lo(t,e,i,n,r,o),Eo.set(e,n,o,s)),s}(l,u,h,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:To,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return jo(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_==xo||this.anchorYUnits_==xo){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==xo&&(t[0]*=e[0]),this.anchorYUnits_==xo&&(t[1]*=e[1])}if(this.anchorOrigin_!=To){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=bo&&this.anchorOrigin_!=Co||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=So&&this.anchorOrigin_!=Co||(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_!=To){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=bo&&this.offsetOrigin_!=Co||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=So&&this.offsetOrigin_!=Co||(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(R,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(R,t)},e}(Vt),Do=Ao,Go=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_=Bt(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 je({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:un,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_=Bt(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}(),Wo=Go,Xo=.5;var Yo={Point:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Yt)return;var l=t.getBuilder(i.getZIndex(),wn);l.setImageStyle(s,o),l.drawPoint(e,n)}if(a&&a.getText()){var h=t.getBuilder(i.getZIndex(),Tn);h.setTextStyle(a,o),h.drawText(e,n)}},LineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Sn);s.setFillStrokeStyle(null,o),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),Tn);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Cn);a.setFillStrokeStyle(o,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(r||t).getBuilder(i.getZIndex(),Tn);h.setTextStyle(l),h.drawText(e,n)}},MultiPoint:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Yt)return;var l=t.getBuilder(i.getZIndex(),wn);l.setImageStyle(s,o),l.drawMultiPoint(e,n)}if(a&&a.getText()){var h=(r||t).getBuilder(i.getZIndex(),Tn);h.setTextStyle(a,o),h.drawText(e,n)}},MultiLineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Sn);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),Tn);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(s||o){var a=t.getBuilder(i.getZIndex(),Cn);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var h=(r||t).getBuilder(i.getZIndex(),Tn);h.setTextStyle(l),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n,r){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o0)e([]);else{var _=Yi(u.getTileCoordExtent(n.wrappedTileCoord)),y=[(c[0]-_[0])/h,(_[1]-c[1])/h],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=n.hitDetectionImageData[o];if(!x&&!this.animatingOrInteracting_){var w=Bt(u.getTileSize(u.getZForResolution(h))),S=this.renderedRotation_;x=function(t,e,i,n,r,o,s){var a=ne(t[0]*Xo,t[1]*Xo);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new mo(a,Xo,r,null,s),u=i.length,c=Math.floor(16777215/u),f={},p=1;p<=u;++p){var d=i[p-1],g=d.getStyleFunction()||n;if(n){var _=g(d,o);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(p*c).toString(16)).slice(-6),v=0,x=_.length;v=0;--u)h[u].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,r,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,n=e.viewState,r=n.center,o=n.resolution,s=n.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 En(Rn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(r,o,s,i,l,h,p))},e.prototype.renderFrame=function(e,i){var n=e.viewHints,r=!(n[io]||n[no]);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=Ko[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[Y(o)],v=!1,m=0,x=y.length;mt)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){W()},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 n,r=e-i+1e3/60;return r>=this.transition_?1:(n=r/this.transition_,Math.pow(n,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}(P),is=es,ns=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),rs=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.extent=null,a.format_=r,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=n,a.key=n,a}return ns(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==sr&&(this.setState(ar),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(hr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(lr)},e.prototype.setLoader=function(t){this.loader_=t},e}(is),os=rs,ss=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 it(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 it(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){it(!(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}();function as(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function ls(t,e,i){return t+"/"+e+"/"+i}function hs(t){return ls(t[0],t[1],t[2])}function us(t){return t.split("/").map(Number)}var cs=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return cs(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=us(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(hs(e.tileCoord)),e.release())}.bind(this))}},e}(ss),ps=fs,ds="tileloadstart",gs="tileloadend",_s="tileloaderror",ys=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function vs(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var ms=function(t){function e(e){var i=t.call(this)||this;i.projection=Yr(e.projection),i.attributions_=vs(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:vt,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var n=i;return i.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),i}return ys(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 W()},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_=vs(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(N),xs=[0,0,0],ws=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,it((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||m,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o=this.minZoom;){if(e(a,2===this.zoomFactor_?rr(r=Math.floor(r/2),r,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(r=1;r0?r-1:r:t[r-1]-e0?n:Math.max(s/a[0],o/a[1]),h=r+1,u=new Array(h),c=0;ci||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(n,r)}(t,n)?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,n){},e}(ms),Rs=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Fs(e,t),e}(_),Is=Ps;function Ms(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return it(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function ks(t,e){for(var i=t.length,n=new Array(i),r=0;r=200&&a.status<300){var n=e.getType(),l=void 0;n==Xs||n==Ys?l=a.responseText:n==zs?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==Ws&&(l=a.response),l?o(e.readFeatures(l,{extent:i,featureProjection:r}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}var Zs=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var Ks,Us=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=r,a.src_=n,a.key=n,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return Zs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=lr,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=hr,this.unlistenImage_(),this.image_=((t=ne(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=lr:this.state=ur,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==hr&&(this.state=sr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==sr&&(this.state=ar,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Io(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(is),qs=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Kr(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_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Bi(n)==Bi(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Bi(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Bi(this.targetProj_.getExtent()):null;var l=Yi(i),h=zi(i),u=Ai(i),c=ji(i),f=this.transformInv_(l),p=this.transformInv_(h),d=this.transformInv_(u),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(ot(Li(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=Bi(yi([t,e,i,n]))/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]))||Ni(h,this.maxSourceExtent_)){var d=0;if(!(p||isFinite(r[0])&&isFinite(r[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(r[0])&&isFinite(r[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=(ht(r[0],c)+ht(s[0],c))/2-ht(_[0],c);else y=(r[0]+s[0])/2-_[0];var v=(r[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=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(w);this.addQuad_(t,e,m,w,r,o,x,S,l-1),this.addQuad_(w,m,i,n,S,x,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],T=this.transformInv_(C),b=[(i[0]+n[0])/2,(i[1]+n[1])/2],O=this.transformInv_(b);this.addQuad_(t,C,b,n,r,T,O,a,l-1),this.addQuad_(C,e,i,b,T,o,s,O,l-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,i,n,r,s,a),0==(14&d)&&this.addTriangle_(t,i,e,r,s,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,a,r),0==(7&d)&&this.addTriangle_(e,n,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,n){var r=e.source;Ri(t,r[0]),Ri(t,r[1]),Ri(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),Js={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function Hs(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function Qs(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function $s(t,e,i,n){var r=Ur(i,e,t),o=zr(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||xi(l,r)){var h=zr(t,o,r)/o;isFinite(h)&&h>0&&(o/=h)}return o}function ta(t,e,i,n,r,o,s,a,l,h,u,c){var f=ne(Math.round(i*t),Math.round(i*e));if(T(f,c),0===l.length)return f.canvas;function p(t){return Math.round(t*i)/i}f.scale(i,i),f.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){var n,r;n=d,(r=t.extent)[0]n[2]&&(n[2]=r[2]),r[1]n[3]&&(n[3]=r[3])}));var g=Bi(d),_=Wi(d),y=ne(Math.round(i*g/n),Math.round(i*_/n));T(y,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-d[0],r=-(t.extent[3]-d[3]),o=Bi(t.extent),s=Wi(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*v,r*v,o*v,s*v)}));var m=Yi(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=p((a[0][0]-m[0])/o),w=p(-(a[0][1]-m[1])/o),S=p((a[1][0]-m[0])/o),C=p(-(a[1][1]-m[1])/o),T=p((a[2][0]-m[0])/o),b=p(-(a[2][1]-m[1])/o),O=l,E=h;l=0,h=0;var F=function(t){for(var e=t.length,i=0;ir&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=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-=O,g-=E,0,0,S-x],[_-=O,v-=E,0,0,T-x],[0,0,u,g,C-w],[0,0,_,v,b-w]]);if(F){if(f.save(),f.beginPath(),function(){if(void 0===Ks){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Hs(t,4,5,4,0),Hs(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Ks=Qs(e,0)||Qs(e,4)||Qs(e,8)}return Ks}()||c===Js){f.moveTo(S,C);for(var P=x-S,R=w-C,I=0;I<4;I++)f.lineTo(S+p((I+1)*P/4),C+p(I*R/3)),3!=I&&f.lineTo(S+p((I+1)*P/4),C+p((I+1)*R/3));f.lineTo(T,b)}else f.moveTo(S,C),f.lineTo(x,w),f.lineTo(T,b);f.clip(),f.transform(F[0],F[2],F[1],F[3],x,w),f.translate(d[0]-O,d[3]-E),f.scale(n/i,-n/i),f.drawImage(y.canvas,0,0),f.restore()}})),u&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-m[0])/o,s=-(n[0][1]-m[1])/o,a=(n[1][0]-m[0])/o,l=-(n[1][1]-m[1])/o,h=(n[2][0]-m[0])/o,u=-(n[2][1]-m[1])/o;f.beginPath(),f.moveTo(a,l),f.lineTo(r,s),f.lineTo(h,u),f.closePath(),f.stroke()})),f.restore()),f.canvas}var ea=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ia=function(t){function e(e,i,n,r,o,s,a,l,h,u,c,f){var p=t.call(this,o,sr)||this;p.renderEdges_=void 0!==c&&c,p.contextOptions_=f,p.pixelRatio_=a,p.gutter_=l,p.canvas_=null,p.sourceTileGrid_=i,p.targetTileGrid_=r,p.wrappedTileCoord_=s||o,p.sourceTiles_=[],p.sourcesListenerKeys_=null,p.sourceZ_=0;var d=r.getTileCoordExtent(p.wrappedTileCoord_),g=p.targetTileGrid_.getExtent(),_=p.sourceTileGrid_.getExtent(),y=g?Xi(d,g):d;if(0===Li(y))return p.state=ur,p;var v=e.getExtent();v&&(_=_?Xi(_,v):v);var m=r.getResolution(p.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=Di(i),o=$s(t,e,r,n);return(!isFinite(o)||o<=0)&&ki(i,(function(i){return o=$s(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,y,m);if(!isFinite(x)||x<=0)return p.state=ur,p;var w=void 0!==u?u:.5;if(p.triangulation_=new qs(e,n,y,_,x*w,m),0===p.triangulation_.getTriangles().length)return p.state=ur,p;p.sourceZ_=i.getZForResolution(x);var S=p.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(S[1]=nt(S[1],_[1],_[3]),S[3]=nt(S[3],_[1],_[3])):S=Xi(S,_)),Li(S)){for(var C=i.getTileRangeForExtentAndZ(S,p.sourceZ_),T=C.minX;T<=C.maxX;T++)for(var b=C.minY;b<=C.maxY;b++){var O=h(p.sourceZ_,T,b,a);O&&p.sourceTiles_.push(O)}0===p.sourceTiles_.length&&(p.state=ur)}else p.state=ur;return p}return ea(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==lr&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=hr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="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_=ta(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=lr}this.changed()},e.prototype.load=function(){if(this.state==sr){this.state=ar,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==sr||r==ar){t++;var o=k(e,R,(function(i){var n=e.getState();n!=lr&&n!=hr&&n!=ur||(j(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()==sr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(j),this.sourcesListenerKeys_=null},e}(is),na=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ra=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:oa,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Us,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?Js:void 0,i.renderReprojectionEdges_=!1,i}return na(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Vr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Vr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Vr(e,t)){var i=Y(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Cs(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Vr(e,t))return this.tileCache;var i=Y(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new ps(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,h=new this.tileClass(s,void 0!==l?sr:ur,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=o,h.addEventListener(R,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!Vr(o,r)){var s=this.getTileCacheForProjection(r),a=[t,e,i],l=void 0,h=hs(a);s.containsKey(h)&&(l=s.get(h));var u=this.getKey();if(l&&l.key==u)return l;var c=this.getTileGridForProjection(o),f=this.getTileGridForProjection(r),p=this.getTileCoordForTileUrlFunction(a,r),d=new ia(o,c,r,f,a,p,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return d.key=u,l?(d.interimTile=l,d.refreshInterimChain(),s.replace(h,d)):s.set(h,d),d}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=ls(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==sr?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Yr(t);if(i){var n=Y(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(js);function oa(t,e){t.getImage().src=e}var sa=ra,aa=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();!function(t){function e(e){var i=this,n="Unexpected response status: "+e.status;return(i=t.call(this,n)||this).name="ResponseError",i.response=e,i}aa(e,t)}(Error),function(t){function e(e){var i=t.call(this,"Failed to issue request")||this;return i.name="ClientError",i.client=e,i}aa(e,t)}(Error);var la=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 n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ha=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,imageSmoothing:e.imageSmoothing,projection:Yr("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:yt,tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this;if(i.tileJSON_=null,i.tileSize_=e.tileSize,e.url)if(e.jsonp)!function(t,e,i,n){var r=document.createElement("script"),o="olc_"+Y(e);function s(){delete window[o],r.parentNode.removeChild(r)}r.async=!0,r.src=t+(-1==t.indexOf("?")?"?":"&")+(n||"callback")+"="+o;var a=setTimeout((function(){s(),i&&i()}),1e4);window[o]=function(t){clearTimeout(a),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(r)}(e.url,i.handleTileJSONResponse.bind(i),i.handleTileJSONError.bind(i));else{var n=new XMLHttpRequest;n.addEventListener("load",i.onXHRLoad_.bind(i)),n.addEventListener("error",i.onXHRError_.bind(i)),n.open("GET",e.url),n.send()}else e.tileJSON?i.handleTileJSONResponse(e.tileJSON):it(!1,51);return i}return la(e,t),e.prototype.onXHRLoad_=function(t){var e=t.target;if(!e.status||e.status>=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=Yr("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var r=Zr(i,n);e=Vi(t.bounds,r)}var o=Es(n),s=t.minzoom||0,a=Ts({extent:o,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.tileSize_});if(this.tileGrid=a,this.tileUrlFunction=ks(t.tiles,a),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:o;this.setAttributions((function(e){return Ni(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState(vt)},e.prototype.handleTileJSONError=function(){this.setState(mt)},e}(sa),ua=ha,ca=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var n=e.dataProjection?Yr(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===pr.TILE_PIXELS&&(n=Yr(n)).setWorldExtent(e.extent),i={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return T({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return W()},t.prototype.readFeature=function(t,e){return W()},t.prototype.readFeatures=function(t,e){return W()},t.prototype.readGeometry=function(t,e){return W()},t.prototype.readProjection=function(t){return W()},t.prototype.writeFeature=function(t,e){return W()},t.prototype.writeFeatures=function(t,e){return W()},t.prototype.writeGeometry=function(t,e){return W()},t}();function fa(t,e,i,n,r,o,s){var a,l=t[e],h=t[e+1],u=t[i]-l,c=t[i+1]-h;if(0===u&&0===c)a=e;else{var f=((r-l)*u+(o-h)*c)/(u*u+c*c);if(f>1)a=i;else{if(f>0){for(var p=0;pr&&(r=h),o=a,s=l}return r}function da(t,e,i,n,r){for(var o=0,s=i.length;o>1)],e))<0?s=n+1:(a=n,l=!r);return l?s:~s}(p,y);v<0?(l=(y-p[-v-2])/(p[-v-1]-p[-v-2]),a=e+(-v-2)*n):a=e+v*n}var x=s>1?s:2,w=o||new Array(x);for(d=0;d>1;ro&&(h-a)*(o-l)-(r-a)*(u-l)>0&&s++:u<=o&&(h-a)*(o-l)-(r-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function Ta(t,e,i,n,r,o){if(0===i.length)return!1;if(!Ca(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;s=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||ma(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=Ci(t,e),o=Ci(t,i);if(r===ai||o===ai)n=!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&li&&!(r&li)&&(n=(g=f-(p-h)/d)>=s&&g<=l),n||!(o&hi)||r&hi||(n=(_=p-(f-l)*d)>=a&&_<=h),n||!(o&ui)||r&ui||(n=(g=f-(p-a)/d)>=s&&g<=l),n||!(o&ci)||r&ci||(n=(_=p-(f-s)*d)>=a&&_<=h)}return n}(r,t,e)})))))}function Oa(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(ba(t,e,i,n,r)||Ca(t,e,i,n,r[0],r[1])||Ca(t,e,i,n,r[0],r[3])||Ca(t,e,i,n,r[2],r[1])||Ca(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;ow&&Ta(t,e,i,n,h=(u+c)/2,d)&&(x=h,w=S),u=c}return isNaN(x)&&(x=r[o]),s?(s.push(x,d,w),s):[x,d,w]}function Va(t,e,i,n,r){for(var o=[],s=0,a=i.length;s0}function Ua(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s */ -read:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<>1,u=-7,c=i?r-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+=n;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,n),o-=h}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,h=8*o-r-1,u=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?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,r),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,r),s=0));r>=8;t[i+p]=255&a,p+=d,a/=256,r-=8);for(s=s<0;t[i+p]=255&s,p+=d,s/=256,h-=8);t[i+p-d]|=128*g}},ol=al,sl=rl;function al(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}al.Varint=0,al.Fixed64=1,al.Bytes=2,al.Fixed32=5;var ll=4294967296,hl=1/ll,ul="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function cl(t){return t.type===al.Bytes?t.readVarint()+t.pos:t.pos+1}function fl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function pl(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function dl(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function bl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}al.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&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Cl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=bl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Cl(this.buf,this.pos)+Cl(this.buf,this.pos+4)*ll;return this.pos+=8,t},readSFixed64:function(){var t=Cl(this.buf,this.pos)+bl(this.buf,this.pos+4)*ll;return this.pos+=8,t},readFloat:function(){var t=sl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=sl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return fl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[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&&ul?function(t,e,i){return ul.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(h=l):2===u?128==(192&(o=t[r+1]))&&(h=(31&l)<<6|63&o)<=127&&(h=null):3===u?(o=t[r+1],s=t[r+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[r+1],s=t[r+2],a=t[r+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,n+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),n+=String.fromCharCode(h),r+=u}return n}(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!==al.Bytes)return t.push(this.readVarint(e));var i=cl(this);for(t=t||[];this.pos127;);else if(e===al.Bytes)this.pos=this.readVarint()+this.pos;else if(e===al.Fixed32)this.pos+=4;else{if(e!==al.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,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+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}(n,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 n,r,o=0;o55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&pl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),sl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),sl.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&&pl(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,al.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,_l,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,xl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,wl,e)},writeBytesField:function(t,e){this.writeTag(t,al.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,al.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,al.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,al.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,al.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,al.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,al.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,al.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,al.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,al.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ol=[1,0,0,1,0,0],El=function(){function t(t,e,i,n,r){this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Ae?Ei(this.flatCoordinates_):Fi(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Di(this.getExtent());this.flatInteriorPoints_=Na(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=tl(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Va(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=xa(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_,n=0,r=i.length;n>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&h>u&&(n.push(h),u=h),i.push(a,l),h+=2):7===o?h>u&&(i.push(i[u],i[u+1]),h+=2):it(!1,59)}h>u&&(n.push(h),u=h)},e.prototype.createFeature_=function(t,e,i){var n,r=e.type;if(0===r)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?Ae:Xe:2===t?i=1===e?De:Ye:3===t&&(i=We);return i}(r,l.length);if(this.featureClass_===Fl)(n=new this.featureClass_(h,a,l,s,o)).transform(i.dataProjection);else{var u=void 0;if(h==We){for(var c=[],f=0,p=0,d=0,g=l.length;d1?new nl(a,lo,c):new $a(a,lo,l)}else u=h===Ae?new ja(a,lo):h===De?new Pa(a,lo):h===We?new $a(a,lo,l):h===Xe?new Ga(a,lo):h===Ye?new Ma(a,lo,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var y=function(t,e,i){var n,r=i?Yr(i.featureProjection):null,o=i?Yr(i.dataProjection):null;if(n=r&&o&&!Vr(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);n===t&&(n=t.clone()),n.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(n)}}function kl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var n=i.readVarint()+i.pos;i.pos1&&void 0!==arguments[1]?arguments[1]:{};r(this,i);var s=document.createElement("div");return s.className="level-control ol-unselectable ol-control",(n=e.call(this,{element:s,target:o.target})).indoorEqual=t,n._renderNewLevels(),n.indoorEqual.on("change:levels",n._renderNewLevels.bind(c(n))),n.indoorEqual.on("change:level",n._renderNewLevels.bind(c(n))),n}return s(i,[{key:"_renderNewLevels",value:function(){var t=this;this.element.innerHTML="";var e=this.indoorEqual.get("level");this.indoorEqual.get("levels").forEach((function(i){var n=document.createElement("button");e===i&&n.classList.add("level-control-active"),n.textContent=i,n.addEventListener("click",(function(){t.indoorEqual.set("level",i)})),t.element.appendChild(n)}))}}]),i}(function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Xl(e,t),e.prototype.disposeInternal=function(){re(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&re(this.element);for(var e=0,i=this.listenerKeys.length;e1&&void 0!==arguments[1]?arguments[1]:{};r(this,n);var a={url:"https://tiles.indoorequal.org/"},l=i(i({},a),s);if(l.url===a.url&&!l.apiKey)throw"You must register your apiKey at https://indoorequal.com before and set it as apiKey param.";return(o=e.call(this,{levels:[],level:"0"})).map=t,o.url=l.url,o.apiKey=l.apiKey,o.styleFunction=zl,o._addLayer(),o._changeLayerOnLevelChange(),o._setLayerStyle(),o}return s(n,[{key:"setStyle",value:function(t){this.styleFunction=t}},{key:"_addLayer",value:function(){var t=this.apiKey?"?key=".concat(this.apiKey):"";this.layer=Gl("".concat(this.url).concat(t)),this.map.addLayer(this.layer),this._listenForLevels()}},{key:"_listenForLevels",value:function(){var t=this;this.layer.on("change:source",(function(){var e=t.layer.getSource();e.on("tileloadend",(function(){var i=t.map.getView().calculateExtent(t.map.getSize()),n=e.getFeaturesInExtent(i);t.set("levels",function(t){for(var e=[],i=0;i>1,u=-7,c=i?r-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+=n;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,n),o-=h}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,h=8*o-r-1,u=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?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,r),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,r),s=0));r>=8;t[i+p]=255&a,p+=d,a/=256,r-=8);for(s=s<0;t[i+p]=255&s,p+=d,s/=256,h-=8);t[i+p-d]|=128*g}},ol=al,sl=rl;function al(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}al.Varint=0,al.Fixed64=1,al.Bytes=2,al.Fixed32=5;var ll=4294967296,hl=1/ll,ul="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function cl(t){return t.type===al.Bytes?t.readVarint()+t.pos:t.pos+1}function fl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function pl(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function dl(t,e){for(var i=0;i>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function bl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}al.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&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Cl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=bl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Cl(this.buf,this.pos)+Cl(this.buf,this.pos+4)*ll;return this.pos+=8,t},readSFixed64:function(){var t=Cl(this.buf,this.pos)+bl(this.buf,this.pos+4)*ll;return this.pos+=8,t},readFloat:function(){var t=sl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=sl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return fl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[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&&ul?function(t,e,i){return ul.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(h=l):2===u?128==(192&(o=t[r+1]))&&(h=(31&l)<<6|63&o)<=127&&(h=null):3===u?(o=t[r+1],s=t[r+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[r+1],s=t[r+2],a=t[r+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,n+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),n+=String.fromCharCode(h),r+=u}return n}(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!==al.Bytes)return t.push(this.readVarint(e));var i=cl(this);for(t=t||[];this.pos127;);else if(e===al.Bytes)this.pos=this.readVarint()+this.pos;else if(e===al.Fixed32)this.pos+=4;else{if(e!==al.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,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+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}(n,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 n,r,o=0;o55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&pl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),sl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),sl.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&&pl(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,al.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,dl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,_l,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,yl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,xl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writeBytesField:function(t,e){this.writeTag(t,al.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,al.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,al.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,al.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,al.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,al.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,al.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,al.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,al.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,al.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ol=[1,0,0,1,0,0],El=function(){function t(t,e,i,n,r){this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Ae?Ei(this.flatCoordinates_):Fi(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=Di(this.getExtent());this.flatInteriorPoints_=Na(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=tl(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Va(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=xa(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_,n=0,r=i.length;n>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&h>u&&(n.push(h),u=h),i.push(a,l),h+=2):7===o?h>u&&(i.push(i[u],i[u+1]),h+=2):it(!1,59)}h>u&&(n.push(h),u=h)},e.prototype.createFeature_=function(t,e,i){var n,r=e.type;if(0===r)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?Ae:Xe:2===t?i=1===e?De:Ye:3===t&&(i=We);return i}(r,l.length);if(this.featureClass_===Fl)(n=new this.featureClass_(h,a,l,s,o)).transform(i.dataProjection);else{var u=void 0;if(h==We){for(var c=[],f=0,p=0,d=0,g=l.length;d1?new nl(a,lo,c):new $a(a,lo,l)}else u=h===Ae?new ja(a,lo):h===De?new Pa(a,lo):h===We?new $a(a,lo,l):h===Xe?new Ga(a,lo):h===Ye?new Ma(a,lo,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var y=function(t,e,i){var n,r=i?Yr(i.featureProjection):null,o=i?Yr(i.dataProjection):null;if(n=r&&o&&!Vr(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);n===t&&(n=t.clone()),n.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(n)}}function kl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var n=i.readVarint()+i.pos;i.pos1&&void 0!==arguments[1]?arguments[1]:{};r(this,i);var s=document.createElement("div");return s.className="level-control ol-unselectable ol-control",(n=e.call(this,{element:s,target:o.target})).indoorEqual=t,n._renderNewLevels(),n.indoorEqual.on("change:levels",n._renderNewLevels.bind(c(n))),n.indoorEqual.on("change:level",n._renderNewLevels.bind(c(n))),n}return s(i,[{key:"_renderNewLevels",value:function(){var t=this;this.element.innerHTML="";var e=this.indoorEqual.get("level");this.indoorEqual.get("levels").forEach((function(i){var n=document.createElement("button");e===i&&n.classList.add("level-control-active"),n.textContent=i,n.addEventListener("click",(function(){t.indoorEqual.set("level",i)})),t.element.appendChild(n)}))}}]),i}(function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return Xl(e,t),e.prototype.disposeInternal=function(){re(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&re(this.element);for(var e=0,i=this.listenerKeys.length;e1&&void 0!==arguments[1]?arguments[1]:{};r(this,n);var a={url:"https://tiles.indoorequal.org/"},l=i(i({},a),s);if(l.url===a.url&&!l.apiKey)throw"You must register your apiKey at https://indoorequal.com before and set it as apiKey param.";return(o=e.call(this,{levels:[],level:"0"})).map=t,o.url=l.url,o.apiKey=l.apiKey,o.styleFunction=zl,o._addLayer(),o._changeLayerOnLevelChange(),o._setLayerStyle(),o}return s(n,[{key:"setStyle",value:function(t){this.styleFunction=t}},{key:"_addLayer",value:function(){var t=this.apiKey?"?key=".concat(this.apiKey):"";this.layer=Gl("".concat(this.url).concat(t)),this.map.addLayer(this.layer),this._listenForLevels()}},{key:"_listenForLevels",value:function(){var t=this;this.layer.on("change:source",(function(){var e=t.layer.getSource();e.on("tileloadend",(function(){var i=t.map.getView().calculateExtent(t.map.getSize()),n=e.getFeaturesInExtent(i);t.set("levels",function(t){for(var e=[],i=0;i