/*! * * iclient-mapboxgl * Copyright© 2000 - 2023 SuperMap Software Co.Ltd * license: Apache-2.0 * version: v11.1.0 * */(()=>{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]},186:e=>{var t=[],r=[],s="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function i(e,i){if(i=i||{},void 0===e)throw new Error(s);var n,a=!0===i.prepend?"prepend":"append",o=void 0!==i.container?i.container:document.querySelector("head"),l=t.indexOf(o);return-1===l&&(l=t.push(o)-1,r[l]={}),void 0!==r[l]&&void 0!==r[l][a]?n=r[l][a]:(n=r[l][a]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===a?o.insertBefore(n,o.childNodes[0]):o.appendChild(n)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),n.styleSheet?n.styleSheet.cssText+=e:n.textContent+=e,n}e.exports=i,e.exports.insertCss=i},465:(e,t,r)=>{e=r.nmd(e);var s=200,i="__lodash_hash_undefined__",n=9007199254740991,a="[object Arguments]",o="[object Boolean]",l="[object Date]",h="[object Function]",u="[object GeneratorFunction]",c="[object Map]",d="[object Number]",p="[object Object]",f="[object RegExp]",y="[object Set]",m="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",S="[object Float32Array]",x="[object Float64Array]",_="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",A="[object Uint8Array]",E="[object Uint8ClampedArray]",T="[object Uint16Array]",L="[object Uint32Array]",P=/\w*$/,O=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,M={};M[a]=M["[object Array]"]=M[v]=M[b]=M[o]=M[l]=M[S]=M[x]=M[_]=M[w]=M[C]=M[c]=M[d]=M[p]=M[f]=M[y]=M[m]=M[g]=M[A]=M[E]=M[T]=M[L]=!0,M["[object Error]"]=M[h]=M["[object WeakMap]"]=!1;var N="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,F="object"==typeof self&&self&&self.Object===Object&&self,k=N||F||Function("return this")(),D=t&&!t.nodeType&&t,R=D&&e&&!e.nodeType&&e,B=R&&R.exports===D;function G(e,t){return e.set(t[0],t[1]),e}function j(e,t){return e.add(t),e}function U(e,t,r,s){var i=-1,n=e?e.length:0;for(s&&n&&(r=e[++i]);++i-1},Ae.prototype.set=function(e,t){var r=this.__data__,s=Oe(r,e);return s<0?r.push([e,t]):r[s][1]=t,this},Ee.prototype.clear=function(){this.__data__={hash:new Ce,map:new(de||Ae),string:new Ce}},Ee.prototype.delete=function(e){return ke(this,e).delete(e)},Ee.prototype.get=function(e){return ke(this,e).get(e)},Ee.prototype.has=function(e){return ke(this,e).has(e)},Ee.prototype.set=function(e,t){return ke(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Ae},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ae){var i=r.__data__;if(!de||i.length-1&&e%1==0&&e-1&&e%1==0&&e<=n}(e.length)&&!We(e)}var ze=he||function(){return!1};function We(e){var t=qe(e)?$.call(e):"";return t==h||t==u}function qe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return He(e)?Le(e):function(e){if(!je(e))return ue(e);var t=[];for(var r in Object(e))K.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Ie(e,!0,!0)}},52:(e,t,r)=>{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)&&!H(e)}function H(e){var t=z(e)?x.call(e):"";return t==n||t==a}function z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var W=function(e){return function(t){var r,s,i,n=G(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 V(e)?k(e):R(e)});e.exports=W},618:(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]",y="[object Function]",m="[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]",A="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,L=/^\./,P=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,M=/^(?: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[A]=N[p]=N[f]=N[y]=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,D=F||k||Function("return this")(),R=t&&!t.nodeType&&t,B=R&&e&&!e.nodeType&&e,G=B&&B.exports===R&&F.process,j=function(){try{return G&&G.binding("util")}catch(e){}}(),U=j&&j.isTypedArray;function J(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 V(e,t,r){for(var s=-1,i=e?e.length:0;++s-1},Ae.prototype.set=function(e,t){var r=this.__data__,s=Oe(r,e);return s<0?r.push([e,t]):r[s][1]=t,this},Ee.prototype.clear=function(){this.__data__={hash:new Ce,map:new(ce||Ae),string:new Ce}},Ee.prototype.delete=function(e){return je(this,e).delete(e)},Ee.prototype.get=function(e){return je(this,e).get(e)},Ee.prototype.has=function(e){return je(this,e).has(e)},Ee.prototype.set=function(e,t){return je(this,e).set(e,t),this},Te.prototype.add=Te.prototype.push=function(e){return this.__data__.set(e,n),this},Te.prototype.has=function(e){return this.__data__.has(e)},Le.prototype.clear=function(){this.__data__=new Ae},Le.prototype.delete=function(e){return this.__data__.delete(e)},Le.prototype.get=function(e){return this.__data__.get(e)},Le.prototype.has=function(e){return this.__data__.has(e)},Le.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ae){var i=r.__data__;if(!ce||i.lengthh))return!1;var c=n.get(e);if(c&&n.get(t))return c==t;var d=-1,p=!0,f=i&a?new Te:void 0;for(n.set(e,t),n.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=h}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function it(e){return!!e&&"object"==typeof e}function nt(e){return"symbol"==typeof e||it(e)&&se.call(e)==w}var at=U?function(e){return function(t){return e(t)}}(U):function(e){return it(e)&&rt(e.length)&&!!N[se.call(e)]};function ot(e){return et(e)?Pe(e):De(e)}function lt(e){return e}e.exports=function(e,t){return e&&e.length?function(e,t,r){var i=-1,n=J,a=e.length,o=!0,l=[],h=l;if(r)o=!1,n=V;else if(a>=s){var u=t?null:Be(e);if(u)return X(u);o=!1,n=W,h=new Te}else h=t?[]:l;e:for(;++it?1:0}return function(r,s,i,n,a){!function t(r,s,i,n,a){for(;n>i;){if(n-i>600){var o=n-i+1,l=s-i+1,h=Math.log(o),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(o-u)/o)*(l-o/2<0?-1:1),d=Math.max(i,Math.floor(s-l*u/o+c)),p=Math.min(n,Math.floor(s+(o-l)*u/o+c));t(r,s,d,p,a)}var f=r[s],y=i,m=n;for(e(r,i,s),a(r[n],f)>0&&e(r,i,n);y0;)m--}0===a(r[i],f)?e(r,i,m):e(r,++m,n),m<=s&&(i=m+1),s<=m&&(n=m-1)}}(r,s,i||0,n||r.length-1,a||t)}}()},510:(e,t,r)=>{"use strict";e.exports=i,e.exports.default=i;var s=r(166);function i(e,t){if(!(this instanceof i))return new i(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function n(e,t,r){if(!r)return t.indexOf(e);for(var s=0;s=e.minX&&t.maxY>=e.minY}function y(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,t,r,i,n){for(var a,o=[t,r];o.length;)(r=o.pop())-(t=o.pop())<=i||(a=t+Math.ceil((r-t)/i/2)*i,s(e,a,t,r,n),o.push(t,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,r=[],s=this.toBBox;if(!f(e,t))return r;for(var i,n,a,o,l=[];t;){for(i=0,n=t.children.length;i=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)},_split:function(e,t){var r=e[t],s=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,s);var n=this._chooseSplitIndex(r,i,s),o=y(r.children.splice(n,r.children.length-n));o.height=r.height,o.leaf=r.leaf,a(r,this.toBBox),a(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(r,o)},_splitRoot:function(e,t){this.data=y([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,r){var s,i,n,a,l,h,u,d,p,f,y,m,g,v;for(h=u=1/0,s=t;s<=r-t;s++)i=o(e,0,s,this.toBBox),n=o(e,s,r,this.toBBox),p=i,f=n,void 0,void 0,void 0,void 0,y=Math.max(p.minX,f.minX),m=Math.max(p.minY,f.minY),g=Math.min(p.maxX,f.maxX),v=Math.min(p.maxY,f.maxY),a=Math.max(0,g-y)*Math.max(0,v-m),l=c(i)+c(n),a=t;i--)n=e.children[i],l(u,e.leaf?a(n):n),c+=d(u);return c},_adjustParentBBoxes:function(e,t,r){for(var s=r;s>=0;s--)l(t[s],e)},_condense:function(e){for(var t,r=e.length-1;r>=0;r--)0===e[r].children.length?r>0?(t=e[r-1].children).splice(t.indexOf(e[r]),1):this.clear():a(e[r],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}},901:function(e){e.exports=function(){"use strict";var e=new Uint8Array(0);function t(t){this._source=t,this._array=e,this._index=0}return t.prototype.read=function(){var t=this,r=t._array.subarray(t._index);return t._source.read().then(function(s){return t._array=e,t._index=0,s.done?r.length>0?{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=m;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>=y))if(e.state=y,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>=m)){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>=y)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&&A(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>=y?(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=E.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=E.get(this);if(void 0===t)throw new Error("WeakMap error");return t.state<=p||t.state>=y||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=P,e.merge=O,e.zip=I,e.latest=M,e}();function L(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 P(e){var t=this,r=L(e,{returnValues:!0});return new T(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 O(e){var t=this,r=L(e,{yieldValues:!0});return new T(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 I(e){var t=this,r=L(e,{returnValues:!0});return new T(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 M(e){var t=this,r=L(e,{yieldValues:!0,returnValues:!0});return new T(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=T}},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";const e=mapboxgl;var t=r.n(e),s=(function(){t().Map.prototype.overlayLayersManager={},void 0===t().Map.prototype.addLayerBak&&(t().Map.prototype.addLayerBak=t().Map.prototype.addLayer,t().Map.prototype.addLayer=function(e,t){return e.source||"custom"===e.type||"background"===e.type?(this.addLayerBak(e,t),e.overlay&&!this.overlayLayersManager[e.id]&&(this.overlayLayersManager[e.id]=e),this):this.overlayLayersManager[e.id]||this.style._layers[e.id]?void this.fire("error",{error:new Error("A layer with this id already exists.")}):(function(e,t){e.onAdd&&e.onAdd(t)}(e,this),this.overlayLayersManager[e.id]=e,this)}),t().Map.prototype.getLayer=function(e){return this.overlayLayersManager[e]?this.overlayLayersManager[e]:this.style.getLayer(e)},t().Map.prototype.moveLayer=function(e,r){return this.overlayLayersManager[e]?(this.overlayLayersManager[e].moveLayer?this.overlayLayersManager[e].moveLayer(e,r):function(e,r){var s=document.getElementById(e);if(r){var i=document.getElementById(r);i||t().Evented.prototype.fire("error",{error:new Error(`Layer with id "${r}" does not exist on this document.`)})}s&&i?i.parentNode.insertBefore(s,i):s.parentNode.appendChild(s)}(e,r),this):this.style._layers[e]?(this.style.moveLayer(e,r),this._update(!0),this):void 0},t().Map.prototype.removeLayer=function(e){return this.overlayLayersManager[e]&&delete this.overlayLayersManager[e],this.style.removeLayer(e),this._update(!0),this},t().Map.prototype.setLayoutProperty=function(e,t,r){return this.overlayLayersManager[e]?("visibility"===t&&(r="visible"===r,s=this.overlayLayersManager[e],i=r,s.setVisibility&&s.setVisibility(i),this.style.fire("data",{dataType:"style"})),this):(this.style.setLayoutProperty(e,t,r),this._update(!0),this);var s,i},t().Map.prototype.updateTransform=function(e,r,s,i,n,a,o){this.transform.units=e;var l=this.mercatorZfromAltitude;t().MercatorCoordinate.fromLngLat=function(e,i){i=i||0;const n=t().LngLat.convert(e);return new(t().MercatorCoordinate)((n.lng-r)/a,(s-n.lat)/o,l(i,n.lat))},t().MercatorCoordinate.prototype.toLngLat=function(){return new(t().LngLat)(this.x*a+r,s-this.y*o)},this.customConvertPoint=window.URL.createObjectURL(new Blob(["customConvertPoint = {projectX:function(x){return (x - "+i+") / "+a+" + 0.5},projectY:function(y){y = 0.5 - ((y - "+n+") / "+o+");return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+o+"+"+n+";}}"],{type:"text/javascript"}))}}(),"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 i{constructor(e){this.imageUrl=null,this.link=null,this.width=null,this.height=null,this.alt="SuperMap iClient",this._extend(this,e)}onAdd(e){this._map=e,this._container=document.createElement("div"),this._container.className="mapboxgl-ctrl iclient-logo",this._container.style.marginTop=0,this._container.style.marginBottom=0,this._container.style.marginLeft=0,this._container.style.marginRight=0;var t=s;this.imageUrl&&(t=this.imageUrl);var r=this.alt,i="94px",n="29px",a="width:"+i+";height:"+n+";";this.imageUrl&&(a="width:"+(i=this.width)+";height:"+(n=this.height)+";",i&&n||(a=""));var o=this.link;return this._container.innerHTML=""+r+"",this._createStyleSheet(),this._container}_createStyleSheet(){var e=document.createElement("style");e.type="text/css",e.innerHTML=".iclient-logo{margin:0 !important;}.iclient-logo a{border: none;display: block;height:31px;}.iclient-logo img{border: none;white-space: nowrap}",document.getElementsByTagName("head")[0].appendChild(e)}_extend(e){for(var t=0;t0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,t,r,s){t=void 0!==t?t:0,r=void 0!==r?r:h.thousandsSeparator,s=void 0!==s?s:h.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 h.limitSigDigs(this,e)});var u={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(){}},c={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}}(),f=function(){var e=!0,t=p;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}(),y=function(){var e=navigator.userAgent.toLowerCase();return-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")}(),m={assign(e){for(var t=0;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=m.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(l.contains(e,"?")){var r=e.indexOf("?")+1,s=l.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/(m.normalizeScale(e)*g[t]*96));return r},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*g[t]*96},getBrowser:function(){return p},isSupportCanvas:f,supportCanvas:function(){return m.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=m.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 d.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),p=Math.max(e.x,t.x),f=Math.min(e.x,t.x);a=(r.y>=c&&r.y<=u||s.y>=c&&s.y<=u)&&r.x>=f&&r.x<=p||s.x>=f&&s.x<=p?"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}},g={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};g.in=g.inches,g.degrees=g.dd,g.nmi=1852*g.m;const v=.0254000508001016;m.extend(g,{Inch:g.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}),m.extend(g,{mm:g.Meter/1e3,cm:g.Meter/100,dm:100*g.Meter,km:1e3*g.Meter,kmi:g.nmi,fath:g.Fathom,ch:g.IntnlChain,link:g.IntnlLink,"us-in":g.inches,"us-ft":g.Foot,"us-yd":g.Yard,"us-ch":g.GunterChain,"us-mi":g.Mile,"ind-yd":g.IndianYd37,"ind-ft":g.IndianFt37,"ind-ch":791.9942845122}),g.degree=g.dd,g.meter=g.m,g.foot=g.ft,g.inch=g.inches,g.mile=g.mi,g.kilometer=g.km,g.yard=g.yd;class b{constructor(e,t){m.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?m.toFloat(e):0,this.lat=t?m.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 b(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new b(this.lon+m.toFloat(e),this.lat+m.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 b(t[0],t[1])}static fromArray(e){var t=m.isArray(e),r=t&&e[0],s=t&&e[1];return new b(r,s)}}class S{constructor(e,t,r,s){m.isArray(e)&&(s=e[3],r=e[2],t=e[1],e=e[0]),this.left=null!=e?m.toFloat(e):this.left,this.bottom=null!=t?m.toFloat(t):this.bottom,this.right=null!=r?m.toFloat(r):this.right,this.top=null!=s?m.toFloat(s):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new S(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 n(this.getWidth(),this.getHeight())}getCenterPixel(){return new a((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new b((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 S(i,n,a,o)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new S(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 S(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new S(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 S.fromArray(r,t)}static fromArray(e,t){return!0===t?new S(e[1],e[0],e[3],e[2]):new S(e[0],e[1],e[2],e[3])}static fromSize(e){return new S(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 x extends d{constructor(e,t,r,s){super(e,t,r,s),this.x=parseFloat(e),this.y=parseFloat(t),this.tag=s||0==s?parseFloat(s):null,this.type=r||"Point",this.CLASS_NAME="SuperMap.Geometry.Point",this.geometryType="Point"}clone(e){return null==e&&(e=new x(this.x,this.y)),m.applyDefaults(e,this),e}calculateBounds(){this.bounds=new S(this.x,this.y,this.x,this.y)}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}move(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()}toShortString(){return this.x+", "+this.y}destroy(){this.x=null,this.y=null,this.tag=null,super.destroy()}getVertices(){return[this]}}class _ extends d{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 _,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 m.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:_>=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 C=t.x+n*Math.cos(h),A=t.y+n*Math.sin(h);c.push(new x(C,A))}c.push(i)}return c}static createLineEPS(e){var t=[],r=e.length;if(r<2)return e;for(var s=0;s3;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;t0&&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 x(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 y=n.length;if(y)n[y-1].components=n[y-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 Ae extends M{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 x(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(m.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}}const Ee=function(e){return"[object Array]"==Object.prototype.toString.call(e)},Te=function(e){return"string"==typeof e&&e.constructor===String},Le={toSuperMapGeometry(e){if(e&&e.type)return(new Ae).read(e,"FeatureCollection")[0].geometry},toSuperMapBounds:e=>Ee(e)?new S(e[0],e[1],e[2],e[3]):new S(e.getWest(),e.getSouth(),e.getEast(),e.getNorth()),toSuperMapPoint:e=>Ee(e)?new x(e[0],e[1]):e.lng&&e.lat?new x(e.lng,e.lat):new x(e.geometry.coordinates[0],e.geometry.coordinates[1]),toSuperMapPolygon(e){const t=e.getWest(),r=e.getEast(),s=e.getSouth(),i=e.getNorth();return new T([new E([new x(t,s),new x(r,s),new x(r,i),new x(t,i)])])},isArray:Ee,toGeoJSON(e){if(e)return(new Ae).toGeoJSON(e)},toProcessingParam(e){var t={};if(e.length<1)t="";else{for(var r=[],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 S(i,n,o,a)}getLabelPxBoundsByText(e,t){var r,s,i,n,a=this.getLabelPxSize(t),o=m.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 S(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 Oe{constructor(e,t){e&&t&&t.map&&t.renderer&&(this.id=m.createUniqueID(this.CLASS_NAME+"_"),this.lonlat=null,this.location=[],this.data=e,this.shapes=[],this.layer=t,this.CLASS_NAME="SuperMap.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}getLocalXY(e){var t=this.layer.map.getResolution(),r=this.layer.map.getExtent();if(e instanceof x||e instanceof Pe){return[e.x/t+-r.left/t,r.top/t-e.y/t]}if(e instanceof b){return[e.lon/t+-r.left/t,r.top/t-e.lat/t]}return null}}class Ie{constructor(e,t){this.geometry=e,this.attributes=t}toFeature(){var e=Le.toSuperMapGeometry(this.geometry),r=[];return this.geometry instanceof t().LngLat?r=[this.geometry.lng,this.geometry.lat]:this.geometry instanceof t().Point?r=[this.geometry.x,this.geometry.y]:3===this.geometry.length&&(e=new Pe(this.geometry[0],this.geometry[1],this.geometry[2])),r.length>1&&(e=new x(r[0],r[1])),new O(e,this.attributes)}}class Me{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;r3&&(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 y=c/u;let e=-o/a+y,t=-y/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 m=(2*u*o-3*a*c)/(2*Math.sqrt(u*u*u)),g=Math.acos(m)/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(),y=.005,m=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&&l1)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 De.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),De.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 De.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]}}class Re{}Re.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},Re.catchBrushException=!1,Re.debugMode=0;class Be{static SUtil_smoothBezier(e,t,r,s,i){i&&2===i.length||(i=[0,0]);var n,a,o=i,l=[],h=[],u=[],c=[],d=!!s;if(d){n=[1/0,1/0],a=[-1/0,-1/0];let t=e.length;for(let r=0;rn-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 y=p*p,m=p*y;a.push([h(s[0],f[0],o[0],u[0],p,y,m),h(s[1],f[1],o[1],u[1],p,y,m)])}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&&(y=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=m[m.length-2],h=m[m.length-1],u=!1,c&&"A"!==y.command&&(c=!1,a=l,o=h)}switch(y.command){case"M":a=m[0],o=m[1];break;case"L":if(d&&this.isInsideLine(a,o,m[0],m[1],t,s,i))return!0;p&&(n+=this.windingLine(a,o,m[0],m[1],s,i)),a=m[0],o=m[1];break;case"C":if(d&&this.isInsideCubicStroke(a,o,m[0],m[1],m[2],m[3],m[4],m[5],t,s,i))return!0;p&&(n+=this.windingCubic(a,o,m[0],m[1],m[2],m[3],m[4],m[5],s,i)),a=m[4],o=m[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(a,o,m[0],m[1],m[2],m[3],t,s,i))return!0;p&&(n+=this.windingQuadratic(a,o,m[0],m[1],m[2],m[3],s,i)),a=m[2],o=m[3];break;case"A":var g=m[0],v=m[1],b=m[2],S=m[3],x=m[4],_=m[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 A=(s-g)*S/b+g;if(d&&this.isInsideArcStroke(g,v,S,x,x+_,1-m[7],t,A,i))return!0;p&&(n+=this.windingArc(g,v,S,x,x+_,1-m[7],A,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}},Be.Util_color=new De,Be.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 ke,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))}},Be.Util_curve=new ke,Be.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,y,m,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.]+)/),y=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),b=s&&e.match(/Mobile\//)&&!m,S=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,(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]),y&&(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),m&&(r.chrome=!0,r.version=m[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||y||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||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:r,os:t,canvasSupported:!!document.createElement("canvas").getContext}}destory(){return!0}},Be.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}},Be.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)}},Be.Util_log=new class{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(0!=+Re.debugMode)if(1==+Re.debugMode)for(let e in arguments)throw new Error(arguments[e]);else if(+Re.debugMode>1)for(let e in arguments)console.log(arguments[e])}}destory(){return!0}},Be.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}},Be.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}},Be.Util=new Me,Be.Util_vector=new Fe;class Ge{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=Be.Util_vector.create(),function(t){this.transform||(this.transform=Be.Util_matrix.create());var r=this.transform;function s(e){return e>-5e-5&&e<5e-5}Be.Util_vector.sub(e,t,this.position),s(e[0])&&s(e[1])||(Be.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||Be.Util_matrix.create();if(Be.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&&Be.Util_matrix.translate(t,t,e),Be.Util_matrix.scale(t,t,this.scale),s&&(e[0]=-e[0],e[1]=-e[1],Be.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&&Be.Util_matrix.translate(t,t,e),Be.Util_matrix.rotate(t,t,this.rotation[0]),s&&(e[0]=-e[0],e[1]=-e[1],Be.Util_matrix.translate(t,t,e))}}else 0!=+this.rotation&&Be.Util_matrix.rotate(t,t,this.rotation);(r(this.position[0])||r(this.position[1]))&&Be.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Be.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Be.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 je extends(o(Ne,Ge)){constructor(e){super(e),e=e||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,m.extend(this,e),this.id=this.id||m.createUniqueID("smShapeGroup_"),this.CLASS_NAME="SuperMap.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(e){return this._children[e]}addChild(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof je&&e.addChildrenToStorage(this._storage)))}removeChild(e){var t=m.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof je&&e.delChildrenFromStorage(this._storage))}eachChild(e,t){for(var r=!!t,s=0;s0}addRoot(e){e instanceof je&&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 je&&i.delChildrenFromStorage(this))}}addToMap(e){return e instanceof je&&(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 je&&(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 Je extends d{constructor(e,t,r,s){super(e,t,r,s),this.x=e,this.y=t,this.width=r,this.height=s,this.CLASS_NAME="SuperMap.Geometry.Rectangle",this.geometryType="Rectangle"}calculateBounds(){this.bounds=new S(this.x,this.y,this.x+this.width,this.y+this.height)}getArea(){return this.width*this.height}}class Ve{constructor(e,t){this.value=e||"",this.name=t||"token",this.CLASS_NAME="SuperMap.Credential"}getUrlParameters(){return this.name+"="+this.value}getValue(){return this.value}destroy(){this.value=null,this.name=null}}Ve.CREDENTIAL=null;var He={toISOString:function(){if("toISOString"in Date.prototype)return function(e){return e.toISOString()};{function e(e,t){for(var r=e+"";r.length1},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=ze.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,s){var i=m.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=m.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=m.getElement(e)._eventCacheID;this._removeElementObservers(ze.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);ze.stopObserving.apply(this,s)}},stopObserving:function(e,t,r,s){s=s||!1;var i=m.getElement(e),n=i._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(t="keydown");var a=!1,o=ze.observers[n];if(o)for(var l=0;!a&&l0&&(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&&Be.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,y=0;if(void 0!==t.pointList){var m=t.pointList;if(m.length<2)return;var g=m.length;switch(h){case"start":d=m[0][0]+u[0],p=m[1][0]+u[0],f=m[0][1]+u[1],y=m[1][1]+u[1];break;case"end":d=m[g-2][0]+u[0],p=m[g-1][0]+u[0],f=m[g-2][1]+u[1],y=m[g-1][1]+u[1]}}else d=t.xStart+u[0]||0,p=t.xEnd+u[0]||0,f=t.yStart+u[1]||0,y=t.yEnd+u[1]||0;switch(h){case"start":i=d0&&e>this._zlevelList[0]){for(i=0;ie);i++);s=this._layers[this._zlevelList[i]]}this._zlevelList.splice(i+1,0,e),t=new Qe(m.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 Me).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,Re.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=Be.Util_event.getX(e),this._mouseY=Be.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,Re.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(Re.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,Re.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,Re.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&&Be.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&&(Be.Util_matrix.invert(t,e.transform),Be.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&&!(y[b]<=a);b--);b=Math.min(b,h-2)}else{for(b=A;ba);b++);b=Math.min(b-1,h-2)}A=b,E=a;var o=y[b+1]-y[b];if(0!==o){if(S=(a-y[b])/o,n)if(_=m[b],x=m[0===b?b:b-1],w=m[b>h-2?h-1:b+1],C=m[b>h-3?h-1:b+2],c)et._catmullRomInterpolateArray(x,_,w,C,S,S*S,S*S*S,s(e,l),p);else{let t;t=d?et.rgba2String(T):et._catmullRomInterpolate(x,_,w,C,S,S*S,S*S*S),r(e,l,t)}else if(c)et._interpolateArray(m[b],m[b+1],S,s(e,l),p);else{let t;d?(et._interpolateArray(m[b],m[b+1],S,T,1),t=et.rgba2String(T)):t=et._interpolateNumber(m[b],m[b+1],S),r(e,l,t)}for(b=0;b=0;t--)e[t].destroy()}}setVisibility(e){e!==this.visibility&&(this.visibility=e,this.display(e),this.redrawThematicFeatures(this.map.getBounds()))}display(e){this.div.style.display=e?"block":"none"}setOpacity(e){if(e!==this.opacity){this.opacity=e;var r=this.div;m.modifyDOMElement(r,null,null,null,null,null,null,e),null!==this.map&&t().Evented.prototype.fire("changelayer",{layer:this,property:"opacity"})}}addFeatures(e){}removeFeatures(e){var r=this;if(e){if(e===r.features)return r.removeAllFeatures();m.isArray(e)||"function"==typeof e||(e=[e]);for(var s=[],i=0;i=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.getBounds()),!0)}clear(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}}class ot{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="SuperMap.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class lt extends ot{constructor(e,t){super(e,t),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=6,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class ht extends ot{constructor(e){super(e),this.pointList=e,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class ut extends ot{constructor(e){super(e),this.pointList=e,this.holePolygonPointLists=null,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class ct extends ot{constructor(e,t,r,s){super(e,t,r,s),this.x=isNaN(e)?0:e,this.y=isNaN(e)?0:t,this.width=isNaN(r)?0:r,this.height=isNaN(s)?0:s,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class dt extends ot{constructor(e,t,r,s,i,n,a){super(e,t,r,s,i,n,a),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(r)?0:r,this.startAngle=isNaN(s)?0:s,this.endAngle=isNaN(i)?0:i,this.r0=isNaN(n)?0:n,this.clockWise=a,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class pt extends ot{constructor(e,t,r){super(e,t,r),this.x=e,this.y=t,this.text=r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class ft extends ot{constructor(e,t,r,s,i,n,a,o,l){super(e,t,r,s,i,n,a,o,l),this.x=e,this.y=t,this.image=r,this.width=s,this.height=i,this.sx=n,this.sy=a,this.sWidth=o,this.sHeight=l,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class yt extends ot{constructor(e,t,r){super(e,t,r),this.x=isNaN(e)?0:e,this.y=isNaN(t)?0:t,this.r=isNaN(r)?0:r,this.CLASS_NAME="SuperMap.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class mt extends qe{constructor(e){super(e),this.type="smicpoint",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.arc(t.x+r[0],t.y+r[1],t.r,0,2*Math.PI,!0)}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]-e.r-t/2),y:Math.round(e.y+r[1]-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect)}}class gt extends qe{constructor(e){super(e),this.type="smictext",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="SuperMap.LevelRenderer.Shape.SmicText"}destroy(){this.type=null,super.destroy()}brush(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,s=this.style;if(t&&(s=this.getHighlightStyle(s,this.highlightStyle||{})),void 0!==s.text&&!1!==s.text){e.save(),this.doClip(e),this.setContext(e,s),this.setTransform(e),s.textFont&&(e.font=s.textFont),e.textAlign=s.textAlign||"start",e.textBaseline=s.textBaseline||"middle";var i,n=(s.text+"").split("\n"),a=Be.Util_area.getTextHeight("ZH",s.textFont),o=this.getRectNoRotation(s),l=s.x+r[0];i="top"==s.textBaseline?o.y:"bottom"==s.textBaseline?o.y+a:o.y+a/2;for(var h=s.x+r[0],u=s.y+r[1],c=0,d=n.length;cs&&(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=Be.Util_area.getTextHeight("ZH",e.textFont),i=Be.Util_area.getTextWidth(e.text,e.textFont),n=Be.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 vt extends qe{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 bt extends qe{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=m.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=Be.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 St extends qe{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=Be.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 _t extends qe{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=Be.Util_math.degreeToRadian(o),l=Be.Util_math.degreeToRadian(l),h||(o=-o,l=-l);var u=Be.Util_math.cos(o),c=Be.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(Be.Util_math.cos(l)*n+s,Be.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=Be.Util_vector.create(),s=Be.Util_vector.create(),i=Be.Util_vector.create(),n=Be.Util_vector.create(),a=e.x+t[0],o=e.y+t[1],l=e.r0||0,h=e.r,u=Be.Util_math.degreeToRadian(e.startAngle),c=Be.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(u=-u,c=-c),l>1?Be.Util_computeBoundingBox.arc(a,o,l,u,c,!d,r,i):(r[0]=i[0]=a,r[1]=i[1]=o),Be.Util_computeBoundingBox.arc(a,o,h,u,c,!d,s,n),Be.Util_vector.min(r,r,s),Be.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 wt{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 lt){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e=m.copyAttributesWithClip(e,t.style,["x","y"]);let r=new mt;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["x","y","style","highlightStyle"]),r}if(t instanceof ht){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=m.copyAttributesWithClip(e,t.style,["pointList"]);let r=new St;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["pointList","style","highlightStyle"]),r}if(t instanceof ut){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=m.copyAttributesWithClip(e,t.style,["pointList"]);let r=new bt;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["pointList","style","highlightStyle"]),r}if(t instanceof ct){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=m.copyAttributesWithClip(e,t.style,["x","y","width","height"]);let r=new xt;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["x","y","width","height","style","highlightStyle"]),r}if(t instanceof dt){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=m.copyAttributesWithClip(e,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let r=new _t;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),r}if(t instanceof pt){let e=new Object;e.x=t.x,e.y=t.y,e.text=t.text,e=m.copyAttributesWithClip(e,t.style,["x","y","text"]);let r=new gt;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["x","y","text","style","highlightStyle"]),r}if(t instanceof ft){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=m.copyAttributesWithClip(e,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let r=new Ye;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.copyAttributesWithClip(r,t,["x","y","image","width","height","style","highlightStyle"]),r}if(t instanceof yt){let e=new Object;e.x=t.x,e.r=t.r,e.y=t.y,e=m.copyAttributesWithClip(e,t.style,["x","y","r"]);let r=new vt;return r.style=wt.transformStyle(e),r.highlightStyle=wt.transformStyle(t.highlightStyle),m.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 ct(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return i.style={fillColor:"#f3f3f3"},s.backgroundStyle&&m.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 g=[[i[2]+5,i[1]+4],[i[2]+13,i[1]],[i[2]+5,i[1]-4]],v=[[i[0]-4,i[3]-5],[i[0],i[3]-13],[i[0]+4,i[3]-5]],b=new ut(g);b.style={fillColor:"#008acd"},m.copyAttributesWithClip(b.style,n.axisStyle),o.push(e.createShape(b));var S=new ut(v);if(S.style={fillColor:"#008acd"},m.copyAttributesWithClip(S.style,n.axisStyle),o.push(e.createShape(S)),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){var x=new ut(u);x.style={fillColor:"#008acd"},m.copyAttributesWithClip(x.style,n.axisStyle),o.push(e.createShape(x))}}var _=new ht(c);_.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},n.axisStyle&&m.copyAttributesWithClip(_.style,n.axisStyle),_.clickable=!1,_.hoverable=!1;var w=[e.createShape(_)],C=[];if(n.axisYLabels&&n.axisYLabels.length&&n.axisYLabels.length>0){var A=n.axisYLabels;let t=A.length;var E=[0,0];if(n.axisYLabelsOffset&&n.axisYLabelsOffset.length&&(E=n.axisYLabelsOffset),1==t){let t=new pt(i[0]-5+E[0],i[3]+E[1],A[0]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&m.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,C.push(e.createShape(t))}else for(var T=i[3],L=Math.abs(i[1]-i[3])/(t-1),P=0;P0){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]&&m.copyAttributesWithClip(a,r[i]),s&&s.length&&void 0!==n)for(var o=s,l=o.length,h=parseFloat(n),u=0;u0){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=m.copyAttributesWithClip(u,this.style,["pointList"])).pointList=n;var c=new St({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&&m.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=m.copyAttributesWithClip(u,this.style)).x=s[0],u.y=s[1];var c=new mt({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&&m.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 y={};(y=m.copyAttributesWithClip(y,this.style,["pointList"])).pointList=n;var g=new bt({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(g.highlightStyle=this.highlightStyle),g.refOriginalPosition=this.location,g.refDataID=this.data.id,g.isHoverByRefDataID=this.isMultiHover,o.length>0&&(g.holePolygonPointLists=o),this.shapeOptions&&m.copyAttributesWithClip(g,this.shapeOptions),this.shapes.push(g)}}rectangleToTF(e){var t=this.location,r=new b(e.x,e.y),s=this.layer.map.getResolution(),i=this.getLocalXY(r),n=new Object;n.r=6,(n=m.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 xt({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&&m.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=m.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 gt({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&&m.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;ro){var d=n[0];n.splice(0,1),delete i[d]}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var p=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(p)}}createThematicFeature(e){var t=m.copyAttributesWithClip(this.style);e.style&&!0===this.isAllowFeatureStyle&&(t=m.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=wt.transformStyle(this.highlightStyle);for(var s=new Ct(e,this,wt.transformStyle(t),r),i=0;ie-s&&r.time",a="
"+(t._createLegendElement.call(t)||"")+"
";this._container.innerHTML=n+a}return t._appendLegendCSSStyle(),this._container},r.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},new r}_createLegendElement(){}_addLayer(){var e=this.getLayerStyleOptions(),t=this.id?this.id:"theme3DLayer",r=this.sourceId=t+"Source";this.map.getSource(r)?(this.map.removeSource(r),this.map.addSource(r,{type:"geojson",data:this.data})):this.map.addSource(r,{type:"geojson",data:this.data}),this.map.addLayer({id:t,type:"fill-extrusion",source:r,paint:e}),this.map.moveLayer(t)}_addHighLightLayer(){if(this.map){var e=this.map;e.addLayer({id:this._highlightLayerId,type:"fill-extrusion",source:this.sourceId,paint:this.getHighlightStyleOptions(),filter:["in","$id",""]}),this._selectFeatureId=null,e.on("mousemove",this.id,this._onMouseMove.bind(this)),e.on("mouseout",this.id,this._onMouseMove.bind(this))}}_onMouseMove(e){var t=this,r=this.map,s=r.queryRenderedFeatures(e.point,{layers:[t.id]});if(t.highlight&&t.highlight.callback&&t.highlight.callback(s,e),!s||s.length<1)return t._clearHighlight.call(t),void(t._selectFeatureId=null);var i=s[0].id;t._selectFeatureId!==i&&(t._selectFeatureId=i,r.setFilter(t._highlightLayerId,["==","$id",t._selectFeatureId]))}_clearHighlight(){this.map&&this.map.setFilter(this._highlightLayerId,["in","$id",""])}_appendLegendCSSStyle(){var e=document.createElement("style");e.type="text/css";e.innerHTML="\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n "+this._legendCSSStyle(),document.getElementsByTagName("head")[0].appendChild(e)}_legendCSSStyle(){return"\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n "}_extend(e){for(var t=0;t=0;t--){let r=e[t],s=m.indexOf(this.graphics,r);-1!==s&&this.graphics.splice(s,1)}this.update()}update(){if("Awaiting state"!==this.layer.lifecycle){this.layer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0});let e=this.getState(),t=parseInt(this.canvas.style.width),r=parseInt(this.canvas.style.height);e.width=t,e.height=r,this.layer.setState(e)}}clear(){this.removeGraphics(),this.deckGL.finalize()}remove(){this.mapOptions.targetElement.removeChild(this.canvas)}destroy(){this.remove(),this.clear()}moveTo(e,t){var r=document.getElementById(this.id);if(t=void 0===t||t){var s=document.getElementById(e);r&&s&&s.parentNode.insertBefore(r,s)}else{var i=document.getElementById(e);if(r){if(i.nextSibling)return void i.parentNode.insertBefore(r,i.nextSibling);i.parentNode.appendChild(r)}}}setVisibility(e){this.canvas&&e!==this.visibility&&(this.visibility=e,this.canvas.style.display=e?"block":"none")}draw(){let e=this.getState(),t={};for(let r in e)t[r]=e[r];let r=parseInt(this.canvas.style.width),s=parseInt(this.canvas.style.height);t.width=r,t.height=s,t.layers=[this.layer],t.canvas=this.canvas,this.deckGL.setProps(t)}_initContainer(){this.canvas=this._createCanvas(this.mapOptions.mapElement),this.mapOptions.targetElement.appendChild(this.canvas)}_createCanvas(e){let t=document.createElement("canvas");return this.id&&(t.id=this.id),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.cursor="",t.width=parseInt(e.style.width),t.height=parseInt(e.style.height),t.style.width=e.style.width,t.style.height=e.style.height,t}getState(){let e=this.functions.getMapState();return{data:this.graphics,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,...e}}}const kt=function(){try{return THREE}catch(e){return{}}}();function Dt(e,t,r){if(e===r||e===t)return e;let s=r-t;return((e-t)%s+s)%s+t}function Rt(e){return e*Math.PI/180}var Bt={matrix:[1,-1,0,0],projection:{R:6378137,minZoom:0,maxZoom:22,nativeMaxZoom:19,RAD:Math.PI/180,METERS_PER_DEGREE:6378137*Math.PI/180,MAX_LATITUDE:85.0511287798,project:function(e){const t=this.RAD,r=this.METERS_PER_DEGREE,s=this.MAX_LATITUDE;let i,n=e instanceof Array?{lng:e[0],lat:e[1]}:{lng:e.lng,lat:e.lat},a=n.lng,o=Math.max(Math.min(s,n.lat),-s);return{x:a*r,y:(i=0===o?0:Math.log(Math.tan((90+o)*t/2))/t)*r}},unproject:function(e){const t=e.x,r=e.y,s=this.RAD,i=this.METERS_PER_DEGREE;let n;return 0===r?n=0:(n=r/i,n=(2*Math.atan(Math.exp(n*s))-Math.PI/2)/s),{lng:Dt(t/i,-180,180),lat:Dt(n,-this.MAX_LATITUDE,this.MAX_LATITUDE)}},locate:function(e,t,r){if(!e)return null;if(t=t||0,r=r||0,!t&&!r)return e;let s=e.lng;if(0!==t){let r=Math.abs(t),i=Rt(e.lng);s=Dt(180*(i+=2*Math.sqrt(Math.pow(Math.sin(r/(2*this.R)),2)/Math.pow(Math.cos(i),2))*(r>0?1:-1))/Math.PI,-180,180)}let i=e.lat;if(0!==r){let t=Math.abs(r),s=Rt(e.lat);i=Dt(180*(s+=2*Math.sin(t/(2*this.R))*(t>0?1:-1))/Math.PI,-90,90)}return{lng:s,lat:i}},getResolution:function(e){if(!this.resolutions){for(var t=[],r=12756274*Math.PI,s=0;s<=this.maxZoom;s++)t[s]=r/(256*Math.pow(2,s));this.resolutions=t}let i=0|e,n=this.resolutions.length;i=i<0?0:i>n-1?n-1:i;const a=this.resolutions[i];if((0|e)!==e&&i!==n-1){return a+(this.resolutions[i+1]-a)*(e-i)}return a}},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},lngLatToPoint:function(e,t){var r=this.project(e);return this.transform(r,this.projection.getResolution(t))},locate:function(e,t,r){return this.projection.locate(e,t,r)},transform:function(e,t){return{x:this.matrix[0]*(e.x-this.matrix[2])/t,y:this.matrix[1]*(e.y-this.matrix[3])/t}}};const Gt=Bt.projection,{Color:jt,Scene:Ut,WebGLRenderer:Jt,PerspectiveCamera:Vt,Vector3:Ht,Shape:zt,Mesh:Wt,ExtrudeGeometry:qt}=kt,Yt=Math.PI/180,Xt=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,Qt=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;class Zt{constructor(e,t,r){this._layer=e,this.renderer=t||"gl",this.options=r}setMap(e){this.map=e}render(){this._layer&&(this.prepare(),this._layer.fire("initialized"),this._layer&&this._layer.draw(this.context,this.scene,this.camera),this._layer.fire("draw"),this.renderScene())}update(){this.remove(),this.render()}renderScene(){this.locationCamera(),this.animationFrame=this.renderFrame(function(){this.animationFrame=null,this.context&&this.context.render(this.scene,this.camera)}.bind(this))}renderFrame(e){return Xt(function(){e&&"function"==typeof e&&e()})}resize(){this._resetElementSize(this.container),this._resetElementSize(this.canvas);let e=this.canvas.width,t=this.canvas.height,r=this.getMapSize();this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.context.setSize(r.width,r.height),this.renderScene()}prepare(){if(!this.map)return new Error("map object is necessary");this.canvas?this.clear(this.context):(this._initContainer(),this._initThreeRenderer(),this._layer.fire("rendererinitialized"))}getMapSize(){let e=this.map.getContainer();return{width:e.clientWidth,height:e.clientHeight}}cancelFrame(){null!=this.animationFrame&&Qt(this.animationFrame)}remove(){null!=this.animationFrame&&Qt(this.animationFrame),this.container.removeChild(this.canvas),this.container.parentNode.removeChild(this.container),this.context=null,this.canvas=null,this.container=null}clear(e){e&&e.clear&&e.clear(),e&&e.clearRect&&e.clearRect(0,0,e.canvas.width,e.canvas.height)}getScale(e){let t=this.map,r=null==e?t.getZoom():e,s=Gt.getResolution(Gt.nativeMaxZoom);return Gt.getResolution(r)/s}getCanvasContainer(){return this.container}getCanvas(){return this.canvas}locationCamera(){let e=this.map,t=this.getMapSize(),r=e.transform.zoomScale(Gt.nativeMaxZoom-e.getZoom()-1),s=Math.tan(e.transform.fov/2*Yt),i=this.camera,n=e.getPitch()*Yt,a=-r*t.height/2/s;i.position.z=a*Math.cos(n);let o=Bt.lngLatToPoint(e.getCenter(),Gt.nativeMaxZoom),l=Math.sin(n)*a,h=e.getBearing()*Yt;i.position.x=o.x+l*Math.sin(h),i.position.y=o.y-l*Math.cos(h),i.up.set(Math.sin(h),-Math.cos(h),0),i.lookAt(new kt.Vector3(o.x,o.y,0)),i.updateProjectionMatrix()}toThreeShape(e){if(!e)return null;let t=this.getCoordinatesCenter(e),r=this.lngLatToPosition(t),s=e.map(e=>this.lngLatToPosition({lng:e[0],lat:e[1]}).sub(r));return new zt(s)}toThreeMesh(e,t,r,s){if(!e)return null;let i=e;s&&(i=this.removeDuplicatedCoordinates(e));let n=this.distanceToThreeVector3(t,t).x,a=this.toThreeShape(i),o=new qt(a,{amount:n,bevelEnabled:!0}),l=new Wt(o,r),h=this.lngLatToPosition(this.getCoordinatesCenter(i));return l.position.set(h.x,h.y,-n),l}addObject(e,t){t&&e&&this.setPosition(e,t),this.scene.add(e)}clearMesh(){let e=this.scene;if(!e)return this;for(let t=e.children.length-1;t>=0;t--)e.children[t]instanceof kt.Mesh&&e.remove(e.children[t]);return this}clearAll(e){let t=this.scene;if(!t)return this;for(let r=t.children.length-1;r>=0;r--)!e&&t.children[r]instanceof kt.Camera||t.remove(t.children[r]);return this}setPosition(e,t){if(!e||!t)return this;var r=this.lngLatToPosition(t);return e.position.set(r.x,r.y,r.z),this}lngLatToPosition(e){let t=Bt.projection.nativeMaxZoom,r=Bt.lngLatToPoint(e,t);return new Ht(r.x,r.y,-0)}distanceToThreeVector3(e,t,r){let s=this.map,i=r||s.getCenter(),n=Bt.projection.nativeMaxZoom,a=Bt.locate(i,e,t),o=Bt.lngLatToPoint(i,n),l=Bt.lngLatToPoint(a,n),h=Math.abs(l.x-o.x)*Math.sign(e),u=Math.abs(l.y-o.y)*Math.sign(t);return new Ht(h,u,0)}removeDuplicatedCoordinates(e){function t(e,t){return e[0]===t[0]&&e[1]===t[1]}let r=[].concat(e);for(let e=r.length-1;e>=1;e--)t(r[e],r[e-1])&&r.splice(e,1);return t(r[0],r[r.length-1])&&r.splice(r.length-1,1),r}getCoordinatesCenter(e){let t=0,r=0,s=0,i=0,n=e.length;for(;i0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}convertFastToPixelPoints(e){var t,r,s,i,n,a,o,l=[],h=e.getEast()-e.getWest(),u=e.getNorth()-e.getSouth(),c=this.mapElement;i=h/c.width>u/c.height?h/c.width:u/c.height,this.useRadius=this.useGeoUnit?parseInt(this.radius/i):this.radius;for(var d=0;d0&&this.maxWidth>0))return!1;var r=this.canvasContext;r.setTransform(1,0,0,1,0,0),this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var s=0;s-180&&e<=-90||e>=90&&e<180}_updateExtent(){if(this.options.wrapX&&!this.oldExtent){const{_ne:e,_sw:t}=this.getMapStateByKey("getBounds");this.options.extent=[t.lng,t.lat,e.lng,e.lat]}}_calcInterval(e=this.options.interval){"function"==typeof e?(e=e(this.map),this._currLngInterval=e,this._currLatInterval=e):(this._currLngInterval=e,this._currLatInterval=e)}_formatLat(e){return this.options.latFormatTickLabel?this.options.latLabelFormatter(e):e<0?It(-1*e)+"S":e>0?It(e)+"N":""+It(e)}_formatLng(e){return this.options.lngLabelFormatter?this.options.lngLabelFormatter(e):(e=Ot(e))>0&&e<=180?It(e)+"E":e<0&&e>=-180?It(-1*e)+"W":""+It(e)}_parsePxToInt(e){e.length>2&&"p"===e.charAt(e.length-2)&&(e=e.substr(0,e.length-2));try{return parseInt(e,10)}catch(e){console.log(e)}return 0}_drawLabel(e=this.visible){const t=this.canvas,r=t.getContext("2d");if(e&&this.options.showLabel){if(this.mapElement){this._currLngInterval&&this._currLatInterval||this._calcInterval(),r.clearRect(0,0,t.width,t.height);const{lngLabelStyle:e,latLabelStyle:s}=this.options,{lngPoints:i,latPonits:n}=this._getGridiculePoints();i.forEach(t=>{this._drawLng(r,t[0],t[1],t[2],e)}),n.forEach(e=>{this._drawLat(r,e[0],e[1],e[2],s)})}}else r.clearRect(0,0,t.width,t.height)}_drawLat(e,t,r,s,i){e=this._setLabelStyle(e,i);const n=this.canvas.width;let a=12;try{const t=e.font.split(" ")[0];a=this._parsePxToInt(t)}catch(e){console.log(e)}if(!s){const e=t;t=r,r=this.getMapStateByKey("project",[e,t])}const o=this._formatLat(t),l=e.measureText(o).width;e.strokeText(o,(s?n:r.x)-l,(s?r:r.y)+a/2),e.fillText(o,(s?n:r.x)-l,(s?r:r.y)+a/2)}_drawLng(e,t,r,s,i){e=this._setLabelStyle(e,i);const n=this.canvas.height;if(!s){const e=r;r=this.getMapStateByKey("project",[t,e])}const a=this._formatLng(t),o=e.measureText(a).width;e.strokeText(a,(s?r:r.x)-o/2,s?n:r.y),e.fillText(a,(s?r:r.x)-o/2,s?n:r.y)}_getLatPoints(e=[-180,180],t,r,s=this.features){if(!s)return;if(this.options.wrapX&&-180===e[0]&&180===e[1])return[];let i=[];return s.forEach(s=>{const n=s.geometry.coordinates[0][1];if(s.geometry.coordinates[1][1]===n){let s="number"==typeof r?r:e[1];this.isRotate&&(s="number"==typeof t?t:e[0]),this.options.wrapX&&(i=i.concat(this._getWrapPoints(s,n,[s,s]))),i.push([s,n])}}),i}_getLngPoints(e=[-90,90],t,r,s=this.features){if(!s)return;let i="number"==typeof t?t:e[0];this.isRotate&&(i="number"==typeof r?r:e[1]);let n=[];return s.forEach(e=>{let t=e.geometry.coordinates[0][0];e.geometry.coordinates[1][0]===t&&(n.push([t,i]),this.options.wrapX&&(n=n.concat(this._getWrapPoints(t,i))))}),n}_getWrapPoints(e,t,r=this.oldExtent){const s=[],{_ne:i,_sw:n}=this.getMapStateByKey("getBounds"),a=r.length>2?r[2]:r[1];for(;e>=n.lng;){const i=Ot(e,180===a,-180===r[0]);(!r||i>=r[0]&&i<=a)&&s.push([e,t]),e-=360}for(;e<=i.lng;){const i=Ot(e,180===a,-180===r[0]);(!r||i>=r[0]&&i<=a)&&s.push([e,t]),e+=360}return s}_getGridiculePoints(){const e=this._getEdgeLat(),t=this._getEdgeLng(),{latRange:r,lngRange:s,firstLat:i,firstLng:n,lastLat:a,lastLng:o}=this._getRange();return{latPonits:this._getUniquePoint(this._getLatPoints(s,n,o),e,1),lngPoints:this._getUniquePoint(this._getLngPoints(r,i,a),t,0)}}_getEdgeLat(e=this._currLatInterval){let t,r=[],s=[];const i=this.canvas.width,n=this.canvas.height,{extent:a}=this._getRange(),{_ne:o}=this.getMapStateByKey("getBounds");if(this.options.wrapX&&Ot(o.lng)>a[2])return[];const l=this._countDecimals(e);for(let o=0;o<=n;o++){const n=this.getMapStateByKey("unproject",[i,o]),h=Ot(n.lng);(this.options.wrapX?h>=a[0]&&h<=a[2]:n.lng>=a[0]&&n.lng<=a[2])&&n.lat>=a[1]&&n.lat<=a[3]&&(r.push([n.lat,o]),s.push(n.lat),void 0===t&&n.lat.toFixed(l)%e==0&&(t=Number(n.lat.toFixed(l))))}const{first:h,last:u,coordinates:c,points:d}=this._getIntersectRange(t,s,r,e);t=Math.min(Math.max(h,-90),90);const p=Math.max(Math.min(Math.round(u),90),-90);return-90!==t||-90!==p?this._getClosestCoordinate(t,p,c,d,e):[]}_getEdgeLng(e=this._currLngInterval){let t,r=[],s=[];const i=this.canvas.width,n=this.canvas.height,a=this.options.extent,o=this._countDecimals(e),{_sw:l}=this.getMapStateByKey("getBounds");if(this.options.wrapX&&Ot(l.lat)>a[3])return[];for(let l=0;l<=i;l++){const i=this.getMapStateByKey("unproject",[l,n]),h=Ot(i.lng);(this.options.wrapX?h>=a[0]&&h<=a[2]:i.lng>=a[0]&&i.lng<=a[2])&&i.lat>=a[1]&&i.lat<=a[3]&&(r.push([i.lng,l]),s.push(i.lng),void 0===t&&i.lng.toFixed(o)%e==0&&(t=Number(i.lng.toFixed(o))))}const{first:h,last:u,coordinates:c,points:d}=this._getIntersectRange(t,s,r,e);return t=h,this._getClosestCoordinate(t,u,c,d,e)}_getIntersectRange(e,t,r,s){let i=t[t.length-1];if(e>i){i=e,t.reverse(),r.reverse();const n=this._countDecimals(s);for(let r=0;r<=t.length;r++){const i=t[r];if(i.toFixed(n)%s==0){e=Number(i.toFixed(n));break}}}return{first:e,last:i,coordinates:t,points:r}}_getClosestCoordinate(e,t,r,s,i){let n=[],a=e;for(;a<=t;){const e=this._getClosestNumberIndex(a,r),t=s[e];n.push([Math.round(t[0]),t[1],!0]),a+=i,r=r.slice(e),s=s.slice(e)}return n}_getClosestNumberIndex(e,t){for(var r=0,s=Number.MAX_VALUE,i=0;it[0]===e[a][r]);o<=-1?s.push(e[a]):t&&t.x>=0&&t.x<=i&&t.y>=0&&t.y<=n&&(s[o]=e[a])}return s}_countDecimals(e){return Math.floor(e)!==e&&e.toString().split(".")[1].length||0}_getGraticuleFeatures(){const e=this._currLngInterval||10,t=this._currLatInterval||10,r=[];let{latRange:s,lngRange:i,firstLat:n,firstLng:a,lastLat:o,lastLng:l}=this._getRange();this.options.wrapX&&!this.oldExtent&&(s=[-90,90],i=[-180,180],n=a=o=l=null),"number"==typeof a&&r.unshift(this._makeLineFeature(this._makeLineCoords(a,s,n,o))),"number"==typeof l&&r.unshift(this._makeLineFeature(this._makeLineCoords(l,s,n,o)));for(var h=i[0];h<=i[1];h+=e)r.unshift(this._makeLineFeature(this._makeLineCoords(h,s,n,o)));"number"==typeof n&&r.unshift(this._makeLineFeature(this._makeLineCoords(n,i,a,l,"lat"))),"number"==typeof o&&r.unshift(this._makeLineFeature(this._makeLineCoords(o,i,a,l,"lat")));for(var u=s[0];u<=s[1];u+=t)r.unshift(this._makeLineFeature(this._makeLineCoords(u,i,a,l,"lat")));return r}_getRange(e=this.options.extent&&[...this.options.extent]){e&&0!==e.length||(e=this.getDefaultExtent());const t={};if((e=e.map(e=>Number(e.toFixed(6))))[1]%this._currLatInterval!=0){t.firstLat=e[1];const r=Math.ceil(e[1]/this._currLatInterval);e[1]=r*this._currLatInterval}if(e[3]%this._currLatInterval!=0){t.lastLat=e[3];const r=Math.floor(e[3]/this._currLatInterval);e[3]=r*this._currLatInterval}if(e[0]%this._currLngInterval!=0){t.firstLng=e[0];const r=Math.ceil(e[0]/this._currLngInterval);e[0]=r*this._currLngInterval}if(e[2]%this._currLngInterval!=0){t.lastLng=e[2];const r=Math.floor(e[2]/this._currLngInterval);e[2]=r*this._currLngInterval}return Object.assign({latRange:[e[1],e[3]],lngRange:[e[0],e[2]],extent:e},t)}_makeLineCoords(e,t=[-90,90],r,s,i="lng"){e="lng"===i?this._lngFix(e):e,r="number"==typeof r?r:t[0],s="number"==typeof s?s:t[1];const n=Math.abs(r-s),a=[];for(var o=r;o<=s;o+=n)"lng"===i?a.push([e,o]):a.push([o,e]);return a}_makeLineFeature(e,t="LineString"){return{type:"Feature",geometry:{type:t,coordinates:e}}}_lngFix(e){return e>=180?180:e<=-180?-180:e}_transformStrokeStyle(e=this.options.strokeStyle){if(!e||"string"==typeof e)return{paint:{"line-color":e||"rgba(0,0,0,0.2)"}};const t={visibility:this.visible?"visible":"none","line-join":e.lineJoin||"round","line-cap":e.lineCap||"round"},r={"line-color":e.lineColor||"rgba(0,0,0,0.2)","line-width":e.lineWidth||1,"line-offset":e.lineDashOffset||0,"line-translate-anchor":"viewport"};return e.lineWidth&&("function"==typeof e.lineWidth?r["line-width"]=e.lineWidth(this.map):r["line-width"]=e.lineWidth),e.lindDasharray&&("function"==typeof e.lindDasharray?r["line-dasharray"]=e.lindDasharray(this.map):r["line-dasharray"]=e.lindDasharray),{layout:t,paint:r}}_setLabelStyle(e,t){return t.textColor&&(e.fillStyle=t.textColor),t.textSize&&(e.font=t.textSize+" "+(t.textFont||["Calibri","sans-serif"]).join(",")),t.textHaloColor&&(e.strokeStyle=t.textHaloColor,e.lineWidth=t.textHaloWidth||1),t.textAnchor&&(e.textBaseline=this._getTxetBaseline(t.textAnchor),e.textAligin=this._getTxetAlign(t.textAligin)),e}_getTxetBaseline(e){if(!e)return"bottom";const t=e.split("-");return t.includes("bottom")?"bottom":t.includes("top")?"top":t.includes("center")?"middle":void 0}_getTxetAlign(e){if(!e)return"center";const t=e.split("-");return t.includes("left")?"left":t.includes("right")?"right":t.includes("center")?"center":void 0}}const ir={textSize:"12px",textFont:["12px Calibri","sans-serif"],textAnchor:"bottom",textColor:"rgba(0,0,0,1)",textHaloColor:"rgba(255,255,255,1)",textHaloWidth:1},nr={lineColor:"red",lineCap:"round",lineJoin:"round",lindDasharray:[.4,5],lineDashOffset:0,lineWidth:1},ar={showLabel:!0,opacity:1,visible:!0,interval:10,extent:null,minZoom:0,maxZoom:50,wrapX:!0,strokeStyle:nr,lngLabelFormatter:null,latLabelFormatter:null,lngLabelStyle:ir,latLabelStyle:ir};r(107),r(693);var or=r(144),lr=r.n(or);let hr=window.fetch;var ur,cr,dr,pr={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=m.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=s,a=0,o=t.queryKeys?t.queryKeys.length:0,l=0;l=t.limitLength){if(0==a)return!1;i.push(n),n=s,a=0,l--}else if(n.length+t.queryKeys[l].length+2+t.queryValues[l].length>t.limitLength)for(var h=t.queryValues[l];h.length>0;){var u=t.limitLength-n.length-t.queryKeys[l].length-2;n.indexOf("?")>-1?n+="&":n+="?";var c=h.substring(0,u);"%"===c.substring(u-1,u)?(u-=1,c=h.substring(0,u)):"%"===c.substring(u-2,u-1)&&(u-=2,c=h.substring(0,u)),n+=t.queryKeys[l]+"="+c,h=h.substring(u),c.length>0&&(i.push(n),n=s,a=0)}else a++,n.indexOf("?")>-1?n+="&":n+="?",n+=t.queryKeys[l]+"="+t.queryValues[l];return i.push(n),t.send(i,"SuperMapJSONPCallbacks_"+r,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var s=e.length;if(s>0)return new Promise(i=>{for(var n=(new Date).getTime(),a=0;a-1?o+="&":o+="?",o+="sectionCount="+s,o+="§ionIndex="+a,o+="&jsonpUserID="+n,r&&(o=decodeURIComponent(o),o=r+encodeURIComponent(o)),lr()(o,{jsonpCallbackFunction:t,timeout:3e4}).then(e=>{i(e.json())})}})},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)}},fr=function(){return void 0!=ur?ur:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},yr=function(){return cr||45e3},mr={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!!m.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:fr()||t.proxy)},get:function(e,t,r){r=r||{};if(e=m.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 pr.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=m.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 pr.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||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var s={url:m.urlAppend(e,"_method=POST"),data:t};return pr.POST(s)}return this._fetch(e,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 pr.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,hr(e,{method:s,headers:r.headers,body:"PUT"===s||"POST"===s?t:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:yr()}).then(function(e){return e})):hr(e,{method:s,body:"PUT"===s||"POST"===s?t:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:yr()}).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||{},lr()(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}};!function(e){e[e.Unknown=0]="Unknown",e[e.Point=1]="Point",e[e.LineString=2]="LineString",e[e.Polygon=3]="Polygon",e[e.MultiPoint=4]="MultiPoint",e[e.MultiLineString=5]="MultiLineString",e[e.MultiPolygon=6]="MultiPolygon",e[e.GeometryCollection=7]="GeometryCollection",e[e.CircularString=8]="CircularString",e[e.CompoundCurve=9]="CompoundCurve",e[e.CurvePolygon=10]="CurvePolygon",e[e.MultiCurve=11]="MultiCurve",e[e.MultiSurface=12]="MultiSurface",e[e.Curve=13]="Curve",e[e.Surface=14]="Surface",e[e.PolyhedralSurface=15]="PolyhedralSurface",e[e.TIN=16]="TIN",e[e.Triangle=17]="Triangle"}(dr||(dr={}));var gr=r(903);function vr(e,t){for(var r=0;r=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,dr.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):dr.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}}])&&vr(t.prototype,r),s&&vr(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();function xr(e,t){for(var r=[],s=0;s>1]),r.push(i)}return r}function _r(e,t,r){if(!r||0===r.length)return[xr(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 xr(e,s?s[t]:void 0)})}function wr(e,t){var r=t;if(r===dr.Unknown&&(r=e.type()),r===dr.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 Sr).__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 Ar).__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}}])&&Er(t.prototype,r),s&&Er(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Lr=(new TextEncoder,new TextDecoder);function Pr(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,dr.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):dr.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 Ar).__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 Nr).__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}}])&&Fr(t.prototype,r),s&&Fr(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Dr(e){for(var t=kr.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 zr(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 Wr(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 Wr(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 Wr(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],"]")}}])&&Yr(t.prototype,r),s&&Yr(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}(),a=s.minX,o=s.minY,l=s.maxX,h=s.maxY,Jr.info("tree items: ".concat(t,", nodeSize: ").concat(r)),u=$r(t,r),c=u[0][0],void 0,y=u.length-1,d=new n([0,1],y),p=[d],Jr.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(t,", nodeSize: ").concat(r,", levelBounds: ").concat(u)),f=Hr().mark(function e(){var s,d,f,y,m,g,v,b,S,x,_,w;return Hr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=p.shift(),Jr.debug("popped node: ".concat(s,", queueLength: ").concat(p.length)),d=s.startNode(),f=d>=c,y=zr(u[s.level()],2),m=y[1],g=Math.min(s.endNode()+r,m),v=g-d,e.next=9,new Qr(i(d*Zr,v*Zr),0);case 9:b=e.sent,S=new Float64Array(b),x=new Uint32Array(b),_=Hr().mark(function e(r){var i,u,y,m,g,v,b,_;return Hr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(lS[i+2])){e.next=7;break}return e.abrupt("return",0);case 7:if(!(o>S[i+3])){e.next=9;break}return e.abrupt("return",0);case 9:if(u=x[8+(i<<1)],y=x[9+(i<<1)],m=rs(y,u),!f){e.next=17;break}return g=function(){if(r ").concat(m)),b.extendEndNodeToNewOffset(m),e.abrupt("return",0);case 23:void 0,w=s.level()-1,_=new n([m,m+1],w),void 0!==b&&b.level()==_.level()?Jr.info("Same level, but too far away. Pushing new request at offset: ".concat(m," rather than merging with distant ").concat(b)):Jr.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 os(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)||ls(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 ls(e,t){if(e){if("string"==typeof e)return hs(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)?hs(e,t):void 0}}function hs(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 cs(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 ds(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){cs(n,s,i,a,o,"next",e)}function o(e){cs(n,s,i,a,o,"throw",e)}a(void 0)})}}function ps(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fs(e,t){for(var r=0;rjr.global.extraRequestThreshold()&&(Jr.info("Pushing new feature batch, since gap ".concat(S," was too large")),a.push(o),o=[]),o.push([y,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,vs(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(bs(xs(Rr.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 ss.length+is+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(){return new Cs(this.headerClient.httpClient)}},{key:"readFeatureBatch",value:function(e){var t=this;return ms(us().mark(function r(){var s,i,n,a,o,l,h,u,c,d,p;return us().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:s=os(e[0],1),i=s[0],n=os(e[e.length-1],2),a=n[0],o=n[1],l=a+o-i,h=t.buildFeatureClient(),u=as(e),r.prev=7,u.s();case 9:if((c=u.n()).done){r.next=17;break}return d=os(c.value,1),p=d[0],r.next=13,vs(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=ds(us().mark(function e(t,r,s){var i,n,a,o,l,h,u;return us().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+is)).set(l,is),(u=new gr.cZ(h)).setPosition(is),e.abrupt("return",Tr.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=ds(us().mark(function t(r){var s,i,n,a,o,l,h,u,c,d,p;return us().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return s=2024,i=new Cs(r),n=function(){var e,t=0;for(e=0;e<3;e++){t+=Math.pow(16,e)*Zr}return t}(),a=s+n,Jr.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 ss[t]===e})){t.next=13;break}throw Jr.error("bytes: ".concat(o," != ").concat(ss)),new Error("Not a FlatGeobuf file");case 13:return Jr.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 Jr.debug("headerLength: ".concat(l)),t.next=24,i.getRange(12,l,a,"header");case 24:return u=t.sent,c=new gr.cZ(new Uint8Array(u)),d=Dr(c),p=Kr(d.featuresCount,d.indexNodeSize),Jr.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}(),Cs=function(){function e(t){ps(this,e),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new As(t):t}return ys(e,[{key:"getRange",value:function(){var e=ds(us().mark(function e(t,r,s,i){var n,a,o;return us().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,Jr.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);Jr.info("".concat(t," bytes used/requested: ").concat(r," / ").concat(s," = ").concat(i,"%"))}}]),e}(),As=function(){function e(t){ps(this,e),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}return ys(e,[{key:"getRange",value:function(){var e=ds(us().mark(function e(t,r,s){var i,n;return us().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),Jr.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 Es(e){"@babel/helpers - typeof";return(Es="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 Ts(){Ts=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 A()}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 y=Object.getPrototypeOf,m=y&&y(y(C([])));m&&m!==t&&r.call(m,i)&&(f=m);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"==Es(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 Ls(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 Ps(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){Ls(n,s,i,a,o,"next",e)}function o(e){Ls(n,s,i,a,o,"throw",e)}a(void 0)})}}function Os(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 Is(t.call(e));r="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function Is(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(Is=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 Is(e)}function Ms(e){return new ks(e,0)}function Ns(e){return function(){return new Fs(e.apply(this,arguments))}}function Fs(e){var t,r;function s(t,r){try{var n=e[t](r),a=n.value,o=a instanceof ks;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 ks(e,t){this.v=e,this.k=t}function Ds(){return(Ds=Ns(Ts().mark(function e(t,r,s){var i,n,a,o,l,h,u,c,d,p;return Ts().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=Ir(t),n=function(){var e=Ps(Ts().mark(function e(t){return Ts().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,Ms(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 ss[t]===e})){e.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return e.t2=Uint8Array,e.next=12,Ms(n(4,"header length"));case 12:return e.t3=e.sent,a=new e.t2(e.t3),o=new gr.cZ(a),l=o.readUint32(0),e.t4=Uint8Array,e.next=19,Ms(n(l,"header data"));case 19:if(e.t5=e.sent,a=new e.t4(e.t5),o=new gr.cZ(a),h=Dr(o),s&&s(h),u=h.indexNodeSize,c=h.featuresCount,!(u>0)){e.next=29;break}return d=Kr(c,u),e.next=29,Ms(n(d,"entire index, w/o rect"));case 29:return e.next=31,Ms(Bs(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 Rs(){return(Rs=Ns(Ts().mark(function e(t,r,s,i){var n,a,o,l,h,u,c;return Ts().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ms(ws.open(t));case 2:n=e.sent,Jr.debug("opened reader"),i&&i(n.header),a=!1,o=!1,e.prev=7,h=Os(n.selectBbox(r));case 9:return e.next=11,Ms(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,Ms(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 Bs(e,t,r){return Gs.apply(this,arguments)}function Gs(){return(Gs=Ps(Ts().mark(function e(t,r,s){var i,n,a,o,l;return Ts().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 gr.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 gr.cZ(o)).setPosition(is),l=Tr.getRootAsFeature(n),e.abrupt("return",s(l,r));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function js(e,t){return{type:"FeatureCollection",features:function(e,t,r){if(!e.subarray(0,3).every(function(e,t){return ss[t]===e}))throw new Error("Not a FlatGeobuf file");var s=new gr.cZ(e),i=s.readUint32(ss.length);s.setPosition(ss.length+is);var n=Dr(s);r&&r(n);var a=ss.length+is+i,o=n.indexNodeSize,l=n.featuresCount;o>0&&(a+=Kr(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 Ys(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 Xs(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){Ys(n,s,i,a,o,"next",e)}function o(e){Ys(n,s,i,a,o,"throw",e)}a(void 0)})}}function Qs(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=t.layerID?t.layerID:m.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=t,this.strategy=t.strategy||"bbox",this.url=t.url,this.layerType="",this.extent=t.extent,this.init()}var t,r,s;return t=e,(r=[{key:"init",value:function(){"bbox"===this.strategy&&(this.loadedExtentsRtree_=new(zs()))}},{key:"iterateFeatures",value:function(){var e=Xs(qs().mark(function e(t){var r,s,i,n,a,o,l;return qs().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r={type:"FeatureCollection",features:[]},s=!1,i=!1,e.prev=3,a=Zs(t);case 5:return e.next=7,a.next();case 7:if(!(s=!(o=e.sent).done)){e.next=15;break}l=o.value,this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(l=this.options.featureLoader(l)),this.layerType||(this.layerType=$s[l.geometry.type]),r.features.push(l);case 12:s=!1,e.next=5;break;case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(3),i=!0,n=e.t0;case 21:if(e.prev=21,e.prev=22,!s||null==a.return){e.next=26;break}return e.next=26,a.return();case 26:if(e.prev=26,!i){e.next=29;break}throw n;case 29:return e.finish(26);case 30:return e.finish(21);case 31:return e.abrupt("return",r);case 32:case"end":return e.stop()}},e,this,[[3,17,21,31],[22,,26,30]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_loadData",value:function(){var e=Xs(qs().mark(function e(t){var r,s,i=this;return qs().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]},t.length){e.next=7;break}return e.next=4,this._getStream(this.url);case 4:r=e.sent,e.next=9;break;case 7:s.value={extent:t.slice()},this.loadedExtentsRtree_.insert(s);case 9:return e.next=11,Vs(r&&r.body||this.url,s,function(e){i.layerType=$s[e.geometryType]});case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_getStream",value:function(){var e=Xs(qs().mark(function e(t){return qs().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,mr.get(t,{},{withoutFormatSuffix:!0}).then(function(e){return e});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"_containsExtent",value:function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}},{key:"_getInExtent",value:function(e){var t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.loadedExtentsRtree_.search(t).map(function(e){return e.value})}},{key:"_forEachInExtent",value:function(e,t){return this._forEach(this._getInExtent(e),t)}},{key:"_forEach",value:function(e,t){for(var r,s=0,i=e.length;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 si(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 ii(e){return function(){var t=this,r=arguments;return new Promise(function(s,i){var n=e.apply(t,r);function a(e){si(n,s,i,a,o,"next",e)}function o(e){si(n,s,i,a,o,"throw",e)}a(void 0)})}}function ni(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=t.layerID?t.layerID:m.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=t,this.strategy=t.strategy||"bbox",this.url=t.url,this.layerType="",this.extent=t.extent,this.overlay=!0,this.type="custom",this.renderingMode="3d",this._updateFeaturesFn=this._updateFeatures.bind(this)}var t,r,s;return t=e,(r=[{key:"onAdd",value:function(e){this.map=e;var t=[];if("bbox"===this.strategy){var r=this.map.getBounds().toArray();t=[r[0][0],r[0][1],r[1][0],r[1][1]],this.map.on("moveend",this._updateFeaturesFn)}if(this.extent){var s=function(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]0?(r.totalTimes--,r.ajaxPolling(t)):e&&e(s,t)}}ajaxPolling(e){let t=this,r=e.url,s=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(s,s.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=m.isInTheSameDomain(r),t._commit(e)}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,t){e=m.transformResult(e),this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let r=(e=m.transformResult(e)).error||e;this.events.triggerEvent("processFailed",{error:r,options:t})}_returnContent(e){return e.scope.format!==G.FGB&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[G.GEOJSON,G.ISERVER]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=m.urlAppend(e.url,m.getParameterString(e.params||{}))),"object"==typeof e.data)try{e.params=m.toJSON(e.data)}catch(e){console.log("不是json对象")}else e.params=e.data;mr.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(t){let r=t;return"string"==typeof t&&(r=(new M).read(t)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&e.scope.format===G.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(e){return{error:e}}).then(t=>{t.error?(e.scope?u.bind(e.failure,e.scope):e.failure)(t):(t.succeed=void 0==t.succeed||t.succeed,(e.scope?u.bind(e.success,e.scope):e.success)(t))})}}class ci extends ui{constructor(e,t){super(e,t),this.options=t||{},this.eventCount=0,this.CLASS_NAME="SuperMap.KnowledgeGraphService"}destroy(){super.destroy()}query(e,t){const r=m.urlAppend(this.url+"/query.json",`cypherQuery=${e}`);this.processAsync({url:r,method:"GET",callback:t})}getGraphMaps(e){const t=this.url+"/graphmaps.json";this.processAsync({url:t,method:"GET",callback:e})}getGraphMap(e,t){const r=this.url+`/graphmaps/${e}.json`;this.processAsync({url:r,method:"GET",callback:t})}async getGraphMapData(e){let t=[];const r=await this._getGraphMapData(e);if(!r)return;const s=r.dataContent.queries&&r.dataContent.queries.query||[];let i=[];i="string"==typeof s?[s]:s;const n=this._getGraphMapExpandQuery(r);n.length&&i.push(...n);for(let e=0;e{t.push(`match p=(n)-[]-(m) where id(n)=${e} return p;`)}),t}processAsync({url:e,params:t,method:r,callback:s}){let i=++this.eventCount,n={scope:this,processCompleted:function(e){if(i===e.result.eventId&&s)return delete e.result.eventId,s(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((i===e.error.eventId||i===e.eventId)&&s)return delete e.eventId,s(e),this.events&&this.events.un(n),!1}};this.events.on(n);const a={method:r,url:e,scope:this,success(e,t){e.eventId=i,this.serviceProcessCompleted(e,t)},failure(e,t){e.eventId=i,this.serviceProcessFailed(e,t)}};t&&(a.params=t),this.request(a)}_getGraphMapData(e){return new Promise((t,r)=>{this.getGraphMap(e,e=>{"processFailed"===e.type?r(e.error):""===e.result.data?r("无数据"):t(e.result.graphMap)})})}_queryDataBySql(e){return new Promise((t,r)=>{this.query(e,e=>{"processFailed"===e.type?r(e.error):t(e.result)})})}}class di extends li{constructor(e,t){super(e,t),this._knowledgeGraphService=new ci(e,t)}query(e,t){this._knowledgeGraphService.query(e,t)}getGraphMaps(e){this._knowledgeGraphService.getGraphMaps(e)}getGraphMap(e,t){this._knowledgeGraphService.getGraphMap(e,t)}async getGraphMapData(e){return await this._knowledgeGraphService.getGraphMapData(e)}}var pi=r(618),fi=r.n(pi);function yi(e,t){const r=t&&t.styles&&t.styles.style,s=t&&t.captionFields&&t.captionFields.captionField,i={nodes:[],edges:[]};return e.forEach(e=>{const t=e.path;if(t){const{nodes:e,edges:n}=function(e,t,r){const s={nodes:[],edges:[]};return e.forEach(e=>{if(gi(e)){const r=bi(e,t);s.edges.push(r)}else{const i=vi(e,t,r);s.nodes.push(i)}}),s}(t,r,s);i.nodes.push(...e),i.edges.push(...n)}else if(gi(e)){const t=bi(e,r);i.edges.push(t)}else{const t=vi(e,r,s);i.nodes.push(t)}}),{nodes:mi(i.nodes),edges:mi(i.edges,"edgeId")}}function mi(e,t="id"){return fi()(e,t)}function gi(e){return e.hasOwnProperty("start")&&e.hasOwnProperty("end")}function vi(e,t,r){const{id:s,properties:i,lables:n}=e,a=t?function(e,t){if(!t)return{};const{id:r,labels:s}=e,i=t.filter(e=>"entity"===e.type);for(let e=0;e"relationShip"===e.type);for(let e=0;e!!(e.target&&e.target.isCanvas&&e.target.isCanvas())||!!e.item,getContent:e=>{const{item:t}=e;if(e.target&&e.target.isCanvas&&e.target.isCanvas())return;if(!t)return;const r=t.getType(),s=t.getModel();return r&&s&&"node"===r?this.isCollpased(s.id)?"
    \n
  • 展开
  • \n
  • 隐藏
  • \n
":"
    \n
  • 折叠
  • \n
  • 隐藏
  • \n
":void 0},handleMenuClick:(e,t)=>{switch(e.id.split("-")[0]){case"hide":this.hideItem(t);break;case"expand":this.expandNode(t);break;case"collapse":this.collapseNode(t);break;case"show":this.showItem(t)}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}_getGraphConfig(e){const t={speed:120,maxIteration:83,tick:()=>{this.refreshPositions()}},r={type:"fruchterman",gravity:5},s={},i={type:"line",style:{endArrow:{path:"M 0,0 L 2,1 L 2,-1 Z"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},n={default:["drag-canvas","zoom-canvas","drag-node"]},a=this._getContextMenu(),o=[new(wi().ToolBar),a],l={lineWidth:3,stroke:"#b4d6ff"},h={stroke:"#b4d6ff",lineWidth:2,endArrow:{path:"M 0,0 L 2,1 L 2,-1 Z",fill:"#b4d6ff"}};if(!e)return this._setToolBarStyle(),((e="knowledgeGraph")=>{const a=document.querySelector(`#${e}`);return{container:e,width:a.scrollWidth,height:a.scrollHeight,plugins:o,modes:n,layout:{...r,...t},defaultNode:s,defaultEdge:i,nodeStateStyles:{hover:l},edgeStateStyles:{hover:h}}})();e.container=e.container||"knowledgeGraph";const u="string"==typeof e.container?document.querySelector(`#${e.container}`):e.container;return e.width=e.width||u.scrollWidth,e.height=e.height||u.scrollHeight,e.layout={...r,...e.layout||{},...!1!==e.animate?t:{}},e.defaultNode={...s,...e.defaultNode||{}},e.defaultEdge={...i,...e.defaultEdge||{}},e.modes={default:[!1!==e.dragCanvas&&"drag-canvas",!1!==e.zoomCanvas&&"zoom-canvas",!1!==e.dragNode&&"drag-node"]},e.nodeStateStyles={hover:{...l,...e.nodeHighlightStyle||{}}},e.edgeStateStyles={hover:{...h,...e.edgeHighlightStyle||{}}},!1!==e.showToolBar&&(e.plugins=[new(wi().ToolBar)],this._setToolBarStyle()),!1!==e.showContextMenu&&(e.plugins=[...e.plugins||[],a],this._setToolBarStyle()),e}changeSize(e,t){return this.graph.changeSize(e,t)}autoResize(){const e=this.getContainer();window.addEventListener("resize",()=>{const t=e.scrollWidth,r=e.scrollHeight;this.graph.changeSize(t,r),this.graph.refresh()})}zoom(e,t,r,s){this.graph.zoom(e,t,r,s)}zoomTo(e,t,r,s){this.graph.zoomTo(e,t,r,s)}fitView(e,t,r,s){this.graph.fitView(e,t,r,s)}fitCenter(e,t){this.graph.fitCenter(e,t)}getGraphCenterPoint(){return this.graph.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graph.getViewPortCenterPoint()}getZoom(){return this.graph.getZoom()}getMinZoom(){return this.graph.getMinZoom()}setMinZoom(e){this.graph.setMinZoom(e)}getMaxZoom(){return this.graph.getMaxZoom()}setMaxZoom(e){this.graph.setMaxZoom(e)}getWidth(){return this.graph.getWidth()}getHeight(){return this.graph.getHeight()}setCenter(e){var t=this.graph.getWidth()/2,r=this.graph.getHeight()/2,s=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-s.x,r-s.y)}_setToolBarStyle(){Ai()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}highlightNode(e=this.graph){e.on("node:mouseenter",function(t){const r=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(r,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("node:mouseleave",function(){e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.paint(),e.setAutoPaint(!0)})}highlightEdge(e=this.graph){e.on("edge:mouseenter",function(t){const r=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(r,"hover",!0),e.paint(),e.setAutoPaint(!0)}),e.on("edge:mouseleave",function(){e.setAutoPaint(!1),e.getEdges().forEach(function(t){e.clearItemStates(t)}),e.paint(),e.setAutoPaint(!0)})}setData(e,t=this.graph){this.data?t.changeData(e):t.data(e),this.data=e}render(e=this.graph){return e.render()}updateGraph(e,t=this.graph){this.data=e,t.changeData(e)}refresh(e=this.graph){e.refresh()}getContainer(e=this.graph){return e.getContainer()}getCanvas(e=this.graph){return e.get("canvas")}getNodes(e=this.graph){return e.getNodes()}getEdges(e=this.graph){return e.getEdges()}getNeighbors(e,t,r=this.graph){return r.getNeighbors(e,t)}findById(e,t=this.graph){return t.findById(e)}find(e,t,r=this.graph){return r.find(e,t)}findAll(e,t,r=this.graph){return r.findAll(e,t)}getEdgesByNode(e){return e.getEdges()}getInEdges(e){return e.getInEdges()}getOutEdges(e){return e.getOutEdges()}getSourceByEdge(e){return e.getSource()}getTargetByEdge(e){return e.getTarget()}expandNode(e){const t=e.getModel().id;this._expandCollapseNode(this.collpasedData[t],"show"),delete this.collpasedData[t]}collapseNode(e){const t=e.getModel().id,r=[];this._collapseFunc(e,r),this.collpasedData[t]=r,this._expandCollapseNode(r)}isCollpased(e){return!!this.collpasedData[e]}_collapseFunc(e,t=[]){const r=this.getNeighbors(e,"target"),s=this.getNeighbors(e,"source");for(let e=0;e{"hide"===t?this.hideItem(e.id):(this.showItem(e.id),this.isCollpased(e.id)&&delete this.collpasedData[e.id]),e.children&&this._expandCollapseNode(e.children,t)})}showItem(e,t,r=this.graph){r.showItem(e,t)}hideItem(e,t,r=this.graph){r.hideItem(e,t)}show(e){e.show()}hide(e){e.hide()}changeVisibility(e,t){e.changeVisibility(t)}isVisible(e){return e.isVisible()}getModel(e){return e.getModel()}addItem(e,t,r=this.graph){r.addItem(e,t)}removeItem(e,t=this.graph){t.removeItem(e)}updateItem(e,t,r=this.graph){r.updateItem(e,t)}refreshItem(e,t=this.graph){t.refreshItem(e)}refreshPositions(e=this.graph){e.refreshPositions()}on(e,t,r=this.graph){r.on(e,t)}off(e,t,r=this.graph){r.off(e,t)}toDataURL(e,t,r=this.graph){r.toDataURL(e,t)}bindNodeDefaultDragEvent(e=this.graph){e.on("node:dragstart",function(e){Ti(e)}),e.on("node:drag",function(e){Ti(e)}),e.on("node:dragend",function(e){e.item.get("model").fx=null,e.item.get("model").fy=null})}stopDefaultEventPropagation(e=this.graph){e.on("click",function(e){e.stopPropagation()}),e.on("mousedown",function(e){e.stopPropagation()}),e.on("mouseover",function(e){e.stopPropagation()}),e.on("mouseout",function(e){e.stopPropagation()})}clear(e=this.graph){e.clear()}destroy(e=this.graph){e.destroy()}}function Ti(e){const t=e.item.get("model");return t.fx=e.x,t.fy=e.y,t.x=e.x,t.y=e.y,t}var Li=r(465),Pi=r.n(Li);class Oi{constructor(e,t="G6"){this.graph=null,this.config=Pi()(e),this.graphRender=null,this.type=t,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"}static dataFromGraphMap(e,t){return yi(e,t)}static dataFromKnowledgeGraphQuery(e){return yi(e)}handleNodeStatus(e){const{expand:t,collapse:r,hidden:s}=e;this.expandNodes(t),this.collapseNodes(r),this.hideNodes(s)}expandNodes(e){e&&e.forEach(e=>{this.expandNode(e+"")})}collapseNodes(e){e&&e.forEach(e=>{this.collapseNode(e+"")})}hideNodes(e){e&&e.forEach(e=>{this.hideItem(e+"")})}createGraphRender(e){"G6"===e&&(this.graphRender=new Ei)}createGraph(e){const t=this.initGraph(e);return this.graph=t,this.autoResize(),t}getGraph(){return this.graph}autoResize(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}zoom(e,t,r,s){this.graphRender.zoom(e,t,r,s)}zoomTo(e,t,r,s){this.graphRender.zoomTo(e,t,r,s)}fitView(e,t,r,s){this.graphRender.fitView(e,t,r,s)}fitCenter(e,t){this.graphRender.fitCenter(e,t)}getGraphCenterPoint(){return this.graphRender.getGraphCenterPoint()}getViewPortCenterPoint(){return this.graphRender.getViewPortCenterPoint()}getZoom(){return this.graphRender.getZoom()}getMinZoom(){return this.graphRender.getMinZoom()}setMinZoom(e){this.graphRender.setMinZoom(e)}getMaxZoom(){return this.graphRender.getMaxZoom()}setMaxZoom(e){this.graphRender.setMaxZoom(e)}getWidth(){return this.graphRender.getWidth()}getHeight(){return this.graphRender.getHeight()}initGraph(e){const t=this.graphRender.initGraph(e);this.graph=t;return this.graph.on("beforelayout",()=>{void 0!==this.config.zoom&&this.zoom(this.config.zoom),void 0!==this.config.center&&this.graphRender.setCenter({x:this.config.center[0],y:this.config.center[1]})}),t}setData(e,t=this.graph){e=e||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(e.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,e.nodes)),this.graphRender.setData(e,t),this.render(t),this.data=e}render(e=this.graph){e&&this.graphRender.render(e)}updateGraph(e,t=this.graph){t&&this.graphRender.updateGraph(e,t)}refresh(){return this.graphRender.refresh()}changeSize(e,t){return this.graphRender.changeSize(e,t)}resize(e,t){this.graphRender.changeSize(e,t),this.graphRender.refresh()}getContainer(){return this.graphRender.getContainer()}getCanvas(){return this.graphRender.getCanvas()}getNodes(){return this.graphRender.getNodes()}getEdges(){return this.graphRender.getEdges()}getNeighbors(e,t){return this.graphRender.getNeighbors(e,t)}findById(e){return this.graphRender.findById(e)}find(e,t){return this.graphRender.find(e,t)}findAll(e,t){return this.graphRender.findAll(e,t)}getEdgesByNode(e){return this.graphRender.getEdgesByNode(e)}getInEdges(e){return this.graphRender.getInEdges(e)}getOutEdges(e){return this.graphRender.getOutEdges(e)}getSourceByEdge(e){return this.graphRender.getSourceByEdge(e)}getTargetByEdge(e){return this.graphRender.getTargetByEdge(e)}expandNode(e){const t=this.findById(e);t&&this.graphRender.expandNode(t)}collapseNode(e){const t=this.findById(e);t&&this.graphRender.collapseNode(t)}showItem(e,t){this.graphRender.showItem(e,t)}hideItem(e,t){this.graphRender.hideItem(e,t)}show(e){this.graphRender.show(e)}hide(e){this.graphRender.hide(e)}changeVisibility(e,t){this.graphRender.changeVisibility(e,t)}isVisible(e){return this.graphRender.isVisible(e)}getModel(e){return this.graphRender.getModel(e)}addItem(e,t){return this.graphRender.addItem(e,t)}removeItem(e){return this.graphRender.removeItem(e)}updateItem(e,t){return this.graphRender.updateItem(e,t)}refreshItem(e){return this.graphRender.refreshItem(e)}refreshPositions(){return this.graphRender.refreshPositions()}on(e,t){this.graphRender.on(e,t)}off(e,t){this.graphRender.off(e,t)}toDataURL(e,t){this.graphRender.toDataURL(e,t)}nodeLabelOpenEllipsis(e,t){return t?e?t.map(t=>{const r=t.labelCfg&&t.labelCfg.fontSize||this.defaultNode&&this.defaultNode.labelCfg&&this.defaultNode.labelCfg.fontSize||14;return t.label=function(e,t,r){const s=1*r;t*=1.6;if((e=>{let t=0;for(let r=0;r0&&e.charCodeAt(r)<128?t++:t+=2;return t})(e)*s>t){const r=Math.floor((t-20)/s),i=e.substring(0,r);return(e.substring(r).length+"…".length)*s>t?i+"\n"+e.substring(r,r+r-2)+"…":0==e.substring(r).length?i:i+"\n"+e.substring(r)}return e}(t.label,e,r),t}):t:[]}clear(e=this.graph){e&&e.clear()}destroy(e=this.graph){e&&e.destroy()}}var Ii={getPoint:function(e){if(e&&e instanceof Array)return new Et.DataSet([{geometry:{type:"Point",coordinates:e}}])},getPoints:function(e){if(e&&e instanceof Array){var t=[];return e.forEach(e=>{t.push({geometry:{type:"Point",coordinates:e.geometry.coordinates}})}),new Et.DataSet(t)}},getCurveLines:function(e,t){if(e&&e instanceof Array&&t&&t instanceof Array){var r=[];return t.forEach(t=>{var s=t.geometry&&t.geometry.coordinates,i={lng:s[0],lat:s[1]},n={lng:e[0],lat:e[1]},a=Et.utilCurve.getPoints([n,i]);r.push({geometry:{type:"LineString",coordinates:a}})}),new Et.DataSet(r)}},getCurveDynamicPoints:function(e,t){if(e&&e instanceof Array&&t&&t instanceof Array){var r=[];return t.forEach(t=>{for(var s=t.geometry&&t.geometry.coordinates,i={lng:s[0],lat:s[1]},n={lng:e[0],lat:e[1]},a=Et.utilCurve.getPoints([n,i]),o=0;o{const s=m.createUniqueID(`${e.id}_`);this.singleSymbol.addLayer({...e,id:s},t,r),this.addLayerId(e.id,s)})}addLayerId(e,t){this.layerIds[e]||(this.layerIds[e]=[]),!this.layerIds[e].includes(t)&&this.layerIds[e].push(t)}removeLayerId(e){delete this.layerIds[e]}getLayerIds(e){return this.layerIds[e]}getLayerId(e){for(const t in this.layerIds)if(this.layerIds[t].find(t=>t===e))return t}};const ki=class{constructor(){this.symbols={},this.images={}}addSymbol(e,t){this.symbols[e]=t}getSymbol(e){return this.symbols[e]&&JSON.parse(JSON.stringify(this.symbols[e]))}removeSymbol(e){delete this.symbols[e]}addImageInfo(e,t){this.images[e]=t}getImageInfo(e){return this.images[e]}},Di={circle:"circle",symbol:"symbol",line:"line",fill:"fill"},Ri=[{prefix:"line-",type:Di.line},{prefix:"fill-",type:Di.fill},{prefix:"circle-",type:Di.circle}];function Bi(e){return e&&e.length>0}function Gi(e){const t=function(e){const{paint:t={},layout:r={}}=e,s=Object.keys(t).concat(Object.keys(r));let i;for(const e of Ri){const t=s.some(t=>t.startsWith(e.prefix));if(t){i=e.type;break}}return i||Di.symbol}(e);return{[Di.symbol]:{type:"layout",name:"icon-image"},[Di.line]:{type:"paint",name:"line-pattern"},[Di.fill]:{type:"paint",name:"fill-pattern"}}[t]}const ji=["array","boolean","collator","format","literal","number","object","string","to-boolean","to-color","to-number","to-string","typeof","feature-state","geometry-type","id","line-progress","properties","at","get","has","length","!","!=","<","<=","==",">",">=","all","any","case","match","coalesce","interpolate","interpolate-hcl","interpolate-lab","step","let","var","concat","downcase","is-supported-script","resolved-locale","upcase","rgb","rgba","-","*","/","%","^","+","abs","acos","asin","atan","ceil","cos","e","floor","ln","ln2","log10","log2","max","min","pi","round","sin","sqrt","tan","zoom","heatmap-density"];function Ui(e){if(e&&e.length>0){const[t]=e;return"string"==typeof t&&ji.includes(t)}return!1}function Ji(e){return Object.keys(e).every(t=>!Ui(e[t]))}function Vi(e){return(Bi(e)?e:[e]).every(e=>Ji(e.paint||{})&&Ji(e.layout||{}))}const Hi=e=>["icon-color","icon-opacity","icon-translate","line-opacity","line-blur","line-translate","line-color","line-width","line-offset","line-dasharray","line-pattern","fill-color","fill-opacity","fill-pattern","fill-outline-color","text-color","text-halo-blur","text-halo-color","text-halo-width","text-opacity","text-translate","text-translate-anchor","circle-blur","circle-color","circle-opacity","circle-translate","circle-radius","circle-stroke-color","circle-stroke-opacity","circle-stroke-width"].includes(e);const zi=class{constructor(e){this.map=e,this.symbolManager=new ki,this.singleSymbolRender=new Ni(e),this.compositeSymbolRender=new Fi(e),this._layerSymbols={}}_update(e){return this.map=e,this}addLayer(e,t){if("string"==typeof e.symbol){const r=e.symbol;if(r){const s=this.symbolManager.getSymbol(r);if(!s)return this.map.fire("error",{error:new Error(`Symbol "${r}" could not be loaded. Please make sure you have added the symbol with map.addSymbol().`)});this.setSymbolTolayer(e.id,r),this.getSymbolRender(s).addLayer(e,s,t)}}else Ui(e.symbol)&&(this.setSymbolTolayer(e.id,e.symbol),this.addExpressionLayer(e,t))}setSymbol(e,t){const r=this.map.getStyle().layers,s=r.findIndex(t=>t.id===e);if(-1===s)return this.map.fire("error",{error:new Error(`Cannot set symbol "${t}" to non-existing layer "${e}".`)});this.map.removeLayer(e);const i=r[s+1]&&r[s+1].id,n=i&&this.map.style.getLayer(i),a=n&&n.id||i&&this.getFirstLayerId(i),o=r[s];this.addLayer({...o,paint:{},layout:{visibility:o.layout&&o.layout.visibility||"visible"},symbol:t},a)}getMatchLayers(e){const t=[],r=["all"];e.filter&&r.push(e.filter);const s=e.symbol.slice(2);return s.forEach((i,n)=>{n%2==1?t.push({...e,filter:[...r,["==",e.symbol[1][1],s[n-1]]],symbol:i}):n===s.length-1&&t.unshift({...e,symbol:i})}),t}getCaseLayers(e){const t=[],r=["all"];e.filter&&r.push(e.filter);const s=e.symbol.slice(1);return s.forEach((i,n)=>{n%2==1?t.push({...e,filter:[...r,s[n-1]],symbol:i}):n===s.length-1&&t.unshift({...e,symbol:i})}),t}addExpressionLayer(e,t){delete e.paint,delete e.layout;const r={match:this.getMatchLayers,case:this.getCaseLayers}[e.symbol[0]],s=r&&r(e);if(!s)return this.map.fire("error",{error:new Error("This expressions not supported")});s.forEach(r=>{r.id=m.createUniqueID(`${e.id}_`),this.compositeSymbolRender.addLayerId(e.id,r.id),this.addLayer(r,t)})}getSymbolRender(e){return Bi(e)?this.compositeSymbolRender:this.singleSymbolRender}addSymbolImageToMap(e,t){const{type:r,name:s}=Gi(e),i=e[r]&&e[r][s];i&&!this.map.hasImage(i)&&(this.map.addImage(i,t),this.symbolManager.addImageInfo(i,t))}addSymbol(e,t){return this.symbolManager.getSymbol(e)?this.map.fire("error",{error:new Error("An symbol with this name already exists.")}):Vi(t)?void this.symbolManager.addSymbol(e,t):this.map.fire("error",{error:new Error("Symbol is not supported expressions.")})}setSymbolTolayer(e,t){this._layerSymbols[e]=t}getSymbol(e){return this._layerSymbols[e]}hasSymbol(){return Object.keys(this._layerSymbols).length>0}removeSymbol(e){this.symbolManager.removeSymbol(e)}getSymbolInfo(e){return this.symbolManager.getSymbol(e)}getLayerIds(e){return this.compositeSymbolRender.getLayerIds(e)||[]}getLayerId(e){return this.compositeSymbolRender.getLayerId(e)}removeLayerId(e){return this.compositeSymbolRender.removeLayerId(e)}getLayer(e){const t=this.map.getLayerBySymbolBak(e),r=this.getSymbol(e);if(t)return r?{...t,symbol:r}:t;{const t=this.getLayerIds(e);if(t[0]){const s=this.map.getLayerBySymbolBak(t[0]);return s&&{...s,symbol:r,id:e}}}}removeLayer(e){const t=this.getLayerIds(e);t.length>0?(t.forEach(e=>this.map.style.removeLayer(e)),this.removeLayerId(e)):this.map.style.removeLayer(e)}getStyle(){const e=this.map.style.serialize();return this.hasSymbol()&&(e.layers=e.layers.reduce((e,t)=>{const r=this.getLayerId(t.id);return r?!e.find(e=>e.id===r)&&e.push({...t,symbol:this.getSymbol(r),id:r}):this.getSymbol(t.id)?e.push({...t,symbol:this.getSymbol(t.id)}):e.push(t),e},[])),e}getFirstLayerId(e){return this.getLayerIds(e)[0]}moveLayer(e,t){const r=this.getLayerIds(e),s=t&&this.map.style.getLayer(t),i=s&&s.id||t&&this.getFirstLayerId(t);r.length>0?r.forEach(e=>this.map.style.moveLayer(e,i)):this.map.style.moveLayer(e,i)}setFilter(e,t,r){if(Ui(this.getSymbol(e))){const s=this.getFirstLayerId(e);this.map.style.setFilter(s,t,r);const i=this.getSymbol(e);return void this.setSymbol(e,i)}const s=this.getLayerIds(e);s.length>0?s.forEach(e=>this.map.style.setFilter(e,t,r)):this.map.style.setFilter(e,t,r)}getFilter(e){const t=this.getFirstLayerId(e);if(this.map.style.getLayer(t))return this.map.style.getFilter(t)}setLayerZoomRange(e,t,r){const s=this.getLayerIds(e);s.length>0?s.forEach(e=>this.map.style.setLayerZoomRange(e,t,r)):this.map.style.setLayerZoomRange(e,t,r)}setPaintProperty(e,t,r,s){const i=this.getLayerIds(e);i.length>0?i.forEach(e=>this.map.style.setPaintProperty(e,t,r,s)):this.map.style.setPaintProperty(e,t,r,s)}getPaintProperty(e,t){const r=this.getFirstLayerId(e);return this.map.style.getPaintProperty(r,t)}setLayoutProperty(e,t,r,s){const i=this.getLayerIds(e);i.length>0?i.forEach(e=>this.map.style.setLayoutProperty(e,t,r,s)):this.map.style.setLayoutProperty(e,t,r,s)}getLayoutProperty(e,t){const r=this.getFirstLayerId(e);return this.map.style.getLayoutProperty(r,t)}updateLayerSymbol(e){Object.keys(this._layerSymbols).forEach(t=>{const r=this._layerSymbols[t];r.includes(e)&&this.setSymbol(t,r)})}updateSymbol(e,t){return this.symbolManager.getSymbol(e)?Vi(t)?(this.symbolManager.addSymbol(e,t),void this.updateLayerSymbol(e)):this.map.fire("error",{error:new Error("Symbol is not supported expressions.")}):this.map.fire("error",{error:new Error(`Symbol "${e}" could not be loaded. Please make sure you have added the symbol with map.addSymbol().`)})}setSymbolProperty(e,t,r,s){const i=this.symbolManager.getSymbol(e);if(!i)return this.map.fire("error",{error:new Error(`Symbol "${e}" could not be loaded. Please make sure you have added the symbol with map.addSymbol().`)});if(Ui(s))return this.map.fire("error",{error:new Error("Symbol value is not supported expressions.")});const n=Hi(r)?"paint":"layout";if(i.length>0){const e=i[t];if(!e)return this.map.fire("error",{error:new Error(`symbol[${t}] does not exist.`)});e[n]||(e[n]={}),Object.assign(e[n],{[r]:s})}else i[n]||(i[n]={}),Object.assign(i[n],{[r]:s});this.symbolManager.addSymbol(e,i),this.updateLayerSymbol(e)}getSymbolProperty(e,t,r){const s=this.symbolManager.getSymbol(e);if(!s)return void this.map.fire("error",{error:new Error(`Symbol "${e}" could not be loaded. Please make sure you have added the symbol with map.addSymbol().`)});const i=Hi(r)?"paint":"layout";return s.length>0?s[t]&&s[t][i]&&s[t][i][r]:s[i]&&s[i][r]}};const Wi=function(){const e=e=>(t().Map.prototype.symbolHandler||(t().Map.prototype.symbolHandler=new zi(e)),t().Map.prototype.symbolHandler._update(e));void 0===t().Map.prototype.addLayerBySymbolBak&&(t().Map.prototype.addLayerBySymbolBak=t().Map.prototype.addLayer,t().Map.prototype.addLayer=function(t,r){return t.symbol?(e(this).addLayer(t,r),this):(this.addLayerBySymbolBak(t,r),this)}),void 0===t().Map.prototype.getLayerBySymbolBak&&(t().Map.prototype.getLayerBySymbolBak=t().Map.prototype.getLayer,t().Map.prototype.getLayer=function(t){return e(this).getLayer(t)}),void 0===t().Map.prototype.moveLayerBySymbolBak&&(t().Map.prototype.moveLayerBySymbolBak=t().Map.prototype.moveLayer,t().Map.prototype.moveLayer=function(t,r){return!this.style.getLayer(t)||r&&!this.style.getLayer(r)?(e(this).moveLayer(t,r),this._update(!0)):this.moveLayerBySymbolBak(t,r)}),void 0===t().Map.prototype.removeLayerBySymbolBak&&(t().Map.prototype.removeLayerBySymbolBak=t().Map.prototype.removeLayer,t().Map.prototype.removeLayer=function(t){return this.style.getLayer(t)?this.removeLayerBySymbolBak(t):e(this).removeLayer(t)}),void 0===t().Map.prototype.setLayoutPropertyBySymbolBak&&(t().Map.prototype.setLayoutPropertyBySymbolBak=t().Map.prototype.setLayoutProperty,t().Map.prototype.setLayoutProperty=function(t,r,s,i){return this.overlayLayersManager[t]||this.style.getLayer(t)?this.setLayoutPropertyBySymbolBak(t,r,s,i):(e(this).setLayoutProperty(t,r,s,i),this._update(!0))}),t().Map.prototype.setSymbol=function(t,r){e(this).setSymbol(t,r)},t().Map.prototype.setStyleBak||(t().Map.prototype.setStyleBak=t().Map.prototype.setStyle,t().Map.prototype.setStyle=function(e,t){return this.setStyleBak(e,t),this.style&&this.style.once("style.load",()=>{e.layers.filter(e=>e.symbol).forEach(e=>{this.setSymbol(e.id,e.symbol)})}),this}),t().Map.prototype.loadSymbol=async function(t,r){if("string"==typeof t){let s=e(this).getSymbolInfo(t);if(!s){const i=await async function(e,t){let r=`${t.basePath}/${e}/${e}`;const s=await mr.get(`${r}.json`).then(e=>{if(e.ok)return e.json()}).catch(()=>null);if(!s)return null;const i=s.paint||{},n=s.layout||{},a=(i["fill-pattern"]||i["line-pattern"]||n["icon-image"])&&await new Promise(e=>{const t=new Image;t.src=`${r}.png`,t.onload=(r=>{e(r?t:null)}),t.onerror=(()=>{e(null)})});return{value:s,image:a}}(t,this);if(!i)return void r({message:"This symbol is not exists."});const{value:n,image:a}=i;s=n,a&&e(this).addSymbolImageToMap(n,a)}r(null,s)}else r({message:"Symbol id must be a string."})},t().Map.prototype.addSymbol=function(t,r){e(this).addSymbol(t,r)},t().Map.prototype.hasSymbol=function(t){return t?!!e(this).getSymbolInfo(t):(this.fire("error",{error:new Error("Missing required symbol id")}),!1)},t().Map.prototype.removeSymbol=function(t){e(this).removeSymbol(t)},t().Map.prototype.updateSymbol=function(t,r){e(this).updateSymbol(t,r)},t().Map.prototype.setSymbolProperty=function(t,r,s,i){e(this).setSymbolProperty(t,r,s,i)},t().Map.prototype.getSymbolProperty=function(t,r,s){return e(this).getSymbolProperty(t,r,s)},t().Map.prototype.getStyle=function(){if(this.style)return e(this).getStyle()},t().Map.prototype.setFilter=function(t,r,s){return this.style.getLayer(t)?(this.style.setFilter(t,r,s),this._update(!0)):(e(this).setFilter(t,r,s),this._update(!0))},t().Map.prototype.getFilter=function(t){return this.style.getLayer(t)?this.style.getFilter(t):e(this).getFilter(t)},t().Map.prototype.setLayerZoomRange=function(t,r,s){return this.style.getLayer(t)?(this.style.setLayerZoomRange(t,r,s),this._update(!0)):(e(this).setLayerZoomRange(t,r,s),this._update(!0))},t().Map.prototype.setPaintProperty=function(t,r,s,i){return this.style.getLayer(t)?(this.style.setPaintProperty(t,r,s,i),this._update(!0)):(e(this).setPaintProperty(t,r,s,i),this._update(!0))},t().Map.prototype.getPaintProperty=function(t,r){return this.style.getLayer(t)?this.style.getPaintProperty(t,r):e(this).getPaintProperty(t,r)},t().Map.prototype.getLayoutProperty=function(t,r){return this.style.getLayer(t)?this.style.getLayoutProperty(t,r):e(this).getLayoutProperty(t,r)}};class qi{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,m.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class Yi{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,m.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 Xi extends ui{constructor(e,t){super(e,t),this.options=t||{},this.eventCount=0,this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,r){t instanceof qi&&this.processAsync(e,t,r)}decode(e,t,r){t instanceof Yi&&this.processAsync(e,t,r)}processAsync(e,t,r){let s=++this.eventCount,i={scope:this,processCompleted:function(e){if(s===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(i),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&r)return r(e),this.events&&this.events.un(i),!1}};this.events.on(i),this.request({method:"GET",url:e,params:t,scope:this,success(e,t){e.eventId=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,this.serviceProcessFailed(e,t)}})}serviceProcessCompleted(e,t){e.succeed&&delete e.succeed,super.serviceProcessCompleted(e,t)}serviceProcessFailed(e,t){super.serviceProcessFailed(e,t)}}class Qi{constructor(e){e&&(this.customParams=null,this.prjCoordSys=null,this.expectCount=1e5,this.networkType=U.LINE,this.queryOption=J.ATTRIBUTEANDGEOMETRY,this.queryParams=null,this.startRecord=0,this.holdTime=10,this.returnCustomResult=!1,this.returnFeatureWithFieldCaption=!1,m.extend(this,e),this.CLASS_NAME="SuperMap.QueryParameters")}destroy(){var e=this;if(e.customParams=null,e.expectCount=null,e.networkType=null,e.queryOption=null,e.queryParams){for(var t=0,r=e.queryParams,s=r.length;t=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=hi.appendCredential(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}}class sn extends ui{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,this.eventCount=0,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();this.datasource=null,this.dataset=null}getDatasetsService(e,t){const r=m.urlPathAppend(this.url,`datasources/name/${e}/datasets`);this.processAsync(r,"GET",t)}getDatasetService(e,t,r){const s=m.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(s,"GET",r)}setDatasetService(e,t){if(!e)return;const r=m.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);delete e.datasourceName,this.processAsync(r,"PUT",t,e)}deleteDatasetService(e,t,r){const s=m.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(s,"DELETE",r)}processAsync(e,t,r,s){let i=++this.eventCount,n={scope:this,processCompleted:function(e){if(i===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((i===e.error.eventId||i===e.eventId)&&r)return r(e),this.events&&this.events.un(n),!1}};this.events.on(n);var a=this;let o={url:e,method:t,scope:a,success(e,t){e.eventId=i,a.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=i),e.eventId=i,a.serviceProcessFailed(e,t)}};s&&(o.data=m.toJSON(s)),a.request(o)}}class nn{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&m.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){this.datasourceName=null,this.datasetName=null,this.datasetType=null}}class an{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&&m.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 on{constructor(e){e&&(this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null,e&&m.extend(this,e),this.CLASS_NAME="SuperMap.SetDatasourceParameters")}destroy(){this.datasourceName=null,this.description=null,this.coordUnit=null,this.distanceUnit=null}}class ln extends ui{constructor(e,t){super(e,t),t&&m.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.DatasourceService"}destroy(){this.eventCount=0,super.destroy()}getDatasourceService(e,t){let r=m.urlPathAppend(this.url,`datasources/name/${e}`);this.processAsync(r,"GET",t)}getDatasourcesService(e){let t=m.urlPathAppend(this.url,"datasources");this.processAsync(t,"GET",e)}setDatasourceService(e,t){if(!e)return;const r=m.urlPathAppend(this.url,`datasources/name/${e.datasourceName}`);this.processAsync(r,"PUT",t,e)}processAsync(e,t,r,s){let i=++this.eventCount,n={scope:this,processCompleted:function(e){if(i===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((i===e.error.eventId||i===e.eventId)&&r)return r(e),this.events&&this.events.un(n),!1}};this.events.on(n);let a={url:e,method:t,scope:this,success(e,t){e.eventId=i,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=i),e.eventId=i,this.serviceProcessFailed(e,t)}};s&&(a.data=m.toJSON(s)),this.request(a)}}class hn{constructor(e){this.dataSourceName=null,this.dataSetName=null,this.features=null,this.editType=he.ADD,this.IDs=null,this.returnContent=!1,this.isUseBatch=!1,m.extend(this,e),this.CLASS_NAME="SuperMap.EditFeaturesParameters"}destroy(){var e=this;e.dataSourceName=null,e.dataSetName=null,e.features=null,e.editType=null,e.IDs=null,e.returnContent=null}static toJsonParameters(e){var t,r,s;if(e.editType===he.DELETE){if(null===e.IDs)return;s={ids:e.IDs}}else if(s=[],e.features){r=e.features.length;for(var i=0;i=0&&r.toIndex>=0&&!s&&(r.url=m.urlAppend(r.url,`fromIndex=${r.fromIndex}&toIndex=${r.toIndex}`)),e.returnCountOnly&&(r.url=m.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,t){if(e=m.transformResult(e),this.format===G.GEOJSON&&e.features){var r=new Ae;e.features=r.toGeoJSON(e.features)}this.events.triggerEvent("processCompleted",{result:e,options:t})}dataFormat(){return[G.GEOJSON,G.ISERVER,G.FGB]}}class dn{constructor(e){this.attributeFilter=null,this.name=null,this.joinItems=null,this.linkItems=null,this.ids=null,this.orderBy=null,this.groupBy=null,this.fields=null,e&&m.extend(this,e),this.CLASS_NAME="SuperMap.FilterParameter"}destroy(){var e=this;if(e.attributeFilter=null,e.name=null,e.joinItems){for(let t=0,r=e.joinItems,s=r.length;t0;)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 dn).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),m.toJSON(t)}}class yn extends cn{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return fn.toJsonParameters(e)}}class mn extends pn{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,m.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),m.toJSON(t)}}class gn extends cn{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return mn.toJsonParameters(e)}}class vn extends pn{constructor(e){super(e),this.getFeatureMode=vn.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=V.CONTAIN,m.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:vn.getFeatureMode.BOUNDS,bounds:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new dn).name=e.datasetNames,t.fields=e.fields,s.queryParameter=t),e.attributeFilter&&(s.attributeFilter=e.attributeFilter,s.getFeatureMode=vn.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),m.toJSON(s)}}vn.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class bn extends cn{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return vn.toJsonParameters(e)}}class Sn extends pn{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,m.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=Ce.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:s},e.fields&&((t=new dn).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),m.toJSON(r)}}class xn extends cn{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Sn)return Sn.toJsonParameters(e)}}class _n extends pn{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=V.CONTAIN,m.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=Ce.fromGeometry(e.geometry),s={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:r,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new dn).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),m.toJSON(s)}}class wn extends cn{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return _n.toJsonParameters(e)}}class Cn{constructor(e,t){this.url=e,this.options=t||{}}getFeaturesByIDs(e,t,r){var s=this;new yn(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{processCompleted:t,processFailed:t},format:r}).processAsync(e)}getFeaturesByBounds(e,t,r){var s=this;new bn(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(e)}getFeaturesByBuffer(e,t,r){var s=this;new xn(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(e)}getFeaturesBySQL(e,t,r){var s=this;new gn(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(e)}getFeaturesByGeometry(e,t,r){var s=this;new wn(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(e)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,s=r.url,i=e.dataSourceName,n=e.dataSetName;s=m.urlPathAppend(s,"datasources/"+i+"/datasets/"+n),new un(s,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(e)}}_processFormat(e){return e||G.GEOJSON}}class An extends ui{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();this.datasource=null,this.dataset=null}processAsync(){var e=this;e.url=m.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 En{constructor(e){this.datasource=null,this.dataset=null,e&&m.extend(this,e),this.CLASS_NAME="SuperMap.FieldParameters"}destroy(){this.datasource=null,this.dataset=null}}class Tn extends En{constructor(e){super(e),this.fieldName=null,this.statisticMode=null,e&&m.extend(this,e),this.CLASS_NAME="SuperMap.FieldStatisticsParameters"}destroy(){this.fieldName=null,this.statisticMode=null}}class Ln extends ui{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.FieldStatisticService"}destroy(){super.destroy();this.datasource=null,this.dataset=null,this.field=null,this.statisticMode=null}processAsync(){var e=this,t="datasources/"+e.datasource+"/datasets/"+e.dataset+"/fields/"+e.field+"/"+e.statisticMode;e.url=m.urlPathAppend(e.url,t),e.request({method:"GET",data:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class Pn{constructor(e,t){this.url=e,this.options=t||{}}getFields(e,t){var r=this;new An(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){if(e instanceof Tn){var r=this,s=e.fieldName,i=e.statisticMode;i&&!Array.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 Ln(i.url,{eventListeners:{scope:i,processCompleted:i._processCompleted.bind(i),processFailed:i._statisticsCallback},datasource:e,dataset:t,field:r,statisticMode:s,crossOrigin:i.options.crossOrigin,headers:i.options.headers}).processAsync()}_processCompleted(e,t){var r=this,s=!0,i=e.result;for(var n in this.currentStatisticResult&&null==r.currentStatisticResult[i.mode]&&(this.currentStatisticResult[i.mode]=i.result),r.currentStatisticResult)if(null==r.currentStatisticResult[n]){s=!1;break}s&&r._statisticsCallback({result:r.currentStatisticResult,options:t})}}class On{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,m.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null}}class In extends ui{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&m.extend(this,t),this.eventCount=0,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,t){if(e instanceof On){m.extend(this,e);var r=this;r.url=m.urlPathAppend(r.url,`datasources/${r.dataSourceName}/datasets/${r.datasetName}`),r.queryRequest(r.getDatasetInfoCompleted.bind(r),r.getDatasetInfoFailed.bind(r),t)}}queryRequest(e,t,r){let s=++this.eventCount,i={scope:this,processCompleted:function(e){if(s===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(i),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&r)return r(e),this.events&&this.events.un(i),!1}};this.events.on(i);this.request({method:"GET",data:null,scope:this,success(t,i){t.eventId=s,e(t,i,r)},failure(e,r){e.error&&(e.error.eventId=s),e.eventId=s,t(e,r)}})}getDatasetInfoCompleted(e,t,r){e=m.transformResult(e),this.datasetType=e.datasetInfo.type,this.queryGridInfos(r)}queryGridInfos(e){var t=this;t.url=m.urlPathAppend(t.url,"GRID"==t.datasetType?"gridValue":"imageValue"),null!=t.X&&null!=t.Y&&(t.url=m.urlAppend(t.url,`x=${t.X}&y=${t.Y}`)),t.queryRequest(t.serviceProcessCompleted.bind(t),t.serviceProcessFailed.bind(t),e)}getDatasetInfoFailed(e,t){this.serviceProcessFailed(e,t)}}class Mn extends ui{constructor(e,t){(t=t||{}).EVENT_TYPES=["processCompleted","processFailed","processRunning"],super(e,t),this.CLASS_NAME="SuperMap.GeoprocessingService",this.headers={},this.crossOrigin=!0,this.eventCount=0}getTools(e){this._processAsync({url:`${this.url}/list`,callback:e})}getTool(e,t){this._processAsync({url:`${this.url}/${e}`,callback:t})}execute(e,t,r,s){const i={parameter:t=t||null,environment:r=r||null};this._processAsync({url:`${this.url}/${e}/execute`,executeParamter:i,callback:s})}submitJob(e,t,r,s){t=t||null,r=r||null;const i=JSON.stringify({parameter:t,environments:r});this._processAsync({url:`${this.url}/${e}/jobs`,method:"POST",callback:s,params:i})}waitForJobCompletion(e,t,r,s){const i=this,n=setInterval(function(){i._processAsync({url:`${i.url}/${t}/jobs/${e}`,serviceProcessCompleted:function(e,t){const r=e.state.runState;switch(t.statusCallback&&t.statusCallback(r),r){case"FINISHED":clearInterval(n),i.events.triggerEvent("processCompleted",{result:e,options:t});break;case"FAILED":case"CANCELED":clearInterval(n),i.events.triggerEvent("processFailed",{result:e,options:t})}},callback:s})},r.interval)}getJobInfo(e,t,r){this._processAsync({url:`${this.url}/${e}/jobs/${t}`,callback:r})}cancelJob(e,t,r){this._processAsync({url:`${this.url}/${e}/jobs/${t}/cancel`,callback:r})}getJobs(e,t){let r=`${this.url}/jobs`;e&&(r=`${this.url}/${e}/jobs`),this._processAsync({url:r,callback:t})}getResults(e,t,r,s){let i=`${this.url}/${e}/jobs/${t}/results`;r&&(i=`${i}/${r}`),this._processAsync({url:i,callback:s})}_processAsync({url:e,method:t,callback:r,paramter:s,serviceProcessCompleted:i,serviceProcessFailed:n}){let a=++this.eventCount,o={scope:this,processCompleted:function(e){if(a===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(o),!1},processFailed:function(e){if((a===e.error.eventId||a===e.eventId)&&r)return r(e),this.events&&this.events.un(o),!1}};this.events.on(o),this.request({url:e,method:t||"GET",params:s,headers:{"Content-type":"application/json"},scope:this,success(e,t){e.eventId=a,(i||this.serviceProcessCompleted.bind(this))(e,t)},failure(e,t){e.error&&(e.error.eventId=a),e.eventId=a,(n||this.serviceProcessFailed.bind(this))(e,t)}})}}class Nn{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){this.memoryData&&(this.memoryData.destroy(),this.memoryData=null),this.type=null}toServerJSONObject(){}}class Fn{constructor(e){this.align=$.BASELINECENTER,this.backColor=new k(255,255,255),this.foreColor=new k(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&&m.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 Fn(e);return m.copy(t,e),t.backColor=k.fromJson(e.backColor),t.foreColor=k.fromJson(e.foreColor),t}}class kn{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new Fn,e&&m.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 kn;return m.copy(t,e),t}}}class Dn{constructor(e){this.caption=null,this.style=new D,this.unique=null,this.visible=!0,e&&m.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=m.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new Dn;return m.copy(t,e),t.style=D.fromJson(e.style),t}}class Rn{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&m.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 Rn;return m.copy(t,e),t}}}class Bn{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new Fn,e&&m.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=m.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 $n;m.copy(t,e);var r=e.items,s=r?r.length:0;t.items=[];for(var i=0;i0?e[0].subLayers.layers:null)?r.length:0,this.handleLayers(s,r),this.events.triggerEvent("processCompleted",{result:e[0],options:t})}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 na).fromJson(t[s]),t[s]=r;break;case"GRID":(r=new oa).fromJson(t[s]),t[s]=r;break;case"IMAGE":(r=new la).fromJson(t[s]),t[s]=r;break;case"VECTOR":(r=new ha).fromJson(t[s]),t[s]=r}}}}class ca extends ui{constructor(e,t){super(e,t),t&&m.extend(this,t),this.CLASS_NAME="SuperMap.SetLayerInfoService"}destroy(){super.destroy(),m.reset(this)}processAsync(e){if(e){var t=m.toJSON(e);this.request({method:"PUT",data:t,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}}class da extends ui{constructor(e,t){super(e,t),this.resourceID=null,this.isTempLayers=!1,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.SetLayersInfoService"}destroy(){super.destroy(),m.reset(this)}processAsync(e){if(e){var t,r=[],s=this,i="";s.isTempLayers?(s.url=m.urlPathAppend(s.url,"tempLayersSet/"+s.resourceID),i="PUT"):(s.url=m.urlPathAppend(s.url,"tempLayersSet"),i="POST"),e.subLayers||(e.subLayers={layers:[]}),e.subLayers.layers||(e.subLayers.layers=[]);var n=e.subLayers.layers,a=n.length;for(let e in n){if("GRID"===n[e].ugcLayerType){var o={},l=n[e].colorDictionarys;for(var h in l){o[l[h].elevation]=l[h].color}}n[e].colorDictionary=o,delete n[e].colorDictionarys}for(let e=0;e0&&(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=m.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,t){null!=(e=m.transformResult(e))&&null!=this.lastparams&&(e.newResourceID=this.lastparams.resourceID),this.events.triggerEvent("processCompleted",{result:e,options:t})}}class ya{constructor(e,t){this.url=e,this.options=t||{}}getLayersInfo(e){var t=this;new ua(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=m.urlPathAppend(r.url,"tempLayersSet/"+s+"/"+i);new ca(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 da(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 fa(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 ma extends ui{constructor(e,t){super(e,t),this.projection=null,this.CLASS_NAME="SuperMap.MapService",t&&m.extend(this,t);var r=this;if(r.projection){var s=r.projection.split(":");s instanceof Array&&(2===s.length&&(r.url=m.urlAppend(r.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${s[1]}"}`)}`)),1===s.length&&(r.url=m.urlAppend(r.url,`prjCoordSys=${encodeURIComponent(`{"epsgCode":"${s[0]}"}`)}`)))}this.eventCount=0}destroy(){super.destroy();var e=this;e.events&&(e.events.un(e.eventListeners),e.events.listeners=null,e.events.destroy(),e.events=null,e.eventListeners=null)}processAsync(e){let t=++this.eventCount,r={scope:this,processCompleted:function(s){if(t===s.result.eventId&&e)return delete s.result.eventId,e(s),this.events&&this.events.un(r),!1},processFailed:function(s){if((t===s.error.eventId||t===s.eventId)&&e)return e(s),this.events&&this.events.un(r),!1}};this.events.on(r);this.request({method:"GET",scope:this,success(e,r){e.eventId=t,this.serviceProcessCompleted(e,r)},failure(e,r){e.error&&(e.error.eventId=t),e.eventId=t,this.serviceProcessFailed(e,r)}})}serviceProcessCompleted(e,t){var r=(e=m.transformResult(e)).code>=200&&e.code<300||0==e.code||304===e.code,s=e.code&&r;!e.code||s?this.events&&this.events.triggerEvent("processCompleted",{result:e,options:t}):this.events.triggerEvent("processFailed",{error:e,options:t})}}class ga extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(){if(this.url){var e=this;e.url=m.urlPathAppend(e.url,"tilesets"),e.request({method:"GET",scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}}class va{constructor(e,t){e&&(this.geometry=e,this.unit=z.METER,this.prjCoordSys=null,this.distanceMode=null,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.MeasureParameters")}destroy(){this.geometry=null,this.unit=null,this.prjCoordSys=null}}class ba extends ui{constructor(e,t){super(e,t),this.measureMode=H.DISTANCE,t&&m.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.MeasureService"}destroy(){super.destroy();this.measureMode=null}processAsync(e,t){if(!(e instanceof va))return;let r=++this.eventCount,s={scope:this,processCompleted:function(e){if(r===e.result.eventId&&t)return delete e.result.eventId,t(e),this.events&&this.events.un(s),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&t)return t(e),this.events&&this.events.un(s),!1}};this.events.on(s);var i,n,a=this,o=e.geometry;if(o){a.url=m.urlPathAppend(a.url,a.measureMode===H.AREA?"area":"distance");var l,h,u,c=Ce.fromGeometry(o);if(c)i=c.parts[0],n=c.points.splice(0,i),e.prjCoordSys?("object"==typeof e.prjCoordSys?l='{"epsgCode"'+(h=e.prjCoordSys.projCode).substring(h.indexOf(":"),h.length)+"}":"string"==typeof e.prjCoordSys&&(l='{"epsgCode"'+e.prjCoordSys.substring(e.prjCoordSys.indexOf(":"),e.prjCoordSys.length)+"}"),u={point2Ds:m.toJSON(n),unit:e.unit,prjCoordSys:l,distanceMode:e.distanceMode||"Geodesic"}):u={point2Ds:m.toJSON(n),unit:e.unit,distanceMode:e.distanceMode||"Geodesic"},a.request({method:"GET",params:u,scope:a,success(e,t){e.eventId=r,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=r),e.eventId=r,this.serviceProcessFailed(e,t)}})}}}class Sa extends ui{constructor(e,t){super(e,t),this.format=G.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e,t){var r;(e=m.transformResult(e))&&this.format===G.GEOJSON&&"function"==typeof this.toGeoJSONResult&&(r=this.toGeoJSONResult(e)),r||(r=e),this.events.triggerEvent("processCompleted",{result:r,options:t})}toGeoJSONResult(e){return null}}class xa{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,m.extend(this,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=null}}class _a extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e){if(!(e instanceof xa))return null;var t,r=this;if(r.url=m.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 wa{constructor(e){e&&(this.returnEdgeFeatures=!1,this.returnEdgeGeometry=!1,this.returnEdgeIDs=!1,this.returnNodeFeatures=!1,this.returnNodeGeometry=!1,this.returnNodeIDs=!1,this.returnPathGuides=!1,this.returnRoutes=!1,m.extend(this,e),this.CLASS_NAME="SuperMap.TransportationAnalystResultSetting")}destroy(){var e=this;e.returnEdgeFeatures=null,e.returnEdgeGeometry=null,e.returnEdgeIDs=null,e.returnNodeFeatures=null,e.returnNodeGeometry=null,e.returnNodeIDs=null,e.returnPathGuides=null,e.returnRoutes=null}}class Ca{constructor(e){e&&(this.barrierEdgeIDs=null,this.barrierNodeIDs=null,this.barrierPoints=null,this.weightFieldName=null,this.turnWeightField=null,this.resultSetting=new wa,m.extend(this,e),this.CLASS_NAME="SuperMap.TransportationAnalystParameter")}destroy(){var e=this;if(e.barrierEdgeIDs=null,e.barrierNodeIDs=null,e.weightFieldName=null,e.turnWeightField=null,e.resultSetting&&(e.resultSetting.destroy(),e.resultSetting=null),e.barrierPoints&&e.barrierPoints.length)for(var t in e.barrierPoints)e.barrierPoints[t].destroy();e.barrierPoints=null}}class Aa{constructor(e){this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ca,m.extend(this,e),this.CLASS_NAME="SuperMap.ComputeWeightMatrixParameters"}destroy(){var e=this;e.isAnalyzeById=null,e.nodes=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class Ea extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ComputeWeightMatrixService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Aa){var t,r=this;r.url=m.urlPathAppend(r.url,"weightmatrix"),t={parameter:m.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+="]"}}class Ta{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,this.queryType=null,m.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystStreamParameters"}destroy(){var e=this;e.edgeID=null,e.nodeID=null,e.weightName=null,e.isUncertainDirectionValid=null,e.type=null}}class La extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystStreamService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ta){var t,r=this;if(0===e.queryType)r.url=m.urlPathAppend(r.url,"upstreamcirticalfaclilities");else{if(1!==e.queryType)return;r.url=m.urlPathAppend(r.url,"downstreamcirticalfaclilities")}t={sourceNodeIDs:e.sourceNodeIDs,isUncertainDirectionValid:e.isUncertainDirectionValid},null!==e.edgeID&&null!==e.nodeID||null===e.edgeID&&null===e.nodeID||(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 Pa{constructor(e){this.event=null,this.expectFacilityCount=1,this.facilities=null,this.fromEvent=!1,this.isAnalyzeById=!1,this.maxWeight=0,this.parameter=new Ca,m.extend(this,e),this.CLASS_NAME="SuperMap.FindClosestFacilitiesParameters"}destroy(){var e=this;e.event=null,e.expectFacilityCount=null,e.facilities=null,e.fromEvent=null,e.isAnalyzeById=null,e.maxWeight=null,e.parameter&&(e.parameter.destroy(),e.parameter=null)}}class Oa extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindClosestFacilitiesService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Pa){var t,r=this;r.url=m.urlPathAppend(r.url,"closestfacility"),t={expectFacilityCount:e.expectFacilityCount,fromEvent:e.fromEvent,maxWeight:e.maxWeight,parameter:m.toJSON(e.parameter),event:m.toJSON(e.event),facilities:r.getJson(e.isAnalyzeById,e.facilities)},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.facilityPathList)return e;var t=new Ae;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 Ia{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,m.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+=m.toJSON(e[s]);return t+="]"}toGeoJSONResult(e){if(!e)return null;var t=new Ae;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class Na{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ca,m.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 Fa extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Na){var t,r=this,s=r.getJson(e.isAnalyzeById,e.centers),i=r.getJson(e.isAnalyzeById,e.nodes);r.url=m.urlPathAppend(r.url,"mtsppath"),t={centers:s,nodes:i,parameter:m.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 Ae;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 ka{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new Ca,m.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 Da extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof ka){var t,r=this;r.url=m.urlPathAppend(r.url,"path"),t={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:m.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 Ae;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 Ra{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new Ca,m.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 Ba extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ra){var t,r=this;r.url=m.urlPathAppend(r.url,"servicearea"),t={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:m.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 Ae;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 Ga{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ca,m.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 ja extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ga){var t,r=this;r.url=m.urlPathAppend(r.url,"tsppath"),t={parameter:m.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 Ae;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 Ua{constructor(e){e&&(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",m.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 Ja extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ua){var t=this,r=t.parse(e);t.url=m.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 Va{constructor(e){e&&(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",m.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 Ha extends Sa{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Va){var t=this,r=t.parse(e);t.url=m.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 za{constructor(e,t){this.url=e,this.options=t||{}}burstPipelineAnalyst(e,t){var r=this;new _a(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)}computeWeightMatrix(e,t){var r=this;new Ea(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)}findClosestFacilities(e,t,r){var s=this;new Oa(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)}streamFacilityAnalyst(e,t,r){var s=this;new La(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)}findLocation(e,t,r){var s=this;new Ma(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)}findPath(e,t,r){var s=this;new Da(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)}findTSPPaths(e,t,r){var s=this;new ja(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)}findMTSPPaths(e,t,r){var s=this;new Fa(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)}findServiceAreas(e,t,r){var s=this;new Ba(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)}updateEdgeWeight(e,t){var r=this;new Ja(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 Ha(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)}_processFormat(e){return e||G.GEOJSON}}class Wa{constructor(e){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=!1,m.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalyst3DParameters"}destroy(){this.edgeID=null,this.nodeID=null,this.weightName=null,this.isUncertainDirectionValid=null}}class qa extends Wa{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DParameters"}destroy(){super.destroy()}}class Ya extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSinks3DService"}destroy(){ui.prototype.destroy.apply(this,arguments)}processAsync(e){if(e instanceof qa){var t,r=this;r.url=m.urlPathAppend(r.url,"sinks"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class Xa extends Wa{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DParameters"}destroy(){super.destroy()}}class Qa extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystSources3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Xa){var t,r=this;r.url=m.urlPathAppend(r.url,"sources"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class Za extends Wa{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DParameters"}destroy(){super.destroy()}}class Ka extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTraceup3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Za){var t,r=this;r.url=m.urlPathAppend(r.url,"traceupresult"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class $a extends Wa{constructor(e){super(e),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DParameters"}destroy(){super.destroy()}}class eo extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystTracedown3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof $a){var t,r=this;r.url=m.urlPathAppend(r.url,"tracedownresult"),t={edgeID:e.edgeID,nodeID:e.nodeID,weightName:e.weightName,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class to extends Wa{constructor(e){super(e),e=e||{},this.sourceNodeIDs=null,m.extend(this,e),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DParameters"}destroy(){super.destroy(),this.sourceNodeIDs=null}}class ro extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FacilityAnalystUpstream3DService"}destroy(){super.destroy()}processAsync(e){if(e instanceof to){var t,r=this;r.url=m.urlPathAppend(r.url,"upstreamcirticalfaclilities"),t={sourceNodeIDs:e.sourceNodeIDs,edgeID:e.edgeID,nodeID:e.nodeID,isUncertainDirectionValid:e.isUncertainDirectionValid},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class so{constructor(e,t){this.url=e,this.options=t||{}}sinksFacilityAnalyst(e,t){var r=this;new Ya(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 Qa(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 Ka(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 eo(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 ro(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 io extends ui{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;mr.get(hi.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};mr.post(hi.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=m.transformResult(e),t=t||1e3;var r=this;if(e)var s=setInterval(function(){mr.get(hi.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 no{constructor(e){this.alias=null,this.connect=null,this.dataBase=null,this.driver=null,this.engineType=null,this.exclusive=null,this.OpenLinkTable=null,this.password=null,this.readOnly=null,this.server=null,this.user=null,e&&m.extend(this,e),this.CLASS_NAME="SuperMap.DatasourceConnectionInfo"}destroy(){var e=this;e.alias=null,e.connect=null,e.dataBase=null,e.driver=null,e.engineType=null,e.exclusive=null,e.OpenLinkTable=null,e.password=null,e.readOnly=null,e.server=null,e.user=null}}class ao{constructor(e){this.type=ne.UDB,this.datasetName="analystResult",this.datasourceInfo=null,this.outputPath="",m.extend(this,e),this.CLASS_NAME="SuperMap.OutputSetting"}destroy(){var e=this;e.type=null,e.datasetName=null,e.outputPath=null,e.datasourceInfo instanceof no&&(e.datasourceInfo.destroy(),e.datasourceInfo=null)}}class oo{constructor(e){this.items=null,this.numericPrecision=1,this.rangeMode=Z.EQUALINTERVAL,this.rangeCount="",this.colorGradientType=K.YELLOW_RED,m.extend(this,e),this.CLASS_NAME="SuperMap.MappingParameters"}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.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}class lo{constructor(e){e&&(this.datasetName="",this.query="",this.resolution=80,this.method=0,this.meshType=0,this.fields="",this.radius=300,this.meshSizeUnit=ge.METER,this.radiusUnit=ge.METER,this.areaUnit=me.SQUAREMILE,this.output=null,this.mappingParameters=null,m.extend(this,e),this.CLASS_NAME="SuperMap.KernelDensityJobParameter")}destroy(){this.datasetName=null,this.query=null,this.resolution=null,this.method=null,this.radius=null,this.meshType=null,this.fields=null,this.meshSizeUnit=null,this.radiusUnit=null,this.areaUnit=null,this.output instanceof ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var r in e)"datasetName"!==r?"output"!==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.input=t.input||{},t.input[r]=e[r])}}class ho extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/density"),this.CLASS_NAME="SuperMap.KernelDensityJobsService"}destroy(){super.destroy()}getKernelDensityJobs(){super.getJobs(this.url)}getKernelDensityJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addKernelDensityJob(e,t){super.addJob(this.url,e,lo,t)}}class uo{constructor(e){e&&(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=V.CONTAIN,this.output=null,this.mappingParameters=null,m.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 co extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(){super.getJobs(this.url)}getQueryJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addQueryJob(e,t){super.addJob(this.url,e,uo,t)}}class po{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=ve.AVERAGE,this.fields="",this.type=be.SUMMARYMESH,this.output=null,this.mappingParameters=null,m.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 ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 fo extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(){super.getJobs(this.url)}getSummaryMeshJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addSummaryMeshJob(e,t){super.addJob(this.url,e,po,t)}}class yo{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=ye.CLIP,this.output=null,this.mappingParameters=null,m.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 mo extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(){super.getJobs(this.url)}getVectorClipJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addVectorClipJob(e,t){super.addJob(this.url,e,yo,t)}}class go{constructor(e){e&&(this.datasetName="",this.datasetOverlay="",this.mode="",this.srcFields="",this.overlayFields="",this.output=null,this.mappingParameters=null,m.extend(this,e),this.CLASS_NAME="SuperMap.OverlayGeoJobParameter")}destroy(){this.datasetName=null,this.datasetOverlay=null,this.mode=null,this.srcFields=null,this.overlayFields=null,this.output instanceof ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 vo extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/overlay"),this.CLASS_NAME="SuperMap.OverlayGeoJobsService"}destroy(){super.destroy()}getOverlayGeoJobs(){super.getJobs(this.url)}getOverlayGeoJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addOverlayGeoJob(e,t){super.addJob(this.url,e,go,t)}}class bo{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=ge.METER,this.type=be.SUMMARYMESH,this.output=null,this.mappingParameters=null,m.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 ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 So extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(){super.getJobs(this.url)}getSummaryRegionJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addSummaryRegionJob(e,t){super.addJob(this.url,e,bo,t)}}class xo{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=ge.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;m.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 ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 _o extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(){super.getJobs(this.url)}getBuffersJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addBuffersJob(e,t){super.addJob(this.url,e,xo,t)}}class wo{constructor(e){e&&(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=Se.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,m.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 Co extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(){super.getJobs(this.url)}getTopologyValidatorJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addTopologyValidatorJob(e,t){super.addJob(this.url,e,wo,t)}}class Ao{constructor(e){e&&(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,m.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof ao&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof oo&&(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 Eo extends io{constructor(e,t){super(e,t),this.url=m.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(){super.getJobs(this.url)}getSummaryAttributesJob(e){super.getJobs(m.urlPathAppend(this.url,e))}addSummaryAttributesJob(e,t){super.addJob(this.url,e,Ao,t)}}class To{constructor(e,t){this.url=e,this.options=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 ho(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 ho(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._processFormat(s);new ho(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.kernelDensityJobs[e.id]=e.state}},format:n}).addKernelDensityJob(e,r)}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var r=this,s=r._processFormat(t);new fo(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 fo(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}).getSummaryMeshJob(e)}addSummaryMeshJob(e,t,r,s){var i=this,n=i._processFormat(s);new fo(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.summaryMeshJobs[e.id]=e.state}},format:n}).addSummaryMeshJob(e,r)}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var r=this,s=r._processFormat(t);new co(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 co(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._processFormat(s);new co(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.queryJobs[e.id]=e.state}},format:n}).addQueryJob(e,r)}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var r=this,s=r._processFormat(t);new So(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 So(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._processFormat(s);new So(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.summaryRegionJobs[e.id]=e.state}},format:n}).addSummaryRegionJob(e,r)}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var r=this,s=r._processFormat(t);new mo(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 mo(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._processFormat(s);new mo(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:n}).addVectorClipJob(e,r)}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var r=this,s=r._processFormat(t);new vo(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 vo(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._processFormat(s);new vo(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:n}).addOverlayGeoJob(e,r)}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var r=this,s=r._processFormat(t);new _o(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 _o(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._processFormat(s);new _o(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:n}).addBuffersJob(e,r)}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var r=this,s=r._processFormat(t);new Co(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 Co(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._processFormat(s);new Co(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:n}).addTopologyValidatorJob(e,r)}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var r=this,s=r._processFormat(t);new Eo(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 Eo(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._processFormat(s);new Eo(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:n}).addSummaryAttributesJob(e,r)}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||G.GEOJSON}}class Lo extends ui{constructor(e,t){super(e,t),this.returnContent=!1,this.format=G.GEOJSON,this.returnFeatureWithFieldCaption=!1,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.QueryService",this.url&&(t&&t.format&&(this.format=t.format.toUpperCase()),this.url=m.urlPathAppend(this.url,"queryResults"))}destroy(){super.destroy();this.returnContent=null,this.format=null}processAsync(e){if(e instanceof Qi){var t,r=this,s=null;r.returnContent=e.returnContent,t=r.getJsonParameters(e),r.returnContent||(s=e.returnCustomResult)&&(r.url=m.urlAppend(r.url,"returnCustomResult="+s)),r.returnFeatureWithFieldCaption=e.returnFeatureWithFieldCaption,r.request({method:"POST",data:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}serviceProcessCompleted(e,t){e=m.transformResult(e);var r=new Ae;if(e&&e.recordsets)for(var s=0,i=e.recordsets,n=i.length;s(e.fieldNames=i[s].fieldCaptions,e)),this.format===G.GEOJSON&&(i[s].features=r.toGeoJSON(i[s].features)));this.events.triggerEvent("processCompleted",{result:e,options:t})}dataFormat(){return[G.GEOJSON,G.ISERVER,G.FGB]}getQueryParameters(e){return new Qi({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 Po extends Qi{constructor(e){super(e=e||{}),this.returnContent=!0,this.bounds=null,m.extend(this,e),this.CLASS_NAME="SuperMap.QueryByBoundsParameters"}destroy(){super.destroy();this.returnContent=null,this.bounds&&(this.bounds=null)}}class Oo extends Lo{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof Po))return null;var t,r="",s=e.bounds;return t=this.getQueryParameters(e),r+="'queryMode':'BoundsQuery','queryParameters':",r+=m.toJSON(t),r="{"+(r+=",'bounds': {'rightTop':{'y':"+s.top+",'x':"+s.right+"},'leftBottom':{'y':"+s.bottom+",'x':"+s.left+"}}")+"}"}}class Io extends Qi{constructor(e){super(e=e||{}),this.geometry=null,this.isNearest=null,this.returnContent=!0,m.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 Mo extends Lo{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Io){var t="",r=this.getQueryParameters(e),s=Ce.fromGeometry(e.geometry);return t+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",t+=m.toJSON(r),t="{"+(t+=",'geometry':"+m.toJSON(s)+",'distance':"+e.distance)+"}"}}}class No extends Qi{constructor(e){super(e=e||{}),this.returnContent=!0,m.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();this.returnContent=null}}class Fo extends Lo{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof No){var t,r="";return t=this.getQueryParameters(e),r+="'queryMode':'SqlQuery','queryParameters':",r="{"+(r+=m.toJSON(t))+"}"}}}class ko extends Qi{constructor(e){super(e=e||{}),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=V.INTERSECT,m.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();this.returnContent=null,this.geometry=null,this.spatialQueryMode=null}}class Do extends Lo{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof ko){var t,r="",s=e.geometry,i=Ce.fromGeometry(s);return t=this.getQueryParameters(e),r+="'queryMode':'SpatialQuery','queryParameters':",r="{"+(r+=m.toJSON(t)+",'geometry':"+m.toJSON(i)+",'spatialQueryMode':"+m.toJSON(e.spatialQueryMode))+"}"}}}class Ro{constructor(e,t){this.options=t||{},this.url=e}queryByBounds(e,t,r){var s=this;new Oo(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)}queryByDistance(e,t,r){var s=this;new Mo(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:r}).processAsync(e)}queryBySQL(e,t,r){var s=this;new Fo(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:r}).processAsync(e)}queryByGeometry(e,t,r){var s=this;new Do(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:r}).processAsync(e)}_processFormat(e){return e||G.GEOJSON}}class Bo extends li{constructor(e,t){super(e,t),this._queryService=new Ro(e,t)}queryByBounds(e,t,r){e=this._processParams(e),this._queryService.queryByBounds(e,t,r)}queryByDistance(e,t,r){e=this._processParams(e),this._queryService.queryByDistance(e,t,r)}queryBySQL(e,t,r){e=this._processParams(e),this._queryService.queryBySQL(e,t,r)}queryByGeometry(e,t,r){e=this._processParams(e),this._queryService.queryByGeometry(e,t,r)}_processParams(e){return e?(e.returnContent=null==e.returnContent||e.returnContent,e.queryParams&&!Le.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds instanceof Array&&(e.bounds=new S(e.bounds[0],e.bounds[1],e.bounds[2],e.bounds[3])),e.bounds instanceof t().LngLatBounds&&(e.bounds=new S(e.bounds.getSouthWest().lng,e.bounds.getSouthWest().lat,e.bounds.getNorthEast().lng,e.bounds.getNorthEast().lat))),e.geometry&&(e.geometry instanceof t().LngLat&&(e.geometry=new x(e.geometry.lng,e.geometry.lat)),e.geometry instanceof t().Point&&(e.geometry=new x(e.geometry.x,e.geometry.y)),e.geometry instanceof t().LngLatBounds&&(e.geometry=Le.toSuperMapPolygon(e.geometry)),e.geometry instanceof d||(e.geometry=Le.toSuperMapGeometry(e.geometry))),e):{}}}class Go extends ui{constructor(e,t){super(e,t),this.format=t.format||G.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e,t){var r,s=this;if((e=m.transformResult(e))&&s.format===G.GEOJSON&&"function"==typeof s.toGeoJSONResult)if(m.isArray(e)){for(var 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=Ce.fromGeometry(e.clipRegion):t[r]=e[r]}}class Tl extends Go{constructor(e,t){super(e,t),this.mode=null,t&&m.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t={},r=this;e instanceof Al?(r.mode="datasets",r.url=m.urlPathAppend(r.url,"datasets/"+e.dataset+"/thiessenpolygon"),Al.toObject(e,t)):e instanceof El&&(r.mode="geometry",r.url=m.urlPathAppend(r.url,"geometry/thiessenpolygon"),El.toObject(e,t));var s=m.toJSON(t);this.returnContent=!0,r.request({method:"POST",data:s,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}dataFormat(){return[G.GEOJSON,G.ISERVER,G.FGB]}}class Ll extends Go{constructor(e,t){super(e,t),t&&m.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e){var t=this;t.url=m.urlPathAppend(t.url,"geometry/batchanalyst"),t.url=m.urlAppend(t.url,"returnContent=true&ignoreAnalystParam=true");var r=t._processParams(e),s=m.toJSON(r);t.request({method:"POST",data:s,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}_processParams(e){var t=this;if(m.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={},qo.toObject(e.param,t.param);else if("overlay"===e.analystName)t.analystName="overlay",t.param={},dl.toObject(e.param,t.param);else if("interpolationDensity"===e.analystName)t.analystName="interpolationDensity",t.param={},tl.toObject(e.param,t.param);else if("interpolationidw"===e.analystName)t.analystName="interpolationidw",t.param={},tl.toObject(e.param,t.param);else if("interpolationRBF"===e.analystName)t.analystName="interpolationRBF",t.param={},tl.toObject(e.param,t.param);else if("interpolationKriging"===e.analystName)t.analystName="interpolationKriging",t.param={},tl.toObject(e.param,t.param);else{if("thiessenpolygon"!==e.analystName)return e;t.analystName="thiessenpolygon",t.param={},El.toObject(e.param,t.param)}return t}destroy(){super.destroy()}}class Pl{constructor(e,t){this.url=e,this.options=t||{}}getAreaSolarRadiationResult(e,t,r){var s=this;new Uo(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 Yo(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)}densityAnalysis(e,t,r){var s=this;new Qo(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)}generateSpatialData(e,t,r){var s=this;new Ko(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 el(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 ol(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)}mathExpressionAnalysis(e,t,r){var s=this;new hl(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)}overlayAnalysis(e,t,r){var s=this;new pl(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)}routeCalculateMeasure(e,t,r){var s=this;new yl(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)}routeLocate(e,t,r){var s=this;new gl(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)}surfaceAnalysis(e,t,r){var s=this;new _l(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)}terrainCurvatureCalculate(e,t,r){var s=this;new Cl(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 Tl(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)}geometrybatchAnalysis(e,t,r){for(var s=new Ll(this.url,{eventListeners:{scope:this,processCompleted:t,processFailed:t},format:this._processFormat(r)}),i=[],n=0;n0&&(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':"+m.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[a]&&(r+="'joinItems':["+m.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 Ml{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,m.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){m.reset(this)}}class Nl extends ui{constructor(e,t){super(e,t),t=t||{},m.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),m.reset(this)}processAsync(e){if(e instanceof Ml){var t=this;t.url=m.urlPathAppend(t.url,"stops/keyword/"+e.keyWord),t.request({method:"GET",params:{returnPosition:e.returnPosition},scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class Fl{constructor(e){e=e||{},this.transferLines=null,this.points=null,m.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){m.reset(this)}static toJson(e){if(e)return m.toJSON(e)}}class kl extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Fl){var t,r=this;r.url=m.urlPathAppend(r.url,"path"),t={points:m.toJSON(e.points),transferLines:m.toJSON(e.transferLines)},r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class Dl{constructor(e){e=e||{},this.solutionCount=6,this.transferPreference=ce.NONE,this.transferTactic=ue.LESS_TIME,this.walkingRatio=null,this.points=!1,this.evadeLines=null,this.evadeStops=null,this.priorLines=null,this.priorStops=null,this.travelTime=null,m.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){m.reset(this)}static toJson(e){if(e)return m.toJSON(e)}}class Rl extends ui{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Dl){var t,r=this;r.url=m.urlPathAppend(r.url,"solutions"),t={points:m.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(t.evadeLines=m.toJSON(e.evadeLines)),e.evadeStops&&(t.evadeStops=m.toJSON(e.evadeStops)),e.priorLines&&(t.priorLines=m.toJSON(e.priorLines)),e.priorStops&&(t.priorStops=m.toJSON(e.priorStops)),e.travelTime&&(t.travelTime=e.travelTime),r.request({method:"GET",params:t,scope:r,success:r.serviceProcessCompleted,failure:r.serviceProcessFailed})}}}class Bl{constructor(e,t){this.url=e,this.options=t||{}}queryStop(e,t){var r=this;new Nl(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)}analysisTransferPath(e,t){var r=this;new kl(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)}analysisTransferSolution(e,t){var r=this;new Rl(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 Gl extends ui{constructor(e,t){super(e,t),t&&m.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.WebPrintingService",this.url}destroy(){super.destroy()}createWebPrintingJob(e,t){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,/,""))),this.processAsync("jobs","POST",t,e))}getPrintingJob(e,t){var r=this;r.processAsync(`jobs/${e}`,"GET",function(s){r.rollingProcess(s,r._processUrl(`jobs/${e}`),t)})}getPrintingJobResult(e,t){this.processAsync(`jobs/${e}/result`,"GET",t)}getLayoutTemplates(e){this.processAsync("layouts","GET",e)}rollingProcess(e,t,r){var s=this;if(e)var i=setInterval(function(){let e=++s.eventCount,n={scope:this,processCompleted:function(t){if(e===t.result.eventId&&r)return delete t.result.eventId,r(t),s.events.un(n),!1},processFailed:function(t){if((e===t.error.eventId||e===t.eventId)&&r)return r(t),s.events.un(n),!1}};s.events.on(n),s.request({url:t,method:"GET",scope:s,success:function(t,r){switch(t.eventId=e,t.status){case"FINISHED":clearInterval(i),s.serviceProcessCompleted(t,r);break;case"ERROR":clearInterval(i),s.serviceProcessFailed(t,r);break;case"RUNNING":s.events.triggerEvent("processRunning",t)}},failure:s.serviceProcessFailed})},1e3)}processAsync(e,t,r,s){let i=++this.eventCount,n={scope:this,processCompleted:function(e){if(i===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(n),!1},processFailed:function(e){if(i===e.error.eventId||i===e.eventId)return r(e),this.events&&this.events.un(n),!1}};this.events.on(n);let a={url:this._processUrl(e),method:t,scope:this,success(e,t){e.eventId=i,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=i),e.eventId=i,this.serviceProcessFailed(e,t)}};s&&(a.data=m.toJSON(s)),this.request(a)}_processUrl(e){return e?m.urlPathAppend(this.url,e):this.url}}class jl extends ui{constructor(e,t){super(e,t),this.options=t||{},t&&m.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(e){var t=m.convertPath("/collections"),r=m.urlPathAppend(this.url,t);this._processAsync({url:r,mehtod:"GET",callback:e})}getCollectionByID(e,t){var r={collectionId:e},s=m.convertPath("/collections/{collectionId}",r),i=m.urlPathAppend(this.url,s);this._processAsync({url:i,mehtod:"GET",callback:t})}search(e,t){var r={...e||{}},s=m.convertPath("/search"),i=m.urlPathAppend(this.url,s);this._processAsync({url:i,method:"POST",data:r,callback:t})}_processAsync({url:e,method:t,callback:r,data:s}){let i=++this.eventCount,n=this,a={scope:this,processCompleted:function(e){if(i===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(a),!1},processFailed:function(e){if((i===e.error.eventId||i===e.eventId)&&r)return r(e),this.events&&this.events.un(a),!1}};this.events.on(a),this.request({method:t||"GET",url:e,data:s,scope:this,success(e,t){e.eventId=i,n.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=i),e.eventId=i,n.serviceProcessFailed(e,t)}})}}class Ul extends ui{constructor(e,t){super(e,t),this.options=t||{},t&&m.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e,t){var r={collectionId:this.options.collectionId},s=m.convertPath("/collections/{collectionId}/legend",r),i=m.urlPathAppend(this.url,s);this._processAsync({url:i,method:"GET",params:e,callback:t})}getStatistics(e){var t={collectionId:this.options.collectionId},r=m.convertPath("/collections/{collectionId}/statistics",t),s=m.urlPathAppend(this.url,r);this._processAsync({url:s,method:"GET",callback:e})}getTileInfo(e){var t={collectionId:this.options.collectionId},r=m.convertPath("/collections/{collectionId}/tileInfo",t),s=m.urlPathAppend(this.url,r);this._processAsync({url:s,method:"GET",callback:e})}deleteItemByID(e,t){var r={collectionId:this.options.collectionId,featureId:e},s=m.convertPath("/collections/{collectionId}/items/{featureId}",r),i=m.urlPathAppend(this.url,s);this._processAsync({url:i,method:"DELETE",callback:t})}getItemByID(e,t){var r={collectionId:this.options.collectionId,featureId:e},s=m.convertPath("/collections/{collectionId}/items/{featureId}",r),i=m.urlPathAppend(this.url,s);this._processAsync({url:i,method:"GET",callback:t})}_processAsync({url:e,method:t,callback:r,params:s}){let i=++this.eventCount,n={scope:this,processCompleted:function(e){if(i===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((i===e.error.eventId||i===e.eventId)&&r)return r(e),this.events&&this.events.un(n),!1}};this.events.on(n),this.request({method:t||"GET",url:e,params:s,scope:this,success(e,t){e.eventId=i,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=i),e.eventId=i,this.serviceProcessFailed(e,t)}})}}var Jl=window.SuperMap=window.SuperMap||{};Jl.Components=window.SuperMap.Components||{};class Vl{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 We(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(){}}class Hl{constructor(e,t){if(e){var r=e.substr(e.length-1,1);this.serviceUrl="/"===r?e.substr(0,e.length-2):e}this.options=t||{},this.CLASS_NAME="SuperMap.iManagerServiceBase"}request(e,t,r,s){(s=s||{headers:{Accept:"*/*","Content-Type":"application/json"}}).hasOwnProperty("withCredentials")||(s.withCredentials=!0),s.crossOrigin=this.options.crossOrigin,s.headers=this.options.headers;var i=hi.imanagerToken;return i&&(s.headers||(s.headers=[]),s.headers["X-Auth-Token"]=i),r&&(r=JSON.stringify(r)),mr.commit(e,t,r,s).then(function(e){return e.json()})}}class zl{constructor(e){e=e||{},this.nodeSpec="SMALL",this.nodeCount=1,this.nodeName="",this.password="",this.description="",this.physicalMachineName="",this.ips=[],this.userName="",m.extend(this,e)}}class Wl{constructor(e,t){t=t||{},this.serviceUrl=e,this.CLASS_NAME="SuperMap.iPortalServiceBase",this.withCredentials=t.withCredentials||!1,this.crossOrigin=t.crossOrigin,this.headers=t.headers}request(e,t,r,s={headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials}){return t=hi.appendCredential(t),mr.commit(e,t,r,s).then(function(e){return e.json()})}}class ql{constructor(e){e=e||{},this.resourceType="",this.pageSize=12,this.currentPage=1,this.orderBy="UPDATETIME",this.orderType="DESC",this.searchType="PUBLIC",this.tags=[],this.dirIds=[],this.resourceSubTypes=[],this.aggregationTypes=[],this.text="",this.groupIds=[],this.departmentIds=[],m.extend(this,e)}}class Yl{constructor(e){e=e||{},this.content=[],this.total=0,this.currentPage=1,this.pageSize=12,this.aggregations=null,m.extend(this,e)}}class Xl extends Wl{constructor(e,t){super(e),t=t||{},this.authorizeSetting=[],this.bounds="",this.bounds4326="",this.checkStatus="",this.createTime=0,this.description=null,this.dirId=null,this.epsgCode=0,this.heatLevel=0,this.id=0,this.name="",this.personalDirId=null,this.resourceId=0,this.resourceSubType=null,this.resourceType=null,this.serviceRootUrlId=null,this.tags=null,this.thumbnail=null,this.updateTime=0,this.userName="",this.sourceJSON={},m.extend(this,t),this.resourceUrl=e+"/web/"+this.resourceType.replace("_","").toLowerCase()+"s/"+this.resourceId,this.withCredentials&&(this.resourceUrl=e+"/web/mycontent/"+this.resourceType.replace("_","").toLowerCase()+"s/"+this.resourceId)}load(){var e=this;return e.request("GET",e.resourceUrl+".json").then(function(t){if(t.error)return t;e.sourceJSON=t})}update(){var e=this.resourceType.replace("_","").toLowerCase();"data"===e&&(this.resourceUrl=this.resourceUrl+"/attributes.json");var t=JSON.stringify(this.sourceJSON);if("service"===e){var r={authorizeSetting:this.sourceJSON.authorizeSetting,metadata:this.sourceJSON.metadata,tags:this.sourceJSON.tags,thumbnail:this.sourceJSON.thumbnail,tokenRefreshUrl:this.sourceJSON.tokenRefreshUrl};t=JSON.stringify(r)}return this.request("PUT",this.resourceUrl,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})}}class Ql{constructor(e){e=e||{},this.ids=[],this.entities=[],this.resourceType="",m.extend(this,e)}}class Zl{constructor(e){e=e||{},this.rootUrl="",this.tags=[],this.entities=[],m.extend(this,e)}}class Kl{constructor(e){e=e||{},this.type="",this.tags=[],this.entities=[],this.metadata={},this.addedMapNames=[],this.addedSceneNames=[],m.extend(this,e)}}class $l{constructor(e){e=e||{},this.fileName="",this.type="",this.tags=[],this.dataMetaInfo={},m.extend(this,e)}}class eh{constructor(e){e=e||{},this.xField="",this.yField="",this.fileEncoding="UTF-8",this.xIndex=1,this.yIndex=1,this.fieldTypes=[],this.separator="",this.firstRowIsHead=!0,this.url="",this.dataStoreInfo={},m.extend(this,e)}}class th{constructor(e){e=e||{},this.type="",this.url="",this.connectionInfo={},m.extend(this,e)}}class rh{constructor(e){e=e||{},this.dataBase="",this.server="",m.extend(this,e)}}class sh{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",m.extend(this,e)}destroy(){this.aggName=null,this.aggFieldName=null,this.aggType=null}}class ih extends sh{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",m.extend(this,e)}destroy(){this.subAggs&&(this.subAggs=null)}}class nh{constructor(){this.CLASS_NAME="LabelMatrixCell"}}class ah{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&m.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 ah({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class oh{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new D,e&&m.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 oh;return m.copy(t,e),t.leaderLineStyle=D.fromJson(e.leaderLineStyle),t}}}class lh{constructor(e){this.caption=null,this.color=new k,this.end=0,this.start=0,this.visible=!0,e&&m.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=m.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(e){var t=new lh;return m.copy(t,e),t.color=k.fromJson(e.color),t}}}class hh extends Nn{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=Z.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=K.YELLOW_RED,this.reverseColor=!1,e&&m.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 hh;m.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=m.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,s=0;sEh.constructFromObject&&Eh.constructFromObject(e,{})||e)))),t}}class Lh{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",m.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 Lh,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}}Lh.StretchType={NONE:"NONE",GAUSSIAN:"GAUSSIAN",PERCENTCLIP:"PERCENTCLIP",MINIMUMMAXIMUM:"MINIMUMMAXIMUM",STANDARDDEVIATION:"STANDARDDEVIATION"};class Ph{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",m.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 Ph,e.hasOwnProperty("displayMode")&&(t.displayMode=e.displayMode),e.hasOwnProperty("displayBands")&&(t.displayBands=e.displayBands),e.hasOwnProperty("stretchOption")&&(t.stretchOption=Lh.constructFromObject&&Lh.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}}Ph.DisplayMode={COMPOSITE:"COMPOSITE",STRETCHED:"Stretched"},Ph.InterpolationMode={NEARESTNEIGHBOR:"NEARESTNEIGHBOR",HIGHQUALITYBILINEAR:"HIGHQUALITYBILINEAR",DEFAULT:"DEFAULT"};class Oh{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",m.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 Oh,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 Ih{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",m.extend(this,e)}destroy(){this.girdFuncName="GFAspect",this.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new Ih,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class Mh{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",m.extend(this,e)}destroy(){this.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new Mh,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class Nh{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",m.extend(this,e)}destroy(){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new Nh,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class Fh{constructor(e){e=e||{},m.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,r,s={}){return t=hi.appendCredential(t),s.crossOrigin=this.options.crossOrigin,s.headers=this.options.headers,mr.commit(e,t,r,s).then(function(e){return e.json()})}}class kh extends Fh{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,m.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){m.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}const Dh=function(){try{return elasticsearch}catch(e){return{}}}();var Rh=r.n(Dh);var Bh=new De;class Gh{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 Uh=r(52),Jh=r.n(Uh);class Vh{constructor(e){this.env=null,this.parser=null,this.ruleSet=null,this.cartoStr="",this.shaders=null,"string"==typeof e&&(this.cartoStr=e,this.env={frames:[],errors:[],error:function(e){this.errors.push(e)}},this.parser=this.getParser(this.env),this.parse(e),this.shaders=this.toShaders())}getParser(e){var t,r,s,i,n,a,o,l,h,u=this;function c(){i=o[s],n=r,l=r}function d(){o[s]=i,l=r=n}function p(){r>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 y(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 Vh.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"+y(t).message:e.errors.message=y(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 Vh.Tree.Invalid(e,n)},comment:function(){var e;if("/"===t.charAt(r))return"/"===t.charAt(r+1)?new Vh.Tree.Comment(f(/^\/\/.*/),!0):(e=f(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new Vh.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 Vh.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(f("[")){var e=f(/(^[^\]]+)/);if(f("]"))return e?new Vh.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 Vh.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 Vh.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 Vh.Tree.URL(void 0!==e.value||e instanceof Vh.Tree.Variable?e:new Vh.Tree.Quoted(e)):new Vh.Tree.Invalid(e,n,"Missing closing ) in URL.")}},variable:function(){var s,i=r;if("@"===t.charAt(r)&&(s=f(/^@[\w-]+/)))return new Vh.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 Vh.Tree.Color(e[1])},keywordcolor:function(){var e=o[s].match(/^[a-z]+/);if(e&&e[0]in Vh.Tree.Reference.data.colors)return new Vh.Tree.Color(Vh.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 Vh.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 Vh.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 Vh.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 y({message:p,index:r-1});d++}else{if(s)throw y({message:"Encountered second attachment name.",index:r-1});s=e}var m=t.charAt(r);if("{"===m||"}"===m||";"===m||","===m)break}if(c)return new Vh.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 Vh.Tree.Quoted&&(t=new Vh.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 y({message:"Missing closing ] of filter.",index:n-1});return t.is||(t=new Vh.Tree.Field(t)),new Vh.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 Vh.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 Vh.Tree.Ruleset(r,t);return s.isMap=!0,s}return new Vh.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 Vh.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 Vh.Tree.Expression(r)),f(","))for(;(e=f(this.expression))&&(t.push(e),f(",")););return new Vh.Tree.Value(t)},value:function(){for(var e,t=[];(e=f(this.expression))&&(t.push(e),f(",")););return t.length>1?new Vh.Tree.Value(t.map(function(e){return e.value[0]})):1===t.length?new Vh.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 Vh.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 Vh.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 Vh.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"]}};Vh.mapnik_reference={version:{latest:Hh,"2.1.1":Hh}},Vh.Tree={},Vh.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}},Vh.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 Vh.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 Vh.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new Vh.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new Vh.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new Vh.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 Vh.Tree.Color(l,h)},greyscale:function(e){return this.desaturate(e,new Vh.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 Vh.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 Vh.Tree.Dimension(Vh.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new Vh.Tree.Dimension(Vh.Tree.operate(t,this.value,r.value),this.unit||r.unit)}},Vh.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}},Vh.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new Vh.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(" ")}},Vh.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}},Vh.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+"]"}},Vh.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 Vh.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 Vh.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}}},Vh.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}},Vh.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"}}},Vh.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}},Vh.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}},Vh.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 Vh.Tree.Dimension&&s instanceof Vh.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 Vh.Tree.Quoted&&s instanceof Vh.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 Vh.Tree.Field||s instanceof Vh.Tree.Field||r instanceof Vh.Tree.Literal||s instanceof Vh.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 Vh.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))}},Vh.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 Vh.Tree.Quoted(Vh.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}},Vh.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 Vh.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(s);break}}),this._lookups[s]=r)}evZooms(e){for(var t=0;tVh.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+Vh.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<=Vh.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<=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 S(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 Wh extends zh{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)}}const qh="EXCEL",Yh="CSV",Xh="GEOJSON",Qh="JSON";class Zh{constructor(){this._initView()}_initView(){const e=document.createElement("div");e.hidden=!0,e.setAttribute("class","component-messageboxcontainer component-border-bottom-orange");const t=document.createElement("div");t.setAttribute("class","icon"),this.icon=document.createElement("span"),this.icon.setAttribute("class","supermapol-icons-message-warning"),t.appendChild(this.icon),e.appendChild(t);const r=document.createElement("div");r.setAttribute("class","component-messagebox"),r.innerHTML="",e.appendChild(r),this.messageBox=r;const s=document.createElement("div");s.setAttribute("class","component-messagebox__cancelbtncontainer");const i=document.createElement("button");i.setAttribute("class","component-messagebox__cancelBtn"),i.innerHTML="x",i.onclick=this.closeView.bind(this),s.appendChild(i),e.appendChild(s),this.messageBoxContainer=e,document.body.appendChild(this.messageBoxContainer)}closeView(){this.messageBoxContainer.hidden=!0}showView(e,t="warring"){"success"===t?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===t?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===t&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=e,this.messageBoxContainer.hidden=!1}}const Kh=function(){try{return echarts}catch(e){return{}}}();let $h={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return $h.code||$h.setCode(),$h.code},setCode:function(){var e=this.getLanguageFromCookie();e||(e=$h.defaultCode,e="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===e.indexOf("zh")&&(e="zh-CN"),0===e.indexOf("en")&&(e="en-US"),$h.code=e},getLanguageFromCookie(){for(var e=document.cookie.split(";"),t=0;t0){let e=n.SheetNames[0],r=eu.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,$h.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(i,n)}else s&&s.call(i,$h.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",mr.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($h.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`;mr.get(a,null,{withCredentials:i}).then(e=>e.json()).then(o=>{e=o.datasourceNames[0],a=`${t}/data/datasources/${e}/datasets`,mr.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`;mr.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`,mr.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 dn(l),o=new mn({queryParameter:n,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),(a=new gn(e,{eventListeners:{processCompleted:e=>{s&&s(e)},processFailed:e=>{i&&i(e)}}})).processAsync(o)}_queryFeatureBySQL(e,t,r,s,i,n,a,o,l,h){var u,c,d={name:t};Object.assign(d,r),u=new dn(d),s&&(u.fields=s);var p={queryParams:[u]};h&&(p.queryOption=J.ATTRIBUTE),o&&(p.startRecord=o),l&&(p.expectCount=l),i&&(p.prjCoordSys={epsgCode:i}),c=new No(p),this._queryBySQL(e,c,e=>{"processCompleted"===e.type?n(e):a(e)})}_queryBySQL(e,t,r,s){new Fo(e,{eventListeners:{scope:this,processCompleted:r,processFailed:r},format:this._processFormat(s)}).processAsync(t)}_processFormat(e){return e||G.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 ru(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;s{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=Kh.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))}}class nu{constructor(e){e=e||{},this.id=e.id?e.id:null,this.rootContainer=null}getElement(){return this.id&&(this.rootContainer.id=this.id),this.rootContainer}_initView(){}showView(){this.rootContainer.hidden=!1}closeView(){this.rootContainer.hidden=!0}}class au extends nu{constructor(e){super(e=e||{}),e.title=e.title?e.title:"",this._initView(e.title)}_initView(e){const t=document.createElement("div");t.setAttribute("class","component-popcontainer");const r=document.createElement("div");r.setAttribute("class","component-popcontainer__header");const s=document.createElement("label");s.setAttribute("class","component-popcontainer__header__title"),s.innerHTML=e,r.appendChild(s);const i=document.createElement("span");i.setAttribute("class","supermapol-icons-clear component-popcontainer__header__close"),i.onclick=this.closeView.bind(this),t.appendChild(i),t.appendChild(r);const n=document.createElement("div");n.setAttribute("class","component-popcontainer__content"),this.content=n,t.appendChild(n),this.rootContainer=t}appendContent(e){this.content.appendChild(e)}}class ou extends nu{constructor(e){super(e),this._initView()}_initView(){const e=document.createElement("div");e.setAttribute("class","component-tabpage");const t=document.createElement("ul");this.header=t;const r=document.createElement("div");r.setAttribute("class","component-tabpage__content"),this.content=r,e.appendChild(t),e.appendChild(r),this.rootContainer=e}setTabs(e){this.removeAllTabs(),this.appendTabs(e)}appendTabs(e){for(let t=0;t0;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[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 hu(e,t){let r=e;return e.replace(/&|\||>|<|=|!/g," ").split(" ").filter(e=>e).forEach(e=>{const s=t.find(t=>t===e);if(cu(e)&&s&&(r=r.replace(s,"$"+s)),s){const e=lu(s);r=r.replace(s,e)}}),r}function uu(e){let t={};for(let r in e){let s=r;cu(r)&&(s="$"+r),t[s=lu(s)]=e[r]}return t}function cu(e){return/^\d/.test(e)}Jl.Lang=$h,Jl.i18n=Jl.Lang.i18n,Jl.Util={...Jl.Util,...m},Jl.Browser=p,Jl.INCHES_PER_UNIT=g,Jl.METERS_PER_INCH=v,Jl.DOTS_PER_INCH=96,Jl.IS_GECKO=y,Jl.setCORS=function(e){ur=e},Jl.isCORS=fr,Jl.setRequestTimeout=function(e){return cr=e},Jl.getRequestTimeout=yr,Jl.FetchRequest=mr,Jl.inherit=function(e,t){var r,s,i,n=function(){};for(n.prototype=t.prototype,e.prototype=new n,r=2,s=arguments.length;r{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)}},Jl.Components.PopContainer=au,Jl.Components.Select=class extends nu{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)}}},Jl.Format=Jl.Format||I,Jl.Format.GeoJSON=Ae,Jl.Format.JSON=M,Jl.Format.WKT=class extends I{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}},Jl.iManager=class extends Hl{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 zl(e))}createIPortal(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/portal.json",new zl(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)}},Jl.iManagerCreateNodeParam=zl,Jl.iManagerServiceBase=Hl,Jl.iPortal=class extends Wl{constructor(e,t){super(e,t),this.iportalUrl=e,t=t||{},this.withCredentials=t.withCredentials||!1}load(){return mr.get(this.iportalUrl+"/web")}queryResources(e){if(!(e instanceof ql))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 Xl(t.iportalUrl,e))});let s=new Yl;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 Ql))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})}},Jl.iPortalAddDataParam=$l,Jl.iPortalAddResourceParam=Zl,Jl.iPortalDataConnectionInfoParam=rh,Jl.iPortalDataMetaInfoParam=eh,Jl.iPortalDataStoreInfoParam=th,Jl.iPortalQueryParam=ql,Jl.iPortalQueryResult=Yl,Jl.iPortalRegisterServiceParam=Kl,Jl.iPortalResource=Xl,Jl.iPortalServiceBase=Wl,Jl.iPortalShareEntity=class{constructor(e){e=e||{},this.permissionType="",this.entityType="",this.entityName="GUEST",this.entityId=null,m.extend(this,e)}},Jl.iPortalShareParam=Ql,Jl.iPortalUser=class extends Wl{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 Zl))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 Zl))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 Kl))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 $l))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 eh))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 eh))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof th))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 rh))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)}},Jl.AddressMatchService=Xi,Jl.AggregationParameter=sh,Jl.AreaSolarRadiationParameters=jo,Jl.AreaSolarRadiationService=Uo,Jl.BucketAggParameter=ih,Jl.BufferAnalystParameters=Ho,Jl.BufferAnalystService=Yo,Jl.BufferDistance=Jo,Jl.BuffersAnalystJobsParameter=xo,Jl.BuffersAnalystJobsService=_o,Jl.BufferSetting=Vo,Jl.BurstPipelineAnalystParameters=xa,Jl.BurstPipelineAnalystService=_a,Jl.ChartFeatureInfoSpecsService=en,Jl.ChartQueryFilterParameter=Zi,Jl.ChartQueryParameters=Ki,Jl.ChartQueryService=$i,Jl.ClipParameter=class{constructor(e){this.clipDatasetName=null,this.clipDatasourceName=null,this.clipRegion=null,this.isClipInRegion=!0,this.isExactClip=null,e&&m.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 m.toJSON({isClipInRegion:this.isClipInRegion,clipDatasetName:this.clipDatasetName,clipDatasourceName:this.clipDatasourceName,isExactClip:this.isExactClip,clipRegion:Ce.fromGeometry(this.clipRegion)})}},Jl.ColorDictionary=aa,Jl.CommonServiceBase=ui,Jl.ComputeWeightMatrixParameters=Aa,Jl.ComputeWeightMatrixService=Ea,Jl.CreateDatasetParameters=nn,Jl.DataFlowService=rn,Jl.DataReturnOption=zo,Jl.DatasetBufferAnalystParameters=Wo,Jl.DatasetInfo=sa,Jl.DatasetOverlayAnalystParameters=cl,Jl.DatasetService=sn,Jl.DatasetSurfaceAnalystParameters=Sl,Jl.DatasetThiessenAnalystParameters=Al,Jl.DatasourceConnectionInfo=no,Jl.DatasourceService=ln,Jl.DensityAnalystService=Qo,Jl.DensityKernelAnalystParameters=Xo,Jl.EditFeaturesParameters=hn,Jl.EditFeaturesService=un,Jl.FacilityAnalyst3DParameters=Wa,Jl.FacilityAnalystSinks3DParameters=qa,Jl.FacilityAnalystSinks3DService=Ya,Jl.FacilityAnalystSources3DParameters=Xa,Jl.FacilityAnalystSources3DService=Qa,Jl.FacilityAnalystStreamParameters=Ta,Jl.FacilityAnalystStreamService=La,Jl.FacilityAnalystTracedown3DParameters=$a,Jl.FacilityAnalystTracedown3DService=eo,Jl.FacilityAnalystTraceup3DParameters=Za,Jl.FacilityAnalystTraceup3DService=Ka,Jl.FacilityAnalystUpstream3DParameters=to,Jl.FacilityAnalystUpstream3DService=ro,Jl.FieldParameters=En,Jl.FieldsFilter=Ah,Jl.FieldStatisticService=Ln,Jl.FieldStatisticsParameters=Tn,Jl.FilterParameter=dn,Jl.FindClosestFacilitiesParameters=Pa,Jl.FindClosestFacilitiesService=Oa,Jl.FindLocationParameters=Ia,Jl.FindLocationService=Ma,Jl.FindMTSPPathsParameters=Na,Jl.FindMTSPPathsService=Fa,Jl.FindPathParameters=ka,Jl.FindPathService=Da,Jl.FindServiceAreasParameters=Ra,Jl.FindServiceAreasService=Ba,Jl.FindTSPPathsParameters=Ga,Jl.FindTSPPathsService=ja,Jl.GenerateSpatialDataParameters=Zo,Jl.GenerateSpatialDataService=Ko,Jl.GeoCodingParameter=qi,Jl.GeoDecodingParameter=Yi,Jl.GeoHashGridAggParameter=class extends ih{constructor(e){super(),this.precision=5,m.extend(this,e),this.aggType=xe.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 m.toJson(t)}},Jl.GeometryBatchAnalystService=Ll,Jl.GeometryBufferAnalystParameters=qo,Jl.GeometryOverlayAnalystParameters=dl,Jl.GeometrySurfaceAnalystParameters=xl,Jl.GeometryThiessenAnalystParameters=El,Jl.GeoprocessingService=Mn,Jl.GeoRelationAnalystParameters=$o,Jl.GeoRelationAnalystService=el,Jl.GetFeaturesByBoundsParameters=vn,Jl.GetFeaturesByBoundsService=bn,Jl.GetFeaturesByBufferParameters=Sn,Jl.GetFeaturesByBufferService=xn,Jl.GetFeaturesByGeometryParameters=_n,Jl.GetFeaturesByGeometryService=wn,Jl.GetFeaturesByIDsParameters=fn,Jl.GetFeaturesByIDsService=yn,Jl.GetFeaturesBySQLParameters=mn,Jl.GetFeaturesBySQLService=gn,Jl.GetFeaturesParametersBase=pn,Jl.GetFeaturesServiceBase=cn,Jl.GetFieldsService=An,Jl.GetGridCellInfosParameters=On,Jl.GetGridCellInfosService=In,Jl.GetLayersInfoService=ua,Jl.Grid=oa,Jl.HillshadeParameter=class extends fh{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=we.HILLSHADE,m.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}}},Jl.Image=la,Jl.ImageCollectionService=Ul,Jl.ImageGFAspect=Ih,Jl.ImageGFHillShade=Oh,Jl.ImageGFOrtho=Mh,Jl.ImageGFSlope=Nh,Jl.ImageRenderingRule=Ph,Jl.ImageSearchParameter=Th,Jl.ImageService=jl,Jl.ImageStretchOption=Lh,Jl.InterpolationAnalystParameters=tl,Jl.InterpolationAnalystService=ol,Jl.InterpolationDensityAnalystParameters=sl,Jl.InterpolationIDWAnalystParameters=il,Jl.InterpolationKrigingAnalystParameters=al,Jl.InterpolationRBFAnalystParameters=rl,Jl.JoinItem=ra,Jl.KernelDensityJobParameter=lo,Jl.KernelDensityJobsService=ho,Jl.LabelImageCell=class extends nh{constructor(e){super(e),this.height=0,this.pathField=null,this.rotation=0,this.width=0,this.sizeFixed=!1,this.type="IMAGE",e&&m.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}},Jl.LabelMatrixCell=nh,Jl.LabelMixedTextStyle=Bn,Jl.LabelSymbolCell=class extends nh{constructor(e){super(e),this.style=new D,this.symbolIDField=null,this.type="SYMBOL",e&&m.extend(this,e),this.CLASS_NAME="SuperMap.LabelSymbolCell"}destroy(){this.style&&(this.style.destroy(),this.style=null),this.symbolIDField=null}},Jl.LabelThemeCell=class extends nh{constructor(e){super(e),this.themeLabel=new Jn,this.type="THEME",e&&m.extend(this,e),this.CLASS_NAME=" SuperMap.LabelThemeCell"}destroy(){this.themeLabel&&(this.themeLabel.destroy(),this.themeLabel=null)}},Jl.LayerStatus=class{constructor(e){this.layerName=null,this.isVisible=null,this.displayFilter=null,this.fieldValuesDisplayFilter=null,e&&m.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":'+m.toJSON(this.fieldValuesDisplayFilter)),e+=t,e+="}"}},Jl.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&&m.extend(this,e),this.CLASS_NAME="SuperMap.LinkItem"}destroy(){var e=this;e.datasourceConnectionInfo instanceof no&&(e.datasourceConnectionInfo.destroy(),e.datasourceConnectionInfo=null),e.foreignKeys=null,e.foreignTable=null,e.linkFields=null,e.linkFilter=null,e.name=null,e.primaryKeys=null}},Jl.MappingParameters=oo,Jl.MapService=ma,Jl.MathExpressionAnalysisParameters=ll,Jl.MathExpressionAnalysisService=hl,Jl.MeasureParameters=va,Jl.MeasureService=ba,Jl.MetricsAggParameter=class extends sh{constructor(e){super(),this.aggType=_e.AVG,m.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy(),this.aggType=null}},Jl.NDVIParameter=class extends fh{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=we.NDVI,m.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}}},Jl.NetworkAnalystServiceBase=Sa,Jl.OutputSetting=ao,Jl.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,m.extend(this,e),this.ugcLayer=new ea(e),this.CLASS_NAME="SuperMap.OverlapDisplayedOptions"}destroy(){m.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+="}"}},Jl.OverlayAnalystParameters=ul,Jl.OverlayAnalystService=pl,Jl.OverlayGeoJobParameter=go,Jl.OverlayGeoJobsService=vo,Jl.PointWithMeasure=R,Jl.ProcessingServiceBase=io,Jl.QueryByBoundsParameters=Po,Jl.QueryByBoundsService=Oo,Jl.QueryByDistanceParameters=Io,Jl.QueryByDistanceService=Mo,Jl.QueryByGeometryParameters=ko,Jl.QueryByGeometryService=Do,Jl.QueryBySQLParameters=No,Jl.QueryBySQLService=Fo,Jl.QueryParameters=Qi,Jl.QueryService=Ro,Jl.RasterFunctionParameter=fh,Jl.Route=B,Jl.RouteCalculateMeasureParameters=fl,Jl.RouteCalculateMeasureService=yl,Jl.RouteLocatorParameters=ml,Jl.RouteLocatorService=gl,Jl.ServerColor=k,Jl.ServerFeature=it,Jl.ServerGeometry=Ce,Jl.ServerStyle=D,Jl.ServerTextStyle=Fn,Jl.ServerTheme=na,Jl.SetDatasourceParameters=on,Jl.SetLayerInfoParameters=class{constructor(e){e=e||{},this.resourceID=null,this.tempLayerName=null,this.layerInfo=null,m.extend(this,e),this.CLASS_NAME="SuperMap.SetLayerInfoParameters"}destroy(){this.resourceID=null,this.tempLayerName=null,this.layerInfo=null}},Jl.SetLayerInfoService=ca,Jl.SetLayersInfoParameters=class{constructor(e){e=e||{},this.isTempLayers=null,this.resourceID=null,this.layersInfo=null,m.extend(this,e),this.CLASS_NAME="SuperMap.SetLayersInfoParameters"}destroy(){this.isTempLayers=null,this.resourceID=null,this.layersInfo=null}},Jl.SetLayersInfoService=da,Jl.SetLayerStatusParameters=pa,Jl.SetLayerStatusService=fa,Jl.SingleObjectQueryJobsParameter=uo,Jl.SingleObjectQueryJobsService=co,Jl.Sortby=Eh,Jl.SpatialAnalystBase=Go,Jl.StopQueryParameters=Ml,Jl.StopQueryService=Nl,Jl.SummaryAttributesJobsParameter=Ao,Jl.SummaryAttributesJobsService=Eo,Jl.SummaryMeshJobParameter=po,Jl.SummaryMeshJobsService=fo,Jl.SummaryRegionJobParameter=bo,Jl.SummaryRegionJobsService=So,Jl.SupplyCenter=ah,Jl.SurfaceAnalystParameters=bl,Jl.SurfaceAnalystParametersSetting=vl,Jl.SurfaceAnalystService=_l,Jl.TerrainCurvatureCalculationParameters=wl,Jl.TerrainCurvatureCalculationService=Cl,Jl.Theme=Nn,Jl.ThemeDotDensity=Xn,Jl.ThemeFlow=oh,Jl.ThemeGraduatedSymbol=Zn,Jl.ThemeGraduatedSymbolStyle=Qn,Jl.ThemeGraph=Yn,Jl.ThemeGraphAxes=Hn,Jl.ThemeGraphItem=qn,Jl.ThemeGraphSize=zn,Jl.ThemeGraphText=Wn,Jl.ThemeGridRange=hh,Jl.ThemeGridRangeItem=lh,Jl.ThemeGridUnique=ch,Jl.ThemeGridUniqueItem=uh,Jl.ThemeLabel=Jn,Jl.ThemeLabelAlongLine=jn,Jl.ThemeLabelBackground=Un,Jl.ThemeLabelItem=kn,Jl.ThemeLabelText=Gn,Jl.ThemeLabelUniqueItem=dh,Jl.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}},Jl.ThemeOffset=Rn,Jl.ThemeParameters=Ol,Jl.ThemeRange=$n,Jl.ThemeRangeItem=Kn,Jl.ThemeService=Il,Jl.ThemeUnique=Vn,Jl.ThemeUniqueItem=Dn,Jl.ThiessenAnalystParameters=nl,Jl.ThiessenAnalystService=Tl,Jl.TilesetsService=ga,Jl.TopologyValidatorJobsParameter=wo,Jl.TopologyValidatorJobsService=Co,Jl.TransferLine=ph,Jl.TransferPathParameters=Fl,Jl.TransferPathService=kl,Jl.TransferSolutionParameters=Dl,Jl.TransferSolutionService=Rl,Jl.TransportationAnalystParameter=Ca,Jl.TransportationAnalystResultSetting=wa,Jl.UGCLayer=ea,Jl.UGCMapLayer=ta,Jl.UGCSubLayer=ia,Jl.UpdateDatasetParameters=an,Jl.UpdateEdgeWeightParameters=Ua,Jl.UpdateEdgeWeightService=Ja,Jl.UpdateTurnNodeWeightParameters=Va,Jl.UpdateTurnNodeWeightService=Ha,Jl.Vector=ha,Jl.VectorClipJobsParameter=yo,Jl.VectorClipJobsService=mo,Jl.WebPrintingJobContent=_h,Jl.WebPrintingJobCustomItems=yh,Jl.WebPrintingJobExportOptions=Ch,Jl.WebPrintingJobImage=mh,Jl.WebPrintingJobLayers=gh,Jl.WebPrintingJobLayoutOptions=wh,Jl.WebPrintingJobLegendOptions=vh,Jl.WebPrintingJobLittleMapOptions=bh,Jl.WebPrintingJobNorthArrowOptions=Sh,Jl.WebPrintingJobParameters=class{constructor(e){e&&(this.content=null,this.layoutOptions=null,this.exportOptions=null,m.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof _h&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof wh&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof Ch&&(this.exportOptions.destroy(),this.exportOptions=null)}},Jl.WebPrintingJobScaleBarOptions=xh,Jl.WebPrintingService=Gl,Jl.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 mr.get(this.rootUrl).then(function(e){return e})}login(){hi.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,r=t.mDatasUrl;return e&&(e=e.toJSON()),mr.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(wt.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(wt.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 De).getLinearGradient(a,0,o,0,[[0,l],[1,h]]);i.style.color=u}}}},Jl.Feature.Theme.Bar3D=class extends zh{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(wt.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(wt.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 yt(o[0],o[1],a);l.style=wt.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?l.style.fillColor=e.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=wt.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()}}},Jl.Feature.Theme.Graph=zh,Jl.Feature.Theme.Line=class extends zh{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(wt.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(wt.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 lt(a,o);p.style=wt.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,c,i[c]),p.highlightStyle=wt.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 y=new ht(h);y.style=wt.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),y.clickable=!1,y.hoverable=!1;var m=this.shapeFactory.createShape(y);this.shapes.push(m),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 dt(a[0],a[1],u,o,l);if(void 0===e.sectorStyleByFields){var f=c%t.length;p.style=wt.ShapeStyleTool(null,e.sectorStyle,t,null,f)}else p.style=wt.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,c,r[c]);p.highlightStyle=wt.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()}}}},Jl.Feature.Theme.Point=class extends zh{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(wt.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(wt.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 lt(a,o);c.style=wt.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,i[h]),c.highlightStyle=wt.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}},Jl.ArrayStatistic=jh,Jl.ColorsPickerUtil=Gh,Jl.DataFormat=G,Jl.ServerType=j,Jl.GeometryType=U,Jl.QueryOption=J,Jl.JoinType={INNERJOIN:"INNERJOIN",LEFTJOIN:"LEFTJOIN"},Jl.SpatialQueryMode=V,Jl.SpatialRelationType={CONTAIN:"CONTAIN",INTERSECT:"INTERSECT",WITHIN:"WITHIN"},Jl.MeasureMode=H,Jl.Unit=z,Jl.BufferRadiusUnit=W,Jl.EngineType={IMAGEPLUGINS:"IMAGEPLUGINS",OGC:"OGC",ORACLEPLUS:"ORACLEPLUS",SDBPLUS:"SDBPLUS",SQLPLUS:"SQLPLUS",UDB:"UDB"},Jl.ThemeGraphTextFormat=q,Jl.ThemeGraphType=Y,Jl.GraphAxesTextDisplayMode=X,Jl.GraduatedMode=Q,Jl.RangeMode=Z,Jl.ThemeType={DOTDENSITY:"DOTDENSITY",GRADUATEDSYMBOL:"GRADUATEDSYMBOL",GRAPH:"GRAPH",LABEL:"LABEL",RANGE:"RANGE",UNIQUE:"UNIQUE"},Jl.ColorGradientType=K,Jl.TextAlignment=$,Jl.FillGradientMode={NONE:"NONE",LINEAR:"LINEAR",RADIAL:"RADIAL",CONICAL:"CONICAL",SQUARE:"SQUARE"},Jl.AlongLineDirection=ee,Jl.LabelBackShape=te,Jl.LabelOverLengthMode=re,Jl.DirectionType={EAST:"EAST",NONE:"NONE",NORTH:"NORTH",SOURTH:"SOURTH",WEST:"WEST"},Jl.OverlayOperationType=ie,Jl.OutputType=ne,Jl.SideType={LEFT:"LEFT",MIDDLE:"MIDDLE",NONE:"NONE",RIGHT:"RIGHT"},Jl.SupplyCenterType={FIXEDCENTER:"FIXEDCENTER",NULL:"NULL",OPTIONALCENTER:"OPTIONALCENTER"},Jl.TurnType={AHEAD:"AHEAD",BACK:"BACK",END:"END",LEFT:"LEFT",NONE:"NONE",RIGHT:"RIGHT"},Jl.BufferEndType=se,Jl.SmoothMethod=ae,Jl.SurfaceAnalystMethod=oe,Jl.DataReturnMode=le,Jl.EditType=he,Jl.TransferTactic=ue,Jl.TransferPreference=ce,Jl.GridType={CROSS:"CROSS",GRID:"GRID",POINT:"POINT"},Jl.ColorSpaceType={CMYK:"CMYK",RGB:"RGB"},Jl.LayerType={UGC:"UGC",WMS:"WMS",WFS:"WFS",CUSTOM:"CUSTOM"},Jl.UGCLayerType={THEME:"THEME",VECTOR:"VECTOR",GRID:"GRID",IMAGE:"IMAGE"},Jl.StatisticMode={AVERAGE:"AVERAGE",MAX:"MAX",MIN:"MIN",STDDEVIATION:"STDDEVIATION",SUM:"SUM",VARIANCE:"VARIANCE"},Jl.PixelFormat={BIT16:"BIT16",BIT32:"BIT32",BIT64:"BIT64",SINGLE:"SINGLE",DOUBLE:"DOUBLE",UBIT1:"UBIT1",UBIT4:"UBIT4",UBIT8:"UBIT8",UBIT24:"UBIT24",UBIT32:"UBIT32"},Jl.SearchMode={KDTREE_FIXED_COUNT:"KDTREE_FIXED_COUNT",KDTREE_FIXED_RADIUS:"KDTREE_FIXED_RADIUS",NONE:"NONE",QUADTREE:"QUADTREE"},Jl.InterpolationAlgorithmType={KRIGING:"KRIGING",SimpleKriging:"SimpleKriging",UniversalKriging:"UniversalKriging"},Jl.VariogramMode=de,Jl.Exponent=pe,Jl.ClientType=fe,Jl.ChartType={BAR:"Bar",BAR3D:"Bar3D",CIRCLE:"Circle",PIE:"Pie",POINT:"Point",LINE:"Line",RING:"Ring"},Jl.ClipAnalystMode=ye,Jl.AnalystAreaUnit=me,Jl.AnalystSizeUnit=ge,Jl.StatisticAnalystMode=ve,Jl.SummaryType=be,Jl.TopologyValidatorRule=Se,Jl.BucketAggType=xe,Jl.MetricsAggType=_e,Jl.GetFeatureMode={BOUNDS:"BOUNDS",BUFFER:"BUFFER",ID:"ID",SPATIAL:"SPATIAL",SQL:"SQL"},Jl.RasterFunctionType=we,Jl.ResourceType={MAP:"MAP",SERVICE:"SERVICE",SCENE:"SCENE",DATA:"DATA",INSIGHTS_WORKSPACE:"INSIGHTS_WORKSPACE",MAP_DASHBOARD:"MAP_DASHBOARD"},Jl.OrderBy={UPDATETIME:"UPDATETIME",HEATLEVEL:"HEATLEVEL",RELEVANCE:"RELEVANCE"},Jl.OrderType={ASC:"ASC",DESC:"DESC"},Jl.SearchType={PUBLIC:"PUBLIC",MY_RES:"MY_RES",MYGROUP_RES:"MYGROUP_RES",MYDEPARTMENT_RES:"MYDEPARTMENT_RES",SHARETOME_RES:"SHARETOME_RES"},Jl.AggregationTypes={TAG:"TAG",TYPE:"TYPE"},Jl.PermissionType={SEARCH:"SEARCH",READ:"READ",READWRITE:"READWRITE",DELETE:"DELETE",DOWNLOAD:"DOWNLOAD"},Jl.EntityType={DEPARTMENT:"DEPARTMENT",GROUP:"GROUP",IPORTALGROUP:"IPORTALGROUP",ROLE:"ROLE",USER:"USER"},Jl.WebExportFormatType={PNG:"PNG",PDF:"PDF"},Jl.WebScaleOrientationType={HORIZONTALLABELSBELOW:"HORIZONTALLABELSBELOW",HORIZONTALLABELSABOVE:"HORIZONTALLABELSABOVE",VERTICALLABELSLEFT:"VERTICALLABELSLEFT",VERTICALLABELSRIGHT:"VERTICALLABELSRIGHT"},Jl.WebScaleType={LINE:"LINE",BAR:"BAR",BAR_SUB:"BAR_SUB"},Jl.WebScaleUnit={METER:"METER",FOOT:"FOOT",DEGREES:"DEGREES"},Jl.KnowledgeGraph=Oi;const du=function(){try{return convert}catch(e){return{}}}();var pu=r.n(du);const fu=function(){try{return canvg}catch(e){return{}}}();var yu=r.n(fu);const mu=["559082264.0287178","279541132.0143589","139770566.0071794","69885283.00358972","34942641.50179486","17471320.75089743","8735660.375448715","4367830.1877224357","2183915.093862179","1091957.546931089","545978.7734655447","272989.7734655447","272989.3867327723","136494.6933663862","68247.34668319309","34123.67334159654","17061.83667079827","8530.918335399136","4265.459167699568","2132.729583849784"],gu=["5.590822640287176E8","2.795411320143588E8","1.397705660071794E8","6.98852830035897E7","3.494264150179485E7","1.7471320750897426E7","8735660.375448713","4367830.187724357","2183915.0938621783","1091957.5469310891","545978.7734655446","272989.3867327723","136494.69336638614","68247.34668319307","34123.673341596535","17061.836670798268","8530.918335399134"],vu=["GoogleCRS84Quad","GoogleMapsCompatible"];t().supermap={...Jl,...t().supermap},t().supermap.map=t().supermap.map||{},t().supermap.LogoControl=i,t().supermap.Logo=i,t().supermap.Util=Le,t().supermap.WebMap=class extends t().Evented{constructor(e,t){super(),this.mapId=e,t=t||{},this.server=t.server,this.credentialKey=t.credentialKey,this.credentialValue=t.credentialValue,this.withCredentials=t.withCredentials||!1,this.target=t.target||"map",this._canvgsV=[],this._createWebMap(),this.on("mapinitialized",()=>{this.map.on("remove",()=>{this._stopCanvg()})})}resize(){this.map.resize()}setMapId(e){this.mapId=e,this._createWebMap()}setWebMapOptions(e){this.server=e.server,this._createWebMap()}setMapOptions(e){let{center:t,zoom:r,maxBounds:s,minZoom:i,maxZoom:n,isWorldCopy:a,bearing:o,pitch:l}=e;t&&t.length&&this.map.setCenter(t),r&&this.map.setZoom(r),s&&this.map.setMaxBounds(s),i&&this.map.setMinZoom(i),n&&this.map.setMaxZoom(n),a&&this.map.setRenderWorldCopies(a),o&&this.map.setBearing(o),l&&this.map.setPitch(l)}_createWebMap(){let e=this.server.split("");"/"!==e[e.length-1]&&(this.server+="/");let t=this.server+"web/maps/"+this.mapId+"/map";this.credentialValue&&this.credentialKey&&(t+="?"+this.credentialKey+"="+this.credentialValue);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)}_createMap(e){let r=[],s=e.layers;s&&s.length>0&&s.forEach(e=>{e.labelStyle&&r.push(e.labelStyle.fontFamily)},this),r.push("'supermapol-icons'");let i,n=r.join(","),a=e.center,o=e.level||0,l=0;if(e.minScale&&e.maxScale)l=this._transformScaleToZoom(e.minScale,t().CRS?t().CRS.get(this.baseProjection):"EPSG:3857");else{const r=this._getResolution(t().CRS?t().CRS.get(this.baseProjection).getExtent():[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892])/this._getResolution(e.extent);l=+Math.log(r)/Math.LN2.toFixed(2)}o+=l,i=a?this._unproject([a.x,a.y]):new(t().LngLat)(0,0),this.map=new(t().Map)({container:this.target,center:i,zoom:o,style:{version:8,sources:{},layers:[]},crs:this.baseProjection,localIdeographFontFamily:n||""}),this.fire("mapinitialized")}_getMapInfo(e){let t=-1===e.indexOf(".json")?`${e}.json`:e;mr.get(t,null,{withCredentials:this.withCredentials}).then(e=>e.json()).then(e=>{if(this.baseProjection=e.projection,this.mapParams={title:e.title,description:e.description},!(this.baseProjection in{"EPSG:4490":"EPSG:4490","EPSG:4214":"EPSG:4214","EPSG:4610":"EPSG:4610","EPSG:3857":"EPSG:3857","EPSG:4326":"EPSG:4326"}))throw Error($h.i18n("msg_crsunsupport"));{this._createMap(e,this.mapSetting);let t=e.layers;this.map.on("load",()=>{this._addBaseMap(e),t&&0!==t.length?this._addLayers(t):this._sendMapToUser(0,0)})}}).catch(e=>{this.fire("getmapfailed",{error:e})})}_addBaseMap(e){this._createBaseLayer(e)}_createBaseLayer(e){let t=e.baseLayer||e,r=t.layerType;(r.indexOf("TIANDITU_VEC")>-1||r.indexOf("TIANDITU_IMG")>-1||r.indexOf("TIANDITU_TER")>-1)&&(r=r.substr(0,12));let s,i={CLOUD:"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:"http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"https://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i380072576!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0",GOOGLE_CN:"https://mt{0-3}.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"};switch(r){case"TIANDITU_VEC":case"TIANDITU_IMG":case"TIANDITU_TER":this._createTiandituLayer(e);break;case"BING":this._createBingLayer(t.name);break;case"WMS":this._createWMSLayer(t);break;case"WMTS":this._createWMTSLayer(t);break;case"TILE":case"SUPERMAP_REST":this._createDynamicTiledLayer(t);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":s=i[r],this._createXYZLayer(t,s);break;case"MAPBOXSTYLE":this._createMapboxStyle(t)}}_createMapboxStyle(e){let t,r=this,{dataSource:s={}}=e,{serverId:i,url:n}=s;t=void 0!==i?`${this.server}web/datas/${i}/download`:n,mr.get(t,null,{withCredentials:this.withCredentials,withoutFormatSuffix:!0,headers:{"Content-Type":"application/json;chartset=uft-8"}}).then(e=>e.json()).then(e=>{r._matchStyleObject(e),r.map.setStyle(e)})}_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])}_createTiandituLayer(e){let t=this._getTiandituUrl(e),r=e.baseLayer.layerType,s=Boolean(e.baseLayer.labelLayerVisible),i=t.labelUrl,n=t.tiandituUrl;this._addBaselayer(n,"tianditu-layers-"+r),s&&this._addBaselayer(i,"tianditu-label-layers-"+r)}_createWMTSLayer(e){let t=this._getWMTSUrl(e);this._filterWMTSIsMatched(e,(r,s)=>{r&&this._addBaselayer([t],"wmts-layers"+e.name,0,s)})}_filterWMTSIsMatched(e,t){let r=!1,s=22,i=e.url;mr.get(i,null,{withCredentials:!1,withoutFormatSuffix:!0}).then(e=>e.text()).then(i=>{let n=pu()?pu():window.convert,a=JSON.parse(n.xml2json(i,{compact:!0,spaces:4})).Capabilities.Contents.TileMatrixSet;Array.isArray(a)||(a=[a]);for(let t=0;t-1)r=!0;else{if(!a[t].WellKnownScaleSet||"Custom"!==a[t].WellKnownScaleSet._text)throw Error($h.i18n("msg_tilematrixsetunsupport"));{let e=[],i="EPSG:3857"===this.map.crs?mu:gu;for(let r=0,s=i.length;r{this.fire("getwmtsfailed",{error:e,map:this.map})})}_createBingLayer(e){this.addLayer(["https://dynamic.t0.tiles.ditu.live.com/comp/ch/{quadkey}?it=G,TW,L,LA&mkt=zh-cn&og=109&cstl=w4c&ur=CN&n=z"],"bing-layers-"+e)}_createXYZLayer(e,t){let r=[];if("OSM"===e.layerType){let e=t.match(/\w\-\w/g)[0],s=e[0],i=e[2],n="";for(let e=97;e<123;e++)n+=String.fromCharCode(e);let a=n.split(""),o=a.indexOf(s),l=a.indexOf(i),h=a.slice(o,l+1);for(let e=0;e{if(e.dataSource&&e.dataSource.serverId||"MARKER"===e.layerType){let n=e.dataSource?e.dataSource.serverId:e.serverId,a=`${this.server}web/datas/${n}/content.json?pageSize=9999999¤tPage=1`;n&&mr.get(a,null,{withCredentials:this.withCredentials}).then(e=>e.json()).then(n=>{if(!1===n.succeed)return r++,this._sendMapToUser(r,s),void this.fire("getlayersfailed",{error:n.error,map:this.map});n.type&&("JSON"===n.type||"GEOJSON"===n.type?(n.content=JSON.parse(n.content.trim()),t=this._formatGeoJSON(n.content,e)):"EXCEL"!==n.type&&"CSV"!==n.type||(t=this._excelData2Feature(n.content,e)),this._addLayer(e,t,i),r++,this._sendMapToUser(r,s))}).catch(e=>{r++,this._sendMapToUser(r,s),this.fire("getlayersfailed",{error:e,map:this.map})})}else if("SUPERMAP_REST"===e.layerType||"TILE"===e.layerType||"WMS"===e.layerType||"WMTS"===e.layerType)this._createBaseLayer(e),r++,this._sendMapToUser(r,s);else if(e.dataSource&&"REST_DATA"===e.dataSource.type){let n=e.dataSource;this._getFeatureBySQL(n.url,[n.dataSourseName||e.name],n=>{t=this._parseGeoJsonData2Feature({allDatas:{features:n.result.features.features},fileCode:e.projection,featureProjection:this.baseProjection}),this._addLayer(e,t,i),r++,this._sendMapToUser(r,s)},e=>{r++,this._sendMapToUser(r,s),this.fire("getfeaturesfailed",{error:e})})}else e.dataSource&&"REST_MAP"===e.dataSource.type&&e.dataSource.url&&this._queryFeatureBySQL(e.dataSource.url,e.dataSource.layerName,"smid=1",null,null,t=>{let n=t&&t.result.recordsets,a=n&&n[0],o=a.fields;if(a&&o){let t=[];for(let e in o){let r=o[e];0===r.indexOf("Sm")&&"SmID"!==r||t.push(r)}this._getFeatures(t,e,t=>{this._addLayer(e,t,i),r++,this._sendMapToUser(r,s)},e=>{r++,this.fire("getfeaturesfailed",{error:e,map:this.map})})}},e=>{this.fire("getlayersfailed",{error:e,map:this.map})})},this)}_getFeatures(e,t,r,s){let i=t.dataSource,n=t.projection;this._queryFeatureBySQL(i.url,i.layerName,null,e,null,e=>{let t=e.result.recordsets[0].features.features,s=this._parseGeoJsonData2Feature({allDatas:{features:t},fileCode:n,featureProjection:this.baseProjection},"JSON");r(s)},e=>{s(e)})}_addLayer(e,t,r){let s=e.layerType;e.layerID=s+"-"+e.name+"-"+r,e.visible=e.visible?"visible":"none",t[0]&&"Polygon"===t[0].geometry.type&&(t=this._handleMultyPolygon(t)),e.style&&e.filterCondition&&"RANGE"!==s&&"UNIQUE"!==s&&(t=this._getFiterFeatures(e.filterCondition,t)),"VECTOR"===s?"POINT"===e.featureType?"SYMBOL_POINT"===e.style.type?this._createSymbolLayer(e,t):this._createGraphicLayer(e,t):this._createVectorLayer(e,t):"UNIQUE"===s?this._createUniqueLayer(e,t):"RANGE"===s?this._createRangeLayer(e,t):"HEAT"===s?this._createHeatLayer(e,t):"MARKER"===s&&this._createMarkerLayer(e,t),e.labelStyle&&e.labelStyle.labelField&&this._addLabelLayer(e,t)}_addLabelLayer(e,t){let r=e.labelStyle;this.map.addLayer({id:e.layerID+"label",type:"symbol",source:{type:"geojson",data:{type:"FeatureCollection",features:t}},paint:{"text-color":r.fill},layout:{"text-field":`{${r.labelField}}`,"text-size":parseFloat(r.fontSize)||12,"text-offset":r.offsetX?[r.offsetX/10||0,r.offsetY/10||0]:[0,-1.5],"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],visibility:e.visible}})}_createSymbolLayer(e,t){document.getElementById(`${this.target}`).classList.add("supermapol-icons-map");let r=e.style,s=e.style.unicode,i=String.fromCharCode(parseInt(s.replace(/^&#x/,""),16)),n=e.layerID;this.map.addSource(n+"-source",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),this.map.addLayer({id:n,type:"symbol",source:n+"-source",paint:{"text-color":r.fillColor},layout:{"text-field":i,"text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],visibility:e.visible}}),this.map.getSource(n+"-source").setData({type:"FeatureCollection",features:t})}_createGraphicLayer(e,t){let r=e.style,s={},i=e.layerID,n={type:"geojson",data:{type:"FeatureCollection",features:t}};if("IMAGE_POINT"===r.type){let t=r.imageInfo,s=t.img;s&&s.src||(t.url=this.server+t.url),this.map.loadImage(t.url||s.src,(t,s)=>{t&&console.log(t);let a=2*Number.parseFloat((r.radius/s.height).toFixed(2));this.map.addImage("imageIcon",s),this.map.addLayer({id:i,type:"symbol",source:n,layout:{"icon-image":"imageIcon","icon-size":a,visibility:e.visible}})})}else if("SVG_POINT"===r.type){let t=r.url;this.svgDiv||(this.svgDiv=document.createElement("div"),document.body.appendChild(this.svgDiv)),this._getCanvasFromSVG(t,this.svgDiv,t=>{let s=t.toDataURL("img/png");s&&this.map.loadImage(s,(s,a)=>{s&&console.log(s);let o=Number.parseFloat((r.radius/t.width).toFixed(2));this.map.addImage("imageIcon",a),this.map.addLayer({id:i,type:"symbol",source:n,layout:{"icon-image":"imageIcon","icon-size":o,visibility:e.visible}})},this)})}else s.style=this._transformStyleToMapBoxGl(r,e.featureType),s.layout={visibility:e.visible},this._addOverlayToMap("POINT",n,i,s)}_createUniqueLayer(e,t){let r=this._getUniqueStyleGroup(e,t);t=this._getFiterFeatures(e.filterCondition,t);let s=e.style,i={},n=e.themeSetting.themeField,a=e.featureType,o=["match",["get","index"]],l=e.layerID;t.forEach(e=>{r.forEach(t=>{t.value===e.properties[n]&&o.push(e.properties.index,t.color)})}),o.push("#ffffff"),i.style=this._transformStyleToMapBoxGl(s,a,o);let h=e.visible;i.layout={visibility:h};let u={type:"geojson",data:{type:"FeatureCollection",features:t}};this._addOverlayToMap(a,u,l,i),"POLYGON"===a&&s.strokeColor&&this._addStrokeLineForPoly(s,u,l+"-strokeLine",h)}_getUniqueStyleGroup(e,t){let r=e.featureType,s=e.style,i=e.themeSetting,n=i.themeField,a=i.colors,o=[],l=i.customSettings;for(let e in t){let r=t[e].properties[n],s=!1;for(let e in o)if(o[e]===r){s=!0;break}s||o.push(r)}let h=a||this.defaultParameters.colors;h=Gh.getGradientColors(h,o.length);let u=[];return o.forEach((e,t)=>{let i=h[t];e in l&&(i=l[e]),"LINE"===r?s.strokeColor=i:s.fillColor=i,u.push({color:i,value:e})},this),u}_getWMTSUrl(e){let t={service:"WMTS",request:"GetTile",version:"1.0.0",style:"default",layer:e.layer,tilematrixSet:e.tileMatrixSet,format:"image/png"},r=e.url;return r+=this._getParamString(t,r)+"&tilematrix={z}&tilerow={y}&tilecol={x}"}_createMarkerLayer(e,t){t&&t.forEach(t=>{let r=t.geometry.type.toUpperCase(),s=t.dv_v5_markerStyle;"POINT"===r&&s.text&&(r="TEXT");let i=this.setFeatureInfo(t);t.properties.useStyle=s,t.properties.featureInfo=i,"POINT"===r&&s.src&&-1===s.src.indexOf("http://")&&-1===s.src.indexOf("https://")&&(s.src=this.server+s.src);let n={type:"geojson",data:t},a=t.properties.index,o=r+"-"+a;if("POINT"===r&&s.src&&s.src.indexOf("svg")<=-1&&this.map.loadImage(s.src,(t,r)=>{t&&console.log(t),this.map.addImage(a+"",r),this.map.addLayer({id:o,type:"symbol",source:n,layout:{"icon-image":a+"","icon-size":s.scale,visibility:e.visible}})},this),"POINT"===r&&s.src&&s.src.indexOf("svg")>-1&&(this.svgDiv||(this.svgDiv=document.createElement("div"),document.body.appendChild(this.svgDiv)),this._getCanvasFromSVG(s.src,this.svgDiv,t=>{let r=t.toDataURL("img/png");r&&this.map.loadImage(r,(t,r)=>{t&&console.log(t),this.map.addImage(a+"",r),this.map.addLayer({id:o,type:"symbol",source:n,layout:{"icon-image":a+"","icon-size":s.scale,visibility:e.visible}})},this)})),!s.src){let t={layout:{}};"LINESTRING"===r&&s.lineCap&&(r="LINE",t.layout={"line-cap":s.lineCap});let i=e.visible;t.layout.visibility=i,t.style=this._transformStyleToMapBoxGl(s,r),this._addOverlayToMap(r,n,o,t),"POLYGON"===r&&s.strokeColor&&this._addStrokeLineForPoly(s,n,o+"-strokeLine",i)}},this)}setFeatureInfo(e){let t,r=e.dv_v5_markerInfo;if(!r||!r.dataViz_title)return r;t=r;let s=e.properties;for(let e in t)s[e]&&(t[e]=s[e],delete s[e]);return t}_createHeatLayer(e,t){let r=e.themeSetting,s={};s.gradient=r.colors.slice(),s.radius=parseInt(r.radius);let i=r.customSettings;for(let e in i)s.gradient[e]=i[e];r.weight&&this._changeWeight(t,r.weight);let n=["interpolate",["linear"],["heatmap-density"]],a=(1/s.gradient.length).toFixed(2);s.gradient.forEach((e,t)=>{n.push(t*a),0===t&&(e=Le.hexToRgba(e,0)),n.push(e)});let o={"heatmap-color":n,"heatmap-radius":r.radius+15,"heatmap-intensity":{base:1,stops:[[0,.8],[22,1]]}};if(t[0].weight&&t.length>=4){let e=[];t.forEach(t=>{e.push(t.weight)});let r=jh.getMax(e),s=jh.getMin(e);o["heatmap-weight"]=["interpolate",["linear"],["get","weight"],s,0,r,1]}this.map.addLayer({id:e.layerID,type:"heatmap",source:{type:"geojson",data:{type:"FeatureCollection",features:t}},paint:o})}_changeWeight(e,t){this.fieldMaxValue={},this._getMaxValue(e,t);let r=this.fieldMaxValue[t];e.forEach(e=>{let s=e.properties[t];e.weight=s/r})}_getMaxValue(e,t){let r,s=[],i=t;this.fieldMaxValue[i]||(e.forEach(e=>{(r=e.properties)&&parseFloat(r[i])&&s.push(parseFloat(r[i]))}),this.fieldMaxValue[i]=jh.getArrayStatistic(s,"Maximum"))}_createRangeLayer(e,t){let r=e.themeSetting.themeField,s=e.style,i=e.featureType,n=this._getRangeStyleGroup(e,t),a={type:"geojson",data:{type:"FeatureCollection",features:t=this._getFiterFeatures(e.filterCondition,t)}},o=["match",["get","index"]];t.forEach(e=>{let t=parseFloat(e.properties[r]);for(let r=0;r0&&s.push(i)}return s}_replaceFilterCharacter(e){return e=e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")}_getRangeStyleGroup(e,t){let r,s=e.featureType,i=e.style,n=[],a=e.themeSetting,o=a.customSettings,l=a.themeField,h=a.segmentCount;t.forEach(e=>{(r=e.properties||e.get("Properties"))?r[l]&&Le.isNumber(r[l])&&n.push(parseFloat(r[l])):e.get(l)&&Le.isNumber(e.get(l))&&e.get(l)&&n.push(parseFloat(e.get(l)))},this);let u=jh.getArraySegments(n,a.segmentMethod,h);if(u){let e=h;r&&u[0]===u[r.length-1]&&(e=1,u.length=2);for(let e in u){let t=u[e];t=0==e?Math.floor(100*t)/100:Math.ceil(100*t)/100+.1,u[e]=Number(t.toFixed(2))}let t=a.colors;for(let t=0;t{e.properties.index=t}),t}_excelData2Feature(e){let t=e.colTitles,r=-1,s=-1;for(let e=0,i=t.length;e1e-7;o++)r=1,a+=l=Math.PI/2-2*Math.atan(n*r)-a;return new(t().LngLat)(e[0]*s/i,a*s)}_getParamString(e,t,r){var s=[];for(var i in e)s.push((r?i.toUpperCase():i)+"="+e[i]);return(t&&-1!==t.indexOf("?")?"&":"?")+s.join("&")}_isXField(e){var t=e.toLowerCase();return"x"===t||"smx"===t||"jd"===t||"经度"===t||"东经"===t||"longitude"===t||"lot"===t||"lon"===t||"lng"===t}_isYField(e){var t=e.toLowerCase();return"y"===t||"smy"===t||"wd"===t||"纬度"===t||"北纬"===t||"latitude"===t||"lat"===t}_transformStyleToMapBoxGl(e,t,r){let s={};"POINT"!==e.type&&"BASIC_POINT"!==e.type&&"POINT"!==t||"LINE"===t?"LINE"===t?s={strokeWidth:"line-width",strokeColor:"line-color",strokeOpacity:"line-opacity"}:"POLYGON"===t&&(s={fillColor:"fill-color",fillOpacity:"fill-opacity",strokeColor:"fill-outline-color"}):s={fillColor:"circle-color",strokeWidth:"circle-stroke-width",fillOpacity:"circle-opacity",radius:"circle-radius",strokeColor:"circle-stroke-color",strokeOpacity:"circle-stroke-opacity"};let i={};for(let t in e)s[t]&&(i[s[t]]=e[t]);return r&&(i["circle-color"]?i["circle-color"]=r:i["line-color"]?i["line-color"]=r:i["fill-color"]=r),e.lineDash&&"solid"!==e.lineDash&&"LINE"===t&&(i["line-dasharray"]=this._dashStyle(e)),i}_dashStyle(e){if(!e)return[];var t=e.strokeDashstyle||e.lineDash;switch(t){case"solid":return[];case"dot":return[1,4];case"dash":return[4,4];case"dashdot":return[4,4,1,4];case"longdash":return[8,4];case"longdashdot":return[8,4,1,4];default:return t?m.isArray(t)?t:(t=l.trim(t).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}}_getCanvasFromSVG(e,t,r){let s=document.createElement("canvas");s.id="dataviz-canvas-"+Le.newGuid(8),s.style.display="none",t.appendChild(s);const i=window.canvg&&window.canvg.default?window.canvg.default:yu(),n=s.getContext("2d");i.from(n,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:()=>!1}).then(e=>{e.start(),this._canvgsV.push(e),s.width>300||s.height>300||r(s)})}_stopCanvg(){this._canvgsV.forEach(e=>e.stop()),this._canvgsV=[]}_addOverlayToMap(e,t,r,s){"circle"!==(e={POINT:"circle",LINE:"line",POLYGON:"fill"}[e])&&"line"!==e&&"fill"!==e||this.map.addLayer({id:r,type:e,source:t,paint:s.style,layout:s.layout||{}})}_addBaselayer(e,t,r=0,s=22,i){this.map.addLayer({id:t,type:"raster",source:{type:"raster",tiles:e,tileSize:256,rasterSource:i?"iserver":"",prjCoordSys:i?{epsgCode:this.baseProjection.split(":")[1]}:""},minzoom:r,maxzoom:s})}_addStrokeLineForPoly(e,t,r,s){let i={};i.style=this._transformStyleToMapBoxGl(e,"LINE"),i.layout={visibility:s},this._addOverlayToMap("LINE",t,r,i)}_parseGeoJsonData2Feature(e){let t=e.allDatas.features,r=[];for(let e=0,s=t.length;e 0"}),a=new mn({queryParameter:i,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),(n=new gn(e,{eventListeners:{processCompleted:e=>{r&&r(e)},processFailed:e=>{s&&s(e)}}})).processAsync(a)}_queryFeatureBySQL(e,t,r,s,i,n,a,o,l,h){var u,c;u=new dn({name:t,attributeFilter:r}),s&&(u.fields=s);var d={queryParams:[u]};h&&(d.queryOption=J.ATTRIBUTE),o&&(d.startRecord=o),l&&(d.expectCount=l),i&&(d.prjCoordSys={epsgCode:i}),c=new No(d),new Bo(e).queryBySQL(c,e=>{"processCompleted"===e.type?n(e):a(e)})}_handleMultyPolygon(e){return e.forEach(e=>{if("Polygon"!==e.geometry.type)return;let t=e.geometry.coordinates;if(t.length>1){let r=[];t.forEach(e=>{r.push([e])}),e.geometry.coordinates=r,e.geometry.type="MultiPolygon"}}),e}_transformScaleToZoom(e,t){let r=295829515.2024169;"EPSG:3857"!==(t||this.map.getCRS()).epsgCode&&(r=295295895);const s=e.split(":")[1];return Math.min(24,+Math.log2(r/+s).toFixed(2))}_getResolution(e,t=512){return e.leftBottom&&e.rightTop?Math.max(e.rightTop.x-e.leftBottom.x,e.rightTop.y-e.leftBottom.y)/t:Math.max(e[2]-e[0],e[3]-e[1])/t}},t().supermap.Graphic=class{constructor(e,t,r){this.lngLat=Le.isArray(e)?{lng:e[0],lat:e[1]}:e,this.style=Le.extend({},t),this.attributes=r}getId(){return this.id}setId(e){this.id=e}getLngLat(){return this.lngLat}setLngLat(e){this.lngLat=Le.isArray(e)?{lng:e[0],lat:e[1]}:e}setStyle(e){this.style=Le.extend(this.style,e)}getStyle(){return this.style}setAttributes(e){this.attributes=Le.extend({},this.attributes,e)}getAttributes(){return this.attributes}},t().supermap.map.getDefaultVectorTileStyle=function(e,t){t=t||{};var r={};r.version=t.version||8,r.layers=t.layers||[],r.light=t.light||{anchor:"viewport",color:"#fcf6ef",intensity:.5,position:[1.15,201,20]};var s={version:r.version,sources:{"vector-tiles":{type:"vector",tiles:[e]}},layers:r.layers,light:r.light};return null!=t.sprite&&(s.sprite=t.sprite),null!=t.glyphs&&(s.glyphs=t.glyphs),s},t().supermap.map.setBackground=function(e,t){t&&e&&e.addLayer({id:"background",type:"background",paint:{"background-color":t}},"background")},t().supermap.map.setPaintProperty=function(e,t,r,s,i,n){if(t&&e){"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]);for(var a=0;a=this.options.minZoom&&t<=this.options.maxZoom,this.renderer&&(this.renderer.visible=this.visible),this.map.getLayer(this.sourceId)&&this.map.setLayoutProperty(this.sourceId,"visibility",this.visible?"visible":"none"),this.renderer&&this.renderer._drawLabel()}setMinZoom(e){this.options.minZoom=e,this.setVisibility()}setMaxZoom(e){this.options.maxZoom=e,this.setVisibility()}setShowLabel(e){this.options.showLabel=e,this.renderer._drawLabel()}setExtent(e){this.options.extent=this.getDefaultExtent(e,this.map),this.updateGraticuleLayer(),this.renderer._drawLabel()}setStrokeStyle(e){if(!this.map||!this.map.getLayer(this.sourceId))return;this.options.strokeStyle=e;const{layout:t,paint:r}=this.renderer._transformStrokeStyle(e);for(let e in t)this.map.setLayoutProperty(this.sourceId,e,t[e]);for(let e in r)this.map.setPaintProperty(this.sourceId,e,r[e])}setLngLabelStyle(e){this.options.lngLabelStyle=e,this.renderer._drawLabel()}setLatLabelStyle(e){this.options.latLabelStyle=e,this.renderer._drawLabel()}setIntervals(e){this.renderer&&this.renderer.setIntervals(e)}getDefaultExtent(e,r=this.map){const s=r.getCRS&&r.getCRS()||{};let{extent:i}=s;if(i||(i=[-180,-85.05119,180,85.05119]),!e||0===e.length)return i;const{_sw:n,_ne:a}=t().LngLatBounds.convert(e);return e=[n.lng,n.lat,a.lng,a.lat],e=[Math.max(i[0],e[0]),Math.max(i[1],e[1]),Math.min(i[2],e[2]),Math.min(i[3],e[3])]}addGraticuleLayer(){if(!this.map.getSource(this.sourceId)){const e={type:"geojson",data:{type:"FeatureCollection",features:this.renderer.features}};this.map.addSource(this.sourceId,e)}if(!this.map.getLayer(this.sourceId)){const e=Object.assign({id:this.sourceId,type:"line",source:this.sourceId},this.renderer._transformStrokeStyle());this.map.addLayer(e)}}_getLatPoints(e,t,r,s){return this.renderer._getLatPoints(e,t,r,s)}_bindEvent(){this.map.on("styledata",this.styleDataEevent),this.map.on("resize",this.resizeEvent),this.map.on("zoomend",this.zoomendEvent)}_unbindEvent(){this.map.off("styledata",this.styleDataEevent),this.map.off("resize",this.resizeEvent),this.map.off("zoomend",this.zoomendEvent)}_setLayerTop(){const e=this.map;if(!e)return;const t=e.getStyle&&e.getStyle().layers;t&&t.length&&t.findIndex(e=>e.id===this.sourceId)!==t.length-1&&e.getLayer(this.sourceId)&&(e.removeLayer(this.sourceId),this.addGraticuleLayer())}updateGraticuleLayer(e=this.features){if(this.map.getSource(this.sourceId)){const t={type:"FeatureCollection",features:e};this.map.getSource(this.sourceId).setData(t)}this.addGraticuleLayer()}},t().supermap.HeatMapLayer=class extends t().Evented{constructor(e,t){super();var r=t||{};this.options=r,this.name=e,this.id=r.id?r.id:m.createUniqueID("HeatMapLayer_"),this.loadWhileAnimating=void 0===r.loadWhileAnimating||r.loadWhileAnimating,this.features={},this.EVENT_TYPES=["featuresadded","featuresremoved","featuresdrawcompleted"],this.type="custom",this.renderingMode="3d",this.overlay=!0}onAdd(e){this.map=e;const t=this.map.getCanvasContainer(),r=this.map.getCanvas();this.renderer=new Kt({id:this.id,...this.options,convertLatlonToPixel:this._convertLatlonToPixel.bind(this),targetElement:t,mapElement:r}),this.features.features&&this.features.features.length&&(this.renderer.setExtent(this.map.getBounds()),this.renderer.addFeatures(this.features))}onRemove(){this.removeAllFeatures(),this.renderer.removeFromMap(),this.features={},this.renderer=null}render(){this.refresh()}addFeatures(e){this.renderer?this.renderer.addFeatures(e):this.features=e,this.fire(this.EVENT_TYPES[0],{features:e,succeed:!0})}refresh(){this.map&&(this.renderer.setExtent(this.map.getBounds()),this.renderer.refresh())}setOpacity(e){e!==this.opacity&&(this.renderer.setOpacity(e),null!==this.map&&this.fire("changelayer",{layer:this,property:"opacity"}))}updateHeatPoints(e){this.renderer.updateHeatPoints(e)}getPixelXY(e){return this.renderer.getPixelXY(e)}removeFeatures(e){const t=this.renderer.removeFeatures(e);if(!t)return;const{heatPointsFailedRemoved:r,succeed:s}=t;this.fire(this.EVENT_TYPES[1],{features:r,succeed:s})}removeAllFeatures(){this.renderer.removeAllFeatures()}moveTo(e,t){var r=document.getElementById(this.renderer.rootCanvas.id);if(t=void 0===t||t){var s=document.getElementById(e);r&&s&&s.parentNode.insertBefore(r,s)}else{var i=document.getElementById(e);if(r){if(i.nextSibling)return void i.parentNode.insertBefore(r,i.nextSibling);i.parentNode.appendChild(r)}}}setVisibility(e){this.renderer.setVisibility(e)}_convertLatlonToPixel(e){return this.map.project(new(t().LngLat)(e.lon,e.lat))}},t().supermap.LabelThemeLayer=class extends At{constructor(e,t){super(e,t),this.isOverLay=!0,this.isAvoid=!0,this.themeField=null,this.styleGroups=null,m.extend(this,t),this.defaultStyle={fontColor:"#000000",fontOpacity:1,fontSize:"12px",fontStyle:"normal",fontWeight:"normal",labelAlign:"cm",labelXOffset:0,labelYOffset:0,labelRotation:0,fill:!1,fillColor:"#ee9900",fillOpacity:.4,stroke:!1,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",labelRect:!0,labelSelect:!0,_isGeoTextStrategyStyle:!0},this.getPxBoundsMode=0,this.labelFeatures=[]}redrawThematicFeatures(e){if(this.features.length>0&&0==this.labelFeatures.length)for(var t=this.setLabelsStyle(this.features),r=0,s=t.length;r=0&&f.x<=c.x&&f.y>=0&&f.y<=c.y){if(r.style.minZoomLevel>-1&&h<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&h>r.style.maxZoomLevel)continue;var y=null;r.isStyleChange?(r.isStyleChange=null,y=this.calculateLabelBounds(r,f)):y=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,f):this.calculateLabelBounds(r,f);var g=new S(0,c.y,c.x,0),v=y.length;if(this.isAvoid){var b=this.getAvoidInfo(g,y);if(b){if("left"===b.aspectW){r.style.labelXOffset+=b.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;sthis.mapVOptions.maxZoom)}_getResolution(){var e=this.map.getBounds(),t=(e.getEast()-e.getWest())/this.map.getCanvas().getBoundingClientRect().width;return Pt("DEGREE")*t}_getCenterPixel(){return this.map.project(new(t().LngLat)(0,0))}addData(e,t){this.renderer.addData(e,t)}update(e){this.renderer.update(e)}getData(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}removeData(e){this.renderer&&this.renderer.removeData(e)}clearData(){this.renderer.clearData()}show(){return this.renderer&&this.renderer.show(),this}hide(){return this.renderer&&this.renderer.hide(),this}getTopLeft(){var e,t=this.map;return t&&(e=t.getBounds().getNorthWest()),e}bindEvent(){var e=this.map;this.mapVOptions.methods&&(this.mapVOptions.methods.click&&e.on("click",this.renderer.clickEvent),this.mapVOptions.methods.mousemove&&e.on("mousemove",this.renderer.mousemoveEvent))}unbindEvent(){var e=this.map;this.mapvOptions.methods&&(this.mapvOptions.methods.click&&e.off("click",this.clickEvent),this.mapvOptions.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}setVisibility(e){e!==this.visibility&&(this.visibility=e,e?this.show():this.hide())}setZIndex(e){this.renderer.setZIndex(e)}},t().supermap.FGBLayer=oi,t().supermap.RangeTheme3DLayer=class extends Mt{constructor(e,t){super(e,t),this.heightStops=null,this.colorStops=null,this.base=null,this.legendRatio=1,this._extend(this,t)}getLayerStyleOptions(){var e=null==this.opacity?1:this.opacity;e=isNaN(parseFloat(e))?1:parseFloat(e);var t=/^[0-9]+.?[0-9]*$/,r={"fill-extrusion-color":{stops:this.colorStops,property:this.themeField||this.heightField,type:"interval",base:t.test(this.base)?this.base:1},"fill-extrusion-opacity":e};return this.heightStops?r["fill-extrusion-height"]={stops:this.heightStops,property:this.heightField||"height",base:t.test(this.base)?this.base:1}:this.height?r["fill-extrusion-height"]=this.height:r["fill-extrusion-height"]={property:this.heightField||"height",type:"identity"},this.baseHeightField&&(r["fill-extrusion-base"]={property:this.baseHeightField,type:"identity"}),r}getHighlightStyleOptions(){return{"fill-extrusion-color":this.highlight&&null!=this.highlight.color?this.highlight.color:"#ADA91E","fill-extrusion-height":{stops:this.heightStops,property:this.heightField},"fill-extrusion-opacity":this.highlight&&this.highlight.opacity||.6}}_createLegendElement(){var e,t=this.colorStops&&this.colorStops.length||0,r="
    ";for(e=0;e "+i:i+"-"+this._getWrapperText(this.colorStops[e+1][0]),r+="
  • "+i+"
  • "}return r+="
"}_getWrapperText(e){var t=e*(null==this.legendRatio?1:parseFloat(this.legendRatio)),r=parseFloat(t);return r%1e6<=1e6?r.toString():parseInt(r/1e3)+"k"}},t().supermap.RangeThemeLayer=class extends At{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}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=wt.transformStyle(this.highlightStyle);for(var s=new Ct(e,this,wt.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"+s+""}return e+=""}},t().supermap.UniqueThemeLayer=class extends At{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}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=wt.transformStyle(this.highlightStyle);for(var s=new Ct(e,this,wt.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{this.fire(this.EVENT_TYPES[0])}),this.graph.setData(s),this.graph.handleNodeStatus(function(e){const{expand:t,collapse:r,hidden:s}=e.dataContent;return{expand:t&&JSON.parse(t),collapse:r&&JSON.parse(r),hidden:s&&JSON.parse(s)}}(r.graphMap))}createKnowledgeGraphService(e,t){return new di(e,t)}},t().supermap.AddressMatchService=class extends li{constructor(e,t){super(e,t),this._addressMatchService=new Xi(e,t)}code(e,t){this._addressMatchService.code(m.urlPathAppend(this.url,"geocoding"),e,t)}decode(e,t){this._addressMatchService.decode(m.urlPathAppend(this.url,"geodecoding"),e,t)}},t().supermap.ChartService=class extends li{constructor(e,t){super(e,t),this._chartService=new tn(e,t)}queryChart(e,t,r){this._chartService.queryChart(e,t,r)}getChartFeatureInfo(e){this._chartService.getChartFeatureInfo(e)}_processFormat(e){return e||G.GEOJSON}},t().supermap.DataFlowService=class extends li{constructor(e,t){(t=t||{}).projection&&(t.prjCoordSys=t.projection),super(e,t),this.dataFlow=new rn(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});var r=this;r.on("subscribeSocketConnected",function(e){r.fire("subscribesucceeded",e)})}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.fire(e.eventType||e.type,e)}},t().supermap.DatasetService=class extends li{constructor(e,t){super(e,t),this._datasetService=new sn(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getDatasets(e,t){e&&this._datasetService.getDatasetsService(e,t)}getDataset(e,t,r){e&&t&&this._datasetService.getDatasetService(e,t,r)}setDataset(e,t){if(e instanceof nn||e instanceof an){if(e instanceof nn)var r={datasetType:e.datasetType,datasetName:e.datasetName,datasourceName:e.datasourceName};else e instanceof an&&(r={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});this._datasetService.setDatasetService(r,t)}}deleteDataset(e,t,r){this._datasetService.deleteDatasetService(e,t,r)}},t().supermap.DatasourceService=class extends li{constructor(e,t){super(e,t),this._datasourceService=new ln(this.url,{proxy:this.proxy,withCredentials:this.withCredentials,crossOrigin:this.crossOrigin,headers:this.headers})}getDatasources(e){this._datasourceService.getDatasourcesService(e)}getDatasource(e,t){e&&this._datasourceService.getDatasourceService(e,t)}setDatasource(e,t){if(!(e instanceof on))return;const r={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};this._datasourceService.setDatasourceService(r,t)}},t().supermap.FeatureService=class extends li{constructor(e,t){super(e,t),this._featureService=new Cn(e,t)}getFeaturesByIDs(e,t,r){e=this._processParams(e),this._featureService.getFeaturesByIDs(e,t,r)}getFeaturesByBounds(e,t,r){e=this._processParams(e),this._featureService.getFeaturesByBounds(e,t,r)}getFeaturesByBuffer(e,t,r){e=this._processParams(e),this._featureService.getFeaturesByBuffer(e,t,r)}getFeaturesBySQL(e,t,r){e=this._processParams(e),this._featureService.getFeaturesBySQL(e,t,r)}getFeaturesByGeometry(e,t,r){e=this._processParams(e),this._featureService.getFeaturesByGeometry(e,t,r)}editFeatures(e,t){if(e&&e.dataSourceName&&e.dataSetName){var r=this,s=r.url,i=e.dataSourceName,n=e.dataSetName;s=m.urlPathAppend(s,"datasources/"+i+"/datasets/"+n),new un(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 r=this;if(e.returnContent=null==e.returnContent||e.returnContent,e.fromIndex=e.fromIndex?e.fromIndex:0,e.toIndex=0===e.toIndex?0:e.toIndex?e.toIndex:-1,e.bounds&&(e.bounds=Le.toSuperMapBounds(e.bounds)),e.editType&&(e.editType=e.editType.toLowerCase()),e.geometry&&(e.geometry instanceof t().LngLatBounds?(e.geometry=Le.toSuperMapPolygon(e.geometry),e.geometry.SRID=4326):e.geometry instanceof t().Point?e.geometry=new x(e.geometry.x,e.geometry.y):e.geometry instanceof t().LngLat?(e.geometry=new x(e.geometry.lng,e.geometry.lat),e.geometry.SRID=4326):e.geometry instanceof d||(e.geometry=Le.toSuperMapGeometry(e.geometry))),e.features){var s=[];Le.isArray(e.features)?e.features.map(function(e){return s.push(r._createServerFeature(e)),s}):s.push(r._createServerFeature(e.features)),e.features=s}return e}_createServerFeature(e){var t={},r=[],s=[],i=e.properties;for(var n in i)r.push(n),s.push(i[n]);return t.fieldNames=r,t.fieldValues=s,e.id&&(t.id=e.id),t.geometry=Le.toSuperMapGeometry(e),t}},t().supermap.FieldService=class extends li{constructor(e,t){super(e,t),this._fieldService=new Pn(e,t)}getFields(e,t){this._fieldService.getFields(e,t)}getFieldStatisticsInfo(e,t){this._fieldService.getFieldStatisticsInfo(e,t)}},t().supermap.GeoprocessingService=class extends li{constructor(e,t){super(e,t),this.headers={},this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0,this._geoprocessingJobsService=new Mn(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getTools(e){this._geoprocessingJobsService.getTools(e)}getTool(e,t){this._geoprocessingJobsService.getTool(e,t)}execute(e,t,r,s){this._geoprocessingJobsService.execute(e,t,r,s)}submitJob(e,t,r,s){this._geoprocessingJobsService.submitJob(e,t,r,s)}waitForJobCompletion(e,t,r,s){this._geoprocessingJobsService.waitForJobCompletion(e,t,r,s)}getJobInfo(e,t,r){this._geoprocessingJobsService.getJobInfo(e,t,r)}cancelJob(e,t,r){this._geoprocessingJobsService.cancelJob(e,t,r)}getJobs(e,t){this._geoprocessingJobsService.getJobs(e,t)}getResults(e,t,r,s){this._geoprocessingJobsService.getResults(e,t,r,s)}},t().supermap.GridCellInfosService=class extends li{constructor(e,t){super(e,t),this._gridCellQueryService=new In(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getGridCellInfos(e,t){if(!e)return null;this._gridCellQueryService.processAsync(e,t)}},t().supermap.ImageCollectionService=class extends li{constructor(e,t){super(e,t),this._imageCollectionService=new Ul(this.url,{collectionId:this.options.collectionId,proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getLegend(e,t){this._imageCollectionService.getLegend(e,t)}getStatistics(e){this._imageCollectionService.getStatistics(e)}getTileInfo(e){this._imageCollectionService.getTileInfo(e)}deleteItemByID(e,t){this._imageCollectionService.deleteItemByID(e,t)}getItemByID(e,t){this._imageCollectionService.getItemByID(e,t)}},t().supermap.ImageService=class extends li{constructor(e,t){super(e,t),this._imageService=new jl(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})}getCollections(e){this._imageService.getCollections(e)}getCollectionByID(e,t){this._imageService.getCollectionByID(e,t)}search(e,t){this._imageService.search(e,t)}},t().supermap.LayerInfoService=class extends li{constructor(e,t){super(e,t),this._layerInfoService=new ya(e,t)}getLayersInfo(e){this._layerInfoService.getLayersInfo(e)}setLayerInfo(e,t){this._layerInfoService.setLayerInfo(e,t)}setLayersInfo(e,t){this._layerInfoService.setLayersInfo(e,t)}setLayerStatus(e,t){this._layerInfoService.setLayerStatus(e,t)}},t().supermap.MapService=class extends li{constructor(e,t){super(e,t)}getMapInfo(e){var t=this;new ma(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection}).processAsync(e)}getTilesets(e){var t=this;new ga(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()}},t().supermap.MeasureService=class extends li{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 ba(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,measureMode:t}).processAsync(s._processParam(e),r)}_processParam(e){return!e||e.geometry instanceof d||(e.geometry=Le.toSuperMapGeometry(e.geometry)),e}},t().supermap.NetworkAnalyst3DService=class extends li{constructor(e,t){super(e,t),this._networkAnalyst3DService=new so(e,t)}sinksFacilityAnalyst(e,t){this._networkAnalyst3DService.sinksFacilityAnalyst(e,t)}sourcesFacilityAnalyst(e,t){this._networkAnalyst3DService.sourcesFacilityAnalyst(e,t)}traceUpFacilityAnalyst(e,t){this._networkAnalyst3DService.traceUpFacilityAnalyst(e,t)}traceDownFacilityAnalyst(e,t){this._networkAnalyst3DService.traceDownFacilityAnalyst(e,t)}upstreamFacilityAnalyst(e,t){this._networkAnalyst3DService.upstreamFacilityAnalyst(e,t)}},t().supermap.NetworkAnalystService=class extends li{constructor(e,t){super(e,t),this._networkAnalystService=new za(e,t)}burstPipelineAnalyst(e,t){e=this._processParams(e),this._networkAnalystService.burstPipelineAnalyst(e,t)}computeWeightMatrix(e,t){e=this._processParams(e),this._networkAnalystService.computeWeightMatrix(e,t)}findClosestFacilities(e,t,r){e=this._processParams(e),this._networkAnalystService.findClosestFacilities(e,t,r)}streamFacilityAnalyst(e,t,r){e=this._processParams(e),this._networkAnalystService.streamFacilityAnalyst(e,t,r)}findLocation(e,t,r){e=this._processParams(e),this._networkAnalystService.findLocation(e,t,r)}findPath(e,t,r){e=this._processParams(e),this._networkAnalystService.findPath(e,t,r)}findTSPPaths(e,t,r){e=this._processParams(e),this._networkAnalystService.findTSPPaths(e,t,r)}findMTSPPaths(e,t,r){e=this._processParams(e),this._networkAnalystService.findMTSPPaths(e,t,r)}findServiceAreas(e,t,r){e=this._processParams(e),this._networkAnalystService.findServiceAreas(e,t,r)}updateEdgeWeight(e,t){this._networkAnalystService.updateEdgeWeight(e,t)}updateTurnNodeWeight(e,t){this._networkAnalystService.updateTurnNodeWeight(e,t)}_processParams(e){if(!e)return{};var r=this;if(e.centers&&Le.isArray(e.centers)&&e.centers.map(function(t,s){return e.centers[s]=r._toPointObject(t),e.centers[s]}),e.nodes&&Le.isArray(e.nodes)&&e.nodes.map(function(t,s){return e.nodes[s]=r._toPointObject(t),e.nodes[s]}),e.event&&(e.event=r._toPointObject(e.event)),e.facilities&&Le.isArray(e.facilities)&&e.facilities.map(function(t,s){return e.facilities[s]=r._toPointObject(t),e.facilities[s]}),e.parameter&&e.parameter.barrierPoints){var s=e.parameter.barrierPoints;Le.isArray(s)?s.map(function(t,s){return e.parameter[s]=r._toPointObject(t),e.parameter.barrierPoints[s]}):e.parameter.barrierPoints=[s instanceof t().LngLat?{x:s.lng,y:s.lat}:s]}return e}_toPointObject(e){return Le.isArray(e)?{x:e[0],y:e[1]}:e instanceof t().LngLat?{x:e.lng,y:e.lat}:e instanceof t().Point?{x:e.x,y:e.y}:e}_processFormat(e){return e||G.GEOJSON}},t().supermap.ProcessingService=class extends li{constructor(e,t){super(e,t),this._processingService=new To(e,t)}getKernelDensityJobs(e,t){this._processingService.getKernelDensityJobs(e,t)}getKernelDensityJob(e,t,r){this._processingService.getKernelDensityJob(e,t,r)}addKernelDensityJob(e,t,r,s){e=this._processParams(e),this._processingService.addKernelDensityJob(e,t,r,s)}getKernelDensityJobState(e){return this._processingService.getKernelDensityJobState(e)}getSummaryMeshJobs(e,t){this._processingService.getSummaryMeshJobs(e,t)}getSummaryMeshJob(e,t,r){this._processingService.getSummaryMeshJob(e,t,r)}addSummaryMeshJob(e,t,r,s){e=this._processParams(e),this._processingService.addSummaryMeshJob(e,t,r,s)}getSummaryMeshJobState(e){return this._processingService.getSummaryMeshJobState(e)}getQueryJobs(e,t){this._processingService.getQueryJobs(e,t)}getQueryJob(e,t,r){this._processingService.getQueryJob(e,t,r)}addQueryJob(e,t,r,s){e=this._processParams(e),this._processingService.addQueryJob(e,t,r,s)}getQueryJobState(e){return this._processingService.getQueryJobState(e)}getSummaryRegionJobs(e,t){this._processingService.getSummaryRegionJobs(e,t)}getSummaryRegionJob(e,t,r){this._processingService.getSummaryRegionJob(e,t,r)}addSummaryRegionJob(e,t,r,s){e=this._processParams(e),this._processingService.addSummaryRegionJob(e,t,r,s)}getSummaryRegionJobState(e){return this._processingService.getSummaryRegionJobState(e)}getVectorClipJobs(e,t){this._processingService.getVectorClipJobs(e,t)}getVectorClipJob(e,t,r){this._processingService.getVectorClipJob(e,t,r)}addVectorClipJob(e,t,r,s){e=this._processParams(e),this._processingService.addVectorClipJob(e,t,r,s)}getVectorClipJobState(e){return this._processingService.getVectorClipJobState(e)}getOverlayGeoJobs(e,t){this._processingService.getOverlayGeoJobs(e,t)}getOverlayGeoJob(e,t,r){this._processingService.getOverlayGeoJob(e,t,r)}addOverlayGeoJob(e,t,r,s){e=this._processParams(e),this._processingService.addOverlayGeoJob(e,t,r,s)}getoverlayGeoJobState(e){return this._processingService.getoverlayGeoJobState(e)}getBuffersJobs(e,t){this._processingService.getBuffersJobs(e,t)}getBuffersJob(e,t,r){this._processingService.getBuffersJob(e,t,r)}addBuffersJob(e,t,r,s){e=this._processParams(e),this._processingService.addBuffersJob(e,t,r,s)}getBuffersJobState(e){return this._processingService.getBuffersJobState(e)}getTopologyValidatorJobs(e,t){this._processingService.getTopologyValidatorJobs(e,t)}getTopologyValidatorJob(e,t,r){this._processingService.getTopologyValidatorJob(e,t,r)}addTopologyValidatorJob(e,t,r,s){e=this._processParams(e),this._processingService.addTopologyValidatorJob(e,t,r,s)}getTopologyValidatorJobState(e){return this._processingService.getTopologyValidatorJobState(e)}getSummaryAttributesJobs(e,t){this._processingService.getSummaryAttributesJobs(e,t)}getSummaryAttributesJob(e,t,r){this._processingService.getSummaryAttributesJob(e,t,r)}addSummaryAttributesJob(e,t,r,s){e=this._processParams(e),this._processingService.addSummaryAttributesJob(e,t,r,s)}getSummaryAttributesJobState(e){return this._processingService.getSummaryAttributesJobState(e)}_processFormat(e){return e||G.GEOJSON}_processParams(e){return e?(e.bounds&&(e.bounds=Le.toSuperMapBounds(e.bounds)),e.query&&(e.query=Le.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=Le.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=Le.toProcessingParam(e.geometryClip)),e):{}}},t().supermap.QueryService=Bo,t().supermap.ServiceBase=li,t().supermap.SpatialAnalystService=class extends li{constructor(e,t){super(e,t),this._spatialAnalystService=new Pl(e,t)}getAreaSolarRadiationResult(e,t,r){this._spatialAnalystService.getAreaSolarRadiationResult(e,t,r)}bufferAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.bufferAnalysis(e,t,r)}densityAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.densityAnalysis(e,t,r)}generateSpatialData(e,t,r){this._spatialAnalystService.generateSpatialData(e,t,r)}geoRelationAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.geoRelationAnalysis(e,t,r)}interpolationAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.interpolationAnalysis(e,t,r)}mathExpressionAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.mathExpressionAnalysis(e,t,r)}overlayAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.overlayAnalysis(e,t,r)}routeCalculateMeasure(e,t,r){e=this._processParams(e),this._spatialAnalystService.routeCalculateMeasure(e,t,r)}routeLocate(e,t,r){e=this._processParams(e),this._spatialAnalystService.routeLocate(e,t,r)}surfaceAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.surfaceAnalysis(e,t,r)}terrainCurvatureCalculate(e,t,r){this._spatialAnalystService.terrainCurvatureCalculate(e,t,r)}thiessenAnalysis(e,t,r){e=this._processParams(e),this._spatialAnalystService.thiessenAnalysis(e,t,r)}geometrybatchAnalysis(e,t,r){for(var s=0;s{"use strict"})()})();