/*! * * iclient-openlayers * Copyright© 2000 - 2023 SuperMap Software Co.Ltd * license: Apache-2.0 * version: v11.1.0-beta * */(()=>{var e={693:function(e){!function(t){"use strict";if(t.__disableNativeFetch||!t.fetch){o.prototype.append=function(e,t){e=n(e),t=a(t);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(t)},o.prototype.delete=function(e){delete this.map[n(e)]},o.prototype.get=function(e){var t=this.map[n(e)];return t?t[0]:null},o.prototype.getAll=function(e){return this.map[n(e)]||[]},o.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},o.prototype.set=function(e,t){this.map[n(e)]=[a(t)]},o.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(s){e.call(t,s,r,this)},this)},this)};var r={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},s=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this)},c.call(d.prototype),c.call(f.prototype),f.prototype.clone=function(){return new f(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},f.error=function(){var e=new f(null,{status:0,statusText:""});return e.type="error",e};var i=[301,302,303,307,308];f.redirect=function(e,t){if(-1===i.indexOf(t))throw new RangeError("Invalid status code");return new f(null,{status:t,headers:{location:e}})},t.Headers=o,t.Request=d,t.Response=f,t.fetch=function(e,t){return new Promise(function(s,i){var n;n=d.prototype.isPrototypeOf(e)&&!t?e:new d(e,t);var a=new XMLHttpRequest;var l=!1;function h(){if(4===a.readyState){var e=1223===a.status?204:a.status;if(e<100||e>599){if(l)return;return l=!0,void i(new TypeError("Network request failed"))}var t={status:e,statusText:a.statusText,headers:function(e){var t=new o;return e.getAllResponseHeaders().trim().split("\n").forEach(function(e){var r=e.trim().split(":"),s=r.shift().trim(),i=r.join(":").trim();t.append(s,i)}),t}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;l||(l=!0,s(new f(r,t)))}}a.onreadystatechange=h,a.onload=h,a.onerror=function(){l||(l=!0,i(new TypeError("Network request failed")))},a.open(n.method,n.url,!0);try{"include"===n.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(e){console&&console.warn&&console.warn("set withCredentials error:"+e)}"responseType"in a&&r.blob&&(a.responseType="blob"),n.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send(void 0===n._bodyInit?null:n._bodyInit)})},t.fetch.polyfill=!0,e.exports&&(e.exports=t.fetch)}function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){this.map={},e instanceof o?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(e){var t=new FileReader;return t.readAsArrayBuffer(e),h(t)}function c(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(u)},this.text=function(){var e,t,r,s,i,n,a,o=l(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,r=new FileReader,s=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",i=/charset\=[0-9a-zA-Z\-\_]*;?/,n=e.type.match(i)||s.match(i),a=[e],n&&a.push(n[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),h(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=l(this);return e||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(e,t){var r,i,n=(t=t||{}).body;if(d.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),s.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n,t)}function p(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),s=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(i))}}),t}function f(e,t){t||(t={}),this._initBody(e,t),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof o?t.headers:new o(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:this)},144:function(e,t){var r,s,i;s=[t,e],void 0===(i="function"==typeof(r=function(e,t){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function s(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);t&&document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=e,a=t.timeout||r.timeout,o=t.jsonpCallback||r.jsonpCallback,l=void 0;return new Promise(function(r,h){var u=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=o+"_"+u;window[u]=function(e){r({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),i(c),s(u)},n+=-1===n.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",""+n+o+"="+u),t.charset&&d.setAttribute("charset",t.charset),d.id=c,document.getElementsByTagName("head")[0].appendChild(d),l=setTimeout(function(){h(new Error("JSONP request to "+e+" timed out")),s(u),i(c),window[u]=function(){s(u)}},a),d.onerror=function(){h(new Error("JSONP request to "+e+" failed")),s(u),i(c),l&&clearTimeout(l)}})}})?r.apply(t,s):r)||(e.exports=i)},962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;var s=r(505),i=r(147),n=function(){function e(e){var t;this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,t=e||1024,this.bb=s.ByteBuffer.allocate(t),this.space=t}return e.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null},e.prototype.forceDefaults=function(e){this.force_defaults=e},e.prototype.dataBuffer=function(){return this.bb},e.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},e.prototype.prep=function(t,r){t>this.minalign&&(this.minalign=t);for(var s=1+~(this.bb.capacity()-this.space+r)&t-1;this.space=0&&0==this.vtable[t];t--);for(var r=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var s=(r+2)*i.SIZEOF_SHORT;this.addInt16(s);var n=0,a=this.space;e:for(t=0;t=0;a--)this.writeInt8(n.charCodeAt(a))}this.prep(this.minalign,i.SIZEOF_INT+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},e.prototype.finishSizePrefixed=function(e,t){this.finish(e,t,!0)},e.prototype.requiredField=function(e,t){var r=this.bb.capacity()-e,s=r-this.bb.readInt32(r);if(!(0!=this.bb.readInt16(s+t)))throw new Error("FlatBuffers: field "+t+" must be set")},e.prototype.startVector=function(e,t,r){this.notNested(),this.vector_num_elems=t,this.prep(i.SIZEOF_INT,e*t),this.prep(r,e*t)},e.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},e.prototype.createSharedString=function(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);var t=this.createString(e);return this.string_maps.set(e,t),t},e.prototype.createString=function(e){if(null===e||void 0===e)return 0;var t;if(e instanceof Uint8Array)t=e;else{t=[];for(var r=0;r=56320)s=i;else s=(i<<10)+e.charCodeAt(r++)+-56613888;s<128?t.push(s):(s<2048?t.push(s>>6&31|192):(s<65536?t.push(s>>12&15|224):t.push(s>>18&7|240,s>>12&63|128),t.push(s>>6&63|128)),t.push(63&s|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);r=0;for(var n=this.space,a=this.bb.bytes();r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ByteBuffer=void 0;var s=r(147),i=r(766),n=r(650),a=function(){function e(e){this.bytes_=e,this.position_=0}return e.allocate=function(t){return new e(new Uint8Array(t))},e.prototype.clear=function(){this.position_=0},e.prototype.bytes=function(){return this.bytes_},e.prototype.position=function(){return this.position_},e.prototype.setPosition=function(e){this.position_=e},e.prototype.capacity=function(){return this.bytes_.length},e.prototype.readInt8=function(e){return this.readUint8(e)<<24>>24},e.prototype.readUint8=function(e){return this.bytes_[e]},e.prototype.readInt16=function(e){return this.readUint16(e)<<16>>16},e.prototype.readUint16=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8},e.prototype.readInt32=function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24},e.prototype.readUint32=function(e){return this.readInt32(e)>>>0},e.prototype.readInt64=function(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8},e.prototype.writeUint16=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8},e.prototype.writeInt32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},e.prototype.writeUint32=function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24},e.prototype.writeInt64=function(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))},e.prototype.writeUint64=function(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))},e.prototype.writeFloat32=function(e,t){i.float32[0]=t,this.writeInt32(e,i.int32[0])},e.prototype.writeFloat64=function(e,t){i.float64[0]=t,this.writeInt32(e,i.int32[i.isLittleEndian?0:1]),this.writeInt32(e+4,i.int32[i.isLittleEndian?1:0])},e.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&o)))}return i},e.prototype.__union_with_string=function(e,t){return"string"==typeof e?this.__string(t):this.__union(e,t)},e.prototype.__indirect=function(e){return e+this.readInt32(e)},e.prototype.__vector=function(e){return e+this.readInt32(e)+s.SIZEOF_INT},e.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},e.prototype.__has_identifier=function(e){if(e.length!=s.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+s.FILE_IDENTIFIER_LENGTH);for(var t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SIZE_PREFIX_LENGTH=t.FILE_IDENTIFIER_LENGTH=t.SIZEOF_INT=t.SIZEOF_SHORT=void 0,t.SIZEOF_SHORT=2,t.SIZEOF_INT=4,t.FILE_IDENTIFIER_LENGTH=4,t.SIZE_PREFIX_LENGTH=4},650:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoding=void 0,function(e){e[e.UTF8_BYTES=1]="UTF8_BYTES",e[e.UTF16_STRING=2]="UTF16_STRING"}(t.Encoding||(t.Encoding={}))},903:(e,t,r)=>{"use strict";t.cZ=t.XU=void 0;var s=r(147);var i=r(147);var n=r(147);var a=r(147);Object.defineProperty(t,"XU",{enumerable:!0,get:function(){return a.SIZE_PREFIX_LENGTH}});var o=r(766);var l=r(650);var h=r(962);var u=r(505);Object.defineProperty(t,"cZ",{enumerable:!0,get:function(){return u.ByteBuffer}})},766:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=t.float64=t.float32=t.int32=void 0,t.int32=new Int32Array(2),t.float32=new Float32Array(t.int32.buffer),t.float64=new Float64Array(t.int32.buffer),t.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0]},478:(e,t,r)=>{var s=200,i="__lodash_hash_undefined__",n=9007199254740991,a="[object Arguments]",o="[object Function]",l="[object GeneratorFunction]",h=/^\[object .+?Constructor\]$/,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,d=u||c||Function("return this")();function p(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,s){var i=e.length,n=r+(s?1:-1);for(;s?n--:++n-1}function f(e,t,r){for(var s=-1,i=e?e.length:0;++s=s&&(o=g,l=!1,t=new D(t));e:for(;++a-1},k.prototype.set=function(e,t){var r=this.__data__,s=G(r,e);return s<0?r.push([e,t]):r[s][1]=t,this},R.prototype.clear=function(){this.__data__={hash:new F,map:new(I||k),string:new F}},R.prototype.delete=function(e){return U(this,e).delete(e)},R.prototype.get=function(e){return U(this,e).get(e)},R.prototype.has=function(e){return U(this,e).has(e)},R.prototype.set=function(e,t){return U(this,e).set(e,t),this},D.prototype.add=D.prototype.push=function(e){return this.__data__.set(e,i),this},D.prototype.has=function(e){return this.__data__.has(e)};var J=function(e,t){return t=L(void 0===t?e.length-1:t,0),function(){for(var r=arguments,s=-1,i=L(r.length-t,0),n=Array(i);++s0&&s(l)?r>1?e(l,r-1,s,i,n):m(n,l):i||(n[n.length]=l)}return n}(t,1,W,!0)):[]});var q=Array.isArray;function H(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Y(e)}function W(e){return function(e){return!!e&&"object"==typeof e}(e)&&H(e)}function Y(e){var t=X(e)?T.call(e):"";return t==o||t==l}function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=J},794:(e,t,r)=>{e=r.nmd(e);var s=200,i="Expected a function",n="__lodash_hash_undefined__",a=1,o=2,l=1/0,h=9007199254740991,u="[object Arguments]",c="[object Array]",d="[object Boolean]",p="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",g="[object Map]",v="[object Number]",b="[object Object]",S="[object RegExp]",x="[object Set]",_="[object String]",w="[object Symbol]",C="[object ArrayBuffer]",T="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,E=/^\w*$/,A=/^\./,O=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N[u]=N[c]=N[C]=N[d]=N[T]=N[p]=N[f]=N[m]=N[g]=N[v]=N[b]=N[S]=N[x]=N[_]=N["[object WeakMap]"]=!1;var F="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,R=F||k||Function("return this")(),D=t&&!t.nodeType&&t,G=D&&e&&!e.nodeType&&e,B=G&&G.exports===D&&F.process,j=function(){try{return B&&B.binding("util")}catch(e){}}(),U=j&&j.isTypedArray;function V(e,t){for(var r=-1,s=e?e.length:0;++rh))return!1;var c=n.get(e);if(c&&n.get(t))return c==t;var d=-1,p=!0,f=i&a?new we:void 0;for(n.set(e,t),n.set(t,e);++d-1},xe.prototype.set=function(e,t){var r=this.__data__,s=Me(r,e);return s<0?r.push([e,t]):r[s][1]=t,this},_e.prototype.clear=function(){this.__data__={hash:new Se,map:new(oe||xe),string:new Se}},_e.prototype.delete=function(e){return ke(this,e).delete(e)},_e.prototype.get=function(e){return ke(this,e).get(e)},_e.prototype.has=function(e){return ke(this,e).has(e)},_e.prototype.set=function(e,t){return ke(this,e).set(e,t),this},we.prototype.add=we.prototype.push=function(e){return this.__data__.set(e,n),this},we.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.clear=function(){this.__data__=new xe},Ce.prototype.delete=function(e){return this.__data__.delete(e)},Ce.prototype.get=function(e){return this.__data__.get(e)},Ce.prototype.has=function(e){return this.__data__.has(e)},Ce.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xe){var i=r.__data__;if(!oe||i.length-1&&e%1==0&&ei?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var n=Array(i);++s-1&&e%1==0&&e<=h}function et(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function tt(e){return!!e&&"object"==typeof e}function rt(e){return"symbol"==typeof e||tt(e)&&$.call(e)==w}var st=U?function(e){return function(t){return e(t)}}(U):function(e){return tt(e)&&$e(e.length)&&!!N[$.call(e)]};function it(e){return Ze(e)?Te(e):Ie(e)}function nt(e){return e}e.exports=function(e,t){var r=[];if(!e||!e.length)return r;var s=-1,i=[],n=e.length;for(t=Le(t);++s{var s=9007199254740991,i="[object Arguments]",n="[object Function]",a="[object GeneratorFunction]",o="[object Map]",l="[object Set]",h=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,d="object"==typeof self&&self&&self.Object===Object&&self,p=c||d||Function("return this")();function f(e,t){return function(e,t){for(var r=-1,s=e?e.length:0,i=Array(s);++r-1&&e%1==0&&e-1&&e%1==0&&e<=s}(e.length)&&!J(e)}function J(e){var t=q(e)?x.call(e):"";return t==n||t==a}function q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var H=function(e){return function(t){var r,s,i,n=B(t);return n==o?(r=t,s=-1,i=Array(r.size),r.forEach(function(e,t){i[++s]=[t,e]}),i):n==l?function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}(t):f(t,e(t))}}(function(e){return z(e)?k(e):D(e)});e.exports=H},785:function(e){e.exports=function(){"use strict";var e=1,t=2,r=3,s=4,i=5,n=484813681109536e-20,a=Math.PI/2,o=.16666666666666666,l=.04722222222222222,h=.022156084656084655,u=1e-10,c=.017453292519943295,d=57.29577951308232,p=Math.PI/4,f=2*Math.PI,m=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},g={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},v=/[\s_\-\/\(\)]/g;function b(e,t){if(e[t])return e[t];for(var r,s=Object.keys(e),i=t.toLowerCase().replace(v,""),n=-1;++n=this.text.length)return;e=this.text[this.place++]}switch(this.state){case x:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},E.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(T.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},E.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=x)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=x,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},E.prototype.number=function(e){if(!M.test(e)){if(T.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},E.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},E.prototype.keyword=function(e){if(C.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=x)}if(!T.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},E.prototype.neutral=function(e){if(w.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(M.test(e))return this.word=e,void(this.state=3);if(!T.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},E.prototype.output=function(){for(;this.place0?90:-90),e.lat_ts=e.lat1)}(i),i};function N(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?N[e]=S(arguments[1]):N[e]=I(arguments[1]):N[e]=r}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?N.apply(t,e):N(e)});if("string"==typeof e){if(e in N)return N[e]}else"EPSG"in e?N["EPSG:"+e.EPSG]=e:"ESRI"in e?N["ESRI:"+e.ESRI]=e:"IAU2000"in e?N["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(N);var F=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],k=["3857","900913","3785","102113"];function R(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in N}(e))return N[e];if(function(e){return F.some(function(t){return e.indexOf(t)>-1})}(e)){var t=I(e);if(function(e){var t=b(e,"authority");if(t){var r=b(t,"epsg");return r&&k.indexOf(r)>-1}}(t))return N["EPSG:3857"];var r=function(e){var t=b(e,"extension");if(t)return b(t,"proj4")}(t);return r?S(r):t}return function(e){return"+"===e[0]}(e)?S(e):void 0}var D=function(e,t){var r,s;if(e=e||{},!t)return e;for(s in t)void 0!==(r=t[s])&&(e[s]=r);return e},G=function(e,t,r){var s=e*t;return r/Math.sqrt(1-s*s)},B=function(e){return e<0?-1:1},j=function(e){return Math.abs(e)<=m?e:e-B(e)*f},U=function(e,t,r){var s=e*r,i=.5*e;return s=Math.pow((1-s)/(1+s),i),Math.tan(.5*(a-t))/s},V=function(e,t){for(var r,s,i=.5*e,n=a-2*Math.atan(t),o=0;o<=15;o++)if(r=e*Math.sin(n),s=a-2*Math.atan(t*Math.pow((1-r)/(1+r),i))-n,n+=s,Math.abs(s)<=1e-10)return n;return-9999};function z(e){return e}var J=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,r,s=e.x,i=e.y;if(i*d>90&&i*d<-90&&s*d>180&&s*d<-180)return null;if(Math.abs(Math.abs(i)-a)<=u)return null;if(this.sphere)t=this.x0+this.a*this.k0*j(s-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(p+.5*i));else{var n=Math.sin(i),o=U(this.e,i,n);t=this.x0+this.a*this.k0*j(s-this.long0),r=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,s=e.x-this.x0,i=e.y-this.y0;if(this.sphere)r=a-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var n=Math.exp(-i/(this.a*this.k0));if(-9999===(r=V(this.e,n)))return null}return t=j(this.long0+s/(this.a*this.k0)),e.x=t,e.y=r,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:z,inverse:z,names:["longlat","identity"]}],q={},H=[];function W(e,t){var r=H.length;return e.names?(H[r]=e,e.names.forEach(function(e){q[e.toLowerCase()]=r}),this):(console.log(t),!0)}var Y={start:function(){J.forEach(W)},add:W,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==q[t]&&H[q[t]]?H[q[t]]:void 0}},X={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Q=X.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};X.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Z={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},K={};function $(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:K[e]||null,isNull:!1}}function ee(e){return e/3600*Math.PI/180}function te(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function re(e){return e.map(function(e){return[ee(e.longitudeShift),ee(e.latitudeShift)]})}function se(e,t,r){return{name:te(e,t+8,t+16).trim(),parent:te(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function ie(e,t,r,s){for(var i=t+176,n=[],a=0;a3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=t,p.datum_params[3]*=n,p.datum_params[4]*=n,p.datum_params[5]*=n,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=r,p.grids=d),p.a=l,p.b=h,p.es=u,p.ep2=c,p}(S.datumCode,S.datum_params,w.a,w.b,C.es,C.ep2,T);D(this,S),D(this,x),this.a=w.a,this.b=w.b,this.rf=w.rf,this.sphere=w.sphere,this.es=C.es,this.e=C.e,this.ep2=C.ep2,this.datum=M,this.init(),c(null,this)}else c(a)}else c(a)}function ae(e,t,r){var s,i,n,o,l=e.x,h=e.y,u=e.z?e.z:0;if(h<-a&&h>-1.001*a)h=-a;else if(h>a&&h<1.001*a)h=a;else{if(h<-a)return{x:-1/0,y:-1/0,z:e.z};if(h>a)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),i=Math.sin(h),o=Math.cos(h),n=i*i,{x:((s=r/Math.sqrt(1-t*n))+u)*o*Math.cos(l),y:(s+u)*o*Math.sin(l),z:(s*(1-t)+u)*i}}function oe(e,t,r,s){var i,n,o,l,h,u,c,d,p,f,m,y,g,v,b,S,x=e.x,_=e.y,w=e.z?e.z:0;if(i=Math.sqrt(x*x+_*_),n=Math.sqrt(x*x+_*_+w*w),i/r<1e-12){if(v=0,n/r<1e-12)return b=a,S=-s,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(_,x);o=w/n,l=i/n,h=1/Math.sqrt(1-t*(2-t)*l*l),d=l*(1-t)*h,p=o*h,g=0;do{g++,c=r/Math.sqrt(1-t*p*p),u=t*c/(c+(S=i*d+w*p-c*(1-t*p*p))),h=1/Math.sqrt(1-u*(2-u)*l*l),y=(m=o*h)*d-(f=l*(1-u)*h)*p,d=f,p=m}while(y*y>1e-24&&g<30);return b=Math.atan(m/Math.abs(f)),{x:v,y:b,z:S}}function le(r){return r===e||r===t}ne.projections=Y,ne.projections.start();var he=function(s,n,a){if(function(r,s){return r.datum_type===s.datum_type&&!(r.a!==s.a||Math.abs(r.es-s.es)>5e-11)&&(r.datum_type===e?r.datum_params[0]===s.datum_params[0]&&r.datum_params[1]===s.datum_params[1]&&r.datum_params[2]===s.datum_params[2]:r.datum_type!==t||r.datum_params[0]===s.datum_params[0]&&r.datum_params[1]===s.datum_params[1]&&r.datum_params[2]===s.datum_params[2]&&r.datum_params[3]===s.datum_params[3]&&r.datum_params[4]===s.datum_params[4]&&r.datum_params[5]===s.datum_params[5]&&r.datum_params[6]===s.datum_params[6])}(s,n))return a;if(s.datum_type===i||n.datum_type===i)return a;var o=s.a,l=s.es;if(s.datum_type===r){var h=ue(s,!1,a);if(0!==h)return;o=6378137,l=.0066943799901413165}var u=n.a,c=n.b,d=n.es;if(n.datum_type===r&&(u=6378137,c=6356752.314,d=.0066943799901413165),l===d&&o===u&&!le(s.datum_type)&&!le(n.datum_type))return a;if(a=ae(a,l,o),le(s.datum_type)&&(a=function(r,s,i){if(s===e)return{x:r.x+i[0],y:r.y+i[1],z:r.z+i[2]};if(s===t){var n=i[0],a=i[1],o=i[2],l=i[3],h=i[4],u=i[5],c=i[6];return{x:c*(r.x-u*r.y+h*r.z)+n,y:c*(u*r.x+r.y-l*r.z)+a,z:c*(-h*r.x+l*r.y+r.z)+o}}}(a,s.datum_type,s.datum_params)),le(n.datum_type)&&(a=function(r,s,i){if(s===e)return{x:r.x-i[0],y:r.y-i[1],z:r.z-i[2]};if(s===t){var n=i[0],a=i[1],o=i[2],l=i[3],h=i[4],u=i[5],c=i[6],d=(r.x-n)/c,p=(r.y-a)/c,f=(r.z-o)/c;return{x:d+u*p-h*f,y:-u*d+p+l*f,z:h*d-l*p+f}}}(a,n.datum_type,n.datum_params)),a=oe(a,d,u,c),n.datum_type===r){var p=ue(n,!0,a);if(0!==p)return}return a};function ue(e,t,r){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var s={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},n=[],a=0;as.y||u>s.x||f1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=j(n.x+r.ll[0]),s.y=n.y+r.ll[1]}else isNaN(n.x)||(s.x=e.x+n.x,s.y=e.y+n.y);return s}function de(e,t){var r,s={x:e.x/t.del[0],y:e.y/t.del[1]},i={x:Math.floor(s.x),y:Math.floor(s.y)},n={x:s.x-1*i.x,y:s.y-1*i.y},a={x:Number.NaN,y:Number.NaN};if(i.x<0||i.x>=t.lim[0])return a;if(i.y<0||i.y>=t.lim[1])return a;r=i.y*t.lim[0]+i.x;var o={x:t.cvs[r][0],y:t.cvs[r][1]};r++;var l={x:t.cvs[r][0],y:t.cvs[r][1]};r+=t.lim[0];var h={x:t.cvs[r][0],y:t.cvs[r][1]};r--;var u={x:t.cvs[r][0],y:t.cvs[r][1]},c=n.x*n.y,d=n.x*(1-n.y),p=(1-n.x)*(1-n.y),f=(1-n.x)*n.y;return a.x=p*o.x+d*l.x+f*u.x+c*h.x,a.y=p*o.y+d*l.y+f*u.y+c*h.y,a}var pe=function(e,t,r){var s,i,n,a=r.x,o=r.y,l=r.z||0,h={};for(n=0;n<3;n++)if(!t||2!==n||void 0!==r.z)switch(0===n?(s=a,i=-1!=="ew".indexOf(e.axis[n])?"x":"y"):1===n?(s=o,i=-1!=="ns".indexOf(e.axis[n])?"y":"x"):(s=l,i="z"),e.axis[n]){case"e":h[i]=s;break;case"w":h[i]=-s;break;case"n":h[i]=s;break;case"s":h[i]=-s;break;case"u":void 0!==r[i]&&(h.z=s);break;case"d":void 0!==r[i]&&(h.z=-s);break;default:return null}return h},fe=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},me=function(e){ye(e.x),ye(e.y)};function ye(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function ge(s,i,n,a){var o,l=void 0!==(n=Array.isArray(n)?fe(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(me(n),s.datum&&i.datum&&function(s,i){return(s.datum.datum_type===e||s.datum.datum_type===t||s.datum.datum_type===r)&&"WGS84"!==i.datumCode||(i.datum.datum_type===e||i.datum.datum_type===t||i.datum.datum_type===r)&&"WGS84"!==s.datumCode}(s,i)&&(o=new ne("WGS84"),n=ge(s,o,n,a),s=o),a&&"enu"!==s.axis&&(n=pe(s,!1,n)),"longlat"===s.projName)n={x:n.x*c,y:n.y*c,z:n.z||0};else if(s.to_meter&&(n={x:n.x*s.to_meter,y:n.y*s.to_meter,z:n.z||0}),!(n=s.inverse(n)))return;if(s.from_greenwich&&(n.x+=s.from_greenwich),n=he(s.datum,i.datum,n))return i.from_greenwich&&(n={x:n.x-i.from_greenwich,y:n.y,z:n.z||0}),"longlat"===i.projName?n={x:n.x*d,y:n.y*d,z:n.z||0}:(n=i.forward(n),i.to_meter&&(n={x:n.x/i.to_meter,y:n.y/i.to_meter,z:n.z||0})),a&&"enu"!==i.axis?pe(i,!0,n):(l||delete n.z,n)}var ve=ne("WGS84");function be(e,t,r,s){var i,n,a;return Array.isArray(r)?(i=ge(e,t,r,s)||{x:NaN,y:NaN},r.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(n=ge(e,t,r,s),2===(a=Object.keys(r)).length?n:(a.forEach(function(s){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===s||"y"===s||"z"===s)return}else if("x"===s||"y"===s)return;n[s]=r[s]}),n))}function Se(e){return e instanceof ne?e:e.oProj?e.oProj:ne(e)}function xe(e,t,r){e=Se(e);var s,i=!1;return void 0===t?(t=e,e=ve,i=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,t=e,e=ve,i=!0),t=Se(t),r?be(e,t,r):(s={forward:function(r,s){return be(e,t,r,s)},inverse:function(r,s){return be(t,e,r,s)}},i&&(s.oProj=t),s)}var _e=6,we="AJSAJS",Ce="AFAFAF",Te=65,Me=73,Ee=79,Ae=86,Oe=90,Pe={forward:Le,inverse:function(e){var t=ke(De(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]},toPoint:Ie};function Le(e,t){return t=t||5,function(e,t){var r,s,i,n,a,o,l,h,u,c,d,p,f,m,y="00000"+e.easting,g="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(u=e.easting,c=e.northing,d=e.zoneNumber,p=Re(d),f=Math.floor(u/1e5),m=Math.floor(c/1e5)%20,r=f,s=m,i=p-1,n=we.charCodeAt(i),a=Ce.charCodeAt(i),l=a+s,h=!1,(o=n+r-1)>Oe&&(o=o-Oe+Te-1,h=!0),(o===Me||nMe||(o>Me||nEe||(o>Ee||nOe&&(o=o-Oe+Te-1),l>Ae?(l=l-Ae+Te-1,h=!0):h=!1,(l===Me||aMe||(l>Me||aEe||(l>Ee||aAe&&(l=l-Ae+Te-1),String.fromCharCode(o)+String.fromCharCode(l))+y.substr(y.length-5,t)+g.substr(g.length-5,t)}(function(e){var t,r,s,i,n,a,o,l=e.lat,h=e.lon,u=6378137,c=Ne(l),d=Ne(h);o=Math.floor((h+180)/6)+1,180===h&&(o=60),l>=56&&l<64&&h>=3&&h<12&&(o=32),l>=72&&l<84&&(h>=0&&h<9?o=31:h>=9&&h<21?o=33:h>=21&&h<33?o=35:h>=33&&h<42&&(o=37)),a=Ne(6*(o-1)-180+3),t=u/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),r=Math.tan(c)*Math.tan(c),s=.006739496752268451*Math.cos(c)*Math.cos(c),i=Math.cos(c)*(d-a),n=u*(.9983242984503243*c-.002514607064228144*Math.sin(2*c)+2639046602129982e-21*Math.sin(4*c)-3.418046101696858e-9*Math.sin(6*c));var p,f,m=.9996*t*(i+(1-r+s)*i*i*i/6+(5-18*r+r*r+72*s-.39089081163157013)*i*i*i*i*i/120)+5e5,y=.9996*(n+t*Math.tan(c)*(i*i/2+(5-r+9*s+4*s*s)*i*i*i*i/24+(61-58*r+r*r+600*s-2.2240339282485886)*i*i*i*i*i*i/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(m),zoneNumber:o,zoneLetter:(p=l,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:e[1],lon:e[0]}),t)}function Ie(e){var t=ke(De(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Ne(e){return e*(Math.PI/180)}function Fe(e){return e/Math.PI*180}function ke(e){var t=e.northing,r=e.easting,s=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var n,a,o,l,h,u,c,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=r-5e5,y=t;s<"N"&&(y-=1e7),u=6*(i-1)-180+3,d=(c=y/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*c)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*c)+151*f*f*f/96*Math.sin(6*c),n=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),o=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*n);var g=d-n*Math.tan(d)/l*(h*h/2-(5+3*a+10*o-4*o*o-.06065547077041606)*h*h*h*h/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*h*h*h*h*h*h/720);g=Fe(g);var v,b=(h-(1+2*a+o)*h*h*h/6+(5-2*o+28*a-3*o*o+.05391597401814761+24*a*a)*h*h*h*h*h/120)/Math.cos(d);if(b=u+Fe(b),e.accuracy){var S=ke({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:S.lat,right:S.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function Re(e){var t=e%_e;return 0===t&&(t=_e),t}function De(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,s=null,i="",n=0;!/[A-Z]/.test(t=e.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+e;i+=t,n++}var a=parseInt(i,10);if(0===n||n+3>r)throw"MGRSPoint bad conversion from: "+e;var o=e.charAt(n++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+e;s=e.substring(n,n+=2);for(var l=Re(a),h=function(e,t){for(var r=we.charCodeAt(t-1),s=1e5,i=!1;r!==e.charCodeAt(0);){if(++r===Me&&r++,r===Ee&&r++,r>Oe){if(i)throw"Bad character: "+e;r=Te,i=!0}s+=1e5}return s}(s.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=Ce.charCodeAt(t-1),s=0,i=!1;r!==e.charCodeAt(0);){if(++r===Me&&r++,r===Ee&&r++,r>Ae){if(i)throw"Bad character: "+e;r=Te,i=!0}s+=1e5}return s}(s.charAt(1),l);u0&&(d=1e5/Math.pow(10,m),p=e.substring(n,n+m),y=parseFloat(p)*d,f=e.substring(n+m),g=parseFloat(f)*d),{easting:y+h,northing:g+u,zoneLetter:o,zoneNumber:a,accuracy:d}}function Ge(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Be(e,t,r){if(!(this instanceof Be))return new Be(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var s=e.split(",");this.x=parseFloat(s[0],10),this.y=parseFloat(s[1],10),this.z=parseFloat(s[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Be.fromMGRS=function(e){return new Be(Ie(e))},Be.prototype.toMGRS=function(e){return Le([this.x,this.y],e)};var je=.01068115234375,Ue=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*je))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*je)));var r=e*e;return t[2]=r*(.46875-e*(.013020833333333334+.007120768229166667*e)),r*=e,t[3]=r*(.3645833333333333-.005696614583333333*e),t[4]=r*e*.3076171875,t},Ve=function(e,t,r,s){return r*=t,t*=t,s[0]*e-r*(s[1]+t*(s[2]+t*(s[3]+t*s[4])))},ze=function(e,t,r){for(var s=1/(1-t),i=e,n=20;n;--n){var a=Math.sin(i),o=1-t*a*a;if(o=(Ve(i,a,Math.cos(i),r)-e)*(o*Math.sqrt(o))*s,i-=o,Math.abs(o)u?Math.tan(n):0,m=Math.pow(f,2),y=Math.pow(m,2);t=1-this.es*Math.pow(o,2),h/=Math.sqrt(t);var g=Ve(n,o,l,this.en);r=this.a*(this.k0*h*(1+c/6*(1-m+d+c/20*(5-18*m+y+14*d-58*m*d+c/42*(61+179*y-y*m-479*m)))))+this.x0,s=this.a*(this.k0*(g-this.ml0+o*a*h/2*(1+c/12*(5-m+9*d+4*p+c/30*(61+y-58*m+270*d-330*m*d+c/56*(1385+543*y-y*m-3111*m))))))+this.y0}else{var v=l*Math.sin(a);if(Math.abs(Math.abs(v)-1)=1){if(v-1>u)return 93;s=0}else s=Math.acos(s);n<0&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return e.x=r,e.y=s,e},inverse:function(e){var t,r,s,i,n=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,r=ze(t,this.es,this.en),Math.abs(r)u?Math.tan(r):0,d=this.ep2*Math.pow(h,2),p=Math.pow(d,2),f=Math.pow(c,2),m=Math.pow(f,2);t=1-this.es*Math.pow(l,2);var y=n*Math.sqrt(t)/this.k0,g=Math.pow(y,2);s=r-(t*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*f-9*d*f+d-4*p-g/30*(61+90*f-252*d*f+45*m+46*d-g/56*(1385+3633*f+4095*m+1574*m*f)))),i=j(this.long0+y*(1-g/6*(1+2*f+d-g/20*(5+28*f+24*m+8*d*f+6*d-g/42*(61+662*f+1320*m+720*m*f))))/h)}else s=a*B(o),i=0;else{var v=Math.exp(n/this.k0),b=.5*(v-1/v),S=this.lat0+o/this.k0,x=Math.cos(S);t=Math.sqrt((1-Math.pow(x,2))/(1+Math.pow(b,2))),s=Math.asin(t),o<0&&(s=-s),i=0===b&&0===x?0:j(Math.atan2(b,x)+this.long0)}return e.x=i,e.y=s,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},qe=function(e){var t=Math.exp(e);return t=(t-1/t)/2},He=function(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),s=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(s,2))},We=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}(t*(1+t/(He(1,t)+1))),e<0?-t:t},Ye=function(e,t){for(var r,s=2*Math.cos(2*t),i=e.length-1,n=e[i],a=0;--i>=0;)r=s*n-a+e[i],a=n,n=r;return t+r*Math.sin(2*t)},Xe=function(e,t){for(var r,s=2*Math.cos(t),i=e.length-1,n=e[i],a=0;--i>=0;)r=s*n-a+e[i],a=n,n=r;return Math.sin(t)*r},Qe=function(e,t,r){for(var s,i,n=Math.sin(t),a=Math.cos(t),o=qe(r),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(r),h=2*a*l,u=-2*n*o,c=e.length-1,d=e[c],p=0,f=0,m=0;--c>=0;)s=f,i=p,d=h*(f=d)-s-u*(p=m)+e[c],m=u*f-i+h*p;return[(h=n*l)*d-(u=a*o)*m,h*m+u*d]},Ze={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Je.init.apply(this),this.forward=Je.forward,this.inverse=Je.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r*=t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r*=t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),r*=t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r*=t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var s=Ye(this.cbg,this.lat0);this.Zb=-this.Qn*(s+Xe(this.gtu,2*s))},forward:function(e){var t=j(e.x-this.long0),r=e.y;r=Ye(this.cbg,r);var s=Math.sin(r),i=Math.cos(r),n=Math.sin(t),a=Math.cos(t);r=Math.atan2(s,a*i),t=Math.atan2(n*i,He(s,i*a)),t=We(Math.tan(t));var o,l,h=Qe(this.gtu,2*r,2*t);return r+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(o=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*r+this.Zb)+this.y0):(o=1/0,l=1/0),e.x=o,e.y=l,e},inverse:function(e){var t,r,s=(e.x-this.x0)*(1/this.a),i=(e.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,s/=this.Qn,Math.abs(s)<=2.623395162778){var n=Qe(this.utg,2*i,2*s);i+=n[0],s+=n[1],s=Math.atan(qe(s));var a=Math.sin(i),o=Math.cos(i),l=Math.sin(s),h=Math.cos(s);i=Math.atan2(a*h,He(l,h*o)),s=Math.atan2(l,h*o),t=j(s+this.long0),r=Ye(this.cgb,i)}else t=1/0,r=1/0;return e.x=t,e.y=r,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Ke=function(e,t){if(void 0===e){if((e=Math.floor(30*(j(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e},$e={init:function(){var e=Ke(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*c,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ze.init.apply(this),this.forward=Ze.forward,this.inverse=Ze.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},et=function(e,t){return Math.pow((1-e)/(1+e),t)},tt=20,rt={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+p)/(Math.pow(Math.tan(.5*this.lat0+p),this.C)*et(this.e*e,this.ratexp))},forward:function(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+p),this.C)*et(this.e*Math.sin(r),this.ratexp))-a,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,r=e.y,s=Math.pow(Math.tan(.5*r+p)/this.K,1/this.C),i=tt;i>0&&(r=2*Math.atan(s*et(this.e*Math.sin(e.y),-.5*this.e))-a,!(Math.abs(r-e.y)<1e-14));--i)e.y=r;return i?(e.x=t,e.y=r,e):null},names:["gauss"]},st={init:function(){rt.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,r,s,i;return e.x=j(e.x-this.long0),rt.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),s=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*s),e.x=i*r*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*r*s),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,r,s,i,n;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,n=Math.sqrt(e.x*e.x+e.y*e.y)){var a=2*Math.atan2(n,this.R2);t=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+e.y*t*this.cosc0/n),s=Math.atan2(e.x*t,n*this.cosc0*r-e.y*this.sinc0*t)}else i=this.phic0,s=0;return e.x=s,e.y=i,rt.inverse.apply(this,[e]),e.x=j(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},it={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=u&&(this.k0=.5*(1+B(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=u&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=u&&(this.k0=.5*this.cons*G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/U(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=G(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,r,s,i,n,o,l=e.x,h=e.y,c=Math.sin(h),d=Math.cos(h),p=j(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=u&&Math.abs(h+this.lat0)<=u?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*c+this.coslat0*d*Math.cos(p)),e.x=this.a*t*d*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*c-this.sinlat0*d*Math.cos(p))+this.y0,e):(r=2*Math.atan(this.ssfn_(h,c,this.e))-a,i=Math.cos(r),s=Math.sin(r),Math.abs(this.coslat0)<=u?(n=U(this.e,h*this.con,this.con*c),o=2*this.a*this.k0*n/this.cons,e.x=this.x0+o*Math.sin(l-this.long0),e.y=this.y0-this.con*o*Math.cos(l-this.long0),e):(Math.abs(this.sinlat0)0?j(this.long0+Math.atan2(e.x,-1*e.y)):j(this.long0+Math.atan2(e.x,e.y)):j(this.long0+Math.atan2(e.x*Math.sin(l),o*this.coslat0*Math.cos(l)-e.y*this.sinlat0*Math.sin(l))),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=u){if(o<=u)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,s=o*this.cons/(2*this.a*this.k0),r=this.con*V(this.e,s),t=this.con*j(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=u?n=this.X0:(n=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/o),t=j(this.long0+Math.atan2(e.x*Math.sin(i),o*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),r=-1*V(this.e,Math.tan(.5*(a+n)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,r){return t*=r,Math.tan(.5*(a+e))*Math.pow((1-t)/(1+t),.5*r)}},nt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,s=1/this.rf,i=2*s-Math.pow(s,2),n=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(t,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+n*t)/(1-n*t));this.K=a-this.alpha*o+this.alpha*n/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),s=-this.alpha*(t+r)+this.K,i=2*(Math.atan(Math.exp(s))-Math.PI/4),n=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(n))),o=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(n));return e.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,r=e.y-this.y0,s=t/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(s)),a=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(i))),o=this.lambda0+a/this.alpha,l=0,h=n,u=-1e3,c=0;Math.abs(h-u)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),u=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=o,e.y=h,e},names:["somerc"]},at=1e-7,ot={init:function(){var e,t,r,s,i,n,o,l,h,d,m,y,g,v=0,b=0,S=0,x=0,_=0,w=0,C=0;this.no_off=(g="object"==typeof(y=this).PROJECTION?Object.keys(y.PROJECTION)[0]:y.PROJECTION,"no_uoff"in y||"no_off"in y||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var T=!1;"alpha"in this&&(T=!0);var M=!1;if("rectified_grid_angle"in this&&(M=!0),T&&(C=this.alpha),M&&(v=this.rectified_grid_angle*c),T||M)b=this.longc;else if(S=this.long1,_=this.lat1,x=this.long2,w=this.lat2,Math.abs(_-w)<=at||(e=Math.abs(_))<=at||Math.abs(e-a)<=at||Math.abs(Math.abs(this.lat0)-a)<=at||Math.abs(Math.abs(w)-a)<=at)throw new Error;var E=1-this.es;t=Math.sqrt(E),Math.abs(this.lat0)>u?(l=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*l*l,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/E),this.A=this.B*this.k0*t/e,s=this.B*t/(r*Math.sqrt(e)),(i=s*s-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=s,this.E*=Math.pow(U(this.e,this.lat0,l),this.B)):(this.B=1/t,this.A=this.k0,this.E=s=i=1),T||M?(T?(m=Math.asin(Math.sin(C)/s),M||(v=C)):(m=v,C=Math.asin(s*Math.sin(m))),this.lam0=b-Math.asin(.5*(i-1/i)*Math.tan(m))/this.B):(n=Math.pow(U(this.e,_,Math.sin(_)),this.B),o=Math.pow(U(this.e,w,Math.sin(w)),this.B),i=this.E/n,h=(o-n)/(o+n),d=((d=this.E*this.E)-o*n)/(d+o*n),(e=S-x)<-Math.pi?x-=f:e>Math.pi&&(x+=f),this.lam0=j(.5*(S+x)-Math.atan(d*Math.tan(.5*this.B*(S-x))/h)/this.B),m=Math.atan(2*Math.sin(this.B*j(S-this.lam0))/(i-1/i)),v=C=Math.asin(s*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(C))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(p-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(p+i))},forward:function(e){var t,r,s,i,n,o,l,h,c={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-a)>u){if(n=this.E/Math.pow(U(this.e,e.y,Math.sin(e.y)),this.B),t=.5*(n-(o=1/n)),r=.5*(n+o),i=Math.sin(this.B*e.x),s=(t*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(s)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(c.x=l,c.y=h):(l-=this.u_0,c.x=h*this.cosrot+l*this.sinrot,c.y=l*this.cosrot-h*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(e){var t,r,s,i,n,o,l,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*r),i=.5*(s-1/s),n=.5*(s+1/s),o=Math.sin(this.BrA*t),l=(o*this.cosgam+i*this.singam)/n,Math.abs(Math.abs(l)-1)u?this.ns=Math.log(s/o)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=s/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=u&&(r=B(r)*(a-2*u));var s,i,n=Math.abs(Math.abs(r)-a);if(n>u)s=U(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(s,this.ns);else{if((n=r*this.ns)<=0)return null;i=0}var o=this.ns*j(t-this.long0);return e.x=this.k0*(i*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-i*Math.cos(o))+this.y0,e},inverse:function(e){var t,r,s,i,n,o=(e.x-this.x0)/this.k0,l=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+l*l),r=1):(t=-Math.sqrt(o*o+l*l),r=-1);var h=0;if(0!==t&&(h=Math.atan2(r*o,r*l)),0!==t||this.ns>0){if(r=1/this.ns,s=Math.pow(t/(this.a*this.f0),r),-9999===(i=V(this.e,s)))return null}else i=-a;return n=j(h/this.ns+this.long0),e.x=n,e.y=i,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},ht={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,r,s,i,n,a,o,l=e.x,h=e.y,u=j(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),s=-u*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),n=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(i)),a=this.n*n,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=o*Math.cos(a)/1,e.x=o*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,r,s,i,n,a,o,l,h=e.x;e.x=e.y,e.y=h,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x),i=n/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(i)),r=Math.asin(Math.cos(s)*Math.sin(i)/Math.cos(t)),e.x=this.long0-r/this.alfa,o=t,l=0;var u=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(l=1),o=e.y,u+=1}while(0===l&&u<15);return u>=15?null:e},names:["Krovak","krovak"]},ut=function(e,t,r,s,i){return e*i-t*Math.sin(2*i)+r*Math.sin(4*i)-s*Math.sin(6*i)},ct=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},dt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},pt=function(e){return.05859375*e*e*(1+.75*e)},ft=function(e){return e*e*e*(35/3072)},mt=function(e,t,r){var s=t*r;return e/Math.sqrt(1-s*s)},yt=function(e){return Math.abs(e)1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t},St=.3333333333333333,xt=.17222222222222222,_t=.10257936507936508,wt=.06388888888888888,Ct=.0664021164021164,Tt=.016415012942191543,Mt={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-a)0)switch(this.qp=bt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=e*St,t=e*e,r[0]+=t*xt,r[1]=t*wt,t*=e,r[0]+=t*_t,r[1]+=t*Ct,r[2]=t*Tt,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=bt(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,r,s,i,n,o,l,h,c,d,f=e.x,m=e.y;if(f=j(f-this.long0),this.sphere){if(n=Math.sin(m),d=Math.cos(m),s=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+d*s:1+this.sinph0*n+this.cosph0*d*s)<=u)return null;r=Math.sqrt(2/r),t=r*d*Math.sin(f),r*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*d*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(m+this.lat0)=0?(t=(c=Math.sqrt(o))*i,r=s*(this.mode===this.S_POLE?c:-c)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,s,i,n,o,l,h,c,d,p=e.x/this.a,f=e.y/this.a;if(this.sphere){var m,y=0,g=0;if(m=Math.sqrt(p*p+f*f),(r=.5*m)>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(r),y=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(m)<=u?0:Math.asin(f*g/m),p*=g,f=y*m;break;case this.OBLIQ:r=Math.abs(m)<=u?this.lat0:Math.asin(y*this.sinph0+f*g*this.cosph0/m),p*=g*this.cosph0,f=(y-Math.sin(r)*this.sinph0)*m;break;case this.N_POLE:f=-f,r=a-r;break;case this.S_POLE:r-=a}t=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))1&&(e=e>1?1:-1),Math.asin(e)},At={init:function(){Math.abs(this.lat1+this.lat2)u?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var s=bt(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,n=this.ns0*j(t-this.long0),a=i*Math.sin(n)+this.x0,o=this.rh-i*Math.cos(n)+this.y0;return e.x=a,e.y=o,e},inverse:function(e){var t,r,s,i,n,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),s=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),s=-1),i=0,0!==t&&(i=Math.atan2(s*e.x,s*e.y)),s=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-s*s)/(2*this.ns0)):(r=(this.c-s*s)/this.ns0,a=this.phi1z(this.e3,r)),n=j(i/this.ns0+this.long0),e.x=n,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var r,s,i,n,a,o=Et(.5*t);if(e0||Math.abs(n)<=u?(a=this.x0+1*this.a*r*Math.sin(s)/n,o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)/n):(a=this.x0+this.infinity_dist*r*Math.sin(s),o=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*i)),e.x=a,e.y=o,e},inverse:function(e){var t,r,s,i,n,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),r=Math.sin(i),s=Math.cos(i),a=Et(s*this.sin_p14+e.y*r*this.cos_p14/t),n=Math.atan2(e.x*r,t*this.cos_p14*s-e.y*this.sin_p14*r),n=j(this.long0+n)):(a=this.phic0,n=0),e.x=n,e.y=a,e},names:["gnom"]},Pt=function(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*a:a;for(var s,i,n,o,l=Math.asin(.5*t),h=0;h<30;h++)if(i=Math.sin(l),n=Math.cos(l),o=e*i,s=Math.pow(1-o*o,2)/(2*n)*(t/(1-e*e)-i/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),l+=s,Math.abs(s)<=1e-10)return l;return NaN},Lt={init:function(){this.sphere||(this.k0=G(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,r,s=e.x,i=e.y,n=j(s-this.long0);if(this.sphere)t=this.x0+this.a*n*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=bt(this.e,Math.sin(i));t=this.x0+this.a*this.k0*n,r=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=r,e},inverse:function(e){var t,r;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=j(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=Pt(this.e,2*e.y*this.k0/this.a),t=j(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e},names:["cea"]},It={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,r=e.y,s=j(t-this.long0),i=yt(r-this.lat0);return e.x=this.x0+this.a*s*this.rc,e.y=this.y0+this.a*i,e},inverse:function(e){var t=e.x,r=e.y;return e.x=j(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=yt(this.lat0+(r-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Nt=20,Ft={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ct(this.es),this.e1=dt(this.es),this.e2=pt(this.es),this.e3=ft(this.es),this.ml0=this.a*ut(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,r,s,i=e.x,n=e.y,a=j(i-this.long0);if(s=a*Math.sin(n),this.sphere)Math.abs(n)<=u?(t=this.a*a,r=-1*this.a*this.lat0):(t=this.a*Math.sin(s)/Math.tan(n),r=this.a*(yt(n-this.lat0)+(1-Math.cos(s))/Math.tan(n)));else if(Math.abs(n)<=u)t=this.a*a,r=-1*this.ml0;else{var o=mt(this.a,this.e,Math.sin(n))/Math.tan(n);t=o*Math.sin(s),r=this.a*ut(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*(1-Math.cos(s))}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){var t,r,s,i,n,a,o,l,h;if(s=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=u)t=j(s/this.a+this.long0),r=0;else{var c;for(a=this.lat0+i/this.a,o=s*s/this.a/this.a+a*a,l=a,n=Nt;n;--n)if(c=Math.tan(l),l+=h=-1*(a*(l*c+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),Math.abs(h)<=u){r=l;break}t=j(this.long0+Math.asin(s*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=u)r=0,t=j(this.long0+s/this.a);else{var d,p,f,m,y;for(a=(this.ml0+i)/this.a,o=s*s/this.a/this.a+a*a,l=a,n=Nt;n;--n)if(y=this.e*Math.sin(l),d=Math.sqrt(1-y*y)*Math.tan(l),p=this.a*ut(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=p/this.a,h=(a*(d*m+1)-m-.5*d*(m*m+o))/(this.es*Math.sin(2*l)*(m*m+o-2*a*m)/(4*d)+(a-m)*(d*f-2/Math.sin(2*l))-f),l-=h,Math.abs(h)<=u){r=l;break}d=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=j(this.long0+Math.asin(s*d/this.a)/Math.sin(r))}return e.x=t,e.y=r,e},names:["Polyconic","poly"]},kt={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,r=e.x,s=e.y-this.lat0,i=r-this.long0,a=s/n*1e-5,o=i,l=1,h=0;for(t=1;t<=10;t++)l*=a,h+=this.A[t]*l;var u,c=h,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)u=f*c+p*d,p=p*c-f*d,f=u,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,r,s=e.x,i=e.y,a=s-this.x0,o=(i-this.y0)/this.a,l=a/this.a,h=1,u=0,c=0,d=0;for(t=1;t<=6;t++)r=u*o+h*l,h=h*o-u*l,u=r,c=c+this.C_re[t]*h-this.C_im[t]*u,d=d+this.C_im[t]*h+this.C_re[t]*u;for(var p=0;p.999999999999&&(r=.999999999999),t=Math.asin(r);var s=j(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=s,e.y=i,e},names:["Mollweide","moll"]},jt={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var n=0;if(0!==r&&(n=Math.atan2(t*e.x,t*e.y)),this.sphere)return i=j(this.long0+n/this.ns),s=yt(this.g-r/this.a),e.x=i,e.y=s,e;var a=this.g-r/this.a;return s=gt(a,this.e0,this.e1,this.e2,this.e3),i=j(this.long0+n/this.ns),e.x=i,e.y=s,e},names:["Equidistant_Conic","eqdc"]},Ut={init:function(){this.R=this.a},forward:function(e){var t,r,s=e.x,i=e.y,n=j(s-this.long0);Math.abs(i)<=u&&(t=this.x0+this.R*n,r=this.y0);var o=Et(2*Math.abs(i/Math.PI));(Math.abs(n)<=u||Math.abs(Math.abs(i)-a)<=u)&&(t=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var l=.5*Math.abs(Math.PI/n-n/Math.PI),h=l*l,c=Math.sin(o),d=Math.cos(o),p=d/(c+d-1),f=p*p,m=p*(2/c-1),y=m*m,g=Math.PI*this.R*(l*(p-y)+Math.sqrt(h*(p-y)*(p-y)-(y+h)*(f-y)))/(y+h);n<0&&(g=-g),t=this.x0+g;var v=h+p;return g=Math.PI*this.R*(m*v-l*Math.sqrt((y+h)*(h+1)-v*v))/(y+h),r=i>=0?this.y0+g:this.y0-g,e.x=t,e.y=r,e},inverse:function(e){var t,r,s,i,n,a,o,l,h,c,d,p,f;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,s=e.x/d,i=e.y/d,n=s*s+i*i,a=-Math.abs(i)*(1+n),f=i*i/(l=-2*a+1+2*i*i+n*n)+(2*(o=a-2*i*i+s*s)*o*o/l/l/l-9*a*o/l/l)/27,h=(a-o*o/3/l)/l,c=2*Math.sqrt(-h/3),d=3*f/h/c,Math.abs(d)>1&&(d=d>=0?1:-1),p=Math.acos(d)/3,r=e.y>=0?(-c*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI,t=Math.abs(s)2*a*this.a)return;return r=t/this.a,s=Math.sin(r),i=Math.cos(r),n=this.long0,Math.abs(t)<=u?o=this.lat0:(o=Et(i*this.sin_p12+e.y*s*this.cos_p12/t),l=Math.abs(this.lat0)-a,n=Math.abs(l)<=u?this.lat0>=0?j(this.long0+Math.atan2(e.x,-e.y)):j(this.long0-Math.atan2(-e.x,e.y)):j(this.long0+Math.atan2(e.x*s,t*this.cos_p12*i-e.y*this.sin_p12*s))),e.x=n,e.y=o,e}return h=ct(this.es),c=dt(this.es),d=pt(this.es),p=ft(this.es),Math.abs(this.sin_p12-1)<=u?(f=this.a*ut(h,c,d,p,a),t=Math.sqrt(e.x*e.x+e.y*e.y),o=gt((f-t)/this.a,h,c,d,p),n=j(this.long0+Math.atan2(e.x,-1*e.y)),e.x=n,e.y=o,e):Math.abs(this.sin_p12+1)<=u?(f=this.a*ut(h,c,d,p,a),t=Math.sqrt(e.x*e.x+e.y*e.y),o=gt((t-f)/this.a,h,c,d,p),n=j(this.long0+Math.atan2(e.x,e.y)),e.x=n,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),m=mt(this.a,this.e,this.sin_p12),v=Math.cos(g),b=this.e*this.cos_p12*v,S=-b*b/(1-this.es),x=3*this.es*(1-S)*this.sin_p12*this.cos_p12*v/(1-this.es),w=(_=t/m)-S*(1+S)*Math.pow(_,3)/6-x*(1+3*S)*Math.pow(_,4)/24,C=1-S*w*w/2-_*w*w*w/6,y=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*v),n=j(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(y))),T=Math.sin(y),o=Math.atan2((T-this.es*C*this.sin_p12)*Math.tan(y),T*(1-this.es)),e.x=n,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]},zt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,r,s,i,n,a,o,l=e.x,h=e.y;return s=j(l-this.long0),t=Math.sin(h),r=Math.cos(h),i=Math.cos(s),((n=this.sin_p14*t+this.cos_p14*r*i)>0||Math.abs(n)<=u)&&(a=1*this.a*r*Math.sin(s),o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*i)),e.x=a,e.y=o,e},inverse:function(e){var t,r,s,i,n,o,l;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=Et(t/this.a),s=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(t)<=u?(l=this.lat0,e.x=o,e.y=l,e):(l=Et(i*this.sin_p14+e.y*s*this.cos_p14/t),n=Math.abs(this.lat0)-a,Math.abs(n)<=u?(o=this.lat0>=0?j(this.long0+Math.atan2(e.x,-e.y)):j(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=l,e):(o=j(this.long0+Math.atan2(e.x*s,t*this.cos_p14*i-e.y*this.sin_p14*s)),e.x=o,e.y=l,e))},names:["ortho"]},Jt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},qt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ht(e,t,r,s){var i;return ep&&i<=a+p?(s.value=qt.AREA_1,i-=a):i>a+p||i<=-(a+p)?(s.value=qt.AREA_2,i=i>=0?i-m:i+m):(s.value=qt.AREA_3,i+=a)),i}function Wt(e,t){var r=e+t;return r<-m?r+=f:r>+m&&(r-=f),r}var Yt,Xt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=a-p/2?this.face=Jt.TOP:this.lat0<=-(a-p/2)?this.face=Jt.BOTTOM:Math.abs(this.long0)<=p?this.face=Jt.FRONT:Math.abs(this.long0)<=a+p?this.face=this.long0>0?Jt.RIGHT:Jt.LEFT:this.face=Jt.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,r,s,i,n,o,l={x:0,y:0},h={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,this.face===Jt.TOP)i=a-t,r>=p&&r<=a+p?(h.value=qt.AREA_0,s=r-a):r>a+p||r<=-(a+p)?(h.value=qt.AREA_1,s=r>0?r-m:r+m):r>-(a+p)&&r<=-p?(h.value=qt.AREA_2,s=r+a):(h.value=qt.AREA_3,s=r);else if(this.face===Jt.BOTTOM)i=a+t,r>=p&&r<=a+p?(h.value=qt.AREA_0,s=-r+a):r=-p?(h.value=qt.AREA_1,s=-r):r<-p&&r>=-(a+p)?(h.value=qt.AREA_2,s=-r-a):(h.value=qt.AREA_3,s=r>0?-r+m:-r-m);else{var u,c,d,f,y,g,v;this.face===Jt.RIGHT?r=Wt(r,+a):this.face===Jt.BACK?r=Wt(r,+m):this.face===Jt.LEFT&&(r=Wt(r,-a)),f=Math.sin(t),y=Math.cos(t),g=Math.sin(r),v=Math.cos(r),u=y*v,c=y*g,d=f,this.face===Jt.FRONT?(i=Math.acos(u),s=Ht(i,d,c,h)):this.face===Jt.RIGHT?(i=Math.acos(c),s=Ht(i,d,-u,h)):this.face===Jt.BACK?(i=Math.acos(-u),s=Ht(i,d,-c,h)):this.face===Jt.LEFT?(i=Math.acos(-c),s=Ht(i,d,u,h)):(i=s=0,h.value=qt.AREA_0)}return o=Math.atan(12/m*(s+Math.acos(Math.sin(s)*Math.cos(p))-a)),n=Math.sqrt((1-Math.cos(i))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(s))))),h.value===qt.AREA_1?o+=a:h.value===qt.AREA_2?o+=m:h.value===qt.AREA_3&&(o+=1.5*m),l.x=n*Math.cos(o),l.y=n*Math.sin(o),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,e.x=l.x,e.y=l.y,e},inverse:function(e){var t,r,s,i,n,o,l,h,u,c,d,p,f={lam:0,phi:0},y={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?y.value=qt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(y.value=qt.AREA_1,t-=a):e.x<0&&-e.x>=Math.abs(e.y)?(y.value=qt.AREA_2,t=t<0?t+m:t-m):(y.value=qt.AREA_3,t+=a),u=m/12*Math.tan(t),n=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),o=Math.atan(n),s=Math.cos(t),i=Math.tan(r),(l=1-s*s*i*i*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?l=-1:l>1&&(l=1),this.face===Jt.TOP)h=Math.acos(l),f.phi=a-h,y.value===qt.AREA_0?f.lam=o+a:y.value===qt.AREA_1?f.lam=o<0?o+m:o-m:y.value===qt.AREA_2?f.lam=o-a:f.lam=o;else if(this.face===Jt.BOTTOM)h=Math.acos(l),f.phi=h-a,y.value===qt.AREA_0?f.lam=-o+a:y.value===qt.AREA_1?f.lam=-o:y.value===qt.AREA_2?f.lam=-o-a:f.lam=o<0?-o-m:-o+m;else{var g,v,b;b=(u=(g=l)*g)>=1?0:Math.sqrt(1-u)*Math.sin(o),v=(u+=b*b)>=1?0:Math.sqrt(1-u),y.value===qt.AREA_1?(u=v,v=-b,b=u):y.value===qt.AREA_2?(v=-v,b=-b):y.value===qt.AREA_3&&(u=v,v=b,b=-u),this.face===Jt.RIGHT?(u=g,g=-v,v=u):this.face===Jt.BACK?(g=-g,v=-v):this.face===Jt.LEFT&&(u=g,g=v,v=-u),f.phi=Math.acos(-b)-a,f.lam=Math.atan2(v,g),this.face===Jt.RIGHT?f.lam=Wt(f.lam,-a):this.face===Jt.BACK?f.lam=Wt(f.lam,-m):this.face===Jt.LEFT&&(f.lam=Wt(f.lam,+a))}0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(f.phi=-f.phi));return f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Qt=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Zt=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Kt=.8487,$t=1.3523,er=d/5,tr=1/er,rr=18,sr=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},ir=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])},nr={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=j(e.x-this.long0),r=Math.abs(e.y),s=Math.floor(r*er);s<0?s=0:s>=rr&&(s=rr-1),r=d*(r-tr*s);var i={x:sr(Qt[s],r)*t,y:sr(Zt[s],r)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*Kt+this.x0,i.y=i.y*this.a*$t+this.y0,i},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Kt),y:Math.abs(e.y-this.y0)/(this.a*$t)};if(t.y>=1)t.x/=Qt[rr][0],t.y=e.y<0?-a:a;else{var r=Math.floor(t.y*rr);for(r<0?r=0:r>=rr&&(r=rr-1);;)if(Zt[r][0]>t.y)--r;else{if(!(Zt[r+1][0]<=t.y))break;++r}var s=Zt[r],i=5*(t.y-s[0])/(Zt[r+1][0]-s[0]);i=function(e,t,r,s){for(var i=t;s;--s){var n=e(i);if(i-=n,Math.abs(n)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,r,s,i,n=e.x,a=e.y;if(n-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var o=this.radius_p/He(this.radius_p*Math.cos(a),Math.sin(a));if(r=o*Math.cos(n)*Math.cos(a),s=o*Math.sin(n)*Math.cos(a),i=o*Math.sin(a),(this.radius_g-r)*r-s*s-i*i*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(s/He(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(s/t),e.y=this.radius_g_1*Math.atan(i/He(s,t)))}else"sphere"===this.shape&&(t=Math.cos(a),r=Math.cos(n)*t,s=Math.sin(n)*t,i=Math.sin(a),t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(s/He(i,t)),e.y=this.radius_g_1*Math.atan(i/t)):(e.x=this.radius_g_1*Math.atan(s/t),e.y=this.radius_g_1*Math.atan(i/He(s,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,r,s,i,n=-1,a=0,o=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*He(1,o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*He(1,a));var l=o/this.radius_p;if(t=a*a+l*l+n*n,r=2*this.radius_g*n,(s=r*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(s))/(2*t),n=this.radius_g+i*n,a*=i,o*=i,e.x=Math.atan2(a,n),e.y=Math.atan(o*Math.cos(e.x)/n),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+o*o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+o*o+n*n,r=2*this.radius_g*n,(s=r*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;i=(-r-Math.sqrt(s))/(2*t),n=this.radius_g+i*n,a*=i,o*=i,e.x=Math.atan2(a,n),e.y=Math.atan(o*Math.cos(e.x)/n)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};return xe.defaultDatum="WGS84",xe.Proj=ne,xe.WGS84=new xe.Proj("WGS84"),xe.Point=Be,xe.toPoint=fe,xe.defs=N,xe.nadgrid=function(e,t){var r=new DataView(t),s=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),i=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:te(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(r,s);i.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n=function(e,t,r){for(var s=[],i=0;i0?{done:!1,value:r}:{done:!0,value:void 0}:{done:!1,value:function(e,t){if(!e.length)return t;if(!t.length)return e;var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(r,s.value)}})},t.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var r=this,s=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var i=new Uint8Array(t);return i.set(this._array.subarray(this._index)),function n(){return r._source.read().then(function(a){return a.done?(r._array=e,r._index=0,s>0?i.subarray(0,s):null):s+a.value.length>=t?(r._array=a.value,r._index=t-s,i.set(a.value.subarray(0,t-s),s),i):(i.set(a.value,s),s+=a.value.length,n())})}()},t.prototype.cancel=function(){return this._source.cancel()},function(e){return"function"==typeof e.slice?e:new t("function"==typeof e.read?e:e.getReader())}}()},982:(e,t)=>{"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function s(e,t,r,s){return new(r||(r=Promise))(function(i,n){function a(e){try{l(s.next(e))}catch(e){n(e)}}function o(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((s=s.apply(e,t||[])).next())})}function i(e,t){var r,s,i,n,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,s&&(i=2&n[0]?s.return:n[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,n[1])).done)return i;switch(s=0,i&&(n=[2&n[0],i.value]),n[0]){case 0:case 1:i=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,s=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!i||n[1]>i[0]&&n[1]=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e){return this instanceof a?(this.v=e,this):new a(e)}function o(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=r.apply(e,t||[]),n=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(e){i[e]&&(s[e]=function(t){return new Promise(function(r,s){n.push([e,t,r,s])>1||l(e,t)})})}function l(e,t){try{(r=i[e](t)).value instanceof a?Promise.resolve(r.value.v).then(h,u):c(n[0][2],r)}catch(e){c(n[0][3],e)}var r}function h(e){l("next",e)}function u(e){l("throw",e)}function c(e,t){e(t),n.shift(),n.length&&l(n[0][0],n[0][1])}}var l=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(e,t){function s(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}(t,e),t}(Error),h=function(){function e(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),e.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}(),u=function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}(),c=function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){this._q.length=y;return Promise.resolve(t).then(function(t){return!r&&e.state>=g?S(e).then(function(e){return{value:e,done:!0}}):{value:t,done:r}})}function _(e,t){var r,s;if(!(e.state>=m))if(e.state=m,e.onnext(),e.onstop(),null==e.err&&(e.err=t),0!==e.pushes.length||void 0!==e.buffer&&!e.buffer.empty)try{for(var i=n(e.pushes),a=i.next();!a.done;a=i.next()){a.value.resolve()}}catch(e){r={error:e}}finally{try{a&&!a.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}else w(e)}function w(e){var t,r;if(!(e.state>=y)){e.state=g||(e.state=f)){e.state=f;var t=function(e,t){if(d(t),e.pushes.length>=v)throw new l("No more than "+v+" pending calls to push are allowed on a single repeater.");if(e.state>=m)return Promise.resolve(void 0);var r,s=void 0===e.pending?Promise.resolve(t):e.pending.then(function(){return t});s=s.catch(function(t){e.state=v)throw new l("No more than "+v+" pending calls to next are allowed on a single repeater.");if(t.state<=p&&T(t),t.onnext(e),void 0!==t.buffer&&!t.buffer.empty){var r=x(t,t.buffer.remove());if(t.pushes.length){var s=t.pushes.shift();t.buffer.add(s.value),t.onnext=s.resolve}return r}if(t.pushes.length){var i=t.pushes.shift();return t.onnext=i.resolve,x(t,i.value)}return t.state>=m?(w(t),x(t,S(t))):new Promise(function(r){return t.nexts.push({resolve:r,value:e})})},e.prototype.return=function(e){d(e);var t=M.get(this);if(void 0===t)throw new Error("WeakMap error");return w(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),x(t,S(t))},e.prototype.throw=function(e){var t=M.get(this);if(void 0===t)throw new Error("WeakMap error");return t.state<=p||t.state>=m||void 0!==t.buffer&&!t.buffer.empty?(w(t),null==t.err&&(t.err=e),x(t,S(t))):this.next(Promise.reject(e))},e.prototype[Symbol.asyncIterator]=function(){return this},e.race=O,e.merge=P,e.zip=L,e.latest=I,e}();function A(e,t){var r,s,l=[],h=function(e){null!=e&&"function"==typeof e[Symbol.asyncIterator]?l.push(e[Symbol.asyncIterator]()):null!=e&&"function"==typeof e[Symbol.iterator]?l.push(e[Symbol.iterator]()):l.push(function(){return o(this,arguments,function(){return i(this,function(r){switch(r.label){case 0:return t.yieldValues?[4,a(e)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return t.returnValues?[4,a(e)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var u=n(e),c=u.next();!c.done;c=u.next()){h(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(r)throw r.error}}return l}function O(e){var t=this,r=A(e,{returnValues:!0});return new E(function(e,a){return s(t,void 0,void 0,function(){var t,s,o,l,h,u;return i(this,function(c){switch(c.label){case 0:if(!r.length)return a(),[2];s=!1,a.then(function(){t(),s=!0}),c.label=1;case 1:c.trys.push([1,,5,7]),l=void 0,h=0,u=function(){var s,u,c,d,p,f;return i(this,function(i){switch(i.label){case 0:s=h;try{for(p=void 0,u=n(r),c=u.next();!c.done;c=u.next())d=c.value,Promise.resolve(d.next()).then(function(e){e.done?(a(),void 0===o&&(o=e)):h===s&&(h++,t(e))},function(e){return a(e)})}catch(e){p={error:e}}finally{try{c&&!c.done&&(f=u.return)&&f.call(u)}finally{if(p)throw p.error}}return[4,new Promise(function(e){return t=e})];case 1:return void 0===(l=i.sent())?[3,3]:[4,e(l.value)];case 2:i.sent(),i.label=3;case 3:return[2]}})},c.label=2;case 2:return s?[3,4]:[5,u()];case 3:return c.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return a(),[4,Promise.race(r.map(function(e){return e.return&&e.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}function P(e){var t=this,r=A(e,{yieldValues:!0});return new E(function(e,a){return s(t,void 0,void 0,function(){var t,o,l,h=this;return i(this,function(u){switch(u.label){case 0:if(!r.length)return a(),[2];t=[],o=!1,a.then(function(){var e,r;o=!0;try{for(var s=n(t),i=s.next();!i.done;i=s.next()){(0,i.value)()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}}),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,n){return s(h,void 0,void 0,function(){var s;return i(this,function(i){switch(i.label){case 0:i.trys.push([0,,6,9]),i.label=1;case 1:return o?[3,5]:(Promise.resolve(r.next()).then(function(e){return t[n](e)},function(e){return a(e)}),[4,new Promise(function(e){t[n]=e})]);case 2:return void 0===(s=i.sent())?[3,4]:s.done?(l=s,[2]):[4,e(s.value)];case 3:i.sent(),i.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:i.sent(),i.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return u.sent(),[2,l&&l.value];case 3:return a(),[7];case 4:return[2]}})})})}function L(e){var t=this,r=A(e,{returnValues:!0});return new E(function(e,n){return s(t,void 0,void 0,function(){var t,s,a,o;return i(this,function(i){switch(i.label){case 0:if(!r.length)return n(),[2,[]];s=!1,n.then(function(){t(),s=!0}),i.label=1;case 1:i.trys.push([1,,6,8]),i.label=2;case 2:return s?[3,5]:(Promise.all(r.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return n(e)}),[4,new Promise(function(e){return t=e})]);case 3:return void 0===(a=i.sent())?[2]:(o=a.map(function(e){return e.value}),a.some(function(e){return e.done})?[2,o]:[4,e(o)]);case 4:return i.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(e){return e.return&&e.return()}))];case 7:return i.sent(),[7];case 8:return[2]}})})})}function I(e){var t=this,r=A(e,{yieldValues:!0,returnValues:!0});return new E(function(e,a){return s(t,void 0,void 0,function(){var t,o,l,h,u,c=this;return i(this,function(d){switch(d.label){case 0:if(!r.length)return a(),[2,[]];o=[],l=!1,a.then(function(){var e,r;t();try{for(var s=n(o),i=s.next();!i.done;i=s.next()){(0,i.value)()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}l=!0}),d.label=1;case 1:return d.trys.push([1,,5,7]),Promise.all(r.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return a(e)}),[4,new Promise(function(e){return t=e})];case 2:return void 0===(h=d.sent())?[2]:(u=h.map(function(e){return e.value}),h.every(function(e){return e.done})?[2,u]:[4,e(u.slice())]);case 3:return d.sent(),[4,Promise.all(r.map(function(t,r){return s(c,void 0,void 0,function(){var s;return i(this,function(i){switch(i.label){case 0:if(h[r].done)return[2,h[r].value];i.label=1;case 1:return l?[3,4]:(Promise.resolve(t.next()).then(function(e){return o[r](e)},function(e){return a(e)}),[4,new Promise(function(e){return o[r]=e})]);case 2:return void 0===(s=i.sent())?[2,h[r].value]:s.done?[2,s.value]:(u[r]=s.value,[4,e(u.slice())]);case 3:return i.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,d.sent()];case 5:return a(),[4,Promise.all(r.map(function(e){return e.return&&e.return()}))];case 6:return d.sent(),[7];case 7:return[2]}})})})}t.ZN=E}},t={};function r(s){var i=t[s];if(void 0!==i)return i.exports;var n=t[s]={id:s,loaded:!1,exports:{}};return e[s].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}),r.d=((e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}),r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),r.nmd=(e=>(e.paths=[],e.children||(e.children=[]),e)),(()=>{"use strict";var e=window.SuperMap=window.SuperMap||{};e.Components=window.SuperMap.Components||{};var t={GEOJSON:"GEOJSON",ISERVER:"ISERVER",FGB:"FGB"},s={ISERVER:"ISERVER",IPORTAL:"IPORTAL",ONLINE:"ONLINE"},i={LINE:"LINE",LINEM:"LINEM",POINT:"POINT",REGION:"REGION",POINTEPS:"POINTEPS",LINEEPS:"LINEEPS",REGIONEPS:"REGIONEPS",ELLIPSE:"ELLIPSE",CIRCLE:"CIRCLE",TEXT:"TEXT",RECTANGLE:"RECTANGLE",UNKNOWN:"UNKNOWN",GEOCOMPOUND:"GEOCOMPOUND"},n={ATTRIBUTE:"ATTRIBUTE",ATTRIBUTEANDGEOMETRY:"ATTRIBUTEANDGEOMETRY",GEOMETRY:"GEOMETRY"},a={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"},o={DISTANCE:"DISTANCE",AREA:"AREA"},l={METER:"METER",KILOMETER:"KILOMETER",MILE:"MILE",YARD:"YARD",DEGREE:"DEGREE",MILLIMETER:"MILLIMETER",CENTIMETER:"CENTIMETER",INCH:"INCH",DECIMETER:"DECIMETER",FOOT:"FOOT",SECOND:"SECOND",MINUTE:"MINUTE",RADIAN:"RADIAN"},h={CENTIMETER:"CENTIMETER",DECIMETER:"DECIMETER",FOOT:"FOOT",INCH:"INCH",KILOMETER:"KILOMETER",METER:"METER",MILE:"MILE",MILLIMETER:"MILLIMETER",YARD:"YARD"},u={CAPTION:"CAPTION",CAPTION_PERCENT:"CAPTION_PERCENT",CAPTION_VALUE:"CAPTION_VALUE",PERCENT:"PERCENT",VALUE:"VALUE"},c={AREA:"AREA",BAR:"BAR",BAR3D:"BAR3D",LINE:"LINE",PIE:"PIE",PIE3D:"PIE3D",POINT:"POINT",RING:"RING",ROSE:"ROSE",ROSE3D:"ROSE3D",STACK_BAR:"STACK_BAR",STACK_BAR3D:"STACK_BAR3D",STEP:"STEP"},d={ALL:"ALL",NONE:"NONE",YAXES:"YAXES"},p={CONSTANT:"CONSTANT",LOGARITHM:"LOGARITHM",SQUAREROOT:"SQUAREROOT"},f={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"},m={BLACK_WHITE:"BLACKWHITE",BLUE_BLACK:"BLUEBLACK",BLUE_RED:"BLUERED",BLUE_WHITE:"BLUEWHITE",CYAN_BLACK:"CYANBLACK",CYAN_BLUE:"CYANBLUE",CYAN_GREEN:"CYANGREEN",CYAN_WHITE:"CYANWHITE",GREEN_BLACK:"GREENBLACK",GREEN_BLUE:"GREENBLUE",GREEN_ORANGE_VIOLET:"GREENORANGEVIOLET",GREEN_RED:"GREENRED",GREEN_WHITE:"GREENWHITE",PINK_BLACK:"PINKBLACK",PINK_BLUE:"PINKBLUE",PINK_RED:"PINKRED",PINK_WHITE:"PINKWHITE",RAIN_BOW:"RAINBOW",RED_BLACK:"REDBLACK",RED_WHITE:"REDWHITE",SPECTRUM:"SPECTRUM",TERRAIN:"TERRAIN",YELLOW_BLACK:"YELLOWBLACK",YELLOW_BLUE:"YELLOWBLUE",YELLOW_GREEN:"YELLOWGREEN",YELLOW_RED:"YELLOWRED",YELLOW_WHITE:"YELLOWWHITE"},y={TOPLEFT:"TOPLEFT",TOPCENTER:"TOPCENTER",TOPRIGHT:"TOPRIGHT",BASELINELEFT:"BASELINELEFT",BASELINECENTER:"BASELINECENTER",BASELINERIGHT:"BASELINERIGHT",BOTTOMLEFT:"BOTTOMLEFT",BOTTOMCENTER:"BOTTOMCENTER",BOTTOMRIGHT:"BOTTOMRIGHT",MIDDLELEFT:"MIDDLELEFT",MIDDLECENTER:"MIDDLECENTER",MIDDLERIGHT:"MIDDLERIGHT"},g={NORMAL:"ALONG_LINE_NORMAL",LB_TO_RT:"LEFT_BOTTOM_TO_RIGHT_TOP",LT_TO_RB:"LEFT_TOP_TO_RIGHT_BOTTOM",RB_TO_LT:"RIGHT_BOTTOM_TO_LEFT_TOP",RT_TO_LB:"RIGHT_TOP_TO_LEFT_BOTTOM"},v={DIAMOND:"DIAMOND",ELLIPSE:"ELLIPSE",MARKER:"MARKER",NONE:"NONE",RECT:"RECT",ROUNDRECT:"ROUNDRECT",TRIANGLE:"TRIANGLE"},b={NEWLINE:"NEWLINE",NONE:"NONE",OMIT:"OMIT"},S={FLAT:"FLAT",ROUND:"ROUND"},x={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"},_={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},w={BSPLINE:"BSPLINE",POLISH:"POLISH"},C={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"},T={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"},M={ADD:"add",UPDATE:"update",DELETE:"delete"},E={LESS_TIME:"LESS_TIME",LESS_TRANSFER:"LESS_TRANSFER",LESS_WALK:"LESS_WALK",MIN_DISTANCE:"MIN_DISTANCE"},A={BUS:"BUS",SUBWAY:"SUBWAY",NO_SUBWAY:"NO_SUBWAY",NONE:"NONE"},O={EXPONENTIAL:"EXPONENTIAL",GAUSSIAN:"GAUSSIAN",SPHERICAL:"SPHERICAL"},P={EXP1:"EXP1",EXP2:"EXP2"},L={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"},I={CLIP:"clip",INTERSECT:"intersect"},N={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"},F={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"},k={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},R={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},D={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"},G={GEOHASH_GRID:"geohash_grid"},B={AVG:"avg",MAX:"max",MIN:"min",SUM:"sum"},j={NDVI:"NDVI",HILLSHADE:"HILLSHADE"};class U{constructor(e,t){this.w=e?parseFloat(e):0,this.h=e?parseFloat(t):0,this.CLASS_NAME="SuperMap.Size"}toString(){return"w="+this.w+",h="+this.h}clone(){return new U(this.w,this.h)}equals(e){var t=!1;return null!=e&&(t=this.w===e.w&&this.h===e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t}destroy(){this.w=null,this.h=null}}class V{constructor(e,t,r){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=r,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new V(this.x,this.y,this.mode)}equals(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){if(null==e||null==t)throw new TypeError("Pixel.add cannot receive null values");return new V(this.x+e,this.y+t)}offset(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t}destroy(){this.x=null,this.y=null,this.mode=null}}V.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var z=function(...e){class t{constructor(t){for(var r=0;r0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,t,r,s){t=void 0!==t?t:0,r=void 0!==r?r:q.thousandsSeparator,s=void 0!==s?s:q.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var i=e.toString().split(".");1===i.length&&null==t&&(t=0);var n,a=i[0];if(r)for(var o=/(-?[0-9]+)([0-9]{3})/;o.test(a);)a=a.replace(o,"$1"+r+"$2");if(0==t)n=a;else{var l=i.length>1?i[1]:"0";null!=t&&(l+=new Array(t-l.length+1).join("0")),n=a+s+l}return n}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return q.limitSigDigs(this,e)});var H={bind:function(e,t){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var s=r.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,s)}},bindAsEventListener:function(e,t){return function(r){return e.call(t,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},W={filter:function(e,t,r){var s=[];if(Array.prototype.filter)s=e.filter(t,r);else{var i=e.length;if("function"!=typeof t)throw new TypeError;for(var n=0;n-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(t="msie",e=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(t="chrome",e=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(t="firefox",e=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(t="opera",e=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(t="safari",e=i.match(/version\/([\d.]+)/)),r=e?e[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?s="apple":i.indexOf("android")>-1&&(r=(e=i.match(/version\/([\d.]+)/))?e[1]:"",s="android"),{name:t,version:r,device:s}}(),Q=function(){var e=!0,t=X;return document.createElement("canvas").getContext?("firefox"===t.name&&parseFloat(t.version)<5&&(e=!1),"safari"===t.name&&parseFloat(t.version)<4&&(e=!1),"opera"===t.name&&parseFloat(t.version)<10&&(e=!1),"msie"===t.name&&parseFloat(t.version)<9&&(e=!1)):e=!1,e}(),Z=function(){var e=navigator.userAgent.toLowerCase();return-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")}(),K=96,$={extend:function(e,t){if(e=e||{},t){for(var r in t){var s=t[r];void 0!==s&&(e[r]=s)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},copy:function(e,t){var r;if(e=e||{},t)for(var s in e)void 0!==(r=t[s])&&(e[s]=r)},reset:function(e){for(var t in e=e||{})if(e.hasOwnProperty(t)){if("object"==typeof e[t]&&e[t]instanceof Array){for(var r in e[t])e[t][r].destroy&&e[t][r].destroy();e[t].length=0}else"object"==typeof e[t]&&e[t]instanceof Object&&e[t].destroy&&e[t].destroy();e[t]=null}},getElement:function(){for(var e=[],t=0,r=arguments.length;t=0;r--)e[r]===t&&e.splice(r,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var r=0,s=e.length;r=0&&parseFloat(o)<1?(e.style.filter="alpha(opacity="+100*o+")",e.style.opacity=o):1===parseFloat(o)&&(e.style.filter="",e.style.opacity="")},applyDefaults:function(e,t){e=e||{};var r="function"==typeof window.Event&&t instanceof window.Event;for(var s in t)(void 0===e[s]||!r&&t.hasOwnProperty&&t.hasOwnProperty(s)&&!e.hasOwnProperty(s))&&(e[s]=t[s]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var r in e){var s,i=e[r];if(null!=i&&"function"!=typeof i)s=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),t.push(encodeURIComponent(r)+"="+s)}return t.join("&")},urlAppend:function(e,t){var r=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var s=(e+" ").split(/[?&]/);r+=" "===s.pop()?t:s.length?"&"+t:"?"+t}return r},urlPathAppend:function(e,t){let r=e;if(!t)return r;0===t.indexOf("/")&&(t=t.substring(1));const s=e.split("?");return s[0].indexOf("/",s[0].length-1)<0&&(s[0]+="/"),r=`${s[0]}${t}${s.length>1?`?${s[1]}`:""}`},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=$.DEFAULT_PRECISION),"number"!=typeof e&&(e=parseFloat(e)),0===t?e:parseFloat(e.toPrecision(t))},rad:function(e){return e*Math.PI/180},getParameters:function(e){e=null===e||void 0===e?window.location.href:e;var t="";if(J.contains(e,"?")){var r=e.indexOf("?")+1,s=J.contains(e,"#")?e.indexOf("#"):e.length;t=e.substring(r,s)}for(var i={},n=t.split(/[&;]/),a=0,o=n.length;a1?1/e:e},getResolutionFromScale:function(e,t){var r;e&&(null==t&&(t="degrees"),r=1/($.normalizeScale(e)*ee[t]*K));return r},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*ee[t]*K},getBrowser:function(){return X},isSupportCanvas:Q,supportCanvas:function(){return $.isSupportCanvas},isInTheSameDomain:function(e){if(!e)return!0;var t=e.indexOf("//"),r=document.location.toString(),s=r.indexOf("//");if(-1===t)return!0;var i,n=i=e.substring(0,t),a=r.substring(s+2);s=a.indexOf("/");var o=a.indexOf(":"),l=a.substring(0,s),h=document.location.protocol;if(-1!==o||(l+=":"+("http:"===h.toLowerCase()?80:443)),h.toLowerCase()!==n.toLowerCase())return!1;var u=(n=e.substring(t+2)).indexOf(":");t=n.indexOf("/");var c,d=n.substring(0,t);return-1!==u?c=n.substring(0,u):(c=n.substring(0,t),d+=":"+("http:"===i.toLowerCase()?80:443)),c===document.domain&&d===l},calculateDpi:function(e,t,r,s,i){if(e&&t&&r){var n,a=e.getWidth(),o=e.getHeight(),l=t.w,h=t.h;if(i=i||6378137,"degree"===(s=s||"degrees").toLowerCase()||"degrees"===s.toLowerCase()||"dd"===s.toLowerCase()){let e=a/l,t=o/h;n=254/(e>t?e:t)/r/(2*Math.PI*i/360)/1e4}else{n=254/(a/l)/r/1e4}return n}},toJSON:function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return t=(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",s=0,i=t.length;s0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,r,s){return s=s||6378137,r=r||"",e>0&&t>0?(e=$.normalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*s/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,r,s){return s=s||6378137,r=r||"",e>0&&t>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*s/360)/1e4:254/t/e/1e4:-1},transformResult:function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},copyAttributes:function(e,t){if(e=e||{},t)for(var r in t){var s=t[r];void 0!==s&&"CLASS_NAME"!==r&&"function"!=typeof s&&(e[r]=s)}return e},copyAttributesWithClip:function(e,t,r){if(e=e||{},t)for(var s in t){var i=!1;if(r&&r.length)for(var n=0,a=r.length;n=0&&n<=1&&i<=1&&n>=0?new Y.Point(e.x+i*(t.x-e.x),e.y+i*(t.y-e.y)):"No Intersection";else if(0==o&&0==l){var u=Math.max(e.y,t.y),c=Math.min(e.y,t.y),d=Math.max(e.x,t.x),p=Math.min(e.x,t.x);a=(r.y>=c&&r.y<=u||s.y>=c&&s.y<=u)&&r.x>=p&&r.x<=d||s.x>=p&&s.x<=d?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",e.fontSize&&(r.style.fontSize=e.fontSize),e.fontFamily&&(r.style.fontFamily=e.fontFamily),e.fontWeight&&(r.style.fontWeight=e.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=t;var s=r.clientWidth,i=r.clientHeight;return document.body.removeChild(r),{textWidth:s,textHeight:i}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,(e,r)=>{var s;return s=t.hasOwnProperty(r)?function(e){if(void 0==e||null==e)return"";if(e instanceof Date)return e.toJSON();if(function(e){if("string"!=typeof e&&"object"!=typeof e)return!1;try{const t=e.toString();return"[object Object]"===t||"[object Array]"===t}catch(e){return!1}}(e))return JSON.stringify(e);return e.toString()}(t[r]):e,encodeURIComponent(s)}):e}},ee={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};ee.in=ee.inches,ee.degrees=ee.dd,ee.nmi=1852*ee.m;const te=.0254000508001016;$.extend(ee,{Inch:ee.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),$.extend(ee,{mm:ee.Meter/1e3,cm:ee.Meter/100,dm:100*ee.Meter,km:1e3*ee.Meter,kmi:ee.nmi,fath:ee.Fathom,ch:ee.IntnlChain,link:ee.IntnlLink,"us-in":ee.inches,"us-ft":ee.Foot,"us-yd":ee.Yard,"us-ch":ee.GunterChain,"us-mi":ee.Mile,"ind-yd":ee.IndianYd37,"ind-ft":ee.IndianFt37,"ind-ch":791.9942845122}),ee.degree=ee.dd,ee.meter=ee.m,ee.foot=ee.ft,ee.inch=ee.inches,ee.mile=ee.mi,ee.kilometer=ee.km,ee.yard=ee.yd;class re{constructor(e,t){$.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?$.toFloat(e):0,this.lat=t?$.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new re(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new re(this.lon+$.toFloat(e),this.lat+$.toFloat(t))}equals(e){var t=!1;return null!=e&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lone.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new re(t[0],t[1])}static fromArray(e){var t=$.isArray(e),r=t&&e[0],s=t&&e[1];return new re(r,s)}}class se{constructor(e,t,r,s){$.isArray(e)&&(s=e[3],r=e[2],t=e[1],e=e[0]),this.left=null!=e?$.toFloat(e):this.left,this.bottom=null!=t?$.toFloat(t):this.bottom,this.right=null!=r?$.toFloat(r):this.right,this.top=null!=s?$.toFloat(s):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new se(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return null!=e&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return!0===e?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){null==e&&(e=6);var r=Math.pow(10,e),s=Math.round(this.left*r)/r,i=Math.round(this.bottom*r)/r,n=Math.round(this.right*r)/r,a=Math.round(this.top*r)/r;return!0===t?i+","+s+","+a+","+n:s+","+i+","+n+","+a}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new U(this.getWidth(),this.getHeight())}getCenterPixel(){return new V((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new re((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){var r,s;e=e||1,null==t&&(t=this.getCenterLonLat()),"SuperMap.LonLat"===t.CLASS_NAME?(r=t.lon,s=t.lat):(r=t.x,s=t.y);var i=(this.left-r)*e+r,n=(this.bottom-s)*e+s,a=(this.right-r)*e+r,o=(this.top-s)*e+s;return new se(i,n,a,o)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new se(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new se(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new se(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e}t&&(this.centerLonLat=null,(null==this.left||t.leftthis.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),s=t.worldBounds;if(s&&!r){var i=s.getWidth(),n=(s.left+s.right)/2,a=Math.round((e.lon-n)/i);r=this.containsLonLat({lon:e.lon-a*i,lat:e.lat},{inclusive:t.inclusive})}return r}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,r){if(null==r&&(r=!0),null==e||null==t)return!1;return r?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&ethis.bottom&&t=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,a=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,l=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;s=(n||a)&&(o||l)}if(t.worldBounds&&!s){var h=t.worldBounds,u=h.getWidth(),c=!h.containsBounds(r),d=!h.containsBounds(e);c&&!d?(e=e.add(-u,0),s=r.intersectsBounds(e,{inclusive:t.inclusive})):d&&!c&&(r=r.add(-u,0),s=e.intersectsBounds(r,{inclusive:t.inclusive}))}return s}containsBounds(e,t,r){null==t&&(t=!1),null==r&&(r=!0);var s=this.contains(e.left,e.bottom,r),i=this.contains(e.right,e.bottom,r),n=this.contains(e.left,e.top,r),a=this.contains(e.right,e.top,r);return t?s||i||n||a:s&&i&&n&&a}determineQuadrant(e){var t="",r=this.getCenterLonLat();return t+=e.lat=e.right&&i.right>e.right;)i=i.add(-n,0);var a=i.left+r;ae.left&&i.right-s>e.right&&(i=i.add(-n,0))}return i}toServerJSONObject(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}destroy(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}static fromString(e,t){var r=e.split(",");return se.fromArray(r,t)}static fromArray(e,t){return!0===t?new se(e[1],e[0],e[3],e[2]):new se(e[0],e[1],e[2],e[3])}static fromSize(e){return new se(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return t+="t"===e.charAt(0)?"b":"t",t+="l"===e.charAt(1)?"r":"l"}}class ie extends Y{constructor(e){super(),this.components=[],this.componentTypes=null,null!=e&&this.addComponents(e),this.CLASS_NAME="SuperMap.Geometry.Collection",this.geometryType="Collection"}destroy(){this.components.length=0,this.components=null,super.destroy()}clone(){for(var e=new ie,t=0,r=this.components.length;t-1)){if(null!=t&&t=0;--r)t=this.removeComponent(e[r])||t;return t}removeComponent(e){return $.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,r=this.components.length;t2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e,t,r=this.components.length-1,s=new Array(r),i=0;i=1?1:g)<=-1?-1:g,u=180*Math.acos(g)/Math.PI,a=(u=i.x==r.x?t.x>r.x&&s.x>r.x||t.xd*t.x+p&&s.y>d*s.x+p||t.yr.y?s.xr.x&&(o=!1):i.xd*s.x+p&&(o=!1):i.x>r.x?s.y>r.y&&(o=!1):s.y=0?180*Math.atan(v)/Math.PI:Math.abs(180*Math.atan(v)/Math.PI)+90,S=Math.abs(t.y);r.y==S&&S==i.y&&r.x=0?v>=0?h+=l:h=180-(h-90)+l:h=v>0?h-180+l:90-h+l:x>=0?v>=0?h-=l:h=180-(h-90)-l:h=v>=0?h-180-l:90-h-l,h=h*Math.PI/180;var w=t.x+n*Math.cos(h),C=t.y+n*Math.sin(h);c.push(new oe(w,C))}c.push(i)}return c}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var s=0;s1&&(r=parseFloat(r)*h),s.labelAlign&&"cm"!==s.labelAlign)switch(s.labelAlign){case"lt":l.x+=t/2,l.y+=r/2;break;case"lm":l.x+=t/2;break;case"lb":l.x+=t/2,l.y-=r/2;break;case"ct":l.y+=r/2;break;case"cb":l.y-=r/2;break;case"rt":l.x-=t/2,l.y+=r/2;break;case"rm":l.x-=t/2;break;case"rb":l.x-=t/2,l.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=t,i=l.x-parseFloat(t)/2,n=l.y+parseFloat(r)/2,o=l.x+parseFloat(t)/2,a=l.y-parseFloat(r)/2,new se(i,n,o,a)}getLabelPxBoundsByText(e,t){var r,s,i,n,a=this.getLabelPxSize(t),o=$.cloneObject(e);if(t.labelAlign&&"cm"!==t.labelAlign)switch(t.labelAlign){case"lt":o.x+=a.w/2,o.y+=a.h/2;break;case"lm":o.x+=a.w/2;break;case"lb":o.x+=a.w/2,o.y-=a.h/2;break;case"ct":o.y+=a.h/2;break;case"cb":o.y-=a.h/2;break;case"rt":o.x-=a.w/2,o.y+=a.h/2;break;case"rm":o.x-=a.w/2;break;case"rb":o.x-=a.w/2,o.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=o.x-a.w/2,s=o.y+a.h/2,n=t.fontStyle&&"italic"===t.fontStyle?o.x+a.w/2+parseInt(parseFloat(t.fontSize)/2):o.x+a.w/2,i=o.y-a.h/2,new se(r,s,n,i)}getLabelPxSize(e){var t,r,s,i,n=parseFloat(e.strokeWidth);t=e.label||this.text,r=e.fontSize?parseFloat(e.fontSize):parseFloat("12px");var a=t.split("\n"),o=a.length;i=o>1?r*o+o+n+.2*r:r+n+.2*r+1,s=0,this.labelWTmp&&s255?r++:s++;return t.cnC=r,t.enC=s,t.textC=e.length,t}}class ue extends le{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var r=!1,s=this.components.pop();null==t&&e.equals(s)||(r=super.addComponent.apply(this,arguments));var i=this.components[0];return super.addComponent.apply(this,[i]),r}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var r=this.components[0];super.addComponent.apply(this,[r])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,s=this.components.length;r0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var r=ge.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,s){var i=$.getElement(e);if(s=s||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!i._eventCacheID){var n="eventCacheID_";i.id&&(n=i.id+"_"+n),i._eventCacheID=$.createUniqueID(n)}var a=i._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:i,name:t,observer:r,useCapture:s}),i.addEventListener?"mousewheel"===t?i.addEventListener(t,r,{useCapture:s,passive:!1}):i.addEventListener(t,r,s):i.attachEvent&&i.attachEvent("on"+t,r)},stopObservingElement:function(e){var t=$.getElement(e)._eventCacheID;this._removeElementObservers(ge.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var r=e[t],s=new Array(r.element,r.name,r.observer,r.useCapture);ge.stopObserving.apply(this,s)}},stopObserving:function(e,t,r,s){s=s||!1;var i=$.getElement(e),n=i._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(t="keydown");var a=!1,o=ge.observers[n];if(o)for(var l=0;!a&&l0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,function(e,r){var s=t[r];return s||(s=r.charCodeAt(),"\\u00"+Math.floor(s/16).toString(16)+(s%16).toString(16))})+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}}}read(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=r),r}write(e,t){this.pretty=!!t;var r=null,s=typeof e;if(this.serialize[s])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[s].apply(this,[e])}catch(e){}return r}writeIndent(){var e=[];if(this.pretty)for(var t=0;t0){e+='"points":[';for(var r=0,s=this.components.length;r0))return null;for(var n=0,a=0,o=[];n0){if(1===r)return new oe(t[0].x,t[0].y);var s=[];for(let e=0;e0){if(1===r){let r=[];for(let s=0;s0){if(1===o){for(e=0,r=[];e=0;t--)if(d[e]=-1,h[t].containsBounds(h[e])){u[e]=-1*u[t],u[e]<0&&(d[e]=t);break}for(let e=0;e0?i.push(l[e]):(i[d[e]].components=i[d[e]].components.concat(l[e].components),i.push(""))}else{i=new Array;for(let e=0;e0&&i.length>0&&(i[i.length-1].components=i[i.length-1].components.concat(a),a=[]),i.push(l[e])),e==s-1){var p=i.length;if(p)i[p-1].components=i[p-1].components.concat(a);else for(let e=0,t=a.length;e=0;t--)if(f[e]=-1,c[t].containsBounds(c[e])){d[e]=-1*d[t],d[e]<0&&(f[e]=t);break}for(let e=0;e0?n.push(u[e]):(n[f[e]].components=n[f[e]].components.concat(u[e].components),n.push(""))}else{n=new Array;for(let e=0;e0&&n.length>0&&(n[n.length-1].components=n[n.length-1].components.concat(l),l=[]),n.push(u[e])),e==s-1){var m=n.length;if(m)n[m-1].components=n[m-1].components.concat(l);else for(let e=0,t=l.length;ee[n]){var a=e[n];e[n]=e[i],e[i]=a;var o=t[n];if(t[n]=t[i],t[i]=o,r&&r.length>0){var l=r[n];r[n]=r[i],r[i]=l}if(s&&s.length>0){var h=s[n];s[n]=s[i],s[i]=h}}}}class Oe extends we{constructor(e){super(e),this.ignoreExtraDims=!0,this.CLASS_NAME="SuperMap.Format.GeoJSON",this.parseCoords={point:function(e){if(!1===this.ignoreExtraDims&&2!=e.length)throw"Only 2D points are supported: "+e;return new oe(e[0],e[1])},multipoint:function(e){for(var t=[],r=null,s=0,i=e.length;sthis._toiSevrerFeature(e)):this._toiSevrerFeature(s)}toGeoJSON(e){var t={type:null};if($.isArray(e)){t.type="FeatureCollection";var r=e.length;t.features=new Array(r);for(var s=0;s-1||(t[s]=e[s]);return t}}class Pe{constructor(e){var t=this;e=e||{},this.speed=e.speed&&e.speed>=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=t.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],t.events=new ve(this,null,this.EVENT_TYPES),t.speed=Number(t.speed),t.frequency=Number(t.frequency),t.startTime=Number(t.startTime),t.endTime=Number(t.endTime),t.startTime=Date.parse(new Date(t.startTime)),t.endTime=Date.parse(new Date(t.endTime)),t.currentTime=t.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"}updateOptions(e){var t=this;(e=e||{}).speed&&e.speed>=0&&(t.speed=e.speed,t.speed=Number(t.speed)),e.speed&&e.frequency>=0&&(t.frequency=e.frequency,t.frequency=Number(t.frequency)),e.startTime&&null!=e.startTime&&(t.startTime=e.startTime,t.startTime=Date.parse(new Date(t.startTime))),e.endTime&&null!=e.endTime&&e.endTime>=t.startTime&&(t.endTime=e.endTime,t.endTime=Date.parse(new Date(t.endTime))),null!=e.repeat&&(t.repeat=e.repeat),null!=e.reverse&&(t.reverse=e.reverse)}start(){var e=this;e.running||(e.running=!0,e.tick(),e.events.triggerEvent("start",e.currentTime))}pause(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}stop(){var e=this;e.currentTime=e.startTime,e.running&&(e.running=!1),e.events.triggerEvent("stop",e.currentTime)}toggle(){this.running?this.pause():this.start()}setSpeed(e){return e>=0&&(this.speed=e,!0)}getSpeed(){return this.speed}setFrequency(e){return e>=0&&(this.frequency=e,!0)}getFrequency(){return this.frequency}setStartTime(e){var t=this;return!((e=Date.parse(new Date(e)))>t.endTime)&&(t.startTime=e,t.currentTime=t.endTime&&(t.currentTime=t.startTime,t.tick()),!0)}getEndTime(){return this.endTime}setCurrentTime(e){var t=this;return t.currentTime=Date.parse(new Date(t.currentTime)),e>=t.startTime&&e<=t.endTime&&(t.currentTime=e,t.startTime=t.currentTime,t.tick(),!0)}getCurrentTime(){return this.currentTime}setRepeat(e){this.repeat=e}getRepeat(){return this.repeat}setReverse(e){this.reverse=e}getReverse(){return this.reverse}getRunning(){return this.running}destroy(){var e=this;e.speed=null,e.frequency=null,e.startTime=null,e.endTime=null,e.currentTime=null,e.repeat=null,e.running=!1,e.reverse=null}tick(){}}r(107),r(693);var Le=r(144),Ie=r.n(Le);let Ne=window.fetch;var Fe,ke,Re={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=$.toJSON(e[t]));var r=encodeURIComponent(e[t]);this.queryValues.push(r)}},issue:function(e){for(var t=this,r=t.getUid(),s=e.url,i=[],n=new Promise(function(e){t.supermap_callbacks[r]=function(s){delete t.supermap_callbacks[r],e(s)}}),a=s,o=0,l=t.queryKeys?t.queryKeys.length:0,h=0;h=t.limitLength){if(0==o)return!1;i.push(a),a=s,o=0,h--}else if(a.length+t.queryKeys[h].length+2+t.queryValues[h].length>t.limitLength)for(var u=t.queryValues[h];u.length>0;){var c=t.limitLength-a.length-t.queryKeys[h].length-2;a.indexOf("?")>-1?a+="&":a+="?";var d=u.substring(0,c);"%"===d.substring(c-1,c)?(c-=1,d=u.substring(0,c)):"%"===d.substring(c-2,c-1)&&(c-=2,d=u.substring(0,c)),a+=t.queryKeys[h]+"="+d,u=u.substring(c),d.length>0&&(i.push(a),a=s,o=0)}else o++,a.indexOf("?")>-1?a+="&":a+="?",a+=t.queryKeys[h]+"="+t.queryValues[h];return i.push(a),t.send(i,"RequestJSONPPromise.supermap_callbacks["+r+"]",e&&e.proxy),n},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var s=e.length;if(s>0)for(var i=(new Date).getTime(),n=0;n-1?a+="&":a+="?",a+="sectionCount="+s,a+="§ionIndex="+n,a+="&jsonpUserID="+i,r&&(a=decodeURIComponent(a),a=r+encodeURIComponent(a)),Ie()(a,{jsonpCallbackFunction:t,timeout:3e4})}},GET:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(e.params),this.issue(e)},POST:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},PUT:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},DELETE:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)}},De=function(){return void 0!=Fe?Fe:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},Ge=function(){return ke||45e3},Be={commit:function(e,t,r,s){switch(e=e?e.toUpperCase():e){case"GET":return this.get(t,r,s);case"POST":return this.post(t,r,s);case"PUT":return this.put(t,r,s);case"DELETE":return this.delete(t,r,s);default:return this.get(t,r,s)}},supportDirectRequest:function(e,t){return!!$.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:De()||t.proxy)},get:function(e,t,r){r=r||{};if(e=$.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){var s={url:e=e.replace(".json",".jsonp"),data:t};return Re.GET(s)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"GET")},delete:function(e,t,r){r=r||{};if(e=$.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var s={url:e+="&_method=DELETE",data:t};return Re.DELETE(s)}return this.urlIsLong(e)?this._postSimulatie("DELETE",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"DELETE")},post:function(e,t,r){if(r=r||{},!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var s={url:e+="&_method=POST",data:t};return Re.POST(s)}return this._fetch(this._processUrl(e,r),t,r,"POST")},put:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var s={url:e+="&_method=PUT",data:t};return Re.PUT(s)}return this._fetch(e,t,r,"PUT")},urlIsLong:function(e){for(var t=0,r=null,s=0,i=e.length;s-1?"&":"?")+"_method="+e,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(t,r,s)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var r=e.split("?");2===r.length&&(e=r[0]+".json?"+r[1])}return t&&t.proxy&&("function"==typeof t.proxy?e=t.proxy(e):(e=decodeURIComponent(e),e=t.proxy+encodeURIComponent(e))),e},_fetch:function(e,t,r,s){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,Ne(e,{method:s,headers:r.headers,body:"PUT"===s||"POST"===s?t:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:Ge()}).then(function(e){return e})):Ne(e,{method:s,body:"PUT"===s||"POST"===s?t:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:Ge()}).then(function(e){return e})},_getWithCredentials:function(e){return!0===e.withCredentials?"include":!1===e.withCredentials?"omit":"same-origin"},_fetchJsonp:function(e,t){return t=t||{},Ie()(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(r,s){setTimeout(function(){s(new Error("timeout"))},e),t.then(r,s)})},_getParameterString:function(e){var t=[];for(var r in e){var s,i=e[r];if(null!=i&&"function"!=typeof i)s=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),t.push(encodeURIComponent(r)+"="+s)}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class je{static generateToken(e,t){var r=this.servers[e];if(r)return Be.post(r.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(e){return e.text()})}static registerServers(e){this.servers=this.servers||{},$.isArray(e)||(e=[e]);for(var t=0;t0?(t.totalTimes--,t.ajaxPolling()):t._processFailed(e)}ajaxPolling(){let e=this,t=e.options.url,r=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],t=t.replace(r,r.exec(e.url)[0]),e.options.url=t,e.options.isInTheSameDomain=$.isInTheSameDomain(t),e._commit(e.options)}calculatePollingTimes(){let e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.timese.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}isServiceSupportPolling(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}serviceProcessCompleted(e){e=$.transformResult(e),this.events.triggerEvent("processCompleted",{result:e})}serviceProcessFailed(e){let t=(e=$.transformResult(e)).error||e;this.events.triggerEvent("processFailed",{error:t})}_returnContent(e){return e.scope.format!==t.FGB&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[t.GEOJSON,t.ISERVER]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=$.urlAppend(e.url,$.getParameterString(e.params||{}))),"object"==typeof e.data)try{e.params=$.toJSON(e.data)}catch(e){console.log("不是json对象")}else e.params=e.data;Be.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then(function(e){return e.text?e.text():e.json?e.json():e}).then(function(r){let s=r;return"string"==typeof r&&(s=(new we).read(r)),(!s||s.error||s.code>=300&&304!==s.code)&&(s=s&&s.error?{error:s.error}:{error:s}),s&&e.scope.format===t.FGB&&(s.newResourceLocation=s.newResourceLocation.replace(".json","")+".fgb"),s}).catch(function(e){return{error:e}}).then(t=>{t.error?(e.scope?H.bind(e.failure,e.scope):e.failure)(t):(t.succeed=void 0==t.succeed||t.succeed,(e.scope?H.bind(e.success,e.scope):e.success)(t))})}}class tt{constructor(e){e.filters&&"string"==typeof e.filters&&(e.filters=e.filters.split(",")),this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,$.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class rt{constructor(e){e.filters&&(e.filters=e.filters.split(",")),this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null,$.extend(this,e)}destroy(){this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null}}class st extends et{constructor(e,t){super(e,t),this.options=t||{},this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t){t instanceof tt&&this.processAsync(e,t)}decode(e,t){t instanceof rt&&this.processAsync(e,t)}processAsync(e,t){this.request({method:"GET",url:e,params:t,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}serviceProcessCompleted(e){e.succeed&&delete e.succeed,super.serviceProcessCompleted(e)}serviceProcessFailed(e){super.serviceProcessFailed(e)}}class it{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",$.extend(this,e)}destroy(){this.aggName=null,this.aggFieldName=null,this.aggType=null}}class nt extends it{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",$.extend(this,e)}destroy(){this.subAggs&&(this.subAggs=null)}}class at{constructor(e){this.dataset=null,this.targetDatasourceName=null,this.totalGridName=null,this.diffuseDatasetGridName=null,this.durationDatasetGridName=null,this.directDatasetGridName=null,this.latitude=null,this.timeMode="MULTIDAYS",this.dayStart=null,this.dayEnd=null,this.hourStart=null,this.hourEnd=null,this.transmittance=null,this.hourInterval=null,this.dayInterval=null,this.deleteExistResultDataset=!1,$.extend(this,e),this.CLASS_NAME="SuperMap.AreaSolarRadiationParameters"}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){var r={};for(var s in e){if("dataset"!==s)"latitude"===s||"timeMode"===s||"dayStart"===s||("dayEnd"===s||"hourStart"===s||"hourEnd"===s)||("transmittance"===s||"hourInterval"===s||"dayInterval"===s)?r[s]=e[s]:t[s]=e[s]}t.parameter=r}}class ot extends et{constructor(e,r){super(e,r),this.format=r.format||t.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e){var r,s=this;if((e=$.transformResult(e))&&s.format===t.GEOJSON&&"function"==typeof s.toGeoJSONResult)if($.isArray(e)){for(var i=0;i0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}class St{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=F.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;$.extend(this,e),this.CLASS_NAME="SuperMap.BuffersAnalystJobsParameter"}destroy(){this.datasetName=null,this.bounds=null,this.distance=null,this.distanceField=null,this.distanceUnit=null,this.dissolveField=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},"bounds"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class xt extends et{constructor(e,t){(t=t||{}).EVENT_TYPES=["processCompleted","processFailed","processRunning"],super(e,t),this.CLASS_NAME="SuperMap.ProcessingServiceBase"}destroy(){super.destroy()}getJobs(e){var t=this;Be.get(je.appendCredential(e),null,{proxy:t.proxy}).then(function(e){return e.json()}).then(function(e){t.events.triggerEvent("processCompleted",{result:e})}).catch(function(e){t.eventListeners.processFailed({error:e})})}addJob(e,t,r,s){var i=this,n=null;t&&t instanceof r&&(n=new Object,r.toObject(t,n));let a=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},i.headers||{});var o={proxy:i.proxy,headers:a,withCredentials:i.withCredentials,crossOrigin:i.crossOrigin,isInTheSameDomain:i.isInTheSameDomain};Be.post(je.appendCredential(e),JSON.stringify(n),o).then(function(e){return e.json()}).then(function(e){e.succeed?i.serviceProcessCompleted(e,s):i.serviceProcessFailed(e)}).catch(function(e){i.serviceProcessFailed({error:e})})}serviceProcessCompleted(e,t){e=$.transformResult(e),t=t||1e3;var r=this;if(e)var s=setInterval(function(){Be.get(je.appendCredential(e.newResourceLocation),{_t:(new Date).getTime()}).then(function(e){return e.json()}).then(function(e){r.events.triggerEvent("processRunning",{id:e.id,state:e.state}),"LOST"!==e.state.runState&&"KILLED"!==e.state.runState&&"FAILED"!==e.state.runState||(clearInterval(s),r.events.triggerEvent("processFailed",{error:e.state.errorMsg,state:e.state.runState})),"FINISHED"===e.state.runState&&e.setting.serviceInfo&&(clearInterval(s),r.events.triggerEvent("processCompleted",{result:e}))}).catch(function(e){clearInterval(s),r.events.triggerEvent("processFailed",{error:e})})},t)}serviceProcessFailed(e){super.serviceProcessFailed(e)}}class _t extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(){super.getJobs(this.url)}getBuffersJob(e){super.getJobs($.urlPathAppend(this.url,e))}addBuffersJob(e,t){super.addJob(this.url,e,St,t)}}class wt{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,$.extend(this,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=null}}class Ct extends et{constructor(e,r){super(e,r),this.format=t.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e){var r;(e=$.transformResult(e))&&this.format===t.GEOJSON&&"function"==typeof this.toGeoJSONResult&&(r=this.toGeoJSONResult(e)),r||(r=e),this.events.triggerEvent("processCompleted",{result:r})}toGeoJSONResult(e){return null}}class Tt extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e){if(!(e instanceof wt))return null;var t,r=this;if(r.url=$.urlPathAppend(r.url,"burstAnalyse"),t={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},null!==e.edgeID&&null!==e.nodeID)throw new Error("edgeID and nodeID cannot be null at the same time.");if(null===e.edgeID&&null===e.nodeID)throw new Error("edgeID and nodeID cannot be null at the same time.");null!==e.edgeID?t.edgeID=e.edgeID:t.nodeID=e.nodeID,r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}class Mt extends et{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ChartFeatureInfoSpecsService"}destroy(){super.destroy(),$.reset(this)}processAsync(){var e=this;e.isTempLayers||$.urlPathAppend(e.url,"chartFeatureInfoSpecs"),e.request({method:"GET",params:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class Et{constructor(e){this.isQueryPoint=null,this.isQueryLine=null,this.isQueryRegion=null,this.attributeFilter=null,this.chartFeatureInfoSpecCode=null,$.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryFilterParameter"}destroy(){var e=this;e.isQueryPoint=null,e.isQueryLine=null,e.isQueryRegion=null,e.attributeFilter=null,e.chartFeatureInfoSpecCode=null}toJson(){var e="";return e+='"isQueryPoint":'+this.isQueryPoint+",",e+='"isQueryLine":'+this.isQueryLine+",",e+='"isQueryRegion":'+this.isQueryRegion+",",this.attributeFilter&&(e+='"attributeFilter": "'+this.attributeFilter+'",'),e="{"+(e+='"chartFeatureInfoSpecCode":'+this.chartFeatureInfoSpecCode)+"}"}}class At{constructor(e){this.queryMode=null,this.bounds=null,this.chartLayerNames=null,this.chartQueryFilterParameters=null,this.returnContent=!0,this.startRecord=0,this.expectCount=null,$.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryParameters"}destroy(){var e=this;e.queryMode=null,e.bounds=null,e.chartLayerNames=null,e.chartQueryFilterParameters=null,e.returnContent=!0,e.startRecord=0,e.expectCount=null}getVariablesJson(){var e="";if(e+='"queryMode":"'+this.queryMode+'",',this.chartLayerNames&&this.chartLayerNames.length){for(var t=[],r=this.chartLayerNames.length,s=0;s0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(r+=","),r+=t[e];return r+="]"}}class Rt extends et{constructor(e,t){(t=t||{}).EVENT_TYPES=["broadcastSocketConnected","broadcastSocketClosed","broadcastSocketError","broadcastFailed","broadcastSucceeded","subscribeSocketConnected","subscribeSocketClosed","subscribeSocketError","messageSucceeded","setFilterParamSucceeded"],super(e,t),this.geometry=null,this.prjCoordSys=null,this.excludeField=null,$.extend(this,t),this.CLASS_NAME="SuperMap.DataFlowService"}initBroadcast(){var e=this;return this.broadcastWebSocket=this._connect($.urlPathAppend(e.url,"broadcast")),this.broadcastWebSocket.onopen=function(t){e.broadcastWebSocket.isOpen=!0,t.eventType="broadcastSocketConnected",e.events.triggerEvent("broadcastSocketConnected",t)},this.broadcastWebSocket.onclose=function(t){e.broadcastWebSocket&&(e.broadcastWebSocket.isOpen=!1),t.eventType="broadcastSocketClosed",e.events.triggerEvent("broadcastSocketClosed",t)},this.broadcastWebSocket.onerror=function(t){t.eventType="broadcastSocketError",e.events.triggerEvent("broadcastSocketError",t)},this}broadcast(e){this.broadcastWebSocket&&this.broadcastWebSocket.isOpen?(this.broadcastWebSocket.send(JSON.stringify(e)),this.events.triggerEvent("broadcastSucceeded")):this.events.triggerEvent("broadcastFailed")}initSubscribe(){var e=this;return this.subscribeWebSocket=this._connect($.urlPathAppend(e.url,"subscribe")),this.subscribeWebSocket.onopen=function(t){e.subscribeWebSocket.send(e._getFilterParams()),t.eventType="subscribeSocketConnected",e.events.triggerEvent("subscribeSocketConnected",t)},this.subscribeWebSocket.onclose=function(t){t.eventType="subscribeWebSocketClosed",e.events.triggerEvent("subscribeWebSocketClosed",t)},this.subscribeWebSocket.onerror=function(t){t.eventType="subscribeSocketError",e.events.triggerEvent("subscribeSocketError",t)},this.subscribeWebSocket.onmessage=function(t){e._onMessage(t)},this}setExcludeField(e){return this.excludeField=e,this.subscribeWebSocket.send(this._getFilterParams()),this}setGeometry(e){return this.geometry=e,this.subscribeWebSocket.send(this._getFilterParams()),this}unSubscribe(){this.subscribeWebSocket&&(this.subscribeWebSocket.close(),this.subscribeWebSocket=null)}unBroadcast(){this.broadcastWebSocket&&(this.broadcastWebSocket.close(),this.broadcastWebSocket=null)}destroy(){et.prototype.destroy.apply(this,arguments);this.geometry=null,this.prjCoordSys=null,this.excludeField=null,this.unBroadcast(),this.unSubscribe()}_getFilterParams(){var e={filterParam:{prjCoordSys:this.prjCoordSys,excludeField:this.excludeField,geometry:this.geometry}};return $.toJSON(e)}_onMessage(e){if(e.data&&e.data.indexOf("filterParam")>=0){var t=JSON.parse(e.data);return e.filterParam=t,e.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",e)}var r=JSON.parse(e.data);e.featureResult=r,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}_connect(e){return e=je.appendCredential(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}}class Dt{constructor(e){e=e||{},this.bounds=null,this.dataSourceName=null,this.description=null,this.encodeType=null,this.isReadOnly=null,this.name=null,this.prjCoordSys=null,this.tableName=null,this.type=null,$.extend(this,e);var t=this.bounds;t&&(this.bounds=new se(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y)),this.CLASS_NAME="SuperMap.DatasetInfo"}destroy(){$.reset(this)}toServerJSONObject(){var e={};return(e=$.copyAttributes(e,this)).bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class Gt{constructor(e){this.operation=x.UNION,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.OverlayAnalystParameters"}destroy(){this.operation=null}}class Bt extends Gt{constructor(e){super(e),this.operateDataset=null,this.operateDatasetFields=[],this.operateDatasetFilter=new pt,this.operateRegions=[],this.sourceDataset=null,this.sourceDatasetFields=[],this.sourceDatasetFilter=new pt,this.tolerance=0,this.resultSetting=new dt,$.extend(this,e),this.CLASS_NAME="SuperMap.DatasetOverlayAnalystParameters"}destroy(){super.destroy();var e=this;if(e.operateDataset=null,e.operateDatasetFields=null,e.operateDatasetFilter&&(e.operateDatasetFilter.destroy(),e.operateDatasetFilter=null),e.operateRegions){for(var t=0,r=e.operateRegions,s=r.length;t0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.facilityPathList)return e;var t=new Oe;return e.facilityPathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}class pr{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,$.extend(this,e),this.CLASS_NAME="SuperMap.FindLocationParameters"}destroy(){var e=this;if(e.expectedSupplyCenterCount=null,e.isFromCenter=null,e.turnWeightField=null,e.weightName=null,e.supplyCenters){for(var t=0,r=e.supplyCenters,s=r.length;t0&&(t+=","),t+=$.toJSON(e[s]);return t+="]"}toGeoJSONResult(e){if(!e)return null;var t=new Oe;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class mr{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Nt,$.extend(this,e),this.CLASS_NAME="SuperMap.FindMTSPPathsParameters"}destroy(){var e=this;e.centers=null,e.hasLeastTotalCost=null,e.isAnalyzeById=null,e.nodes=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class yr extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof mr){var t,r=this,s=r.getJson(e.isAnalyzeById,e.centers),i=r.getJson(e.isAnalyzeById,e.nodes);r.url=$.urlPathAppend(r.url,"mtsppath"),t={centers:s,nodes:i,parameter:$.toJSON(e.parameter),hasLeastTotalCost:e.hasLeastTotalCost},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getJson(e,t){var r="[",s=t?t.length:0;if(!1===e)for(let e=0;e0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.pathList)return null;var t=new Oe;return e.pathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}class gr{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new Nt,$.extend(this,e),this.CLASS_NAME="SuperMap.FindPathParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.hasLeastEdgeCount=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class vr extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof gr){var t,r=this;r.url=$.urlPathAppend(r.url,"path"),t={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:$.toJSON(e.parameter),nodes:r.getJson(e.isAnalyzeById,e.nodes)},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getJson(e,t){var r="[",s=t?t.length:0;if(!1===e)for(let e=0;e0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new Oe;return e.pathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}class br{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new Nt,$.extend(this,e),this.CLASS_NAME="SuperMap.FindServiceAreasParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.isCenterMutuallyExclusive=null,e.centers=null,e.isFromCenter=null,e.weights=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class Sr extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e){if(e instanceof br){var t,r=this;r.url=$.urlPathAppend(r.url,"servicearea"),t={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:$.toJSON(e.parameter),centers:r.getJson(e.isAnalyzeById,e.centers),weights:r.getJson(!0,e.weights)},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getJson(e,t){var r="[",s=t?t.length:0;if(!1===e)for(let e=0;e0&&(r+=","),r+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(r+=","),r+=t[e];return r+="]"}toGeoJSONResult(e){if(!e||!e.serviceAreaList)return e;var t=new Oe;return e.serviceAreaList.map(function(e){return e.serviceRegion&&(e.serviceRegion=t.toGeoJSON(e.serviceRegion)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e.routes&&(e.routes=t.toGeoJSON(e.routes)),e}),e}}class xr{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Nt,$.extend(this,e),this.CLASS_NAME="SuperMap.FindTSPPathsParameters"}destroy(){var e=this;e.endNodeAssigned=null,e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class _r extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof xr){var t,r=this;r.url=$.urlPathAppend(r.url,"tsppath"),t={parameter:$.toJSON(e.parameter),endNodeAssigned:e.endNodeAssigned,nodes:r.getNodesJson(e)},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getNodesJson(e){var t,r,s,i,n="";if(!1===e.isAnalyzeById){for(t="[",r=0,s=(i=e.nodes).length;r0&&(t+=","),t+='{"x":'+i[r].x+',"y":'+i[r].y+"}";n+=t+="]"}else if(!0===e.isAnalyzeById){let t="[",r=e.nodes,s=r.length;for(let e=0;e0&&(t+=","),t+=r[e];n+=t+="]"}return n}toGeoJSONResult(e){if(!e||!e.tspPathList)return null;var t=new Oe;return e.tspPathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}class wr{constructor(e){this.routeTable=null,this.routeIDField=null,this.attributeFilter=null,this.eventTable=null,this.eventRouteIDField=null,this.measureField=null,this.measureStartField=null,this.measureEndField=null,this.measureOffsetField=null,this.errorInfoField=null,this.retainedFields=null,this.dataReturnOption=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.GenerateSpatialDataParameters"}destroy(){var e=this;e.routeTable&&(e.routeTable=null),e.routeIDField=null,e.attributeFilter=null,e.eventTable=null,e.eventRouteIDField=null,e.measureField=null,e.measureStartField=null,e.measureEndField=null,e.measureOffsetField=null,e.errorInfoField=null,e.dataReturnOption&&(e.dataReturnOption.destroy(),e.dataReturnOption=null)}}class Cr extends ot{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GenerateSpatialDataService"}destroy(){super.destroy()}processAsync(e){if(e instanceof wr){var t,r=this;t=r.getJsonParameters(e),r.request({method:"POST",data:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getJsonParameters(e){var t="datasets/"+e.routeTable+"/linearreferencing/generatespatialdata";return this.url=$.urlPathAppend(this.url,t),this.url=$.urlAppend(this.url,"returnContent=true"),$.toJSON(e)}}class Tr extends Gt{constructor(e){super(e),e&&e.operateGeometry&&(this.operateGeometry=e.operateGeometry),e&&e.sourceGeometry&&(this.sourceGeometry=e.sourceGeometry),e&&e.operateGeometries&&(this.operateGeometries=e.operateGeometries),e&&e.sourceGeometries&&(this.sourceGeometries=e.sourceGeometries),e&&$.extend(this,e),this.CLASS_NAME="SuperMap.GeometryOverlayAnalystParameters"}destroy(){super.destroy();var e=this;e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.sourceGeometries&&(e.sourceGeometries.destroy(),e.sourceGeometries=null),e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.operateGeometries&&(e.operateGeometries.destroy(),e.operateGeometries=null)}static toObject(e,t){for(var r in e)if("sourceGeometry"===r)t.sourceGeometry=Ae.fromGeometry(e.sourceGeometry);else if("sourceGeometries"===r){for(var s=[],i=0;i=0;e--)this.points[e].destroy();this.points=null}}static toObject(e,t){for(var r in e)"clipRegion"===r?t.clipRegion=Ae.fromGeometry(e.clipRegion):t[r]=e[r]}}class Ar extends et{constructor(e,t){(t=t||{}).EVENT_TYPES=["processCompleted","processFailed","processRunning"],super(e,t),this.CLASS_NAME="SuperMap.GeoprocessingService",this.headers={},this.crossOrigin=!0}getTools(){this._get(`${this.url}/list`)}getTool(e){this._get(`${this.url}/${e}`)}execute(e,t,r){const s={parameter:t=t||null,environment:r=r||null};this._get(`${this.url}/${e}/execute`,s)}submitJob(e,t,r){const s={parameter:t=t||null,environments:r=r||null};this.request({url:`${this.url}/${e}/jobs`,headers:{"Content-type":"application/json"},method:"POST",data:JSON.stringify(s),scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}waitForJobCompletion(e,t,r){const s=this,i=setInterval(function(){s._get(`${s.url}/${t}/jobs/${e}`,null,function(e){const t=e.state.runState;switch(r.statusCallback&&r.statusCallback(t),t){case"FINISHED":clearInterval(i),s.events.triggerEvent("processCompleted",{result:e});break;case"FAILED":case"CANCELED":clearInterval(i),s.events.triggerEvent("processFailed",{result:e})}})},r.interval)}getJobInfo(e,t){this._get(`${this.url}/${e}/jobs/${t}`)}cancelJob(e,t){this._get(`${this.url}/${e}/jobs/${t}/cancel`)}getJobs(e){let t=`${this.url}/jobs`;e&&(t=`${this.url}/${e}/jobs`),this._get(t)}getResults(e,t,r){let s=`${this.url}/${e}/jobs/${t}/results`;r&&(s=`${s}/${r}`),this._get(s)}_get(e,t,r,s){this.request({url:e,method:"GET",params:t,headers:{"Content-type":"application/json"},scope:this,success:r||this.serviceProcessCompleted,failure:s||this.serviceProcessFailed})}}class Or{constructor(e){this.dataset=null,this.sourceFilter=null,this.referenceFilter=null,this.spatialRelationType=null,this.isBorderInside=null,this.returnFeature=null,this.returnGeoRelatedOnly=null,this.startRecord=0,this.expectCount=500,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.GeoRelationAnalystParameters"}destroy(){var e=this;e.sourceFilter&&e.sourceFilter.destroy(),e.sourceFilter=null,e.referenceFilter&&e.referenceFilter.destroy(),e.referenceFilter=null,e.dataset=null,e.spatialRelationType=null,e.isBorderInside=null,e.returnFeature=null,e.returnGeoRelatedOnly=null,e.startRecord=null,e.expectCount=null}}class Pr extends ot{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GeoRelationAnalystService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Or){var t=this;t.url=$.urlPathAppend(t.url,"datasets/"+e.dataset+"/georelation");var r=$.toJSON(e);t.url=$.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class Lr extends et{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,t&&$.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();this.datasource=null,this.dataset=null}getDatasetsService(e){var t=this;t.url=$.urlPathAppend(t.url,`datasources/name/${e}/datasets`),t.request({method:"GET",data:null,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}getDatasetService(e,t){var r=this;r.url=$.urlPathAppend(r.url,`datasources/name/${e}/datasets/name/${t}`),r.request({method:"GET",data:null,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}setDatasetService(e){if(e){var t=$.toJSON(e);this.request({method:"PUT",data:t,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}deleteDatasetService(){this.request({method:"DELETE",data:null,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}class Ir{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnCountOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,$.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class Nr extends Ir{constructor(e){super(e),this.getFeatureMode=Nr.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,$.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsParameters"}destroy(){super.destroy();var e=this;if(e.bounds&&(e.bounds.destroy(),e.bounds=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,s;return r={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},s={datasetNames:e.datasetNames,getFeatureMode:Nr.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new pt).name=e.datasetNames,t.fields=e.fields,s.queryParameter=t),e.attributeFilter&&(s.attributeFilter=e.attributeFilter,s.getFeatureMode=Nr.getFeatureMode.BOUNDS_ATTRIBUTEFILTER),e.maxFeatures&&!isNaN(e.maxFeatures)&&(s.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(s.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(s.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(s.targetPrj=e.targetPrj),e.aggregations&&(s.aggregations=e.aggregations),$.toJSON(s)}}Nr.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class Fr extends et{constructor(e,r){super(e,r),r=r||{},this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=t.GEOJSON,$.extend(this,r),this.url=$.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e){if(e){var t,r=this,s=!0;r.returnContent=e.returnContent,r.fromIndex=e.fromIndex,r.toIndex=e.toIndex,r.maxFeatures=e.maxFeatures,r.hasGeometry=e.hasGeometry,r.returnContent&&(s=!1),null!=r.fromIndex&&null!=r.toIndex&&!isNaN(r.fromIndex)&&!isNaN(r.toIndex)&&r.fromIndex>=0&&r.toIndex>=0&&!s&&(r.url=$.urlAppend(r.url,`fromIndex=${r.fromIndex}&toIndex=${r.toIndex}`)),e.returnCountOnly&&(r.url=$.urlAppend(r.url,"&returnCountOnly="+e.returnContent)),t=r.getJsonParameters(e),r.request({method:"POST",data:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}serviceProcessCompleted(e){if(e=$.transformResult(e),this.format===t.GEOJSON&&e.features){var r=new Oe;e.features=r.toGeoJSON(e.features)}this.events.triggerEvent("processCompleted",{result:e})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class kr extends Fr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return Nr.toJsonParameters(e)}}class Rr extends Ir{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,$.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByBufferParameters"}destroy(){super.destroy();var e=this;if(e.bufferDistance=null,e.attributeFilter=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}static toJsonParameters(e){var t,r,s;return s=Ae.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:s},e.fields&&((t=new pt).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(r.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(r.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(r.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(r.targetPrj=e.targetPrj),$.toJSON(r)}}class Dr extends Fr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Rr)return Rr.toJsonParameters(e)}}class Gr extends Ir{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,$.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryParameters"}destroy(){super.destroy();var e=this;if(e.geometry&&(e.geometry.destroy(),e.geometry=null),e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}static toJsonParameters(e){var t,r,s;return r=Ae.fromGeometry(e.geometry),s={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new pt).name=e.datasetNames,t.fields=e.fields,s.queryParameter=t),e.attributeFilter&&(s.attributeFilter=e.attributeFilter,s.getFeatureMode="SPATIAL_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(s.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(s.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(s.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(s.targetPrj=e.targetPrj),e.aggregations&&(s.aggregations=e.aggregations),$.toJSON(s)}}class Br extends Fr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return Gr.toJsonParameters(e)}}class jr extends Ir{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,$.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,r;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((r=new pt).name=e.datasetNames,r.fields=e.fields,t.queryParameter=r),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),$.toJSON(t)}}class Ur extends Fr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return jr.toJsonParameters(e)}}class Vr extends Ir{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,$.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesBySQLParameters"}destroy(){super.destroy();this.getFeatureMode=null,this.queryParameter&&(this.queryParameter.destroy(),this.queryParameter=null)}static toJsonParameters(e){var t={datasetNames:e.datasetNames,getFeatureMode:"SQL",queryParameter:e.queryParameter};return e.maxFeatures&&!isNaN(e.maxFeatures)&&(t.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(t.hasGeometry=e.hasGeometry),e.aggregations&&(t.aggregations=e.aggregations),e.targetEpsgCode&&(t.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(t.targetPrj=e.targetPrj),e.aggregations&&(t.aggregations=e.aggregations),$.toJSON(t)}}class zr extends Fr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return Vr.toJsonParameters(e)}}class Jr extends et{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&$.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();this.datasource=null,this.dataset=null}processAsync(){var e=this;e.url=$.urlPathAppend(e.url,`datasources/${e.datasource}/datasets/${e.dataset}/fields`),e.request({method:"GET",data:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class qr{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,$.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null}}class Hr extends et{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&$.extend(this,t),this.CLASS_NAME="SuperMap.GetGridCellInfosService"}destroy(){super.destroy();var e=this;e.X=null,e.Y=null,e.datasetName=null,e.dataSourceName=null,e.datasetType=null}processAsync(e){if(e instanceof qr){$.extend(this,e);var t=this;t.url=$.urlPathAppend(t.url,`datasources/${t.dataSourceName}/datasets/${t.datasetName}`),t.queryRequest(t.getDatasetInfoCompleted,t.getDatasetInfoFailed)}}queryRequest(e,t){this.request({method:"GET",data:null,scope:this,success:e,failure:t})}getDatasetInfoCompleted(e){e=$.transformResult(e),this.datasetType=e.datasetInfo.type,this.queryGridInfos()}queryGridInfos(){var e=this;e.url=$.urlPathAppend(e.url,"GRID"==e.datasetType?"gridValue":"imageValue"),null!=e.X&&null!=e.Y&&(e.url=$.urlAppend(e.url,`x=${e.X}&y=${e.Y}`)),e.queryRequest(e.serviceProcessCompleted,e.serviceProcessFailed)}getDatasetInfoFailed(e){this.serviceProcessFailed(e)}}class Wr{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&$.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){this.memoryData&&(this.memoryData.destroy(),this.memoryData=null),this.type=null}toServerJSONObject(){}}class Yr{constructor(e){this.align=y.BASELINECENTER,this.backColor=new Ce(255,255,255),this.foreColor=new Ce(0,0,0),this.backOpaque=!1,this.sizeFixed=!0,this.fontHeight=6,this.fontWidth=0,this.fontWeight=400,this.fontName="Times New Roman",this.bold=!1,this.italic=!1,this.italicAngle=0,this.shadow=!1,this.strikeout=!1,this.outline=!1,this.opaqueRate=0,this.underline=!1,this.rotation=0,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ServerTextStyle"}destroy(){var e=this;e.align=null,e.backColor&&(e.backColor.destroy(),e.backColor=null),e.foreColor&&(e.foreColor.destroy(),e.foreColor=null),e.backOpaque=null,e.sizeFixed=null,e.fontHeight=null,e.fontWidth=null,e.fontWeight=null,e.fontName=null,e.bold=null,e.italic=null,e.italicAngle=null,e.shadow=null,e.strikeout=null,e.outline=null,e.opaqueRate=null,e.underline=null,e.rotation=null}static fromObj(e){var t=new Yr(e);return $.copy(t,e),t.backColor=Ce.fromJson(e.backColor),t.foreColor=Ce.fromJson(e.foreColor),t}}class Xr{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new Yr,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ThemeLabelItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}static fromObj(e){if(e){var t=new Xr;return $.copy(t,e),t}}}class Qr{constructor(e){this.caption=null,this.style=new Te,this.unique=null,this.visible=!0,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ThemeUniqueItem"}destroy(){var e=this;e.caption=null,e.unique=null,e.style&&(e.style.destroy(),e.style=null),e.visible=null}toServerJSONObject(){var e={};return(e=$.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new Qr;return $.copy(t,e),t.style=Te.fromJson(e.style),t}}class Zr{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ThemeOffset"}destroy(){this.offsetFixed=null,this.offsetX=null,this.offsetY=null}static fromObj(e){if(e){var t=new Zr;return $.copy(t,e),t}}}class Kr{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new Yr,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.LabelMixedTextStyle"}destroy(){var e=this;if(e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null),e.separator=null,e.separatorEnabled=null,e.splitIndexes&&(e.splitIndexes=null),e.styles){for(var t=0,r=e.styles,s=r.length;t0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null)}toServerJSONObject(){var e={};if((e=$.copyAttributes(e,this)).defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,s=0;s0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.rangeExpression=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(e){var t=new ps;$.copy(t,e);var r=e.items,s=r?r.length:0;t.items=[];for(var i=0;i0?e[0].subLayers.layers:null)?t.length:0,this.handleLayers(r,t),this.events.triggerEvent("processCompleted",{result:e[0]})}handleLayers(e,t){var r;if(e)for(var s=0;s0)this.handleLayers(t[s].subLayers.layers.length,t[s].subLayers.layers);else switch(t[s].ugcLayerType){case"THEME":(r=new vs).fromJson(t[s]),t[s]=r;break;case"GRID":(r=new bs).fromJson(t[s]),t[s]=r;break;case"IMAGE":(r=new Ss).fromJson(t[s]),t[s]=r;break;case"VECTOR":(r=new xs).fromJson(t[s]),t[s]=r}}}}class ws{constructor(e){e&&(this.bounds=null,this.searchRadius=0,this.zValueFieldName=null,this.zValueScale=1,this.resolution=null,this.filterQueryParameter=null,this.outputDatasetName=null,this.outputDatasourceName=null,this.pixelFormat=null,this.dataset=null,this.inputPoints=null,this.InterpolationAnalystType="dataset",this.clipParam=null,$.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationAnalystParameters")}destroy(){var e=this;e.bounds=null,e.searchRadius=null,e.zValueFieldName=null,e.zValueScale=null,e.resolution=null,e.filterQueryParameter=null,e.outputDatasetName=null,e.pixelFormat=null}static toObject(e,t){for(var r in e)if("inputPoints"===r&&"geometry"===e.InterpolationAnalystType){for(var s=[],i=0;i=200&&e.code<300||0==e.code||304===e.code,r=e.code&&t;!e.code||r?this.events&&this.events.triggerEvent("processCompleted",{result:e}):this.events.triggerEvent("processFailed",{error:e})}}class Ns{constructor(e){e&&(this.dataset=null,this.extractRegion=null,this.expression=null,this.isZip=!1,this.ignoreNoValue=!1,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,$.extend(this,e),this.CLASS_NAME="SuperMap.MathExpressionAnalysisParameters")}destroy(){var e=this;e.dataset=null,e.bounds=null,e.expression=null,e.isZip=!0,e.ignoreNoValue=!0,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var r in e)if("dataset"!==r&&(t[r]=e[r]),"extractRegion"===r&&e[r]){for(var s=e[r].components[0].components,i={},n=[],a=s.length,o=0;o(e.fieldNames=i[s].fieldCaptions,e)),this.format===t.GEOJSON&&(i[s].features=r.toGeoJSON(i[s].features)));this.events.triggerEvent("processCompleted",{result:e})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}getQueryParameters(e){return new Ot({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class Vs extends Us{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof js))return null;var t,r="",s=e.bounds;return t=this.getQueryParameters(e),r+="'queryMode':'BoundsQuery','queryParameters':",r+=$.toJSON(t),r="{"+(r+=",'bounds': {'rightTop':{'y':"+s.top+",'x':"+s.right+"},'leftBottom':{'y':"+s.bottom+",'x':"+s.left+"}}")+"}"}}class zs extends Ot{constructor(e){super(e=e||{}),this.geometry=null,this.isNearest=null,this.returnContent=!0,$.extend(this,e),this.CLASS_NAME="SuperMap.QueryByDistanceParameters"}destroy(){super.destroy();var e=this;e.returnContent=null,e.distance=null,e.isNearest=null,e.geometry&&(e.geometry.destroy(),e.geometry=null)}}class Js extends Us{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof zs){var t="",r=this.getQueryParameters(e),s=Ae.fromGeometry(e.geometry);return t+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",t+=$.toJSON(r),t="{"+(t+=",'geometry':"+$.toJSON(s)+",'distance':"+e.distance)+"}"}}}class qs extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=a.INTERSECT,$.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();this.returnContent=null,this.geometry=null,this.spatialQueryMode=null}}class Hs extends Us{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof qs){var t,r="",s=e.geometry,i=Ae.fromGeometry(s);return t=this.getQueryParameters(e),r+="'queryMode':'SpatialQuery','queryParameters':",r="{"+(r+=$.toJSON(t)+",'geometry':"+$.toJSON(i)+",'spatialQueryMode':"+$.toJSON(e.spatialQueryMode))+"}"}}}class Ws extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,$.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();this.returnContent=null}}class Ys extends Us{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Ws){var t,r="";return t=this.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':",r="{"+(r+=$.toJSON(t))+"}"}}}class Xs{constructor(e){if(!e)return this;this.sourceRoute=null,this.point=null,this.tolerance=null,this.isIgnoreGap=!1,$.extend(this,e),this.CLASS_NAME="SuperMap.RouteCalculateMeasureParameters"}destroy(){var e=this;e.sourceRoute=null,e.point=null,e.tolerance&&(e.tolerance=null),e.isIgnoreGap&&(e.isIgnoreGap=!1)}}class Qs extends ot{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteCalculateMeasureService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Xs){var t,r=this;t=r.getJsonParameters(e),r.request({method:"POST",data:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getJsonParameters(e){return this.url=$.urlPathAppend(this.url,"geometry/calculatemeasure"),this.url=$.urlAppend(this.url,"returnContent=true"),$.toJSON(e)}}class Zs{constructor(e){if(!e)return this;this.sourceRoute=null,this.dataset=null,this.routeIDField=null,this.routeID=null,this.type=null,this.measure=null,this.offset=0,this.isIgnoreGap=!1,this.startMeasure=null,this.endMeasure=null;var t=e.sourceRoute,r={};if(t&&t instanceof Y&&t.components){r.type=t.type,r.parts=t.parts;for(var s=[],i=0,n=t.components.length;i0&&(r+='"subLayers":'+e.toJSON()),r+=',"visible":true,',r+='"name":"'+this.getMapName(this.mapUrl)+'"',r+="}]",t.request({method:"PUT",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}createTempLayerComplete(e){(e=$.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams)}getMapName(e){var t=e;"/"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1));var r=t.lastIndexOf("/");return t.substring(r+1,t.length)}serviceProcessCompleted(e){null!=(e=$.transformResult(e))&&null!=this.lastparams&&(e.newResourceID=this.lastparams.resourceID),this.events.triggerEvent("processCompleted",{result:e})}}class ni{constructor(e){e&&(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=a.CONTAIN,this.output=null,this.mappingParameters=null,$.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class ai extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(){super.getJobs(this.url)}getQueryJob(e){super.getJobs($.urlPathAppend(this.url,e))}addQueryJob(e,t){super.addJob(this.url,e,ni,t)}}class oi{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,$.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){$.reset(this)}}class li extends et{constructor(e,t){super(e,t),t=t||{},$.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),$.reset(this)}processAsync(e){if(e instanceof oi){var t=this;t.url=$.urlPathAppend(t.url,"stops/keyword/"+e.keyWord),t.request({method:"GET",params:{returnPosition:e.returnPosition},scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class hi{constructor(e){e&&(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,$.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class ui extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(){super.getJobs(this.url)}getSummaryAttributesJob(e){super.getJobs($.urlPathAppend(this.url,e))}addSummaryAttributesJob(e,t){super.addJob(this.url,e,hi,t)}}class ci{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=k.AVERAGE,this.fields="",this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,$.extend(this,e),this.CLASS_NAME="SuperMap.SummaryMeshJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.statisticModes=null,this.meshType=null,this.fields=null,this.regionDataset=null,this.type=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"type"!==r?"output"!==r?("SUMMARYMESH"===e.type&&"regionDataset"!==r||"SUMMARYREGION"===e.type&&!s(["meshType","resolution","query"],r))&&(t.analyst=t.analyst||{},"query"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):t.type=e[r]:(t.input=t.input||{},t.input[r]=e[r]);function s(e,t){for(var r=e.length;r--;)if(e[r]===t)return!0;return!1}}}class di extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(){super.getJobs(this.url)}getSummaryMeshJob(e){super.getJobs($.urlPathAppend(this.url,e))}addSummaryMeshJob(e,t){super.addJob(this.url,e,ci,t)}}class pi{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.sumShape=!0,this.query="",this.standardSummaryFields=!1,this.standardFields="",this.standardStatisticModes="",this.weightedSummaryFields=!1,this.weightedFields="",this.weightedStatisticModes="",this.meshType=0,this.resolution=100,this.meshSizeUnit=F.METER,this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,$.extend(this,e),this.CLASS_NAME="SuperMap.SummaryRegionJobParameter")}destroy(){this.datasetName=null,this.sumShape=null,this.regionDataset=null,this.query=null,this.standardSummaryFields=null,this.standardFields=null,this.standardStatisticModes=null,this.weightedSummaryFields=null,this.weightedFields=null,this.weightedStatisticModes=null,this.meshType=null,this.resolution=null,this.meshSizeUnit=null,this.type=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"type"!==r&&"type"!==r?"output"!==r?("SUMMARYREGION"===e.type||"SUMMARYMESH"===e.type&&"regionDataset"!==r)&&(t.analyst=t.analyst||{},"query"===r&&e[r]?t.analyst[r]=e[r].toBBOX():t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):t.type=e[r]:(t.input=t.input||{},t.input[r]=e[r])}}class fi extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(){super.getJobs(this.url)}getSummaryRegionJob(e){super.getJobs($.urlPathAppend(this.url,e))}addSummaryRegionJob(e,t){super.addJob(this.url,e,pi,t)}}class mi{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.SupplyCenter"}destroy(){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null}static fromJson(e){if(e)return new mi({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class yi extends ot{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.SurfaceAnalystService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ut){var t,r=this;t=r.getJsonParameters(e),r.request({method:"POST",data:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}getJsonParameters(e){var t="",r={};if(e instanceof Vt)this.url=$.urlPathAppend(this.url,"datasets/"+e.dataset+"/"+e.surfaceAnalystMethod.toLowerCase()),Vt.toObject(e,r),t=$.toJSON(r);else{if(!(e instanceof Mr))return;this.url=$.urlPathAppend(this.url,"geometry/"+e.surfaceAnalystMethod.toLowerCase()),t=$.toJSON(e)}return this.returnContent=!0,t}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class gi{constructor(e){e&&(this.dataset=null,this.zFactor=1,this.averageCurvatureName=null,this.profileCurvatureName="",this.planCurvatureName="",this.deleteExistResultDataset=!1,$.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationParameters")}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){for(var r in e)"dataset"!==r&&(t[r]=e[r])}}class vi extends ot{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationService"}destroy(){super.destroy()}processAsync(e){var t=this,r={};e instanceof gi&&(t.url=$.urlPathAppend(t.url,"datasets/"+e.dataset+"/terraincalculation/curvature")),gi.toObject(e,r);var s=$.toJSON(r);t.url=$.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:s,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}class bi{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new Te,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ThemeFlow"}destroy(){var e=this;e.flowEnabled=null,e.leaderLineDisplayed=null,e.leaderLineStyle&&(e.leaderLineStyle.destroy(),e.leaderLineStyle=null)}static fromObj(e){if(e){var t=new bi;return $.copy(t,e),t.leaderLineStyle=Te.fromJson(e.leaderLineStyle),t}}}class Si{constructor(e){this.caption=null,this.color=new Ce,this.end=0,this.start=0,this.visible=!0,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRangeItem"}destroy(){var e=this;e.caption=null,e.end=null,e.start=null,e.color&&(e.color.destroy(),e.color=null),e.visible=null}toServerJSONObject(){var e={};return(e=$.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(e){var t=new Si;return $.copy(t,e),t.color=Ce.fromJson(e.color),t}}}class xi extends Wr{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=f.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=m.YELLOW_RED,this.reverseColor=!1,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ThemeGridRange"}destroy(){super.destroy();var e=this;if(e.items){if(e.items.length>0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.reverseColor=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}static fromObj(e){if(e){var t=new xi;$.copy(t,e);var r=e.items,s=r?r.length:0;t.items=[];for(var i=0;i0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.defaultcolor&&(e.defaultcolor.destroy(),e.defaultcolor=null)}toServerJSONObject(){var e={};if((e=$.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,s=0;s0&&(1===i.length?r+="'displayFilter':\""+i[0]+'",':r+="'displayFilter':\""+i[a]+'",'),(n=e.displayOrderBy)&&n.length>0&&(1===n.length?r+="'displayOrderBy':'"+n[0]+"',":r+="'displayOrderBy':'"+n[a]+"',"),(t=e.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+$.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[a]&&(r+="'joinItems':["+$.toJSON(e.joinItems[a])+"],"),e.datasetNames&&e.dataSourceNames){var l=e.datasetNames[a]?a:e.datasetNames.length-1,h=e.dataSourceNames[a]?a:e.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+e.datasetNames[l]+"','dataSourceName': '"+e.dataSourceNames[h]+"'}},"}else r+="},"}e.themes&&e.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var u=this.url.split("/");return r+="'name': '"+u[u.length-2]+"'}]"}}class Ei extends ot{constructor(e,t){super(e,t),this.mode=null,t&&$.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t={},r=this;e instanceof Jt?(r.mode="datasets",r.url=$.urlPathAppend(r.url,"datasets/"+e.dataset+"/thiessenpolygon"),Jt.toObject(e,t)):e instanceof Er&&(r.mode="geometry",r.url=$.urlPathAppend(r.url,"geometry/thiessenpolygon"),Er.toObject(e,t));var s=$.toJSON(t);this.returnContent=!0,r.request({method:"POST",data:s,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ai extends ot{constructor(e,t){super(e,t),t&&$.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e){var t=this;t.url=$.urlPathAppend(t.url,"geometry/batchanalyst"),t.url=$.urlAppend(t.url,"returnContent=true&ignoreAnalystParam=true");var r=t._processParams(e),s=$.toJSON(r);t.request({method:"POST",data:s,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}_processParams(e){var t=this;if($.isArray(e)){var r=[];return e.map(function(e){return r.push(t._toJSON(e)),e}),r}}_toJSON(e){var t={};if("buffer"===e.analystName)t.analystName="buffer",t.param={},mt.toObject(e.param,t.param);else if("overlay"===e.analystName)t.analystName="overlay",t.param={},Tr.toObject(e.param,t.param);else if("interpolationDensity"===e.analystName)t.analystName="interpolationDensity",t.param={},ws.toObject(e.param,t.param);else if("interpolationidw"===e.analystName)t.analystName="interpolationidw",t.param={},ws.toObject(e.param,t.param);else if("interpolationRBF"===e.analystName)t.analystName="interpolationRBF",t.param={},ws.toObject(e.param,t.param);else if("interpolationKriging"===e.analystName)t.analystName="interpolationKriging",t.param={},ws.toObject(e.param,t.param);else{if("thiessenpolygon"!==e.analystName)return e;t.analystName="thiessenpolygon",t.param={},Er.toObject(e.param,t.param)}return t}destroy(){super.destroy()}}class Oi extends et{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(){if(this.url){var e=this;e.url=$.urlPathAppend(e.url,"tilesets"),e.request({method:"GET",scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}}class Pi{constructor(e){e&&(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=D.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,$.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Li extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(){super.getJobs(this.url)}getTopologyValidatorJob(e){super.getJobs($.urlPathAppend(this.url,e))}addTopologyValidatorJob(e,t){super.addJob(this.url,e,Pi,t)}}class Ii{constructor(e){e=e||{},this.lineID=null,this.lineName=null,this.lineAliasName=null,this.startStopIndex=null,this.startStopName=null,this.startStopAliasName=null,this.endStopIndex=null,this.endStopName=null,this.endStopAliasName=null,$.extend(this,e),this.CLASS_NAME="SuperMap.TransferLine"}destroy(){$.reset(this)}static fromJson(e){if(e)return new Ii({lineID:e.lineID,lineName:e.lineName,lineAliasName:e.lineAliasName,startStopIndex:e.startStopIndex,startStopName:e.startStopName,startStopAliasName:e.startStopAliasName,endStopIndex:e.endStopIndex,endStopName:e.endStopName,endStopAliasName:e.endStopAliasName})}}class Ni{constructor(e){e=e||{},this.transferLines=null,this.points=null,$.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){$.reset(this)}static toJson(e){if(e)return $.toJSON(e)}}class Fi extends et{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ni){var t,r=this;r.url=$.urlPathAppend(r.url,"path"),t={points:$.toJSON(e.points),transferLines:$.toJSON(e.transferLines)},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class ki{constructor(e){e=e||{},this.solutionCount=6,this.transferPreference=A.NONE,this.transferTactic=E.LESS_TIME,this.walkingRatio=null,this.points=!1,this.evadeLines=null,this.evadeStops=null,this.priorLines=null,this.priorStops=null,this.travelTime=null,$.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){$.reset(this)}static toJson(e){if(e)return $.toJSON(e)}}class Ri extends et{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ki){var t,r=this;r.url=$.urlPathAppend(r.url,"solutions"),t={points:$.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(t.evadeLines=$.toJSON(e.evadeLines)),e.evadeStops&&(t.evadeStops=$.toJSON(e.evadeStops)),e.priorLines&&(t.priorLines=$.toJSON(e.priorLines)),e.priorStops&&(t.priorStops=$.toJSON(e.priorStops)),e.travelTime&&(t.travelTime=e.travelTime),r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class Di{constructor(e){e&&(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",$.extend(this,e),this.CLASS_NAME="SuperMap.UpdateEdgeWeightParameters")}destroy(){this.edgeId=null,this.fromNodeId=null,this.toNodeId=null,this.weightField=null,this.edgeWeight=null}}class Gi{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){this.datasourceName=null,this.datasetName=null,this.datasetType=null}}class Bi extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Di){var t=this,r=t.parse(e);t.url=$.urlPathAppend(t.url,r);var s=e.edgeWeight?e.edgeWeight:null;t.request({method:"PUT",scope:t,data:s,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}parse(e){if(e){var t="";for(var r in e)if(""!==e[r]&&"edgeWeight"!==e[r])switch(r){case"edgeId":t+="/edgeweight/"+e[r];break;case"fromNodeId":t+="/fromnode/"+e[r];break;case"toNodeId":t+="/tonode/"+e[r];break;case"weightField":t+="/weightfield/"+e[r]}return t}}}class ji{constructor(e){e&&(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",$.extend(this,e),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightParameters")}destroy(){this.nodeId=null,this.fromEdgeId=null,this.toEdgeId=null,this.weightField=null,this.turnNodeWeight=null}}class Ui extends Ct{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ji){var t=this,r=t.parse(e);t.url=$.urlPathAppend(t.url,r);var s=e.turnNodeWeight?e.turnNodeWeight:null;t.request({method:"PUT",scope:t,data:s,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}parse(e){if(e){var t="";for(var r in e)if(""!==e[r]&&"turnNodeWeight"!==e[r])switch(r){case"nodeId":t+="/turnnodeweight/"+e[r];break;case"fromEdgeId":t+="/fromedge/"+e[r];break;case"toEdgeId":t+="/toedge/"+e[r];break;case"weightField":t+="/weightfield/"+e[r]}return t}}}class Vi{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.isFileCache=null,this.description=null,this.prjCoordSys=null,this.charset=null,this.palette=null,this.noValue=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.UpdateDatasetParameters")}destroy(){var e=this;e.datasourceName=null,e.datasetName=null,e.isFileCache=null,e.prjCoordSys=null,e.charset=null,e.palette=null,e.noValue=null}}class zi{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=I.CLIP,this.output=null,this.mappingParameters=null,$.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof vt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof bt&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==r?(t.analyst=t.analyst||{},t.analyst[r]=e[r],"mappingParameters"===r&&(t.analyst[r]=t.analyst[r]||{},t.analyst.mappingParameters=e[r])):(t.output=t.output||{},t.output=e[r]):(t.input=t.input||{},t.input[r]=e[r])}}class Ji extends xt{constructor(e,t){super(e,t),this.url=$.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(){super.getJobs(this.url)}getVectorClipJob(e){super.getJobs($.urlPathAppend(this.url,e))}addVectorClipJob(e,t){super.addJob(this.url,e,zi,t)}}class qi{constructor(e){e=e||{},this.type=null,$.extend(this,e),this.CLASS_NAME="SuperMap.RasterFunctionParameter"}destroy(){this.type=null}}class Hi{constructor(e){this.name=null,this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobCustomItems",$.extend(this,e)}destroy(){this.name=null,this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={name:this.name};return this.title&&(e.title=this.title),this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),$.toJSON(e)}}class Wi{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobImage",$.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl&&(e.picAsUrl=this.picAsUrl),this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),$.toJSON(e)}}class Yi{constructor(e){this.name=null,this.layerType=null,this.url=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayers",$.extend(this,e)}destroy(){this.name=null,this.layerType=null,this.url=null}}class Xi{constructor(e){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers=null,this.customItems=null,this.CLASS_NAME="SuperMap.WebPrintingJobLegendOptions",$.extend(this,e)}destroy(){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers instanceof Yi&&(this.layers.destroy(),this.layers=null),this.customItems instanceof Hi&&(this.customItems.destroy(),this.customItems=null)}toJSON(){var e={title:this.title||""};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64?e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,""):this.customItems&&(e.customItems=this.customItems),$.toJSON(e)}}class Qi{constructor(e){this.center=null,this.scale=null,this.layerNames=null,this.image=null,this.layers=null,this.CLASS_NAME="SuperMap.WebPrintingJobLittleMapOptions",$.extend(this,e)}destroy(){this.center=null,this.scale=null,this.layerNames=null,this.image instanceof Wi&&(this.image.destroy(),this.image=null),this.layers instanceof Yi&&(this.layers.destroy(),this.layers=null)}toJSON(){var e={scale:this.scale,center:this.center};return this.layerNames?e.layerNames=this.layerNames:this.layers&&(e.layers=this.layers),this.image&&(e.image=this.image),$.toJSON(e)}}class Zi{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobNorthArrowOptions",$.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),$.toJSON(e)}}class Ki{constructor(e){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null,this.CLASS_NAME="SuperMap.WebPrintingJobScaleBarOptions",$.extend(this,e)}destroy(){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null}toJSON(){var e={scaleText:this.scaleText||"",type:this.type||"BAR",intervals:this.intervals||"",unit:this.unit||"METER"};return this.orientation&&(e.orientation=this.orientation),$.toJSON(e)}}class $i{constructor(e){this.type=null,this.url=null,this.token=null,this.value=null,this.CLASS_NAME="SuperMap.WebPrintingJobContent",$.extend(this,e)}destroy(){this.type="WEBMAP",this.url=null,this.token=null,this.value=null}toJSON(){var e={type:this.type};return this.token&&(e.token=this.token),this.url?e.url=this.url:this.value&&(e.value=this.value),$.toJSON(e)}}class en{constructor(e){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions=null,this.northArrowOptions=null,this.littleMapOptions=null,this.legendOptions=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayoutOptions",$.extend(this,e)}destroy(){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions instanceof Ki&&(this.scaleBarOptions.destroy(),this.scaleBarOptions=null),this.northArrowOptions instanceof Zi&&(this.northArrowOptions.destroy(),this.northArrowOptions=null),this.littleMapOptions instanceof Qi&&(this.littleMapOptions.destroy(),this.littleMapOptions=null),this.legendOptions instanceof Xi&&(this.legendOptions.destroy(),this.legendOptions=null)}toJSON(){var e={templateName:this.templateName,title:this.title,subTitle:this.subTitle,author:this.author,copyright:this.copyright};return this.scaleBarOptions&&(e.scaleBarOptions=this.scaleBarOptions),this.northArrowOptions&&(e.northArrowOptions=this.northArrowOptions),this.littleMapOptions&&(e.littleMapOptions=this.littleMapOptions),this.legendOptions&&(e.legendOptions=this.legendOptions),$.toJSON(e)}}class tn{constructor(e){this.format=null,this.dpi=96,this.scale=null,this.rotation=null,this.center=null,this.CLASS_NAME="SuperMap.WebPrintingJobExportOptions",$.extend(this,e)}destroy(){this.format=null,this.dpi=null,this.scale=null,this.rotation=null,this.center=null,this.outputSize=null}toJSON(){var e={format:this.format||"PDF",dpi:this.dpi,scale:this.scale,center:this.center};return this.rotation&&(e.rotation=this.rotation),this.outputSize&&(e.outputSize=this.outputSize),$.toJSON(e)}}class rn extends et{constructor(e,t){super(e,t),t&&$.extend(this,t),this.CLASS_NAME="SuperMap.WebPrintingService",this.url}destroy(){super.destroy()}createWebPrintingJob(e){if(e){e.layoutOptions&&e.layoutOptions.legendOptions&&(!e.layoutOptions.legendOptions.title&&(e.layoutOptions.legendOptions.title=""),e.layoutOptions.legendOptions.picAsBase64=e.layoutOptions.legendOptions.picAsBase64&&e.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/,""),e.layoutOptions.legendOptions.customItems&&e.layoutOptions.legendOptions.customItems.hasOwnProperty("picAsBase64")&&(e.layoutOptions.legendOptions.customItems.picAsBase64=e.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/,"")));var t=this;t.request({url:t._processUrl("jobs"),method:"POST",data:$.toJSON(e),scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}getPrintingJob(e){var t=this,r=t._processUrl(`jobs/${e}`);t.request({url:r,method:"GET",scope:t,success:function(e){t.rollingProcess(e,r)},failure:t.serviceProcessFailed})}getPrintingJobResult(e){var t=this;t.request({url:t._processUrl(`jobs/${e}/result`),method:"GET",scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}getLayoutTemplates(){var e=this;e.request({url:e._processUrl("layouts"),method:"GET",scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}rollingProcess(e,t){var r=this;if(e)var s=setInterval(function(){r.request({url:t,method:"GET",scope:r,success:function(e){switch(e.status){case"FINISHED":clearInterval(s),r.serviceProcessCompleted(e);break;case"ERROR":clearInterval(s),r.serviceProcessFailed(e);break;case"RUNNING":r.events.triggerEvent("processRunning",e)}},failure:r.serviceProcessFailed})},1e3)}_processUrl(e){return e?$.urlPathAppend(this.url,e):this.url}}class sn extends et{constructor(e,t){super(e,t),this.options=t||{},t&&$.extend(this,t),this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e){var t={collectionId:this.options.collectionId},r=$.convertPath("/collections/{collectionId}/legend",t),s=$.urlPathAppend(this.url,r);this.request({method:"GET",url:s,params:e,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}getStatistics(){var e={collectionId:this.options.collectionId},t=$.convertPath("/collections/{collectionId}/statistics",e),r=$.urlPathAppend(this.url,t);this.request({method:"GET",url:r,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}getTileInfo(){var e={collectionId:this.options.collectionId},t=$.convertPath("/collections/{collectionId}/tileInfo",e),r=$.urlPathAppend(this.url,t);this.request({method:"GET",url:r,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}deleteItemByID(e){var t={collectionId:this.options.collectionId,featureId:e},r=$.convertPath("/collections/{collectionId}/items/{featureId}",t),s=$.urlPathAppend(this.url,r);this.request({method:"DELETE",url:s,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}getItemByID(e){var t={collectionId:this.options.collectionId,featureId:e},r=$.convertPath("/collections/{collectionId}/items/{featureId}",t),s=$.urlPathAppend(this.url,r);this.request({method:"GET",url:s,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}class nn extends et{constructor(e,t){super(e,t),this.options=t||{},t&&$.extend(this,t),this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(){var e=$.convertPath("/collections"),t=$.urlPathAppend(this.url,e);this.request({method:"GET",url:t,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}getCollectionByID(e){var t={collectionId:e},r=$.convertPath("/collections/{collectionId}",t),s=$.urlPathAppend(this.url,r);this.request({method:"GET",url:s,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}search(e){var t={...e||{}},r=$.convertPath("/search"),s=$.urlPathAppend(this.url,r);this.request({method:"POST",url:s,data:t,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}class an{constructor(e){this.include=void 0,this.exclude=void 0,this.CLASS_NAME="SuperMap.FieldsFilter",$.extend(this,e)}destroy(){this.include=void 0,this.exclude=void 0}static constructFromObject(e,t){return e&&(t=t||new an,e.hasOwnProperty("include")&&(t.include=e.include),e.hasOwnProperty("exclude")&&(t.exclude=e.exclude)),t}}class on{constructor(e){this.field=void 0,this.direction=on.Direction.ASC,this.CLASS_NAME="SuperMap.Sortby",$.extend(this,e)}destroy(){this.field=void 0,this.direction="ASC"}static constructFromObject(e,t){return e&&(t=t||new on,e.hasOwnProperty("field")&&(t.field=e.field),e.hasOwnProperty("direction")&&(t.direction=e.direction)),t}}on.Direction={ASC:"ASC",DESC:"DESC"};class ln{constructor(e){this.bbox=void 0,this.collections=void 0,this.ids=void 0,this.limit=void 0,this.fields=void 0,this.query=void 0,this.sortby=void 0,this.CLASS_NAME="SuperMap.ImageSearchParameter",$.extend(this,e)}destroy(){var e=this;e.bbox=void 0,e.collections=void 0,e.ids=void 0,e.limit=void 0,e.fields=void 0,e.query=void 0,e.sortby=void 0}static constructFromObject(e,t){return e&&(t=t||new ln,e.hasOwnProperty("bbox")&&(t.bbox=e.bbox),e.hasOwnProperty("collections")&&(t.collections=e.collections),e.hasOwnProperty("ids")&&(t.ids=e.ids),e.hasOwnProperty("limit")&&(t.limit=e.limit),e.hasOwnProperty("fields")&&(t.fields=an.constructFromObject&&an.constructFromObject(e.fields,{})||e.fields),e.hasOwnProperty("query")&&(t.query=e.query),e.hasOwnProperty("sortby")&&(t.sortby=e.sortby,e.sortby&&(t.sortby=e.sortby.map(e=>on.constructFromObject&&on.constructFromObject(e,{})||e)))),t}}class hn{constructor(e){this.stretchType=void 0,this.stdevCoefficient=void 0,this.gaussianCoefficient=void 0,this.useMedianValue=void 0,this.minPercent=void 0,this.maxPercent=void 0,this.CLASS_NAME="SuperMap.ImageStretchOption",$.extend(this,e)}destroy(){var e=this;e.stretchType=void 0,e.stdevCoefficient=void 0,e.gaussianCoefficient=void 0,e.useMedianValue=void 0,e.minPercent=void 0,e.maxPercent=void 0}static constructFromObject(e,t){return e&&(t=t||new hn,e.hasOwnProperty("stretchType")&&(t.stretchType=e.stretchType),e.hasOwnProperty("stdevCoefficient")&&(t.stdevCoefficient=e.stdevCoefficient),e.hasOwnProperty("gaussianCoefficient")&&(t.gaussianCoefficient=e.gaussianCoefficient),e.hasOwnProperty("useMedianValue")&&(t.useMedianValue=e.useMedianValue),e.hasOwnProperty("minPercent")&&(t.minPercent=e.minPercent),e.hasOwnProperty("maxPercent")&&(t.maxPercent=e.maxPercent)),t}}hn.StretchType={NONE:"NONE",GAUSSIAN:"GAUSSIAN",PERCENTCLIP:"PERCENTCLIP",MINIMUMMAXIMUM:"MINIMUMMAXIMUM",STANDARDDEVIATION:"STANDARDDEVIATION"};class un{constructor(e){this.displayMode=void 0,this.displayBands=void 0,this.stretchOption=void 0,this.interpolationMode=void 0,this.colorScheme=void 0,this.colorTable=void 0,this.brightness=void 0,this.contrast=void 0,this.noData=void 0,this.noDataColor=void 0,this.noDataTransparent=void 0,this.backgroundValue=void 0,this.backgroundColor=void 0,this.backgroundTransparent=void 0,this.gridFunctions=void 0,this.CLASS_NAME="SuperMap.ImageRenderingRule",$.extend(this,e)}destroy(){var e=this;e.displayMode=void 0,e.displayBands=void 0,e.stretchOption=void 0,e.interpolationMode=void 0,e.colorScheme=void 0,e.colorTable=void 0,e.brightness=void 0,e.contrast=void 0,e.noData=void 0,e.noDataColor=void 0,e.noDataTransparent=void 0,e.backgroundValue=void 0,e.backgroundColor=void 0,e.backgroundTransparent=void 0,e.gridFuncOptions=void 0}static constructFromObject(e,t){return e&&(t=t||new un,e.hasOwnProperty("displayMode")&&(t.displayMode=e.displayMode),e.hasOwnProperty("displayBands")&&(t.displayBands=e.displayBands),e.hasOwnProperty("stretchOption")&&(t.stretchOption=hn.constructFromObject&&hn.constructFromObject(e.stretchOption,{})||e.stretchOption),e.hasOwnProperty("interpolationMode")&&(t.interpolationMode=e.interpolationMode),e.hasOwnProperty("colorScheme")&&(t.colorScheme=e.colorScheme),e.hasOwnProperty("colorTable")&&(t.colorTable=e.colorTable),e.hasOwnProperty("brightness")&&(t.brightness=e.brightness),e.hasOwnProperty("contrast")&&(t.contrast=e.contrast),e.hasOwnProperty("noData")&&(t.noData=e.noData),e.hasOwnProperty("noDataColor")&&(t.noDataColor=e.noDataColor),e.hasOwnProperty("backgroundValue")&&(t.backgroundValue=e.backgroundValue),e.hasOwnProperty("noDataTransparent")&&(t.noDataTransparent=e.noDataTransparent),e.hasOwnProperty("backgroundColor")&&(t.backgroundColor=e.backgroundColor),e.hasOwnProperty("backgroundTransparent")&&(t.backgroundTransparent=e.backgroundTransparent),e.hasOwnProperty("gridFunctions")&&(t.gridFunctions=e.gridFunctions)),t}}un.DisplayMode={COMPOSITE:"COMPOSITE",STRETCHED:"Stretched"},un.InterpolationMode={NEARESTNEIGHBOR:"NEARESTNEIGHBOR",HIGHQUALITYBILINEAR:"HIGHQUALITYBILINEAR",DEFAULT:"DEFAULT"};class cn{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",$.extend(this,e)}destroy(){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new cn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class dn{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",$.extend(this,e)}destroy(){this.girdFuncName="GFAspect",this.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new dn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class pn{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",$.extend(this,e)}destroy(){this.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new pn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class fn{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",$.extend(this,e)}destroy(){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new fn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class mn{constructor(e){e=e||{},$.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,r,s={}){return t=je.appendCredential(t),s.crossOrigin=this.options.crossOrigin,s.headers=this.options.headers,Be.commit(e,t,r,s).then(function(e){return e.json()})}}class yn extends mn{constructor(e,t){super(e),t=t||{},this.MD5=null,this.type=null,this.userName=null,this.fileName=null,this.size=null,this.serviceStatus=null,this.serviceId=null,this.id=null,this.lastModfiedTime=null,this.status=null,this.storageId=null,this.publishInfo=null,this.authorizeSetting=null,this.nickname=null,this.tags=[],this.description=null,this.dataItemServices=null,this.coordType=null,this.dataCheckResult=null,this.dataMetaInfo=null,this.thumbnail=null,$.extend(this,t),this.id&&(this.serviceUrl=e+"/"+this.id),this.CLASS_NAME="SuperMap.OnlineData"}load(){if(this.serviceUrl){var e=this;return e.request("GET",this.serviceUrl).then(function(t){$.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}const gn=function(){try{return elasticsearch}catch(e){return{}}}();var vn=r.n(gn);class bn{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Util"}clone(e){var t=this.BUILTIN_OBJECT;if("object"==typeof e&&null!==e){var r=e;if(e instanceof Array){r=[];for(var s=0,i=e.length;sn&&(n=e+o+100,s.width=n,r=!0),t+l>a&&(a=t+l+100,s.height=a,r=!0),e<-o&&(n+=o=100*Math.ceil(-e/100),s.width=n,r=!0),t<-l&&(a+=l=100*Math.ceil(-t/100),s.height=a,r=!0),r&&i.translate(o,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,s=e.length;r1)for(var i=0,n=s-1;i1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}toArray(e){(e=this.trim(e)).indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,function(e){r<3?e|=0:e=+e,t[r++]=e}),t}convert(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),s=r[3];return void 0===s&&(s=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=s,this.toColor(r,t)}toRGBA(e){return this.convert(e,"rgba")}toRGB(e){return this.convert(e,"rgb")}toHex(e){return this.convert(e,"hex")}toHSVA(e){return this.convert(e,"hsva")}toHSV(e){return this.convert(e,"hsv")}toHSBA(e){return this.convert(e,"hsba")}toHSB(e){return this.convert(e,"hsb")}toHSLA(e){return this.convert(e,"hsla")}toHSL(e){return this.convert(e,"hsl")}toName(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}trim(e){return String(e).replace(/\s+/g,"")}normalize(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,r=(240&e)<<4,s=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(s<<4)+s).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var s=this.getData(e),i=0;i<3;i++)s[i]=1===r?s[i]*(1-t)|0:(255-s[i])*t+s[i]|0;return"rgb("+s.join(",")+")"}reverse(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,function(e){return 255-e}),this.toColor(t,"rgb")}mix(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===r&&(r=.5);for(var s=2*(r=1-this.adjust(r,[0,1]))-1,i=this.getData(this.toRGBA(e)),n=this.getData(this.toRGBA(t)),a=i[3]-n[3],o=((s*a==-1?s:(s+a)/(1+s*a))+1)/2,l=1-o,h=[],u=0;u<3;u++)h[u]=i[u]*o+n[u]*l;var c=i[3]*r+n[3]*(1-r);return c=Math.max(0,Math.min(1,c)),1===i[3]&&1===n[3]?this.toColor(h,"rgb"):(h[3]=c,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(e){var t,r,s=(e=this.normalize(e)).match(this.colorRegExp);if(null===s)throw new Error("The color format error");var i,n=[];if(s[2])i=[(t=s[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],n=this.map(i,function(e){return Sn.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(s[4]){var a=s[4].split(",");r=a[3],i=a.slice(0,3),n=this.map(i,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),Sn.prototype.adjust.call(this,e,[0,255])}),void 0!==r&&n.push(this.adjust(parseFloat(r),[0,1]))}else if(s[5]||s[6]){var o=(s[5]||s[6]).split(","),l=parseInt(o[0],0)/360,h=o[1],u=o[2];r=o[3],(n=this.map([h,u],function(e){return Sn.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==r&&n.push(this.adjust(parseFloat(r),[0,1]))}return n}alpha(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}map(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,s=0;s=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||"string"==typeof e}_HSV_2_RGB(e){var t,r,s,i=e[0],n=e[1],a=e[2];if(0===n)t=255*a,r=255*a,s=255*a;else{var o=6*i;6===o&&(o=0);var l=0|o,h=a*(1-n),u=a*(1-n*(o-l)),c=a*(1-n*(1-(o-l))),d=0,p=0,f=0;0===l?(d=a,p=c,f=h):1===l?(d=u,p=a,f=h):2===l?(d=h,p=a,f=c):3===l?(d=h,p=u,f=a):4===l?(d=c,p=h,f=a):(d=a,p=h,f=u),t=255*d,r=255*p,s=255*f}return[t,r,s]}_HSL_2_RGB(e){var t,r,s,i=e[0],n=e[1],a=e[2];if(0===n)t=255*a,r=255*a,s=255*a;else{var o,l=2*a-(o=a<.5?a*(1+n):a+n-n*a);t=255*this._HUE_2_RGB(l,o,i+1/3),r=255*this._HUE_2_RGB(l,o,i),s=255*this._HUE_2_RGB(l,o,i-1/3)}return[t,r,s]}_HUE_2_RGB(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}_RGB_2_HSB(e){var t,r,s=e[0]/255,i=e[1]/255,n=e[2]/255,a=Math.min(s,i,n),o=Math.max(s,i,n),l=o-a,h=o;if(0===l)t=0,r=0;else{r=l/o;var u=((o-s)/6+l/2)/l,c=((o-i)/6+l/2)/l,d=((o-n)/6+l/2)/l;s===o?t=d-c:i===o?t=1/3+u-d:n===o&&(t=2/3+c-u),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,h*=100]}_RGB_2_HSL(e){var t,r,s=e[0]/255,i=e[1]/255,n=e[2]/255,a=Math.min(s,i,n),o=Math.max(s,i,n),l=o-a,h=(o+a)/2;if(0===l)t=0,r=0;else{r=h<.5?l/(o+a):l/(2-o-a);var u=((o-s)/6+l/2)/l,c=((o-i)/6+l/2)/l,d=((o-n)/6+l/2)/l;s===o?t=d-c:i===o?t=1/3+u-d:n===o&&(t=2/3+c-u),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,h*=100]}}var xn=new Sn;class _n{static createCanvas(e,t){var r=document.createElement("canvas");return r.height=e,r.width=t,r.getContext("2d")}static getLinearGradient(e,t,r,s,i){this._ctx||(this._ctx=this.getContext());for(var n=this._ctx.createLinearGradient(e,t,r,s),a=i.length,o=1/(a-1),l=0,h=0;h=t)if("RANGE"===r)for(i=0;i=0&&this.getSqrtInterval(e,r)}if("logarithm"===t){return this.getMin(e)>0&&this.getGeometricProgression(e,r)}}static getSum(e){return this.getInstance(e).sum()}static getMax(e){return this.getInstance(e).max()}static getMin(e){return this.getInstance(e).min()}static getMean(e){return this.getInstance(e).mean()}static getMedian(e){return this.getInstance(e).median()}static getTimes(e){return e.length}static getEqInterval(e,t){return this.getInstance(e).getClassEqInterval(t)}static getJenks(e,t){return this.getInstance(e).getClassJenks(t)}static getSqrtInterval(e,t){return e=e.map(function(e){return Math.sqrt(e)}),this.getInstance(e).getClassEqInterval(t).map(function(e){return e*e})}static getGeometricProgression(e,t){return this.getInstance(e).getClassGeometricProgression(t)}}var Cn=function(e){var t;if(e===l.METER)t=1;else if(e===l.DEGREE)t=2*Math.PI*6378137/360;else if(e===l.KILOMETER)t=.001;else if(e===l.INCH)t=1/.025399999918;else{if(e!==l.FOOT)return t;t=.3048}return t};function Tn(e,t,r){return 1/(e*t*(1/.0254)*Cn(r))}function Mn(e,t){const r=[];return function(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}(e,t)&&(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]l&&(o[s]=o[s].slice(r-l),l=r)}function f(e){var i,n,a,u;if(e instanceof Function)return e.call(h.parsers);if("string"==typeof e)i=t.charAt(r)===e?e:null,n=1,p();else{if(p(),!(i=e.exec(o[s])))return null;n=i[0].length}if(i){var c=r+=n;for(u=r+o[s].length-n;r=0&&"\n"!==s.charAt(o);o--)r.column++;return new Error([r.filename,r.line,r.column,r.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},h={parse:function(i){var n,h=null;if(r=s=l=a=0,o=[],t=i.replace(/\r\n/g,"\n"),e.filename&&(u.env.inputs[e.filename]=t),o=function(e){for(var r,s,i,n,a=0,o=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,l=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,u=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,c=0,d=e[0],p=0;p0?"missing closing `}`":"missing opening `{`"}),e.map(function(e){return e.join("")})}([[]]),h)throw m(h);var c=function(e,t){var r=e.specificity,s=t.specificity;return r[0]!=s[0]?s[0]-r[0]:r[1]!=s[1]?s[1]-r[1]:r[2]!=s[2]?s[2]-r[2]:s[3]-r[3]};return(n=new On.Tree.Ruleset([],f(this.parsers.primary))).root=!0,n.toList=function(e){e.error=function(t){e.errors||(e.errors=new Error("")),e.errors.message?e.errors.message+="\n"+m(t).message:e.errors.message=m(t).message},e.frames=e.frames||[];var t=this.flatten([],[],e);return t.sort(c),t},n},parsers:{primary:function(){for(var e,t=[];(e=f(this.rule)||f(this.ruleset)||f(this.comment))||f(/^[\s\n]+/)||(e=f(this.invalid));)e&&t.push(e);return t},invalid:function(){var e=f(/^[^;\n]*[;\n]/);if(e)return new On.Tree.Invalid(e,n)},comment:function(){var e;if("/"===t.charAt(r))return"/"===t.charAt(r+1)?new On.Tree.Comment(f(/^\/\/.*/),!0):(e=f(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new On.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===t.charAt(r)||"'"===t.charAt(r)){var e=f(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new On.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(f("[")){var e=f(/(^[^\]]+)/);if(f("]"))return e?new On.Tree.Field(e[1]):void 0}},comparison:function(){var e=f(/^=~|=|!=|<=|>=|<|>/);if(e)return e},keyword:function(){var e=f(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new On.Tree.Keyword(e)},call:function(){var e,t;if(e=/^([\w\-]+|%)\(/.exec(o[s])){if("url"===(e=e[1]))return null;r+=e.length;if(f("("),t=f(this.entities.arguments),f(")"))return e?new On.Tree.Call(e,t,r):void 0}},arguments:function(){for(var e,t=[];e=f(this.expression);){t.push(e);if(!f(","))break}return t},literal:function(){return f(this.entities.dimension)||f(this.entities.keywordcolor)||f(this.entities.hexcolor)||f(this.entities.quoted)},url:function(){var e;if("u"===t.charAt(r)&&f(/^url\(/)){e=f(this.entities.quoted)||f(this.entities.variable)||f(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return f(")")?new On.Tree.URL(void 0!==e.value||e instanceof On.Tree.Variable?e:new On.Tree.Quoted(e)):new On.Tree.Invalid(e,n,"Missing closing ) in URL.")}},variable:function(){var s,i=r;if("@"===t.charAt(r)&&(s=f(/^@[\w-]+/)))return new On.Tree.Variable(s,i,e.filename)},hexcolor:function(){var e;if("#"===t.charAt(r)&&(e=f(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new On.Tree.Color(e[1])},keywordcolor:function(){var e=o[s].match(/^[a-z]+/);if(e&&e[0]in On.Tree.Reference.data.colors)return new On.Tree.Color(On.Tree.Reference.data.colors[f(/^[a-z]+/)])},dimension:function(){var e=t.charCodeAt(r);if(!(e>57||e<45||47===e)){var s=f(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return s?new On.Tree.Dimension(s[1],s[2],n):void 0}}},variable:function(){var e;if("@"===t.charAt(r)&&(e=f(/^(@[\w-]+)\s*:/)))return e[1]},entity:function(){var e=f(this.entities.call)||f(this.entities.literal),t=f(this.entities.field)||f(this.entities.variable),r=f(this.entities.url)||f(this.entities.keyword);return e||t||r},end:function(){var e;return f(";")||("string"==typeof(e="}")?t.charAt(r)===e:!!e.test(o[s]))},element:function(){var e=f(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new On.Tree.Element(e)},attachment:function(){var e=f(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(e)return e[1]},selector:function(){for(var e,s,i,a,o,l=[],h=new On.Tree.Filterset,u=[],c=0,d=0;(i=f(this.element))||(o=f(this.zoom))||(a=f(this.filter))||(e=f(this.attachment));){if(c++,i)l.push(i);else if(o)u.push(o),d++;else if(a){var p=h.add(a);if(p)throw m({message:p,index:r-1});d++}else{if(s)throw m({message:"Encountered second attachment name.",index:r-1});s=e}var y=t.charAt(r);if("{"===y||"}"===y||";"===y||","===y)break}if(c)return new On.Tree.Selector(h,u,l,s,d,n)},filter:function(){c();var t,r,s;if(f("[")&&(t=f(/^[a-zA-Z0-9\-_]+/)||f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.keyword)||f(this.entities.field))&&(t instanceof On.Tree.Quoted&&(t=new On.Tree.Field(t.toString())),(r=f(this.entities.comparison))&&(s=f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.dimension)||f(this.entities.keyword)||f(this.entities.field)))){if(!f("]"))throw m({message:"Missing closing ] of filter.",index:n-1});return t.is||(t=new On.Tree.Field(t)),new On.Tree.Filter(t,r,s,n,e.filename)}},zoom:function(){c();var e,t;if(f(/^\[\s*zoom/g)&&(e=f(this.entities.comparison))&&(t=f(this.entities.variable)||f(this.entities.dimension))&&f("]"))return new On.Tree.Zoom(e,t,n);d()},block:function(){var e;if(f("{")&&(e=f(this.primary))&&f("}"))return e},ruleset:function(){var e,t,r=[];for(c();e=f(this.selector);){for(r.push(e);f(this.comment););if(!f(","))break;for(;f(this.comment););}if(e)for(;f(this.comment););if(r.length>0&&(t=f(this.block))){if(1===r.length&&r[0].elements.length&&"Map"===r[0].elements[0].value){var s=new On.Tree.Ruleset(r,t);return s.isMap=!0,s}return new On.Tree.Ruleset(r,t)}d()},rule:function(){var s,i,o=t.charAt(r);if(c(),"."!==o&&"#"!==o&&(s=f(this.variable)||f(this.property))){if((i=f(this.value))&&f(this.end))return new On.Tree.Rule(s,i,n,e.filename);a=r,d()}},font:function(){for(var e,t=[],r=[];e=f(this.entity);)r.push(e);if(t.push(new On.Tree.Expression(r)),f(","))for(;(e=f(this.expression))&&(t.push(e),f(",")););return new On.Tree.Value(t)},value:function(){for(var e,t=[];(e=f(this.expression))&&(t.push(e),f(",")););return t.length>1?new On.Tree.Value(t.map(function(e){return e.value[0]})):1===t.length?new On.Tree.Value(t):void 0},sub:function(){var e;if(f("(")&&(e=f(this.expression))&&f(")"))return e},multiplication:function(){var e,t,r,s;if(e=f(this.operand)){for(;(r=f("/")||f("*")||f("%"))&&(t=f(this.operand));)s=new On.Tree.Operation(r,[s||e,t],n);return s||e}},addition:function(){var e,s,i,a;if(e=f(this.multiplication)){for(;(i=f(/^[-+]\s+/)||" "!=t.charAt(r-1)&&(f("+")||f("-")))&&(s=f(this.multiplication));)a=new On.Tree.Operation(i,[a||e,s],n);return a||e}},operand:function(){return f(this.sub)||f(this.entity)},expression:function(){for(var e,t=[];e=f(this.addition)||f(this.entity);)t.push(e);if(t.length>0)return new On.Tree.Expression(t)},property:function(){var e=f(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(e)return e[1]}}}}parse(e){var t=this.parser;return this.ruleSet=t.parse(e)}toShaders(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var r={},s=[];this._toShaders(r,s,t);for(var i=[],n={},a=0,o=t.length;a=0){if(!t.featureFilter){var n=i+s.length,a=r.indexOf(")",n+1),o="featureId&&(featureId"+r.substring(n,a)+")";Object.defineProperty(t,"featureFilter",{configurable:!0,enumerable:!1,value:function(e){return!!o}})}return{property:p,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(u[p],c);Object.defineProperty(c,"attachment",{configurable:!0,enumerable:!1,value:h}),Object.defineProperty(c,"elements",{configurable:!0,enumerable:!1,value:l.elements}),i.push(c),n[s[a]]=!0}Object.defineProperty(c,"zoom",{configurable:!0,enumerable:!1,value:l.zoom})}return i}}return null}_toShaders(e,t,r){for(let s=0,i=r.length;s= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};On.mapnik_reference={version:{latest:Pn,"2.1.1":Pn}},On.Tree={},On.Tree.operate=function(e,t,r){switch(e){case"+":return t+r;case"-":return t-r;case"*":return t*r;case"%":return t%r;case"/":return t/r}},On.Tree.functions={rgb:function(e,t,r){return this.rgba(e,t,r,1)},rgba:function(e,t,r,s){var i=this,n=[e,t,r].map(function(e){return i.number(e)});return s=i.number(s),n.some(isNaN)||isNaN(s)?null:new On.Tree.Color(n,s)},stop:function(e){var t,r;return arguments.length>1&&(t=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:e,color:t,mode:r,toString:s=>'\n\t"}},hsl:function(e,t,r){return this.hsla(e,t,r,1)},hsla:function(e,t,r,s){if([e=this.number(e)%360/360,t=this.number(t),r=this.number(r),s=this.number(s)].some(isNaN))return null;var i=r<=.5?r*(t+1):r+t-r*t,n=2*r-i;return this.rgba(255*a(e+1/3),255*a(e),255*a(e-1/3),s);function a(e){return 6*(e=e<0?e+1:e>1?e-1:e)<1?n+(i-n)*e*6:2*e<1?i:3*e<2?n+(i-n)*(2/3-e)*6:n}},hue:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new On.Tree.Dimension(e.toHSL().a):null},saturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s+=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s-=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l+=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l-=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a+=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a-=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL(),s=(r.h+t.value)%360;return r.h=s<0?360+s:s,this.hsla_simple(r)},replace:function(e,t,r){return"field"===e.is?e.toString+".replace("+t.toString()+", "+r.toString()+")":e.replace(t,r)},mix:function(e,t,r){var s=r.value/100,i=2*s-1,n=e.toHSL().a-t.toHSL().a,a=((i*n==-1?i:(i+n)/(1+i*n))+1)/2,o=1-a,l=[e.rgb[0]*a+t.rgb[0]*o,e.rgb[1]*a+t.rgb[1]*o,e.rgb[2]*a+t.rgb[2]*o],h=e.alpha*s+t.alpha*(1-s);return new On.Tree.Color(l,h)},greyscale:function(e){return this.desaturate(e,new On.Tree.Dimension(100))},"%":function(e){for(var t=Array.prototype.slice.call(arguments,1),r=e.value,s=0;s.5?h/(2-a-o):h/(a+o),a){case r:e=(s-i)/h+(s=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}toColor(){return new On.Tree.Color([this.value,this.value,this.value])}round(){return this.value=Math.round(this.value),this}toString(){return this.value.toString()}operate(e,t,r){return"%"===this.unit&&"%"!==r.unit?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===t||"/"===t||"%"===t?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new On.Tree.Dimension(On.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new On.Tree.Dimension(On.Tree.operate(t,this.value,r.value),this.unit||r.unit)}},On.Tree.Element=class{constructor(e){this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")}specificity(){return["id"===this.type?1:0,"class"===this.type?1:0]}toString(){return this.value}},On.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new On.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}toString(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}},On.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}},On.Tree.Filter=class{constructor(e,t,r,s,i){this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=t,this.val=r,this.index=s,this.filename=i,this.id=this.key+this.op+this.val}ev(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}toString(){return"["+this.id+"]"}},On.Tree.Filterset=class{constructor(){this.filters={}}toJS(e){function t(e){var t=e.op;"="===t&&(t="==");var r=e.val;void 0!==e._val&&(r=e._val.toString(!0)),e.key&&"scale"===e.key.value?r=+r:"string"!=typeof r&&"object"!=typeof r||(r="'"+r+"'");var s="attributes";return s+"&&"+s+e.key+"&&"+s+e.key+" "+t+r}var r=[];for(var s in this.filters)r.push(t(this.filters[s]));return r.join(" && ")}toString(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join("\t")}ev(e){for(var t in this.filters)this.filters[t].ev(e);return this}clone(){var e=new On.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}cloneWith(e){var t=[];for(var r in e.filters){var s=this.addable(e.filters[r]);if(!1===s)return!1;!0===s&&t.push(e.filters[r])}if(!t.length)return null;var i=new On.Tree.Filterset;for(r in this.filters)i.filters[r]=this.filters[r];for(;r=t.shift();)i.add(r);return i}addable(e){var t=e.key.toString(),r=e.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),e.op){case"=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val.toString()==r&&null:void 0===this.filters[t+"!="+r]&&(!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val"]&&this.filters[t+">"].val>=r?null:void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val":return t+"="in this.filters?!(this.filters[t+"="].val<=r)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)||null));case">=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)||null));case"<":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>=r)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].valr)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)||null))}}conflict(e){var t=e.key.toString(),r=e.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===e.op&&void 0!==this.filters[t+"="]&&r!=this.filters[t+"="].val.toString()||"!="===e.op&&void 0!==this.filters[t+"="]&&r==this.filters[t+"="].val.toString()||"="===e.op&&void 0!==this.filters[t+"!="]&&r===this.filters[t+"!="].val.toString())&&e.toString()+" added to "+this.toString()+" produces an invalid filter"}add(e,t){var r,s=e.key.toString(),i=e.op,n=this.conflict(e);if(n)return n;if("="===i){for(var a in this.filters)this.filters[a].key===s&&delete this.filters[a];this.filters[s+"="]=e}else if("!="===i)this.filters[s+"!="+e.val]=e;else if("=~"===i)this.filters[s+"=~"+e.val]=e;else if(">"===i){for(var o in this.filters)this.filters[o].key===s&&this.filters[o].val<=e.val&&delete this.filters[o];this.filters[s+">"]=e}else if(">="===i){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===s&&r",this.filters[s+">"]=e):this.filters[s+">="]=e}else if("<"===i){for(var h in this.filters)r=+this.filters[h].val.toString(),this.filters[h].key===s&&r>=e.val&&delete this.filters[h];this.filters[s+"<"]=e}else if("<="===i){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===s&&r>e.val&&delete this.filters[u];void 0!==this.filters[s+"!="+e.val]?(delete this.filters[s+"!="+e.val],e.op="<",this.filters[s+"<"]=e):this.filters[s+"<="]=e}}},On.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}},On.Tree.Invalid=class{constructor(e,t,r){this.is="invalid",this.chunk=e,this.index=t,this.type="syntax",this.message=r||"Invalid code: "+this.chunk}ev(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}},On.Tree.Keyword=class{ev(){return this}constructor(e){this.value=e;var t={transparent:"color",true:"boolean",false:"boolean"};this.is=t[e]?t[e]:"keyword"}toString(){return this.value}},On.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}},On.Tree.Operation=class{constructor(e,t,r){this.is="operation",this.op=e.trim(),this.operands=t,this.index=r}ev(e){var t,r=this.operands[0].ev(e),s=this.operands[1].ev(e);return"undefined"===r.is||"undefined"===s.is?{is:"undefined",value:"undefined"}:(r instanceof On.Tree.Dimension&&s instanceof On.Tree.Color&&("*"===this.op||"+"===this.op?(t=s,s=r,r=t):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof On.Tree.Quoted&&s instanceof On.Tree.Quoted&&"+"!==this.op?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof On.Tree.Field||s instanceof On.Tree.Field||r instanceof On.Tree.Literal||s instanceof On.Tree.Literal?"color"===r.is||"color"===s.is?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new On.Tree.Literal(r.ev(e).toString(!0)+this.op+s.ev(e).toString(!0)):void 0===r.operate?(e.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(e,this.op,s))}},On.Tree.Quoted=class{constructor(e){this.is="string",this.value=e||""}toString(e){var t=this.value.replace(/&/g,"&"),r=t.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===e?"'"+r+"'":t}ev(){return this}operate(e,t,r){return new On.Tree.Quoted(On.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}},On.Tree.Reference={_validateValue:{font:function(e,t){return!e.validation_data||!e.validation_data.fonts||-1!=e.validation_data.fonts.indexOf(t)}},setData:function(e){this.data=e,this.selector_cache=function(e){var t={};for(var r in e.symbolizers)for(var s in e.symbolizers[r])e.symbolizers[r][s].hasOwnProperty("css")&&(t[e.symbolizers[r][s].css]=[e.symbolizers[r][s],r,s]);return t}(e),this.mapnikFunctions=function(e){var t={};for(var r in e.symbolizers)for(var s in e.symbolizers[r])if("functions"===e.symbolizers[r][s].type)for(var i=0;i1?Array.prototype.push.apply(r,s.find(new On.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(s);break}}),this._lookups[s]=r)}evZooms(e){for(var t=0;tOn.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+On.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t}return this}toString(){for(var e="",t=0;t<=On.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<3&&(t=Array.prototype.slice.call(t,1));for(var s=this._handlers[e],i=s.length,n=0;n4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var s=t[t.length-1],i=this._handlers[e],n=i.length,a=0;a-this.EPSILON&&ethis.EPSILON||e<-this.EPSILON}cubicAt(e,t,r,s,i){var n=1-i;return n*n*(n*e+3*i*t)+i*i*(i*s+3*n*r)}cubicDerivativeAt(e,t,r,s,i){var n=1-i;return 3*(((t-e)*n+2*(r-t)*i)*n+(s-r)*i*i)}cubicRootAt(e,t,r,s,i,n){var a=s+3*(t-r)-e,o=3*(r-2*t+e),l=3*(t-e),h=e-i,u=o*o-3*a*l,c=o*l-9*a*h,d=l*l-3*o*h,p=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(o))n[0]=0;else{let e=-l/o;e>=0&&e<=1&&(n[p++]=e)}else{var f=c*c-4*u*d;if(this.isAroundZero(f)){var m=c/u;let e=-o/a+m,t=-m/2;e>=0&&e<=1&&(n[p++]=e),t>=0&&t<=1&&(n[p++]=t)}else if(f>0){let e=Math.sqrt(f),t=u*o+1.5*a*(-c+e),r=u*o+1.5*a*(-c-e),s=(-o-((t=t<0?-Math.pow(-t,this.ONE_THIRD):Math.pow(t,this.ONE_THIRD))+(r=r<0?-Math.pow(-r,this.ONE_THIRD):Math.pow(r,this.ONE_THIRD))))/(3*a);s>=0&&s<=1&&(n[p++]=s)}else{var y=(2*u*o-3*a*c)/(2*Math.sqrt(u*u*u)),g=Math.acos(y)/3,v=Math.sqrt(u),b=Math.cos(g);let e=(-o-2*v*b)/(3*a),t=(-o+v*(b+this.THREE_SQRT*Math.sin(g)))/(3*a),r=(-o+v*(b-this.THREE_SQRT*Math.sin(g)))/(3*a);e>=0&&e<=1&&(n[p++]=e),t>=0&&t<=1&&(n[p++]=t),r>=0&&r<=1&&(n[p++]=r)}}return p}cubicExtrema(e,t,r,s,i){var n=6*r-12*t+6*e,a=9*t+3*s-3*e-9*r,o=3*t-3*e,l=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(n)){let e=-o/n;e>=0&&e<=1&&(i[l++]=e)}}else{var h=n*n-4*a*o;if(this.isAroundZero(h))i[0]=-n/(2*a);else if(h>0){let e=Math.sqrt(h),t=(-n+e)/(2*a),r=(-n-e)/(2*a);t>=0&&t<=1&&(i[l++]=t),r>=0&&r<=1&&(i[l++]=r)}}return l}cubicSubdivide(e,t,r,s,i,n){var a=(t-e)*i+e,o=(r-t)*i+t,l=(s-r)*i+r,h=(o-a)*i+a,u=(l-o)*i+o,c=(u-h)*i+h;n[0]=e,n[1]=a,n[2]=h,n[3]=c,n[4]=c,n[5]=u,n[6]=l,n[7]=s}cubicProjectPoint(e,t,r,s,i,n,a,o,l,h,u){var c,d=this.vector.create(),p=this.vector.create(),f=this.vector.create(),m=.005,y=1/0;d[0]=l,d[1]=h;for(let l=0;l<1;l+=.05){p[0]=this.cubicAt(e,r,i,a,l),p[1]=this.cubicAt(t,s,n,o,l);let h=this.vector.distSquare(d,p);h=0&&u=0&&h<=1&&(i[l++]=h)}}else{var u=a*a-4*n*o;if(this.isAroundZero(u)){let e=-a/(2*n);e>=0&&e<=1&&(i[l++]=e)}else if(u>0){let e=Math.sqrt(u),t=(-a+e)/(2*n),r=(-a-e)/(2*n);t>=0&&t<=1&&(i[l++]=t),r>=0&&r<=1&&(i[l++]=r)}}return l}quadraticExtremum(e,t,r){var s=e+r-2*t;return 0===s?.5:(e-t)/s}quadraticProjectPoint(e,t,r,s,i,n,a,o,l){var h,u=this.vector.create(),c=this.vector.create(),d=this.vector.create(),p=.005,f=1/0;u[0]=a,u[1]=o;for(let a=0;a<1;a+=.05){c[0]=this.quadraticAt(e,r,i,a),c[1]=this.quadraticAt(t,s,n,a);let o=this.vector.distSquare(u,c);o=0&&ln-2?n-1:d+1][0]+i[0],e[d>n-2?n-1:d+1][1]+i[1]],u=[e[d>n-3?n-1:d+2][0]+i[0],e[d>n-3?n-1:d+2][1]+i[1]]);let m=p*p,y=p*m;a.push([h(s[0],f[0],o[0],u[0],p,m,y),h(s[1],f[1],o[1],u[1],p,m,y)])}return a;function h(e,t,r,s,i,n,a){var o=.5*(r-e),l=.5*(s-t);return(2*(t-r)+o+l)*a+(-3*(t-r)-2*o-l)*n+o*i+t}}static SUtil_dashedLineTo(e,t,r,s,i,n,a){var o=[5,5];if(n="number"!=typeof n?5:n,e.setLineDash)return o[0]=n,o[1]=n,a&&a instanceof Array?e.setLineDash(a):e.setLineDash(o),e.moveTo(t,r),void e.lineTo(s,i);var l=s-t,h=i-r,u=Math.floor(Math.sqrt(l*l+h*h)/n);l/=u,h/=u;for(var c=!0,d=0;d0){for(var i=this.isInsidePolygon(t.pointList,u,c),n=e.holePolygonPointLists,a=!1,o=0,l=n.length;ot+o&&a>s+o||ae+o&&n>r+o||nt+c&&u>s+c&&u>n+c&&u>o+c||ue+c&&h>r+c&&h>i+c&&h>a+c||ht+h&&l>s+h&&l>n+h||le+h&&o>r+h&&o>i+h||or||c+u=h)return!0;if(n){var d=s;s=this.normalizeRadian(i),i=this.normalizeRadian(d)}else s=this.normalizeRadian(s),i=this.normalizeRadian(i);s>i&&(i+=h);var p=Math.atan2(l,o);return p<0&&(p+=h),p>=s&&p<=i||p+h>=s&&p+h<=i}isInsideBrokenLine(e,t,r,s){for(var i=Math.max(t,10),n=0,a=e.length-1;nr*r}isInsideRect(e,t,r,s,i,n){return i>=e&&i<=e+r&&n>=t&&n<=t+s}isInsideCircle(e,t,r,s,i){return(s-e)*(s-e)+(i-t)*(i-t)t&&n>s||ni?st&&h>s&&h>n&&h>o||h1&&this.swapExtrema(),f=u.cubicAt(t,s,n,o,d[0]),g>1&&(m=u.cubicAt(t,s,n,o,d[1]))),2==g?bt&&o>s&&o>n||o=0&&c<=1){var d=0,p=l.quadraticAt(t,s,n,c);for(let s=0;sa||(h[s]a?0:nr||o<-r)return 0;let u=Math.sqrt(r*r-o*o);if(l[0]=-u,l[1]=u,Math.abs(s-i)>=h){s=0,i=h;var c=n?1:-1;return a>=l[0]+e&&a<=l[1]+e?c:0}if(n){let e=s;s=this.normalizeRadian(i),i=this.normalizeRadian(e)}else s=this.normalizeRadian(s),i=this.normalizeRadian(i);s>i&&(i+=h);var d=0;for(let t=0;t<2;t++){var p=l[t];if(p+e>a){let e=Math.atan2(o,p),t=n?1:-1;e<0&&(e=h+e),(e>=s&&e<=i||e+h>=s&&e+h<=i)&&(e>Math.PI/2&&e<1.5*Math.PI&&(t=-t),d+=t)}}return d}isInsidePath(e,t,r,s,i){for(var n=0,a=0,o=0,l=0,h=0,u=!0,c=!0,d="stroke"===(r=r||"fill")||"both"===r,p="fill"===r||"both"===r,f=0;f0&&(p&&(n+=this.windingLine(a,o,l,h,s,i)),0!==n))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==m.command&&(c=!1,a=l,o=h)}switch(m.command){case"M":a=y[0],o=y[1];break;case"L":if(d&&this.isInsideLine(a,o,y[0],y[1],t,s,i))return!0;p&&(n+=this.windingLine(a,o,y[0],y[1],s,i)),a=y[0],o=y[1];break;case"C":if(d&&this.isInsideCubicStroke(a,o,y[0],y[1],y[2],y[3],y[4],y[5],t,s,i))return!0;p&&(n+=this.windingCubic(a,o,y[0],y[1],y[2],y[3],y[4],y[5],s,i)),a=y[4],o=y[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(a,o,y[0],y[1],y[2],y[3],t,s,i))return!0;p&&(n+=this.windingQuadratic(a,o,y[0],y[1],y[2],y[3],s,i)),a=y[2],o=y[3];break;case"A":var g=y[0],v=y[1],b=y[2],S=y[3],x=y[4],_=y[5],w=Math.cos(x)*b+g,C=Math.sin(x)*S+v;c?(c=!1,l=w,h=C):n+=this.windingLine(a,o,w,C);var T=(s-g)*S/b+g;if(d&&this.isInsideArcStroke(g,v,S,x,x+_,1-y[7],t,T,i))return!0;p&&(n+=this.windingArc(g,v,S,x,x+_,1-y[7],T,i)),a=Math.cos(x+_)*b+g,o=Math.sin(x+_)*S+v;break;case"z":if(d&&this.isInsideLine(a,o,l,h,t,s,i))return!0;u=!0}}return p&&(n+=this.windingLine(a,o,l,h,s,i)),0!==n}getTextWidth(e,t){var r=e+":"+t;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t);for(var s=0,i=0,n=(e=(e+"").split("\n")).length;ithis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),s}getTextHeight(e,t){var r=e+":"+t;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split("\n");var s=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[r]=s,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),s}},Jn.Util_color=new Sn,Jn.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="SuperMap.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(e,t,r){if(0!==e.length){for(var s=e[0][0],i=e[0][0],n=e[0][1],a=e[0][1],o=1;oi&&(i=l[0]),l[1]a&&(a=l[1])}t[0]=s,t[1]=n,r[0]=i,r[1]=a}}cubeBezier(e,t,r,s,i,n){var a=new Vn,o=[];a.cubicExtrema(e[0],t[0],r[0],s[0],o);for(let i=0;ii&&!n?i+=2*Math.PI:ss&&(c[0]=Math.cos(p)*r+e,c[1]=Math.sin(p)*r+t,l.min(a,c,a),l.max(o,c,o))}},Jn.Util_curve=new Vn,Jn.Util_env=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Env";var e,t,r,s,i,n,a,o,l,h,u,c,d,p,f,m,y,g,v,b,S,x=this;return e=navigator.userAgent,t=x.os={},r=x.browser={},s=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),n=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),o=!n&&e.match(/(iPhone\sOS)\s([\d_]+)/),l=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),h=l&&e.match(/TouchPad/),u=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),d=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),f=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),m=e.match(/PlayBook/),y=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),b=s&&e.match(/Mobile\//)&&!y,S=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!y,(r.webkit=!!s)&&(r.version=s[1]),i&&(t.android=!0,t.version=i[2]),o&&!a&&(t.ios=t.iphone=!0,t.version=o[2].replace(/_/g,".")),n&&(t.ios=t.ipad=!0,t.version=n[2].replace(/_/g,".")),a&&(t.ios=t.ipod=!0,t.version=a[3]?a[3].replace(/_/g,"."):null),l&&(t.webos=!0,t.version=l[2]),h&&(t.touchpad=!0),d&&(t.blackberry=!0,t.version=d[2]),p&&(t.bb10=!0,t.version=p[2]),f&&(t.rimtabletos=!0,t.version=f[2]),m&&(r.playbook=!0),u&&(t.kindle=!0,t.version=u[1]),c&&(r.silk=!0,r.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(r.silk=!0),y&&(r.chrome=!0,r.version=y[1]),g&&(r.firefox=!0,r.version=g[1]),v&&(r.ie=!0,r.version=v[1]),b&&(e.match(/Safari/)||t.ios)&&(r.safari=!0),S&&(r.webview=!0),v&&(r.ie=!0,r.version=v[1]),t.tablet=!!(n||m||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(i||o||l||d||p||y&&e.match(/Android/)||y&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:r,os:t,canvasSupported:!!document.createElement("canvas").getContext}}destory(){return!0}},Jn.Util_event=new class{constructor(){this.stop="function"==typeof window.addEventListener?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0},this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Event"}getX(e){return void 0!==e.zrenderX&&e.zrenderX||void 0!==e.offsetX&&e.offsetX||void 0!==e.layerX&&e.layerX||void 0!==e.clientX&&e.clientX}getY(e){return void 0!==e.zrenderY&&e.zrenderY||void 0!==e.offsetY&&e.offsetY||void 0!==e.layerY&&e.layerY||void 0!==e.clientY&&e.clientY}getDelta(e){return void 0!==e.zrenderDelta&&e.zrenderDelta||void 0!==e.wheelDelta&&e.wheelDelta||void 0!==e.detail&&-e.detail}},Jn.Util_http=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Http"}get(e,t,r){if("object"==typeof e){var s=e;e=s.url,t=s.onsuccess,r=s.onerror}var i=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");i.open("GET",e,!0),i.onreadystatechange=function(){4==i.readyState&&(i.status>=200&&i.status<300||304===i.status?t&&t(i.responseText):r&&r(),i.onreadystatechange=new Function,i=null)},i.send(null)}},Jn.Util_log=new class{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(0!=+zn.debugMode)if(1==+zn.debugMode)for(let e in arguments)throw new Error(arguments[e]);else if(+zn.debugMode>1)for(let e in arguments)console.log(arguments[e])}}destory(){return!0}},Jn.Util_math=new class{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Math"}sin(e,t){return window.Math.sin(t?e*this._radians:e)}cos(e,t){return window.Math.cos(t?e*this._radians:e)}degreeToRadian(e){return e*this._radians}radianToDegree(e){return e/this._radians}},Jn.Util_matrix=new class{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Matrix"}create(){var e=new(0,this.ArrayCtor)(6);return this.identity(e),e}identity(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}mul(e,t,r){return e[0]=t[0]*r[0]+t[2]*r[1],e[1]=t[1]*r[0]+t[3]*r[1],e[2]=t[0]*r[2]+t[2]*r[3],e[3]=t[1]*r[2]+t[3]*r[3],e[4]=t[0]*r[4]+t[2]*r[5]+t[4],e[5]=t[1]*r[4]+t[3]*r[5]+t[5],e}translate(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}rotate(e,t,r){var s=t[0],i=t[2],n=t[4],a=t[1],o=t[3],l=t[5],h=Math.sin(r),u=Math.cos(r);return e[0]=s*u+a*h,e[1]=-s*h+a*u,e[2]=i*u+o*h,e[3]=-i*h+u*o,e[4]=u*n+h*l,e[5]=u*l-h*n,e}scale(e,t,r){var s=r[0],i=r[1];return e[0]=t[0]*s,e[1]=t[1]*i,e[2]=t[2]*s,e[3]=t[3]*i,e[4]=t[4]*s,e[5]=t[5]*i,e}invert(e,t){var r=t[0],s=t[2],i=t[4],n=t[1],a=t[3],o=t[5],l=r*a-n*s;return l?(l=1/l,e[0]=a*l,e[1]=-n*l,e[2]=-s*l,e[3]=r*l,e[4]=(s*o-a*i)*l,e[5]=(n*i-r*o)*l,e):null}mulVector(e,t,r){var s=t[0],i=t[2],n=t[4],a=t[1],o=t[3],l=t[5];return e[0]=r[0]*s+r[1]*i+n,e[1]=r[0]*a+r[1]*o+l,e}},Jn.Util=new bn,Jn.Util_vector=new Un;class qn{constructor(){var e;this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="SuperMap.LevelRenderer.Transformable",this.lookAt=(e=Jn.Util_vector.create(),function(t){this.transform||(this.transform=Jn.Util_matrix.create());var r=this.transform;function s(e){return e>-5e-5&&e<5e-5}Jn.Util_vector.sub(e,t,this.position),s(e[0])&&s(e[1])||(Jn.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){function e(e){return e>5e-5||e<-5e-5}this.needLocalTransform=e(this.rotation[0])||e(this.position[0])||e(this.position[1])||e(this.scale[0]-1)||e(this.scale[1]-1)}updateTransform(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var e=[0,0],t=this.transform||Jn.Util_matrix.create();if(Jn.Util_matrix.identity(t),this.needLocalTransform){if(r(this.scale[0])||r(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;let s=r(e[0])||r(e[1]);s&&Jn.Util_matrix.translate(t,t,e),Jn.Util_matrix.scale(t,t,this.scale),s&&(e[0]=-e[0],e[1]=-e[1],Jn.Util_matrix.translate(t,t,e))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){e[0]=-this.rotation[1]||0,e[1]=-this.rotation[2]||0;let s=r(e[0])||r(e[1]);s&&Jn.Util_matrix.translate(t,t,e),Jn.Util_matrix.rotate(t,t,this.rotation[0]),s&&(e[0]=-e[0],e[1]=-e[1],Jn.Util_matrix.translate(t,t,e))}}else 0!=+this.rotation&&Jn.Util_matrix.rotate(t,t,this.rotation);(r(this.position[0])||r(this.position[1]))&&Jn.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Jn.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Jn.Util_matrix.copy(this.transform,this.parent.transform))}function r(e){return e>5e-5||e<-5e-5}}setTransform(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}decomposeTransform(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],r=this.position,s=this.scale,i=this.rotation;a(t-1)&&(t=Math.sqrt(t));var n=e[2]*e[2]+e[3]*e[3];a(n-1)&&(n=Math.sqrt(n)),r[0]=e[4],r[1]=e[5],s[0]=t,s[1]=n,s[2]=s[3]=0,i[0]=Math.atan2(-e[1]/n,e[0]/t),i[1]=i[2]=0}function a(e){return e>5e-5||e<-5e-5}}}class Hn extends(z(jn,qn)){constructor(e){var t;super(e),e=e||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,$.extend(this,e),this.id=this.id||$.createUniqueID("smShape_"),this.CLASS_NAME="SuperMap.LevelRenderer.Shape",this.getTansform=(t=[],function(e,r){var s=[e,r];return this.needTransform&&this.transform&&(Jn.Util_matrix.invert(t,this.transform),Jn.Util_matrix.mulVector(s,t,[e,r,1]),e==s[0]&&r==s[1]&&this.updateNeedTransform()),s})}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(e,t){var r=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,r),r.brushType){case"both":this.setCtxGlobalAlpha(e,"fill",r),e.fill(),r.lineWidth>0&&(this.setCtxGlobalAlpha(e,"stroke",r),e.stroke()),this.setCtxGlobalAlpha(e,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",r);break;default:this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)}this.drawText(e,r,this.style),this.afterBrush(e)}beforeBrush(e,t){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),t&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r}afterBrush(e){e.restore()}setContext(e,t){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],s=0,i=r.length;s=s.x&&e<=s.x+s.width&&t>=s.y&&t<=s.y+s.height&&Jn.Util_area.isInside(this,this.style,e,t)}drawText(e,t,r){if(void 0!==t.text&&!1!==t.text){var s=t.textColor||t.color||t.strokeColor;e.fillStyle=s;var i,n,a,o,l=10,h=t.textPosition||this.textPosition||"top",u=[];switch(u=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(r||t).__rect||this.getRect(r||t);switch(h){case"inside":a=c.x+c.width/2,o=c.y+c.height/2,i="center",n="middle","stroke"!=t.brushType&&s==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-l,o=c.y+c.height/2,i="end",n="middle";break;case"right":a=c.x+c.width+l,o=c.y+c.height/2,i="start",n="middle";break;case"top":a=c.x+c.width/2,o=c.y-l,i="center",n="bottom";break;case"bottom":a=c.x+c.width/2,o=c.y+c.height+l,i="center",n="top"}}break;case"start":case"end":var d=0,p=0,f=0,m=0;if(void 0!==t.pointList){var y=t.pointList;if(y.length<2)return;var g=y.length;switch(h){case"start":d=y[0][0]+u[0],p=y[1][0]+u[0],f=y[0][1]+u[1],m=y[1][1]+u[1];break;case"end":d=y[g-2][0]+u[0],p=y[g-1][0]+u[0],f=y[g-2][1]+u[1],m=y[g-1][1]+u[1]}}else d=t.xStart+u[0]||0,p=t.xEnd+u[0]||0,f=t.yStart+u[1]||0,m=t.yEnd+u[1]||0;switch(h){case"start":i=ds&&(s=l[0]),l[1]i&&(i=l[1]))}return e.__rect={x:t,y:r,width:s-t,height:i-r},e.__rect}getRectNoRotation(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition,s=Jn.Util_area.getTextHeight("ZH",e.textFont),i=Jn.Util_area.getTextWidth(e.text,e.textFont),n=Jn.Util_area.getTextHeight(e.text,e.textFont),a=e.x+r[0];"end"==e.textAlign||"right"==e.textAlign?a-=i:"center"==e.textAlign&&(a-=i/2),t="top"==e.textBaseline?e.y+r[1]:"bottom"==e.textBaseline?e.y+r[1]-n:e.y+r[1]-n/2;var o,l=!1;if(e.maxWidth){var h=parseInt(e.maxWidth);h-1&&(i+=!0===l?s/3*(i/o):s/3));return{x:a,y:t,width:i,height:n}}getTextBackground(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var s=this.getRectNoRotation(e),i=e.x+r[0],n=e.y+r[1],a=[];if(e.textRotation&&0!==e.textRotation){let t=e.textRotation,r=this.getRotatedLocation(s.x,s.y,i,n,t),o=this.getRotatedLocation(s.x+s.width,s.y,i,n,t),l=this.getRotatedLocation(s.x+s.width,s.y+s.height,i,n,t),h=this.getRotatedLocation(s.x,s.y+s.height,i,n,t);a.push(r),a.push(o),a.push(l),a.push(h)}else{let e=[s.x,s.y],t=[s.x+s.width,s.y],r=[s.x+s.width,s.y+s.height],i=[s.x,s.y+s.height];a.push(e),a.push(t),a.push(r),a.push(i)}return e.__textBackground=a,e.__textBackground}getRotatedLocation(e,t,r,s,i){var n,a,o=new Array;return t=-t,s=-s,i=-i,n=(e-r)*Math.cos(i/180*Math.PI)-(t-s)*Math.sin(i/180*Math.PI)+r,a=(e-r)*Math.sin(i/180*Math.PI)+(t-s)*Math.cos(i/180*Math.PI)+s,o[0]=n,o[1]=-a,o}}class Xn extends Hn{constructor(e){super(e),this.type="smiccircle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,s=t.x+r[0],i=t.y+r[1];return e.moveTo(s+t.r,i),e.arc(s,i,t.r,0,2*Math.PI,!0),!0}getRect(e){if(e.__rect)return e.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition,s=e.x+r[0],i=e.y+r[1],n=e.r;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(s-n-t/2),y:Math.round(i-n-t/2),width:2*n+t,height:2*n+t},e.__rect}}class Qn extends Hn{constructor(e){super(e),this.type="smicpolygon",this.holePolygonPointLists=null,this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.style;t&&(r=this.getHighlightStyle(r,this.highlightStyle||{})),e.save(),this.setContext(e,r),this.setTransform(e);var s=!1;"fill"!=r.brushType&&"both"!=r.brushType&&void 0!==r.brushType||(e.beginPath(),"dashed"==r.lineType||"dotted"==r.lineType||"dot"==r.lineType||"dash"==r.lineType||"dashdot"==r.lineType||"longdash"==r.lineType||"longdashdot"==r.lineType?this.buildPath(e,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(e,r),s=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)),r.lineWidth>0&&("stroke"==r.brushType||"both"==r.brushType)&&(s||(e.beginPath(),this.buildPath(e,r)),this.setCtxGlobalAlpha(e,"stroke",r),e.stroke(),this.setCtxGlobalAlpha(e,"reset",r)),this.drawText(e,r,this.style);var i=$.cloneObject(r);if(i.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var n=this.holePolygonPointLists,a=n.length,o=0;o0&&("stroke"==i.brushType||"both"==i.brushType)?(s||(e.beginPath(),this.buildPath(e,i)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",i),e.stroke(),this.setCtxGlobalAlpha(e,"reset",i)):e.globalCompositeOperation="source-over"}e.restore()}buildPath(e,t){t.showShadow&&(e.shadowBlur=t.shadowBlur,e.shadowColor=t.shadowColor,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,s=t.pointList;if(!(s.length<2))if(t.smooth&&"spline"!==t.smooth){var i,n,a,o=Jn.SUtil_smoothBezier(s,t.smooth,!0,t.smoothConstraint,r);e.moveTo(s[0][0]+r[0],s[0][1]+r[1]);for(var l=s.length,h=0;hn&&(n=l[h][0]+r[0]),l[h][1]+r[1]o&&(o=l[h][1]+r[1]);return s="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(i-s/2),y:Math.round(a-s/2),width:n-i+s,height:o-a+s},e.__rect}}class Zn extends Hn{constructor(e){super(e),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,s=t.pointList;if(!(s.length<2)){var i=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var n,a,o,l=Jn.SUtil_smoothBezier(s,t.smooth,!1,t.smoothConstraint,r);e.moveTo(s[0][0]+r[0],s[0][1]+r[1]);for(let t=0;tu&&(r*=u/(a=r+s),s*=u/a),i+n>u&&(i*=u/(a=i+n),n*=u/a),s+i>c&&(s*=c/(a=s+i),i*=c/a),r+n>c&&(r*=c/(a=r+n),n*=c/a),e.moveTo(l+r,h),e.lineTo(l+u-s,h),0!==s&&e.quadraticCurveTo(l+u,h,l+u,h+s),e.lineTo(l+u,h+c-i),0!==i&&e.quadraticCurveTo(l+u,h+c,l+u-i,h+c),e.lineTo(l+n,h+c),0!==n&&e.quadraticCurveTo(l,h+c,l,h+c-n),e.lineTo(l,h+r),0!==r&&e.quadraticCurveTo(l,h,l+r,h)}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+r[0],t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1])),e.closePath()}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition;return e.__rect?e.__rect:(t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x+r[0]-t/2),y:Math.round(e.y+r[1]-t/2),width:e.width+t,height:e.height+t},e.__rect)}}class ea extends Hn{constructor(e){super(e),this.type="smicsector",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,s=t.x+r[0],i=t.y+r[1],n=t.r0||0,a=t.r,o=t.startAngle,l=t.endAngle,h=t.clockWise||!1;o=Jn.Util_math.degreeToRadian(o),l=Jn.Util_math.degreeToRadian(l),h||(o=-o,l=-l);var u=Jn.Util_math.cos(o),c=Jn.Util_math.sin(o);e.moveTo(u*n+s,c*n+i),e.lineTo(u*a+s,c*a+i),e.arc(s,i,a,o,l,!h),e.lineTo(Jn.Util_math.cos(l)*n+s,Jn.Util_math.sin(l)*n+i),0!==n&&e.arc(s,i,n,l,o,h),e.closePath()}getRect(e){if(e.__rect)return e.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t=this.refOriginalPosition,r=Jn.Util_vector.create(),s=Jn.Util_vector.create(),i=Jn.Util_vector.create(),n=Jn.Util_vector.create(),a=e.x+t[0],o=e.y+t[1],l=e.r0||0,h=e.r,u=Jn.Util_math.degreeToRadian(e.startAngle),c=Jn.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(u=-u,c=-c),l>1?Jn.Util_computeBoundingBox.arc(a,o,l,u,c,!d,r,i):(r[0]=i[0]=a,r[1]=i[1]=o),Jn.Util_computeBoundingBox.arc(a,o,h,u,c,!d,s,n),Jn.Util_vector.min(r,r,s),Jn.Util_vector.max(i,i,n),e.__rect={x:r[0],y:r[1],width:i[0]-r[0],height:i[1]-r[1]},e.__rect}}class ta{constructor(e){this.shapeParameters=e,this.CLASS_NAME="SuperMap.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(e){if(e&&(this.shapeParameters=e),!this.shapeParameters)return null;var t=this.shapeParameters;if(t instanceof In){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e=$.copyAttributesWithClip(e,t.style,["x","y"]);let r=new Wn;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["x","y","style","highlightStyle"]),r}if(t instanceof Nn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=$.copyAttributesWithClip(e,t.style,["pointList"]);let r=new Zn;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["pointList","style","highlightStyle"]),r}if(t instanceof Fn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=$.copyAttributesWithClip(e,t.style,["pointList"]);let r=new Qn;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["pointList","style","highlightStyle"]),r}if(t instanceof kn){if(!t.x&&!t.y&!t.width&!t.height)return null;let e=new Object;e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e=$.copyAttributesWithClip(e,t.style,["x","y","width","height"]);let r=new $n;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["x","y","width","height","style","highlightStyle"]),r}if(t instanceof Rn){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e.startAngle=t.startAngle,e.endAngle=t.endAngle,t.r0&&(e.r0=t.r0),t.clockWise&&(e.clockWise=t.clockWise),e=$.copyAttributesWithClip(e,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let r=new ea;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),r}if(t instanceof Dn){let e=new Object;e.x=t.x,e.y=t.y,e.text=t.text,e=$.copyAttributesWithClip(e,t.style,["x","y","text"]);let r=new Yn;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["x","y","text","style","highlightStyle"]),r}if(t instanceof Gn){let e=new Object;e.x=t.x,e.y=t.y,t.image&&(e.image=t.image),t.width&&(e.width=t.width),t.height&&(e.height=t.height),t.sx&&(e.sx=t.sx),t.sy&&(e.sy=t.sy),t.sWidth&&(e.sWidth=t.sWidth),t.sHeight&&(e.sHeight=t.sHeight),e=$.copyAttributesWithClip(e,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let r=new Kn;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["x","y","image","width","height","style","highlightStyle"]),r}if(t instanceof Bn){let e=new Object;e.x=t.x,e.r=t.r,e.y=t.y,e=$.copyAttributesWithClip(e,t.style,["x","y","r"]);let r=new Xn;return r.style=ta.transformStyle(e),r.highlightStyle=ta.transformStyle(t.highlightStyle),$.copyAttributesWithClip(r,t,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),r}return null}static transformStyle(e){var t={},r=["normal","normal","normal","12","arial,sans-serif"],s=[!0,!1];for(var i in e)switch(i){case"fill":s[0]=e[i];break;case"fillColor":t.color=e[i];break;case"stroke":s[1]=e[i];break;case"strokeWidth":t.lineWidth=e[i];break;case"strokeLinecap":t.lineCap=e[i];break;case"strokeLineJoin":t.lineJoin=e[i];break;case"strokeDashstyle":t.lineType=e[i];break;case"pointRadius":t.r=e[i];break;case"label":t.text=e[i];break;case"labelRect":t.labelRect=e[i];break;case"fontColor":t.textColor=e[i];break;case"fontStyle":r[0]=e[i];break;case"fontVariant":r[1]=e[i];break;case"fontWeight":r[2]=e[i];break;case"fontSize":var n="";e[i]&&e[i].toString().indexOf("px")<0&&(n="px"),r[3]=e[i]+n;break;case"fontFamily":r[4]=e[i];break;case"fontOpacity":t.opacity=e[i];break;case"labelPosition":t.textPosition=e[i];break;case"labelAlign":t.textAlign=e[i];break;case"labelBaseline":t.textBaseline=e[i];break;case"labelRotation":t.textRotation=e[i];break;default:t[i]=e[i]}return t.textFont=r.join(" "),!0===s[0]&&!1===s[1]?t.brushType="fill":!1===s[0]&&!0===s[1]?t.brushType="stroke":!0===s[0]&&!0===s[1]?t.brushType="both":t.brushType="fill",null==t.lineWidth&&(t.lineWidth=1),t}static Background(e,t,r){var s=r||{},i=new kn(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return i.style={fillColor:"#f3f3f3"},s.backgroundStyle&&$.copyAttributesWithClip(i.style,s.backgroundStyle),s.backgroundRadius&&(i.style.radius=s.backgroundRadius),i.clickable=!1,i.hoverable=!1,e.createShape(i)}static GraphAxis(e,t,r,s){var i=t,n=r||{},a=[],o=[],l=!!n.useXReferenceLine&&n.useXReferenceLine,h=n.axisYTick&&!isNaN(n.axisYTick)?n.axisYTick:0,u=[],c=[];if(0==h){if(c.push([i[0],i[3]-5]),c.push([i[0],i[1]]),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){let e=parseInt(n.axis3DParameter),t=[i[0]-e,i[1]+e];n.axisUseArrow?(u.push([t[0]+1.5,t[1]-7.5]),u.push([t[0]-1,t[1]+1]),u.push([t[0]+7.5,t[1]-1.5]),c.push([t[0],t[1]])):c.push([t[0],t[1]]),c.push([i[0],i[1]])}c.push([i[2]+5,i[1]])}else{var d=Math.abs(i[1]-i[3])/h,p=i[3];c.push([i[0],p-5]);for(var f=0;f=15){let e=parseInt(n.axis3DParameter),t=[i[0]-e,i[1]+e];n.axisUseArrow?(u.push([t[0]+1.5,t[1]-7.5]),u.push([t[0]-1,t[1]+1]),u.push([t[0]+7.5,t[1]-1.5]),c.push([t[0],t[1]])):c.push([t[0],t[1]]),c.push([i[0],i[1]])}c.push([i[2]+5,i[1]])}if(n.axisUseArrow){var y=[[i[2]+5,i[1]+4],[i[2]+13,i[1]],[i[2]+5,i[1]-4]],g=[[i[0]-4,i[3]-5],[i[0],i[3]-13],[i[0]+4,i[3]-5]],v=new Fn(y);v.style={fillColor:"#008acd"},$.copyAttributesWithClip(v.style,n.axisStyle),o.push(e.createShape(v));var b=new Fn(g);if(b.style={fillColor:"#008acd"},$.copyAttributesWithClip(b.style,n.axisStyle),o.push(e.createShape(b)),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){var S=new Fn(u);S.style={fillColor:"#008acd"},$.copyAttributesWithClip(S.style,n.axisStyle),o.push(e.createShape(S))}}var x=new Nn(c);x.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},n.axisStyle&&$.copyAttributesWithClip(x.style,n.axisStyle),x.clickable=!1,x.hoverable=!1;var _=[e.createShape(x)],w=[];if(n.axisYLabels&&n.axisYLabels.length&&n.axisYLabels.length>0){var C=n.axisYLabels;let t=C.length;var T=[0,0];if(n.axisYLabelsOffset&&n.axisYLabelsOffset.length&&(T=n.axisYLabelsOffset),1==t){let t=new Dn(i[0]-5+T[0],i[3]+T[1],C[0]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&$.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,w.push(e.createShape(t))}else for(var M=i[3],E=Math.abs(i[1]-i[3])/(t-1),A=0;A0){let t=n.axisXLabels,r=t.length,a=[0,0];if(n.axisXLabelsOffset&&n.axisXLabelsOffset.length&&(a=n.axisXLabelsOffset),s&&s.xPositions&&s.xPositions.length&&s.xPositions.length==r){let o=s.xPositions;for(let s=0;s=0&&r[i]&&$.copyAttributesWithClip(a,r[i]),s&&s.length&&void 0!==n)for(var o=s,l=o.length,h=parseFloat(n),u=0;u=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}resetLocation(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var r=this.width,s=this.height,i=this.location;return this.chartBounds=new se(i[0]-r/2,i[1]+s/2,i[0]+r/2,i[1]-s/2),this.resetLinearGradient(),i}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var e=this.shapes,t=this.location,r=0,s=e.length;r=0?s.push(parseFloat(i[a].toString()).toFixed(r)):s.push(parseFloat(i[a].toString()))}catch(e){throw new Error("not a number")}return s.length===t.length&&s};class ia extends sa{constructor(e,t,r,s,i,n){super(e,t,r,s,i,n),this.setting=null,s&&s.codomain&&(this.setting=s,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="SuperMap.Feature.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var e=this.setting;e.XOffset&&(this.XOffset=e.XOffset),e.YOffset&&(this.YOffset=e.YOffset),this.XOffset=e.XOffset?e.XOffset:0,this.YOffset=e.YOffset?e.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=e.dataViewBoxParameter?e.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var t=this.width,r=this.height,s=this.location;this.origonPoint=[s[0]-t/2,s[1]-r/2];var i=this.origonPoint;this.chartBox=[i[0],i[1]+r,i[0]+t,i[1]];var n=this.chartBox,a=this.DVBParameter;this.dataViewBox=[n[0]+a[0],n[1]-a[1],n[2]-a[2],n[3]+a[3]];var o=this.dataViewBox;return!(o[0]>=o[2]||o[1]<=o[3])&&(this.DVBOrigonPoint=[o[0],o[3]],this.DVBWidth=Math.abs(o[2]-o[0]),this.DVBHeight=Math.abs(o[1]-o[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-i[0],this.DVBOrigonPoint[1]-i[1]],!0)}}class na extends ra{constructor(e,t,r,s,i){if(super(e,t),e.geometry&&e.geometry instanceof Y){this.dataBounds=e.geometry.getBounds(),this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=r||{},this.CLASS_NAME="SuperMap.Feature.Theme.Vector",this.style=r||{},s&&$.copyAttributesWithClip(this,s,["shapeOptions","dataBounds"]),i&&$.copyAttributesWithClip(this.shapeOptions,i);var n=e.geometry;this.lonlat=this.dataBounds.getCenterLonLat(),this.location=this.getLocalXY(this.lonlat),n instanceof ue?this.lineToTF(n):n instanceof le?this.lineToTF(n):n instanceof ae||(n instanceof ne?this.multiPointToTF(n):n instanceof ce?this.multiLineStringToTF(n):n instanceof de?this.multiPolygonToTF(n):n instanceof pe?this.polygonToTF(n):n instanceof ie||(n instanceof oe?this.pointToTF(n):n instanceof fe?this.rectangleToTF(n):n instanceof he&&this.geoTextToTF(n)))}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}lineToTF(e){for(var t=e.components,r=[],s=[],i=this.location,n=[],a=this.nodesClipPixel,o=0;o0){var h=n[n.length-1];if(Math.abs(h[0]-s[0])<=a&&Math.abs(h[1]-s[1])<=a)continue}n.push(s)}if(n.length<2)return null;var u=new Object;(u=$.copyAttributesWithClip(u,this.style,["pointList"])).pointList=n;var c=new Zn({style:u,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(c.highlightStyle=this.highlightStyle),c.refOriginalPosition=this.location,c.refDataID=this.data.id,c.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}multiPointToTF(e){for(var t=e.components,r=[],s=[],i=this.location,n=[],a=this.nodesClipPixel,o=0;o0){var h=n[n.length-1];if(Math.abs(h[0]-s[0])<=a&&Math.abs(h[1]-s[1])<=a)continue}n.push(s);var u=new Object;u.r=6,(u=$.copyAttributesWithClip(u,this.style)).x=s[0],u.y=s[1];var c=new Wn({style:u,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(c.highlightStyle=this.highlightStyle),c.refOriginalPosition=i,c.refDataID=this.data.id,c.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}}multiLineStringToTF(e){for(var t=e.components,r=0;r0){var d=n[n.length-1];if(Math.abs(d[0]-s[0])<=l&&Math.abs(d[1]-s[1])<=l)continue}n.push(s)}}else{a=[];for(var p=0;p0){var f=a[a.length-1];if(Math.abs(f[0]-s[0])<=l&&Math.abs(f[1]-s[1])<=l)continue}a.push(s)}}a.length<2||o.push(a)}if(!(n.length<2)){var m={};(m=$.copyAttributesWithClip(m,this.style,["pointList"])).pointList=n;var y=new Qn({style:m,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(y.highlightStyle=this.highlightStyle),y.refOriginalPosition=this.location,y.refDataID=this.data.id,y.isHoverByRefDataID=this.isMultiHover,o.length>0&&(y.holePolygonPointLists=o),this.shapeOptions&&$.copyAttributesWithClip(y,this.shapeOptions),this.shapes.push(y)}}rectangleToTF(e){var t=this.location,r=new re(e.x,e.y),s=this.layer.map.getResolution(),i=this.getLocalXY(r),n=new Object;n.r=6,(n=$.copyAttributesWithClip(n,this.style)).x=i[0]-t[0],n.y=i[1]-t[1]-2*e.width/s,n.width=e.width/s,n.height=e.height/s;var a=new $n({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=t,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}geoTextToTF(e){var t=this.location,r=this.getLocalXY(e),s=new Object;s.r=6,(s=$.copyAttributesWithClip(s,this.style,["x","y","text"])).x=r[0]-t[0],s.y=r[1]-t[1],s.text=e.text;var i=new Yn({style:s,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(i.highlightStyle=this.highlightStyle),i.refOriginalPosition=t,i.refDataID=this.data.id,i.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(i,this.shapeOptions),this.shapes.push(i)}updateAndAddShapes(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,r=0,s=this.shapes.length;r0}addRoot(e){e instanceof aa&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}delRoot(e){if(void 0===e){for(var t=0;t=0&&(this.delFromMap(i.id),this._roots.splice(n,1),i instanceof aa&&i.delChildrenFromStorage(this))}}addToMap(e){return e instanceof aa&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this}get(e){return this._elements[e]}delFromMap(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof aa&&(t._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}}class la{constructor(e,t){this.root=e,this.storage=t,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,la.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="SuperMap.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var r=document.createElement("div");this._domRoot=r,r.style.position="relative",r.style.overflow="hidden",r.style.width=this._width+"px",r.style.height=this._height+"px",this.root.appendChild(r),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=la.createDom($.createUniqueID("SuperMap.Theme_background_"),"div",this),r.appendChild(this._bgDom),this._bgDom.onselectstart=n,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var s=new ha($.createUniqueID("_highLightLayer_"),this);this._layers.hover=s,r.appendChild(s.dom),s.initContext(),s.dom.onselectstart=n,s.dom.style["-webkit-user-select"]="none",s.dom.style["user-select"]="none",s.dom.style["-webkit-touch-callout"]="none";var i=this;function n(){return!1}this.updatePainter=function(e,t){i.refreshShapes(e,t)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(e){return this.refresh(e,!0),this}refresh(e,t){var r=this.storage.getShapeList(!0);return this._paintList(r,t),"function"==typeof e&&e(),this}_paintList(e,t){var r,s,i;for(var n in void 0===t&&(t=!1),this._updateLayerStatus(e),this._layers)"hover"!==n&&(this._layers[n].unusedCount++,this._layers[n].updateTransform());for(var a=[],o=0,l=e.length;o0&&e>this._zlevelList[0]){for(i=0;ie);i++);s=this._layers[this._zlevelList[i]]}this._zlevelList.splice(i+1,0,e),t=new ha($.createUniqueID("_levelLayer_"+e),this);var n=s?s.dom:this._bgDom;n.nextSibling?n.parentNode.insertBefore(t.dom,n.nextSibling):n.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&(new bn).merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}getLayers(){return this._layers}_updateLayerStatus(e){var t=this._layers,r={};for(let e in t)"hover"!==e&&(r[e]=t[e].elCount,t[e].elCount=0);for(let r=0;r0?1.1:1/1.1,r=this.painter.getLayers(),s=!1;for(var i in r)if("hover"!==i){var n=r[i],a=n.position;if(n.zoomable){n.__zoom=n.__zoom||1;var o=n.__zoom;o*=t,t=(o=Math.max(Math.min(n.maxZoom,o),n.minZoom))/n.__zoom,n.__zoom=o,a[0]-=(this._mouseX-a[0])*(t-1),a[1]-=(this._mouseY-a[1])*(t-1),n.scale[0]*=t,n.scale[1]*=t,n.dirty=!0,s=!0}}s&&this.painter.refresh(),this._dispatchAgency(this._lastHover,zn.EVENT.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){this._clickThreshold++,e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=Jn.Util_event.getX(e),this._mouseY=Jn.Util_event.getY(e);var t=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var s="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var i=this.painter.getLayers(),n=!1;for(var a in i)if("hover"!==a){var o=i[a];o.panable&&(s="move",o.position[0]+=t,o.position[1]+=r,n=!0,o.dirty=!0)}n&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?s="move":this._hasfound&&this._lastHover.clickable&&(s="pointer"),this.root.style.cursor=s,this._dispatchAgency(this._lastHover,zn.EVENT.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){var t=(e=this._zrenderEventFixed(e)).toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.refreshHover(),this.dispatch(zn.EVENT.GLOBALOUT,e)},mousedown:function(e){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=e.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,zn.EVENT.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,zn.EVENT.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&Jn.Util_event.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;i--){var n=r[i];if(void 0!==n.zlevel&&(e=this.painter.getLayer(n.zlevel,e),s[0]=this._mouseX,s[1]=this._mouseY,e.needTransform&&(Jn.Util_matrix.invert(t,e.transform),Jn.Util_vector.applyTransform(s,s,t))),this._findHover(n,s[0],s[1]))break}}_mobildFindFixed(e){var t=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(t,1)}_update(){var e=(new Date).getTime(),t=e-this._time,r=this._clips,s=r.length,i=[],n=[];for(let t=0;t=0&&!(m[b]<=a);b--);b=Math.min(b,h-2)}else{for(b=T;ba);b++);b=Math.min(b-1,h-2)}T=b,M=a;var o=m[b+1]-m[b];if(0!==o){if(S=(a-m[b])/o,n)if(_=y[b],x=y[0===b?b:b-1],w=y[b>h-2?h-1:b+1],C=y[b>h-3?h-1:b+2],c)pa._catmullRomInterpolateArray(x,_,w,C,S,S*S,S*S*S,s(e,l),p);else{let t;t=d?pa.rgba2String(E):pa._catmullRomInterpolate(x,_,w,C,S,S*S,S*S*S),r(e,l,t)}else if(c)pa._interpolateArray(y[b],y[b+1],S,s(e,l),p);else{let t;d?(pa._interpolateArray(y[b],y[b+1],S,E,1),t=pa.rgba2String(E)):t=pa._interpolateNumber(y[b],y[b+1],S),r(e,l,t)}for(b=0;b0){let e=n.SheetNames[0],r=Ta.utils.sheet_to_csv(n.Sheets[e]);t&&t.call(s,r)}}catch(e){r&&r.call(s,e)}},i.onerror=function(e){r&&r.call(s,e)},this.rABF&&i.readAsArrayBuffer(e.file)},processDataToGeoJson(e,t,r,s,i){let n=null;if("EXCEL"===e||"CSV"===e)n=this.processExcelDataToGeoJson(t),r&&r.call(i,n);else if("JSON"===e||"GEOJSON"===e){let e=t;"string"==typeof e&&(e=JSON.parse(e)),"ISERVER"===e.type?n=e.data.recordsets[0].features:"FeatureCollection"===e.type?n=e:s&&s.call(i,Ca.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(i,n)}else s&&s.call(i,Ca.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson(e){let t=this.string2Csv(e),r=t.colTitles,s=-1,i=-1;for(let e=0,t=r.length;ee.json()).then(s=>{if(!1!==s.succeed)if(s.dataItemServices&&s.dataItemServices.length>0){let i;s.dataItemServices.forEach(s=>{if("RESTDATA"===s.serviceType&&"PUBLISHED"===s.serviceStatus)i=s;else{if("RESTMAP"!==s.serviceType||"PUBLISHED"!==s.serviceStatus)return void r.getDatafromContent(e,t);i=s}}),i&&r.getDatafromRest(i.serviceType,i.address,t)}else r.getDatafromContent(e,t);else r._fireFailedEvent(s)}).catch(e=>{console.log(e),r._fireFailedEvent(e)})}getDatafromContent(e,t){let r={result:{}},s=this;e+="/content.json?pageSize=9999999¤tPage=1",Be.get(e,null,{withCredentials:this.datasets.withCredentials}).then(e=>e.json()).then(e=>{if(!1!==e.succeed){if(e.type){if("JSON"===e.type||"GEOJSON"===e.type){if(e.content=JSON.parse(e.content.trim()),!e.content.features)return void console.log(Ca.i18n("msg_jsonResolveFiled"));let t=this._formatGeoJSON(e.content);r.result.features={type:e.content.type,features:t}}else if("EXCEL"===e.type||"CSV"===e.type){let t=this._excelData2Feature(e.content);r.result.features={type:"FeatureCollection",features:t}}t(r,"content")}}else s._fireFailedEvent(e)},this).catch(e=>{console.log(e),s._fireFailedEvent(e)})}getDatafromRest(e,t,r){let s=this,i=this.datasets.withCredentials;if("RESTDATA"===e){let e,n,a=`${t}/data/datasources`;Be.get(a,null,{withCredentials:i}).then(e=>e.json()).then(o=>{e=o.datasourceNames[0],a=`${t}/data/datasources/${e}/datasets`,Be.get(a,null,{withCredentials:i}).then(e=>e.json()).then(i=>(n=i.datasetNames[0],s.getDatafromRestData(`${t}/data`,[e+":"+n],r),[e+":"+n])).catch(function(e){s._fireFailedEvent(e)})}).catch(function(e){s._fireFailedEvent(e)})}else{let e,n,a,o=`${t}/maps`;Be.get(o,null,{withCredentials:i}).then(e=>e.json()).then(l=>{e=l[0].name,a=l[0].path,o=o=`${t}/maps/${e}/layers`,Be.get(o,null,{withCredentials:i}).then(e=>e.json()).then(e=>(n=e[0].subLayers.layers[0].caption,s.getDatafromRestMap(n,a,r),n)).catch(function(e){s._fireFailedEvent(e)})}).catch(function(e){s._fireFailedEvent(e)})}}getDatafromRestData(e,t,r){let s=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,e=>{r(e,"RESTDATA")},e=>{console.log(e),s._fireFailedEvent(e)})}getDatafromRestMap(e,t,r){let s=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,e=>{r(e,"RESTMAP")},e=>{console.log(e),s._fireFailedEvent(e)})}_getFeatureBySQL(e,t,r,s,i){let n,a,o,l={name:t.join().replace(":","@")};Object.assign(l,r),n=new pt(l),o=new Vr({queryParameter:n,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),(a=new zr(e,{eventListeners:{processCompleted:e=>{s&&s(e)},processFailed:e=>{i&&i(e)}}})).processAsync(o)}_queryFeatureBySQL(e,t,r,s,i,a,o,l,h,u){var c,d,p={name:t};Object.assign(p,r),c=new pt(p),s&&(c.fields=s);var f={queryParams:[c]};u&&(f.queryOption=n.ATTRIBUTE),l&&(f.startRecord=l),h&&(f.expectCount=h),i&&(f.prjCoordSys={epsgCode:i}),d=new Ws(f),this._queryBySQL(e,d,e=>{"processCompleted"===e.type?a(e):o(e)})}_queryBySQL(e,t,r,s){new Ys(e,{eventListeners:{scope:this,processCompleted:r,processFailed:r},format:this._processFormat(s)}).processAsync(t)}_processFormat(e){return e||t.GEOJSON}_formatGeoJSON(e){let t=e.features;return t.forEach((e,t)=>{e.properties.index=t}),t}_excelData2Feature(e){let t=e.colTitles,r=-1,s=-1;for(let e=0,i=t.length;e0&&e.forEach(function(e){e.xAxis&&t.xField.push({field:e.xAxis.field,name:e.xAxis.name}),e.yAxis&&t.yField.push({field:e.yAxis.field,name:e.yAxis.name})})}getDatasetInfo(e){this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new Ea(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:e=>{this.events.triggerEvent("getdatafailed",e)}}))}_getDatasetInfoSuccess(e){let t=this.datasets.url,r=t.indexOf("rest");if(r>0){let s=t.indexOf("/",r+5),i=t.substring(r+5,s),n=t.substring(0,r+4)+"/data";if("maps"===i){let i=t.indexOf("/",s+1),a=t.substring(s+1,i);n=t.substring(0,r+4)+"/maps/"+a,e.result.dataUrl=n,this._getLayerFeatures(e)}else"data"===i&&(e.result.dataUrl=n,this._getDataFeatures(e))}}_getDataInfoSuccess(e,t){let r=this;"RESTMAP"===t?r._getChartDatasFromLayer(e):r._getChartDatas(e)}_getDataFeatures(e){this.chartModel.getDataFeatures(e,this._getChartDatas.bind(this))}_getLayerFeatures(e){this.chartModel.getLayerFeatures(e,this._getChartDatasFromLayer.bind(this))}_getChartDatas(e){if(e){this.features=e.result.features;let t=this.features.features,r={};if(t.length){let e=t[0],s=[],i=[];for(let t in e.properties)s.push(t),i.push(this._getDataType(e.properties[t]));r={features:t,fieldCaptions:s,fieldTypes:i,fieldValues:[]};for(let e in i){let s=[];for(let i in t){let n=t[i],a=r.fieldCaptions[e],o=n.properties[a];s.push(o)}r.fieldValues.push(s)}this.createChart(r)}}}_getChartDatasFromLayer(e){if(e.result.recordsets){let t=e.result.recordsets[0],r=t.features.features;this.features=t.features;let s={};if(r.length){s={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]};for(let e in s.fieldCaptions){let t=[];for(let i in r){let n=r[i],a=s.fieldCaptions[e],o=n.properties[a];t.push(o)}s.fieldValues.push(t)}this.createChart(s)}}}_createChartOptions(e){return this.calculatedData=this._createChartDatas(e),this.updateChartOptions(this.chartType)}changeType(e){if(e!==this.chartType)return this.chartType=e,this.updateChartOptions(this.chartType)}updateData(e,t,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(t),e.type=e.type||"iServer",e.withCredentials=e.withCredentials||!1,this.datasets=e,this.getDatasetInfo(this._updateDataSuccess.bind(this))}_updateDataSuccess(e){let t=this._createChartOptions(e);this.updateChart(t)}updateChartOptions(e,t){if(this.calculatedData){let r=this.grid,s=this._createChartSeries(this.calculatedData,e),i=[];for(let e in this.calculatedData.XData)i.push({value:this.calculatedData.XData[e].fieldsData});let n={type:"category",name:this.xField[0].name||"X",data:i,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},a={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},o={formatter:"{b0}: {c0}"},l="#404a59";return t&&(t.grid&&(r=t.grid),t.tooltip&&(o=t.tooltip),t.backgroundColor&&(l=t.backgroundColor)),{backgroundColor:l,grid:r,series:s,xAxis:n,yAxis:a,tooltip:o}}}_createChartDatas(e){let t=0,r=[],s=e.fieldCaptions,i=this;s.forEach(function(e,r){i.xField[0]&&e===i.xField[0].field&&(t=r)}),this.yFieldName="",this.yField.forEach(function(e,t){0!==t&&(i.yFieldName=i.yFieldName+","),i.yFieldName=i.yFieldName+e.name,s.forEach(function(t,s){t===e.field&&r.push(s)})});let n=this._getAttrData(e,t),a=[];if(r.length>0)r.forEach(function(t){let r=[];for(let s in e.fieldValues[t])r.push({value:e.fieldValues[t][s]});a.push(r)});else{let e=[],t=[],r=n.length;for(let s=0;s0;e--)this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}_changeTabsPage(e){const t=e.target.index;for(let e=0;e{e.showView(t.message)}})}getStyle(){return this.viewModel.getStyle()}getFeatures(){return this.viewModel.getFeatures()}setStyle(e){let t=this.viewModel.setStyle(e);this._updateChart(t)}changeType(e){if(this.chartType!==e){this.chartType=e;let t=this.viewModel.changeType(e);this._updateChart(t)}}updateData(e,t){let r=this;this.viewModel.updateData(e,t,function(e){r._updateChart(e),r.addChart&&r.addChart()})}_createChart(e){this.echart=wa().init(document.getElementById(this.domID),null,{renderer:"canvas"});let t=this.viewModel._createChartOptions(e);this.echart.setOption(t),this.addChart&&this.addChart()}_updateChart(e){this.echart&&(this.echart.clear(),this.echart.setOption(e))}},e.Components.ChartViewModel=Aa,e.Components.MessageBox=xa,e.Components.AttributesPopContainer=class extends Pa{constructor(e){e.title=e.title?e.title:"属性",super(e),this.rootContainer.firstChild.hidden=!0,e.attributes=e.attributes?e.attributes:[],this._createAttributesTable(e.attributes)}_createAttributesTable(e){const t=document.createElement("table");t.setAttribute("class","component-popcontainer__content__table");const r=document.createElement("tbody");let s=!0;for(let t in e){const i=document.createElement("tr");s&&i.setAttribute("class","component-popcontainer__content__td--color");const n=document.createElement("td"),a=document.createElement("Span");a.innerHTML=t,n.appendChild(a);const o=document.createElement("td");o.innerHTML=e[t],i.appendChild(n),i.appendChild(o),r.appendChild(i),s=!s}t.appendChild(r),this.appendContent(t)}},e.Components.CityTabsPage=class extends La{constructor(e){super(e),this.rootContainer.classList.add("component-citytabpage--noneBoxShadow"),this.config=e.config,$.isArray(this.config)?(this.header.hidden=!0,this._createCityItem("城市",this.config),this.content.style.border="none"):(this._createTabs(),this.header.onclick=(e=>{for(let e=0;e0;e--)this.content.removeChild(this.content.children[e-1]);const t=this.config[e];for(let e in t)this._createCityItem(e,t[e])}_createCityItem(e,t){const r=document.createElement("div"),s=document.createElement("div");s.setAttribute("class","component-citytabpag__py-key"),s.innerHTML=e,r.appendChild(s);const i=document.createElement("div");i.setAttribute("class","component-citytabpag__content");for(let e=0;e0&&this.appendTabs(e),this.rootContainer=t}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t0;e--)this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}_changeTabsPage(e){const t=e.target.index;for(let e=0;e=0;e--)this.content.removeChild(this.content.children[e])}setPageLink(e){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(e),this._appendPageLink()}_createPageLi(e){for(let t=0;t1;e--)this.link.removeChild(this.link.children[e])}_createLink(e){for(let t=0;t<4;t++){const r=document.createElement("li");r.setAttribute("class","disable");const s=document.createElement("span");r.appendChild(s),0===t?(s.id="first",s.setAttribute("class","supermapol-icons-first")):1===t?(s.id="prev",s.setAttribute("class","supermapol-icons-prev")):2===t?(s.id="next",s.setAttribute("class","supermapol-icons-next")):3===t&&(s.id="last",s.setAttribute("class","supermapol-icons-last")),e.appendChild(r)}}_changePageEvent(e){const t=e.target;if("disable"===t.parentElement.classList[0])return;let r;if(t.id)r=t.id;else{if(!Number(t.innerHTML))return;r=Number(t.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}_changeDisableState(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}_prePageNum(e){const t=[];if(this.currentPage="first"===e?1:"last"===e?this.pageNumberLis.length:"prev"===e?this.currentPage-1:"next"===e?this.currentPage+1:e,this.pageNumberLis.length<=5)for(let e=0;e=this.pageNumberLis.length-3)for(let e=this.pageNumberLis.length-5;e0&&(this.currentPageNumberLis=t)}},e.Components.PopContainer=Pa,e.Components.Select=class extends Oa{constructor(e){super(e),this._initView(e)}_initView(e){let t=this._createElement("div","component-selecttool");e.labelName&&(this._createElement("label","component-selecttool__lable--describe",t).innerHTML=e.labelName);let r=this._createElement("div","component-selecttool--chart",t);r.setAttribute("tabindex","1");let s=this._createElement("div","component-selecttool__name",r);s.title=e.optionsArr[0],s.innerHTML=e.optionsArr[0];let i=this._createElement("div","component-selecttool__trianglebtn--chart",r),n=this._createElement("div","component-triangle-down-img",i),a=this._createElement("div","component-selecttool__content",r),o=this._createElement("div","component-selecttool__content--chart",a),l=this._createElement("div","component-selecttool__scrollarea__content",o);l.setAttribute("tabindex","1"),this.createOptions(l,e.optionsArr),this.optionClickEvent(l,s,e.optionsClickCb),this._selectClickEvent(r,a,n),this.rootContainer=t}createOptions(e,t){for(let r in t){let s=this._createElement("div","component-selecttool__option",e);s.title=t[r],s.innerHTML=t[r]}}_selectClickEvent(e,t,r){e.onclick=function(e){"block"===t.style.display?(t.style.display="none",r.className="component-triangle-down-img"):(t.style.display="block",r.className="triangle-up-img"),e.preventDefault(),e.stopPropagation()},e.onmousedown=function(e){e.target!==this&&(this.focus(),e.preventDefault(),e.stopPropagation())},e.onblur=function(){t.style.display="none",r.className="component-triangle-down-img"}}_createElement(e,t,r){let s=document.createElement(e||"div");return t&&(s.className=t),r&&r.appendChild(s),s}optionClickEvent(e,t,r){for(let s=0;s=e.endTime&&(e.currentTime=e.endTime)}}},e.Format=e.Format||_e,e.Format.GeoJSON=Oe,e.Format.JSON=we,e.Format.WKT=class extends _e{constructor(e){super(e),this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},this.CLASS_NAME="SuperMap.Format.WKT",this.extract={point:function(e){return e.x+" "+e.y},multipoint(e){for(var t=[],r=0,s=e.components.length;r0&&i.push(","),r=t[n].geometry,i.push(this.extractGeometry(r));return s&&i.push(")"),i.join("")}extractGeometry(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")":null}},e.iManager=class extends Ue{constructor(e){super(e)}load(){return this.request("GET",this.serviceUrl+"/web/api/service.json")}createIServer(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/server.json",new Ve(e))}createIPortal(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/portal.json",new Ve(e))}iServerList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/server.json")}iPortalList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/portal.json")}startNodes(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/started.json",e)}stopNodes(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/stopped.json",e)}},e.iManagerCreateNodeParam=Ve,e.iManagerServiceBase=Ue,e.iPortal=class extends ze{constructor(e,t){super(e,t),this.iportalUrl=e,t=t||{},this.withCredentials=t.withCredentials||!1}load(){return Be.get(this.iportalUrl+"/web")}queryResources(e){if(!(e instanceof Je))return new Promise(function(e){e("queryParams is not instanceof iPortalQueryParam !")});var t=this,r=this.iportalUrl+"/gateway/catalog/resource/search.json";return e.t=(new Date).getTime(),this.request("GET",r,e).then(function(e){var r=[];e.content.forEach(function(e){r.push(new He(t.iportalUrl,e))});let s=new qe;return s.content=r,s.total=e.total,s.currentPage=e.currentPage,s.pageSize=e.pageSize,s.aggregations=e.aggregations,s})}updateResourcesShareSetting(e){if(!(e instanceof We))return new Promise(function(e){e("shareParams is not instanceof iPortalShareParam !")});var t=e.resourceType.replace("_","").toLowerCase()+"s";"datas"===t&&(t="mycontent/"+t);var r={ids:e.ids,entities:e.entities},s=this.iportalUrl+"/web/"+t+"/sharesetting.json";return this.request("PUT",s,JSON.stringify(r)).then(function(e){return e})}},e.iPortalAddDataParam=Qe,e.iPortalAddResourceParam=Ye,e.iPortalDataConnectionInfoParam=$e,e.iPortalDataMetaInfoParam=Ze,e.iPortalDataStoreInfoParam=Ke,e.iPortalQueryParam=Je,e.iPortalQueryResult=qe,e.iPortalRegisterServiceParam=Xe,e.iPortalResource=He,e.iPortalServiceBase=ze,e.iPortalShareEntity=class{constructor(e){e=e||{},this.permissionType="",this.entityType="",this.entityName="GUEST",this.entityId=null,$.extend(this,e)}},e.iPortalShareParam=We,e.iPortalUser=class extends ze{constructor(e){super(e),this.iportalUrl=e}deleteResources(e){var t=e.resourceType.replace("_","").toLowerCase(),r=this.iportalUrl+"/web/"+t+"s.json?ids="+encodeURI(JSON.stringify(e.ids));return"data"===t?(r=this.iportalUrl+"/web/mycontent/datas/delete.json",this.request("POST",r,JSON.stringify(e.ids))):this.request("DELETE",r)}addMap(e){if(!(e instanceof Ye))return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},r=this.iportalUrl+"/web/maps/batchaddmaps.json";return this.request("POST",r,JSON.stringify(t)).then(function(e){return e})}addScene(e){if(!(e instanceof Ye))return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},r=this.iportalUrl+"/web/scenes/batchaddscenes.json";return this.request("POST",r,JSON.stringify(t)).then(function(e){return e})}registerService(e){if(!(e instanceof Xe))return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");let t={type:e.type,tags:e.tags,authorizeSetting:e.entities,metadata:e.metadata,addedMapNames:e.addedMapNames,addedSceneNames:e.addedSceneNames},r=this.iportalUrl+"/web/services.json";return this.request("POST",r,JSON.stringify(t)).then(e=>e)}getErrMsgPromise(e){return new Promise(t=>{t(e)})}uploadDataRequest(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/upload.json";return this.request("POST",r,t)}addData(e,t){if(!(e instanceof Qe))return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");var r,s=this.iportalUrl+"/web/mycontent/datas.json",i={fileName:e.fileName,tags:e.tags,type:e.type},n=e.type.toLowerCase();if("excel"===n||"csv"===n){if(!(e.dataMetaInfo instanceof Ze))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");r={xField:e.dataMetaInfo.xField,yField:e.dataMetaInfo.yField},"csv"===n&&(r.fileEncoding=e.dataMetaInfo.fileEncoding),i.coordType="WGS84",i.dataMetaInfo=r}else if("hdfs"===n||"hbase"===n){if(!(e.dataMetaInfo instanceof Ze))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof Ke))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");var a={type:e.dataMetaInfo.dataStoreInfo.type};switch(n){case"hdfs":a.url=e.dataMetaInfo.dataStoreInfo.url,r={url:e.dataMetaInfo.url,dataStoreInfo:a};break;case"hbase":if(!(e.dataMetaInfo.dataStoreInfo.connectionInfo instanceof $e))return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");a.connectionInfo={dataBase:e.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,server:e.dataMetaInfo.dataStoreInfo.connectionInfo.server,engineType:"HBASE"},a.datastoreType="SPATIAL",r={dataStoreInfo:a}}i.dataMetaInfo=r}return this.request("POST",s,JSON.stringify(i)).then(e=>"hdfs"===n||"hbase"===n?e:e.childID?this.uploadDataRequest(e.childID,t):e.customResult)}publishOrUnpublish(e,t){if(!e.dataId||!e.serviceType)return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");var r=e.dataId,s=e.dataServiceId,i=e.serviceType,n=this.iportalUrl+"/web/mycontent/datas/"+r+"/publishstatus.json?serviceType="+i;return s&&(n+="&dataServiceId="+s),this.request("PUT",n,JSON.stringify(t)).then(e=>t?(s||(s=e.customResult),s):e)}getDataPublishedStatus(e,t){var r=this.iportalUrl+"/web/mycontent/datas/"+e+"/publishstatus.json?dataServiceId="+t+"&forPublish=true";return this.request("GET",r)}unPublishDataService(e){return this.publishOrUnpublish(e,!1)}publishDataService(e){return this.publishOrUnpublish(e,!0)}},e.AddressMatchService=st,e.AggregationParameter=it,e.AreaSolarRadiationParameters=at,e.AreaSolarRadiationService=lt,e.BucketAggParameter=nt,e.BufferAnalystParameters=ct,e.BufferAnalystService=yt,e.BufferDistance=ht,e.BuffersAnalystJobsParameter=St,e.BuffersAnalystJobsService=_t,e.BufferSetting=ut,e.BurstPipelineAnalystParameters=wt,e.BurstPipelineAnalystService=Tt,e.ChartFeatureInfoSpecsService=Mt,e.ChartQueryFilterParameter=Et,e.ChartQueryParameters=At,e.ChartQueryService=Pt,e.ClipParameter=class{constructor(e){this.clipDatasetName=null,this.clipDatasourceName=null,this.clipRegion=null,this.isClipInRegion=!0,this.isExactClip=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.ClipParameter"}destroy(){var e=this;e.clipDatasetName=null,e.clipDatasourceName=null,e.clipRegion=null,e.isClipInRegion=null,e.isExactClip=null}toJSON(){return $.toJSON({isClipInRegion:this.isClipInRegion,clipDatasetName:this.clipDatasetName,clipDatasourceName:this.clipDatasourceName,isExactClip:this.isExactClip,clipRegion:Ae.fromGeometry(this.clipRegion)})}},e.ColorDictionary=Lt,e.CommonServiceBase=et,e.ComputeWeightMatrixParameters=Ft,e.ComputeWeightMatrixService=kt,e.CreateDatasetParameters=Gi,e.DataFlowService=Rt,e.DataReturnOption=dt,e.DatasetBufferAnalystParameters=ft,e.DatasetInfo=Dt,e.DatasetOverlayAnalystParameters=Bt,e.DatasetService=Lr,e.DatasetSurfaceAnalystParameters=Vt,e.DatasetThiessenAnalystParameters=Jt,e.DatasourceConnectionInfo=gt,e.DatasourceService=qt,e.DensityAnalystService=Wt,e.DensityKernelAnalystParameters=Ht,e.EditFeaturesParameters=Yt,e.EditFeaturesService=Xt,e.FacilityAnalyst3DParameters=Qt,e.FacilityAnalystSinks3DParameters=Zt,e.FacilityAnalystSinks3DService=Kt,e.FacilityAnalystSources3DParameters=$t,e.FacilityAnalystSources3DService=er,e.FacilityAnalystStreamParameters=tr,e.FacilityAnalystStreamService=rr,e.FacilityAnalystTracedown3DParameters=sr,e.FacilityAnalystTracedown3DService=ir,e.FacilityAnalystTraceup3DParameters=nr,e.FacilityAnalystTraceup3DService=ar,e.FacilityAnalystUpstream3DParameters=or,e.FacilityAnalystUpstream3DService=lr,e.FieldParameters=hr,e.FieldsFilter=an,e.FieldStatisticService=ur,e.FieldStatisticsParameters=class extends hr{constructor(e){super(e),this.fieldName=null,this.statisticMode=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.FieldStatisticsParameters"}destroy(){this.fieldName=null,this.statisticMode=null}},e.FilterParameter=pt,e.FindClosestFacilitiesParameters=cr,e.FindClosestFacilitiesService=dr,e.FindLocationParameters=pr,e.FindLocationService=fr,e.FindMTSPPathsParameters=mr,e.FindMTSPPathsService=yr,e.FindPathParameters=gr,e.FindPathService=vr,e.FindServiceAreasParameters=br,e.FindServiceAreasService=Sr,e.FindTSPPathsParameters=xr,e.FindTSPPathsService=_r,e.GenerateSpatialDataParameters=wr,e.GenerateSpatialDataService=Cr,e.GeoCodingParameter=tt,e.GeoDecodingParameter=rt,e.GeoHashGridAggParameter=class extends nt{constructor(e){super(),this.precision=5,$.extend(this,e),this.aggType=G.GEOHASH_GRID,this.CLASS_NAME="SuperMap.GeoHashGridAggParameter"}destroy(){super.destroy(),this.aggType=null,this.precision=null}static toJsonParameters(e){var t={aggName:e.aggName,aggFieldName:e.aggFieldName,aggType:e.aggType,precision:e.precision};return $.toJson(t)}},e.GeometryBatchAnalystService=Ai,e.GeometryBufferAnalystParameters=mt,e.GeometryOverlayAnalystParameters=Tr,e.GeometrySurfaceAnalystParameters=Mr,e.GeometryThiessenAnalystParameters=Er,e.GeoprocessingService=Ar,e.GeoRelationAnalystParameters=Or,e.GeoRelationAnalystService=Pr,e.GetFeaturesByBoundsParameters=Nr,e.GetFeaturesByBoundsService=kr,e.GetFeaturesByBufferParameters=Rr,e.GetFeaturesByBufferService=Dr,e.GetFeaturesByGeometryParameters=Gr,e.GetFeaturesByGeometryService=Br,e.GetFeaturesByIDsParameters=jr,e.GetFeaturesByIDsService=Ur,e.GetFeaturesBySQLParameters=Vr,e.GetFeaturesBySQLService=zr,e.GetFeaturesParametersBase=Ir,e.GetFeaturesServiceBase=Fr,e.GetFieldsService=Jr,e.GetGridCellInfosParameters=qr,e.GetGridCellInfosService=Hr,e.GetLayersInfoService=_s,e.Grid=bs,e.HillshadeParameter=class extends qi{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=j.HILLSHADE,$.extend(this,e),this.CLASS_NAME="SuperMap.HillshadeParameter"}destroy(){super.destroy(),this.altitude=null,this.azimuth=null,this.zFactor=null}toJSON(){return{altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,type:this.type}}},e.Image=Ss,e.ImageCollectionService=sn,e.ImageGFAspect=dn,e.ImageGFHillShade=cn,e.ImageGFOrtho=pn,e.ImageGFSlope=fn,e.ImageRenderingRule=un,e.ImageSearchParameter=ln,e.ImageService=nn,e.ImageStretchOption=hn,e.InterpolationAnalystParameters=ws,e.InterpolationAnalystService=As,e.InterpolationDensityAnalystParameters=Ts,e.InterpolationIDWAnalystParameters=Ms,e.InterpolationKrigingAnalystParameters=Es,e.InterpolationRBFAnalystParameters=Cs,e.JoinItem=ys,e.KernelDensityJobParameter=Os,e.KernelDensityJobsService=Ps,e.LabelImageCell=class extends Ls{constructor(e){super(e),this.height=0,this.pathField=null,this.rotation=0,this.width=0,this.sizeFixed=!1,this.type="IMAGE",e&&$.extend(this,e),this.CLASS_NAME="SuperMap.LabelImageCell"}destroy(){var e=this;e.height=null,e.pathField=null,e.rotation=null,e.width=null,e.sizeFixed=null}},e.LabelMatrixCell=Ls,e.LabelMixedTextStyle=Kr,e.LabelSymbolCell=class extends Ls{constructor(e){super(e),this.style=new Te,this.symbolIDField=null,this.type="SYMBOL",e&&$.extend(this,e),this.CLASS_NAME="SuperMap.LabelSymbolCell"}destroy(){this.style&&(this.style.destroy(),this.style=null),this.symbolIDField=null}},e.LabelThemeCell=class extends Ls{constructor(e){super(e),this.themeLabel=new rs,this.type="THEME",e&&$.extend(this,e),this.CLASS_NAME=" SuperMap.LabelThemeCell"}destroy(){this.themeLabel&&(this.themeLabel.destroy(),this.themeLabel=null)}},e.LayerStatus=class{constructor(e){this.layerName=null,this.isVisible=null,this.displayFilter=null,this.fieldValuesDisplayFilter=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.LayerStatus"}destroy(){this.layerName=null,this.isVisible=null,this.displayFilter=null}toJSON(){var e="{";e+='"type":"UGC",';var t=[];return this.layerName&&(t.push('"name":"'+this.layerName+'"'),t.push('"visible":'+this.isVisible)),this.displayFilter&&t.push('"displayFilter":"'+this.displayFilter+'"'),(this.minScale||0==this.minScale)&&t.push('"minScale":'+this.minScale),(this.maxScale||0==this.maxScale)&&t.push('"maxScale":'+this.maxScale),this.fieldValuesDisplayFilter&&t.push('"fieldValuesDisplayFilter":'+$.toJSON(this.fieldValuesDisplayFilter)),e+=t,e+="}"}},e.LinkItem=class{constructor(e){this.datasourceConnectionInfo=null,this.foreignKeys=null,this.foreignTable=null,this.linkFields=null,this.linkFilter=null,this.name=null,this.primaryKeys=null,e&&$.extend(this,e),this.CLASS_NAME="SuperMap.LinkItem"}destroy(){var e=this;e.datasourceConnectionInfo instanceof gt&&(e.datasourceConnectionInfo.destroy(),e.datasourceConnectionInfo=null),e.foreignKeys=null,e.foreignTable=null,e.linkFields=null,e.linkFilter=null,e.name=null,e.primaryKeys=null}},e.MappingParameters=bt,e.MapService=Is,e.MathExpressionAnalysisParameters=Ns,e.MathExpressionAnalysisService=Fs,e.MeasureParameters=ks,e.MeasureService=Rs,e.MetricsAggParameter=class extends it{constructor(e){super(),this.aggType=B.AVG,$.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy(),this.aggType=null}},e.NDVIParameter=class extends qi{constructor(e){super(e),this.redIndex=0,this.nirIndex=1,this.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff",this.type=j.NDVI,$.extend(this,e),this.CLASS_NAME="SuperMap.NDVIParameter"}destroy(){super.destroy(),this.redIndex=null,this.nirIndex=null,this.colorMap=null}toJSON(){return{redIndex:this.redIndex,nirIndex:this.nirIndex,colorMap:this.colorMap,type:this.type}}},e.NetworkAnalystServiceBase=Ct,e.OutputSetting=vt,e.OverlapDisplayedOptions=class{constructor(e){e=e||{},this.allowPointOverlap=!0,this.allowPointWithTextDisplay=!0,this.allowTextOverlap=!1,this.allowTextAndPointOverlap=!0,this.allowThemeGraduatedSymbolOverlap=!1,this.allowThemeGraphOverlap=!1,this.horizontalOverlappedSpaceSize=0,this.verticalOverlappedSpaceSize=0,$.extend(this,e),this.ugcLayer=new fs(e),this.CLASS_NAME="SuperMap.OverlapDisplayedOptions"}destroy(){$.reset(this)}fromJson(e){this.ugcLayer.fromJson.apply(this,[e])}toServerJSONObject(){return this.ugcLayer.toServerJSONObject.apply(this,arguments)}toString(){var e=this.ugcLayer.toServerJSONObject.apply(this,arguments),t="{";for(var r in e)e.hasOwnProperty(r)&&(t+="'"+r+"':"+e[r]+",");return t=t.substr(0,t.length-1),t+="}"}},e.OverlayAnalystParameters=Gt,e.OverlayAnalystService=Ds,e.OverlayGeoJobParameter=Gs,e.OverlayGeoJobsService=Bs,e.PointWithMeasure=Me,e.ProcessingServiceBase=xt,e.QueryByBoundsParameters=js,e.QueryByBoundsService=Vs,e.QueryByDistanceParameters=zs,e.QueryByDistanceService=Js,e.QueryByGeometryParameters=qs,e.QueryByGeometryService=Hs,e.QueryBySQLParameters=Ws,e.QueryBySQLService=Ys,e.QueryParameters=Ot,e.QueryService=Us,e.RasterFunctionParameter=qi,e.Route=Ee,e.RouteCalculateMeasureParameters=Xs,e.RouteCalculateMeasureService=Qs,e.RouteLocatorParameters=Zs,e.RouteLocatorService=Ks,e.ServerColor=Ce,e.ServerFeature=$s,e.ServerGeometry=Ae,e.ServerStyle=Te,e.ServerTextStyle=Yr,e.ServerTheme=vs,e.SetDatasourceParameters=ei,e.SetLayerInfoParameters=class{constructor(e){e=e||{},this.resourceID=null,this.tempLayerName=null,this.layerInfo=null,$.extend(this,e),this.CLASS_NAME="SuperMap.SetLayerInfoParameters"}destroy(){this.resourceID=null,this.tempLayerName=null,this.layerInfo=null}},e.SetLayerInfoService=ti,e.SetLayersInfoParameters=class{constructor(e){e=e||{},this.isTempLayers=null,this.resourceID=null,this.layersInfo=null,$.extend(this,e),this.CLASS_NAME="SuperMap.SetLayersInfoParameters"}destroy(){this.isTempLayers=null,this.resourceID=null,this.layersInfo=null}},e.SetLayersInfoService=ri,e.SetLayerStatusParameters=si,e.SetLayerStatusService=ii,e.SingleObjectQueryJobsParameter=ni,e.SingleObjectQueryJobsService=ai,e.Sortby=on,e.SpatialAnalystBase=ot,e.StopQueryParameters=oi,e.StopQueryService=li,e.SummaryAttributesJobsParameter=hi,e.SummaryAttributesJobsService=ui,e.SummaryMeshJobParameter=ci,e.SummaryMeshJobsService=di,e.SummaryRegionJobParameter=pi,e.SummaryRegionJobsService=fi,e.SupplyCenter=mi,e.SurfaceAnalystParameters=Ut,e.SurfaceAnalystParametersSetting=jt,e.SurfaceAnalystService=yi,e.TerrainCurvatureCalculationParameters=gi,e.TerrainCurvatureCalculationService=vi,e.Theme=Wr,e.ThemeDotDensity=hs,e.ThemeFlow=bi,e.ThemeGraduatedSymbol=cs,e.ThemeGraduatedSymbolStyle=us,e.ThemeGraph=ls,e.ThemeGraphAxes=is,e.ThemeGraphItem=os,e.ThemeGraphSize=ns,e.ThemeGraphText=as,e.ThemeGridRange=xi,e.ThemeGridRangeItem=Si,e.ThemeGridUnique=wi,e.ThemeGridUniqueItem=_i,e.ThemeLabel=rs,e.ThemeLabelAlongLine=es,e.ThemeLabelBackground=ts,e.ThemeLabelItem=Xr,e.ThemeLabelText=$r,e.ThemeLabelUniqueItem=Ci,e.ThemeMemoryData=class{constructor(e,t){this.srcData=e,this.targetData=t,this.CLASS_NAME="SuperMap.ThemeMemoryData"}destroy(){this.srcData=null,this.targetData=null}toJSON(){if(this.srcData&&this.targetData){for(var e="",t=Math.min(this.srcData.length,this.targetData.length),r=0;r0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}return null}},e.ThemeOffset=Zr,e.ThemeParameters=Ti,e.ThemeRange=ps,e.ThemeRangeItem=ds,e.ThemeService=Mi,e.ThemeUnique=ss,e.ThemeUniqueItem=Qr,e.ThiessenAnalystParameters=zt,e.ThiessenAnalystService=Ei,e.TilesetsService=Oi,e.TopologyValidatorJobsParameter=Pi,e.TopologyValidatorJobsService=Li,e.TransferLine=Ii,e.TransferPathParameters=Ni,e.TransferPathService=Fi,e.TransferSolutionParameters=ki,e.TransferSolutionService=Ri,e.TransportationAnalystParameter=Nt,e.TransportationAnalystResultSetting=It,e.UGCLayer=fs,e.UGCMapLayer=ms,e.UGCSubLayer=gs,e.UpdateDatasetParameters=Vi,e.UpdateEdgeWeightParameters=Di,e.UpdateEdgeWeightService=Bi,e.UpdateTurnNodeWeightParameters=ji,e.UpdateTurnNodeWeightService=Ui,e.Vector=xs,e.VectorClipJobsParameter=zi,e.VectorClipJobsService=Ji,e.WebPrintingJobContent=$i,e.WebPrintingJobCustomItems=Hi,e.WebPrintingJobExportOptions=tn,e.WebPrintingJobImage=Wi,e.WebPrintingJobLayers=Yi,e.WebPrintingJobLayoutOptions=en,e.WebPrintingJobLegendOptions=Xi,e.WebPrintingJobLittleMapOptions=Qi,e.WebPrintingJobNorthArrowOptions=Zi,e.WebPrintingJobParameters=class{constructor(e){e&&(this.content=null,this.layoutOptions=null,this.exportOptions=null,$.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof $i&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof en&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof tn&&(this.exportOptions.destroy(),this.exportOptions=null)}},e.WebPrintingJobScaleBarOptions=Ki,e.WebPrintingService=rn,e.Online=class{constructor(){this.rootUrl="https://www.supermapol.com",this.webUrl=this.rootUrl+"/web";var e=this.webUrl+"/mycontent";this.mDatasUrl=e+"/datas",this.CLASS_NAME="SuperMap.Online"}load(){return Be.get(this.rootUrl).then(function(e){return e})}login(){je.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,r=t.mDatasUrl;return e&&(e=e.toJSON()),Be.get(r,e).then(function(e){if(e&&e.content&&!(e.content.length<1)){for(var r=[],s=e.content,i=s.length,n=0;nr[1])return;var n=this.calculateXShapeInfo();if(n){var a=n.xPositions,o=n.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(ta.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(ta.GraphAxis(this.shapeFactory,s,t,n)));for(var l=0;l=t.length&&(r%=t.length);var l=t[r][0],h=t[r][1],u=(new Sn).getLinearGradient(a,0,o,0,[[0,l],[1,h]]);i.style.color=u}}}},e.Feature.Theme.Bar3D=class extends sa{constructor(e,t,r,s,i){super(e,t,r,s,i),this.CLASS_NAME="SuperMap.Feature.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,25,20,20]:e.dataViewBoxParameter=[5,5,5,5]),e.axisUseArrow=void 0===e.axisUseArrow||e.axisUseArrow,e.axisXLabelsOffset=void 0!==e.axisXLabelsOffset?e.axisXLabelsOffset:[-10,10],this.initBaseParameter()){var t=this.DVBCodomain;this.DVBUnitValue=(t[1]-t[0])/this.DVBHeight;var r=this.dataViewBox,s=this.dataValues;if(!(s.length<1)){for(let e=0,r=s.length;et[1])return;var i=this.calculateXShapeInfo();if(i){var n=i.xPositions,a=i.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ta.Background(this.shapeFactory,this.chartBox,e)),(!e.axis3DParameter||isNaN(e.axis3DParameter)||e.axis3DParameter<15)&&(e.axis3DParameter=20),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(ta.GraphAxis(this.shapeFactory,r,e,i)));var o=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10;for(let i=0;i0?this.DVBUnitValue=e.maxR/(i[1]-i[0]):this.DVBUnitValue=e.maxR;var n=this.DVBUnitValue,a=s[0]*n+e.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!i||!(s[0]i[1]))){var o=this.DVBCenterPoint,l=new Bn(o[0],o[1],a);l.style=ta.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?l.style.fillColor=e.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=ta.ShapeStyleTool(null,e.circleHoverStyle),void 0!==e.circleHoverAble&&(l.hoverable=e.circleHoverAble),void 0!==e.circleClickAble&&(l.clickable=e.circleClickAble),l.refDataID=this.data.id,l.dataInfo={field:this.fields[0],r:a,value:s[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}},e.Feature.Theme.Graph=sa,e.Feature.Theme.Line=class extends sa{constructor(e,t,r,s,i,n){super(e,t,r,s,i,n),this.CLASS_NAME="SuperMap.Feature.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var t=this.dataViewBox,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var s=this.DVBUnitValue,i=this.dataValues;if(!(i.length<1)){var n=this.calculateXShapeInfo();if(n){var a,o,l=n.xPositions;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ta.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(ta.GraphAxis(this.shapeFactory,t,e,n));for(var h=[],u=[],c=0,d=i.length;cr[1])return null;a=l[c],o=t[1]-(i[c]-r[0])/s;var p=new In(a,o);p.style=ta.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,c,i[c]),p.highlightStyle=ta.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(p.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(p.clickable=e.pointClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[c],value:i[c]},u.push(this.shapeFactory.createShape(p));var f=[a,o];h.push(f)}var m=new Nn(h);m.style=ta.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),m.clickable=!1,m.hoverable=!1;var y=this.shapeFactory.createShape(m);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,r=this.setting,s=this.dataValues.length;if(s<1)return null;var i=[],n=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var o=n-((e=r.xShapeBlank)[0]+e[1]);if(o<=s)return null;a=o/(s-1)}else e=[a=n/(s+1),a,a];for(var l=0,h=0;hs[1])return;var i=0;for(let e=0;e=360&&(l=359.9999999);var p=new Rn(a[0],a[1],u,o,l);if(void 0===e.sectorStyleByFields){var f=c%t.length;p.style=ta.ShapeStyleTool(null,e.sectorStyle,t,null,f)}else p.style=ta.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,c,r[c]);p.highlightStyle=ta.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(p.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(p.clickable=e.sectorClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[c],value:r[c]},this.shapes.push(this.shapeFactory.createShape(p)),o=l}this.shapesConvertToRelativeCoordinate()}}}},e.Feature.Theme.Point=class extends sa{constructor(e,t,r,s,i,n){super(e,t,r,s,i,n),this.CLASS_NAME="SuperMap.Feature.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var e=this.setting;if(e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var t=this.dataViewBox,r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var s=this.DVBUnitValue,i=this.dataValues,n=this.calculateXShapeInfo();if(n){var a,o,l=n.xPositions;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ta.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(ta.GraphAxis(this.shapeFactory,t,e,n));for(var h=0,u=i.length;hr[1])return null;a=l[h],o=t[1]-(i[h]-r[0])/s;var c=new In(a,o);c.style=ta.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,i[h]),c.highlightStyle=ta.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(c.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(c.clickable=e.pointClickAble),c.refDataID=this.data.id,c.dataInfo={field:this.fields[h],value:i[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var e,t=this.dataViewBox,r=this.setting,s=this.dataValues.length;if(s<1)return null;var i=[],n=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var o=n-((e=r.xShapeBlank)[0]+e[1]);if(o<=s)return null;a=o/(s-1)}else e=[a=n/(s+1),a,a];for(var l=0,h=0;hs[1])return;var i=0;for(let e=0;e=0&&t.innerRingRadiust.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),r})}_distance(e,t,r,s){return Math.sqrt((e-r)*(e-r)+(t-s)*(t-s))}_getMeterPerMapUnit(e){let t;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}},e.ArrayStatistic=wn,e.ColorsPickerUtil=_n,e.DataFormat=t,e.ServerType=s,e.GeometryType=i,e.QueryOption=n,e.JoinType={INNERJOIN:"INNERJOIN",LEFTJOIN:"LEFTJOIN"},e.SpatialQueryMode=a,e.SpatialRelationType={CONTAIN:"CONTAIN",INTERSECT:"INTERSECT",WITHIN:"WITHIN"},e.MeasureMode=o,e.Unit=l,e.BufferRadiusUnit=h,e.EngineType={IMAGEPLUGINS:"IMAGEPLUGINS",OGC:"OGC",ORACLEPLUS:"ORACLEPLUS",SDBPLUS:"SDBPLUS",SQLPLUS:"SQLPLUS",UDB:"UDB"},e.ThemeGraphTextFormat=u,e.ThemeGraphType=c,e.GraphAxesTextDisplayMode=d,e.GraduatedMode=p,e.RangeMode=f,e.ThemeType={DOTDENSITY:"DOTDENSITY",GRADUATEDSYMBOL:"GRADUATEDSYMBOL",GRAPH:"GRAPH",LABEL:"LABEL",RANGE:"RANGE",UNIQUE:"UNIQUE"},e.ColorGradientType=m,e.TextAlignment=y,e.FillGradientMode={NONE:"NONE",LINEAR:"LINEAR",RADIAL:"RADIAL",CONICAL:"CONICAL",SQUARE:"SQUARE"},e.AlongLineDirection=g,e.LabelBackShape=v,e.LabelOverLengthMode=b,e.DirectionType={EAST:"EAST",NONE:"NONE",NORTH:"NORTH",SOURTH:"SOURTH",WEST:"WEST"},e.OverlayOperationType=x,e.OutputType=_,e.SideType={LEFT:"LEFT",MIDDLE:"MIDDLE",NONE:"NONE",RIGHT:"RIGHT"},e.SupplyCenterType={FIXEDCENTER:"FIXEDCENTER",NULL:"NULL",OPTIONALCENTER:"OPTIONALCENTER"},e.TurnType={AHEAD:"AHEAD",BACK:"BACK",END:"END",LEFT:"LEFT",NONE:"NONE",RIGHT:"RIGHT"},e.BufferEndType=S,e.SmoothMethod=w,e.SurfaceAnalystMethod=C,e.DataReturnMode=T,e.EditType=M,e.TransferTactic=E,e.TransferPreference=A,e.GridType={CROSS:"CROSS",GRID:"GRID",POINT:"POINT"},e.ColorSpaceType={CMYK:"CMYK",RGB:"RGB"},e.LayerType={UGC:"UGC",WMS:"WMS",WFS:"WFS",CUSTOM:"CUSTOM"},e.UGCLayerType={THEME:"THEME",VECTOR:"VECTOR",GRID:"GRID",IMAGE:"IMAGE"},e.StatisticMode={AVERAGE:"AVERAGE",MAX:"MAX",MIN:"MIN",STDDEVIATION:"STDDEVIATION",SUM:"SUM",VARIANCE:"VARIANCE"},e.PixelFormat={BIT16:"BIT16",BIT32:"BIT32",BIT64:"BIT64",SINGLE:"SINGLE",DOUBLE:"DOUBLE",UBIT1:"UBIT1",UBIT4:"UBIT4",UBIT8:"UBIT8",UBIT24:"UBIT24",UBIT32:"UBIT32"},e.SearchMode={KDTREE_FIXED_COUNT:"KDTREE_FIXED_COUNT",KDTREE_FIXED_RADIUS:"KDTREE_FIXED_RADIUS",NONE:"NONE",QUADTREE:"QUADTREE"},e.InterpolationAlgorithmType={KRIGING:"KRIGING",SimpleKriging:"SimpleKriging",UniversalKriging:"UniversalKriging"},e.VariogramMode=O,e.Exponent=P,e.ClientType=L,e.ChartType={BAR:"Bar",BAR3D:"Bar3D",CIRCLE:"Circle",PIE:"Pie",POINT:"Point",LINE:"Line",RING:"Ring"},e.ClipAnalystMode=I,e.AnalystAreaUnit=N,e.AnalystSizeUnit=F,e.StatisticAnalystMode=k,e.SummaryType=R,e.TopologyValidatorRule=D,e.BucketAggType=G,e.MetricsAggType=B,e.GetFeatureMode={BOUNDS:"BOUNDS",BUFFER:"BUFFER",ID:"ID",SPATIAL:"SPATIAL",SQL:"SQL"},e.RasterFunctionType=j,e.ResourceType={MAP:"MAP",SERVICE:"SERVICE",SCENE:"SCENE",DATA:"DATA",INSIGHTS_WORKSPACE:"INSIGHTS_WORKSPACE",MAP_DASHBOARD:"MAP_DASHBOARD"},e.OrderBy={UPDATETIME:"UPDATETIME",HEATLEVEL:"HEATLEVEL",RELEVANCE:"RELEVANCE"},e.OrderType={ASC:"ASC",DESC:"DESC"},e.SearchType={PUBLIC:"PUBLIC",MY_RES:"MY_RES",MYGROUP_RES:"MYGROUP_RES",MYDEPARTMENT_RES:"MYDEPARTMENT_RES",SHARETOME_RES:"SHARETOME_RES"},e.AggregationTypes={TAG:"TAG",TYPE:"TYPE"},e.PermissionType={SEARCH:"SEARCH",READ:"READ",READWRITE:"READWRITE",DELETE:"DELETE",DOWNLOAD:"DOWNLOAD"},e.EntityType={DEPARTMENT:"DEPARTMENT",GROUP:"GROUP",IPORTALGROUP:"IPORTALGROUP",ROLE:"ROLE",USER:"USER"},e.WebExportFormatType={PNG:"PNG",PDF:"PDF"},e.WebScaleOrientationType={HORIZONTALLABELSBELOW:"HORIZONTALLABELSBELOW",HORIZONTALLABELSABOVE:"HORIZONTALLABELSABOVE",VERTICALLABELSLEFT:"VERTICALLABELSLEFT",VERTICALLABELSRIGHT:"VERTICALLABELSRIGHT"},e.WebScaleType={LINE:"LINE",BAR:"BAR",BAR_SUB:"BAR_SUB"},e.WebScaleUnit={METER:"METER",FOOT:"FOOT",DEGREES:"DEGREES"};const Ia=ol.Observable;var Na=r.n(Ia);class Fa extends(Na()){constructor(e,t){super(e,t),this.options=t||{},this.url=e,this.dispatchEvent({type:"initialized",value:this})}}class ka extends Fa{constructor(e,t){super(e,t)}getMapInfo(e){var t=this;new Is(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e},projection:t.options.projection}).processAsync()}getWkt(e){var t=this;new Is(`${t.url}/prjCoordSys.wkt`,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,withoutFormatSuffix:!0,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e},projection:t.options.projection}).processAsync()}getTilesets(e){var t=this;new Oi(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).processAsync()}}const Ra=ol.control.Control;var Da=r.n(Ra);class Ga extends(Da()){constructor(e){function t(e,t,r){var s=document.createElement(e);return s.className=t||"",r&&r.appendChild(s),s}function r(e,t,r,s){var i=function(t){if(r)return r.call(s||e,t||window.event)},n=i;return"addEventListener"in e?"mousewheel"===t?e.addEventListener("onwheel"in e?"wheel":"mousewheel",i,!1):"mouseenter"===t||"mouseleave"===t?(i=function(t){t=t||window.event,function(e,t){var r=t.relatedTarget;if(!r)return!0;try{for(;r&&r!==e;)r=r.parentNode}catch(e){return!1}return r!==e}(e,t)&&n(t)},e.addEventListener("mouseenter"===t?"mouseover":"mouseout",i,!1)):e.addEventListener(t,i,!1):"attachEvent"in e&&e.attachEvent("on"+t,i),this}function s(){this._container.classList.add("ol-control-ctv-expanded")}function i(){this._container.classList.remove("ol-control-ctv-expanded")}function n(){var e=this.getVersion();this.tilesVersion(e)}(e=e||{}).title||(e.title="switch tile version"),e.tooltip||(e.tooltip="top"),e.collapsed||(e.collapsed=!0),e.lastText||(e.lastText="-"),e.nextText||(e.nextText="+"),e.ico||(e.ico="V"),"vertical"!==e.orientation&&(e.orientation="horizontal"),e.switch||(e.switch=!0),super(e),this.options=e,this.element=e.element=function(){var a="ol-control-ctv";this._container=t("div",a+" "+a+"-"+e.orientation+" ol-unselectable ol-control"),this._sliderBtn=t("button",a+"-toggle",this._container),this._sliderBtn.setAttribute("title",e.title),this._sliderBtn.innerHTML=e.ico,this._sliderValue=t("p",a+"-value",this._container),this._sliderValue.innerHTML=e.ico,this._sliderValue.setAttribute("title",e.title);this._sliderContent=t("div","ol-ctv-slider-main tooltip",this._container),"vertical"===e.orientation&&"top"===e.tooltip&&(e.tooltip="right");this.tooltip=t("span","tooltip-text tooltip-"+e.tooltip,this._sliderContent),this.tooltip.innerHTML=e.ico,e.switch&&(this._next=t("a","ol-ctv-slider-incdec ol-ctv-slider-next",this._sliderContent),this._next.innerHTML=e.nextText,r(this._next,"click",this.nextTilesVersion,this),this._container.classList.add(a+"-incdec"));this._sliderContainer=t("div","ol-ctv-slider-container",this._sliderContent),this.slider=t("input","ol-ctv-slider",this._sliderContainer),this.min=null==this.min||isNaN(this.min)?0:parseInt(this.min),this.slider.setAttribute("title",e.title),this.slider.setAttribute("id","slider"),this.slider.setAttribute("type","range"),this.slider.setAttribute("min",this.min),this.slider.setAttribute("max",0),this.slider.setAttribute("step",1),this.slider.setAttribute("value",0),this.firstLoad=!0,"oninput"in this.slider||"onchange"in this.slider?r(this.slider,"change",n,this):this.slider.onpropertychange=n;e.switch&&(this._last=t("a","ol-ctv-slider-incdec ol-ctv-slider-last",this._sliderContent),this._last.innerHTML=e.lastText,r(this._last,"click",this.lastTilesVersion,this));"vertical"==e.orientation?(this.slider.style.width="170px",this._sliderContainer.style.height="170px"):this._sliderContainer.style.width="150px";r(this._container,"click",function(e){e.preventDefault(),e.stopPropagation()},this),e.collapsed?(r(this._container,"mouseenter",s,this),r(this._container,"mouseleave",i,this),r(this._sliderBtn,"click",function(e){e.preventDefault(),e.stopPropagation()}),r(this._sliderBtn,"click",s,this),r(this._sliderBtn,"focus",s,this)):s();return this._container}.call(this),e.layer&&this.setLayer(e.layer)}setContent(e){var t=e||{};this.setVersionName(t.desc).setToolTip(t.desc)}setVersionName(e){var t=e;return e||(t=this.getValue()),this._sliderValue.innerHTML=t,this}setToolTip(e){return this.tooltip.innerHTML=e,this}updateLength(e){e>0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))}setLayer(e){e&&(this.options.layer=e);var t=this,r=t.options.layer;r.on("tilesetsinfoloaded",function(e){var r=e.value&&e.value.tileVersions;t.update(r)}),r.on("tileversionschanged",function(e){var r=e.value&&e.value.tileVersion;t.setContent(r)}),t.getTileSetsInfo()}update(e){this.tileVersions=e||[],this.updateLength(this.tileVersions.length)}getTileSetsInfo(){var e=this;e.options.layer&&new ka(e.options.layer._url).getTilesets(function(t){e.options.layer.setTileSetsInfo(t.result)})}removeLayer(){this.options.layer=null}nextTilesVersion(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)}lastTilesVersion(){return parseInt(this.slider.value)=this.minWidth_)break;++d}this.renderedHTML_=this.renderedHTML_||this.D||this.am,this.innerElement_=this.innerElement_||this.l||this.Tm,this.renderedWidth_=this.renderedWidth_||this.B||this.Am,this.renderedVisible_=this.renderedVisible_||this.j||this.yn,this.element_=this.element_||this.c;let p=h.toFixed(c<0?-c:0)+" "+o;this.renderedHTML_!=p&&(this.innerElement_.innerHTML=p,this.renderedHTML_=p),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}}var qa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAF4AAAAdCAYAAAAjHtusAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMDY3IDc5LjE1Nzc0NywgMjAxNS8wMy8zMC0yMzo0MDo0MiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozYWZlOGIwMi01MWE3LTRiZjYtYWVkYS05MGQ2ZTQ4YjZiMmUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6ODg0NkFBQUE3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6ODg0NkFBQTk3RjEzMTFFNzhFRjJFQkY4RjcxQjc1NjIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKE1hY2ludG9zaCkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4MWI3NzdhNC1lZmEyLTQ1MzUtOGQzNi03MmRjNDkyODMzN2UiIHN0UmVmOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYTYzODVjMi1jNDQ1LTExN2EtYTc0ZC1lM2I5MzJlMGE4Y2QiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5q1HM0AAAF/ElEQVR42tSabYhUVRjHZ7W01C1uaCRW4F3oi9SXCUnwQ9gsGUFvOEtQH1bLu5VS9sbYh5KicjYt29qiGQwVg2xWWKgocob91AvC+CWsoJqB3qHMSdTMpZyeU/+Df07n3pk7997Z6cBv99z7nHvOvf/z/pxJNZvNVI/jCKXmv6EquAmVkxPSlvtp2GItr0/96fFQForChJAWDiVYTkMYMu4XBFcYjLOwWS3sNwmn8NGzZ0h4Flv/zwIdchAnh/slCGmmKUNIBzYPaXOUr0vPuEjD71JAPh7l61embzinhV3V8nnCGmGT8LwlzSL8/yUh4Tfjo9T/CgnCIYNKycA2Qq21AcHU/VHE80Idoo3Qs0W6p0UtUnkZvEMDeVcCyqxEafF7hL8Qf0oYsIj+lfC9cH1CwhchWAGCtZO+AooQOkdC1Km1VtCb63StW73uFSzgKFUkNwBbmZGGmqowhvg8ZNpH9oXChcIcYRdeNomgxLkaH+S1SGubAxyIpFv+Zp+0DYjrAS00j/dem2VGEl6FJ4Qa4quEu8j2hTCJ+GJhe4JjfQMf6JCYPPbysMPxBlp0BUKOogEF9Rg9/heNvNKYfM0KsZUZaYxX4STGrzJa+zbhPeFH2DcK10KItcI+pI0rVElwXl1ULaKnIJhDw0oRQpTQc1zcbwRU8ATy4DR6yMlTzwkqMziEWHvubJ4Nk4ZtHdnqwvwY17xq3Z4FjrG+z2Kdrdf2ZSGD+xlLPh6t1R0jP9fI22ZzKI92yvQl7EbmBxI4S7Y+vIAOL87QZqsc5uNnssxZIcfYjXT9snCR7jjobidp+FkxA2v+Cq1QervMDmp4P7Xs3YZtE9kOC3P/By6JGaETl8ElwueYTNTDq4UDsKnd7YfCNbT239LF1udS72xYJt1UWxNfN4IIP4bWuTpEja01JtMFZFsm/AHbtHBlDE6yasA4moYTrUbvdBTXHqUrAH4uSadbyzF+vbBM2IsNkS3MNa5305JxqfA02T4TnkX8XOH1mPw8ruVejpxbI9hZD2Cz1U7LdrrUvjP/WfZinNZhr6V27hP+FPZh9aLvLxVO4DllX0G2OcKnlO/DCblxaz6uXBtmi+8mBaP3/SP8IuEIiTRoPPQm2TaEmEyXo0JU+F0YiPFD0hhOsiE/vqeEVwyTgF8L51OilcIZ2I4Ll5NttvAJPfukUeB2sk0ZPSbKIUUJpCII7+DasWy08uhNNazT0wGHI7mAtB7KqMKm38HhDdAUibTVKGicbB8YAqrJ9DRsp43JdB4qUof1HQrPE6XTQWu3Ce/inVzjXhXpMiTwUYugNVQ+p80jrUsV5EH0POKeuXO9QjhFq5GryNYvfEMCDhsftYVsB9ETtG0V9ZjfhCURhbcJFpfwVZ9jvhxsLHwTYtp2svlWQw3vXL8UnqHVSIG8l8ex+tHhBXgjddgqHEZ8ufAA2aaEnYgrF/KrPXrEmMUqZ9THLW06xhoBaVueQpkug+ewOUphE3Qv2Q5gGamXYa+QbVq4O+DQ5FHyZqrjxNt7UHh9uuRa0F7HjCF8o9PCTOGnscM7g2u1Hl9C9oeEnxC/1ajZg8JLiM9Hj9GHJseMShwL2DO0G5yEWn3Zh1QUods5CPkIoqlwAZxhXMsb6HrcEPBxchhdJ6wj29vCW4hfLOzo8J3rltYX50nXQAATSf/K4DEaGlTLvplsk/QCpoD60EQ7gLYZc8H9wq+I3yncEOEcNhuz6HWf3XEiwU/4Y8YEqVp2P10rt+8REvBGw026i4aDcbL9jF8r8Blmf4fCOzhViiscskygXRdehf3CO4hfigmTBXyQrl8TFtD1IzQX3CbcQrY3hPcRv4z8OmHPXwchVNln2MmE7BX6VwIFi/he6uxvb6JM3m0fdqvx/ATidxg2JeC7VDErAw5NzGfvwRJVheEIQ8Mg/pdwIM+UOmi9Q8ivCsrIy0tF+wVbEcLrd3Pb2XisEb4Tdlhsi4WP4RBbaLGrHfC3PrvMIezy9rTpGm5lz9LOMG15xvFxD/j5gjzjjDbMOzk+9zzt3v5bgAEAibzFeFHVgYkAAAAASUVORK5CYII=";class Ha extends(Da()){constructor(e){(e=e||{}).imageUrl=e.imageUrl||null,e.width=e.width||null,e.height=e.height||null,e.alt=e.alt||"SuperMap iClient",super(e),this.options=e,this.element=e.element=function(){var e=document.createElement("div");e.className="ol-control-logo ol-unselectable ol-control",function(e){var t=document.getElementsByClassName("ol-attribution"),r=(t=t&&t[0])&&t.clientHeight||29;e.style.bottom=parseInt(r)+6+"px",e.style.right="4px",e.style.marginTop=0,e.style.marginLeft=0,e.style.marginBottom=0,e.style.marginRight=0;var s=document.createElement("style");s.type="text/css",s.innerHTML=".ol-control-logo,.ol-control-logo:hover {background-color: rgba(255,255,255,0);}",document.getElementsByTagName("head")[0].appendChild(s)}.call(this,e);var t=qa;this.options.imageUrl&&(t=this.options.imageUrl);var r=this.options.alt,s=this.options.link,i="94px",n="29px",a="width:"+i+";height:"+n+";";this.options.imageUrl&&(i=this.options.width,n=this.options.height,a="width:"+i+";height:"+n+";",i&&n||(a=""));return e.innerHTML=""+r+"",e}.call(this)}}var Wa={"point-file":"pointFile","point-fill":"fillStyle","point-radius":"pointRadius","point-halo-radius":"pointHaloRadius","point-halo-color":"pointHaloColor","point-dx":"offsetX","point-dy":"offsetY","point-opacity":"globalAlpha","point-comp-op":"globalCompositeOperation"},Ya={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","line-offset":"offset","line-comp-op":"globalCompositeOperation"},Xa={"line-color":"strokeStyle","line-width":"lineWidth","line-cap":"lineCap","line-join":"lineJoin","line-miterlimit":"miterLimit","line-dash-offset":"lineDashOffset","line-opacity":"strokeOpacity","line-dasharray":"lineDasharray","polygon-fill":"fillStyle","polygon-dx":"offsetX","polygon-dy":"offsetY","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"},Qa={CartoStyleMap:{TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-vertical-alignment":"textBaseline","text-horizontal-alignment":"textAlign","text-bold":"bold","text-weight":"fontWeight","text-name":"textName","text-halo-radius":"haloRadius","text-halo-color":"backColor","text-fill":"foreColor","text-opacity":"globalAlpha","text-dx":"offsetX","text-dy":"offsetY","text-comp-op":"globalCompositeOperation"},POINT:Wa,MULTIPOINT:Wa,LINE:Ya,LINESTRING:Ya,MULTILINESTRING:Ya,REGION:Xa,POLYGON:Xa,MULTIPOLYGON:Xa},ServerStyleMap:{fillBackOpaque:{canvasStyle:"",type:"bool",defaultValue:!0},lineWidth:{canvasStyle:"lineWidth",type:"number",unit:"mm",defaultValue:.1},fillBackColor:{canvasStyle:"",type:"color",defaultValue:"rgba(0,0,0,0)"},markerWidth:{canvasStyle:"",type:"number",unit:"mm",defaultValue:""},markerAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:""},fillForeColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{canvasStyle:"fillStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{canvasStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},fillGradientOffsetRatioX:{canvasStyle:"",type:"number",defaultValue:0},fillGradientOffsetRatioY:{canvasStyle:"",type:"number",defaultValue:0},lineColor:{canvasStyle:"strokeStyle",type:"color",defaultValue:"rgba(0,0,0,0)"},fillOpaqueRate:{canvasStyle:"",type:"number",defaultValue:100},markerHeight:{canvasStyle:"",type:"number",unit:"mm",defaultValue:0},fillGradientMode:{canvasStyle:"",type:"string",defaultValue:"NONE"},fillSymbolID:{canvasStyle:"",type:"number",defaultValue:0},fillGradientAngle:{canvasStyle:"",type:"number",unit:"degree",defaultValue:0},markerSymbolID:{canvasStyle:"",type:"number",defaultValue:0},lineSymbolID:{canvasStyle:"",type:"number",defaultValue:0}},CartoCompOpMap:{clear:"",src:"",dst:"","src-over":"source-over","dst-over":"destination-over","src-in":"source-in","dst-in":"destination-in","src-out":"source-out","dst-out":"destination-out","src-atop":"source-atop","dst-atop":"destination-atop",xor:"xor",plus:"lighter",minus:"",multiply:"",screen:"",overlay:"",darken:"",lighten:"lighter","color-dodge":"","color-burn":"","hard-light":"","soft-light":"",difference:"",exclusion:"",contrast:"",invert:"","invert-rgb":"","grain-merge":"","grain-extract":"",hue:"",saturation:"",color:"",value:""}},Za={pointFile:"",pointRadius:3,pointHaloRadius:1,pointHaloColor:"#c33",offsetX:0,offsetY:0,fillStyle:"#fc0",globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},Ka={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineDasharray:[],strokeOpacity:1,offset:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},$a={strokeStyle:"rgba(0,0,0,0)",lineWidth:1,lineCap:"butt",lineJoin:"round",miterLimit:10,lineDashOffset:0,lineOpacity:1,fillOpacity:1,lineDasharray:[],fillStyle:"rgba(0,0,0,0)",polygonOpacity:1,offsetX:0,offsetY:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},eo={TEXT:{font:"10px sans-serif",textAlign:"middle",textBaseline:"center",direction:"ltr",bold:!1,haloRadius:0,backColor:"rgba(255,255,255,1)",foreColor:"rgba(0,0,0,1)",offsetX:0,offsetY:0,textHeight:0,globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0},POINT:Za,MULTIPOINT:Za,LINE:Ka,LINESTRING:Ka,MULTILINESTRING:Ka,REGION:$a,POLYGON:$a,MULTIPOLYGON:$a,SHADOW:{shadowBlur:0,shadowColor:"rgba(0,0,0,0)",shadowOffsetX:0,shadowOffsetY:0},GLOBAL:{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0}};const to=ol.util,ro=ol.geom.Geometry;var so=r.n(ro);const io=ol.render,no=ol.source.Vector;var ao=r.n(no);const oo=ol.layer.Vector;var lo=r.n(oo);const ho=ol.style,uo=ol.Feature;var co=r.n(uo);const po=ol.proj.Projection;var fo=r.n(po);const mo={getOlVersion(){if(to&&to.VERSION)return to.VERSION.split(".")[0];if(window&&window.ol){if(window.ol.util)return"6";if(window.ol.WebGLMap)return"5"}return"4"},toGeoJSON:e=>e?(new Oe).toGeoJSON(e):null,toSuperMapGeometry(e){if(!e||!e.type)return null;return(new Oe).read(e,"FeatureCollection")[0].geometry},resolutionToScale:(e,t,r)=>1/(e*t*(1/.0254)*Cn(r)),toSuperMapBounds:e=>new se(e[0],e[1],e[2],e[3]),toProcessingParam(e){if(e.length<1)return"";const t={},r=[];for(let t=0;t1/(e*t*(1/.0254)*Cn(r)),getMeterPerMapUnit:Cn,isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},Csv2GeoJSON(e,t){t=t||{titles:["lon","lat"],latitudeTitle:"lat",longitudeTitle:"lon",fieldSeparator:",",lineSeparator:"\n",deleteDoubleQuotes:!0,firstLineTitles:!1};const r=[];if("string"==typeof e){let i=t.titles;if(t.firstLineTitles){if((e=e.split(t.lineSeparator)).length<2)return;i=e[0],e.splice(0,1),e=e.join(t.lineSeparator),i=i.trim().split(t.fieldSeparator);for(let e=0;e-180&&h<90&&h>-90;if(o.length!==n.length||!u)continue;const c={type:"Feature",geometry:{},properties:{}};c.geometry.type="Point",c.geometry.coordinates=[l,h];for(let e=0;e"[object Object]"===Object.prototype.toString.call(e),trim:(e="")=>e.replace(/(^\s*)|(\s*$)/g,""),newGuid(e){let t=e||32,r="";for(let e=1;evo(e.properties.Name,t)).forEach(e=>{let i=0;Array.from(new Set(e.properties.Name.split(""))).forEach(e=>{t.includes(e)&&i++}),i>r&&(r=i,s=e)}),s},setMask(e,t){if(!t)return;if(!((t instanceof co()?t.getGeometry():t)instanceof so())&&["MultiPolygon","Polygon"].indexOf(t.getType())<0)return;const r=t instanceof co()?t:new(co())(t),s=new ho.Style({fill:new ho.Fill({color:"black"})}),i=new(lo())({source:new(ao())({features:[r],wrapX:!1})}),n=function(e){const t=(0,io.getVectorContext)(e);e.context.globalCompositeOperation="destination-in",i.getSource().forEachFeature(function(r){t.drawFeature(r,s),e.context.globalCompositeOperation="source-over"})},a=Array.isArray(e)?e:[e];go(a),a.forEach(e=>{e.classNameBak_=e.className_,e.className_=`ol_mask_layer_${e.ol_uid}`,e.clipRender=n,e.extentBak_=e.getExtent(),e.setExtent(i.getSource().getExtent()),e.on("postrender",n),e.changed()})},unsetMask:go,getZoomByResolution:(e,t)=>(function(e,t){let r,s=0;for(let i=0;iMath.abs(e-t[i])&&(r=Math.abs(e-t[i]),s=i);return s})(e,t),scalesToResolutions:(e,t,r,s,i,n)=>(function(e,t,r,s,i=22){var n=[];if(e&&e.length>0)for(let t=0;t0&&f[f.length-1]}d=t.getProperties().attributes?t.getProperties().attributes[p]:t.getProperties()[p]}return t.getProperties().TEXT_FEATURE_CONTENT&&(d=t.getProperties().TEXT_FEATURE_CONTENT),d?this.toOLTextStyle(n,d):this.toOLPointStyle(this.getDefaultStyle("POINT"))}if(i){var m=i.fillSymbolID>7?0:i.fillSymbolID,y=i.lineSymbolID>5?0:i.lineSymbolID;for(var g in i){var v,b=Qa.ServerStyleMap[g],S=b.canvasStyle;if(S&&""!=S)switch(b.type){case"number":v=i[g],b.unit&&(v=v*K*ee[b.unit]*2.5),n[S]=v;break;case"color":var x=i[g],_=i.fillBackColor,w=1;if("fillStyle"===S)if(0===m||1===m)w=1-m,v="rgba("+x.red+","+x.green+","+x.blue+","+w+")";else try{var C=document.createElement("canvas");C.height=8,C.width=8;var T=C.getContext("2d"),M=new Image;this.layer&&this.layer.fillImages&&T.drawImage(this.layer.fillImages["System "+m],0,0);for(var E=T.getImageData(0,0,C.width,C.height),A=E.data,O=0,P=A.length;O{r=new(Co())({img:e,scale:c/e.width,imgSize:[e.width,e.height],anchor:[.5,.5]})})):r=new(Co())({src:p,scale:f,anchor:g}):r=new(Mo())({radius:c,fill:new(Ao())({color:v}),stroke:new(Po())({width:h||ko,color:b}),displacement:this.getCircleDisplacement(c,m,y)}),n.setImage(r);else if("LINE"===t||"LINESTRING"===t||"MULTILINESTRING"===t||"LINEARRING"===t)i=new(Po())({width:h||ko,color:b,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),n.setStroke(i);else if("POLYGON"===t||"MULTIPOLYGON"===t||"REGION"===t)s=new(Ao())({color:v}),i=new(Po())({width:h||ko,color:b,lineCap:d||"round",lineDash:this.dashStyle(e,1)}),n.setFill(s),n.setStroke(i);else{let t=this.getCanvas(e);r=new(Co())({img:t.canvas,imgSize:[t.width,t.height],scale:1,anchor:[.5,.5]}),n.setImage(r)}return n}static getIconAnchor(e=.5,t=.5){return[e,t]}static getCircleDisplacement(e,t=0,r=0){return[e*t,-(e*r)]}static getTextOffset(e,t=0,r=0){const s=e.substr(0,e.length-2)/2;return{x:s*t,y:s*r}}static getCanvas(e){let t;e.canvas?t=document.querySelector("#"+e.canvas)?document.getElemntById(e.canvas):this.createCanvas(e):(t=this.createCanvas(e),e.canvas=t.id),t.style.display="none";var r=t.getContext("2d");let s=Number(e.font.replace(/[^0-9]/gi,"")),i=e.text.split("\r\n"),n=i.length;r.font=e.font;let a=this.drawRect(r,e,i,s,t);return this.positionY=No,n>1?i.forEach(function(t,i){0!==i&&(this.positionY=this.positionY+s),this.canvasTextAutoLine(t,e,r,s,a.width)},this):this.canvasTextAutoLine(i[0],e,r,s,a.width),{canvas:t,width:a.width,height:a.height}}static createCanvas(e){let t=document.createElement("div");document.body.appendChild(t);let r=document.createElement("canvas");return r.id=e.canvas?e.canvas:"textCanvas"+mo.newGuid(8),t.appendChild(r),r}static drawRect(e,t,r,s,i){let n,a=t.backgroundFill,o=t.maxWidth-Fo,l=0,h=0,u=[];return r.forEach(function(t){let r,s="";h++;for(var i=0;io&&i>0||"\n"===t[i]?(s=t[i],h++,r=!0):(s=a,n=l)}r?u.push(o):u.push(n)},this),n=this.getCanvasWidth(u,o),l=h*s,l+=Fo,i.width=n,i.height=l,e.fillStyle=a,e.fillRect(0,0,n,l),{width:n,height:l}}static getCanvasWidth(e,t){let r=0;for(let s=0;s=t)return t+Fo;i>r&&(r=i)}return r+Fo}static canvasTextAutoLine(e,t,r,s,i){r.font=t.font;let n=t.textAlign,a=this.getPositionX(n,i),o=e.split(""),l="",h=t.fillColor,u=t.maxWidth-Fo;for(var c=0;cu&&c>0||"\n"===o[c]?(r.fillStyle=h,r.textAlign=n,r.textBaseline="top",r.fillText(l,a,this.positionY),l=o[c],this.positionY+=s):l=e}r.fillStyle=h,r.textAlign=n,r.textBaseline="top",r.fillText(l,a,this.positionY)}static getPositionX(e,t){let r,s=t-Fo;switch(e){case"center":r=s/2;break;case"right":r=s;break;default:r=8}return r}static hexToRgb(e){if(e){var t=e.replace("#","").split(""),r=[t[0]+t[1],t[2]+t[3],t[4]+t[5]];return r=r.map(function(e){return parseInt(e,16)})}}static formatRGB(e){let t;return 3===e.length?(t="rgb(",e.forEach(function(e,r){t+=2===r?e:e+","})):(t="rgba(",e.forEach(function(e,r){t+=3===r?e:e+","})),t+=")"}static async getCanvasFromSVG(e,t,r){const s=window.canvg&&window.canvg.default?window.canvg.default:So();let i=document.createElement("canvas");i.id="dataviz-canvas-"+mo.newGuid(8),i.style.display="none",t.appendChild(i);try{const t=i.getContext("2d");if((await s.from(t,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:()=>!1})).start(),i.width>300||i.height>300)return;r(i)}catch(e){return}}static stopCanvg(){this.canvgsV.forEach(e=>e.stop()),this.canvgsV=[]}static getMarkerDefaultStyle(e,t){let r;switch(e){case"POINT":r={src:`${t}apps/dataviz/static/imgs/markers/mark_red.png`,scale:1,anchor:[.5,1]};break;case"LINE":case"LINESTRING":case"MULTILINESTRING":r={strokeColor:"#3498db",strokeOpacity:1,strokeWidth:5,lineCap:"round",lineDash:"solid"};break;case"REGION":case"POLYGON":case"MULTIPOLYGON":r={fillColor:"#1abd9c",fillOpacity:1,strokeColor:"#3498db",strokeOpacity:1,strokeWidth:3,lineCap:"round",lineDash:"solid"}}return r}static async getOpenlayersStyle(e,t,r){let s;return"BASIC_POINT"===e.type?s=await this.toOpenLayersStyle(e,t):"SYMBOL_POINT"===e.type?s=this.getSymbolStyle(e,r):"SVG_POINT"===e.type?s=await this.getSVGStyle(e):"IMAGE_POINT"===e.type&&(s=this.getImageStyle(e)),s}static getSymbolStyle(e,t){let r="";e.unicode&&(r=String.fromCharCode(parseInt(e.unicode.replace(/^&#x/,""),16)));let s=Ro.hexToRgb(e.fillColor);s.push(e.fillOpacity);let i=Ro.hexToRgb(e.strokeColor);i.push(e.strokeOpacity);let n=t?2*e.radius+"px":e.fontSize;const{offsetX:a,offsetY:o,rotation:l=0}=e,h=Ro.getTextOffset(n,a,o);return new(_o())({text:new(Io())({text:r,font:n+" supermapol-icons",placement:"point",textAlign:"center",fill:new(Ao())({color:s}),backgroundFill:new(Ao())({color:[0,0,0,0]}),stroke:new(Po())({width:e.strokeWidth||1e-6,color:i}),offsetX:h.x,offsetY:h.y,rotation:l})})}static async getSVGStyle(e){let t,r=this;r.svgDiv||(r.svgDiv=document.createElement("div"),document.body.appendChild(r.svgDiv));const{url:s,radius:i,offsetX:n,offsetY:a,fillOpacity:o,rotation:l}=e;let h=this.getIconAnchor(n,a);return await Ro.getCanvasFromSVG(s,r.svgDiv,function(s){t=new(_o())({image:new(Co())({img:r.setColorToCanvas(s,e),scale:2*i/s.width,imgSize:[s.width,s.height],anchor:h||[.5,.5],opacity:o,anchorOrigin:"bottom-right",rotation:l})})}),t}static setColorToCanvas(e,t){let r=e.getContext("2d"),s=Ro.hexToRgb(t.fillColor);s&&s.push(t.fillOpacity);let i=Ro.hexToRgb(t.strokeColor);return i&&i.push(t.strokeOpacity),r.fillStyle=Ro.formatRGB(s),r.fill(),r.strokeStyle=Ro.formatRGB(i),r.lineWidth=t.strokeWidth,r.stroke(),e}static getImageStyle(e){let t=e.imageInfo.size,r=2*e.radius/t.w,s=e.imageInfo,i=s.img;i&&i.src||((i=new Image).src=s.url);const{offsetX:n,offsetY:a,rotation:o}=e;let l=this.getIconAnchor(n,a);return new(_o())({image:new(Co())({img:i,scale:r,imgSize:[t.w,t.h],anchor:l||[.5,.5],anchorOrigin:"bottom-right",rotation:o})})}static getRoadPath(e,t){const{strokeWidth:r=ko,lineCap:s,strokeColor:i,strokeOpacity:n}=e;let a=this.hexToRgb(i);a&&a.push(n);var o=new(_o())({stroke:new(Po())({width:r||ko,color:a,lineCap:s||"round",lineDash:[0]})});const{strokeColor:l}=t;let h=this.hexToRgb(l);h&&h.push(n);let u=0===r?ko:r+2;return[new(_o())({stroke:new(Po())({width:u,color:h,lineCap:s||"round",lineDash:[0]})}),o]}static getPathway(e,t){let{strokeWidth:r=ko,strokeColor:s,strokeOpacity:i}=e;const n=(e=>[e,e+2*r])(4*r);let a=this.hexToRgb(s);a&&a.push(i);var o=new(_o())({stroke:new(Po())({width:.5*r||ko,color:a,lineCap:"square",lineDash:n})});const{strokeColor:l}=t;let h=this.hexToRgb(l);return h&&h.push(i),[new(_o())({stroke:new(Po())({width:r||ko,color:h,lineCap:"square"})}),o]}}const Do=ol.Map;var Go=r.n(Do);const Bo=ol.layer.Group;var jo=r.n(Bo);!function(){const e=function(t,r,s,i,n,a){t instanceof jo()?t.getLayers().forEach(function(t){e(t,r,s,i,n,a)}):t.getSource()._forEachFeatureAtCoordinate&&t.getSource()._forEachFeatureAtCoordinate(r,s,e=>{i(e,t)},n,a)};Go().prototype.forEachFeatureAtPixelDefault=Go().prototype.forEachFeatureAtPixel,Go().prototype.forEachFeatureAtPixel=Go().prototype.Tc=function(t,r,s,i){const n=s&&s.layerFilter?s.layerFilter:()=>!0,a=this.getLayers().getArray(),o=this.getView().getResolution(),l=this.getCoordinateFromPixel(t);for(let s=0;s© SuperMap iClient",s=Ho.defaultTileGrid(),i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"http://online1.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles={styles}&udt=20170408",a=t.hidpi||(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1;n=n.replace("{styles}",a?"ph":"pl"),super({attributions:r,cacheSize:t.cacheSize,crossOrigin:i,opaque:void 0===t.opaque||t.opaque,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,projection:"EPSG:3857",wrapX:t.wrapX,tilePixelRatio:a?2:1,tileGrid:s,tileUrlFunction:function(e,t,r){var i=n.replace("{z}",e[0].toString()).replace("{x}",e[1].toString()).replace("{y}",function(){console.log(mo.getOlVersion());var t=["4","5"].indexOf(mo.getOlVersion())>-1?e[2]:-e[2]-1;return t.toString()}).replace("{-y}",function(){var t=e[0],r=s.getFullTileRange(t);zo.assert(r,55);var i=r.getHeight()+e[2];return i.toString()});o.tileProxy&&(i=o.tileProxy+encodeURIComponent(i));return i}}),t.tileProxy&&(this.tileProxy=t.tileProxy);var o=this}static defaultTileGrid(){return new(qo())({extent:[-33554432,-33554432,33554432,33554432],resolutions:[262144,131072,65536,32768,16284,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1,.5],origin:[0,0],minZoom:3})}}const Wo=ol.source.Image;var Yo=r.n(Wo);const Xo=ol.Image;var Qo=r.n(Xo);const Zo=ol.format.GeoJSON;var Ko=r.n(Zo);const $o=ol.extent;class el extends(Yo()){constructor(e){if(super({attributions:e.attributions,imageSmoothing:e.imageSmoothing,projection:e.projection,resolutions:e.resolutions}),void 0===e.url)return;this.imageLoadFunction_=void 0!==e.imageLoadFunction?e.imageLoadFunction:Wo.defaultImageLoadFunction,this._image=null,this.renderedRevision_=0,this._crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this._url=e.url,this.ratio_=void 0!==e.ratio?e.ratio:1.5,e.attributions=e.attributions||"Map Data © SuperMap iServer with © SuperMap iClient",e.format=e.format?e.format:"png",this._layerUrl=$.urlPathAppend(e.url,"image."+e.format),this._layerUrl=je.appendCredential(this._layerUrl);const t={},r=void 0===e.transparent||e.transparent;t.transparent=r;const s=void 0===e.cacheEnabled||e.cacheEnabled;t.cacheEnabled=s,void 0!==e.layersID&&(t.layersID=e.layersID);let i=!1;void 0!==e.redirect&&(i=e.redirect),t.redirect=i,e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.clipRegionEnabled&&e.clipRegion instanceof so()&&(e.clipRegion=mo.toSuperMapGeometry((new(Ko())).writeGeometryObject(e.clipRegion)),e.clipRegion=$.toJSON(Ae.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion)),e.overlapDisplayed&&e.overlapDisplayedOptions&&(t.overlapDisplayed=e.overlapDisplayed,t.overlapDisplayedOptions=e.overlapDisplayedOptions.toString()),!0===s&&e.tileversion&&(t.tileversion=e.tileversion),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),void 0!==e.antialias&&(t.antialias=e.antialias),void 0!==e.markerAngleFixed&&(t.markerAngleFixed=e.markerAngleFixed),void 0!==e.textAngleFixed&&(t.textAngleFixed=e.textAngleFixed),void 0!==e.textOrientationFixed&&(t.textOrientationFixed=e.textOrientationFixed),void 0!==e.paintBackground&&(t.paintBackground=e.paintBackground),isNaN(e.maxVisibleTextSize)||(t.maxVisibleTextSize=+e.maxVisibleTextSize),isNaN(e.minVisibleTextSize)||(t.maxVisibleTextSize=+e.minVisibleTextSize),isNaN(e.maxVisibleVertex)||(t.maxVisibleVertex=Math.round(+e.maxVisibleVertex)),this._layerUrl=$.urlAppend(this._layerUrl,$.getParameterString(t)),this.cacheEnabled=s,e.tileProxy&&(this.tileProxy=e.tileProxy)}getImageInternal(e,t,r){const s=(t=this.findNearestResolution(t))/r,i=(0,$o.getCenter)(e),n=Math.ceil((0,$o.getWidth)(e)/s),a=Math.ceil((0,$o.getHeight)(e)/s),o=(0,$o.getForViewAndSize)(i,s,0,[n,a]),l=Math.ceil(this.ratio_*(0,$o.getWidth)(e)/s),h=Math.ceil(this.ratio_*(0,$o.getHeight)(e)/s),u=(0,$o.getForViewAndSize)(i,s,0,[l,h]),c=this._image;if(c&&this.renderedRevision_===this.getRevision()&&c.getResolution()===t&&c.getPixelRatio()===r&&(0,$o.containsExtent)(c.getExtent(),o))return c;const d=[Math.round((0,$o.getWidth)(u)/s),Math.round((0,$o.getHeight)(u)/s)],p=this._getRequestUrl(u,d);return this._image=new(Qo())(u,t,r,p,this._crossOrigin,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this._image.addEventListener("change",this.handleImageChange.bind(this)),this._image}_getRequestUrl(e,t){const r={width:t[0],height:t[1],viewBounds:{leftBottom:{x:e[0],y:e[1]},rightTop:{x:e[2],y:e[3]}}};this.cacheEnabled||(r._t=(new Date).getTime());let s=$.urlAppend(this._layerUrl,$.getParameterString(r));return this.tileProxy&&(s=this.tileProxy+encodeURIComponent(s)),s}static optionsFromMapJSON(e,t){var r=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top];return{url:e,resolutions:function(){var e,s=r[2]-r[0],i=r[3]-r[1],n=s>=i?s:i;e=n===s?n/t.viewer.width:n/t.viewer.height;var a=[],o=l.METER;t.coordUnit===l.DEGREE&&(o=l.DEGREE);if(t.visibleScales.length>0)for(let e=0;e© SuperMap iClient",s=t.mapName||"quanguo",i=t.mapType||"web",n=t.url||"http://t2.dituhui.com/FileService/image?map={mapName}&type={type}&x={x}&y={y}&z={z}";n=n.replace("{mapName}",s).replace("{type}",i);var a={attributions:r,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,opaque:void 0===t.opaque||t.opaque,maxZoom:t.maxZoom||18,reprojectionErrorThreshold:t.reprojectionErrorThreshold,url:n,wrapX:t.wrapX};t.tileProxy&&(a.tileLoadFunction=function(e,t){e.getImage().src=o.tileProxy+encodeURIComponent(t)}),super(a),t.tileProxy&&(this.tileProxy=t.tileProxy);var o=this}}const il=ol.source.WMTS;var nl=r.n(il);const al=ol.tilegrid.WMTS;var ll=r.n(al);class hl extends(nl()){constructor(e){var t=e||{},r=t.attributions||"Map Data with © SuperMap iClient";t.layerType=t.layerType||"vec",t.layerType=t.isLabel?{vec:"cva",ter:"cta",img:"cia"}[t.layerType]:t.layerType,t.matrixSet="EPSG:4326"===t.projection||"EPSG:4490"===t.projection?"c":"w",t.url||t.urls||(t.url="http://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?"),t.key&&(t.url=`${t.url}tk=${t.key}`),t.url=t.url.replace("{layer}",t.layerType).replace("{proj}",t.matrixSet);var s=t.tileGrid||hl.getTileGrid(t.projection||"EPSG:3857"),i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n={version:t.version||"1.0.0",format:t.format||"tiles",dimensions:t.dimensions||{},layer:t.layerType,matrixSet:t.matrixSet,tileGrid:s,style:t.style||"default",attributions:r,cacheSize:t.cacheSize,crossOrigin:i,opaque:void 0===t.opaque||t.opaque,maxZoom:{vec:18,ter:14,img:18}[t.layerType],reprojectionErrorThreshold:t.reprojectionErrorThreshold,url:t.url,urls:t.urls,projection:t.projection||"EPSG:3857",wrapX:t.wrapX};t.tileProxy&&(n.tileLoadFunction=function(e,t){e.getImage().src=a.tileProxy+encodeURIComponent(t)}),super(n),t.tileProxy&&(this.tileProxy=t.tileProxy);var a=this}static getTileGrid(e){return"EPSG:4326"===e||"EPSG:4490"===e?hl.default4326TileGrid():hl.default3857TileGrid()}static default4326TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(1.40625/Math.pow(2,r)),t.push(r);return new(ll())({extent:[-180,-90,180,90],resolutions:e,origin:[-180,90],matrixIds:t,minZoom:1})}static default3857TileGrid(){for(var e=[],t=[],r=1;r<19;r++)e.push(156543.03392804062/Math.pow(2,r)),t.push(r);return new(ll())({extent:[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892],resolutions:e,matrixIds:t,origin:[-20037508.3427892,20037508.3427892],minZoom:1})}}const ul=ol.size,cl=ol.tilegrid;class dl extends(Vo()){constructor(e){(e=e||{}).attributions=e.attributions||"Map Data © SuperMap iServer with © SuperMap iClient",e.format=e.format?e.format:"png",super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,logo:"4"===mo.getOlVersion()?e.logo:null,opaque:e.opaque,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:function(r,i,n){t.tileGrid||(e.extent?(t.tileGrid=dl.createTileGrid(e.extent),t.resolutions&&(t.tileGrid.resolutions=t.resolutions)):("EPSG:3857"===n.getCode()&&(t.tileGrid=dl.createTileGrid([-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]),t.extent=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]),"EPSG:4326"===n.getCode()&&(t.tileGrid=dl.createTileGrid([-180,-90,180,90]),t.extent=[-180,-90,180,90])));t.origin=t.tileGrid.getOrigin(0);var a=r[0],o=r[1],h=["4","5"].indexOf(mo.getOlVersion())>-1?-r[2]-1:r[2],u=t.tileGrid.getResolution(a),c=t.dpi||96,d=n.getUnits()||l.DEGREE;"degrees"!==d&&"degree"!==d||(d=l.DEGREE);"m"!==d&&"meter"!==d||(d=l.METER);var p=mo.resolutionToScale(u,c,d),f=ul.toSize(t.tileGrid.getTileSize(a,t.tmpSize)),m=function(){this._paramsChanged&&(this._layerUrl=s.call(this),this._paramsChanged=!1);return this._layerUrl||s.call(this)}.call(t)+encodeURI("&x="+o+"&y="+h+"&width="+f[0]+"&height="+f[1]+"&scale="+p);t.tileProxy&&(m=t.tileProxy+encodeURIComponent(m));t.cacheEnabled||(m+="&_t="+(new Date).getTime());return m},wrapX:void 0!==e.wrapX&&e.wrapX,cacheEnabled:e.cacheEnabled,layersID:e.layersID}),e.tileProxy&&(this.tileProxy=e.tileProxy),this.options=e,this._url=e.url,this.tileSetsIndex=-1,this.tempIndex=-1,this.dpi=this.options.dpi||96;var t=this,r=$.urlPathAppend(e.url,"tileImage."+e.format);function s(){return this.requestParams=this.requestParams||function(){var t={};return t.redirect=void 0!==e.redirect&&e.redirect,t.transparent=void 0===e.transparent||e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),this.cacheEnabled=t.cacheEnabled,t._cache=t.cacheEnabled,this.origin&&(t.origin=JSON.stringify({x:this.origin[0],y:this.origin[1]})),e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(t.layersID=e.layersID.toString()),e.clipRegion instanceof so()&&(e.clipRegionEnabled=!0,e.clipRegion=mo.toSuperMapGeometry((new(Ko())).writeGeometryObject(e.clipRegion)),e.clipRegion=$.toJSON(Ae.fromGeometry(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion)),e.overlapDisplayed?t.overlapDisplayed=!0:(t.overlapDisplayed=!1,e.overlapDisplayedOptions&&(t.overlapDisplayedOptions=this.overlapDisplayedOptions.toString())),t.cacheEnabled&&e.tileversion&&(t.tileversion=e.tileversion.toString()),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),t}.call(this),this._layerUrl=$.urlAppend(r,$.getParameterString(this.requestParams)),this._layerUrl=je.appendCredential(this._layerUrl),this._layerUrl}}setTileSetsInfo(e){this.tileSets=e,mo.isArray(this.tileSets)&&(this.tileSets=e[0]),this.tileSets&&(this.dispatchEvent({type:"tilesetsinfoloaded",value:{tileVersions:this.tileSets.tileVersions}}),this.changeTilesVersion())}lastTilesVersion(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()}nextTilesVersion(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()}changeTilesVersion(){var e=this;if(null!=e.tileSets&&!(e.tempIndex===e.tileSetsIndex||this.tempIndex<0)){var t=e.tileSets.tileVersions;if(t&&e.tempIndex=0){var r=t[e.tempIndex].name;e.mergeTileVersionParam(r)&&(e.tileSetsIndex=e.tempIndex,e.dispatchEvent({type:"tileversionschanged",value:{tileVersion:t[e.tempIndex]}}))}}}updateCurrentTileSetsIndex(e){this.tempIndex=e}mergeTileVersionParam(e){return!!e&&(this.requestParams.tileversion=e,this._paramsChanged=!0,this.refresh(),!0)}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var s=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top];const{visibleScales:i,bounds:n,dpi:a,coordUnit:o}=t;var l=mo.scalesToResolutions(i,n,a,o);return r.tileGrid=new(qo())({extent:s,resolutions:l}),r}static createTileGrid(e,t,r,s,i){var n=cl.createXYZ({extent:e,maxZoom:t,minZoom:r,tileSize:s});return new(qo())({extent:e,minZoom:r,origin:i,resolutions:n.getResolutions(),tileSize:n.getTileSize()})}}var pl=r(785),fl=r.n(pl);function ml(e){const t=function(){const e={};return["(",")","(",")",",",","].forEach((t,r)=>{e[t]=`$${r}`}),e}();for(let r in t){const s=t[r],i=new RegExp(`\\${r}`,"g");for(;i.test(e);)e=e.replace(i,s)}return e}function yl(e,t){let r=e;return e.replace(/&|\||>|<|=|!/g," ").split(" ").filter(e=>e).forEach(e=>{const s=t.find(t=>t===e);if(vl(e)&&s&&(r=r.replace(s,"$"+s)),s){const e=ml(s);r=r.replace(s,e)}}),r}function gl(e){let t={};for(let r in e){let s=r;vl(r)&&(s="$"+r),t[s=ml(s)]=e[r]}return t}function vl(e){return/^\d/.test(e)}const bl=ol.geom.Point;var Sl=r.n(bl);class xl extends Fa{constructor(e,t){super(e,t)}queryByBounds(e,t,r){var s=this;new Vs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}queryByDistance(e,t,r){var s=this;new Js(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}queryBySQL(e,t,r){var s=this;new Ys(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}queryByGeometry(e,t,r){var s=this;new Hs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}_processParams(e){return e?(e.returnContent=null==e.returnContent||e.returnContent,e.queryParams&&!mo.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds=new se(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3])),e.geometry&&(e.geometry instanceof Sl()?e.geometry=new oe(e.geometry.getCoordinates()[0],e.geometry.getCoordinates()[1]):e.geometry=mo.toSuperMapGeometry(JSON.parse((new(Ko())).writeGeometry(e.geometry)))),e):{}}_processFormat(e){return e||t.GEOJSON}}class _l extends Fa{constructor(e,t){super(e,t)}getFeaturesByIDs(e,t,r){var s=this;new Ur(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}getFeaturesByBounds(e,t,r){var s=this;new kr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}getFeaturesByBuffer(e,t,r){var s=this;new Dr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}getFeaturesBySQL(e,t,r){var s=this;new zr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}getFeaturesByGeometry(e,t,r){var s=this;new Br(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,s=r.url,i=e.dataSourceName,n=e.dataSetName;s=$.urlPathAppend(s,"datasources/"+i+"/datasets/"+n),new Xt(s,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(r._processParams(e))}}_processParams(e){if(!e)return{};var t=this;if(e.returnContent=null==e.returnContent||e.returnContent,e.fromIndex=e.fromIndex?e.fromIndex:0,e.toIndex=e.toIndex?e.toIndex:-1,e.bounds&&(e.bounds=mo.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry=mo.toSuperMapGeometry(JSON.parse((new(Ko())).writeGeometry(e.geometry)))),e.editType&&(e.editType=e.editType.toLowerCase()),e.features){var r=[];mo.isArray(e.features)?e.features.map(function(e){return r.push(t._createServerFeature(e)),e}):r.push(t._createServerFeature(e.features)),e.features=r}return e}_createServerFeature(e){var t={},r=[],s=[],i=e.getProperties();for(var n in i)n!==e.getGeometryName()&&(r.push(n),s.push(i[n]));return t.fieldNames=r,t.fieldValues=s,e.getId()&&(t.id=e.getId()),t.geometry=mo.toSuperMapGeometry((new(Ko())).writeFeatureObject(e)),t}_processFormat(e){return e||t.GEOJSON}}function wl(e){let t=[];var r;return r=e,"[object Array]"===Object.prototype.toString.call(r)&&e.length&&e.forEach(e=>{let r=e.get("attributes");r&&t.push(r)}),t}function Cl(e,t,r,s,i,n,a){!function(e,t,r,s,i,n,a){let o,l=new pt({name:t.join().replace(":","@")}),h=a||1e3,u=[];Ml(e,l,t,0,1,1,i,n).then(a=>{o=a;let c=a.result.totalCount;if(c>1){for(let r=1;r{e.forEach(e=>{"processCompleted"===e.type&&e.result.features&&e.result.features.features?e.result.features.features.forEach(e=>{o.result.features.features.push(e)}):o.someRequestFailed=!0}),r(o)}).catch(e=>{s(e)})}else r(a)}).catch(e=>{s(e)})}(e,t,s,i,r,n,a)}function Tl(e,t,r,s,i,a,o,l,h,u){const c=new pt({name:t,attributeFilter:r});s&&(c.fields=s);const d={queryParams:[c]};u&&(d.queryOption=n.ATTRIBUTE),l&&(d.startRecord=l),h&&(d.expectCount=h),i&&(d.prjCoordSys={epsgCode:i});const p=new Ws(d);new xl(e).queryBySQL(p,function(e){"processCompleted"===e.type?a(e):o(e)})}function Ml(e,t,r,s,i,n,a,o){return new Promise((l,h)=>{new _l(e,a).getFeaturesBySQL(function(e,t,r,s,i,n){return new Vr({queryParameter:e,datasetNames:t,fromIndex:r,toIndex:s,maxFeatures:i,returnContent:!0,targetEpsgCode:n})}(t,r,s,i,n,o),e=>{let t=e.result;"processCompleted"===e.type&&t&&t.features?l(e):h(e)})})}class El extends Fa{constructor(e,t){(t=t||{}).projection&&(t.prjCoordSys=t.projection),super(e,t),this.dataFlow=new Rt(e,t),this.dataFlow.events.on({broadcastSocketConnected:this._defaultEvent,broadcastSocketError:this._defaultEvent,broadcastFailed:this._defaultEvent,broadcastSucceeded:this._defaultEvent,subscribeSocketConnected:this._defaultEvent,subscribeSocketError:this._defaultEvent,messageSucceeded:this._defaultEvent,setFilterParamSucceeded:this._defaultEvent,scope:this})}initBroadcast(){return this.dataFlow.initBroadcast(),this}broadcast(e){this.dataFlow.broadcast(e)}initSubscribe(){return this.dataFlow.initSubscribe(),this}setExcludeField(e){return this.dataFlow.setExcludeField(e),this.options.excludeField=e,this}setGeometry(e){return this.dataFlow.setGeometry(e),this.options.geometry=e,this}unSubscribe(){this.dataFlow.unSubscribe()}unBroadcast(){this.dataFlow.unBroadcast()}_defaultEvent(e){this.dispatchEvent({type:e.eventType||e.type,value:e})}}class Al extends(ao()){constructor(e){var t=e||{};super(t),this.idField=t.idField||"id",this.dataService=new El(t.ws,{geometry:t.geometry,prjCoordSys:t.prjCoordSys,excludeField:t.excludeField}).initSubscribe();var r=this;r.dataService.on("subscribeSocketConnected",function(e){r.dispatchEvent({type:"subscribeSucceeded",value:e})}),r.dataService.on("messageSucceeded",function(e){r._onMessageSuccessed(e)}),r.dataService.on("setFilterParamSucceeded",function(e){r.dispatchEvent({type:"setFilterParamSucceeded",value:e})}),this.featureCache={}}setExcludeField(e){return this.dataService.setExcludeField(e),this.excludeField=e,this}setGeometry(e){return this.dataService.setGeometry(e),this.geometry=e,this}_onMessageSuccessed(e){var t=(new(Ko())).readFeature(e.value.featureResult),r=t.get(this.idField);void 0!==r&&this.featureCache[r]?(this.featureCache[r].setGeometry(t.getGeometry()),this.featureCache[r].setProperties(t.getProperties()),this.changed()):(this.addFeature(t),this.featureCache[r]=t),this.dispatchEvent({type:"dataupdated",value:{source:this,data:t}})}}class Ol{constructor(e,t){this.geometry=e,this.attributes=t}toFeature(){var e=this.geometry;if(e instanceof so()){let t=this.attributes;t.geometry=e;let r=new(co())(t);return(new Oe).read((new(Ko())).writeFeature(r),"Feature")}if(3===e.length)return e=new he(e[0],e[1],e[2]),new xe(e,this.attributes)}}const Pl=ol.source.ImageCanvas;var Ll=r.n(Pl);class Il extends(Ll()){constructor(e,t){var r=t||{};function s(e,t,r,s,i){var n=s[0]*r,a=s[1]*r;if(this.context||(this.context=mo.createCanvasContext2D(n,a)),!this.features)return this.context.canvas;this.pixelRatio=r;var o=this.map.getSize()[0]*r,l=this.map.getSize()[1]*r;this.offset=[(n-o)/2/r,(a-l)/2/r],this.notFirst||(this.redrawThematicFeatures(e),this.notFirst=!0),this.div.id=this.id,this.div.className="themeLayer",this.div.style.width=n+"px",this.div.style.height=a+"px",this.map.getViewport().appendChild(this.div),this.renderer.resize(),this.map.getViewport().removeChild(this.div),this.themeCanvas=this.renderer.painter.root.getElementsByTagName("canvas")[0],this.themeCanvas.width=n,this.themeCanvas.height=a,this.themeCanvas.style.width=n+"px",this.themeCanvas.style.height=a+"px",this.themeCanvas.getContext("2d").clearRect(0,0,n,a);var h=this.renderer.painter._layers.hover.ctx.canvas,u=mo.createCanvasContext2D(n,a);u.drawImage(h,0,0,h.width,h.height,0,0,n,a),this.redrawThematicFeatures(e);var c=this.context.canvas;return this.context.clearRect(0,0,c.width,c.height),c.width=n,c.height=a,c.style.width=n+"px",c.style.height=a+"px",this.context.drawImage(this.themeCanvas,0,0),this.context.drawImage(u.canvas,0,0),this.context.canvas}super({attributions:r.attributions||"Map Data © SuperMap iServer with © SuperMap iClient",canvasFunction:s,logo:"4"===mo.getOlVersion()?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state}),this.on=this.onInternal,this.id=r.id?r.id:$.createUniqueID("themeLayer_"),this.canvasFunctionInternal_=s,this.EVENT_TYPES=["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","added","removed","tileloaded","beforefeaturesadded","featuresadded","featuresremoved"],this.features=[],this.TFEvents=r.TFEvents||[],this.map=r.map;var i=this.map.getSize();this.div=document.createElement("div"),this.map.getViewport().appendChild(this.div),this.div.style.width=i[0]+"px",this.div.style.height=i[1]+"px",this.setOpacity(r.opacity),this.levelRenderer=new ya,this.movingOffset=[0,0],this.renderer=this.levelRenderer.init(this.div),this.map.getViewport().removeChild(this.div),this.renderer.clear(),this.addTFEvents()}destroy(){this.EVENT_TYPES=null,this.isBaseLayer=null,this.TFEvents=null,this.destroyFeatures(),this.features=null,this.renderer&&this.renderer.dispose(),this.renderer=null,this.levelRenderer=null,this.movingOffset=null,this.currentMousePosition=null}destroyFeatures(e){if(void 0==e&&(e=this.features),e){this.removeFeatures(e),Array.isArray(e)||(e=[e]);for(var t=e.length-1;t>=0;t--)e[t].destroy()}}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.div;$.modifyDOMElement(t,null,null,null,null,null,null,e),null!==this.map&&this.dispatchEvent({type:"changelayer",value:{layer:this,property:"opacity"}})}}addFeatures(e){}removeFeatures(e){var t=this;if(e){if(e===t.features)return t.removeAllFeatures();$.isArray(e)||"function"==typeof e||(e=[e]);for(var r=[],s=0;s=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){s=!0;break}}return s}clearCache(){this.cache={},this.charts=[]}removeFeatures(e){this.clearCache(),super.removeFeatures(e)}removeAllFeatures(){this.clearCache(),super.removeAllFeatures()}redraw(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getView().calculateExtent()),!0)}clear(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}canvasFunctionInternal_(e,t,r,s,i){return Il.prototype.canvasFunctionInternal_.apply(this,arguments)}}const Fl=ol.style.RegularShape;var kl=r.n(Fl);class Rl extends(kl()){constructor(e){e.stroke?(e.stroke.color=e.stroke.getColor()||"#3388ff",e.stroke.width=e.stroke.getWidth()||1):e.stroke=new(Po())({color:"#3388ff",width:1}),e.fill?e.fill.color=e.fill.getColor()||"#66ccff":e.fill=new(Ao())({color:"#66ccff"}),super({angle:e.angle||60,stroke:e.stroke,fill:e.fill,radius:e.radius||10,rotation:e.rotation||0}),this.count_=e.count||3,this.strokeOpacity=e.strokeOpacity||1,this.fillOpacity=e.fillOpacity||1,this._pixelRatio=window?window.devicePixelRatio:1,this._canvas=this.getImage(this._pixelRatio),this._ctx=this._canvas.getContext("2d"),this._render()}_render(){var e=0,t=this.getAngle();if(this.spaceAngle=360/this.count_-this.getAngle(),!(this.spaceAngle<0)){this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),this._ctx.translate(0,0),this._ctx.beginPath();for(var r=0;r!1,Ul=function(){let e=document.createElement("div"),t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(let r=0;r-1&&(this._data=e),!this._renderLayer)return;this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();let t=this._getLayerState();t.data=this._data||[],this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)}drawGraphics(e){this._data=e||(this._data?this._data:[]),this._renderLayer||this._createInnerRender(),this._clearBuffer(),this._draw()}_initContainer(){this._canvas=this._createCanvas(this.width,this.height),this._layerContainer=this.container,this._wrapper=document.createElement("div"),this._wrapper.className="deck-wrapper",this._wrapper.style.position="absolute",this._wrapper.style.top="0",this._wrapper.style.left="0",this._wrapper.appendChild(this._canvas),this._layerContainer&&this._layerContainer.appendChild(this._wrapper)}_createCanvas(e,t){let r=document.createElement("canvas");return r.oncontextmenu=jl,r.width=e,r.height=t,r.style.width=e+"px",r.style.height=t+"px",r}_createInnerRender(){let e=this,t=this._getLayerState(),{color:r,radius:s,opacity:i,highlightColor:n,radiusScale:a,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,outline:u}=t;s=this._pixelToMeter(s);let c={id:"scatter-plot",data:[],pickable:Boolean(this.onClick)||Boolean(this.onHover),autoHighlight:!0,color:r,opacity:i,radius:s,radiusScale:a,highlightColor:n,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,outline:u,getPosition(t){if(!t)return[0,0,0];let r=t.getGeometry(),s=r&&r.getCoordinates();return(s=e._project(s))&&[s[0],s[1],0]},getColor(t){let r=e._getLayerDefaultStyle(),s=t&&t.getStyle();return s&&s.getColor&&s.getColor()||r.color},getRadius(t){let r=e._getLayerDefaultStyle(),s=t&&t.getStyle();return s&&s.getRadius&&s.getRadius()||r.radius},updateTriggers:{getColor:[r],getRadius:[s]}};e._renderLayer=new window.DeckGL.ScatterplotLayer(c)}_getLayerDefaultStyle(){let{color:e,opacity:t,radius:r,radiusScale:s,radiusMinPixels:i,radiusMaxPixels:n,strokeWidth:a,outline:o}=this._getLayerState();return{color:e,opacity:t,radius:r=this._pixelToMeter(r),radiusScale:s,radiusMinPixels:i,radiusMaxPixels:n,strokeWidth:a,outline:o}}_getLayerState(){let e=this.layer.getLayerState(),t=this.map.getView().getProjection().getCode(),r=Ua.transform([e.longitude,e.latitude],t,"EPSG:4326");return e.longitude=r[0],e.latitude=r[1],e.zoom=e.zoom-1,e}_draw(){this._refreshData();let e=this._getLayerState();e.data=this._data||[];let t={};for(let r in e)t[r]=e[r];this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._canvas,this.onBeforeRender&&(t.onBeforeRender=this.onBeforeRender.bind(this)),this.onAfterRender&&(t.onAfterRender=this.onAfterRender.bind(this)),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)}_refreshData(){let e=this._data||[],t=mo.isArray(e)?[].concat(e):[e];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(let e=0;e=0;t--){let o=a[t].getStyle();if(!o)return;if(o instanceof Dl)continue;let l=a[t].getGeometry().getCoordinates(),h=new(_o())({image:o}).getImage(),u=!1;if(h instanceof Rl&&1===h.getCount()){const e=180*h.getRotation()/Math.PI,t=Number.parseFloat(h.getAngle()),s=h.getRadius()*r;let n=null;if(t>355)n=new(Mo())(l,s);else{const r=[];r.push(l);const i=t/8;for(let t=0;t<8;t++){const n=(e+t*i)/180*Math.PI;r.push([l[0]+s*Math.cos(n),l[1]-s*Math.sin(n)])}r.push(l),n=new(Hl())([r])}n.intersectsCoordinate(this.map.getCoordinateFromPixel(i))&&(u=!0)}else{let t=[];t[0]=l[0]-h.getAnchor()[0]*r,t[2]=l[0]+h.getAnchor()[0]*r,t[1]=l[1]-h.getAnchor()[1]*r,t[3]=l[1]+h.getAnchor()[1]*r,$o.containsCoordinate(t,e)&&(u=!0)}!0!==u||s&&s(a[t],n)}return},this._options=e;const t=this;e.onClick&&t.map.on("click",function(r){if(t.isDeckGLRender){const s=t.renderer.deckGL.pickObject({x:r.pixel[0],y:r.pixel[1]});return void e.onClick(s)}const s=t.findGraphicByPixel(r,t);s&&(e.onClick(s,r),t.isHighLight&&t._highLight(s.getGeometry().getCoordinates(),new(_o())({image:s.getStyle()}).getImage(),s,r.pixel))}),t.map.on("pointermove",function(r){if(t.isDeckGLRender){const s=t.renderer.deckGL.pickObject({x:r.pixel[0],y:r.pixel[1]});e.onHover&&e.onHover(s)}})}findGraphicByPixel(e,t){const r=t.map.getFeaturesAtPixel(e.pixel)||[];for(let e=0;e-1)return s}}setGraphics(e){this.graphics=this.graphics||[],this.graphics.length=0;let t=mo.isArray(e)?[].concat(e):[e];this.graphics=[].concat(t),this.update()}addGraphics(e){this.graphics=this.graphics||[];let t=mo.isArray(e)?[].concat(e):[e];this.graphics=this.graphics.concat(t),this.update()}getGraphicBy(e,t){let r=null;for(let s in this.graphics)if(this.graphics[s][e]===t){r=this.graphics[s];break}return r}getGraphicById(e){return this.getGraphicBy("id",e)}getGraphicsByAttribute(e,t){var r,s=[];for(let i in this.graphics)(r=this.graphics[i])&&r.attributes&&r.attributes[e]===t&&s.push(r);return s}removeGraphics(e=null){if(!e||0===e.length||e===this.graphics)return this.graphics.length=0,void this.update();$.isArray(e)||(e=[e]);for(let t=e.length-1;t>=0;t--){let r=e[t],s=$.indexOf(this.graphics,r);-1!==s&&this.graphics.splice(s,1)}this.update()}clear(){this.removeGraphics()}update(){this.renderer.update(this.graphics,this._getDefaultStyle())}_getDefaultStyle(){const e={};return this.color&&(e.fill=new(Ao())({color:this.toRGBA(this.color)})),this.radius&&(e.radius=this.radius),this.outline&&(e.stroke=new(Ao())({color:this.toRGBA(this.color),width:this.strokeWidth})),new(Mo())(e)}toRGBA(e){return`rgba(${e[0]},${e[1]},${e[2]},${(e[3]||255)/255})`}setStyle(e){let t={color:this.color,radius:this.radius,opacity:this.opacity,highlightColor:this.highlightColor,radiusScale:this.radiusScale,radiusMinPixels:this.radiusMinPixels,radiusMaxPixels:this.radiusMaxPixels,strokeWidth:this.strokeWidth,outline:this.outline};$.extend(this,$.extend(t,e)),this.update()}getLayerState(){let e=this.map,t=e.getSize()[0],r=e.getSize()[1],s=e.getView(),i=s.getCenter(),n={longitude:i[0],latitude:i[1],zoom:s.getZoom(),maxZoom:s.getMaxZoom(),pitch:0,bearing:180*-s.getRotation()/Math.PI},a={};for(let e in n)a[e]=n[e];return a.width=t,a.height=r,a.color=this.color,a.radius=this.radius,a.opacity=this.opacity,a.highlightColor=this.highlightColor,a.radiusScale=this.radiusScale,a.radiusMinPixels=this.radiusMinPixels,a.radiusMaxPixels=this.radiusMaxPixels,a.strokeWidth=this.strokeWidth,a.outline=this.outline,a}_highLightClose(){this.selected=null,this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null),this.changed()}_highLight(e,t,r,s){if(r.getStyle()instanceof Rl){this.hitGraphicLayer&&(this.map.removeLayer(this.hitGraphicLayer),this.hitGraphicLayer=null);var i=this.map.getPixelFromCoordinate([e[0],e[1]]);s=s||[0,0];var n=Math.atan2(s[1]-i[1],s[0]-i[0])/Math.PI*180;n=n>0?n:360+n;var a=(Math.ceil(n/(t.getAngle()+t.getSpaceAngle()))-1)*(t.getAngle()+t.getSpaceAngle()),o={stroke:new(Po())({color:"#ff0000",width:1}),fill:new(Ao())({color:"#0099ff"}),radius:t.getRadius(),angle:t.getAngle(),eAngle:a+t.getAngle(),sAngle:a,rotation:t.getRotation()};this.highLightStyle&&this.highLightStyle instanceof Dl&&(o.stroke=this.highLightStyle.getStroke(),o.fill=this.highLightStyle.getFill(),o.radius=this.highLightStyle.getRadius(),o.angle=this.highLightStyle.getAngle());var l=new Jl(new(Sl())(e));l.setStyle(new Dl(o)),this.hitGraphicLayer=new(Yl())({source:new Zl({map:this.map,graphics:[l]})}),this.map.addLayer(this.hitGraphicLayer)}else this.selected=r,this.changed()}getGraphicsInExtent(e){var t=[];return e?(this.graphics.forEach(r=>{$o.containsExtent(e,r.getGeometry().getExtent())&&t.push(r)}),t):(this.graphics.forEach(e=>{t.push(e)}),t)}}class Kl extends Il{constructor(e,t){super(e,t),this.cache=t.cache||{},this.cacheFields=t.cacheFields||[],this.style=t.style||{},this.maxCacheCount=t.maxCacheCount||0,this.isCustomSetMaxCacheCount=void 0!==t.isCustomSetMaxCacheCount&&t.isCustomSetMaxCacheCount,this.nodesClipPixel=t.nodesClipPixel||2,this.isHoverAble=void 0!==t.isHoverAble&&t.isHoverAble,this.isMultiHover=void 0!==t.isMultiHover&&t.isMultiHover,this.isClickAble=void 0===t.isClickAble||t.isClickAble,this.highlightStyle=t.highlightStyle||null,this.isAllowFeatureStyle=void 0!==t.isAllowFeatureStyle&&t.isAllowFeatureStyle}destroy(){this.maxCacheCount=null,this.isCustomSetMaxCacheCount=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.cache=null,this.cacheFields=null,this.style=null,this.highlightStyle=null,this.isAllowFeatureStyle=null}addFeatures(e){this.dispatchEvent({type:"beforefeaturesadded",value:{features:e}}),this.features=this.toiClientFeature(e),this.isCustomSetMaxCacheCount||(this.maxCacheCount=5*this.features.length),this.renderer&&this.changed()}removeFeatures(e){this.clearCache(),Il.prototype.removeFeatures.call(this,e)}removeAllFeatures(){this.clearCache(),Il.prototype.removeAllFeatures.apply(this,arguments)}redrawThematicFeatures(e){var t=this.renderer.getHoverOne(),r=null;t&&t.refDataID&&(r=t.refDataID),this.renderer.clearAll();for(var s=this.features,i=this.cache,n=this.cacheFields,a=this.map.getView().getZoom(),o=this.maxCacheCount,l=0,h=s.length;lo){var f=n[0];n.splice(0,1),delete i[f]}}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var m=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(m)}}createThematicFeature(e){var t=$.copyAttributesWithClip(this.style);e.style&&!0===this.isAllowFeatureStyle&&(t=$.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=ta.transformStyle(this.highlightStyle);for(var s=new na(e,this,ta.transformStyle(t),r),i=0;i0&&0===this.labelFeatures.length)for(var t=this.setLabelsStyle(this.features),r=0,s=t.length;r=0&&p.x<=h.x&&p.y>=0&&p.y<=h.y){if(r.style.minZoomLevel>-1&&u<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&u>r.style.maxZoomLevel)continue;var f=null;r.isStyleChange?(r.isStyleChange=null,f=this.calculateLabelBounds(r,p)):f=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,p):this.calculateLabelBounds(r,p);var m=new se(0,h.y,h.x,0),y=f.length;if(this.isAvoid){var g=this.getAvoidInfo(m,f);if(g){if("left"===g.aspectW){r.style.labelXOffset+=g.offsetX;for(let e=0;e=i[l].start&&a=i[l].start&&ao&&(o=r,l="top")}if(t.y>e.bottom){let r=Math.abs(t.y-e.bottom);r>o&&(o=r,l="bottom")}if(t.xa&&(a=r,h="left")}if(t.x>e.right){let r=Math.abs(t.x-e.right);r>a&&(a=r,h="right")}}}}isQuadrilateralOverLap(e,t){var r=e.length,s=t.length;if(5!==r||5!==s)return null;var i=!1;for(let s=0;se-s&&t.time© SuperMap iClient",canvasFunction:function(e,t,r,s,i){var n=s[0]/r,a=s[1]/r,o=this.map.getSize()[0],l=this.map.getSize()[1];this.layer||(this.layer=new nh(this.map,this.dataSet,this.mapvOptions,n,a,this));this.layer.pixelRatio=r,this.layer.offset=[(n-o)/2,(a-l)/2],this.rotate?this.rotate!==this.map.getView().getRotation()&&(this.layer.canvasLayer.resize(n,a),this.rotate=this.map.getView().getRotation()):this.rotate=this.map.getView().getRotation();var h=this.layer.canvasLayer.canvas;this.layer.isEnabledTime()||(this.layer.canvasLayer.resize(n,a),this.layer.canvasLayer.draw());this.context||(this.context=mo.createCanvasContext2D(n,a));var u=this.context.canvas;this.context.clearRect(0,0,u.width,u.height),u.width=s[0],u.height=s[1],u.style.width=s[0]+"px",u.style.height=s[1]+"px",this.context.drawImage(h,0,0),(this.resolution!==t||JSON.stringify(this.extent)!==JSON.stringify(e))&&(this.resolution=t,this.extent=e);return this.context.canvas},logo:"4"===mo.getOlVersion()?t.logo:null,projection:t.projection,ratio:t.ratio,resolutions:t.resolutions,state:t.state}),this.map=e.map,this.dataSet=e.dataSet,this.mapvOptions=e.mapvOptions}addData(e,t){this.layer.addData(e,t)}getData(){return this.layer&&(this.dataSet=this.layer.getData()),this.dataSet}removeData(e){this.layer&&this.layer.removeData(e)}clearData(){this.layer.clearData()}update(e){this.layer.update(e),this.changed()}}class oh extends Kl{constructor(e,t){super(e,t),this.style=t.style,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle,this.themeField=t.themeField,this.styleGroups=t.styleGroups}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,Kl.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=ta.transformStyle(this.highlightStyle);for(var s=new na(e,this,ta.transformStyle(t),r),i=0;i0&&r.attributes){var s=this.themeField,i=r.attributes,n=this.styleGroups,a=!1,o=null;for(var l in i)if(s===l){a=!0,o=i[l];break}if(a)for(var h=0,u=n.length;h=n[h].start&&o© turfjs with © SuperMap iClient",features:t.features,format:t.format,extent:t.extent,logo:"4"===mo.getOlVersion()?t.logo:null,projection:t.projection,wrapX:t.wrapX}),this.turfMap={"Measurement.along":["line","distance","units"],"Measurement.area":["geojson"],"Measurement.bbox":["geojson"],"Measurement.bboxPolygon":["bbox"],"Measurement.bearing":["start","end","final"],"Measurement.center":["geojson","properties"],"Measurement.centerOfMass":["geojson","properties"],"Measurement.centroid":["geojson","properties"],"Measurement.destination":["origin","distance","bearing","units"],"Measurement.distance":["from","to","units"],"Measurement.envelope":["geojson"],"Measurement.length":["geojson","units"],"Measurement.midpoint":["point1","point2"],"Measurement.pointOnFeature":["geojson"],"Measurement.polygonTangents":["point","polygon"],"Measurement.rhumbBearing":["start","end","final"],"Measurement.rhumbDestination":["origin","distance","bearing","units"],"Measurement.rhumbDistance":["from","to","units"],"Measurement.square":["bbox"],"Measurement.greatCircle":["start","end","properties","npoints","offset"],"CoordinateMutation.cleanCoords":["geojson","mutate"],"CoordinateMutation.flip":["geojson","mutate"],"CoordinateMutation.rewind":["geojson","reverse","mutate"],"CoordinateMutation.round":["num","precision"],"CoordinateMutation.truncate":["geojson","precision","coordinates","mutate"],"Transformation.bboxClip":["feature","bbox"],"Transformation.bezierSpline":["line","resolution","sharpness"],"Transformation.buffer":["geojson","radius","units","steps"],"Transformation.circle":["center","radius","steps","units","properties"],"Transformation.clone":["geojson"],"Transformation.concave":["points","maxEdge","units"],"Transformation.convex":["geojson","concavity"],"Transformation.difference":["polygon1","polygon2"],"Transformation.dissolve":["featureCollection","propertyName"],"Transformation.intersect":["poly1","poly2"],"Transformation.lineOffset":["geojson","distance","units"],"Transformation.simplify":["feature","tolerance","highQuality"],"Transformation.tesselate":["poly"],"Transformation.transformRotate":["geojson","angle","pivot","mutate"],"Transformation.transformTranslate":["geojson","distance","direction","units","zTranslation","mutate"],"Transformation.transformScale":["geojson","factor","origin","mutate"],"Transformation.union":["A"],"Transformation.voronoi":["points","bbox"],"featureConversion.combine":["fc"],"featureConversion.explode":["geojson"],"featureConversion.flatten":["geojson"],"featureConversion.lineStringToPolygon":["lines","properties","autoComplete","orderCoords"],"featureConversion.polygonize":["geojson"],"featureConversion.polygonToLineString":["polygon","properties"],"Misc.kinks":["featureIn"],"Misc.lineArc":["center","radius","bearing1","bearing2","steps","units"],"Misc.lineChunk":["geojson","segmentLength","units","reverse"],"Misc.lineIntersect":["line1","line2"],"Misc.lineOverlap":["line1","line2"],"Misc.lineSegment":["geojson"],"Misc.lineSlice":["startPt","stopPt","line"],"Misc.lineSliceAlong":["line","startDist","stopDist","units"],"Misc.lineSplit":["line","splitter"],"Misc.mask":["polygon","mask"],"Misc.pointOnLine":["lines","pt","units"],"Misc.sector":["center","radius","bearing1","bearing2","steps","units"],"Misc.shortestPath":["start","end","obstacles","units","resolution"],"Misc.unkinkPolygon":["geojson"],"Helper.featureCollection":["features","bbox","id"],"Helper.feature":["geometry","properties","bbox","id"],"Helper.geometryCollection":["geometries","properties","bbox","id"],"Helper.lineString":["coordinates","properties","bbox","id"],"Helper.multiLineString":["coordinates","properties","bbox","id"],"Helper.multiPoint":["coordinates","properties","bbox","id"],"Helper.multiPolygon":["coordinates","properties","bbox","id"],"Helper.point":["coordinates","properties","bbox","id"],"Helper.polygon":["coordinates","properties","bbox","id"],"Data.sample":["featurecollection","num"],"Interpolation.interpolate":["points","cellSize","gridType","property","units","weight"],"Interpolation.isobands":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.isolines":["pointGrid","breaks","zProperty","commonProperties","breaksProperties"],"Interpolation.planepoint":["point","triangle"],"Interpolation.tin":["points","z"],"Joins.pointsWithinPolygon":["points","polygons"],"Joins.tag":["points","polygons","field","outField","mask","properties"],"Grids.hexGrid":["bbox","cellSide","units","triangles"],"Grids.pointGrid":["bbox","cellSide","units","mask","properties"],"Grids.squareGrid":["bbox","cellSide","units","mask","properties"],"Grids.triangleGrid":["bbox","cellSide","units","mask","properties"],"Classification.nearestPoint":["targetPoint","points"],"Aggregation.collect":["polygons","points","inProperty","outProperty"],"Aggregation.clustersDbscan":["points","maxDistance","units","minPoints","mutate"],"Aggregation.clustersKmeans":["points","numberOfClusters","mutate"],"Meta.coordAll":["geojson"],"Meta.coordEach":["geojson","callback","excludeWrapCoord"],"Meta.coordReduce":["geojson","callback","initialValue","excludeWrapCoord"],"Meta.featureEach":["geojson","callback"],"Meta.featureReduce":["geojson","callback","initialValue"],"Meta.flattenEach":["geojson","callback"],"Meta.flattenReduce":["geojson","callback","initialValue"],"Meta.getCoord":["coord"],"Meta.getCoords":["coords"],"Meta.getGeom":["geojson"],"Meta.getGeomType":["geojson","name"],"Meta.geomEach":["geojson","callback"],"Meta.geomReduce":["geojson","callback","initialValue"],"Meta.propEach":["geojson","callback"],"Meta.propReduce":["geojson","callback","initialValue"],"Meta.segmentEach":["geojson","callback"],"Meta.segmentReduce":["geojson","callback","initialValue"],"Meta.getCluster":["geojson","filter"],"Meta.clusterEach":["geojson","property","callback"],"Meta.clusterReduce":["geojson","property","callback","initialValue"],"Assertions.collectionOf":["featureCollection","type","name"],"Assertions.containsNumber":["coordinates"],"Assertions.geojsonType":["value","type","name"],"Assertions.featureOf":["feature","type","name"],"Booleans.booleanClockwise":["line"],"Booleans.booleanContains":["feature1","feature2"],"Booleans.booleanCrosses":["feature1","feature2"],"Booleans.booleanDisjoint":["feature1","feature2"],"Booleans.booleanEqual":["feature1","feature2"],"Booleans.booleanOverlap":["feature1","feature2"],"Booleans.booleanParallel":["feature1","feature2"],"Booleans.booleanPointInPolygon":["point","polygon","ignoreBoundary"],"Booleans.booleanPointOnLine":["point","linestring","ignoreEndVertices"],"UnitConversion.bearingToAngle":["bearing"],"UnitConversion.convertArea":["area","originalUnit","finalUnit"],"UnitConversion.convertLength":["length","originalUnit","finalUnit"],"UnitConversion.degreesToradians":["degrees"],"UnitConversion.lengthToRadians":["distance","units"],"UnitConversion.lengthToDegrees":["distance","units"],"UnitConversion.radiansToLength":["radians","units"],"UnitConversion.radiansToDegrees":["radians"],"UnitConversion.toMercator":["geojson","mutate"],"UnitConversion.toWgs84":["geojson","mutate"]},this.turfOptionMap={"Measurement.along":["line","distance",{units:""}],"Measurement.bboxPolygon":["bbox",{properties:"",id:""}],"Measurement.bearing":["start","end",{final:""}],"Measurement.center":["geojson",{properties:""}],"Measurement.destination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.distance":["from","to",{units:""}],"Measurement.length":["geojson",{units:""}],"Measurement.rhumbBearing":["start","end",{final:""}],"Measurement.rhumbDestination":["origin","distance","bearing",{units:"",properties:""}],"Measurement.rhumbDistance":["from","to",{units:""}],"Measurement.greatCircle":["start","end",{properties:"",npoints:"",offset:""}],"CoordinateMutation.cleanCoords":["geojson",{mutate:""}],"CoordinateMutation.flip":["geojson",{mutate:""}],"CoordinateMutation.rewind":["geojson",{mutate:"",reverse:""}],"CoordinateMutation.truncate":["geojson",{precision:"",coordinates:"",mutate:""}],"Transformation.bezierSpline":["line",{resolution:"",sharpness:""}],"Transformation.buffer":["geojson","radius",{units:"",steps:""}],"Transformation.circle":["center","radius",{units:"",steps:"",properties:""}],"Transformation.concave":["points",{maxEdge:"",units:""}],"Transformation.convex":["geojson",{concavity:""}],"Transformation.dissolve":["featureCollection",{propertyName:""}],"Transformation.lineOffset":["geojson","distance",{units:""}],"Transformation.simplify":["geojson",{tolerance:"",highQuality:""}],"Transformation.transformRotate":["geojson","angle",{pivot:"",mutate:""}],"Transformation.transformTranslate":["geojson","distance","direction",{units:"",zTranslation:"",mutate:""}],"Transformation.transformScale":["geojson","factor",{origin:"",mutate:""}],"Transformation.voronoi":["points",{bbox:""}],"featureConversion.lineStringToPolygon":["lines",{properties:"",autoComplete:"",orderCoords:""}],"featureConversion.polygonToLineString":["polygon",{properties:""}],"Misc.lineArc":["center","radius","bearing1","bearing2",{steps:"",units:""}],"Misc.lineChunk":["geojson","segmentLength",{units:"",reverse:""}],"Misc.lineOverlap":["line1","line2",{tolerance:""}],"Misc.lineSliceAlong":["line","startDist","stopDist",{units:""}],"Misc.pointOnLine":["lines","pt",{units:""}],"Misc.sector":["center","radius","bearing1","bearing2",{units:"",steps:"",properties:""}],"Misc.shortestPath":["start","end",{obstacles:"",units:"",resolution:""}],"Helper.feature":["geometry","properties",{bbox:"",id:""}],"Helper.geometryCollection":["geometries","properties",{bbox:"",id:""}],"Helper.lineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiLineString":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPoint":["coordinates","properties",{bbox:"",id:""}],"Helper.multiPolygon":["coordinates","properties",{bbox:"",id:""}],"Helper.point":["coordinates","properties",{bbox:"",id:""}],"Helper.polygon":["coordinates","properties",{bbox:"",id:""}],"Interpolation.interpolate":["points","cellSize",{gridType:"",property:"",units:"",weight:""}],"Interpolation.isobands":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Interpolation.isolines":["pointGrid","breaks",{zProperty:"",commonProperties:"",breaksProperties:""}],"Grids.hexGrid":["bbox","cellSide",{units:"",triangles:"",properties:"",mask:""}],"Grids.pointGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.squareGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Grids.triangleGrid":["bbox","cellSide",{units:"",mask:"",properties:""}],"Aggregation.clustersDbscan":["points","maxDistance",{units:"",minPoints:"",mutate:""}],"Aggregation.clustersKmeans":["points",{numberOfClusters:"",mutate:""}],"Booleans.booleanPointInPolygon":["point","polygon",{ignoreBoundary:""}],"Booleans.booleanPointOnLine":["point","linestring",{ignoreEndVertices:""}],"UnitConversion.toMercator":["geojson",{mutate:""}],"UnitConversion.toWgs84":["geojson",{mutate:""}]}}process(e,t,r,s){var i;try{i=hh[e.split(".")[1]].apply(this,this.parse(e,t))}catch(r){i=hh[e.split(".")[1]].apply(this,this.parseOption(e,t))}var n=null;try{n=(new(Ko())).readFeatures(i)}catch(e){return void(r&&r(i))}(s=null==s||s)&&this.addFeatures(n),r&&r(i)}parse(e,t){if("Transformation.union"===e)return t.A;var r=[],s=this.turfMap[e];return s&&s.map(function(e){return r.push(t[e]),t[e]}),r}parseOption(e,t){var r=[];return this.turfOptionMap[e].map(function(e){if(e instanceof Object){var s=e;Object.keys(s).forEach(function(e){s[e]=t[e]}),r.push(s)}else r.push(t[e]);return t}),r}}class ch extends Kl{constructor(e,t){super(e,t),this.themeField=t.themeField,this.style=t.style,this.styleGroups=t.styleGroups,this.isHoverAble=t.isHoverAble,this.highlightStyle=t.highlightStyle}destroy(){this.style=null,this.themeField=null,this.styleGroups=null,Kl.prototype.destroy.apply(this,arguments)}createThematicFeature(e){var t=this.getStyleByData(e),r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=ta.transformStyle(this.highlightStyle);for(var s=new na(e,this,ta.transformStyle(t),r),i=0;i0&&r.attributes){var s=this.themeField,i=r.attributes,n=this.styleGroups,a=!1,o=null;for(var l in i)if(s===l){a=!0,o=i[l];break}if(a)for(var h=0,u=n.length;h-1;e--)if(t.indexOf(n[e])>-1){i=t.replace(n[e],s[n[e]]);break}i=i.replace(/[#]/gi,"#"),s[t]=r,e=e.replace(new RegExp(i,"g"),r)}),e=(e=e.replace(/[#]/gi,"\n#")).replace(/\[zoom/gi,"[scale")}var i={};new On(e).getShaders().forEach(function(e){return i[e.elements[0].clean]=i[e.elements[0].clean]||{},i[e.elements[0].clean][e.attachment]=i[e.elements[0].clean][e.attachment]||[],i[e.elements[0].clean][e.attachment].push(e),e}),dh.setCartoShaders(i)}},l.send(null)}if(dh.getCartoCss()){var h={};new On(dh.getCartoCss()).getShaders().forEach(function(e){return h[e.elements[0].clean]=h[e.elements[0].clean]||{},h[e.elements[0].clean][e.attachment]=h[e.elements[0].clean][e.attachment]||[],h[e.elements[0].clean][e.attachment].push(e),e}),dh.setClientCartoShaders(h)}}},a.open("GET",$.urlPathAppend(dh.getUrl(),"layers.json"),!1),a.send(null),this.on("featureSelected",function(e){dh.setSelectedId(e.selectedId),dh.setLayerName(e.layerName)})}}static setCartoShaders(e){this.cartoShaders=e}static getCartoShaders(){return this.cartoShaders}static setClientCartoShaders(e){this.clientCartoShaders=e}static getClientCartoShaders(){return this.clientCartoShaders}static setCartoCss(e){this.cartoCss=e}static getCartoCss(){return this.cartoCss}static setDonotNeedServerCartoCss(e){this.donotNeedServerCartoCss=e}static getDonotNeedServerCartoCss(){return this.donotNeedServerCartoCss}static setLayersInfo(e){this.layersInfo=e}static getLayersInfo(){return this.layersInfo}static setUrl(e){this.url=e}static getUrl(){return this.url}static setView(e){this.view=e}static getView(){return this.view}static setSelectedId(e){this.selectedId=e}static getSelectedId(){return this.selectedId}static setLayerName(e){this.layerName=e}static getLayerName(){return this.layerName}static setSelectedPointStyle(e){this.selectedPointStyle=e}static setSelectedLineStyle(e){this.selectedLineStyle=e}static setSelectedRegionStyle(e){this.selectedRegionStyle=e}static setSelectedTextStyle(e){this.selectedTextStyle=e}static getSelectedStyle(e){return"POINT"===e||"MULTIPOINT"===e?this.selectedPointStyle:"LINESTRING"===e||"MULTILINESTRING"===e?this.selectedLineStyle:"POLYGON"===e||"MULTIPOLYGON"===e?this.selectedRegionStyle:"TEXT"===e?this.selectedTextStyle:void 0}static getLayerInfo(e){var t=dh.getLayersInfo();if(void 0===t)return null;var r=t[e];if(!r)return null;var s={layerIndex:r.layerIndex,ugcLayerType:r.ugcLayerType};switch(r.ugcLayerType){case"VECTOR":s.layerStyle=r.style?r.style:null;break;case"THEME":var i=r.theme;s.layerStyle=i?i.defaultStyle:null,i&&"LABEL"===i.type&&(s.type=i.type,s.textField=i.labelExpression);break;default:r.style&&(s.layerStyle=r.style)}return s}static getStyle(e,t){var r=dh.getUrl(),s=dh.getView(),i=s.getZoom(),n=mo.resolutionToScale(s.getResolution(),96,l.METER),a=e.replace(/(@)/gi,"___").replace(/(#)/gi,"___");if(dh.getCartoCss()&&dh.getClientCartoShaders()[a])return u(dh.getClientCartoShaders()[a]);var o=dh.getLayerInfo(e);if(!dh.getDonotNeedServerCartoCss()&&dh.getCartoShaders()[a]){if(t.getProperties().textStyle||t.getProperties().TEXT_FEATURE_CONTENT||"LABEL"==o.type&&o.textField){var h=Ro.getValidStyleFromLayerInfo(o,t,r);return"POINT"===t.getGeometry().getType().toUpperCase()&&(h=function(e,t,r){var s=Ro.getValidStyleFromLayerInfo(e,t,r);if("LABEL"==e.type){t.setProperties({type:"TEXT"});for(var i=u(dh.getCartoShaders()[a]),n=s.getText(),o=0;o© SuperMap iServer with © SuperMap iClient",["4","5"].indexOf(mo.getOlVersion())<0&&(e.tileSize=e.format instanceof gh()&&e.style?512:256),super({attributions:e.attributions,cacheSize:e.cacheSize,format:e.format||new(Ko()),logo:"4"===mo.getOlVersion()?e.logo:null,overlaps:e.overlaps,projection:e.projection,state:e.format instanceof gh()&&e.style&&"[object String]"==Object.prototype.toString.call(e.style)?"loading":e.state,tileClass:e.tileClass,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction||(e.format instanceof gh()&&e.style?function(e){return e?n._tileUrl.replace(t,e[0].toString()).replace(r,e[1].toString()).replace(s,function(){var t=["4","5"].indexOf(mo.getOlVersion())>-1?-e[2]-1:e[2];return t.toString()}).replace(i,function(){var t=e[0],r=n.tileGrid.getFullTileRange(t),s=r.getHeight()+e[2];return s.toString()}):void 0}:function(e,t,r){n.tileGrid||(n.tileGrid=n.getTileGridForProjection(r));var s=e[0],i=e[1],a=["4","5"].indexOf(mo.getOlVersion())>-1?-e[2]-1:e[2],o=ul.toSize(n.tileGrid.getTileSize(s,n.tmpSize)),h="";if("ZXY"===n.tileType)h="&width="+o[0]+"&height="+o[1]+"&x="+i+"&y="+a+"&z="+s;else if("ViewBounds"===n.tileType){var u=n.tileGrid.getTileCoordExtent(e);h="&width="+o[0]+"&height="+o[1]+"&viewBounds="+u[0]+","+u[1]+","+u[2]+","+u[3]}else{var c=n.tileGrid.getOrigin(s),d=n.tileGrid.getResolution(s),p=r.getUnits()||"degrees";"degrees"===p&&(p=l.DEGREE),"m"===p&&(p=l.METER);var f=mo.resolutionToScale(d,96,p);h="&x="+i+"&y="+a+"&width="+o[0]+"&height="+o[1]+"&scale="+f+"&origin={'x':"+c[0]+",'y':"+c[1]+"}"}return n._tileUrl+encodeURI(h)}),tileLoadFunction:e.tileLoadFunction||(e.format instanceof gh()?function(e,t){const r=e.getFormat(),s=e.onLoad.bind(e),i=e.onError.bind(e);e.setLoader(function(e,a,o){const l=new XMLHttpRequest;l.open("GET","function"==typeof t?t(e,a,o):t,!0),"arraybuffer"==r.getType()&&(l.responseType="arraybuffer"),l.withCredentials=n.withCredentials,l.onload=function(){if(!l.status||l.status>=200&&l.status<300){const t=r.getType();let n=void 0;"json"===t||"text"===t?n=l.responseText:"xml"===t?(n=l.responseXML)||(n=(new DOMParser).parseFromString(l.responseText,"application/xml")):"arraybuffer"===t&&(n=l.response),n?["4","5"].indexOf(mo.getOlVersion())>-1?s.call(this,r.readFeatures(n,{featureProjection:o}),r.readProjection(n),r.getLastExtent()):s.call(this,r.readFeatures(n,{extent:e,featureProjection:o}),r.readProjection(n)):i.call(this)}else i.call(this)}.bind(this),l.onerror=function(){i.call(this)}.bind(this),l.send()})}:function(e,t){var r=new RegExp("(^|\\?|&)width=([^&]*)(\\s|&|$)"),s=new RegExp("(^|\\?|&)height=([^&]*)(\\s|&|$)"),i=Number(t.match(r)[2]),n=Number(t.match(s)[2]);e.setLoader(function(r,s,a){Be.get(t).then(function(t){if(e.getFormat()instanceof Ko())return t.json()}).then(function(t){var s=[];if(e.getFormat()instanceof Ko()){t.recordsets.map(function(e){return e.features.map(function(e){for(var t=[],r=0,s=0;s-1?(e.setExtent([0,0,i,n]),e.setProjection(o),s=e.getFormat().readFeatures(mo.toGeoJSON(s))):s=e.getFormat().readFeatures(mo.toGeoJSON(s),{extent:r,dataProjection:o,featureProjection:a}),e.setFeatures(s)}})})}),wrapX:void 0!==e.wrapX&&e.wrapX,tileSize:e.tileSize||null,zDirection:["4","5"].indexOf(mo.getOlVersion())>-1?null:0});var n=this;if(n.withCredentials=e.withCredentials,n._tileType=e.tileType||"ScaleXY",this.vectorTileStyles=new dh,e.format instanceof gh()&&e.style)if("[object String]"==Object.prototype.toString.call(e.style)){var a=je.appendCredential(e.style);Be.get(a,null,{withCredentials:e.withCredentials}).then(e=>e.json()).then(t=>{this._fillByStyleJSON(t,e.source),this.setState("ready")})}else this._fillByStyleJSON(e.style,e.source);else this._fillByRestMapOptions(e.url,e)}_fillByStyleJSON(e,t){if(t||(t=Object.keys(e.sources)[0]),e.sources&&e.sources[t]&&(this._tileUrl=je.appendCredential(e.sources[t].tiles[0])),e.metadata&&e.metadata.indexbounds){const t=e.metadata.indexbounds;var r=Math.max(t[2]-t[0],t[3]-t[1]);const s=[];for(let e=0;e<30;e++)s.push(r/512/Math.pow(2,e));this.tileGrid=new(qo())({extent:e.metadata.indexbounds,resolutions:s,tileSize:[512,512]})}}_fillByRestMapOptions(e,t){this._tileUrl=$.urlPathAppend(t.url,"tileFeature.json"),t.format instanceof gh()&&(this._tileUrl=$.urlPathAppend(t.url,"tileFeature.mvt")),this._tileUrl=je.appendCredential(this._tileUrl);var r=!0;void 0!==t.returnAttributes&&(r=t.returnAttributes);var s={};s.returnAttributes=r,void 0!==t._cache&&(s._cache=t._cache),void 0!==t.layersID&&(s.layersID=t.layersID),void 0!==t.layerNames&&(s.layerNames=t.layerNames),void 0!==t.expands&&(s.expands=t.expands),void 0!==t.compressTolerance&&(s.compressTolerance=t.compressTolerance),void 0!==t.coordinateType&&(s.coordinateType=t.coordinateType),void 0!==t.returnCutEdges&&(s.returnCutEdges=t.returnCutEdges),this._tileUrl=$.urlAppend(this._tileUrl,$.getParameterString(s))}static optionsFromMapJSON(e,t){var r={};r.url=e,r.crossOrigin="anonymous";var s=[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],i=function(){var e,r=s[2]-s[0],i=s[3]-s[1],n=r>=i?r:i;e=n===r?n/t.viewer.width:n/t.viewer.height;var a=[],o=l.METER;t.coordUnit===l.DEGREE&&(o=l.DEGREE);if(t.visibleScales.length>0){var h=function(e){var t=e.visibleScales;if(!t)return null;var r=e.viewBounds,s=e.coordUnit,i=e.viewer,n=e.scale,a=e.datumAxis;r=new se(r.left,r.bottom,r.right,r.top),i=new U(i.rightBottom.x,i.rightBottom.y),s=s.toLowerCase(),a=a||6378137;var o=s,l=$.calculateDpi(r,i,n,o,a),h=function(e){if(null===e)return;var t,r;r=e.length,t=[r];for(var s=0;s© SuperMap iServer with © SuperMap iClient",canvasFunction:s,logo:"4"===mo.getOlVersion()?r.logo:null,projection:r.projection,ratio:r.ratio,resolutions:r.resolutions,state:r.state}),this.canvasFunctionInternal_=s,this.features=[],this.name=e,!r.map)throw new Error("options.map is not found.");this.map=r.map,this.id=r.id?r.id:$.createUniqueID("HeatMapSource_"),this.opacity=r.opacity?r.opacity:1,this.colors=r.colors?r.colors:["blue","cyan","lime","yellow","red"],this.useGeoUnit=!!r.useGeoUnit&&r.useGeoUnit,this.radius=r.radius?r.radius:50,this.featureWeight=r.featureWeight?r.featureWeight:null,this.maxWeight=null,this.minWeight=null,this.maxWidth=null,this.maxHeight=null,this.rootCanvas=document.createElement("canvas");var i=this.map.getSize();this.rootCanvas.width=this.maxWidth=parseInt(i[0]),this.rootCanvas.height=this.maxHeight=parseInt(i[1]),$.modifyDOMElement(this.rootCanvas,null,null,null,null,null,null,this.opacity),this.canvasContext=this.rootCanvas.getContext("2d")}addFeatures(e){this.features=this.toiClientFeature(e),this.changed()}setOpacity(e){if(e!==this.opacity){this.opacity=e;var t=this.rootCanvas;$.modifyDOMElement(t,null,null,null,null,null,null,e),null!==this.map&&this.changed()}}updateHeatPoints(e){this.features&&this.features.length>0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}convertFastToPixelPoints(e){var t,r,s,i,n,a,o=[];this.useRadius=this.useGeoUnit?parseInt(this.radius/e):this.radius;for(var l=0;l0&&this.maxWidth>0))return!1;var r=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var s=0;s=0;r--)e.addInt32(t[r]);return e.endVector()}},{key:"startEndsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"addXy",value:function(e,t){e.addFieldOffset(1,t,0)}},{key:"createXyVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startXyVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addZ",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"createZVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startZVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addM",value:function(e,t){e.addFieldOffset(3,t,0)}},{key:"createMVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startMVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addT",value:function(e,t){e.addFieldOffset(4,t,0)}},{key:"createTVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startTVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addTm",value:function(e,t){e.addFieldOffset(5,t,0)}},{key:"createTmVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}},{key:"startTmVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addType",value:function(e,t){e.addFieldInt8(6,t,yh.Unknown)}},{key:"addParts",value:function(e,t){e.addFieldOffset(7,t,0)}},{key:"createPartsVector",value:function(e,t){e.startVector(4,t.length,4);for(var r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}},{key:"startPartsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"endGeometry",value:function(e){return e.endObject()}},{key:"createGeometry",value:function(t,r,s,i,n,a,o,l,h){return e.startGeometry(t),e.addEnds(t,r),e.addXy(t,s),e.addZ(t,i),e.addM(t,n),e.addT(t,a),e.addTm(t,o),e.addType(t,l),e.addParts(t,h),e.endGeometry(t)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"ends",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}},{key:"endsLength",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"endsArray",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"xy",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"xyLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"xyArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"z",value:function(e){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"zLength",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"zArray",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"m",value:function(e){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"mLength",value:function(){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"mArray",value:function(){var e=this.bb.__offset(this.bb_pos,10);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"t",value:function(e){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"tLength",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"tArray",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"tm",value:function(e){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):BigInt(0)}},{key:"tmLength",value:function(){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"type",value:function(){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readUint8(this.bb_pos+e):yh.Unknown}},{key:"parts",value:function(t,r){var s=this.bb.__offset(this.bb_pos,18);return s?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+s)+4*t),this.bb):null}},{key:"partsLength",value:function(){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}}])&&xh(t.prototype,r),s&&xh(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ch(e,t){for(var r=[],s=0;s>1]),r.push(i)}return r}function Th(e,t,r){if(!r||0===r.length)return[Ch(e,t)];var s,i=0,n=Array.from(r).map(function(t){return e.slice(i,i=t<<1)});return t&&(i=0,s=Array.from(r).map(function(e){return t.slice(i,i=e)})),n.map(function(e,t){return Ch(e,s?s[t]:void 0)})}function Mh(e,t){var r=t;if(r===yh.Unknown&&(r=e.type()),r===yh.GeometryCollection){for(var s=[],i=0;i=0;r--)e.addInt8(t[r]);return e.endVector()}},{key:"startPropertiesVector",value:function(e,t){e.startVector(1,t,1)}},{key:"addColumns",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"createColumnsVector",value:function(e,t){e.startVector(4,t.length,4);for(var r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}},{key:"startColumnsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"endFeature",value:function(e){return e.endObject()}},{key:"finishFeatureBuffer",value:function(e,t){e.finish(t)}},{key:"finishSizePrefixedFeatureBuffer",value:function(e,t){e.finish(t,void 0,!0)}},{key:"createFeature",value:function(t,r,s,i){return e.startFeature(t),e.addGeometry(t,r),e.addProperties(t,s),e.addColumns(t,i),e.endFeature(t)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"geometry",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?(e||new wh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"properties",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}},{key:"propertiesLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"propertiesArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"columns",value:function(e,t){var r=this.bb.__offset(this.bb_pos,8);return r?(t||new Ah).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"columnsLength",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}}])&&Oh(t.prototype,r),s&&Oh(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Lh=(new TextEncoder,new TextDecoder);function Ih(e,t){var r={};if(!t||0===t.length)return r;var s=e.propertiesArray();if(!s)return r;for(var i=new DataView(s.buffer,s.byteOffset),n=e.propertiesLength(),a=0;a=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startEnvelopeVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addGeometryType",value:function(e,t){e.addFieldInt8(2,t,yh.Unknown)}},{key:"addHasZ",value:function(e,t){e.addFieldInt8(3,+t,0)}},{key:"addHasM",value:function(e,t){e.addFieldInt8(4,+t,0)}},{key:"addHasT",value:function(e,t){e.addFieldInt8(5,+t,0)}},{key:"addHasTm",value:function(e,t){e.addFieldInt8(6,+t,0)}},{key:"addColumns",value:function(e,t){e.addFieldOffset(7,t,0)}},{key:"createColumnsVector",value:function(e,t){e.startVector(4,t.length,4);for(var r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}},{key:"startColumnsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"addFeaturesCount",value:function(e,t){e.addFieldInt64(8,t,BigInt("0"))}},{key:"addIndexNodeSize",value:function(e,t){e.addFieldInt16(9,t,16)}},{key:"addCrs",value:function(e,t){e.addFieldOffset(10,t,0)}},{key:"addTitle",value:function(e,t){e.addFieldOffset(11,t,0)}},{key:"addDescription",value:function(e,t){e.addFieldOffset(12,t,0)}},{key:"addMetadata",value:function(e,t){e.addFieldOffset(13,t,0)}},{key:"endHeader",value:function(e){return e.endObject()}},{key:"finishHeaderBuffer",value:function(e,t){e.finish(t)}},{key:"finishSizePrefixedHeaderBuffer",value:function(e,t){e.finish(t,void 0,!0)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"name",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"envelope",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"envelopeLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"envelopeArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"geometryType",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):yh.Unknown}},{key:"hasZ",value:function(){var e=this.bb.__offset(this.bb_pos,10);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasM",value:function(){var e=this.bb.__offset(this.bb_pos,12);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasT",value:function(){var e=this.bb.__offset(this.bb_pos,14);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasTm",value:function(){var e=this.bb.__offset(this.bb_pos,16);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"columns",value:function(e,t){var r=this.bb.__offset(this.bb_pos,18);return r?(t||new Ah).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"columnsLength",value:function(){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"featuresCount",value:function(){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}},{key:"indexNodeSize",value:function(){var e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}},{key:"crs",value:function(e){var t=this.bb.__offset(this.bb_pos,24);return t?(e||new Rh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"title",value:function(e){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"metadata",value:function(e){var t=this.bb.__offset(this.bb_pos,30);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&Dh(t.prototype,r),s&&Dh(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bh(e){for(var t=Gh.getRootAsHeader(e),r=t.featuresCount(),s=t.indexNodeSize(),i=[],n=0;ne)){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s=0;--i){var n=this.tryEntries[i],a=n.completion;if("root"===n.tryLoc)return s("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--s){var i=this.tryEntries[s];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var s=r.completion;if("throw"===s.type){var i=s.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function Yh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var s,i,n=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Xh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xh(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);rthis.nodes[1]),this.nodes[1]=e}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&Zh(t.prototype,r),s&&Zh(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),a=s.minX,o=s.minY,l=s.maxX,h=s.maxY,qh.info("tree items: ".concat(t,", nodeSize: ").concat(r)),u=ru(t,r),c=u[0][0],void 0,m=u.length-1,d=new n([0,1],m),p=[d],qh.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(t,", nodeSize: ").concat(r,", levelBounds: ").concat(u)),f=Wh().mark(function e(){var s,d,f,m,y,g,v,b,S,x,_,w;return Wh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=p.shift(),qh.debug("popped node: ".concat(s,", queueLength: ").concat(p.length)),d=s.startNode(),f=d>=c,m=Yh(u[s.level()],2),y=m[1],g=Math.min(s.endNode()+r,y),v=g-d,e.next=9,new $h(i(d*eu,v*eu),0);case 9:b=e.sent,S=new Float64Array(b),x=new Uint32Array(b),_=Wh().mark(function e(r){var i,u,m,y,g,v,b,_;return Wh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(lS[i+2])){e.next=7;break}return e.abrupt("return","continue");case 7:if(!(o>S[i+3])){e.next=9;break}return e.abrupt("return","continue");case 9:if(u=x[8+(i<<1)],m=x[9+(i<<1)],y=nu(m,u),!f){e.next=17;break}return g=function(){if(r ").concat(y)),b.extendEndNodeToNewOffset(y),e.abrupt("return","continue");case 23:void 0,w=s.level()-1,_=new n([y,y+1],w),void 0!==b&&b.level()==_.level()?qh.info("Same level, but too far away. Pushing new request at offset: ".concat(y," rather than merging with distant ").concat(b)):qh.info("Pushing new level for ".concat(_," onto queue with nearestNodeRange: ").concat(b," since there's not already a range for this level.")),p.push(_);case 26:case"end":return e.stop()}var w},e)}),w=d;case 14:if(!(w=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){o=!0,n=e},f:function(){try{a||null==r.return||r.return()}finally{if(o)throw n}}}}function uu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var s,i,n=[],a=!0,o=!1;try{for(r=r.call(e);!(a=(s=r.next()).done)&&(n.push(s.value),!t||n.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(o)throw i}}return n}(e,t)||cu(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cu(e,t){if(e){if("string"==typeof e)return du(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?du(e,t):void 0}}function du(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r=0;--i){var n=this.tryEntries[i],a=n.completion;if("root"===n.tryLoc)return s("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--s){var i=this.tryEntries[s];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var s=r.completion;if("throw"===s.type){var i=s.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function fu(e,t,r,s,i,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(s,i)}function mu(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){fu(n,s,i,a,o,"next",e)}function o(e){fu(n,s,i,a,o,"throw",e)}a(void 0)})}}function yu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gu(e,t){for(var r=0;rzh.global.extraRequestThreshold()&&(qh.info("Pushing new feature batch, since gap ".concat(S," was too large")),a.push(o),o=[]),o.push([m,g]);case 23:l=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),h=!0,u=r.t0;case 32:if(r.prev=32,r.prev=33,!l||null==c.return){r.next=37;break}return r.next=37,xu(c.return());case 37:if(r.prev=37,!h){r.next=40;break}throw u;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return t.headerClient.logUsage("header+index"),o.length>0&&a.push(o),x=a.flatMap(function(e){return t.readFeatureBatch(e)}),r.delegateYield(_u(Cu(jh.ZN.merge(x))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return au.length+ou+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(){return new Eu(this.headerClient.httpClient)}},{key:"readFeatureBatch",value:function(e){var t=this;return bu(pu().mark(function r(){var s,i,n,a,o,l,h,u,c,d,p;return pu().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:s=uu(e[0],1),i=s[0],n=uu(e[e.length-1],2),a=n[0],o=n[1],l=a+o-i,h=t.buildFeatureClient(),u=hu(e),r.prev=7,u.s();case 9:if((c=u.n()).done){r.next=17;break}return d=uu(c.value,1),p=d[0],r.next=13,xu(t.readFeature(h,p,l));case 13:return r.next=15,r.sent;case 15:r.next=9;break;case 17:r.next=22;break;case 19:r.prev=19,r.t0=r.catch(7),u.e(r.t0);case 22:return r.prev=22,u.f(),r.finish(22);case 25:h.logUsage("feature");case 26:case"end":return r.stop()}},r,null,[[7,19,22,25]])}))()}},{key:"readFeature",value:function(){var e=mu(pu().mark(function e(t,r,s){var i,n,a,o,l,h,u;return pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=r+this.lengthBeforeFeatures(),e.next=3,t.getRange(i,4,s,"feature length");case 3:return a=e.sent,n=new DataView(a).getUint32(0,!0),e.next=7,t.getRange(i+4,n,s,"feature data");case 7:return o=e.sent,l=new Uint8Array(o),(h=new Uint8Array(n+ou)).set(l,ou),(u=new Sh.cZ(h)).setPosition(ou),e.abrupt("return",Ph.getRootAsFeature(u));case 14:case"end":return e.stop()}},e,this)}));return function(t,r,s){return e.apply(this,arguments)}}()}],[{key:"open",value:function(){var t=mu(pu().mark(function t(r){var s,i,n,a,o,l,h,u,c,d,p;return pu().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=2024,i=new Eu(r),n=function(){var e,t=0;for(e=0;e<3;e++){t+=Math.pow(16,e)*eu}return t}(),a=s+n,qh.debug("fetching header. minReqLength: ".concat(a," (assumedHeaderLength: ").concat(s,", assumedIndexLength: ").concat(n,")")),t.t0=Uint8Array,t.next=8,i.getRange(0,8,a,"header");case 8:if(t.t1=t.sent,(o=new t.t0(t.t1)).subarray(0,3).every(function(e,t){return au[t]===e})){t.next=13;break}throw qh.error("bytes: ".concat(o," != ").concat(au)),new Error("Not a FlatGeobuf file");case 13:return qh.debug("magic bytes look good"),t.next=16,i.getRange(8,4,a,"header");case 16:if(h=t.sent,!((l=new DataView(h).getUint32(0,!0))>10485760||l<8)){t.next=21;break}throw new Error("Invalid header size");case 21:return qh.debug("headerLength: ".concat(l)),t.next=24,i.getRange(12,l,a,"header");case 24:return u=t.sent,c=new Sh.cZ(new Uint8Array(u)),d=Bh(c),p=tu(d.featuresCount,d.indexNodeSize),qh.debug("completed: opening http reader"),t.abrupt("return",new e(i,d,l,p));case 30:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()}]),e}(),Eu=function(){function e(t){yu(this,e),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new Au(t):t}return vu(e,[{key:"getRange",value:function(){var e=mu(pu().mark(function e(t,r,s,i){var n,a,o;return pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bytesEverUsed+=r,n=t-this.head,a=n+r,!(n>=0&&a<=this.buffer.byteLength)){e.next=5;break}return e.abrupt("return",this.buffer.slice(n,a));case 5:return o=Math.max(r,s),this.bytesEverFetched+=o,qh.debug("requesting for new Range: ".concat(t,"-").concat(t+r-1)),e.next=10,this.httpClient.getRange(t,o,i);case 10:return this.buffer=e.sent,this.head=t,e.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return e.stop()}},e,this)}));return function(t,r,s,i){return e.apply(this,arguments)}}()},{key:"logUsage",value:function(e){var t=e.split(" ")[0],r=this.bytesEverUsed,s=this.bytesEverFetched,i=(100*r/s).toFixed(2);qh.info("".concat(t," bytes used/requested: ").concat(r," / ").concat(s," = ").concat(i,"%"))}}]),e}(),Au=function(){function e(t){yu(this,e),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}return vu(e,[{key:"getRange",value:function(){var e=mu(pu().mark(function e(t,r,s){var i,n;return pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,i="bytes=".concat(t,"-").concat(t+r-1),qh.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(s,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(i)),e.next=6,fetch(this.url,{headers:{Range:i}});case 6:return n=e.sent,e.abrupt("return",n.arrayBuffer());case 8:case"end":return e.stop()}},e,this)}));return function(t,r,s){return e.apply(this,arguments)}}()}]),e}();function Ou(e){"@babel/helpers - typeof";return(Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pu(){Pu=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},i=s.iterator||"@@iterator",n=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function o(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,r){return e[t]=r}}function l(e,t,r,s){var i=t&&t.prototype instanceof c?t:c,n=Object.create(i.prototype),a=new w(s||[]);return n._invoke=function(e,t,r){var s="suspendedStart";return function(i,n){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===i)throw n;return T()}for(r.method=i,r.arg=n;;){var a=r.delegate;if(a){var o=S(a,r);if(o){if(o===u)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===s)throw s="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);s="executing";var l=h(e,t,r);if("normal"===l.type){if(s=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(s="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),n}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function c(){}function d(){}function p(){}var f={};o(f,i,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==t&&r.call(y,i)&&(f=y);var g=p.prototype=c.prototype=Object.create(f);function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){var s;this._invoke=function(i,n){function a(){return new t(function(s,a){!function s(i,n,a,o){var l=h(e[i],e,n);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==Ou(c)&&r.call(c,"__await")?t.resolve(c.__await).then(function(e){s("next",e,a,o)},function(e){s("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return s("throw",e,a,o)})}o(l.arg)}(i,n,s,a)})}return s=s?s.then(a,a):a()}}function S(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var s=h(r,e.iterator,t.arg);if("throw"===s.type)return t.method="throw",t.arg=s.arg,t.delegate=null,u;var i=s.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function C(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,n=function t(){for(;++s=0;--i){var n=this.tryEntries[i],a=n.completion;if("root"===n.tryLoc)return s("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--s){var i=this.tryEntries[s];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var s=r.completion;if("throw"===s.type){var i=s.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function Lu(e,t,r,s,i,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(s,i)}function Iu(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){Lu(n,s,i,a,o,"next",e)}function o(e){Lu(n,s,i,a,o,"throw",e)}a(void 0)})}}function Nu(e){var t,r,s,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,s=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e);if(s&&null!=(t=e[s]))return new Fu(t.call(e));r="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function Fu(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(Fu=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new Fu(e)}function ku(e){return new Gu(e,0)}function Ru(e){return function(){return new Du(e.apply(this,arguments))}}function Du(e){var t,r;function s(t,r){try{var n=e[t](r),a=n.value,o=a instanceof Gu;Promise.resolve(o?a.v:a).then(function(r){if(o){var l="return"===t?"return":"next";if(!a.k||r.done)return s(l,r);r=e[l](r).value}i(n.done?"return":"normal",r)},function(e){s("throw",e)})}catch(e){i("throw",e)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?s(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise(function(n,a){var o={key:e,arg:i,resolve:n,reject:a,next:null};r?r=r.next=o:(t=r=o,s(e,i))})},"function"!=typeof e.return&&(this.return=void 0)}function Gu(e,t){this.v=e,this.k=t}function Bu(){return(Bu=Ru(Pu().mark(function e(t,r,s){var i,n,a,o,l,h,u,c,d,p;return Pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=Fh(t),n=function(){var e=Iu(Pu().mark(function e(t){return Pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.slice(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.t0=Uint8Array,e.next=5,ku(n(8,"magic bytes"));case 5:if(e.t1=e.sent,(a=new e.t0(e.t1)).subarray(0,3).every(function(e,t){return au[t]===e})){e.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return e.t2=Uint8Array,e.next=12,ku(n(4,"header length"));case 12:return e.t3=e.sent,a=new e.t2(e.t3),o=new Sh.cZ(a),l=o.readUint32(0),e.t4=Uint8Array,e.next=19,ku(n(l,"header data"));case 19:if(e.t5=e.sent,a=new e.t4(e.t5),o=new Sh.cZ(a),h=Bh(o),s&&s(h),u=h.indexNodeSize,c=h.featuresCount,!(u>0)){e.next=29;break}return d=tu(c,u),e.next=29,ku(n(d,"entire index, w/o rect"));case 29:return e.next=31,ku(Uu(n,h,r));case 31:if(!(p=e.sent)){e.next=36;break}return e.next=34,p;case 34:e.next=29;break;case 36:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ju(){return(ju=Ru(Pu().mark(function e(t,r,s,i){var n,a,o,l,h,u,c;return Pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ku(Mu.open(t));case 2:n=e.sent,qh.debug("opened reader"),i&&i(n.header),a=!1,o=!1,e.prev=7,h=Nu(n.selectBbox(r));case 9:return e.next=11,ku(h.next());case 11:if(!(a=!(u=e.sent).done)){e.next=18;break}return c=u.value,e.next=15,s(c,n.header);case 15:a=!1,e.next=9;break;case 18:e.next=24;break;case 20:e.prev=20,e.t0=e.catch(7),o=!0,l=e.t0;case 24:if(e.prev=24,e.prev=25,!a||null==h.return){e.next=29;break}return e.next=29,ku(h.return());case 29:if(e.prev=29,!o){e.next=32;break}throw l;case 32:return e.finish(29);case 33:return e.finish(24);case 34:case"end":return e.stop()}},e,null,[[7,20,24,34],[25,,29,33]])}))).apply(this,arguments)}function Uu(e,t,r){return Vu.apply(this,arguments)}function Vu(){return(Vu=Iu(Pu().mark(function e(t,r,s){var i,n,a,o,l;return Pu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,t(4,"feature length");case 3:if(e.t1=e.sent,0!==(i=new e.t0(e.t1)).byteLength){e.next=7;break}return e.abrupt("return");case 7:return n=new Sh.cZ(i),a=n.readUint32(0),e.t2=Uint8Array,e.next=12,t(a,"feature data");case 12:return e.t3=e.sent,i=new e.t2(e.t3),(o=new Uint8Array(a+4)).set(i,4),(n=new Sh.cZ(o)).setPosition(ou),l=Ph.getRootAsFeature(n),e.abrupt("return",s(l,r));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function zu(e,t){return{type:"FeatureCollection",features:function(e,t,r){if(!e.subarray(0,3).every(function(e,t){return au[t]===e}))throw new Error("Not a FlatGeobuf file");var s=new Sh.cZ(e),i=s.readUint32(au.length);s.setPosition(au.length+ou);var n=Bh(s);r&&r(n);var a=au.length+ou+i,o=n.indexNodeSize,l=n.featuresCount;o>0&&(a+=tu(l,o));for(var h=[];a=0;--i){var n=this.tryEntries[i],a=n.completion;if("root"===n.tryLoc)return s("end");if(n.tryLoc<=this.prev){var o=r.call(n,"catchLoc"),l=r.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--s){var i=this.tryEntries[s];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var s=r.completion;if("throw"===s.type){var i=s.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}function Qu(e,t,r,s,i,n,a){try{var o=e[n](a),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(s,i)}function Zu(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){Qu(n,s,i,a,o,"next",e)}function o(e){Qu(n,s,i,a,o,"throw",e)}a(void 0)})}}function Ku(e,t){for(var r=0;r1?(h=d,c=new t.geom.MultiPolygon(null)):c=new t.geom.Polygon(null)}else c=u===t.geom.GeometryType.POINT?new t.geom.Point(null):u===t.geom.GeometryType.LINE_STRING?new t.geom.LineString(null):u===t.geom.GeometryType.POLYGON?new t.geom.Polygon(null):u===t.geom.GeometryType.MULTI_POINT?new t.geom.MultiPoint(null):u===t.geom.GeometryType.MULTI_LINE_STRING?new t.geom.MultiLineString(null):null;if(c){c.setFlatCoordinates(t.geom.GeometryLayout.XY,l,h),i=new this.featureClass_,this.geometryName_&&i.setGeometryName(this.geometryName_);var v=t.format.Feature.transformWithOptions(c,!1,this.adaptOptions(s));i.setGeometry(v),i.setId(a),i.setProperties(o)}}return i},t.geom.flat.textpath.lineString=function(e,r,s,i,n,a,o,l){for(var h=[],u=Math.atan2(e[s-i+1]-e[r+1],e[s-i]-e[r]),c=u<-.785||u>2.356,d=u<-.785&&u>-2.356||u>.785&&u<2.356,p=n.length,f=e[r],m=e[r+1],y=e[r+=i],g=e[r+1],v=0,b=Math.sqrt(Math.pow(y-f,2)+Math.pow(g-m,2));r=19968&&L<=40907,N=a(E=c?P+E:E+P)-A;for(A+=N;r1?G:G<0||G>1?D:D1?G:G<0||G>1?D:D0?-Math.PI:Math.PI),I&&d&&(z+=z>0?-Math.PI/2:Math.PI/2),void 0!==_){var J=z-_;if(J+=J>Math.PI?-2*Math.PI:J<-Math.PI?2*Math.PI:0,I===w?Math.abs(J)>l:Math.abs(J)>l+Math.PI/2)return null}_!=z||d?(A=N,S=[B,j,N/2,z,E=P],c?h.unshift(S):h.push(S),_=z,w=I):(c&&(S[0]=B,S[1]=j,S[2]=N/2),S[4]=E),T=U,M=V,o+=N}return h},t.layer.VectorTile.prototype.setFastRender=function(e){return this.fastRender=e},t.renderer.canvas.VectorTileLayer.prototype.postCompose=function(e,r,s){var i,n,a=this.getLayer(),o=a.getDeclutter()?{}:null,l=a.getSource(),h=a.getRenderMode(),u=t.renderer.canvas.VectorTileLayer.VECTOR_REPLAYS[h],c=r.pixelRatio,d=r.viewState.rotation,p=r.size;d&&(i=Math.round(c*p[0]/2),n=Math.round(c*p[1]/2),t.render.canvas.rotateAtOffset(e,-d,i,n)),o&&this.declutterTree_.clear();for(var f=this.renderedTiles,m=l.getTileGridForProjection(r.viewState.projection),y=[],g=[],v=f.length-1;v>=0;--v){var b=f[v];if(b.getState()!=t.TileState.ABORT)for(var S=b.tileCoord,x=m.getTileCoordExtent(S)[0]-m.getTileCoordExtent(b.wrappedTileCoord)[0],_=void 0,w=0,C=b.tileKeys.length;w{hc()(this.selectedObjects,t=>e.id===t.id&&e.sourceLayer===t.sourceLayer)})}clearSelectedObjects(){this.selectedObjects=[]}updateStyles(e){"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);const t={};e.forEach(e=>{t[e.id]=e});let r=0;for(const s in this._mbStyle.layers){const i=this._mbStyle.layers[s];if(r>=e.length)break;if(!t[i.id])continue;const n=JSON.parse(JSON.stringify(t[i.id]));n.paint&&(n.paint=Object.assign({},i.paint,n.paint)),n.layout&&(n.layout=Object.assign({},i.layout,n.layout)),Object.assign(i,n),r++}this._createStyleFunction()}setStyle(e){this.layersBySourceLayer={},this._loadStyle(e)}_loadStyle(e){if("[object Object]"==Object.prototype.toString.call(e))this._mbStyle=e,this._resolve();else{var t=je.appendCredential(e);Be.get(t,null,{withCredentials:this.withCredentials}).then(e=>e.json()).then(e=>{this._mbStyle=e,this._resolve()})}}_resolve(){if(this.source||(this.source=Object.keys(this._mbStyle.sources)[0]),this._mbStyle.sprite){const e=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"";this._mbStyle.sprite=this._mbStyle.sprite.replace("@2x","");const t=this._toSpriteUrl(this._mbStyle.sprite,this.path,e+".json");Be.get(je.appendCredential(t),null,{withCredentials:this.withCredentials}).then(e=>e.json()).then(t=>{this._spriteData=t,this._spriteImageUrl=je.appendCredential(this._toSpriteUrl(this._mbStyle.sprite,this.path,e+".png")),this._spriteImage=null;const r=new Image;r.crossOrigin=this.withCredentials?"use-credentials":"anonymous",r.onload=(()=>{this._spriteImage=r,this._initStyleFunction()}),r.onerror=(()=>{this._spriteImage=null,this._initStyleFunction()}),r.src=this._spriteImageUrl})}else this._initStyleFunction()}_initStyleFunction(){if(!this.resolutions&&this._mbStyle.metadata&&this._mbStyle.metadata.indexbounds){const t=this._mbStyle.metadata.indexbounds;var e=Math.max(t[2]-t[0],t[3]-t[1]);const r=[];for(let t=0;t<30;t++)r.push(e/512/Math.pow(2,t));this.resolutions=r}this._createStyleFunction(),this.dispatchEvent("styleloaded")}_createStyleFunction(){this.map&&window.olms.applyBackground(this.map,this._mbStyle),this.featureStyleFuntion=this._getStyleFunction()}_getStyleFunction(){return this.fun=window.olms.stylefunction({setStyle:function(){},set:function(){},changed:function(){}},this._mbStyle,this.source,this.resolutions,this._spriteData,"",this._spriteImage),(e,t)=>{const r=this.fun(e,t);if(this.selectedObjects.length>0&&this.selectedObjects.find(t=>t.id===e.getId()&&t.sourceLayer===e.get("layer"))){const s=r&&r[0]?r[0].getZIndex():99999;let i=this.selectedStyle(e,t);Array.isArray(i)||(i=[i]);for(let t=0;t2?s[2]:""):e+r}}class cc extends Fa{constructor(e,t){super(e,t)}code(e,t){var r=this;new st(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).code($.urlPathAppend(r.url,"geocoding"),e)}decode(e,t){var r=this;new st(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).decode($.urlPathAppend(r.url,"geodecoding"),e)}}class dc extends Fa{constructor(e,t){super(e,t)}queryChart(e,t,r){var s=this,i=s._processParams(e),n=s._processFormat(r);new Pt(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:n}).processAsync(i)}getChartFeatureInfo(e){var t=this,r=$.urlPathAppend(t.url,"chartFeatureInfoSpecs");new Mt(r,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).processAsync()}_processParams(e){if(!e)return{};e.returnContent=null==e.returnContent||e.returnContent,e.filter&&(e.chartQueryFilterParameters=mo.isArray(e.filter)?e.filter:[e.filter]),e.bounds&&(e.bounds=new se(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3]))}_processFormat(e){return e||t.GEOJSON}}class pc extends Fa{constructor(e,t){super(e,t)}getFields(e,t){var r=this;new Jr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},datasource:e.datasource,dataset:e.dataset}).processAsync()}getFieldStatisticsInfo(e,t){var r=this,s=e.fieldName,i=e.statisticMode;i&&!mo.isArray(i)&&(i=[i]),r.currentStatisticResult={fieldName:s},r._statisticsCallback=t,i.forEach(t=>{r.currentStatisticResult[t]=null,r._fieldStatisticRequest(e.datasource,e.dataset,s,t)})}_fieldStatisticRequest(e,t,r,s){var i=this;new ur(i.url,{eventListeners:{scope:i,processCompleted:i._processCompleted,processFailed:i._statisticsCallback},crossOrigin:i.options.crossOrigin,headers:i.options.headers,datasource:e,dataset:t,field:r,statisticMode:s}).processAsync()}_processCompleted(e){var t=this,r=!0,s=e.result;for(var i in this.currentStatisticResult&&null==t.currentStatisticResult[s.mode]&&(this.currentStatisticResult[s.mode]=s.result),t.currentStatisticResult)if(null==t.currentStatisticResult[i]){r=!1;break}r&&t._statisticsCallback({result:t.currentStatisticResult})}}class fc extends Fa{constructor(e,t){super(e,t)}getDatasets(e,t){if(!e)return;const r=this;new Lr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).getDatasetsService(e)}getDataset(e,t,r){if(!e||!t)return;const s=this;new Lr(s.url,{proxy:s.proxy,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,headers:s.headers,eventListeners:{scope:s,processCompleted:r,processFailed:r}}).getDatasetService(e,t)}setDataset(e,t){if(!(e instanceof Gi||e instanceof Vi))return;if(e instanceof Gi)var r={datasetType:e.datasetType,datasetName:e.datasetName};else e instanceof Vi&&(r={datasetName:e.datasetName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});const s=this,i=$.urlPathAppend(s.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);new Lr(i,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).setDatasetService(r)}deleteDataset(e,t,r){const s=this,i=$.urlPathAppend(s.url,`datasources/name/${e}/datasets/name/${t}`);new Lr(i,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:r,processFailed:r}}).deleteDatasetService()}}class mc extends Fa{constructor(e,t){super(e,t)}getDatasources(e){const t=this;new qt(t.url,{proxy:t.proxy,withCredentials:t.withCredentials,crossOrigin:t.crossOrigin,headers:t.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).getDatasourcesService()}getDatasource(e,t){if(!e)return;const r=this;new qt(r.url,{proxy:r.proxy,withCredentials:r.withCredentials,crossOrigin:r.crossOrigin,headers:r.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).getDatasourceService(e)}setDatasource(e,t){if(!(e instanceof ei))return;const r={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit},s=this,i=$.urlPathAppend(s.url,`datasources/name/${e.datasourceName}`);new qt(i,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).setDatasourceService(r)}}class yc extends Fa{constructor(e,t){super(e,t)}getGridCellInfos(e,t){if(!e)return null;var r=this;new Hr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}}class gc extends Fa{constructor(e,t){super(e,t),this.headers=!0,this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0}getTools(e){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:e,processFailed:e}}).getTools()}getTool(e,t){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:t,processFailed:t}}).getTool(e)}execute(e,t,r,s){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:s,processFailed:s}}).execute(e,t,r)}submitJob(e,t,r,s){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:s,processFailed:s}}).submitJob(e,t,r)}waitForJobCompletion(e,t,r,s){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:s,processFailed:s}}).waitForJobCompletion(e,t,r)}getJobInfo(e,t,r){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:r,processFailed:r}}).getJobInfo(e,t)}cancelJob(e,t,r){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:r,processFailed:r}}).cancelJob(e,t)}getJobs(e,t){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:t,processFailed:t}}).getJobs(e)}getResults(e,t,r,s){new Ar(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers,eventListeners:{scope:this,processCompleted:s,processFailed:s}}).getResults(e,t,r)}}class vc extends Fa{constructor(e,t){super(e,t)}getLayersInfo(e){var t=this;new _s(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{processCompleted:e,processFailed:e}}).processAsync()}setLayerInfo(e,t){if(e){var r=this,s=e.resourceID,i=e.tempLayerName,n=e.layerInfo;if(s&&i){var a=$.urlPathAppend(r.url,"tempLayersSet/"+s+"/"+i);new ti(a,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(n)}}}setLayersInfo(e,t){if(e){var r=this,s=e.resourceID,i=!!e.isTempLayers&&e.isTempLayers,n=e.layersInfo;if((!i||s)&&n)new ri(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t},resourceID:s,isTempLayers:i}).processAsync(n)}}setLayerStatus(e,t){if(e){var r=this;new ii(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(e)}}}class bc extends Fa{constructor(e,t){super(e,t)}measureDistance(e,t){this.measure(e,"DISTANCE",t)}measureArea(e,t){this.measure(e,"AREA",t)}measure(e,t,r){var s=this;new Rs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,measureMode:t,eventListeners:{scope:s,processCompleted:r,processFailed:r}}).processAsync(s._processParam(e))}_processParam(e){return e&&e.geometry&&(e.geometry=mo.toSuperMapGeometry(JSON.parse((new(Ko())).writeGeometry(e.geometry)))),e}}class Sc extends Fa{constructor(e,t){super(e,t)}sinksFacilityAnalyst(e,t){var r=this;new Kt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}sourcesFacilityAnalyst(e,t){var r=this;new er(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}traceUpFacilityAnalyst(e,t){var r=this;new ar(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}traceDownFacilityAnalyst(e,t){var r=this;new ir(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}upstreamFacilityAnalyst(e,t){var r=this;new lr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}}class xc extends Fa{constructor(e,t){super(e,t)}burstPipelineAnalyst(e,t){var r=this;new Tt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(r._processParams(e))}computeWeightMatrix(e,t){var r=this;new kt(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(r._processParams(e))}findClosestFacilities(e,t,r){var s=this;new dr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}streamFacilityAnalyst(e,t,r){var s=this;new rr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}findLocation(e,t,r){var s=this;new fr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}findPath(e,t,r){var s=this;new vr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}findTSPPaths(e,t,r){var s=this;new _r(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}findMTSPPaths(e,t,r){var s=this;new yr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}findServiceAreas(e,t,r){var s=this;new Sr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}updateEdgeWeight(e,t){var r=this;new Bi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}updateTurnNodeWeight(e,t){var r=this;new Ui(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t}}).processAsync(e)}_processParams(e){if(!e)return{};if(e.centers&&mo.isArray(e.centers)&&e.centers.map(function(t,r){return e.centers[r]=t instanceof Sl()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.centers[r]}),e.nodes&&mo.isArray(e.nodes)&&e.nodes.map(function(t,r){return e.nodes[r]=t instanceof Sl()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.nodes[r]}),e.event&&e.event instanceof Sl()&&(e.event={x:e.event.getCoordinates()[0],y:e.event.getCoordinates()[1]}),e.facilities&&mo.isArray(e.facilities)&&e.facilities.map(function(t,r){return e.facilities[r]=t instanceof Sl()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.facilities[r]}),e.parameter&&e.parameter.barrierPoints){var t=e.parameter.barrierPoints;mo.isArray(t)?t.map(function(t,r){return e.parameter.barrierPoints[r]=t instanceof Sl()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t,e.parameter.barrierPoints[r]}):e.parameter.barrierPoints=[t instanceof Sl()?{x:t.getCoordinates()[0],y:t.getCoordinates()[1]}:t]}return e}_processFormat(e){return e||t.GEOJSON}}class _c extends Fa{constructor(e,t){super(e,t),this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={}}getKernelDensityJobs(e,t){var r=this,s=r._processFormat(t);new Ps(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getKernelDensityJobs()}getKernelDensityJob(e,t,r){var s=this,i=s._processFormat(r);new Ps(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getKernelDensityJob(e)}addKernelDensityJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new Ps(i.url,{proxy:i.proxy,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.kernelDensityJobs[e.id]=e.state}},format:a}).addKernelDensityJob(n,r)}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var r=this,s=r._processFormat(t);new di(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getSummaryMeshJobs()}getSummaryMeshJob(e,t,r){var s=this,i=s._processFormat(r);new di(s.url,{proxy:s.options.proxy,crossOrigin:s.options.crossOrigin,headers:s.options.headers,withCredentials:s.options.withCredentials,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getSummaryMeshJob(e)}addSummaryMeshJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new di(i.url,{proxy:i.proxy,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.summaryMeshJobs[e.id]=e.state}},format:a}).addSummaryMeshJob(n,r)}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var r=this,s=r._processFormat(t);new ai(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getQueryJobs()}getQueryJob(e,t,r){var s=this,i=s._processFormat(r);new ai(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getQueryJob(e)}addQueryJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new ai(i.url,{proxy:i.proxy,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.queryJobs[e.id]=e.state}},format:a}).addQueryJob(n,r)}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var r=this,s=r._processFormat(t);new fi(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getSummaryRegionJobs()}getSummaryRegionJob(e,t,r){var s=this,i=s._processFormat(r);new fi(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getSummaryRegionJob(e)}addSummaryRegionJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new fi(i.url,{proxy:i.proxy,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.summaryRegionJobs[e.id]=e.state}},format:a}).addSummaryRegionJob(n,r)}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var r=this,s=r._processFormat(t);new Ji(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getVectorClipJobs()}getVectorClipJob(e,t,r){var s=this,i=s._processFormat(r);new Ji(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getVectorClipJob(e)}addVectorClipJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new Ji(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.vectorClipJobs[e.id]=e.state}},format:a}).addVectorClipJob(n,r)}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var r=this,s=r._processFormat(t);new Bs(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getOverlayGeoJobs()}getOverlayGeoJob(e,t,r){var s=this,i=s._processFormat(r);new Bs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getOverlayGeoJob(e)}addOverlayGeoJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new Bs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.overlayGeoJobs[e.id]=e.state}},format:a}).addOverlayGeoJob(n,r)}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var r=this,s=r._processFormat(t);new _t(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getBuffersJobs()}getBuffersJob(e,t,r){var s=this,i=s._processFormat(r);new _t(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getBuffersJob(e)}addBuffersJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new _t(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.buffersJobs[e.id]=e.state}},format:a}).addBuffersJob(n,r)}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var r=this,s=r._processFormat(t);new Li(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getTopologyValidatorJobs()}getTopologyValidatorJob(e,t,r){var s=this,i=s._processFormat(r);new Li(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getTopologyValidatorJob(e)}addTopologyValidatorJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new Li(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.topologyValidatorJobs[e.id]=e.state}},format:a}).addTopologyValidatorJob(n,r)}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var r=this,s=r._processFormat(t);new ui(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:e,processFailed:e},format:s}).getSummaryAttributesJobs()}getSummaryAttributesJob(e,t,r){var s=this,i=s._processFormat(r);new ui(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:i}).getSummaryAttributesJob(e)}addSummaryAttributesJob(e,t,r,s){var i=this,n=i._processParams(e),a=i._processFormat(s);new ui(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t,processRunning:function(e){i.summaryAttributesJobs[e.id]=e.state}},format:a}).addSummaryAttributesJob(n,r)}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||t.GEOJSON}_processParams(e){return e?(e.bounds&&(e.bounds=mo.toSuperMapBounds(e.bounds)),e.query&&(e.query=mo.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=mo.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=mo.toProcessingParam(e.geometryClip)),e):{}}}class wc extends Fa{constructor(e,t){super(e,t)}getAreaSolarRadiationResult(e,t,r){var s=this;new lt(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(e)}bufferAnalysis(e,t,r){var s=this;new yt(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}densityAnalysis(e,t,r){var s=this;new Wt(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}generateSpatialData(e,t,r){var s=this;new Cr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(e)}geoRelationAnalysis(e,t,r){var s=this;new Pr(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(e)}interpolationAnalysis(e,t,r){var s=this;new As(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}mathExpressionAnalysis(e,t,r){var s=this;new Fs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}overlayAnalysis(e,t,r){var s=this;new Ds(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}routeCalculateMeasure(e,t,r){var s=this;new Qs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}routeLocate(e,t,r){var s=this;new Ks(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}surfaceAnalysis(e,t,r){var s=this;new yi(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}terrainCurvatureCalculate(e,t,r){var s=this;new vi(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(e)}thiessenAnalysis(e,t,r){var s=this;new Ei(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t},format:s._processFormat(r)}).processAsync(s._processParams(e))}geometrybatchAnalysis(e,t,r){for(var s=new Ai(this.url,{eventListeners:{scope:this,processCompleted:t,processFailed:t},format:this._processFormat(r)}),i=[],n=0;n{r&&("MIGRATION"!==t?("DATAFLOW_POINT_TRACK"!==t&&"DATAFLOW_HEAT"!==t||(i&&e.removeLayer(i),n&&n.unSubscribe()),s&&e.removeLayer(s),e.removeLayer(r)):r.remove())}),this.layers=[]}_clear(){this.scales=[],this.resolutionArray=[],this.resolutions={},this.layerAdded=0,this._removeBaseLayer(),this._removeLayers()}refresh(){this._clear(),this.createWebmap()}createMap(e){let t,r,s;e&&(s=e.interactions,t=e.overlays,r=e.controls),this.map=new(Go())({interactions:s,overlays:t,controls:r,target:this.target}),e&&this.registerMapEvent({mapClickCallback:e.mapClickCallback})}registerMapEvent(e){this.map.on("click",function(t){e.mapClickCallback&&e.mapClickCallback(t)})}createWebmap(e){let t;if(e)t=e;else{let e=this.server.split("");"/"!==e[e.length-1]&&(this.server+="/"),t=this.server+"web/maps/"+this.mapId+"/map";let r="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.server.indexOf(r)>-1){let e=this.server.split(r);e.length>1&&(t=e[0]+r+this.server+"web/maps/"+this.mapId+"/map.json")}}this.getMapInfo(t)}getMapInfo(e){let t=this,r=e;-1===e.indexOf(".json")&&(r=`${e}.json`),Be.get(t.getRequestUrl(r),null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){t.getMapInfoSuccess(e)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)})}async getMapInfoSuccess(e){let t=this;if(!1===e.succeed)return void(t.errorCallback&&t.errorCallback(e.error,"getMapFaild",t.map));let r=await t.handleCRS(e.projection,e.baseLayer.url);if(t.mapParams={title:e.title,description:e.description},"BrowseMap"===r.action)t.createSpecLayer(e);else{if("OpenMap"!==r.action)return void(t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${e.projection}`},"getMapFaild",t.map));t.baseProjection=r.newCrs||e.projection,t.webMapVersion=e.version,t.baseLayer=e.baseLayer,t.isHaveGraticule=e.grid&&e.grid.graticule,e.baseLayer&&"MAPBOXSTYLE"===e.baseLayer.layerType?t.addMVTMapLayer(e,e.baseLayer,0).then(async()=>{t.createView(e),e.layers&&0!==e.layers.length?await t.addLayers(e):t.sendMapToUser(0),t.addGraticule(e)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)}):(await t.addBaseMap(e),e.layers&&0!==e.layers.length?await t.addLayers(e):t.sendMapToUser(0),t.addGraticule(e))}}async handleCRS(e,t){let r=this,s={},i=e,n="OpenMap";return this.isCustomProjection(e)?await Be.get(r.getRequestUrl(`${t}/prjCoordSys.wkt`),null,{withCredentials:r.withCredentials,withoutFormatSuffix:!0}).then(function(e){return e.text()}).then(async function(t){if(-1!==t.indexOf(""))throw"ERROR";r.addProjctionFromWKT(t,e),s={action:n,newCrs:i}}).catch(function(){s={action:n="BrowseMap",newCrs:i}}):(0===e.indexOf("EPSG")&&e.split(":")[1]<=0?n="BrowseMap":"EPSG:910111"===e||"EPSG:910112"===e?i="EPSG:3857":"EPSG:910101"===e||"EPSG:910102"===e?i="EPSG:4326":0!==e.indexOf("EPSG")&&(r.addProjctionFromWKT(i),i=r.getEpsgInfoFromWKT(e)),s={action:n,newCrs:i}),s}getScales(e){let t,r,s=[],i={},n=[],a=e.coordUnit||Ua.get(e.projection).getUnits();if(a||(a="EPSG:3857"==this.baseProjection?"m":"degree"),e.visibleScales&&e.visibleScales.length>0)e.visibleScales.forEach(e=>{let r=1/e;t=this.getResFromScale(r,a),e=`1:${r}`,i[this.formatScale(e)]=t,n.push(t),s.push(e)},this);else if("WMTS"===e.layerType)e.scales.forEach(e=>{t=this.getResFromScale(e,a,90.7),e=`1:${e}`,i[this.formatScale(e)]=t,n.push(t),s.push(e)},this);else{let{minZoom:o=0,maxZoom:l=22}=e,h=this.map.getView();for(let e=o;e<=l;e++)if(t=h.getResolutionForZoom(e),r=this.getScaleFromRes(t,a),-1===s.indexOf(r)){s.push(r);let e=r.replace(/,/g,"");i[e]=t,n.push(t)}}this.scales=s,this.resolutions=i,this.resolutionArray=n}getResFromScale(e,t="DEGREE",r=96){return.0254*e/r/td[t.toUpperCase()]}getScaleFromRes(e,t="DEGREE",r=96){let s;return"1:"+(s=e*r*td[t.toUpperCase()]/.0254)}formatScale(e){return e.replace(/,/g,"")}createSpecLayer(e){let t=this,r=e.baseLayer,s=r.url,i=r.layerType,n=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],a=new Ua.Projection({extent:n,units:"m",code:"EPSG:0"});Ua.addProjection(a);let o={center:e.center,level:0};t.baseProjection=a;let l={center:o.center?[o.center.x,o.center.y]:[0,0],zoom:0,projection:a};["4","5"].indexOf(mo.getOlVersion())<0&&(l.multiWorld=!0);let h,u=new(Nc())(l);t.map.setView(u),t.mapParams&&(t.mapParams.extent=n,t.mapParams.projection=e.projection),s&&s.indexOf("?token=")>-1&&(t.credentialKey="token",t.credentialValue=e.baseLayer.credential=s.split("?token=")[1],s=s.split("?token=")[0]),"TILE"===i?Be.get(t.getRequestUrl(`${s}.json`),null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(function(e){r.originResult=e;let i="IPORTAL",n=r.credential,a="Token",o=r.url;(r.url.indexOf("www.supermapol.com")>-1||r.url.indexOf("itest.supermapol.com")>-1)&&(a="Key",o=[o],i="ONLINE"),n&&je[`register${a}`](o,n);let l={serverType:i,url:s,tileGrid:dl.optionsFromMapJSON(s,e).tileGrid};s&&!t.isSameDomain(s)&&(l.tileProxy=t.server+"apps/viewer/getUrlResource.png?url="),h=new dl(l),t.addSpecToMap(h)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)}):"WMS"===i?(h=t.createWMSSource(r),t.addSpecToMap(h)):"WMTS"===i?Be.get(t.getRequestUrl(s,!0),null,{withCredentials:this.withCredentials}).then(function(e){return e.text()}).then(function(s){r.extent=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],r.scales=t.getWMTSScales(r.tileMatrixSet,s),r.dpi=rd.iServerWMTS,h=t.createWMTSSource(r),t.addSpecToMap(h)}).catch(function(e){t.errorCallback&&t.errorCallback(e,"getMapFaild",t.map)}):t.errorCallback&&t.errorCallback({type:"Not support CS",errorMsg:`Not support CS: ${i}`},"getMapFaild",t.map),u&&u.fit(n)}addSpecToMap(e){let t=new Bc.Tile({source:e,zIndex:0});this.map.addLayer(t),this.sendMapToUser(0)}getWMTSScales(e,t){let r=(new(Uc())).read(t).Contents.TileMatrixSet,s=[];for(let t=0;t=1)}limitScale(e,t){if(this.validScale(e.minScale)&&this.validScale(e.maxScale)){let r,s,i;if("WMTS"===t.layerType)r=t.scales,s=+e.minScale.split(":")[1],i=+e.maxScale.split(":")[1];else{const n=this.scales.map(e=>1/e.split(":")[1]);r=Array.isArray(t.visibleScales)&&t.visibleScales.length&&t.visibleScales?t.visibleScales:n,s=1/+e.minScale.split(":")[1],i=1/+e.maxScale.split(":")[1]}const n=this.findNearest(r,s),a=this.findNearest(r,i);let o=r.indexOf(n),l=r.indexOf(a);o>l&&([o,l]=[l,o]),0===o&&l===r.length-1||(this.map.setView(new(Nc())(Object.assign({},this.map.getView().options_,{maxResolution:void 0,minResolution:void 0,minZoom:o,maxZoom:l,constrainResolution:!1}))),this.map.addInteraction(new(kc())({constrainResolution:!0})))}}parseNumber(e){return Number(e.split(":")[1])}findNearest(e,t){let r=0,s=t;for(let t=1,i=e.length;tthis.createMVTLayer(e).then(e=>{let r=mo.newGuid(8);t.name&&e.setProperties({name:t.name,layerID:r,layerType:"VECTOR_TILE"}),t.visibleScale&&this.setVisibleScales(e,t.visibleScale),t.layer=e,t.layerID=r,this.map.addLayer(e)})).catch(function(e){throw e})}createView(e){let t,r=e.center,s=void 0!==e.level?e.level:1,i=e.maxZoom||22,n=this.baseProjection,a=[];for(let e in r)a.push(r[e]);0===a.length&&(a=[0,0]),this.baseLayerExtent=t=e.baseLayer&&e.baseLayer.extent,this.mapParams&&(this.mapParams.extent=t,this.mapParams.projection=n),!(0,$o.containsCoordinate)(t,a)&&(a=(0,$o.getCenter)(t));let o,l=e.baseLayer;if(l.visibleScales&&l.visibleScales.length>0||l.scales&&l.scales.length>0)this.getScales(l);else if(e.baseLayer&&t&&4===t.length){let e=(t[2]-t[0])/512,r=(t[3]-t[1])/512;o=Math.max(e,r)}this.map.setView(new(Nc())({zoom:s,center:a,projection:n,maxZoom:i,maxResolution:o}));let h={};if(l.scales&&l.scales.length>0&&"WMTS"===l.layerType||this.resolutionArray&&this.resolutionArray.length>0?h={zoom:s,center:a,projection:n,resolutions:this.resolutionArray,maxZoom:i}:"WMTS"===l.layerType?(h={zoom:s,center:a,projection:n,maxZoom:i},this.getScales(l)):(h={zoom:s,center:a,projection:n,maxResolution:o,maxZoom:i},this.getScales(l)),["4","5"].indexOf(mo.getOlVersion())<0&&(h.multiWorld=!0,h.showFullExtent=!0,h.enableRotation=!1,h.constrainResolution=!0),this.map.setView(new(Nc())(h)),e.visibleExtent){const t=this.map.getView(),r=t.getResolutionForExtent(e.visibleExtent,this.map.getSize());t.setResolution(r),t.setCenter((0,$o.getCenter)(e.visibleExtent))}}createBaseLayer(e,t,r,s,i){let n,a=this;s&&(a=s);let o=e.layerType;switch((o.indexOf("TIANDITU_VEC")>-1||o.indexOf("TIANDITU_IMG")>-1||o.indexOf("TIANDITU_TER")>-1)&&(o=o.substr(0,12)),o){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":n=this.createTiandituSource(o,e.projection);break;case"BAIDU":n=this.createBaiduSource();break;case"BING":n=this.createBingSource(e,e.projection);break;case"WMS":n=this.createWMSSource(e);break;case"WMTS":n=a.createWMTSSource(e);break;case"TILE":case"SUPERMAP_REST":n=a.createDynamicTiledSource(e,i);break;case"CLOUD":case"CLOUD_BLACK":case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":n=this.createXYZSource(e)}var l=new Bc.Tile({source:n,zIndex:e.zIndex||1,visible:e.visible}),h=mo.newGuid(8);e.name&&l.setProperties({name:e.name,layerID:h}),void 0!==e.visible&&null!==e.visible||(e.visible=!0),l.setVisible(e.visible),e.opacity&&l.setOpacity(e.opacity),t&&l.setZIndex(t),e.layer=l,e.layerID=h;let u,c,{visibleScale:d,autoUpdateTime:p}=e;return d&&(c=this.resolutions[d.minScale],u=this.resolutions[d.maxScale],c>1?l.setMaxResolution(Math.ceil(c)):l.setMaxResolution(1.1*c),l.setMinResolution(u)),p&&!e.autoUpdateInterval&&(e.autoUpdateInterval=setInterval(()=>{a.updateTileToMap(e,t)},p)),r&&(l.setZIndex(0),a.map.addLayer(l)),l}updateTileToMap(e,t){this.map.removeLayer(e.layer),this.map.addLayer(this.createBaseLayer(e,t))}getInternetMapInfo(e){const t=[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892],r=[-180,-90,180,90],s=[-20037508.34,-20037508.34,20037508.34,20037508.34],i=[12555667.53929,1281852.98656,17525908.86651,7484870.70596],n=[-19741117.14519,-10003921.36848,19981677.71404,19660983.56089];switch(e.units="m",e.layerType){case"BAIDU":e.iServerUrl="https://map.baidu.com/",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=t;break;case"CLOUD":e.url="http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"CLOUD_BLACK":e.url="http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"tencent":e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=18,e.level=1,e.extent=t;break;case"TIANDITU_VEC_3857":case"TIANDITU_IMG_3857":case"TIANDITU_TER_3857":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:3857",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=t,"TIANDITU_TER_3857"===e.layerType&&(e.maxZoom=14);break;case"TIANDITU_VEC_4326":case"TIANDITU_IMG_4326":case"TIANDITU_TER_4326":e.iserverUrl="https://map.tianditu.gov.cn/",e.epsgCode="EPSG:4326",e.minZoom=0,e.maxZoom=19,e.level=1,e.extent=r,"TIANDITU_TER_4326"===e.layerType&&(e.maxZoom=14);break;case"OSM":e.url="http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=1,e.extent=s,e.iserverUrl="https://www.openstreetmap.org";break;case"GOOGLE":e.url=`https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s${this.getLang()}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key=${this.googleMapsAPIKey}`,e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=22,e.level=1,e.extent=s,e.iserverUrl="https://www.google.cn/maps";break;case"JAPAN_STD":e.url="https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=1,e.maxZoom=19,e.level=0,e.extent=s;break;case"JAPAN_PALE":e.url="https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=19,e.level=2,e.extent=s;break;case"JAPAN_RELIEF":e.url="https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",e.epsgCode="EPSG:3857",e.minZoom=5,e.maxZoom=14,e.level=5,e.extent=i;break;case"JAPAN_ORT":e.url="https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg",e.epsgCode="EPSG:3857",e.minZoom=2,e.maxZoom=12,e.level=2,e.extent=n}}createDynamicTiledSource(e,t){let r="IPORTAL",s=e.credential?e.credential.token:void 0,i="Token",n=e.url;(e.url.indexOf("www.supermapol.com")>-1||e.url.indexOf("itest.supermapol.com")>-1)&&(i="Key",n=[n],r="ONLINE"),s&&je[`register${i}`](n,s);let a={transparent:!0,url:e.url,wrapX:!1,serverType:r,format:e.format};if(t||this.isCustomProjection(this.baseProjection)||(a.prjCoordSys={epsgCode:this.baseProjection.split(":")[1]}),e.visibleScales&&e.visibleScales.length>0){let t=[];for(let r in e.visibleScales){let s=mo.scaleToResolution(e.visibleScales[r],rd.default,e.coordUnit);t.push(s)}e.visibleResolutions=t;let r=new(qo())({extent:e.extent,resolutions:t});a.tileGrid=r}else{a.extent=this.baseLayerExtent;let t=new(qo())({extent:e.extent,resolutions:this.getResolutionsFromBounds(e.extent)});a.tileGrid=t}e.url&&!this.isSameDomain(e.url)&&"webp"!==e.format&&(a.tileProxy=this.server+"apps/viewer/getUrlResource.png?url=");let o=new dl(a);return je[`register${i}`](e.url),o}getResolutionsFromBounds(e){let t=[],r=Math.abs(e[0]-e[2])/512;for(let e=0;e<22;e++)0!==e?(r/=2,t[e]=r):t[e]=r;return t}createTiandituSource(e,t,r){let s={layerType:e.split("_")[1].toLowerCase(),isLabel:r||!1,projection:t,url:`https://t{0-7}.tianditu.gov.cn/{layer}_{proj}/wmts?tk=${this.tiandituKey}`};return new hl(s)}createBaiduSource(){return new Ho}createBingSource(e,t){return new(rl())({wrapX:!1,projection:t,crossOrigin:"anonymous",tileUrlFunction:function(e){let[t,r,s]=[...e];s=s>0?s-1:-s-1;let i="";for(let e=t;e>0;e--){let t=0,n=1<{if(!1===t.succeed)return t;let i="png";if("webp"===s.tileFormat){i=await s.isSupportWebp(e.url,r)?"webp":"png"}return{units:t.coordUnit&&t.coordUnit.toLowerCase(),coordUnit:t.coordUnit,visibleScales:t.visibleScales,extent:[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top],projection:`EPSG:${t.prjCoordSys.epsgCode}`,format:i}}).catch(e=>({succeed:!1,error:e}))}getTileInfo(e,t,r){let s=this,i={withCredentials:this.withCredentials,withoutFormatSuffix:!0};return e.url.indexOf("?token=")>-1&&(s.credentialKey="token",s.credentialValue=e.credential=e.url.split("?token=")[1],e.url=e.url.split("?token=")[0]),Be.get(s.getRequestUrl(`${e.url}.json`),null,i).then(function(e){return e.json()}).then(async function(i){if(i&&i.code&&200!==i.code)throw i;i.visibleScales&&(e.visibleScales=i.visibleScales,e.coordUnit=i.coordUnit),e.maxZoom=i.maxZoom,e.maxZoom=i.minZoom;let n=e.credential?e.credential.token:void 0;if(e.format="png","webp"===s.tileFormat&&"https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark"!==e.url){const t=await s.isSupportWebp(e.url,n);e.format=t?"webp":"png"}r?t&&t(r,null,!0,s):t&&t(e)}).catch(function(e){s.errorCallback&&s.errorCallback(e,"getTileInfo",s.map)})}getWMTSUrl(e,t){let r="?";return e.indexOf("?")>-1&&(r="&"),e+=t?r+"SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetCapabilities":r+"/1.0.0/WMTSCapabilities.xml",this.getRequestUrl(e,!0)}getWmtsInfo(e,t){let r=this,s={withCredentials:r.withCredentials,withoutFormatSuffix:!0};const i=!e.requestEncoding||"KVP"===e.requestEncoding;return Be.get(r.getWMTSUrl(e.url,i),null,s).then(function(e){return e.text()}).then(function(s){let n=(new(Uc())).read(s);if(r.isValidResponse(n)){let s,o,l,h=n.Contents,u=h.TileMatrixSet,c=h.Layer,d="default";for(let t=0;t{e.isDefault&&(d=e.Identifier)});let p=[],f=[];for(let t=0;t-1?[s[1],s[0]]:s;break}let m,y=e.name;a?(a[0]<-180&&(a[0]=-180),a[1]<-90&&(a[1]=-90),a[2]>180&&(a[2]=180),a[3]>90&&(a[3]=90),m=Ua.transformExtent(a,"EPSG:4326",r.baseProjection)):m=Ua.get(r.baseProjection).getExtent(),e.tileUrl=r.getTileUrl(n.OperationsMetadata.GetTile.DCP.HTTP.Get,s,l,i),e.extent=m,e.name=y,e.orginEpsgCode=e.projection,e.overLayer=!0,e.scales=p,e.style=d,e.title=y,e.unit="m",e.layerFormat=l,e.matrixIds=f,t&&t(e)}}).catch(function(e){r.errorCallback&&r.errorCallback(e,"getWmtsFaild",r.map)})}getWmsInfo(e){let t=this,r=e.url.trim();r+=r.indexOf("?")>-1?"&SERVICE=WMS&REQUEST=GetCapabilities":"?SERVICE=WMS&REQUEST=GetCapabilities";let s={withCredentials:t.withCredentials,withoutFormatSuffix:!0};return new Promise(function(i){return Be.get(t.getRequestUrl(r,!0),null,s).then(function(e){return e.text()}).then(async function(t){let r=(new(zc())).read(t);if(r){let t=r.Capability.Layer.Layer,s=e.projection;e.subLayers=e.layers[0],e.version=r.version;for(let r=0;r{"KVP"===e.Constraint[0].AllowedValues.Value[0].toUpperCase()&&(i=e.href)});else{const e=t.ResourceURL.filter(e=>e.format===r);i=e[0].template}return i}createWMTSSource(e){let t=e.extent||Ua.get(e.projection).getExtent(),r=Ua.get(this.baseProjection).getUnits();return new(nl())({url:e.tileUrl||e.url,layer:e.layer,format:e.layerFormat,style:e.style,matrixSet:e.tileMatrixSet,requestEncoding:e.requestEncoding||"KVP",tileGrid:this.getWMTSTileGrid(t,e.scales,r,e.dpi,e.origin,e.matrixIds),tileLoadFunction:function(t,r){r.indexOf("tianditu.gov.cn")>=0?t.getImage().src=`${r}&tk=${$.getParameters(e.url).tk}`:t.getImage().src=r}})}getWMTSTileGrid(e,t,r,s,i,n){let a=this.getReslutionsFromScales(t,s||rd.iServerWMTS,r);return new(ll())({origin:i,extent:e,resolutions:a.res,matrixIds:n||a.matrixIds})}getReslutionsFromScales(e,t,r,s){r=r&&r.toLowerCase()||"degrees",t=t||rd.iServerWMTS,s=s||6378137;let i=[],n=[];if(mo.isArray(e))e&&e.forEach(function(e,a){e>1&&(n.push(a),i.push(this.getResolutionFromScale(e,t,r,s)))},this);else{let a=e.TileMatrix;a&&a.forEach(function(e){n.push(e.Identifier),i.push(this.getResolutionFromScale(e.ScaleDenominator,t,r,s))},this)}return{res:i,matrixIds:n}}getResolutionFromScale(e,t=rd.default,r,s){let i;return e=(e=+e)>1?1/e:e,i="degrees"===r||"dd"===r||"degree"===r?254/t/e/(2*Math.PI*s/360)/1e4:254/t/e/1e4}isValidResponse(e){let t=["Contents","OperationsMetadata"],r=!0;for(let s=0;s0){this.layers=t;for(let n=0;n{r.layerAdded++,r.sendMapToUser(i)}).catch(function(e){r.layerAdded++,r.sendMapToUser(i),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)});else if(l&&l.serverId||"MARKER"===a.layerType||"HOSTED_TILE"===a.layerType||h){let e=a.dataSource,t=e?e.serverId:a.serverId;if(!t&&!h)return await r.addLayer(a,null,o),r.layerAdded++,void r.sendMapToUser(i);if("MARKER"===a.layerType||e&&(!e.accessType||"DIRECT"===e.accessType)||h){let n=h?`${r.server}apps/dataviz/libs/sample-datas/${e.name}.json`:`${r.server}web/datas/${t}/content.json?pageSize=9999999¤tPage=1`;n=r.getRequestUrl(n),Be.get(n,null,{withCredentials:this.withCredentials}).then(function(e){return e.json()}).then(async function(e){if(!1===e.succeed)return r.layerAdded++,r.sendMapToUser(i),void(r.errorCallback&&r.errorCallback(e.error,"getLayerFaild",r.map));if(e&&e.type){if("JSON"===e.type||"GEOJSON"===e.type)e.content=e.content.type?e.content:JSON.parse(e.content),s=r.geojsonToFeature(e.content,a);else if("EXCEL"===e.type||"CSV"===e.type)if(a.dataSource&&a.dataSource.administrativeInfo){e.content.rows.unshift(e.content.colTitles);let{divisionType:t,divisionField:i}=a.dataSource.administrativeInfo,n=r.excelData2FeatureByDivision(e.content,t,i);s=r._parseGeoJsonData2Feature({allDatas:{features:n.features},fileCode:a.projection})}else s=await r.excelData2Feature(e.content,a);else if("SHP"===e.type){let t=JSON.parse(e.content);e.content=t.layers[0],s=r.geojsonToFeature(e.content,a)}await r.addLayer(a,s,o),r.layerAdded++,r.sendMapToUser(i)}}).catch(function(e){r.layerAdded++,r.sendMapToUser(i),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)})}else{let t="HOSTED_TILE"===a.layerType,s=e?e.serverId:a.serverId;r.checkUploadToRelationship(s).then(function(e){if(e&&e.length>0){let n=e[0].name,l=e[0].type.toUpperCase();r.getDataService(s,n).then(async function(e){let s=e.dataItemServices;if(0===s.length)return r.layerAdded++,r.sendMapToUser(i),void(r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map));if(t){let e=r.getService(s,"RESTDATA");r.isMvt(e.address,n).then(async e=>{await r.getServiceInfoFromLayer(o,i,a,s,n,l,e)}).catch(async()=>{await r.getServiceInfoFromLayer(o,i,a,s,n,l)})}else await r.getServiceInfoFromLayer(o,i,a,s,n,l)})}else r.layerAdded++,r.sendMapToUser(i),r.errorCallback&&r.errorCallback(null,"getLayerFaild",r.map)}).catch(function(e){r.layerAdded++,r.sendMapToUser(i),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)})}}else l&&"USER_DATA"===l.type?r.addGeojsonFromUrl(a,i,o,!1):"TILE"===a.layerType?r.getTileLayerExtent(a,function(e){r.map.addLayer(r.createBaseLayer(e,o)),r.layerAdded++,r.sendMapToUser(i)},function(e){r.layerAdded++,r.sendMapToUser(i),r.errorCallback&&r.errorCallback(e,"getLayerFaild",r.map)}):"SUPERMAP_REST"===a.layerType||"WMS"===a.layerType||"WMTS"===a.layerType?"WMTS"===a.layerType?r.getWmtsInfo(a,function(e){r.map.addLayer(r.createBaseLayer(e,o)),r.layerAdded++,r.sendMapToUser(i)}):"WMS"===a.layerType?r.getWmsInfo(a).then(()=>{r.map.addLayer(r.createBaseLayer(a,o)),r.layerAdded++,r.sendMapToUser(i)}):(a.projection=r.baseProjection,r.map.addLayer(r.createBaseLayer(a,o)),r.layerAdded++,r.sendMapToUser(i)):l&&"REST_DATA"===l.type?r.getFeaturesFromRestData(a,o,i):l&&"REST_MAP"===l.type&&l.url?Tl(l.url,l.layerName,"smid=1",null,null,function(e){var t=e&&e.result.recordsets,s=t&&t[0],n=s.fields;if(s&&n){let e=[];for(var l in n){var h=n[l];0===h.indexOf("Sm")&&"SmID"!==h||e.push(h)}r.getFeatures(e,a,async function(e){await r.addLayer(a,e,o),r.layerAdded++,r.sendMapToUser(i)},function(e){r.layerAdded++,r.errorCallback&&r.errorCallback(e,"getFeatureFaild",r.map)})}},function(e){r.errorCallback&&r.errorCallback(e,"getFeatureFaild",r.map)}):"DATAFLOW_POINT_TRACK"!==a.layerType&&"DATAFLOW_HEAT"!==a.layerType||r.getDataflowInfo(a,async function(){await r.addLayer(a,s,o),r.layerAdded++,r.sendMapToUser(i)},function(e){r.layerAdded++,r.errorCallback&&r.errorCallback(e,"getFeatureFaild",r.map)})}}}addGeojsonFromUrl(e,t,r,s=this.withCredentials){let{dataSource:i}=e,{url:n}=i,a=this;Be.get(n,null,{withCredentials:s,withoutFormatSuffix:!0}).then(function(e){return e.json()}).then(async function(s){if(s&&!1!==s.succeed){var i;if("CSV"===s.type||"EXCEL"===s.type)if(e.dataSource&&e.dataSource.administrativeInfo){s.content.rows.unshift(s.content.colTitles);let{divisionType:t,divisionField:r}=e.dataSource.administrativeInfo,n=a.excelData2FeatureByDivision(s.content,t,r);i=a._parseGeoJsonData2Feature({allDatas:{features:n.features},fileCode:e.projection})}else i=await a.excelData2Feature(s.content,e);else{var n=s.content?JSON.parse(s.content):s;i=a.geojsonToFeature(n,e)}t?(await a.addLayer(e,i,r),a.layerAdded++,a.sendMapToUser(t)):(a.map.removeLayer(e.layer),e.labelLayer&&a.map.removeLayer(e.labelLayer),await a.addLayer(e,i,r))}else t?a.errorCallback&&a.errorCallback(s.error,"autoUpdateFaild",a.map):(a.layerAdded++,a.sendMapToUser(t),a.errorCallback&&a.errorCallback(s.error,"getLayerFaild",a.map))}).catch(function(e){a.layerAdded++,a.sendMapToUser(t),a.errorCallback&&a.errorCallback(e,"getLayerFaild",a.map)})}async getServiceInfoFromLayer(e,t,r,s,i,n,a){let o=this,l=a?!a.isMvt:"HOSTED_TILE"===r.layerType,h=!1;for(let u=0;ue.json());t.xyField={xField:e.xField,yField:e.yField},e.xIndex?(u=e.xIndex,c=e.yIndex):(u=s.indexOf(e.xField),c=s.indexOf(e.yField))}else if("SAMPLE_DATA"===n.type){const e=Lc.find(e=>e.id===n.name)||{};l=e.xField,h=e.yField,t.xyField={xField:l,yField:h},u=s.findIndex(e=>e===l),c=s.findIndex(e=>e===h)}}catch(e){console.error(e)}for(let e=0,t=r.length;e-1){n[r+"_1"]=t[e]}else n[r]=t[e]}let r=new(co())({geometry:e,attributes:n});o.push(r)}}return Promise.resolve(o)}excelData2FeatureByDivision(e,t,r){let s,i=this;if("Province"===t?s=window.ProvinceData:"City"===t?s=window.MunicipalData:"GB-T_2260"===t&&(s=window.AdministrativeArea),s){return i.changeExcel2Geojson(s.features,e.rows,t,r)}}_parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let s=0,i=t.length;se===s);return a.forEach(t=>{let s;if(s="GB-T_2260"===r?e.find(e=>e.properties.GB===t[o]):mo.getHighestMatchAdministration(e,t[o])){let e=window.cloneDeep(s);e.properties={},t.forEach((t,r)=>{let s=n[r].trim();e.properties[s]=t}),i.features.push(e)}}),i}geojsonToFeature(e,t){let r=e.features,s=[];for(let e=0,i=r.length;e-1||n._smiportal_imgLinkUrl.indexOf("https://")>-1?r=n._smiportal_imgLinkUrl:void 0!==n._smiportal_imgLinkUrl&&null!==n._smiportal_imgLinkUrl&&""!==n._smiportal_imgLinkUrl&&(r=`${mo.getIPortalUrl()}resources/markerIcon/${n._smiportal_imgLinkUrl}`),o={dataViz_description:n._smiportal_description,dataViz_imgUrl:r,dataViz_title:n._smiportal_title,dataViz_url:n._smiportal_otherLinkUrl},s.anchor=[.5,1],s.src=s.externalGraphic,l=s,h=Object.assign({},{attributes:o},{useStyle:l}),delete n._smiportal_description,delete n._smiportal_imgLinkUrl,delete n._smiportal_title,delete n._smiportal_otherLinkUrl}else h={attributes:i};n.setProperties(h),s.push(n)}return s}parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let s=0,i=t.length;s{i.updateFeaturesToMap(e,r,!0)},a)}}e.layer=s,e.layerID=n,e.labelStyle&&e.labelStyle.labelField&&"DATAFLOW_POINT_TRACK"!==e.layerType&&(t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,this.addLabelLayer(e,t))}updateFeaturesToMap(e,t){let r=this,s=e.dataSource,i=e.dataSource.url,n=s.dataSourceName||e.name;if("USER_DATA"===s.type||"DIRECT"===s.accessType)r.addGeojsonFromUrl(e,null,t);else{let s=r.formatUrlWithCredential(i),a={};a.withCredentials=this.withCredentials,this.excludePortalProxyUrl||$.isInTheSameDomain(s)||(a.proxy=this.getProxy()),Cl(s,[n],a,async function(s){let i=r.parseGeoJsonData2Feature({allDatas:{features:s.result.features.features},fileCode:e.projection,featureProjection:r.baseProjection});r.map.removeLayer(e.layer),e.labelLayer&&r.map.removeLayer(e.labelLayer),await r.addLayer(e,i,t)},function(e){r.errorCallback&&r.errorCallback(e,"autoUpdateFaild",r.map)},void 0,this.restDataSingleRequestCount)}}async addVectorTileLayer(e,t,r){let s;"RESTDATA"===r&&(s=await this.createDataVectorTileLayer(e));let i=mo.newGuid(8);return s&&(e.name&&s.setProperties({name:e.name,layerID:i}),void 0!=e.opacity&&s.setOpacity(e.opacity),s.setVisible(e.visible),s.setZIndex(t)),e.layer=s,e.layerID=i,s}async createDataVectorTileLayer(e){var t=new(gh())({featureClass:co()});gh().prototype.readProjection=function(){return new Ua.Projection({code:"",units:Gc().TILE_PIXELS})};let r=e.featureType,s=await Ro.toOpenLayersStyle(this.getDataVectorTileStyle(r),r);return new Bc.VectorTile({source:new vh({url:e.url,projection:e.projection,tileType:"ScaleXY",format:t}),style:s})}getDataVectorTileStyle(e){let t={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT"};return["LINE","LINESTRING","MULTILINESTRING"].indexOf(e)>-1?(t.strokeColor="#4CC8A3",t.strokeWidth=2):["REGION","POLYGON","MULTIPOLYGON"].indexOf(e)>-1&&(t.fillColor="#826DBA"),t}getFiterFeatures(e,t){let r=this.parseFilterCondition(e),s=[];for(let e=0;e0&&s.push(i)}return s}parseFilterCondition(e){return e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=").replace(/\(?[^\(]+?\s*in\s*\([^\)]+?\)\)?/gi,e=>{const t=e.match(/([^(]+?)\s*in\s*\(([^)]+?)\)/i);return 3===t.length?`(${t[2].split(",").map(e=>`${t[1]} == ${e.trim()}`).join(" || ")})`:e})}async createGraphicLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let r=await this.getGraphicsFromFeatures(t,e.style,e.featureType),s=new Zl({graphics:r,render:"canvas",map:this.map,isHighLight:!1});return new Bc.Image({source:s})}async getGraphicsFromFeatures(e,t,r){let s=(await Ro.getOpenlayersStyle(t,r)).getImage(),i=[];for(let t in e){let r=new Jl(e[t].getGeometry());r.setStyle(s),r.setProperties({attributes:e[t].get("attributes")}),i.push(r)}return i}createSymbolLayer(e,t){let r=Ro.getSymbolStyle(e.style);return new Bc.Vector({style:r,source:new(ao())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1}),renderMode:"image"})}addLabelLayer(e,t){let r=e.labelStyle,s=this.getLabelStyle(r,e),i=e.labelLayer=new Bc.Vector({declutter:!0,styleOL:s,labelField:r.labelField,source:new(ao())({features:t,wrapX:!1})});i.setStyle(e=>{let t=r.labelField,s=e.get("attributes")[t.trim()]+"";if("undefined"===s)return null;let n=i.get("styleOL"),a=n.getText();return a&&a.setText&&a.setText(s),n}),this.map.addLayer(i),i.setVisible(e.visible),i.setZIndex(1e3);const{visibleScale:n}=e;return n&&this.setVisibleScales(i,n),i}setVisibleScales(e,t){let r=this.resolutions[t.minScale],s=this.resolutions[t.maxScale];r>1?e.setMaxResolution(Math.ceil(r)):e.setMaxResolution(1.1*r),e.setMinResolution(s)}getLabelStyle(e,t){let r=t.style||t.pointStyle;const{radius:s=0,strokeWidth:i=0}=r,n=-(s+i),{fontSize:a="14px",fontFamily:o,fill:l,backgroundFill:h,offsetX:u=0,offsetY:c=n,placement:d="point",textBaseline:p="bottom",textAlign:f="center",outlineColor:m="#000000",outlineWidth:y=0}=e,g={font:`${a} ${o}`,placement:d,textBaseline:p,fill:new(Ao())({color:l}),backgroundFill:new(Ao())({color:h}),padding:[3,3,3,3],offsetX:"POINT"===t.featureType?u:0,offsetY:"POINT"===t.featureType?c:0,overflow:!0,maxAngle:0};return"POINT"===t.featureType&&(g.textAlign=f),y>0&&(g.stroke=new(Po())({color:m,width:y})),new(_o())({text:new(Io())(g)})}async createVectorLayer(e,t){const{featureType:r,style:s}=e;let i;if("LINE"===r&&mo.isArray(s)){const[e,t]=s;i="solid"===t.lineDash?Ro.getRoadPath(t,e):Ro.getPathway(t,e)}else i=await Ro.toOpenLayersStyle(e.style,e.featureType);return new Bc.Vector({style:i,source:new(ao())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})})}createHeatLayer(e,t){t=e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t;let r={source:new(ao())({features:t,wrapX:!1})},s=e.themeSetting;r.gradient=s.colors.slice(),r.radius=parseInt(s.radius);let i=s.customSettings;for(let e in i)r.gradient[e]=i[e];return s.weight&&this.changeWeight(t,s.weight),new Bc.Heatmap(r)}changeWeight(e,t){let r=this;this.fieldMaxValue={},this.getMaxValue(e,t);let s=this.fieldMaxValue[t];e.forEach(function(e){let i=e.get("attributes");try{let n=i[t];e.set("weight",n/s)}catch(e){r.errorCallback&&r.errorCallback(e)}})}getMaxValue(e,t){let r,s=[],i=this,n=t;this.fieldMaxValue[n]||(e.forEach(function(e){r=e.get("attributes");try{s.push(parseFloat(r[n]))}catch(e){i.errorCallback&&i.errorCallback(e)}}),this.fieldMaxValue[n]=wn.getArrayStatistic(s,"Maximum"))}async createUniqueLayer(e,t){let r=await this.createUniqueSource(e,t),s=new Bc.Vector({styleSource:r,source:new(ao())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return s.setStyle(e=>{let t=s.get("styleSource"),r=t.themeField,i=e.get("attributes")[r];return t.styleGroups.find(e=>e.value===i).olStyle}),s}async createUniqueSource(e,t){let r=await this.getUniqueStyleGroup(e,t);return{map:this.map,style:e.style,isHoverAble:e.isHoverAble,highlightStyle:e.highlightStyle,themeField:e.themeSetting.themeField,styleGroups:r}}async getUniqueStyleGroup(e,t){let r=e.featureType,s=e.style,i=e.themeSetting,n=i.themeField,a=[],o=i.customSettings;for(let e in t){let r=t[e].get("attributes")[n],s=!1;for(let e in a)if(a[e]===r){s=!0;break}s||a.push(r)}let l=[];const h=this.getCustomSettingColors(o,r).map(e=>e.toLowerCase()),u=this.getUniqueColors(i.colors||this.defaultParameters.themeSetting.colors,a.length+Object.keys(o).length).map(e=>e.toLowerCase()),c=Kc()(u,h);for(let e=0;e{mo.isString(e[s])?r.push(e[s]):"LINE"===t?r.push(e[s].strokeColor):r.push(e[s].fillColor)}),r}getUniqueColors(e,t){return _n.getGradientColors(e,t)}async createRangeLayer(e,t){let r=await this.createRangeSource(e,t),s=new Bc.Vector({styleSource:r,source:new(ao())({features:e.filterCondition?this.getFiterFeatures(e.filterCondition,t):t,wrapX:!1})});return s.setStyle(e=>{let t=s.get("styleSource");if(t){let r=t.themeField,s=Number(e.get("attributes")[r.trim()]),i=t.styleGroups;for(let e=0;e=i[e].start&&s<=i[e].end)return i[e].olStyle}else if(s>i[e].start&&s<=i[e].end)return i[e].olStyle}}),s}async createRangeSource(e,t){let r=await this.getRangeStyleGroup(e,t);return!!r&&{style:e.style,themeField:e.themeSetting.themeField,styleGroups:r}}async getRangeStyleGroup(e,t){let r,s,i=e.featureType,n=e.themeSetting,a=e.style,o=n.segmentCount,l=n.segmentMethod,h=n.colors,u=n.customSettings,c=n.themeField,d=[],p=o,f=l,m=this;t.forEach(function(e){r=e.get("attributes");try{if(r){let e=r[c.trim()];void 0!==e&&null!==e&&mo.isNumber(e)&&d.push(parseFloat(e))}else e.get(c)&&mo.isNumber(e.get(c))&&e.get(c)&&d.push(parseFloat(e.get(c)))}catch(e){m.errorCallback&&m.errorCallback(e)}});try{s=wn.getArraySegments(d,f,p)}catch(e){m.errorCallback&&m.errorCallback(e)}if(s){let e=p;r&&s[0]===s[r.length-1]&&(e=1,s.length=2);for(let e in s){let t=s[e];t=0===Number(e)?Math.floor(100*t)/100:Math.ceil(100*t)/100+.1,s[e]=Number(t.toFixed(2))}let t=h;t=_n.getGradientColors(t,e,"RANGE");for(let t=0;t0&&c.addDataflowFeature(i,e.identifyField,{dataflowSource:l,featureCache:t,labelSource:n,labelFeatureCache:r,pathSource:o,pathFeatureCache:s,maxPointCount:e.maxPointCount})}else c.addDataflowFeature(i,e.identifyField,{dataflowSource:l,featureCache:t,labelSource:n,labelFeatureCache:r,pathSource:o,pathFeatureCache:s,maxPointCount:e.maxPointCount})}}({},{},{})),this.setFeatureStyle(h,e.directionField,s.type),h}addDataflowFeature(e,t,r){r.dataflowSource&&this.addFeatureFromDataflowService(r.dataflowSource,e,t,r.featureCache),r.labelSource&&this.addFeatureFromDataflowService(r.labelSource,e,t,r.labelFeatureCache),r.pathSource&&this.addPathFeature(r.pathSource,e,t,r.pathFeatureCache,r.maxPointCount)}addPathFeature(e,t,r,s,i){let n=[];var a=t.get(r);s[a]?((n=s[a].getGeometry().getCoordinates()).push(t.getGeometry().getCoordinates()),i&&n.length>i&&n.splice(0,n.length-i),s[a].getGeometry().setCoordinates(n)):(n.push(t.getGeometry().getCoordinates()),s[a]=new(co())({geometry:new Jc.LineString(n)}),e.addFeature(s[a]))}setFeatureStyle(e,t,r){let s=e.get("styleOL");e.setStyle(e=>{let i,n;if((i=void 0!==t&&"未设置"!==t&&"None"!==t?e.get("attributes")[t]:0)>360||i<0)return null;n="SYMBOL_POINT"===r?s.getText():s.getImage();let a=Math.PI*i/180;return n&&n.setRotation(a),s})}createDataflowHeatLayer(e){let t={source:this.createDataflowHeatSource(e)};if(t.gradient=e.themeSetting.colors.slice(),t.radius=parseInt(e.themeSetting.radius),e.themeSetting.customSettings){let r=e.themeSetting.customSettings;for(let e in r)t.gradient[e]=r[e]}return new Bc.Heatmap(t)}createDataflowHeatSource(e){let t=this,r=new(ao())({wrapX:!1});return this.createDataflowService(e,function(s){return function(i){if(e.filterCondition){let n=t.parseFilterCondition(e.filterCondition);const a=i.get("attributes"),o=yl(n,Object.keys(a)),l=gl(a),h="select * from json where ("+o+")";let u=window.jsonsql.query(h,{attributes:l});u&&u.length>0&&t.addDataflowFeature(i,e.identifyField,{dataflowSource:r,featureCache:s})}else t.addDataflowFeature(i,e.identifyField,{dataflowSource:r,featureCache:s});e.themeSetting.weight&&t.changeWeight(r.getFeatures(),e.themeSetting.weight)}}({})),r}addFeatureFromDataflowService(e,t,r,s){var i=t.get(r);void 0!==i&&s[i]?(s[i].setGeometry(t.getGeometry()),s[i].setProperties(t.getProperties()),e.changed()):(e.addFeature(t),s[i]=t)}createDataflowService(e,t){let r=this,s=new El(e.wsUrl).initSubscribe();s.on("messageSucceeded",function(s){let i=JSON.parse(s.value.data),n=$c.readFeature(i,{dataProjection:e.projection||"EPSG:4326",featureProjection:r.baseProjection||"EPSG:4326"});n.setProperties({attributes:i.properties}),t(n)}),e.dataflowService=s}async setEachFeatureDefaultStyle(e){let t=this;e=mo.isArray(e)||e instanceof Qc()?e:[e];for(let r=0;r{let t=s.get("styleSource"),r=t.parameters.themeSetting.themeField,i=Number(e.get("attributes")[r]),n=t.styleGroups;for(let e=0,r=n.length;e=n[e].start&&i{let r=t.get("attributes")[e];null!=r&&mo.isNumber(r)&&i.push(Number(r))});try{n=wn.getArraySegments(i,l,h)}catch(e){console.error(e)}for(let e=0;e0&&r>0&&`EPSG:${e.substring(t,r).split(",")[1].substr(1)}`}}createMigrationLayer(e,t){window.EChartsLayer.prototype.getContainer||(window.EChartsLayer.prototype.getContainer=function(){return this.$container}),window.EChartsLayer.prototype.setVisible||(window.EChartsLayer.prototype.setVisible=function(e){if(e){let e=this.get("options");e&&(this.setChartOptions(e),this.unset("options"))}else{let e=this.getChartOptions();this.set("options",e),this.clear(),this.setChartOptions({})}}),window.EChartsLayer.prototype.setZIndex||(window.EChartsLayer.prototype.setZIndex=function(e){let t=this.getContainer();t&&(t.style.zIndex=e)}),window.EChartsLayer.prototype.setCursor||(window.EChartsLayer.prototype.setCursor=function(e="default"){let t=this.getContainer();t&&"default"===e&&t.classList.add("cursor-default")});let r=wl(t),s=this.createLinesData(e,r),i=this.createPointsData(s,e,r),n=this.createOptions(e,s,i),a=new window.EChartsLayer(n,{hideOnMoving:!1,hideOnZooming:!1,forcedPrecomposeRerender:!0});return a.type="ECHARTS",a}createOptions(e,t,r){let s,i=this.createLineSeries(e,t);if(r&&r.length){let t=this.createPointSeries(e,r);s=i.concat(t)}else s=i.slice();return{series:s}}createLineSeries(e,t){let r=e.lineSetting,s=e.animationSetting,i=[{name:"line-series",type:"lines",zlevel:1,silent:!0,effect:{show:s.show,constantSpeed:s.constantSpeed,trailLength:0,symbol:s.symbol,symbolSize:s.symbolSize},lineStyle:{normal:{color:r.color,type:r.type,width:r.width,opacity:r.opacity,curveness:r.curveness}},data:t}];return t.length>ed&&(i[0].blendMode="lighter"),i}createPointSeries(e,t){let r=e.lineSetting,s=e.animationSetting,i=e.labelSetting,n=[{name:"point-series",coordinateSystem:"geo",zlevel:2,silent:!0,label:{normal:{show:i.show,position:"right",formatter:"{b}",color:i.color,fontFamily:i.fontFamily}},itemStyle:{normal:{color:r.color||i.color}},data:t}];return s.show?(n[0].type="effectScatter",n[0].rippleEffect={brushType:"stroke"}):n[0].type="scatter",n}createPointsData(e,t,r){let s=[],i=t.labelSetting;if(!i.show||!e.length)return s;let n=[],a=[];return e.forEach((e,t)=>{let s=e.coords,o=s[0],l=s[1],h=r[t][i.from],u=r[t][i.to];!n.find(e=>e.value[0]===o[0]&&e.value[1]===o[1])&&n.push({name:h,value:o}),!a.find(e=>e.value[0]===l[0]&&e.value[1]===l[1])&&a.push({name:u,value:l})}),s=n.concat(a)}createLinesData(e,t){let r=[];if(t&&t.length){let s,i,n=e.from,a=e.to;if("XY_FIELD"===n.type&&n.xField&&n.yField&&a.xField&&a.yField)t.forEach(e=>{let t=e[n.xField],o=e[n.yField],l=e[a.xField],h=e[a.yField];t&&o&&l&&h&&(s=[e[n.xField],e[n.yField]],i=[e[a.xField],e[a.yField]],r.push({coords:[s,i]}))});else if("PLACE_FIELD"===n.type&&n.field&&a.field){const e=Oc.concat(Pc);t.forEach(t=>{let o=t[n.field],l=t[a.field];s=e.find(e=>mo.isMatchAdministrativeName(e.name,o)),i=e.find(e=>mo.isMatchAdministrativeName(e.name,l)),s&&i&&r.push({coords:[s.coord,i.coord]})})}}return r}getService(e,t){return e.filter(e=>e&&e.serviceType===t)[0]}isMvt(e,t){let r=this;return this.getDatasetsInfo(e,t).then(e=>e.epsgCode==r.baseProjection.split("EPSG:")[1]?Be.get(r.getRequestUrl(`${e.url}/tilefeature.mvt`),null,{withCredentials:r.withCredentials}).then(function(e){return e.json()}).then(function(t){return e.isMvt=t.error&&400===t.error.code,e}).catch(()=>e):e)}getDatasetsInfo(e,t){let r=this;return r.getDatasources(e).then(function(s){let i=`${e}/data/datasources/${s}/datasets/${t}.json`;return Be.get(r.getRequestUrl(i),null,{withCredentials:r.withCredentials}).then(function(e){return e.json()}).then(function(e){return{epsgCode:e.datasetInfo.prjCoordSys.epsgCode,bounds:e.datasetInfo.bounds,url:i}})})}isRestMapMapboxStyle(e){let t=e.dataSource,r=e.layerType;return!(!(t&&"EXTERNAL"===t.type&&t.url.indexOf("/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY")>-1)||"MAPBOXSTYLE"!==r&&"VECTOR_TILE"!==r)}getMapboxStyleLayerInfo(e,t){let r=this;return new Promise((s,i)=>r.getMapLayerExtent(t).then(t=>r.getMapboxStyle(e,t).then(e=>{Object.assign(t,e),s(t)}).catch(e=>{i(e)})).catch(e=>{i(e)}))}getMapLayerExtent(e){let t=e.dataSource.url;this.isRestMapMapboxStyle(e)&&(t=t.replace("/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY","")),t=this.getRequestUrl(t+".json");let r,s,i=e.credential;return i&&(t=`${t}?${s=Object.keys(i)[0]}=${r=i[s]}`),Be.get(t,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(e){return e.json()}).then(t=>(e.visibleScales=t.visibleScales,e.coordUnit=t.coordUnit,e.scale=t.scale,e.epsgCode=t.prjCoordSys.epsgCode,e.bounds=t.bounds,e)).catch(e=>{throw e})}getMapboxStyle(e,t){let r=this,s=t.url||t.dataSource.url,i=s;i.indexOf("/restjsr/")>-1&&(i=`${i}/style.json`),i=this.getRequestUrl(i);let n,a,o=t.credential;return o&&(a=Object.keys(o)[0],n=o[a],i=`${i}?${a}=${n}`),Be.get(i,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(function(e){return e.json()}).then(i=>{r._matchStyleObject(i);let o=t.bounds;if(n){i.sprite=`${i.sprite}?${a}=${n}`;let e=i.sources;Object.keys(e).forEach(function(e){i.sources[e].tiles.forEach(function(t,r){i.sources[e].tiles[r]=`${t}?${a}=${n}`})})}let l={url:s,sourceType:"VECTOR_TILE",layerType:"VECTOR_TILE",styles:i,extent:o&&[o.left,o.bottom,o.right,o.top],bounds:t.bounds,projection:"EPSG:"+t.epsgCode,epsgCode:t.epsgCode,name:t.name};return Object.assign(t,l),t.zIndex>0&&r.modifyMapboxstyleLayer(e,t),t}).catch(e=>e)}modifyMapboxstyleLayer(e,t){let r=this;if(e.layers&&0===e.layers.length)return;let s=t.styles.layers;if(!s)return;s=s.filter(e=>"background"!==e.type),t.styles.layers=s;let i=e.layers.filter(e=>"VECTOR_TILE"===e.layerType&&e.zIndex!==t.zIndex).map(e=>e.styles&&e.styles.layers);!i||i&&0===i.length||i.forEach(e=>{s.forEach(t=>{r.renameLayerId(e,t)})})}renameLayerId(e,t){if(e.find(e=>e.id===t.id)){const r=t.id.match(/(.+)\((\w)\)$/);r?t.id=`${r[1]}(${+r[2]+1})`:t.id+="(1)",e.find(e=>e.id===t.id)&&this.renameLayerId(e,t)}}_matchStyleObject(e){let{sprite:t,glyphs:r}=e;t&&"object"==typeof t&&(e.sprite=Object.values(t)[0]),r&&"object"==typeof r&&(e.glyphs=Object.values(r)[0])}isIportalProxyServiceUrl(e){if(this.serviceProxy&&this.serviceProxy.enable&&e){let t="";return this.serviceProxy.proxyServerRootUrl?t=`${this.serviceProxy.proxyServerRootUrl}/`:this.serviceProxy.rootUrlPostfix?t=`${this.serviceProxy.port}/${this.serviceProxy.rootUrlPostfix}/`:this.serviceProxy.rootUrlPostfix||(t=`${this.serviceProxy.port}/`),80!==this.serviceProxy.port?e.indexOf(t)>=0:e.indexOf(t)>=0||e.indexOf(t.replace(":80",""))>=0}return!1}getStyleResolutions(e,t=0,r=22){let s=[];let i=Math.abs(e.left-e.right)/512;for(let e=t;e<=r;e++)0!==e?(i/=2,s[e]=i):s[e]=i;return s}createVisibleResolution(e,t,r,s){let i=[];if(e&&e.length>0)i=e.map(e=>{let t=1/e;return this.getResFromScale(t,s)});else{let e=this.getEnvelope(t,r);i=this.getStyleResolutions(e)}return i}getEnvelope(e,t){let r={};return e&&4===e.length?(r.left=e[0],r.bottom=e[1],r.right=e[2],r.top=e[3]):r=t,r}createMVTLayer(e){let t=e.styles;const r=t&&t.metadata&&t.metadata.indexbounds,s=this.createVisibleResolution(e.visibleScales,r,e.bounds,e.coordUnit),i=this.getEnvelope(r,e.bounds),n=this.getStyleResolutions(i);let a=this.isIportalProxyServiceUrl(t.sprite),o=new uc({style:t,source:t.name,resolutions:n,map:this.map,withCredentials:a});return new Promise(r=>{o.on("styleloaded",function(){let i=s[s.length-1],n=s[0],l=new Bc.VectorTile({declutter:!0,source:new vh({style:t,withCredentials:a,projection:e.projection,format:new(gh())({featureClass:Yc()}),wrapX:!1}),style:o.featureStyleFuntion,visible:e.visible,zIndex:e.zIndex,opacity:e.opacity,minResolution:i,maxResolution:n>1?Math.ceil(n):1.1*n});r(l)})})}isSameDomain(e){let t=e.split("://")[1],r=t.indexOf("/"),s=t.substring(0,r),i=document.location.toString().split("://")[1],n=i.indexOf("/"),a=i.substring(0,n);if(s.indexOf(":")>-1||""!==window.location.port)return s===a;{let e=s.split("."),t=a.split(".");return e[1]===t[1]&&e[2]===t[2]}}isSupportWebp(e,t){let r;return!(this.isIE()||this.isFirefox()&&this.getFirefoxVersion()<65||this.isChrome()&&this.getChromeVersion()<32)&&(e=t?`${e}/tileImage.webp?token=${t}`:`${e}/tileImage.webp`,r=!($.isInTheSameDomain(e)&&!t),e=this.getRequestUrl(e,r),Be.get(e,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0}).then(function(e){if(200!==e.status)throw e.status;return e}).then(()=>!0).catch(()=>!1))}isIE(){return!!(window.ActiveXObject||"ActiveXObject"in window)}isFirefox(){return navigator.userAgent.indexOf("Firefox")>-1}isChrome(){return navigator.userAgent.indexOf("Chrome")>-1}getFirefoxVersion(){return+navigator.userAgent.toLowerCase().match(/firefox\/([\d.]+)/)[1]}getChromeVersion(){return+navigator.userAgent.toLowerCase().match(/chrome\/([\d.]+)/)[1]}addGraticule(e){if(this.isHaveGraticule){this.createGraticuleLayer(e.grid.graticule),this.layerAdded++;const t=e.layers?e.layers.length:0;this.sendMapToUser(t)}}createGraticuleLayer(e){const{strokeColor:t,strokeWidth:r,lineDash:s,extent:i,visible:n,interval:a,lonLabelStyle:o,latLabelStyle:l}=e,h=this.baseProjection;let u=new Ua.get(h);u.setExtent(i),u.setWorldExtent(Ua.transformExtent(i,h,"EPSG:4326"));let c={layerID:"graticule_layer",strokeStyle:new(Po())({color:t,width:r,lineDash:s}),extent:i,visible:n,intervals:a,showLabels:!0,zIndex:9999,wrapX:!1,targetSize:0};o&&(c.lonLabelStyle=new(Io())({font:`${o.fontSize} ${o.fontFamily}`,textBaseline:o.textBaseline,fill:new(Ao())({color:o.fill}),stroke:new(Po())({color:o.outlineColor,width:o.outlineWidth})})),l&&(c.latLabelStyle=new(Io())({font:`${l.fontSize} ${l.fontFamily}`,textBaseline:l.textBaseline,fill:new(Ao())({color:l.fill}),stroke:new(Po())({color:l.outlineColor,width:l.outlineWidth})}));const d=new Bc.Graticule(c);this.map.addLayer(d)}getLang(){if(this.getCookie("language")){const e=this.getCookie("language");return this.formatCookieLang(e)}return navigator.language||navigator.browserLanguage}getCookie(e){e=e.toLowerCase();let t=null;return document.cookie.split(";").forEach(function(r){const s=r.split("=");s[0].toLowerCase().trim()!==e||(t=s[1].trim())}),t}formatCookieLang(e){let t;switch(e){case"zh":t="zh-CN";break;case"ar":t="ar-EG";break;case"bg":t="bg-BG";break;case"ca":t="ca-ES";break;case"cs":t="cs-CZ";break;case"da":t="da-DK";break;case"de":t="de-DE";break;case"el":t="el-GR";break;case"es":t="es-ES";break;case"et":t="et-EE";break;case"fa":t="fa-IR";break;case"fl":t="fi-FI";break;case"fr":t="fr-FR";break;case"he":t="he-IL";break;case"hu":t="hu-HU";break;case"id":t="id-ID";break;case"is":t="is-IS";break;case"it":t="it-IT";break;case"ja":t="ja-JP";break;case"ko":t="ko-KR";break;case"ku":t="ku-IQ";break;case"mn":t="mn-MN";break;case"nb":t="nb-NO";break;case"ne":t="ne-NP";break;case"nl":t="nl-NL";break;case"pl":t="pl-PL";break;case"pt":t="pt-PT";break;case"ru":t="ru-RU";break;case"sk":t="sk-SK";break;case"sl":t="sl-SI";break;case"sr":t="sr-RS";break;case"sv":t="sv-SE";break;case"th":t="th-TH";break;case"tr":t="tr-TR";break;case"uk":t="uk-UA";break;case"vi":t="vi-VN";break;default:t="en-US"}return t}isCustomProjection(e){return mo.isNumber(e)?[-1e3,-1].includes(+e):["EPSG:-1000","EPSG:-1"].includes(e)}}class id extends(rl()){constructor(e){(e=e||{}).format=e.format||"png",e.transparent=void 0===e.transparent||!0===e.transparent,e.cacheEnabled=void 0===e.cacheEnabled||!0===e.cacheEnabled;var t=e.attributions||"Map Data © SuperMap iServer",r=function(e,t){var r=$.urlPathAppend(e,`/collections/${t.collectionId}/tile.${t.format}?x={x}&y={y}&z={z}`),s=function(e){var t={};t.transparent=e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),e.sqlFilter&&(t.sqlFilter=e.sqlFilter);e.renderingRule&&(t.renderingRule=JSON.stringify(e.renderingRule));e.ids&&(t.ids=e.ids.join(","));e.names&&(t.names=e.names.join(","));return t}(t);r=$.urlAppend(r,function(e){var t=[];for(var r in e)t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")}(s)),r=je.appendCredential(r),t.cacheEnabled||(r+="&_t="+(new Date).getTime());return r}(e.url,e),s={...e,attributions:t,url:r};!e.tileLoadFunction&&e.tileProxy&&(s.tileLoadFunction=function(e,t){e.getImage().src=i.tileProxy+encodeURIComponent(t)}),super(s);var i=this;this.options=e,e.tileProxy&&(this.tileProxy=e.tileProxy)}}const nd=ol.layer.Tile;var ad=r.n(nd);function od(e,t=22){let{bounds:r,dpi:s,center:i,visibleScales:n,scale:a,coordUnit:o,prjCoordSys:l}=e;const h=i.x&&i.y?[i.x,i.y]:[(r.left+r.right)/2,(r.bottom+r.top)/2],u=[r.left,r.bottom,r.right,r.top];let c=mo.getProjection(l,u);var d=mo.scalesToResolutions(n,r,s,o,t);return{center:h,projection:c,zoom:mo.getZoomByResolution(mo.scaleToResolution(a,s,o),d),resolutions:d}}if(window.proj4=fl(),window&&window.ol){let t=window.ol;t.supermap={...e,...t.supermap},t.supermap.control=t.supermap.control||{},t.supermap.control.ChangeTileVersion=Ga,t.supermap.control.Logo=Ha,t.supermap.control.ScaleLine=Ja,t.supermap.StyleUtils=Ro,t.supermap.Util=mo,t.source.BaiduMap=Ho,t.source.ImageSuperMapRest=el,t.source.SuperMapCloud=sl,t.source.ImageTileSuperMapRest=id,t.source.Tianditu=hl,t.source.TileSuperMapRest=dl,t.supermap.WebMap=sd,t.style.CloverShape=Rl,t.Graphic=Jl,t.style.HitCloverShape=Dl,t.source.GeoFeature=Kl,t.source.Theme=Il,t.supermap.ThemeFeature=Ol,t.supermap.MapboxStyles=uc,t.supermap.VectorTileStyles=dh,t.source.DataFlow=Al,t.source.Graph=Nl,t.source.Graphic=Zl,t.source.HeatMap=bh,t.source.Label=$l,t.source.Mapv=ah,t.source.Range=oh,t.source.RankSymbol=lh,t.source.Turf=uh,t.source.FGB=ic,t.source.Unique=ch,t.source.VectorTileSuperMapRest=vh,t.supermap.AddressMatchService=cc,t.supermap.ChartService=dc,t.supermap.DataFlowService=El,t.supermap.DatasetService=fc,t.supermap.DatasourceService=mc,t.supermap.FeatureService=_l,t.supermap.FieldService=pc,t.supermap.GridCellInfosService=yc,t.supermap.GeoprocessingService=gc,t.supermap.LayerInfoService=vc,t.supermap.MapService=ka,t.supermap.MeasureService=bc,t.supermap.NetworkAnalyst3DService=Sc,t.supermap.NetworkAnalystService=xc,t.supermap.ProcessingService=_c,t.supermap.QueryService=xl,t.supermap.ServiceBase=Fa,t.supermap.SpatialAnalystService=wc,t.supermap.ThemeService=Cc,t.supermap.TrafficTransferAnalystService=Tc,t.supermap.WebPrintingJobService=Mc,t.supermap.ImageService=Ec,t.supermap.ImageCollectionService=Ac,t.supermap.initMap=function(e,t={}){const{mapOptions:r,viewOptions:s,layerOptions:i,sourceOptions:n}=t;return new Promise((t,a)=>{new ka(e).getMapInfo(async function(o){o&&o.result||a("service is not work!");let{prjCoordSys:l,bounds:h}=o.result;if(!(0,Ua.get)(`EPSG:${l.epsgCode}`)&&"PCS_NON_EARTH"!==l.type){const t=await function(e){return new Promise(t=>{new ka(e).getWkt(function(e){let r=e.result.data;t(r)})})}(e);!function(e,t,r){const s=[r.left,r.bottom,r.right,r.top];let i=`EPSG:${e}`;if(!(0,Ua.get)(i)&&fl().defs(i,t),Rc&&Rc.register){Rc.register(fl());var n=(0,Ua.get)(i);n.setExtent(s)}}(l.epsgCode,t,h)}let u=function(e,t,r){let s=od(e);return new(Go())({target:"map",view:new(Nc())({...s,...r}),...t})}(o.result,r,s),{layer:c,source:d}=function(e,t,r,s){let i=dl.optionsFromMapJSON(e,t,!0);i={...i,...r};var n=new dl(i);return{layer:new(ad())({source:n,...s}),source:n}}(e,o.result,n,i);u.addLayer(c),t({map:u,source:d,layer:c})})})},t.supermap.viewOptionsFromMapJSON=od,t.supermap.CommonUtil=$}})(),(()=>{"use strict"})()})();