You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
2 weeks ago
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2910],{61831:function(t,e,n){var i=n(41376),r=n(70492),o=n(76166),s=n(42010),a=n(6566),l=n(46583),u=n(99626),c=n(33248),h=n(80542),f=n(86923),d=n(90776),p=n(75059),v=n(19352),y=n(5162),_=n(12810),g=n(12016),m=n(40574);function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function k(t,e,n){return e&&R(t.prototype,e),n&&R(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function O(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&T(t,e)}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=j(t);if(e){var r=j(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return S(this,n)}}function S(t,e){if(e&&("object"===b(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Z(t)}function Z(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var x=function(t){O(n,t);var e=w(n);function n(t,i,r,o,s,a){var l;return E(this,n),(l=e.call(this,t,i)).src_=r,l.extent_=o,l.preemptive_=s,l.grid_=null,l.keys_=null,l.data_=null,l.jsonp_=a,l}return k(n,[{key:"getImage",value:function(){return null}},{key:"getData",value:function(t){if(!this.grid_||!this.keys_)return null;var e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),n=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),i=this.grid_[Math.floor((1-n)*this.grid_.length)];if("string"!=typeof i)return null;var r=i.charCodeAt(Math.floor(e*i.length));r>=93&&r--,r>=35&&r--;var o=null;if((r-=32)in this.keys_){var s=this.keys_[r];o=this.data_&&s in this.data_?this.data_[s]:s}return o}},{key:"forDataAtCoordinate",value:function(t,e,n){this.state==h.Z.EMPTY&&!0===n?(this.state=h.Z.IDLE,(0,g.Vx)(this,a.Z.CHANGE,(function(n){e(this.getData(t))}),this),this.loadInternal_()):!0===n?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))}},{key:"getKey",value:function(){return this.src_}},{key:"handleError_",value:function(){this.state=h.Z.ERROR,this.changed()}},{key:"handleLoad_",value:function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=h.Z.LOADED,this.changed()}},{key:"loadInternal_",value:function(){if(this.state==h.Z.IDLE)if(this.state=h.Z.LOADING,this.jsonp_)(0,m.R6)(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}}},{key:"onXHRLoad_",value:function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var n;try{n=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(n)}else this.handleError_()}},{key:"onXHRError_",value:function(t){this.handleError_()}},{key:"load",value:function(){this.preemptive_?this.loadInternal_():this.setState(h.Z.EMPTY)}}]),n}(u.Z),L=function(t){O(n,t);var
|
||
|
//# sourceMappingURL=utfgrid.js.map
|