/*! * * iclient-leaflet * Copyright© 2000 - 2023 SuperMap Software Co.Ltd * license: Apache-2.0 * version: v11.1.0 * */(()=>{var e={550:e=>{"use strict";function t(e,t){this.x=e,this.y=t}e.exports=t,t.prototype={clone:function(){return new t(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,s=i*this.x+t*this.y;return this.x=r,this.y=s,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),s=t.x+i*(this.x-t.x)-r*(this.y-t.y),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=s,this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},t.convert=function(e){return e instanceof t?e:Array.isArray(e)?new t(e[0],e[1]):e}},929:(e,t,i)=>{e.exports.VectorTile=i(779),i(24),i(701)},779:(e,t,i)=>{"use strict";var r=i(701);function s(e,t,i){if(3===e){var s=new r(i,i.readVarint()+i.pos);s.length&&(t[s.name]=s)}}e.exports=function(e,t){this.layers=e.readFields(s,{},t)}},24:(e,t,i)=>{"use strict";var r=i(550);function s(e,t,i,r,s){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=s,e.readFields(n,this,t)}function n(e,t,i){1==e?t.id=i.readVarint():2==e?function(e,t){var i=e.readVarint()+e.pos;for(;e.pos>3}if(n--,1===s||2===s)a+=e.readSVarint(),o+=e.readSVarint(),1===s&&(t&&l.push(t),t=[]),t.push(new r(a,o));else{if(7!==s)throw new Error("unknown command "+s);t&&t.push(t[0].clone())}}return t&&l.push(t),l},s.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,s=0,n=0,a=1/0,o=-1/0,l=1/0,h=-1/0;e.pos>3}if(r--,1===i||2===i)s+=e.readSVarint(),n+=e.readSVarint(),so&&(o=s),nh&&(h=n);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,o,h]},s.prototype.toGeoJSON=function(e,t,i){var r,n,o=this.extent*Math.pow(2,i),l=this.extent*e,h=this.extent*t,u=this.loadGeometry(),c=s.types[this.type];function d(e){for(var t=0;t{"use strict";var r=i(24);function s(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(n,this,t),this.length=this._features.length}function n(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){var t=null,i=e.readVarint()+e.pos;for(;e.pos>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t}(i))}e.exports=s,s.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}},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 i=this.map[e];i||(i=[],this.map[e]=i),i.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(i){this.map[i].forEach(function(r){e.call(t,r,i,this)},this)},this)};var i={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},r=["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 s=[301,302,303,307,308];f.redirect=function(e,t){if(-1===s.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(r,s){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 s(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 i=e.trim().split(":"),r=i.shift().trim(),s=i.join(":").trim();t.append(r,s)}),t}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},i="response"in a?a.response:a.responseText;l||(l=!0,r(new f(i,t)))}}a.onreadystatechange=h,a.onload=h,a.onerror=function(){l||(l=!0,s(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&&i.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,i){e.onload=function(){t(e.result)},e.onerror=function(){i(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(i.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(i.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!i.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},i.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,i,r,s,n,a,o=l(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,i=new FileReader,r=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",s=/charset\=[0-9a-zA-Z\-\_]*;?/,n=e.type.match(s)||r.match(s),a=[e],n&&a.push(n[0].replace(/^charset\=/,"").replace(/;$/,"")),i.readAsText.apply(i,a),h(i);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)},i.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(e,t){var i,s,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=(i=t.method||this.method||"GET",s=i.toUpperCase(),r.indexOf(s)>-1?s:i),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 i=e.split("="),r=i.shift().replace(/\+/g," "),s=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(s))}}),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 i,r,s;r=[t,e],void 0===(s="function"==typeof(i=function(e,t){"use strict";var i={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function r(e){try{delete window[e]}catch(t){window[e]=void 0}}function s(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||i.timeout,o=t.jsonpCallback||i.jsonpCallback,l=void 0;return new Promise(function(i,h){var u=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),c=o+"_"+u;window[u]=function(e){i({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),s(c),r(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")),r(u),s(c),window[u]=function(){r(u)}},a),d.onerror=function(){h(new Error("JSONP request to "+e+" failed")),r(u),s(c),l&&clearTimeout(l)}})}})?i.apply(t,r):i)||(e.exports=s)},962:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Builder=void 0;var r=i(505),s=i(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=r.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,i){t>this.minalign&&(this.minalign=t);for(var r=1+~(this.bb.capacity()-this.space+i)&t-1;this.space=0&&0==this.vtable[t];t--);for(var i=t+1;t>=0;t--)this.addInt16(0!=this.vtable[t]?e-this.vtable[t]:0);this.addInt16(e-this.object_start);var r=(i+2)*s.SIZEOF_SHORT;this.addInt16(r);var n=0,a=this.space;e:for(t=0;t=0;a--)this.writeInt8(n.charCodeAt(a))}this.prep(this.minalign,s.SIZEOF_INT+r),this.addOffset(e),r&&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 i=this.bb.capacity()-e,r=i-this.bb.readInt32(i);if(!(0!=this.bb.readInt16(r+t)))throw new Error("FlatBuffers: field "+t+" must be set")},e.prototype.startVector=function(e,t,i){this.notNested(),this.vector_num_elems=t,this.prep(s.SIZEOF_INT,e*t),this.prep(i,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 i=0;i=56320)r=s;else r=(s<<10)+e.charCodeAt(i++)+-56613888;r<128?t.push(r):(r<2048?t.push(r>>6&31|192):(r<65536?t.push(r>>12&15|224):t.push(r>>18&7|240,r>>12&63|128),t.push(r>>6&63|128)),t.push(63&r|128))}}this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length);i=0;for(var n=this.space,a=this.bb.bytes();i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ByteBuffer=void 0;var r=i(147),s=i(766),n=i(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){s.float32[0]=t,this.writeInt32(e,s.int32[0])},e.prototype.writeFloat64=function(e,t){s.float64[0]=t,this.writeInt32(e,s.int32[s.isLittleEndian?0:1]),this.writeInt32(e+4,s.int32[s.isLittleEndian?1:0])},e.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&o)))}return s},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)+r.SIZEOF_INT},e.prototype.__vector_len=function(e){return this.readInt32(e+this.readInt32(e))},e.prototype.__has_identifier=function(e){if(e.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.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,i)=>{"use strict";t.cZ=t.XU=void 0;var r=i(147);var s=i(147);var n=i(147);var a=i(147);Object.defineProperty(t,"XU",{enumerable:!0,get:function(){return a.SIZE_PREFIX_LENGTH}});var o=i(766);var l=i(650);var h=i(962);var u=i(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]},645:(e,t)=>{t.read=function(e,t,i,r,s){var n,a,o=8*s-r-1,l=(1<>1,u=-7,c=i?s-1:0,d=i?-1:1,p=e[t+c];for(c+=d,n=p&(1<<-u)-1,p>>=-u,u+=o;u>0;n=256*n+e[t+c],c+=d,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=r;u>0;a=256*a+e[t+c],c+=d,u-=8);if(0===n)n=1-h;else{if(n===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),n-=h}return(p?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,s,n){var a,o,l,h=8*n-s-1,u=(1<>1,d=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:n-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+c>=1?d/l:d*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=u?(o=0,a=u):a+c>=1?(o=(t*l-1)*Math.pow(2,s),a+=c):(o=t*Math.pow(2,c-1)*Math.pow(2,s),a=0));s>=8;e[i+p]=255&o,p+=f,o/=256,s-=8);for(a=a<0;e[i+p]=255&a,p+=f,a/=256,h-=8);e[i+p-f]|=128*m}},186:e=>{var t=[],i=[],r="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function s(e,s){if(s=s||{},void 0===e)throw new Error(r);var n,a=!0===s.prepend?"prepend":"append",o=void 0!==s.container?s.container:document.querySelector("head"),l=t.indexOf(o);return-1===l&&(l=t.push(o)-1,i[l]={}),void 0!==i[l]&&void 0!==i[l][a]?n=i[l][a]:(n=i[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=s,e.exports.insertCss=s},545:(e,t,i)=>{var r=i(820),s="&&",n="||",a="and",o="or",l="=",h="~",u="!"+l,c="!"+h,d=">",p=">=",f="<",m="<=",y="*",g=",",v=".",b="(",_=")",S="where",x={pathway:[],groups:{}},w={},C={},M=console.log;function A(e){var t=E(e,S),i=t[0],r=t[1];x.pathway=E(i,g);for(var a=0,o=x.pathway.length;aC&&-1!==C){var O="gr_"+(new Date).getTime();x.groups[O]=r.substring(C+1,M),r=r.replace(b+x.groups[O]+_,O),A=-1}A+=1}!function e(t,i){var r=T(i,s),a=T(i,n);if(r!==Number.MAX_VALUE||a!==Number.MAX_VALUE)if(r-1}function O(e,t){var i=E(t,v),s=e;for(var n in i){if(!s.hasOwnProperty(i[n]))return"";s=s[i[n]]}return s=r.isDate(s)?s.valueOf():r.isDateString(s)?r.parseDateFromString(s):s.toString()}function P(e,t){var i=!1;for(var r in e){if(i=i||(r===a?N:r===o?P:I)(e[r],t),C.trace&&M(x.step,"======((( or",e[r],i),i)return i}return i}function N(e,t){var i=!0;for(var r in e){if(i=i&&(r===a?N:r===o?P:I)(e[r],t),C.trace&&M(x.step,"======((( and",e[r],i),!i)return i}return i}function I(e,t){if(x.step+=1,e.or){var i=P(e.or,t);return C.trace&&M(x.step,"OR",e,i),i}if(e.and){i=N(e.and,t);return C.trace&&M(x.step,"AND",e,i),i}if("object"==typeof e)return e.eq?O(t,e.eq[0])===e.eq[1]:e.ne?O(t,e.ne[0])!==e.ne[1]:e.req?L(O(t,e.req[0]),e.req[1]):e.nreq?!L(O(t,e.nreq[0]),e.nreq[1]):e.gt?O(t,e.gt[0])>e.gt[1]:e.ge?O(t,e.ge[0])>=e.ge[1]:e.lt?O(t,e.lt[0])0?r.map(function(e){for(var t={},i=0,r=x.pathway.length;i{function t(e){return Object.prototype.toString.call(e)}function i(e){return"[object String]"===t(e)}e.exports={getObjectType:t,isDate:function(e){return"[object Date]"===t(e)},isString:i,isDateString:function(e){return i(e)&&!isNaN(Date.parse(e))},parseDateFromString:function(e){return Date.parse(e)},isNumber:function(e){return"number"==typeof e}}},465:(e,t,i)=>{e=i.nmd(e);var r=200,s="__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]",m="[object Set]",y="[object String]",g="[object Symbol]",v="[object ArrayBuffer]",b="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",x="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",M="[object Uint8Array]",A="[object Uint8ClampedArray]",T="[object Uint16Array]",E="[object Uint32Array]",L=/\w*$/,O=/^\[object .+?Constructor\]$/,P=/^(?:0|[1-9]\d*)$/,N={};N[a]=N["[object Array]"]=N[v]=N[b]=N[o]=N[l]=N[_]=N[S]=N[x]=N[w]=N[C]=N[c]=N[d]=N[p]=N[f]=N[m]=N[y]=N[g]=N[M]=N[A]=N[T]=N[E]=!0,N["[object Error]"]=N[h]=N["[object WeakMap]"]=!1;var I="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g,F="object"==typeof self&&self&&self.Object===Object&&self,k=I||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 U(e,t){return e.add(t),e}function j(e,t,i,r){var s=-1,n=e?e.length:0;for(r&&n&&(i=e[++s]);++s-1},Me.prototype.set=function(e,t){var i=this.__data__,r=Oe(i,e);return r<0?i.push([e,t]):i[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ce,map:new(de||Me),string:new Ce}},Ae.prototype.delete=function(e){return ke(this,e).delete(e)},Ae.prototype.get=function(e){return ke(this,e).get(e)},Ae.prototype.has=function(e){return ke(this,e).has(e)},Ae.prototype.set=function(e,t){return ke(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Me},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 i=this.__data__;if(i instanceof Me){var s=i.__data__;if(!de||s.length-1&&e%1==0&&e-1&&e%1==0&&e<=n}(e.length)&&!He(e)}var qe=he||function(){return!1};function He(e){var t=We(e)?$.call(e):"";return t==h||t==u}function We(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return Je(e)?Ee(e):function(e){if(!Ue(e))return ue(e);var t=[];for(var i in Object(e))K.call(e,i)&&"constructor"!=i&&t.push(i);return t}(e)}e.exports=function(e){return Pe(e,!0,!0)}},52:(e,t,i)=>{var r=9007199254740991,s="[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 i.g&&i.g&&i.g.Object===Object&&i.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 i=-1,r=e?e.length:0,s=Array(r);++i-1&&e%1==0&&e-1&&e%1==0&&e<=r}(e.length)&&!J(e)}function J(e){var t=q(e)?S.call(e):"";return t==n||t==a}function q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var H=function(e){return function(t){var i,r,s,n=G(t);return n==o?(i=t,r=-1,s=Array(i.size),i.forEach(function(e,t){s[++r]=[t,e]}),s):n==l?function(e){var t=-1,i=Array(e.size);return e.forEach(function(e){i[++t]=[e,e]}),i}(t):f(t,e(t))}}(function(e){return V(e)?k(e):R(e)});e.exports=H},618:(e,t,i)=>{e=i.nmd(e);var r=200,s="Expected a function",n="__lodash_hash_undefined__",a=1,o=2,l=1/0,h=9007199254740991,u="[object Arguments]",c="[object Array]",d="[object Boolean]",p="[object Date]",f="[object Error]",m="[object Function]",y="[object GeneratorFunction]",g="[object Map]",v="[object Number]",b="[object Object]",_="[object RegExp]",S="[object Set]",x="[object String]",w="[object Symbol]",C="[object ArrayBuffer]",M="[object DataView]",A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,E=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,P=/^\[object .+?Constructor\]$/,N=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[u]=I[c]=I[C]=I[d]=I[M]=I[p]=I[f]=I[m]=I[g]=I[v]=I[b]=I[_]=I[S]=I[x]=I["[object WeakMap]"]=!1;var F="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.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,U=function(){try{return G&&G.binding("util")}catch(e){}}(),j=U&&U.isTypedArray;function z(e,t){return!!(e?e.length:0)&&function(e,t,i){if(t!=t)return function(e,t,i,r){var s=e.length,n=i+(r?1:-1);for(;r?n--:++n-1}function V(e,t,i){for(var r=-1,s=e?e.length:0;++r-1},Me.prototype.set=function(e,t){var i=this.__data__,r=Oe(i,e);return r<0?i.push([e,t]):i[r][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ce,map:new(ce||Me),string:new Ce}},Ae.prototype.delete=function(e){return Ue(this,e).delete(e)},Ae.prototype.get=function(e){return Ue(this,e).get(e)},Ae.prototype.has=function(e){return Ue(this,e).has(e)},Ae.prototype.set=function(e,t){return Ue(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)},Ee.prototype.clear=function(){this.__data__=new Me},Ee.prototype.delete=function(e){return this.__data__.delete(e)},Ee.prototype.get=function(e){return this.__data__.get(e)},Ee.prototype.has=function(e){return this.__data__.has(e)},Ee.prototype.set=function(e,t){var i=this.__data__;if(i instanceof Me){var s=i.__data__;if(!ce||s.lengthh))return!1;var c=n.get(e);if(c&&n.get(t))return c==t;var d=-1,p=!0,f=s&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 rt(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function st(e){return!!e&&"object"==typeof e}function nt(e){return"symbol"==typeof e||st(e)&&re.call(e)==w}var at=j?function(e){return function(t){return e(t)}}(j):function(e){return st(e)&&it(e.length)&&!!I[re.call(e)]};function ot(e){return et(e)?Le(e):De(e)}function lt(e){return e}e.exports=function(e,t){return e&&e.length?function(e,t,i){var s=-1,n=z,a=e.length,o=!0,l=[],h=l;if(i)o=!1,n=V;else if(a>=r){var u=t?null:Be(e);if(u)return X(u);o=!1,n=H,h=new Te}else h=t?[]:l;e:for(;++s{"use strict";e.exports=s;var r=i(645);function s(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var n="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(e){return e.type===s.Bytes?e.readVarint()+e.pos:e.pos+1}function o(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function l(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var s=i.pos-1;s>=e;s--)i.buf[s+r]=i.buf[s]}function h(e,t){for(var i=0;i>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function _(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}s.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos>3,n=this.pos;this.type=7&r,e(s,t,this),this.pos===n&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=v(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=_(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=v(this.buf,this.pos)+4294967296*v(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=v(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,s,n=i.buf;if(s=n[i.pos++],r=(112&s)>>4,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<3,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<10,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<17,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(127&s)<<24,s<128)return o(e,r,t);if(s=n[i.pos++],r|=(1&s)<<31,s<128)return o(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&n?function(e,t,i){return n.decode(e.subarray(t,i))}(this.buf,t,e):function(e,t,i){var r="",s=t;for(;s239?4:l>223?3:l>191?2:1;if(s+u>i)break;1===u?l<128&&(h=l):2===u?128==(192&(n=e[s+1]))&&(h=(31&l)<<6|63&n)<=127&&(h=null):3===u?(n=e[s+1],a=e[s+2],128==(192&n)&&128==(192&a)&&((h=(15&l)<<12|(63&n)<<6|63&a)<=2047||h>=55296&&h<=57343)&&(h=null)):4===u&&(n=e[s+1],a=e[s+2],o=e[s+3],128==(192&n)&&128==(192&a)&&128==(192&o)&&((h=(15&l)<<18|(63&n)<<12|(63&a)<<6|63&o)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,u=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),s+=u}return r}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==s.Bytes)return e.push(this.readVarint(t));var i=a(this);for(e=e||[];this.pos127;);else if(t===s.Bytes)this.pos=this.readVarint()+this.pos;else if(t===s.Fixed32)this.pos+=4;else{if(t!==s.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?function(e,t){var i,r;e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos]=127&e}(i,0,t),function(e,t){var i=(7&e)<<4;if(t.buf[t.pos++]|=i|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,s,n=0;n55295&&r<57344){if(!s){r>56319||n+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):s=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(e[i++]=239,e[i++]=191,e[i++]=189,s=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;i>=128&&l(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&l(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,s.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,u,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,y,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,s.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,s.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,s.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,s.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,s.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,s.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,s.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,s.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,s.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,s.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},785:function(e){e.exports=function(){"use strict";var e=1,t=2,i=3,r=4,s=5,n=484813681109536e-20,a=Math.PI/2,o=.16666666666666666,l=.04722222222222222,h=.022156084656084655,u=1e-10,c=.017453292519943295,d=57.29577951308232,p=Math.PI/4,f=2*Math.PI,m=3.14159265359,y={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},g={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},v=/[\s_\-\/\(\)]/g;function b(e,t){if(e[t])return e[t];for(var i,r=Object.keys(e),s=t.toLowerCase().replace(v,""),n=-1;++n=this.text.length)return;e=this.text[this.place++]}switch(this.state){case S:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},T.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(M.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},T.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=S)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=S,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},T.prototype.number=function(e){if(!A.test(e)){if(M.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},T.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},T.prototype.keyword=function(e){if(C.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=S)}if(!M.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},T.prototype.neutral=function(e){if(w.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(A.test(e))return this.word=e,void(this.state=3);if(!M.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},T.prototype.output=function(){for(;this.place0?90:-90),e.lat_ts=e.lat1)}(s),s};function I(e){var t=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?I[e]=_(arguments[1]):I[e]=N(arguments[1]):I[e]=i}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?I.apply(t,e):I(e)});if("string"==typeof e){if(e in I)return I[e]}else"EPSG"in e?I["EPSG:"+e.EPSG]=e:"ESRI"in e?I["ESRI:"+e.ESRI]=e:"IAU2000"in e?I["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(I);var F=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],k=["3857","900913","3785","102113"];function D(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in I}(e))return I[e];if(function(e){return F.some(function(t){return e.indexOf(t)>-1})}(e)){var t=N(e);if(function(e){var t=b(e,"authority");if(t){var i=b(t,"epsg");return i&&k.indexOf(i)>-1}}(t))return I["EPSG:3857"];var i=function(e){var t=b(e,"extension");if(t)return b(t,"proj4")}(t);return i?_(i):t}return function(e){return"+"===e[0]}(e)?_(e):void 0}var R=function(e,t){var i,r;if(e=e||{},!t)return e;for(r in t)void 0!==(i=t[r])&&(e[r]=i);return e},B=function(e,t,i){var r=e*t;return i/Math.sqrt(1-r*r)},G=function(e){return e<0?-1:1},U=function(e){return Math.abs(e)<=m?e:e-G(e)*f},j=function(e,t,i){var r=e*i,s=.5*e;return r=Math.pow((1-r)/(1+r),s),Math.tan(.5*(a-t))/r},z=function(e,t){for(var i,r,s=.5*e,n=a-2*Math.atan(t),o=0;o<=15;o++)if(i=e*Math.sin(n),r=a-2*Math.atan(t*Math.pow((1-i)/(1+i),s))-n,n+=r,Math.abs(r)<=1e-10)return n;return-9999};function V(e){return e}var J=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=B(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,i,r=e.x,s=e.y;if(s*d>90&&s*d<-90&&r*d>180&&r*d<-180)return null;if(Math.abs(Math.abs(s)-a)<=u)return null;if(this.sphere)t=this.x0+this.a*this.k0*U(r-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(p+.5*s));else{var n=Math.sin(s),o=j(this.e,s,n);t=this.x0+this.a*this.k0*U(r-this.long0),i=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=i,e},inverse:function(e){var t,i,r=e.x-this.x0,s=e.y-this.y0;if(this.sphere)i=a-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var n=Math.exp(-s/(this.a*this.k0));if(-9999===(i=z(this.e,n)))return null}return t=U(this.long0+r/(this.a*this.k0)),e.x=t,e.y=i,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:V,inverse:V,names:["longlat","identity"]}],q={},H=[];function W(e,t){var i=H.length;return e.names?(H[i]=e,e.names.forEach(function(e){q[e.toLowerCase()]=i}),this):(console.log(t),!0)}var Y={start:function(){J.forEach(W)},add:W,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==q[t]&&H[q[t]]?H[q[t]]:void 0}},X={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Q=X.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};X.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Z={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},K={};function $(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:K[e]||null,isNull:!1}}function ee(e){return e/3600*Math.PI/180}function te(e,t,i){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,i)))}function ie(e){return e.map(function(e){return[ee(e.longitudeShift),ee(e.latitudeShift)]})}function re(e,t,i){return{name:te(e,t+8,t+16).trim(),parent:te(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,i),upperLatitude:e.getFloat64(t+88,i),lowerLongitude:e.getFloat64(t+104,i),upperLongitude:e.getFloat64(t+120,i),latitudeInterval:e.getFloat64(t+136,i),longitudeInterval:e.getFloat64(t+152,i),gridNodeCount:e.getInt32(t+168,i)}}function se(e,t,i,r){for(var s=t+176,n=[],a=0;a3&&(0===p.datum_params[3]&&0===p.datum_params[4]&&0===p.datum_params[5]&&0===p.datum_params[6]||(p.datum_type=t,p.datum_params[3]*=n,p.datum_params[4]*=n,p.datum_params[5]*=n,p.datum_params[6]=p.datum_params[6]/1e6+1))),d&&(p.datum_type=i,p.grids=d),p.a=l,p.b=h,p.es=u,p.ep2=c,p}(_.datumCode,_.datum_params,w.a,w.b,C.es,C.ep2,M);R(this,_),R(this,S),this.a=w.a,this.b=w.b,this.rf=w.rf,this.sphere=w.sphere,this.es=C.es,this.e=C.e,this.ep2=C.ep2,this.datum=A,this.init(),c(null,this)}else c(a)}else c(a)}function ae(e,t,i){var r,s,n,o,l=e.x,h=e.y,u=e.z?e.z:0;if(h<-a&&h>-1.001*a)h=-a;else if(h>a&&h<1.001*a)h=a;else{if(h<-a)return{x:-1/0,y:-1/0,z:e.z};if(h>a)return{x:1/0,y:1/0,z:e.z}}return l>Math.PI&&(l-=2*Math.PI),s=Math.sin(h),o=Math.cos(h),n=s*s,{x:((r=i/Math.sqrt(1-t*n))+u)*o*Math.cos(l),y:(r+u)*o*Math.sin(l),z:(r*(1-t)+u)*s}}function oe(e,t,i,r){var s,n,o,l,h,u,c,d,p,f,m,y,g,v,b,_,S=e.x,x=e.y,w=e.z?e.z:0;if(s=Math.sqrt(S*S+x*x),n=Math.sqrt(S*S+x*x+w*w),s/i<1e-12){if(v=0,n/i<1e-12)return b=a,_=-r,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(x,S);o=w/n,l=s/n,h=1/Math.sqrt(1-t*(2-t)*l*l),d=l*(1-t)*h,p=o*h,g=0;do{g++,c=i/Math.sqrt(1-t*p*p),u=t*c/(c+(_=s*d+w*p-c*(1-t*p*p))),h=1/Math.sqrt(1-u*(2-u)*l*l),y=(m=o*h)*d-(f=l*(1-u)*h)*p,d=f,p=m}while(y*y>1e-24&&g<30);return b=Math.atan(m/Math.abs(f)),{x:v,y:b,z:_}}function le(i){return i===e||i===t}ne.projections=Y,ne.projections.start();var he=function(r,n,a){if(function(i,r){return i.datum_type===r.datum_type&&!(i.a!==r.a||Math.abs(i.es-r.es)>5e-11)&&(i.datum_type===e?i.datum_params[0]===r.datum_params[0]&&i.datum_params[1]===r.datum_params[1]&&i.datum_params[2]===r.datum_params[2]:i.datum_type!==t||i.datum_params[0]===r.datum_params[0]&&i.datum_params[1]===r.datum_params[1]&&i.datum_params[2]===r.datum_params[2]&&i.datum_params[3]===r.datum_params[3]&&i.datum_params[4]===r.datum_params[4]&&i.datum_params[5]===r.datum_params[5]&&i.datum_params[6]===r.datum_params[6])}(r,n))return a;if(r.datum_type===s||n.datum_type===s)return a;var o=r.a,l=r.es;if(r.datum_type===i){var h=ue(r,!1,a);if(0!==h)return;o=6378137,l=.0066943799901413165}var u=n.a,c=n.b,d=n.es;if(n.datum_type===i&&(u=6378137,c=6356752.314,d=.0066943799901413165),l===d&&o===u&&!le(r.datum_type)&&!le(n.datum_type))return a;if(a=ae(a,l,o),le(r.datum_type)&&(a=function(i,r,s){if(r===e)return{x:i.x+s[0],y:i.y+s[1],z:i.z+s[2]};if(r===t){var n=s[0],a=s[1],o=s[2],l=s[3],h=s[4],u=s[5],c=s[6];return{x:c*(i.x-u*i.y+h*i.z)+n,y:c*(u*i.x+i.y-l*i.z)+a,z:c*(-h*i.x+l*i.y+i.z)+o}}}(a,r.datum_type,r.datum_params)),le(n.datum_type)&&(a=function(i,r,s){if(r===e)return{x:i.x-s[0],y:i.y-s[1],z:i.z-s[2]};if(r===t){var n=s[0],a=s[1],o=s[2],l=s[3],h=s[4],u=s[5],c=s[6],d=(i.x-n)/c,p=(i.y-a)/c,f=(i.z-o)/c;return{x:d+u*p-h*f,y:-u*d+p+l*f,z:h*d-l*p+f}}}(a,n.datum_type,n.datum_params)),a=oe(a,d,u,c),n.datum_type===i){var p=ue(n,!0,a);if(0!==p)return}return a};function ue(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r={x:-i.x,y:i.y},s={x:Number.NaN,y:Number.NaN},n=[],a=0;ar.y||u>r.x||f1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=U(n.x+i.ll[0]),r.y=n.y+i.ll[1]}else isNaN(n.x)||(r.x=e.x+n.x,r.y=e.y+n.y);return r}function de(e,t){var i,r={x:e.x/t.del[0],y:e.y/t.del[1]},s={x:Math.floor(r.x),y:Math.floor(r.y)},n={x:r.x-1*s.x,y:r.y-1*s.y},a={x:Number.NaN,y:Number.NaN};if(s.x<0||s.x>=t.lim[0])return a;if(s.y<0||s.y>=t.lim[1])return a;i=s.y*t.lim[0]+s.x;var o={x:t.cvs[i][0],y:t.cvs[i][1]};i++;var l={x:t.cvs[i][0],y:t.cvs[i][1]};i+=t.lim[0];var h={x:t.cvs[i][0],y:t.cvs[i][1]};i--;var u={x:t.cvs[i][0],y:t.cvs[i][1]},c=n.x*n.y,d=n.x*(1-n.y),p=(1-n.x)*(1-n.y),f=(1-n.x)*n.y;return a.x=p*o.x+d*l.x+f*u.x+c*h.x,a.y=p*o.y+d*l.y+f*u.y+c*h.y,a}var pe=function(e,t,i){var r,s,n,a=i.x,o=i.y,l=i.z||0,h={};for(n=0;n<3;n++)if(!t||2!==n||void 0!==i.z)switch(0===n?(r=a,s=-1!=="ew".indexOf(e.axis[n])?"x":"y"):1===n?(r=o,s=-1!=="ns".indexOf(e.axis[n])?"y":"x"):(r=l,s="z"),e.axis[n]){case"e":h[s]=r;break;case"w":h[s]=-r;break;case"n":h[s]=r;break;case"s":h[s]=-r;break;case"u":void 0!==i[s]&&(h.z=r);break;case"d":void 0!==i[s]&&(h.z=-r);break;default:return null}return h},fe=function(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t},me=function(e){ye(e.x),ye(e.y)};function ye(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function ge(r,s,n,a){var o,l=void 0!==(n=Array.isArray(n)?fe(n):{x:n.x,y:n.y,z:n.z,m:n.m}).z;if(me(n),r.datum&&s.datum&&function(r,s){return(r.datum.datum_type===e||r.datum.datum_type===t||r.datum.datum_type===i)&&"WGS84"!==s.datumCode||(s.datum.datum_type===e||s.datum.datum_type===t||s.datum.datum_type===i)&&"WGS84"!==r.datumCode}(r,s)&&(o=new ne("WGS84"),n=ge(r,o,n,a),r=o),a&&"enu"!==r.axis&&(n=pe(r,!1,n)),"longlat"===r.projName)n={x:n.x*c,y:n.y*c,z:n.z||0};else if(r.to_meter&&(n={x:n.x*r.to_meter,y:n.y*r.to_meter,z:n.z||0}),!(n=r.inverse(n)))return;if(r.from_greenwich&&(n.x+=r.from_greenwich),n=he(r.datum,s.datum,n))return s.from_greenwich&&(n={x:n.x-s.from_greenwich,y:n.y,z:n.z||0}),"longlat"===s.projName?n={x:n.x*d,y:n.y*d,z:n.z||0}:(n=s.forward(n),s.to_meter&&(n={x:n.x/s.to_meter,y:n.y/s.to_meter,z:n.z||0})),a&&"enu"!==s.axis?pe(s,!0,n):(l||delete n.z,n)}var ve=ne("WGS84");function be(e,t,i,r){var s,n,a;return Array.isArray(i)?(s=ge(e,t,i,r)||{x:NaN,y:NaN},i.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof s.z?[s.x,s.y,s.z].concat(i.splice(3)):[s.x,s.y,i[2]].concat(i.splice(3)):[s.x,s.y].concat(i.splice(2)):[s.x,s.y]):(n=ge(e,t,i,r),2===(a=Object.keys(i)).length?n:(a.forEach(function(r){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===r||"y"===r||"z"===r)return}else if("x"===r||"y"===r)return;n[r]=i[r]}),n))}function _e(e){return e instanceof ne?e:e.oProj?e.oProj:ne(e)}function Se(e,t,i){e=_e(e);var r,s=!1;return void 0===t?(t=e,e=ve,s=!0):(void 0!==t.x||Array.isArray(t))&&(i=t,t=e,e=ve,s=!0),t=_e(t),i?be(e,t,i):(r={forward:function(i,r){return be(e,t,i,r)},inverse:function(i,r){return be(t,e,i,r)}},s&&(r.oProj=t),r)}var xe=6,we="AJSAJS",Ce="AFAFAF",Me=65,Ae=73,Te=79,Ee=86,Le=90,Oe={forward:Pe,inverse:function(e){var t=ke(Re(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]},toPoint:Ne};function Pe(e,t){return t=t||5,function(e,t){var i,r,s,n,a,o,l,h,u,c,d,p,f,m,y="00000"+e.easting,g="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(u=e.easting,c=e.northing,d=e.zoneNumber,p=De(d),f=Math.floor(u/1e5),m=Math.floor(c/1e5)%20,i=f,r=m,s=p-1,n=we.charCodeAt(s),a=Ce.charCodeAt(s),l=a+r,h=!1,(o=n+i-1)>Le&&(o=o-Le+Me-1,h=!0),(o===Ae||nAe||(o>Ae||nTe||(o>Te||nLe&&(o=o-Le+Me-1),l>Ee?(l=l-Ee+Me-1,h=!0):h=!1,(l===Ae||aAe||(l>Ae||aTe||(l>Te||aEe&&(l=l-Ee+Me-1),String.fromCharCode(o)+String.fromCharCode(l))+y.substr(y.length-5,t)+g.substr(g.length-5,t)}(function(e){var t,i,r,s,n,a,o,l=e.lat,h=e.lon,u=6378137,c=Ie(l),d=Ie(h);o=Math.floor((h+180)/6)+1,180===h&&(o=60),l>=56&&l<64&&h>=3&&h<12&&(o=32),l>=72&&l<84&&(h>=0&&h<9?o=31:h>=9&&h<21?o=33:h>=21&&h<33?o=35:h>=33&&h<42&&(o=37)),a=Ie(6*(o-1)-180+3),t=u/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),i=Math.tan(c)*Math.tan(c),r=.006739496752268451*Math.cos(c)*Math.cos(c),s=Math.cos(c)*(d-a),n=u*(.9983242984503243*c-.002514607064228144*Math.sin(2*c)+2639046602129982e-21*Math.sin(4*c)-3.418046101696858e-9*Math.sin(6*c));var p,f,m=.9996*t*(s+(1-i+r)*s*s*s/6+(5-18*i+i*i+72*r-.39089081163157013)*s*s*s*s*s/120)+5e5,y=.9996*(n+t*Math.tan(c)*(s*s/2+(5-i+9*r+4*r*r)*s*s*s*s/24+(61-58*i+i*i+600*r-2.2240339282485886)*s*s*s*s*s*s/720));return l<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(m),zoneNumber:o,zoneLetter:(p=l,f="Z",84>=p&&p>=72?f="X":72>p&&p>=64?f="W":64>p&&p>=56?f="V":56>p&&p>=48?f="U":48>p&&p>=40?f="T":40>p&&p>=32?f="S":32>p&&p>=24?f="R":24>p&&p>=16?f="Q":16>p&&p>=8?f="P":8>p&&p>=0?f="N":0>p&&p>=-8?f="M":-8>p&&p>=-16?f="L":-16>p&&p>=-24?f="K":-24>p&&p>=-32?f="J":-32>p&&p>=-40?f="H":-40>p&&p>=-48?f="G":-48>p&&p>=-56?f="F":-56>p&&p>=-64?f="E":-64>p&&p>=-72?f="D":-72>p&&p>=-80&&(f="C"),f)}}({lat:e[1],lon:e[0]}),t)}function Ne(e){var t=ke(Re(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Ie(e){return e*(Math.PI/180)}function Fe(e){return e/Math.PI*180}function ke(e){var t=e.northing,i=e.easting,r=e.zoneLetter,s=e.zoneNumber;if(s<0||s>60)return null;var n,a,o,l,h,u,c,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,y=t;r<"N"&&(y-=1e7),u=6*(s-1)-180+3,d=(c=y/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*c)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*c)+151*f*f*f/96*Math.sin(6*c),n=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),o=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*n);var g=d-n*Math.tan(d)/l*(h*h/2-(5+3*a+10*o-4*o*o-.06065547077041606)*h*h*h*h/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*h*h*h*h*h*h/720);g=Fe(g);var v,b=(h-(1+2*a+o)*h*h*h/6+(5-2*o+28*a-3*o*o+.05391597401814761+24*a*a)*h*h*h*h*h/120)/Math.cos(d);if(b=u+Fe(b),e.accuracy){var _=ke({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});v={top:_.lat,right:_.lon,bottom:g,left:b}}else v={lat:g,lon:b};return v}function De(e){var t=e%xe;return 0===t&&(t=xe),t}function Re(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,i=e.length,r=null,s="",n=0;!/[A-Z]/.test(t=e.charAt(n));){if(n>=2)throw"MGRSPoint bad conversion from: "+e;s+=t,n++}var a=parseInt(s,10);if(0===n||n+3>i)throw"MGRSPoint bad conversion from: "+e;var o=e.charAt(n++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+e;r=e.substring(n,n+=2);for(var l=De(a),h=function(e,t){for(var i=we.charCodeAt(t-1),r=1e5,s=!1;i!==e.charCodeAt(0);){if(++i===Ae&&i++,i===Te&&i++,i>Le){if(s)throw"Bad character: "+e;i=Me,s=!0}r+=1e5}return r}(r.charAt(0),l),u=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var i=Ce.charCodeAt(t-1),r=0,s=!1;i!==e.charCodeAt(0);){if(++i===Ae&&i++,i===Te&&i++,i>Ee){if(s)throw"Bad character: "+e;i=Me,s=!0}r+=1e5}return r}(r.charAt(1),l);u0&&(d=1e5/Math.pow(10,m),p=e.substring(n,n+m),y=parseFloat(p)*d,f=e.substring(n+m),g=parseFloat(f)*d),{easting:y+h,northing:g+u,zoneLetter:o,zoneNumber:a,accuracy:d}}function Be(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Ge(e,t,i){if(!(this instanceof Ge))return new Ge(e,t,i);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ge.fromMGRS=function(e){return new Ge(Ne(e))},Ge.prototype.toMGRS=function(e){return Pe([this.x,this.y],e)};var Ue=.01068115234375,je=function(e){var t=[];t[0]=1-e*(.25+e*(.046875+e*(.01953125+e*Ue))),t[1]=e*(.75-e*(.046875+e*(.01953125+e*Ue)));var i=e*e;return t[2]=i*(.46875-e*(.013020833333333334+.007120768229166667*e)),i*=e,t[3]=i*(.3645833333333333-.005696614583333333*e),t[4]=i*e*.3076171875,t},ze=function(e,t,i,r){return i*=t,t*=t,r[0]*e-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},Ve=function(e,t,i){for(var r=1/(1-t),s=e,n=20;n;--n){var a=Math.sin(s),o=1-t*a*a;if(o=(ze(s,a,Math.cos(s),i)-e)*(o*Math.sqrt(o))*r,s-=o,Math.abs(o)u?Math.tan(n):0,m=Math.pow(f,2),y=Math.pow(m,2);t=1-this.es*Math.pow(o,2),h/=Math.sqrt(t);var g=ze(n,o,l,this.en);i=this.a*(this.k0*h*(1+c/6*(1-m+d+c/20*(5-18*m+y+14*d-58*m*d+c/42*(61+179*y-y*m-479*m)))))+this.x0,r=this.a*(this.k0*(g-this.ml0+o*a*h/2*(1+c/12*(5-m+9*d+4*p+c/30*(61+y-58*m+270*d-330*m*d+c/56*(1385+543*y-y*m-3111*m))))))+this.y0}else{var v=l*Math.sin(a);if(Math.abs(Math.abs(v)-1)=1){if(v-1>u)return 93;r=0}else r=Math.acos(r);n<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return e.x=i,e.y=r,e},inverse:function(e){var t,i,r,s,n=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+o/this.k0,i=Ve(t,this.es,this.en),Math.abs(i)u?Math.tan(i):0,d=this.ep2*Math.pow(h,2),p=Math.pow(d,2),f=Math.pow(c,2),m=Math.pow(f,2);t=1-this.es*Math.pow(l,2);var y=n*Math.sqrt(t)/this.k0,g=Math.pow(y,2);r=i-(t*=c)*g/(1-this.es)*.5*(1-g/12*(5+3*f-9*d*f+d-4*p-g/30*(61+90*f-252*d*f+45*m+46*d-g/56*(1385+3633*f+4095*m+1574*m*f)))),s=U(this.long0+y*(1-g/6*(1+2*f+d-g/20*(5+28*f+24*m+8*d*f+6*d-g/42*(61+662*f+1320*m+720*m*f))))/h)}else r=a*G(o),s=0;else{var v=Math.exp(n/this.k0),b=.5*(v-1/v),_=this.lat0+o/this.k0,S=Math.cos(_);t=Math.sqrt((1-Math.pow(S,2))/(1+Math.pow(b,2))),r=Math.asin(t),o<0&&(r=-r),s=0===b&&0===S?0:U(Math.atan2(b,S)+this.long0)}return e.x=s,e.y=r,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},qe=function(e){var t=Math.exp(e);return t=(t-1/t)/2},He=function(e,t){e=Math.abs(e),t=Math.abs(t);var i=Math.max(e,t),r=Math.min(e,t)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},We=function(e){var t=Math.abs(e);return t=function(e){var t=1+e,i=t-1;return 0===i?e:e*Math.log(t)/i}(t*(1+t/(He(1,t)+1))),e<0?-t:t},Ye=function(e,t){for(var i,r=2*Math.cos(2*t),s=e.length-1,n=e[s],a=0;--s>=0;)i=r*n-a+e[s],a=n,n=i;return t+i*Math.sin(2*t)},Xe=function(e,t){for(var i,r=2*Math.cos(t),s=e.length-1,n=e[s],a=0;--s>=0;)i=r*n-a+e[s],a=n,n=i;return Math.sin(t)*i},Qe=function(e,t,i){for(var r,s,n=Math.sin(t),a=Math.cos(t),o=qe(i),l=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(i),h=2*a*l,u=-2*n*o,c=e.length-1,d=e[c],p=0,f=0,m=0;--c>=0;)r=f,s=p,d=h*(f=d)-r-u*(p=m)+e[c],m=u*f-s+h*p;return[(h=n*l)*d-(u=a*o)*m,h*m+u*d]},Ze={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Je.init.apply(this),this.forward=Je.forward,this.inverse=Je.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),i=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),i*=t,this.cgb[1]=i*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),i*=t,this.cgb[2]=i*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=i*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),i*=t,this.cgb[3]=i*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=i*(1237/630+t*(t*(-24832/14175)-2.4)),i*=t,this.cgb[4]=i*(4174/315+t*(-144838/6237)),this.cbg[4]=i*(-734/315+t*(109598/31185)),i*=t,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=i*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=i*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),i*=t,this.utg[2]=i*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=i*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),i*=t,this.utg[3]=i*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=i*(49561/161280+t*(-179/168+t*(6601661/7257600))),i*=t,this.utg[4]=i*(-4583/161280+t*(108847/3991680)),this.gtu[4]=i*(34729/80640+t*(-3418889/1995840)),i*=t,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=Ye(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Xe(this.gtu,2*r))},forward:function(e){var t=U(e.x-this.long0),i=e.y;i=Ye(this.cbg,i);var r=Math.sin(i),s=Math.cos(i),n=Math.sin(t),a=Math.cos(t);i=Math.atan2(r,a*s),t=Math.atan2(n*s,He(r,s*a)),t=We(Math.tan(t));var o,l,h=Qe(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],Math.abs(t)<=2.623395162778?(o=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(o=1/0,l=1/0),e.x=o,e.y=l,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),s=(e.y-this.y0)*(1/this.a);if(s=(s-this.Zb)/this.Qn,r/=this.Qn,Math.abs(r)<=2.623395162778){var n=Qe(this.utg,2*s,2*r);s+=n[0],r+=n[1],r=Math.atan(qe(r));var a=Math.sin(s),o=Math.cos(s),l=Math.sin(r),h=Math.cos(r);s=Math.atan2(a*h,He(l,h*o)),r=Math.atan2(l,h*o),t=U(r+this.long0),i=Ye(this.cgb,s)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Ke=function(e,t){if(void 0===e){if((e=Math.floor(30*(U(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e},$e={init:function(){var e=Ke(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*c,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Ze.init.apply(this),this.forward=Ze.forward,this.inverse=Ze.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},et=function(e,t){return Math.pow((1-e)/(1+e),t)},tt=20,it={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+p)/(Math.pow(Math.tan(.5*this.lat0+p),this.C)*et(this.e*e,this.ratexp))},forward:function(e){var t=e.x,i=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+p),this.C)*et(this.e*Math.sin(i),this.ratexp))-a,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=Math.pow(Math.tan(.5*i+p)/this.K,1/this.C),s=tt;s>0&&(i=2*Math.atan(r*et(this.e*Math.sin(e.y),-.5*this.e))-a,!(Math.abs(i-e.y)<1e-14));--s)e.y=i;return s?(e.x=t,e.y=i,e):null},names:["gauss"]},rt={init:function(){it.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,i,r,s;return e.x=U(e.x-this.long0),it.forward.apply(this,[e]),t=Math.sin(e.y),i=Math.cos(e.y),r=Math.cos(e.x),s=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*i*r),e.x=s*i*Math.sin(e.x),e.y=s*(this.cosc0*t-this.sinc0*i*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,i,r,s,n;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,n=Math.sqrt(e.x*e.x+e.y*e.y)){var a=2*Math.atan2(n,this.R2);t=Math.sin(a),i=Math.cos(a),s=Math.asin(i*this.sinc0+e.y*t*this.cosc0/n),r=Math.atan2(e.x*t,n*this.cosc0*i-e.y*this.sinc0*t)}else s=this.phic0,r=0;return e.x=r,e.y=s,it.inverse.apply(this,[e]),e.x=U(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},st={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=u&&(this.k0=.5*(1+G(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=u&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=u&&(this.k0=.5*this.cons*B(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/j(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=B(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-a,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,i,r,s,n,o,l=e.x,h=e.y,c=Math.sin(h),d=Math.cos(h),p=U(l-this.long0);return Math.abs(Math.abs(l-this.long0)-Math.PI)<=u&&Math.abs(h+this.lat0)<=u?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*c+this.coslat0*d*Math.cos(p)),e.x=this.a*t*d*Math.sin(p)+this.x0,e.y=this.a*t*(this.coslat0*c-this.sinlat0*d*Math.cos(p))+this.y0,e):(i=2*Math.atan(this.ssfn_(h,c,this.e))-a,s=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=u?(n=j(this.e,h*this.con,this.con*c),o=2*this.a*this.k0*n/this.cons,e.x=this.x0+o*Math.sin(l-this.long0),e.y=this.y0-this.con*o*Math.cos(l-this.long0),e):(Math.abs(this.sinlat0)0?U(this.long0+Math.atan2(e.x,-1*e.y)):U(this.long0+Math.atan2(e.x,e.y)):U(this.long0+Math.atan2(e.x*Math.sin(l),o*this.coslat0*Math.cos(l)-e.y*this.sinlat0*Math.sin(l))),e.x=t,e.y=i,e)}if(Math.abs(this.coslat0)<=u){if(o<=u)return i=this.lat0,t=this.long0,e.x=t,e.y=i,e;e.x*=this.con,e.y*=this.con,r=o*this.cons/(2*this.a*this.k0),i=this.con*z(this.e,r),t=this.con*U(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else s=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=u?n=this.X0:(n=Math.asin(Math.cos(s)*this.sinX0+e.y*Math.sin(s)*this.cosX0/o),t=U(this.long0+Math.atan2(e.x*Math.sin(s),o*this.cosX0*Math.cos(s)-e.y*this.sinX0*Math.sin(s)))),i=-1*z(this.e,Math.tan(.5*(a+n)));return e.x=t,e.y=i,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,i){return t*=i,Math.tan(.5*(a+e))*Math.pow((1-t)/(1+t),.5*i)}},nt={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),i=this.a,r=1/this.rf,s=2*r-Math.pow(r,2),n=this.e=Math.sqrt(s);this.R=this.k0*i*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+n*t)/(1-n*t));this.K=a-this.alpha*o+this.alpha*n/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+i)+this.K,s=2*(Math.atan(Math.exp(r))-Math.PI/4),n=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(s)+Math.cos(this.b0)*Math.cos(n))),o=Math.asin(Math.cos(this.b0)*Math.sin(s)-Math.sin(this.b0)*Math.cos(s)*Math.cos(n));return e.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,i=e.y-this.y0,r=t/this.R,s=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),n=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(r)),a=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(s))),o=this.lambda0+a/this.alpha,l=0,h=n,u=-1e3,c=0;Math.abs(h-u)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+n/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),u=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=o,e.y=h,e},names:["somerc"]},at=1e-7,ot={init:function(){var e,t,i,r,s,n,o,l,h,d,m,y,g,v=0,b=0,_=0,S=0,x=0,w=0,C=0;this.no_off=(g="object"==typeof(y=this).PROJECTION?Object.keys(y.PROJECTION)[0]:y.PROJECTION,"no_uoff"in y||"no_off"in y||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(g)),this.no_rot="no_rot"in this;var M=!1;"alpha"in this&&(M=!0);var A=!1;if("rectified_grid_angle"in this&&(A=!0),M&&(C=this.alpha),A&&(v=this.rectified_grid_angle*c),M||A)b=this.longc;else if(_=this.long1,x=this.lat1,S=this.long2,w=this.lat2,Math.abs(x-w)<=at||(e=Math.abs(x))<=at||Math.abs(e-a)<=at||Math.abs(Math.abs(this.lat0)-a)<=at||Math.abs(Math.abs(w)-a)<=at)throw new Error;var T=1-this.es;t=Math.sqrt(T),Math.abs(this.lat0)>u?(l=Math.sin(this.lat0),i=Math.cos(this.lat0),e=1-this.es*l*l,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/T),this.A=this.B*this.k0*t/e,r=this.B*t/(i*Math.sqrt(e)),(s=r*r-1)<=0?s=0:(s=Math.sqrt(s),this.lat0<0&&(s=-s)),this.E=s+=r,this.E*=Math.pow(j(this.e,this.lat0,l),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=s=1),M||A?(M?(m=Math.asin(Math.sin(C)/r),A||(v=C)):(m=v,C=Math.asin(r*Math.sin(m))),this.lam0=b-Math.asin(.5*(s-1/s)*Math.tan(m))/this.B):(n=Math.pow(j(this.e,x,Math.sin(x)),this.B),o=Math.pow(j(this.e,w,Math.sin(w)),this.B),s=this.E/n,h=(o-n)/(o+n),d=((d=this.E*this.E)-o*n)/(d+o*n),(e=_-S)<-Math.pi?S-=f:e>Math.pi&&(S+=f),this.lam0=U(.5*(_+S)-Math.atan(d*Math.tan(.5*this.B*(_-S))/h)/this.B),m=Math.atan(2*Math.sin(this.B*U(_-this.lam0))/(s-1/s)),v=C=Math.asin(r*Math.sin(m))),this.singam=Math.sin(m),this.cosgam=Math.cos(m),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(C))),this.lat0<0&&(this.u_0=-this.u_0)),s=.5*m,this.v_pole_n=this.ArB*Math.log(Math.tan(p-s)),this.v_pole_s=this.ArB*Math.log(Math.tan(p+s))},forward:function(e){var t,i,r,s,n,o,l,h,c={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-a)>u){if(n=this.E/Math.pow(j(this.e,e.y,Math.sin(e.y)),this.B),t=.5*(n-(o=1/n)),i=.5*(n+o),s=Math.sin(this.B*e.x),r=(t*this.singam-s*this.cosgam)/i,Math.abs(Math.abs(r)-1)0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(c.x=l,c.y=h):(l-=this.u_0,c.x=h*this.cosrot+l*this.sinrot,c.y=l*this.cosrot-h*this.sinrot),c.x=this.a*c.x+this.x0,c.y=this.a*c.y+this.y0,c},inverse:function(e){var t,i,r,s,n,o,l,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*i),s=.5*(r-1/r),n=.5*(r+1/r),o=Math.sin(this.BrA*t),l=(o*this.cosgam+s*this.singam)/n,Math.abs(Math.abs(l)-1)u?this.ns=Math.log(r/o)/Math.log(s/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(s,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;Math.abs(2*Math.abs(i)-Math.PI)<=u&&(i=G(i)*(a-2*u));var r,s,n=Math.abs(Math.abs(i)-a);if(n>u)r=j(this.e,i,Math.sin(i)),s=this.a*this.f0*Math.pow(r,this.ns);else{if((n=i*this.ns)<=0)return null;s=0}var o=this.ns*U(t-this.long0);return e.x=this.k0*(s*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-s*Math.cos(o))+this.y0,e},inverse:function(e){var t,i,r,s,n,o=(e.x-this.x0)/this.k0,l=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+l*l),i=1):(t=-Math.sqrt(o*o+l*l),i=-1);var h=0;if(0!==t&&(h=Math.atan2(i*o,i*l)),0!==t||this.ns>0){if(i=1/this.ns,r=Math.pow(t/(this.a*this.f0),i),-9999===(s=z(this.e,r)))return null}else s=-a;return n=U(h/this.ns+this.long0),e.x=n,e.y=s,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},ht={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,i,r,s,n,a,o,l=e.x,h=e.y,u=U(l-this.long0);return t=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/t)-this.s45),r=-u*this.alfa,s=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(s)),a=this.n*n,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(s/2+this.s45),this.n),e.y=o*Math.cos(a)/1,e.x=o*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,i,r,s,n,a,o,l,h=e.x;e.x=e.y,e.y=h,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),n=Math.atan2(e.y,e.x),s=n/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(s)),i=Math.asin(Math.cos(r)*Math.sin(s)/Math.cos(t)),e.x=this.long0-i/this.alfa,o=t,l=0;var u=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(l=1),o=e.y,u+=1}while(0===l&&u<15);return u>=15?null:e},names:["Krovak","krovak"]},ut=function(e,t,i,r,s){return e*s-t*Math.sin(2*s)+i*Math.sin(4*s)-r*Math.sin(6*s)},ct=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},dt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},pt=function(e){return.05859375*e*e*(1+.75*e)},ft=function(e){return e*e*e*(35/3072)},mt=function(e,t,i){var r=t*i;return e/Math.sqrt(1-r*r)},yt=function(e){return Math.abs(e)1e-7?(1-e*e)*(t/(1-(i=e*t)*i)-.5/e*Math.log((1-i)/(1+i))):2*t},_t=.3333333333333333,St=.17222222222222222,xt=.10257936507936508,wt=.06388888888888888,Ct=.0664021164021164,Mt=.016415012942191543,At={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-a)0)switch(this.qp=bt(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,i=[];return i[0]=e*_t,t=e*e,i[0]+=t*St,i[1]=t*wt,t*=e,i[0]+=t*xt,i[1]+=t*Ct,i[2]=t*Mt,i}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=bt(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,i,r,s,n,o,l,h,c,d,f=e.x,m=e.y;if(f=U(f-this.long0),this.sphere){if(n=Math.sin(m),d=Math.cos(m),r=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+d*r:1+this.sinph0*n+this.cosph0*d*r)<=u)return null;i=Math.sqrt(2/i),t=i*d*Math.sin(f),i*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*d*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(m+this.lat0)=0?(t=(c=Math.sqrt(o))*s,i=r*(this.mode===this.S_POLE?c:-c)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,i,r,s,n,o,l,h,c,d,p=e.x/this.a,f=e.y/this.a;if(this.sphere){var m,y=0,g=0;if(m=Math.sqrt(p*p+f*f),(i=.5*m)>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(g=Math.sin(i),y=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(m)<=u?0:Math.asin(f*g/m),p*=g,f=y*m;break;case this.OBLIQ:i=Math.abs(m)<=u?this.lat0:Math.asin(y*this.sinph0+f*g*this.cosph0/m),p*=g*this.cosph0,f=(y-Math.sin(i)*this.sinph0)*m;break;case this.N_POLE:f=-f,i=a-i;break;case this.S_POLE:i-=a}t=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,f):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,f*=this.dd,(o=Math.sqrt(p*p+f*f))1&&(e=e>1?1:-1),Math.asin(e)},Et={init:function(){Math.abs(this.lat1+this.lat2)u?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,i=e.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=bt(this.e3,this.sin_phi),s=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,n=this.ns0*U(t-this.long0),a=s*Math.sin(n)+this.x0,o=this.rh-s*Math.cos(n)+this.y0;return e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s,n,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),s=0,0!==t&&(s=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,a=this.phi1z(this.e3,i)),n=U(s/this.ns0+this.long0),e.x=n,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var i,r,s,n,a,o=Tt(.5*t);if(e0||Math.abs(n)<=u?(a=this.x0+1*this.a*i*Math.sin(r)/n,o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*s)/n):(a=this.x0+this.infinity_dist*i*Math.sin(r),o=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*s)),e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s,n,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(s=Math.atan2(t,this.rc),i=Math.sin(s),r=Math.cos(s),a=Tt(r*this.sin_p14+e.y*i*this.cos_p14/t),n=Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i),n=U(this.long0+n)):(a=this.phic0,n=0),e.x=n,e.y=a,e},names:["gnom"]},Ot=function(e,t){var i=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-i)<1e-6)return t<0?-1*a:a;for(var r,s,n,o,l=Math.asin(.5*t),h=0;h<30;h++)if(s=Math.sin(l),n=Math.cos(l),o=e*s,r=Math.pow(1-o*o,2)/(2*n)*(t/(1-e*e)-s/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),l+=r,Math.abs(r)<=1e-10)return l;return NaN},Pt={init:function(){this.sphere||(this.k0=B(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,i,r=e.x,s=e.y,n=U(r-this.long0);if(this.sphere)t=this.x0+this.a*n*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var a=bt(this.e,Math.sin(s));t=this.x0+this.a*this.k0*n,i=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=i,e},inverse:function(e){var t,i;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=U(this.long0+e.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(i=Ot(this.e,2*e.y*this.k0/this.a),t=U(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=i,e},names:["cea"]},Nt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,i=e.y,r=U(t-this.long0),s=yt(i-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*s,e},inverse:function(e){var t=e.x,i=e.y;return e.x=U(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=yt(this.lat0+(i-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},It=20,Ft={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=ct(this.es),this.e1=dt(this.es),this.e2=pt(this.es),this.e3=ft(this.es),this.ml0=this.a*ut(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,s=e.x,n=e.y,a=U(s-this.long0);if(r=a*Math.sin(n),this.sphere)Math.abs(n)<=u?(t=this.a*a,i=-1*this.a*this.lat0):(t=this.a*Math.sin(r)/Math.tan(n),i=this.a*(yt(n-this.lat0)+(1-Math.cos(r))/Math.tan(n)));else if(Math.abs(n)<=u)t=this.a*a,i=-1*this.ml0;else{var o=mt(this.a,this.e,Math.sin(n))/Math.tan(n);t=o*Math.sin(r),i=this.a*ut(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+o*(1-Math.cos(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,i,r,s,n,a,o,l,h;if(r=e.x-this.x0,s=e.y-this.y0,this.sphere)if(Math.abs(s+this.a*this.lat0)<=u)t=U(r/this.a+this.long0),i=0;else{var c;for(a=this.lat0+s/this.a,o=r*r/this.a/this.a+a*a,l=a,n=It;n;--n)if(c=Math.tan(l),l+=h=-1*(a*(l*c+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),Math.abs(h)<=u){i=l;break}t=U(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(s+this.ml0)<=u)i=0,t=U(this.long0+r/this.a);else{var d,p,f,m,y;for(a=(this.ml0+s)/this.a,o=r*r/this.a/this.a+a*a,l=a,n=It;n;--n)if(y=this.e*Math.sin(l),d=Math.sqrt(1-y*y)*Math.tan(l),p=this.a*ut(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),m=p/this.a,h=(a*(d*m+1)-m-.5*d*(m*m+o))/(this.es*Math.sin(2*l)*(m*m+o-2*a*m)/(4*d)+(a-m)*(d*f-2/Math.sin(2*l))-f),l-=h,Math.abs(h)<=u){i=l;break}d=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),t=U(this.long0+Math.asin(r*d/this.a)/Math.sin(i))}return e.x=t,e.y=i,e},names:["Polyconic","poly"]},kt={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,i=e.x,r=e.y-this.lat0,s=i-this.long0,a=r/n*1e-5,o=s,l=1,h=0;for(t=1;t<=10;t++)l*=a,h+=this.A[t]*l;var u,c=h,d=o,p=1,f=0,m=0,y=0;for(t=1;t<=6;t++)u=f*c+p*d,p=p*c-f*d,f=u,m=m+this.B_re[t]*p-this.B_im[t]*f,y=y+this.B_im[t]*p+this.B_re[t]*f;return e.x=y*this.a+this.x0,e.y=m*this.a+this.y0,e},inverse:function(e){var t,i,r=e.x,s=e.y,a=r-this.x0,o=(s-this.y0)/this.a,l=a/this.a,h=1,u=0,c=0,d=0;for(t=1;t<=6;t++)i=u*o+h*l,h=h*o-u*l,u=i,c=c+this.C_re[t]*h-this.C_im[t]*u,d=d+this.C_im[t]*h+this.C_re[t]*u;for(var p=0;p.999999999999&&(i=.999999999999),t=Math.asin(i);var r=U(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*t+Math.sin(2*t))/Math.PI,Math.abs(i)>1&&(i=1);var s=Math.asin(i);return e.x=r,e.y=s,e},names:["Mollweide","moll"]},Ut={init:function(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(i=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var n=0;if(0!==i&&(n=Math.atan2(t*e.x,t*e.y)),this.sphere)return s=U(this.long0+n/this.ns),r=yt(this.g-i/this.a),e.x=s,e.y=r,e;var a=this.g-i/this.a;return r=gt(a,this.e0,this.e1,this.e2,this.e3),s=U(this.long0+n/this.ns),e.x=s,e.y=r,e},names:["Equidistant_Conic","eqdc"]},jt={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,s=e.y,n=U(r-this.long0);Math.abs(s)<=u&&(t=this.x0+this.R*n,i=this.y0);var o=Tt(2*Math.abs(s/Math.PI));(Math.abs(n)<=u||Math.abs(Math.abs(s)-a)<=u)&&(t=this.x0,i=s>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var l=.5*Math.abs(Math.PI/n-n/Math.PI),h=l*l,c=Math.sin(o),d=Math.cos(o),p=d/(c+d-1),f=p*p,m=p*(2/c-1),y=m*m,g=Math.PI*this.R*(l*(p-y)+Math.sqrt(h*(p-y)*(p-y)-(y+h)*(f-y)))/(y+h);n<0&&(g=-g),t=this.x0+g;var v=h+p;return g=Math.PI*this.R*(m*v-l*Math.sqrt((y+h)*(h+1)-v*v))/(y+h),i=s>=0?this.y0+g:this.y0-g,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,s,n,a,o,l,h,c,d,p,f;return e.x-=this.x0,e.y-=this.y0,d=Math.PI*this.R,r=e.x/d,s=e.y/d,n=r*r+s*s,a=-Math.abs(s)*(1+n),f=s*s/(l=-2*a+1+2*s*s+n*n)+(2*(o=a-2*s*s+r*r)*o*o/l/l/l-9*a*o/l/l)/27,h=(a-o*o/3/l)/l,c=2*Math.sqrt(-h/3),d=3*f/h/c,Math.abs(d)>1&&(d=d>=0?1:-1),p=Math.acos(d)/3,i=e.y>=0?(-c*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-o/3/l)*Math.PI,t=Math.abs(r)2*a*this.a)return;return i=t/this.a,r=Math.sin(i),s=Math.cos(i),n=this.long0,Math.abs(t)<=u?o=this.lat0:(o=Tt(s*this.sin_p12+e.y*r*this.cos_p12/t),l=Math.abs(this.lat0)-a,n=Math.abs(l)<=u?this.lat0>=0?U(this.long0+Math.atan2(e.x,-e.y)):U(this.long0-Math.atan2(-e.x,e.y)):U(this.long0+Math.atan2(e.x*r,t*this.cos_p12*s-e.y*this.sin_p12*r))),e.x=n,e.y=o,e}return h=ct(this.es),c=dt(this.es),d=pt(this.es),p=ft(this.es),Math.abs(this.sin_p12-1)<=u?(f=this.a*ut(h,c,d,p,a),t=Math.sqrt(e.x*e.x+e.y*e.y),o=gt((f-t)/this.a,h,c,d,p),n=U(this.long0+Math.atan2(e.x,-1*e.y)),e.x=n,e.y=o,e):Math.abs(this.sin_p12+1)<=u?(f=this.a*ut(h,c,d,p,a),t=Math.sqrt(e.x*e.x+e.y*e.y),o=gt((t-f)/this.a,h,c,d,p),n=U(this.long0+Math.atan2(e.x,e.y)),e.x=n,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),g=Math.atan2(e.x,e.y),m=mt(this.a,this.e,this.sin_p12),v=Math.cos(g),b=this.e*this.cos_p12*v,_=-b*b/(1-this.es),S=3*this.es*(1-_)*this.sin_p12*this.cos_p12*v/(1-this.es),w=(x=t/m)-_*(1+_)*Math.pow(x,3)/6-S*(1+3*_)*Math.pow(x,4)/24,C=1-_*w*w/2-x*w*w*w/6,y=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*v),n=U(this.long0+Math.asin(Math.sin(g)*Math.sin(w)/Math.cos(y))),M=Math.sin(y),o=Math.atan2((M-this.es*C*this.sin_p12)*Math.tan(y),M*(1-this.es)),e.x=n,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]},Vt={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,i,r,s,n,a,o,l=e.x,h=e.y;return r=U(l-this.long0),t=Math.sin(h),i=Math.cos(h),s=Math.cos(r),((n=this.sin_p14*t+this.cos_p14*i*s)>0||Math.abs(n)<=u)&&(a=1*this.a*i*Math.sin(r),o=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*s)),e.x=a,e.y=o,e},inverse:function(e){var t,i,r,s,n,o,l;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),i=Tt(t/this.a),r=Math.sin(i),s=Math.cos(i),o=this.long0,Math.abs(t)<=u?(l=this.lat0,e.x=o,e.y=l,e):(l=Tt(s*this.sin_p14+e.y*r*this.cos_p14/t),n=Math.abs(this.lat0)-a,Math.abs(n)<=u?(o=this.lat0>=0?U(this.long0+Math.atan2(e.x,-e.y)):U(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=l,e):(o=U(this.long0+Math.atan2(e.x*r,t*this.cos_p14*s-e.y*this.sin_p14*r)),e.x=o,e.y=l,e))},names:["ortho"]},Jt={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},qt={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Ht(e,t,i,r){var s;return ep&&s<=a+p?(r.value=qt.AREA_1,s-=a):s>a+p||s<=-(a+p)?(r.value=qt.AREA_2,s=s>=0?s-m:s+m):(r.value=qt.AREA_3,s+=a)),s}function Wt(e,t){var i=e+t;return i<-m?i+=f:i>+m&&(i-=f),i}var Yt,Xt={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=a-p/2?this.face=Jt.TOP:this.lat0<=-(a-p/2)?this.face=Jt.BOTTOM:Math.abs(this.long0)<=p?this.face=Jt.FRONT:Math.abs(this.long0)<=a+p?this.face=this.long0>0?Jt.RIGHT:Jt.LEFT:this.face=Jt.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,i,r,s,n,o,l={x:0,y:0},h={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,i=e.x,this.face===Jt.TOP)s=a-t,i>=p&&i<=a+p?(h.value=qt.AREA_0,r=i-a):i>a+p||i<=-(a+p)?(h.value=qt.AREA_1,r=i>0?i-m:i+m):i>-(a+p)&&i<=-p?(h.value=qt.AREA_2,r=i+a):(h.value=qt.AREA_3,r=i);else if(this.face===Jt.BOTTOM)s=a+t,i>=p&&i<=a+p?(h.value=qt.AREA_0,r=-i+a):i=-p?(h.value=qt.AREA_1,r=-i):i<-p&&i>=-(a+p)?(h.value=qt.AREA_2,r=-i-a):(h.value=qt.AREA_3,r=i>0?-i+m:-i-m);else{var u,c,d,f,y,g,v;this.face===Jt.RIGHT?i=Wt(i,+a):this.face===Jt.BACK?i=Wt(i,+m):this.face===Jt.LEFT&&(i=Wt(i,-a)),f=Math.sin(t),y=Math.cos(t),g=Math.sin(i),v=Math.cos(i),u=y*v,c=y*g,d=f,this.face===Jt.FRONT?(s=Math.acos(u),r=Ht(s,d,c,h)):this.face===Jt.RIGHT?(s=Math.acos(c),r=Ht(s,d,-u,h)):this.face===Jt.BACK?(s=Math.acos(-u),r=Ht(s,d,-c,h)):this.face===Jt.LEFT?(s=Math.acos(-c),r=Ht(s,d,u,h)):(s=r=0,h.value=qt.AREA_0)}return o=Math.atan(12/m*(r+Math.acos(Math.sin(r)*Math.cos(p))-a)),n=Math.sqrt((1-Math.cos(s))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(r))))),h.value===qt.AREA_1?o+=a:h.value===qt.AREA_2?o+=m:h.value===qt.AREA_3&&(o+=1.5*m),l.x=n*Math.cos(o),l.y=n*Math.sin(o),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,e.x=l.x,e.y=l.y,e},inverse:function(e){var t,i,r,s,n,o,l,h,u,c,d,p,f={lam:0,phi:0},y={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?y.value=qt.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(y.value=qt.AREA_1,t-=a):e.x<0&&-e.x>=Math.abs(e.y)?(y.value=qt.AREA_2,t=t<0?t+m:t-m):(y.value=qt.AREA_3,t+=a),u=m/12*Math.tan(t),n=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),o=Math.atan(n),r=Math.cos(t),s=Math.tan(i),(l=1-r*r*s*s*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?l=-1:l>1&&(l=1),this.face===Jt.TOP)h=Math.acos(l),f.phi=a-h,y.value===qt.AREA_0?f.lam=o+a:y.value===qt.AREA_1?f.lam=o<0?o+m:o-m:y.value===qt.AREA_2?f.lam=o-a:f.lam=o;else if(this.face===Jt.BOTTOM)h=Math.acos(l),f.phi=h-a,y.value===qt.AREA_0?f.lam=-o+a:y.value===qt.AREA_1?f.lam=-o:y.value===qt.AREA_2?f.lam=-o-a:f.lam=o<0?-o-m:-o+m;else{var g,v,b;b=(u=(g=l)*g)>=1?0:Math.sqrt(1-u)*Math.sin(o),v=(u+=b*b)>=1?0:Math.sqrt(1-u),y.value===qt.AREA_1?(u=v,v=-b,b=u):y.value===qt.AREA_2?(v=-v,b=-b):y.value===qt.AREA_3&&(u=v,v=b,b=-u),this.face===Jt.RIGHT?(u=g,g=-v,v=u):this.face===Jt.BACK?(g=-g,v=-v):this.face===Jt.LEFT&&(u=g,g=v,v=-u),f.phi=Math.acos(-b)-a,f.lam=Math.atan2(v,g),this.face===Jt.RIGHT?f.lam=Wt(f.lam,-a):this.face===Jt.BACK?f.lam=Wt(f.lam,-m):this.face===Jt.LEFT&&(f.lam=Wt(f.lam,+a))}0!==this.es&&(c=f.phi<0?1:0,d=Math.tan(f.phi),p=this.b/Math.sqrt(d*d+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(f.phi=-f.phi));return f.lam+=this.long0,e.x=f.lam,e.y=f.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Qt=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Zt=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Kt=.8487,$t=1.3523,ei=d/5,ti=1/ei,ii=18,ri=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},si=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])},ni={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=U(e.x-this.long0),i=Math.abs(e.y),r=Math.floor(i*ei);r<0?r=0:r>=ii&&(r=ii-1),i=d*(i-ti*r);var s={x:ri(Qt[r],i)*t,y:ri(Zt[r],i)};return e.y<0&&(s.y=-s.y),s.x=s.x*this.a*Kt+this.x0,s.y=s.y*this.a*$t+this.y0,s},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Kt),y:Math.abs(e.y-this.y0)/(this.a*$t)};if(t.y>=1)t.x/=Qt[ii][0],t.y=e.y<0?-a:a;else{var i=Math.floor(t.y*ii);for(i<0?i=0:i>=ii&&(i=ii-1);;)if(Zt[i][0]>t.y)--i;else{if(!(Zt[i+1][0]<=t.y))break;++i}var r=Zt[i],s=5*(t.y-r[0])/(Zt[i+1][0]-r[0]);s=function(e,t,i,r){for(var s=t;r;--r){var n=e(s);if(s-=n,Math.abs(n)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,i,r,s,n=e.x,a=e.y;if(n-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var o=this.radius_p/He(this.radius_p*Math.cos(a),Math.sin(a));if(i=o*Math.cos(n)*Math.cos(a),r=o*Math.sin(n)*Math.cos(a),s=o*Math.sin(a),(this.radius_g-i)*i-r*r-s*s*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/He(s,t)),e.y=this.radius_g_1*Math.atan(s/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(s/He(r,t)))}else"sphere"===this.shape&&(t=Math.cos(a),i=Math.cos(n)*t,r=Math.sin(n)*t,s=Math.sin(a),t=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(r/He(s,t)),e.y=this.radius_g_1*Math.atan(s/t)):(e.x=this.radius_g_1*Math.atan(r/t),e.y=this.radius_g_1*Math.atan(s/He(r,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,i,r,s,n=-1,a=0,o=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*He(1,o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*He(1,a));var l=o/this.radius_p;if(t=a*a+l*l+n*n,i=2*this.radius_g*n,(r=i*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+s*n,a*=s,o*=s,e.x=Math.atan2(a,n),e.y=Math.atan(o*Math.cos(e.x)/n),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+o*o)):(a=Math.tan(e.x/this.radius_g_1),o=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+o*o+n*n,i=2*this.radius_g*n,(r=i*i-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-i-Math.sqrt(r))/(2*t),n=this.radius_g+s*n,a*=s,o*=s,e.x=Math.atan2(a,n),e.y=Math.atan(o*Math.cos(e.x)/n)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};return Se.defaultDatum="WGS84",Se.Proj=ne,Se.WGS84=new Se.Proj("WGS84"),Se.Point=Ge,Se.toPoint=fe,Se.defs=I,Se.nadgrid=function(e,t){var i=new DataView(t),r=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(i),s=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:te(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(i,r);s.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var n=function(e,t,i){for(var r=[],s=0;st?1:0}return function(i,r,s,n,a){!function t(i,r,s,n,a){for(;n>s;){if(n-s>600){var o=n-s+1,l=r-s+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(s,Math.floor(r-l*u/o+c)),p=Math.min(n,Math.floor(r+(o-l)*u/o+c));t(i,r,d,p,a)}var f=i[r],m=s,y=n;for(e(i,s,r),a(i[n],f)>0&&e(i,s,n);m0;)y--}0===a(i[s],f)?e(i,s,y):e(i,++y,n),y<=r&&(s=y+1),r<=y&&(n=y-1)}}(i,r,s||0,n||i.length-1,a||t)}}()},510:(e,t,i)=>{"use strict";e.exports=s,e.exports.default=s;var r=i(166);function s(e,t){if(!(this instanceof s))return new s(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,i){if(!i)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,t,i,s,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=s||(a=t+Math.ceil((i-t)/s/2)*s,r(e,a,t,i,n),o.push(t,a,a,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!f(e,t))return i;for(var s,n,a,o,l=[];t;){for(s=0,n=t.children.length;s=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(s,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=m(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,s,n,a,l,h,u,d,p,f,m,y,g,v;for(h=u=1/0,r=t;r<=i-t;r++)s=o(e,0,r,this.toBBox),n=o(e,r,i,this.toBBox),p=s,f=n,void 0,void 0,void 0,void 0,m=Math.max(p.minX,f.minX),y=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-m)*Math.max(0,v-y),l=c(s)+c(n),a=t;s--)n=e.children[s],l(u,e.leaf?a(n):n),c+=d(u);return c},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)l(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)0===e[i].children.length?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():a(e[i],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,i=t._array.subarray(t._index);return t._source.read().then(function(r){return t._array=e,t._index=0,r.done?i.length>0?{done:!1,value:i}:{done:!0,value:void 0}:{done:!1,value:function(e,t){if(!e.length)return t;if(!t.length)return e;var i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}(i,r.value)}})},t.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var i=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var s=new Uint8Array(t);return s.set(this._array.subarray(this._index)),function n(){return i._source.read().then(function(a){return a.done?(i._array=e,i._index=0,r>0?s.subarray(0,r):null):r+a.value.length>=t?(i._array=a.value,i._index=t-r,s.set(a.value.subarray(0,t-r),r),s):(s.set(a.value,r),r+=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 i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function r(e,t,i,r){return new(i||(i=Promise))(function(s,n){function a(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})}function s(e,t){var i,r,s,n,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[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(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,r&&(s=2&n[0]?r.return:n[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,n[1])).done)return s;switch(r=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,r=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(s=(s=a.trys).length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]=e.length&&(e=void 0),{value:e&&e[r++],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,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,s=i.apply(e,t||[]),n=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){s[e]&&(r[e]=function(t){return new Promise(function(i,r){n.push([e,t,i,r])>1||l(e,t)})})}function l(e,t){try{(i=s[e](t)).value instanceof a?Promise.resolve(i.value.v).then(h,u):c(n[0][2],i)}catch(e){c(n[0][3],e)}var i}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 i=e.call(this,t)||this;return Object.defineProperty(i,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(i,i.constructor.prototype):i.__proto__=i.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error),h=function(){function e(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),e.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}(),u=function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()},e}(),c=function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}return Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){this._q.length=y;return Promise.resolve(t).then(function(t){return!i&&e.state>=g?_(e).then(function(e){return{value:e,done:!0}}):{value:t,done:i}})}function x(e,t){var i,r;if(!(e.state>=m))if(e.state=m,e.onnext(),e.onstop(),null==e.err&&(e.err=t),0!==e.pushes.length||void 0!==e.buffer&&!e.buffer.empty)try{for(var s=n(e.pushes),a=s.next();!a.done;a=s.next()){a.value.resolve()}}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}else w(e)}function w(e){var t,i;if(!(e.state>=y)){e.state=g||(e.state=f)){e.state=f;var t=function(e,t){if(d(t),e.pushes.length>=v)throw new l("No more than "+v+" pending calls to push are allowed on a single repeater.");if(e.state>=m)return Promise.resolve(void 0);var i,r=void 0===e.pending?Promise.resolve(t):e.pending.then(function(){return t});r=r.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&&M(t),t.onnext(e),void 0!==t.buffer&&!t.buffer.empty){var i=S(t,t.buffer.remove());if(t.pushes.length){var r=t.pushes.shift();t.buffer.add(r.value),t.onnext=r.resolve}return i}if(t.pushes.length){var s=t.pushes.shift();return t.onnext=s.resolve,S(t,s.value)}return t.state>=m?(w(t),S(t,_(t))):new Promise(function(i){return t.nexts.push({resolve:i,value:e})})},e.prototype.return=function(e){d(e);var t=A.get(this);if(void 0===t)throw new Error("WeakMap error");return w(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),S(t,_(t))},e.prototype.throw=function(e){var t=A.get(this);if(void 0===t)throw new Error("WeakMap error");return t.state<=p||t.state>=m||void 0!==t.buffer&&!t.buffer.empty?(w(t),null==t.err&&(t.err=e),S(t,_(t))):this.next(Promise.reject(e))},e.prototype[Symbol.asyncIterator]=function(){return this},e.race=L,e.merge=O,e.zip=P,e.latest=N,e}();function E(e,t){var i,r,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 s(this,function(i){switch(i.label){case 0:return t.yieldValues?[4,a(e)]:[3,3];case 1:return[4,i.sent()];case 2:i.sent(),i.label=3;case 3:return t.returnValues?[4,a(e)]:[3,5];case 4:return[2,i.sent()];case 5:return[2]}})})}())};try{for(var u=n(e),c=u.next();!c.done;c=u.next()){h(c.value)}}catch(e){i={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}return l}function L(e){var t=this,i=E(e,{returnValues:!0});return new T(function(e,a){return r(t,void 0,void 0,function(){var t,r,o,l,h,u;return s(this,function(c){switch(c.label){case 0:if(!i.length)return a(),[2];r=!1,a.then(function(){t(),r=!0}),c.label=1;case 1:c.trys.push([1,,5,7]),l=void 0,h=0,u=function(){var r,u,c,d,p,f;return s(this,function(s){switch(s.label){case 0:r=h;try{for(p=void 0,u=n(i),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===r&&(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=s.sent())?[3,3]:[4,e(l.value)];case 2:s.sent(),s.label=3;case 3:return[2]}})},c.label=2;case 2:return r?[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(i.map(function(e){return e.return&&e.return()}))];case 6:return c.sent(),[7];case 7:return[2]}})})})}function O(e){var t=this,i=E(e,{yieldValues:!0});return new T(function(e,a){return r(t,void 0,void 0,function(){var t,o,l,h=this;return s(this,function(u){switch(u.label){case 0:if(!i.length)return a(),[2];t=[],o=!1,a.then(function(){var e,i;o=!0;try{for(var r=n(t),s=r.next();!s.done;s=r.next()){(0,s.value)()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,Promise.all(i.map(function(i,n){return r(h,void 0,void 0,function(){var r;return s(this,function(s){switch(s.label){case 0:s.trys.push([0,,6,9]),s.label=1;case 1:return o?[3,5]:(Promise.resolve(i.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===(r=s.sent())?[3,4]:r.done?(l=r,[2]):[4,e(r.value)];case 3:s.sent(),s.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return i.return?[4,i.return()]:[3,8];case 7:s.sent(),s.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 P(e){var t=this,i=E(e,{returnValues:!0});return new T(function(e,n){return r(t,void 0,void 0,function(){var t,r,a,o;return s(this,function(s){switch(s.label){case 0:if(!i.length)return n(),[2,[]];r=!1,n.then(function(){t(),r=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return r?[3,5]:(Promise.all(i.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=s.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 s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(i.map(function(e){return e.return&&e.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function N(e){var t=this,i=E(e,{yieldValues:!0,returnValues:!0});return new T(function(e,a){return r(t,void 0,void 0,function(){var t,o,l,h,u,c=this;return s(this,function(d){switch(d.label){case 0:if(!i.length)return a(),[2,[]];o=[],l=!1,a.then(function(){var e,i;t();try{for(var r=n(o),s=r.next();!s.done;s=r.next()){(0,s.value)()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}l=!0}),d.label=1;case 1:return d.trys.push([1,,5,7]),Promise.all(i.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(i.map(function(t,i){return r(c,void 0,void 0,function(){var r;return s(this,function(s){switch(s.label){case 0:if(h[i].done)return[2,h[i].value];s.label=1;case 1:return l?[3,4]:(Promise.resolve(t.next()).then(function(e){return o[i](e)},function(e){return a(e)}),[4,new Promise(function(e){return o[i]=e})]);case 2:return void 0===(r=s.sent())?[2,h[i].value]:r.done?[2,r.value]:(u[i]=r.value,[4,e(u.slice())]);case 3:return s.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,d.sent()];case 5:return a(),[4,Promise.all(i.map(function(e){return e.return&&e.return()}))];case 6:return d.sent(),[7];case 7:return[2]}})})})}t.ZN=T}},t={};function i(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}i.n=(e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t}),i.d=((e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=((e,t)=>Object.prototype.hasOwnProperty.call(e,t)),i.nmd=(e=>(e.paths=[],e.children||(e.children=[]),e)),(()=>{"use strict";var e=window.SuperMap=window.SuperMap||{};e.Components=window.SuperMap.Components||{};var t={GEOJSON:"GEOJSON",ISERVER:"ISERVER",FGB:"FGB"},r={ISERVER:"ISERVER",IPORTAL:"IPORTAL",ONLINE:"ONLINE"},s={LINE:"LINE",LINEM:"LINEM",POINT:"POINT",REGION:"REGION",POINTEPS:"POINTEPS",LINEEPS:"LINEEPS",REGIONEPS:"REGIONEPS",ELLIPSE:"ELLIPSE",CIRCLE:"CIRCLE",TEXT:"TEXT",RECTANGLE:"RECTANGLE",UNKNOWN:"UNKNOWN",GEOCOMPOUND:"GEOCOMPOUND"},n={ATTRIBUTE:"ATTRIBUTE",ATTRIBUTEANDGEOMETRY:"ATTRIBUTEANDGEOMETRY",GEOMETRY:"GEOMETRY"},a={CONTAIN:"CONTAIN",CROSS:"CROSS",DISJOINT:"DISJOINT",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",NONE:"NONE",OVERLAP:"OVERLAP",TOUCH:"TOUCH",WITHIN:"WITHIN"},o={DISTANCE:"DISTANCE",AREA:"AREA"},l={METER:"METER",KILOMETER:"KILOMETER",MILE:"MILE",YARD:"YARD",DEGREE:"DEGREE",MILLIMETER:"MILLIMETER",CENTIMETER:"CENTIMETER",INCH:"INCH",DECIMETER:"DECIMETER",FOOT:"FOOT",SECOND:"SECOND",MINUTE:"MINUTE",RADIAN:"RADIAN"},h={CENTIMETER:"CENTIMETER",DECIMETER:"DECIMETER",FOOT:"FOOT",INCH:"INCH",KILOMETER:"KILOMETER",METER:"METER",MILE:"MILE",MILLIMETER:"MILLIMETER",YARD:"YARD"},u={CAPTION:"CAPTION",CAPTION_PERCENT:"CAPTION_PERCENT",CAPTION_VALUE:"CAPTION_VALUE",PERCENT:"PERCENT",VALUE:"VALUE"},c={AREA:"AREA",BAR:"BAR",BAR3D:"BAR3D",LINE:"LINE",PIE:"PIE",PIE3D:"PIE3D",POINT:"POINT",RING:"RING",ROSE:"ROSE",ROSE3D:"ROSE3D",STACK_BAR:"STACK_BAR",STACK_BAR3D:"STACK_BAR3D",STEP:"STEP"},d={ALL:"ALL",NONE:"NONE",YAXES:"YAXES"},p={CONSTANT:"CONSTANT",LOGARITHM:"LOGARITHM",SQUAREROOT:"SQUAREROOT"},f={CUSTOMINTERVAL:"CUSTOMINTERVAL",EQUALINTERVAL:"EQUALINTERVAL",LOGARITHM:"LOGARITHM",QUANTILE:"QUANTILE",SQUAREROOT:"SQUAREROOT",STDDEVIATION:"STDDEVIATION"},m={BLACK_WHITE:"BLACKWHITE",BLUE_BLACK:"BLUEBLACK",BLUE_RED:"BLUERED",BLUE_WHITE:"BLUEWHITE",CYAN_BLACK:"CYANBLACK",CYAN_BLUE:"CYANBLUE",CYAN_GREEN:"CYANGREEN",CYAN_WHITE:"CYANWHITE",GREEN_BLACK:"GREENBLACK",GREEN_BLUE:"GREENBLUE",GREEN_ORANGE_VIOLET:"GREENORANGEVIOLET",GREEN_RED:"GREENRED",GREEN_WHITE:"GREENWHITE",PINK_BLACK:"PINKBLACK",PINK_BLUE:"PINKBLUE",PINK_RED:"PINKRED",PINK_WHITE:"PINKWHITE",RAIN_BOW:"RAINBOW",RED_BLACK:"REDBLACK",RED_WHITE:"REDWHITE",SPECTRUM:"SPECTRUM",TERRAIN:"TERRAIN",YELLOW_BLACK:"YELLOWBLACK",YELLOW_BLUE:"YELLOWBLUE",YELLOW_GREEN:"YELLOWGREEN",YELLOW_RED:"YELLOWRED",YELLOW_WHITE:"YELLOWWHITE"},y={TOPLEFT:"TOPLEFT",TOPCENTER:"TOPCENTER",TOPRIGHT:"TOPRIGHT",BASELINELEFT:"BASELINELEFT",BASELINECENTER:"BASELINECENTER",BASELINERIGHT:"BASELINERIGHT",BOTTOMLEFT:"BOTTOMLEFT",BOTTOMCENTER:"BOTTOMCENTER",BOTTOMRIGHT:"BOTTOMRIGHT",MIDDLELEFT:"MIDDLELEFT",MIDDLECENTER:"MIDDLECENTER",MIDDLERIGHT:"MIDDLERIGHT"},g={NORMAL:"ALONG_LINE_NORMAL",LB_TO_RT:"LEFT_BOTTOM_TO_RIGHT_TOP",LT_TO_RB:"LEFT_TOP_TO_RIGHT_BOTTOM",RB_TO_LT:"RIGHT_BOTTOM_TO_LEFT_TOP",RT_TO_LB:"RIGHT_TOP_TO_LEFT_BOTTOM"},v={DIAMOND:"DIAMOND",ELLIPSE:"ELLIPSE",MARKER:"MARKER",NONE:"NONE",RECT:"RECT",ROUNDRECT:"ROUNDRECT",TRIANGLE:"TRIANGLE"},b={NEWLINE:"NEWLINE",NONE:"NONE",OMIT:"OMIT"},_={FLAT:"FLAT",ROUND:"ROUND"},S={CLIP:"CLIP",ERASE:"ERASE",IDENTITY:"IDENTITY",INTERSECT:"INTERSECT",UNION:"UNION",UPDATE:"UPDATE",XOR:"XOR"},x={INDEXEDHDFS:"INDEXEDHDFS",UDB:"UDB",MONGODB:"MONGODB",PG:"PG"},w={BSPLINE:"BSPLINE",POLISH:"POLISH"},C={ISOLINE:"ISOLINE",ISOREGION:"ISOREGION"},M={DATASET_AND_RECORDSET:"DATASET_AND_RECORDSET",DATASET_ONLY:"DATASET_ONLY",RECORDSET_ONLY:"RECORDSET_ONLY"},A={ADD:"add",UPDATE:"update",DELETE:"delete"},T={LESS_TIME:"LESS_TIME",LESS_TRANSFER:"LESS_TRANSFER",LESS_WALK:"LESS_WALK",MIN_DISTANCE:"MIN_DISTANCE"},E={BUS:"BUS",SUBWAY:"SUBWAY",NO_SUBWAY:"NO_SUBWAY",NONE:"NONE"},O={EXPONENTIAL:"EXPONENTIAL",GAUSSIAN:"GAUSSIAN",SPHERICAL:"SPHERICAL"},P={EXP1:"EXP1",EXP2:"EXP2"},N={IP:"IP",REFERER:"Referer",REQUESTIP:"RequestIP",NONE:"NONE",SERVER:"SERVER",WEB:"WEB"},I={CLIP:"clip",INTERSECT:"intersect"},F={SQUAREMETER:"SquareMeter",SQUAREKILOMETER:"SquareKiloMeter",HECTARE:"Hectare",ARE:"Are",ACRE:"Acre",SQUAREFOOT:"SquareFoot",SQUAREYARD:"SquareYard",SQUAREMILE:"SquareMile"},k={METER:"Meter",KILOMETER:"Kilometer",YARD:"Yard",FOOT:"Foot",MILE:"Mile"},D={MAX:"max",MIN:"min",AVERAGE:"average",SUM:"sum",VARIANCE:"variance",STDDEVIATION:"stdDeviation"},R={SUMMARYMESH:"SUMMARYMESH",SUMMARYREGION:"SUMMARYREGION"},B={REGIONNOOVERLAP:"REGIONNOOVERLAP",REGIONNOOVERLAPWITH:"REGIONNOOVERLAPWITH",REGIONCONTAINEDBYREGION:"REGIONCONTAINEDBYREGION",REGIONCOVEREDBYREGION:"REGIONCOVEREDBYREGION",LINENOOVERLAP:"LINENOOVERLAP",LINENOOVERLAPWITH:"LINENOOVERLAPWITH",POINTNOIDENTICAL:"POINTNOIDENTICAL"},G={GEOHASH_GRID:"geohash_grid"},U={AVG:"avg",MAX:"max",MIN:"min",SUM:"sum"},j={NDVI:"NDVI",HILLSHADE:"HILLSHADE"};class z{constructor(e,t){this.w=e?parseFloat(e):0,this.h=e?parseFloat(t):0,this.CLASS_NAME="SuperMap.Size"}toString(){return"w="+this.w+",h="+this.h}clone(){return new z(this.w,this.h)}equals(e){var t=!1;return null!=e&&(t=this.w===e.w&&this.h===e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t}destroy(){this.w=null,this.h=null}}class V{constructor(e,t,i){this.x=e?parseFloat(e):0,this.y=t?parseFloat(t):0,this.mode=i,this.CLASS_NAME="SuperMap.Pixel"}toString(){return"x="+this.x+",y="+this.y}clone(){return new V(this.x,this.y,this.mode)}equals(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}add(e,t){if(null==e||null==t)throw new TypeError("Pixel.add cannot receive null values");return new V(this.x+e,this.y+t)}offset(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t}destroy(){this.x=null,this.y=null,this.mode=null}}V.Mode={LeftTop:"lefttop",RightTop:"righttop",RightBottom:"rightbottom",LeftBottom:"leftbottom"};var J=function(...e){class t{constructor(t){for(var i=0;i0&&(i=parseFloat(e.toPrecision(t))),i},format:function(e,t,i,r){t=void 0!==t?t:0,i=void 0!==i?i:H.thousandsSeparator,r=void 0!==r?r:H.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var s=e.toString().split(".");1===s.length&&null==t&&(t=0);var n,a=s[0];if(i)for(var o=/(-?[0-9]+)([0-9]{3})/;o.test(a);)a=a.replace(o,"$1"+i+"$2");if(0==t)n=a;else{var l=s.length>1?s[1]:"0";null!=t&&(l+=new Array(t-l.length+1).join("0")),n=a+r+l}return n}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return H.limitSigDigs(this,e)});var W={bind:function(e,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var r=i.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,r)}},bindAsEventListener:function(e,t){return function(i){return e.call(t,i||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},Y={filter:function(e,t,i){var r=[];if(Array.prototype.filter)r=e.filter(t,i);else{var s=e.length;if("function"!=typeof t)throw new TypeError;for(var n=0;n-1||s.indexOf("trident")>-1&&s.indexOf("rv")>-1?(t="msie",e=s.match(/msie ([\d.]+)/)||s.match(/rv:([\d.]+)/)):s.indexOf("chrome")>-1?(t="chrome",e=s.match(/chrome\/([\d.]+)/)):s.indexOf("firefox")>-1?(t="firefox",e=s.match(/firefox\/([\d.]+)/)):s.indexOf("opera")>-1?(t="opera",e=s.match(/version\/([\d.]+)/)):s.indexOf("safari")>-1&&(t="safari",e=s.match(/version\/([\d.]+)/)),i=e?e[1]:"",s.indexOf("ipad")>-1||s.indexOf("ipod")>-1||s.indexOf("iphone")>-1?r="apple":s.indexOf("android")>-1&&(i=(e=s.match(/version\/([\d.]+)/))?e[1]:"",r="android"),{name:t,version:i,device:r}}(),Z=function(){var e=!0,t=Q;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}(),K=function(){var e=navigator.userAgent.toLowerCase();return-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")}(),$=96,ee={assign(e){for(var t=0;t=0;i--)e[i]===t&&e.splice(i,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i=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 i="function"==typeof window.Event&&t instanceof window.Event;for(var r in t)(void 0===e[r]||!i&&t.hasOwnProperty&&t.hasOwnProperty(r)&&!e.hasOwnProperty(r))&&(e[r]=t[r]);return!i&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var i in e){var r,s=e[i];if(null!=s&&"function"!=typeof s)r=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(i)+"="+r)}return t.join("&")},urlAppend:function(e,t){var i=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var r=(e+" ").split(/[?&]/);i+=" "===r.pop()?t:r.length?"&"+t:"?"+t}return i},urlPathAppend:function(e,t){let i=e;if(!t)return i;0===t.indexOf("/")&&(t=t.substring(1));const r=e.split("?");return r[0].indexOf("/",r[0].length-1)<0&&(r[0]+="/"),i=`${r[0]}${t}${r.length>1?`?${r[1]}`:""}`},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=ee.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(q.contains(e,"?")){var i=e.indexOf("?")+1,r=q.contains(e,"#")?e.indexOf("#"):e.length;t=e.substring(i,r)}for(var s={},n=t.split(/[&;]/),a=0,o=n.length;a1?1/e:e},getResolutionFromScale:function(e,t){var i;e&&(null==t&&(t="degrees"),i=1/(ee.normalizeScale(e)*te[t]*$));return i},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*te[t]*$},getBrowser:function(){return Q},isSupportCanvas:Z,supportCanvas:function(){return ee.isSupportCanvas},isInTheSameDomain:function(e){if(!e)return!0;var t=e.indexOf("//"),i=document.location.toString(),r=i.indexOf("//");if(-1===t)return!0;var s,n=s=e.substring(0,t),a=i.substring(r+2);r=a.indexOf("/");var o=a.indexOf(":"),l=a.substring(0,r),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:"===s.toLowerCase()?80:443)),c===document.domain&&d===l},calculateDpi:function(e,t,i,r,s){if(e&&t&&i){var n,a=e.getWidth(),o=e.getHeight(),l=t.w,h=t.h;if(s=s||6378137,"degree"===(r=r||"degrees").toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()){let e=a/l,t=o/h;n=254/(e>t?e:t)/i/(2*Math.PI*s/360)/1e4}else{n=254/(a/l)/i/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 i="",r=0,s=t.length;r0?"{"+e.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,i,r){return r=r||6378137,i=i||"",e>0&&t>0?(e=ee.normalizeScale(e),"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,i,r){return r=r||6378137,i=i||"",e>0&&t>0?"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/t/e/(2*Math.PI*r/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 i in t){var r=t[i];void 0!==r&&"CLASS_NAME"!==i&&"function"!=typeof r&&(e[i]=r)}return e},copyAttributesWithClip:function(e,t,i){if(e=e||{},t)for(var r in t){var s=!1;if(i&&i.length)for(var n=0,a=i.length;n=0&&n<=1&&s<=1&&n>=0?new X.Point(e.x+s*(t.x-e.x),e.y+s*(t.y-e.y)):"No Intersection";else if(0==o&&0==l){var u=Math.max(e.y,t.y),c=Math.min(e.y,t.y),d=Math.max(e.x,t.x),p=Math.min(e.x,t.x);a=(i.y>=c&&i.y<=u||r.y>=c&&r.y<=u)&&i.x>=p&&i.x<=d||r.x>=p&&r.x<=d?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,i){document.body.appendChild(i),i.style.width="auto",i.style.height="auto",e.fontSize&&(i.style.fontSize=e.fontSize),e.fontFamily&&(i.style.fontFamily=e.fontFamily),e.fontWeight&&(i.style.fontWeight=e.fontWeight),i.style.position="relative",i.style.visibility="hidden",i.style.display="inline-block",i.innerHTML=t;var r=i.clientWidth,s=i.clientHeight;return document.body.removeChild(i),{textWidth:r,textHeight:s}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,(e,i)=>{var r;return r=t.hasOwnProperty(i)?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[i]):e,encodeURIComponent(r)}):e}},te={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};te.in=te.inches,te.degrees=te.dd,te.nmi=1852*te.m;const ie=.0254000508001016;ee.extend(te,{Inch:te.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}),ee.extend(te,{mm:te.Meter/1e3,cm:te.Meter/100,dm:100*te.Meter,km:1e3*te.Meter,kmi:te.nmi,fath:te.Fathom,ch:te.IntnlChain,link:te.IntnlLink,"us-in":te.inches,"us-ft":te.Foot,"us-yd":te.Yard,"us-ch":te.GunterChain,"us-mi":te.Mile,"ind-yd":te.IndianYd37,"ind-ft":te.IndianFt37,"ind-ch":791.9942845122}),te.degree=te.dd,te.meter=te.m,te.foot=te.ft,te.inch=te.inches,te.mile=te.mi,te.kilometer=te.km,te.yard=te.yd;class re{constructor(e,t){ee.isArray(e)&&(t=e[1],e=e[0]),this.lon=e?ee.toFloat(e):0,this.lat=t?ee.toFloat(t):0,this.CLASS_NAME="SuperMap.LonLat"}toString(){return"lon="+this.lon+",lat="+this.lat}toShortString(){return this.lon+","+this.lat}clone(){return new re(this.lon,this.lat)}add(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new re(this.lon+ee.toFloat(e),this.lat+ee.toFloat(t))}equals(e){var t=!1;return null!=e&&(t=this.lon===e.lon&&this.lat===e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t}wrapDateLine(e){var t=this.clone();if(e){for(;t.lone.right;)t.lon-=e.getWidth()}return t}destroy(){this.lon=null,this.lat=null}static fromString(e){var t=e.split(",");return new re(t[0],t[1])}static fromArray(e){var t=ee.isArray(e),i=t&&e[0],r=t&&e[1];return new re(i,r)}}class se{constructor(e,t,i,r){ee.isArray(e)&&(r=e[3],i=e[2],t=e[1],e=e[0]),this.left=null!=e?ee.toFloat(e):this.left,this.bottom=null!=t?ee.toFloat(t):this.bottom,this.right=null!=i?ee.toFloat(i):this.right,this.top=null!=r?ee.toFloat(r):this.top,this.centerLonLat=null,this.CLASS_NAME="SuperMap.Bounds"}clone(){return new se(this.left,this.bottom,this.right,this.top)}equals(e){var t=!1;return null!=e&&(t=this.left===e.left&&this.right===e.right&&this.top===e.top&&this.bottom===e.bottom),t}toString(){return[this.left,this.bottom,this.right,this.top].join(",")}toArray(e){return!0===e?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]}toBBOX(e,t){null==e&&(e=6);var i=Math.pow(10,e),r=Math.round(this.left*i)/i,s=Math.round(this.bottom*i)/i,n=Math.round(this.right*i)/i,a=Math.round(this.top*i)/i;return!0===t?s+","+r+","+a+","+n:r+","+s+","+n+","+a}getWidth(){return this.right-this.left}getHeight(){return this.top-this.bottom}getSize(){return new z(this.getWidth(),this.getHeight())}getCenterPixel(){return new V((this.left+this.right)/2,(this.bottom+this.top)/2)}getCenterLonLat(){return this.centerLonLat||(this.centerLonLat=new re((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat}scale(e,t){var i,r;e=e||1,null==t&&(t=this.getCenterLonLat()),"SuperMap.LonLat"===t.CLASS_NAME?(i=t.lon,r=t.lat):(i=t.x,r=t.y);var s=(this.left-i)*e+i,n=(this.bottom-r)*e+r,a=(this.right-i)*e+i,o=(this.top-r)*e+r;return new se(s,n,a,o)}add(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new se(this.left+e,this.bottom+t,this.right+e,this.top+t)}extend(e){var t=null;if(e){switch(e.CLASS_NAME){case"SuperMap.LonLat":t=new se(e.lon,e.lat,e.lon,e.lat);break;case"SuperMap.Geometry.Point":t=new se(e.x,e.y,e.x,e.y);break;case"SuperMap.Bounds":t=e}t&&(this.centerLonLat=null,(null==this.left||t.leftthis.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}}containsLonLat(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var i=this.contains(e.lon,e.lat,t.inclusive),r=t.worldBounds;if(r&&!i){var s=r.getWidth(),n=(r.left+r.right)/2,a=Math.round((e.lon-n)/s);i=this.containsLonLat({lon:e.lon-a*s,lat:e.lat},{inclusive:t.inclusive})}return i}containsPixel(e,t){return this.contains(e.x,e.y,t)}contains(e,t,i){if(null==i&&(i=!0),null==e||null==t)return!1;return i?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&ethis.bottom&&t=i.bottom&&e.bottom<=i.top||i.bottom>=e.bottom&&i.bottom<=e.top,a=e.top>=i.bottom&&e.top<=i.top||i.top>e.bottom&&i.top=i.left&&e.left<=i.right||i.left>=e.left&&i.left<=e.right,l=e.right>=i.left&&e.right<=i.right||i.right>=e.left&&i.right<=e.right;r=(n||a)&&(o||l)}if(t.worldBounds&&!r){var h=t.worldBounds,u=h.getWidth(),c=!h.containsBounds(i),d=!h.containsBounds(e);c&&!d?(e=e.add(-u,0),r=i.intersectsBounds(e,{inclusive:t.inclusive})):d&&!c&&(i=i.add(-u,0),r=e.intersectsBounds(i,{inclusive:t.inclusive}))}return r}containsBounds(e,t,i){null==t&&(t=!1),null==i&&(i=!0);var r=this.contains(e.left,e.bottom,i),s=this.contains(e.right,e.bottom,i),n=this.contains(e.left,e.top,i),a=this.contains(e.right,e.top,i);return t?r||s||n||a:r&&s&&n&&a}determineQuadrant(e){var t="",i=this.getCenterLonLat();return t+=e.lat=e.right&&s.right>e.right;)s=s.add(-n,0);var a=s.left+i;ae.left&&s.right-r>e.right&&(s=s.add(-n,0))}return s}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 i=e.split(",");return se.fromArray(i,t)}static fromArray(e,t){return!0===t?new se(e[1],e[0],e[3],e[2]):new se(e[0],e[1],e[2],e[3])}static fromSize(e){return new se(0,e.h,e.w,0)}static oppositeQuadrant(e){var t="";return t+="t"===e.charAt(0)?"b":"t",t+="l"===e.charAt(1)?"r":"l"}}class ne extends X{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 ne,t=0,i=this.components.length;t-1)){if(null!=t&&t=0;--i)t=this.removeComponent(e[i])||t;return t}removeComponent(e){return ee.removeItem(this.components,e),this.clearBounds(),!0}getArea(){for(var e=0,t=0,i=this.components.length;t2;return t&&super.removeComponent.apply(this,arguments),t}getSortedSegments(){for(var e,t,i=this.components.length-1,r=new Array(i),s=0;s=1?1:g)<=-1?-1:g,u=180*Math.acos(g)/Math.PI,a=(u=s.x==i.x?t.x>i.x&&r.x>i.x||t.xd*t.x+p&&r.y>d*r.x+p||t.yi.y?r.xi.x&&(o=!1):s.xd*r.x+p&&(o=!1):s.x>i.x?r.y>i.y&&(o=!1):r.y=0?180*Math.atan(v)/Math.PI:Math.abs(180*Math.atan(v)/Math.PI)+90,_=Math.abs(t.y);i.y==_&&_==s.y&&i.x=0?v>=0?h+=l:h=180-(h-90)+l:h=v>0?h-180+l:90-h+l:S>=0?v>=0?h-=l:h=180-(h-90)-l:h=v>=0?h-180-l:90-h-l,h=h*Math.PI/180;var w=t.x+n*Math.cos(h),C=t.y+n*Math.sin(h);c.push(new le(w,C))}c.push(s)}return c}static createLineEPS(e){var t=[],i=e.length;if(i<2)return e;for(var r=0;r1&&(i=parseFloat(i)*h),r.labelAlign&&"cm"!==r.labelAlign)switch(r.labelAlign){case"lt":l.x+=t/2,l.y+=i/2;break;case"lm":l.x+=t/2;break;case"lb":l.x+=t/2,l.y-=i/2;break;case"ct":l.y+=i/2;break;case"cb":l.y-=i/2;break;case"rt":l.x-=t/2,l.y+=i/2;break;case"rm":l.x-=t/2;break;case"rb":l.x-=t/2,l.y-=i/2}return this.bsInfo.h=i,this.bsInfo.w=t,s=l.x-parseFloat(t)/2,n=l.y+parseFloat(i)/2,o=l.x+parseFloat(t)/2,a=l.y-parseFloat(i)/2,new se(s,n,o,a)}getLabelPxBoundsByText(e,t){var i,r,s,n,a=this.getLabelPxSize(t),o=ee.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,i=o.x-a.w/2,r=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,s=o.y-a.h/2,new se(i,r,n,s)}getLabelPxSize(e){var t,i,r,s,n=parseFloat(e.strokeWidth);t=e.label||this.text,i=e.fontSize?parseFloat(e.fontSize):parseFloat("12px");var a=t.split("\n"),o=a.length;s=o>1?i*o+o+n+.2*i:i+n+.2*i+1,r=0,this.labelWTmp&&r255?i++:r++;return t.cnC=i,t.enC=r,t.textC=e.length,t}}class ce extends he{constructor(e){super(e),this.componentTypes=["SuperMap.Geometry.Point"],this.CLASS_NAME="SuperMap.Geometry.LinearRing",this.geometryType="LinearRing"}addComponent(e,t){var i=!1,r=this.components.pop();null==t&&e.equals(r)||(i=super.addComponent.apply(this,arguments));var s=this.components[0];return super.addComponent.apply(this,[s]),i}removeComponent(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),super.removeComponent.apply(this,arguments);var i=this.components[0];super.addComponent.apply(this,[i])}return t}getArea(){var e=0;if(this.components&&this.components.length>2){for(var t=0,i=0,r=this.components.length;i0){e+=Math.abs(this.components[0].getArea());for(var t=1,i=this.components.length;t1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var i=ve.element(e);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=t.toUpperCase());)i=i.parentNode;return i},observe:function(e,t,i,r){var s=ee.getElement(e);if(r=r||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!s._eventCacheID){var n="eventCacheID_";s.id&&(n=s.id+"_"+n),s._eventCacheID=ee.createUniqueID(n)}var a=s._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:s,name:t,observer:i,useCapture:r}),s.addEventListener?"mousewheel"===t?s.addEventListener(t,i,{useCapture:r,passive:!1}):s.addEventListener(t,i,r):s.attachEvent&&s.attachEvent("on"+t,i)},stopObservingElement:function(e){var t=ee.getElement(e)._eventCacheID;this._removeElementObservers(ve.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var i=e[t],r=new Array(i.element,i.name,i.observer,i.useCapture);ve.stopObserving.apply(this,r)}},stopObserving:function(e,t,i,r){r=r||!1;var s=ee.getElement(e),n=s._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.detachEvent)&&(t="keydown");var a=!1,o=ve.observers[n];if(o)for(var l=0;!a&&l0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.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,i){var r=t[i];return r||(r=i.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%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 i;if(this.nativeJSON)try{i=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=i),i}write(e,t){this.pretty=!!t;var i=null,r=typeof e;if(this.serialize[r])try{i=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[r].apply(this,[e])}catch(e){}return i}writeIndent(){var e=[];if(this.pretty)for(var t=0;t0){e+='"points":[';for(var i=0,r=this.components.length;i0))return null;for(var n=0,a=0,o=[];n0){if(1===i)return new le(t[0].x,t[0].y);var r=[];for(let e=0;e0){if(1===i){let i=[];for(let r=0;r0){if(1===o){for(e=0,i=[];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?s.push(l[e]):(s[d[e]].components=s[d[e]].components.concat(l[e].components),s.push(""))}else{s=new Array;for(let e=0;e0&&s.length>0&&(s[s.length-1].components=s[s.length-1].components.concat(a),a=[]),s.push(l[e])),e==r-1){var p=s.length;if(p)s[p-1].components=s[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==r-1){var m=n.length;if(m)n[m-1].components=n[m-1].components.concat(l);else for(let e=0,t=l.length;ee[n]){var a=e[n];e[n]=e[s],e[s]=a;var o=t[n];if(t[n]=t[s],t[s]=o,i&&i.length>0){var l=i[n];i[n]=i[s],i[s]=l}if(r&&r.length>0){var h=r[n];r[n]=r[s],r[s]=h}}}}class Oe extends Ce{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 le(e[0],e[1])},multipoint:function(e){for(var t=[],i=null,r=0,s=e.length;rthis._toiSevrerFeature(e)):this._toiSevrerFeature(r)}toGeoJSON(e){var t={type:null};if(ee.isArray(e)){t.type="FeatureCollection";var i=e.length;t.features=new Array(i);for(var r=0;r-1||(t[r]=e[r]);return t}}class Pe{constructor(e){var t=this;e=e||{},this.speed=e.speed&&e.speed>=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=t.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],t.events=new be(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(){}}i(107),i(693);var Ne=i(144),Ie=i.n(Ne);let Fe=window.fetch;var ke,De,Re={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=ee.toJSON(e[t]));var i=encodeURIComponent(e[t]);this.queryValues.push(i)}},issue:function(e){for(var t=this,i=t.getUid(),r=e.url,s=[],n=r,a=0,o=t.queryKeys?t.queryKeys.length:0,l=0;l=t.limitLength){if(0==a)return!1;s.push(n),n=r,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&&(s.push(n),n=r,a=0)}else a++,n.indexOf("?")>-1?n+="&":n+="?",n+=t.queryKeys[l]+"="+t.queryValues[l];return s.push(n),t.send(s,"SuperMapJSONPCallbacks_"+i,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,i){var r=e.length;if(r>0)return new Promise(s=>{for(var n=(new Date).getTime(),a=0;a-1?o+="&":o+="?",o+="sectionCount="+r,o+="§ionIndex="+a,o+="&jsonpUserID="+n,i&&(o=decodeURIComponent(o),o=i+encodeURIComponent(o)),Ie()(o,{jsonpCallbackFunction:t,timeout:3e4}).then(e=>{s(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)}},Be=function(){return void 0!=ke?ke:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},Ge=function(){return De||45e3},Ue={commit:function(e,t,i,r){switch(e=e?e.toUpperCase():e){case"GET":return this.get(t,i,r);case"POST":return this.post(t,i,r);case"PUT":return this.put(t,i,r);case"DELETE":return this.delete(t,i,r);default:return this.get(t,i,r)}},supportDirectRequest:function(e,t){return!!ee.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:Be()||t.proxy)},get:function(e,t,i){i=i||{};if(e=ee.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){var r={url:e=e.replace(".json",".jsonp"),data:t};return Re.GET(r)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,i):this._fetch(e,t,i,"GET")},delete:function(e,t,i){i=i||{};if(e=ee.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){e=e.replace(".json",".jsonp");var r={url:e+="&_method=DELETE",data:t};return Re.DELETE(r)}return this.urlIsLong(e)?this._postSimulatie("DELETE",e.substring(0,e.indexOf("?")),t,i):this._fetch(e,t,i,"DELETE")},post:function(e,t,i){if(i=i||{},e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){e=e.replace(".json",".jsonp");var r={url:ee.urlAppend(e,"_method=POST"),data:t};return Re.POST(r)}return this._fetch(e,t,i,"POST")},put:function(e,t,i){if(i=i||{},e=this._processUrl(e,i),!this.supportDirectRequest(e,i)){e=e.replace(".json",".jsonp");var r={url:e+="&_method=PUT",data:t};return Re.PUT(r)}return this._fetch(e,t,i,"PUT")},urlIsLong:function(e){for(var t=0,i=null,r=0,s=e.length;r-1?"&":"?")+"_method="+e,"string"!=typeof i&&(i=JSON.stringify(i)),this.post(t,i,r)},_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 i=e.split("?");2===i.length&&(e=i[0]+".json?"+i[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,i,r){return(i=i||{}).headers=i.headers||{},i.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(i.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),i.timeout?this._timeout(i.timeout,Fe(e,{method:r,headers:i.headers,body:"PUT"===r||"POST"===r?t:void 0,credentials:this._getWithCredentials(i),mode:"cors",timeout:Ge()}).then(function(e){return e})):Fe(e,{method:r,body:"PUT"===r||"POST"===r?t:void 0,headers:i.headers,credentials:this._getWithCredentials(i),mode:"cors",timeout:Ge()}).then(function(e){return e})},_getWithCredentials:function(e){return!0===e.withCredentials?"include":!1===e.withCredentials?"omit":"same-origin"},_fetchJsonp:function(e,t){return t=t||{},Ie()(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(i,r){setTimeout(function(){r(new Error("timeout"))},e),t.then(i,r)})},_getParameterString:function(e){var t=[];for(var i in e){var r,s=e[i];if(null!=s&&"function"!=typeof s)r=Array.isArray(s)||"[object Object]"===s.toString()?encodeURIComponent(JSON.stringify(s)):encodeURIComponent(s),t.push(encodeURIComponent(i)+"="+r)}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}};class je{static generateToken(e,t){var i=this.servers[e];if(i)return Ue.post(i.tokenServiceUrl,JSON.stringify(t.toJSON())).then(function(e){return e.text()})}static registerServers(e){this.servers=this.servers||{},ee.isArray(e)||(e=[e]);for(var t=0;t0?(i.totalTimes--,i.ajaxPolling(t)):e&&e(r,t)}}ajaxPolling(e){let t=this,i=e.url,r=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],i=i.replace(r,r.exec(t.url)[0]),e.url=i,e.isInTheSameDomain=ee.isInTheSameDomain(i),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=ee.transformResult(e),this.events.triggerEvent("processCompleted",{result:e,options:t})}serviceProcessFailed(e,t){let i=(e=ee.transformResult(e)).error||e;this.events.triggerEvent("processFailed",{error:i,options:t})}_returnContent(e){return e.scope.format!==t.FGB&&!!e.scope.returnContent}supportDataFormat(e){return this.dataFormat().includes(e)}dataFormat(){return[t.GEOJSON,t.ISERVER]}_commit(e){if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=ee.urlAppend(e.url,ee.getParameterString(e.params||{}))),"object"==typeof e.data)try{e.params=ee.toJSON(e.data)}catch(e){console.log("不是json对象")}else e.params=e.data;Ue.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(i){let r=i;return"string"==typeof i&&(r=(new Ce).read(i)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&e.scope.format===t.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(e){return{error:e}}).then(t=>{t.error?(e.scope?W.bind(e.failure,e.scope):e.failure)(t):(t.succeed=void 0==t.succeed||t.succeed,(e.scope?W.bind(e.success,e.scope):e.success)(t))})}}class it{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,ee.extend(this,e)}destroy(){this.address=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null}}class rt{constructor(e){e.filters&&(e.filters=e.filters.split(",")),this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null,ee.extend(this,e)}destroy(){this.x=null,this.y=null,this.fromIndex=null,this.toIndex=null,this.filters=null,this.prjCoordSys=null,this.maxReturn=null,this.geoDecodingRadius=null}}class st extends tt{constructor(e,t){super(e,t),this.options=t||{},this.eventCount=0,this.CLASS_NAME="SuperMap.AddressMatchService"}destroy(){super.destroy()}code(e,t,i){t instanceof it&&this.processAsync(e,t,i)}decode(e,t,i){t instanceof rt&&this.processAsync(e,t,i)}processAsync(e,t,i){let r=++this.eventCount,s={scope:this,processCompleted:function(e){if(r===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(s),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&i)return i(e),this.events&&this.events.un(s),!1}};this.events.on(s),this.request({method:"GET",url:e,params:t,scope:this,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)}})}serviceProcessCompleted(e,t){e.succeed&&delete e.succeed,super.serviceProcessCompleted(e,t)}serviceProcessFailed(e,t){super.serviceProcessFailed(e,t)}}class nt{constructor(e){this.aggName=null,this.aggFieldName=null,this.CLASS_NAME="SuperMap.AggregationParameter",ee.extend(this,e)}destroy(){this.aggName=null,this.aggFieldName=null,this.aggType=null}}class at extends nt{constructor(e){super(),this.subAggs=null,this.aggType=null,this.CLASS_NAME="SuperMap.BucketAggParameter",ee.extend(this,e)}destroy(){this.subAggs&&(this.subAggs=null)}}class ot{constructor(e){this.dataset=null,this.targetDatasourceName=null,this.totalGridName=null,this.diffuseDatasetGridName=null,this.durationDatasetGridName=null,this.directDatasetGridName=null,this.latitude=null,this.timeMode="MULTIDAYS",this.dayStart=null,this.dayEnd=null,this.hourStart=null,this.hourEnd=null,this.transmittance=null,this.hourInterval=null,this.dayInterval=null,this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.AreaSolarRadiationParameters"}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){var i={};for(var r in e){if("dataset"!==r)"latitude"===r||"timeMode"===r||"dayStart"===r||("dayEnd"===r||"hourStart"===r||"hourEnd"===r)||("transmittance"===r||"hourInterval"===r||"dayInterval"===r)?i[r]=e[r]:t[r]=e[r]}t.parameter=i}}class lt extends tt{constructor(e,i){super(e,i),this.format=i.format||t.GEOJSON,this.CLASS_NAME="SuperMap.SpatialAnalystBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e,i){var r,s=this;if((e=ee.transformResult(e))&&s.format===t.GEOJSON&&"function"==typeof s.toGeoJSONResult)if(ee.isArray(e)){for(var n=0;n0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}class St{constructor(e){if(this.datasetName="",this.bounds="",this.distance="",this.distanceField="",this.distanceUnit=k.METER,this.dissolveField="",this.output=null,this.mappingParameters=null,!e)return this;ee.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 bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},"bounds"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class xt extends tt{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;Ue.get(je.appendCredential(e),null,{proxy:t.proxy}).then(function(e){return e.json()}).then(function(e){t.events.triggerEvent("processCompleted",{result:e})}).catch(function(e){t.eventListeners.processFailed({error:e})})}addJob(e,t,i,r){var s=this,n=null;t&&t instanceof i&&(n=new Object,i.toObject(t,n));let a=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},s.headers||{});var o={proxy:s.proxy,headers:a,withCredentials:s.withCredentials,crossOrigin:s.crossOrigin,isInTheSameDomain:s.isInTheSameDomain};Ue.post(je.appendCredential(e),JSON.stringify(n),o).then(function(e){return e.json()}).then(function(e){e.succeed?s.serviceProcessCompleted(e,r):s.serviceProcessFailed(e)}).catch(function(e){s.serviceProcessFailed({error:e})})}serviceProcessCompleted(e,t){e=ee.transformResult(e),t=t||1e3;var i=this;if(e)var r=setInterval(function(){Ue.get(je.appendCredential(e.newResourceLocation),{_t:(new Date).getTime()}).then(function(e){return e.json()}).then(function(e){i.events.triggerEvent("processRunning",{id:e.id,state:e.state}),"LOST"!==e.state.runState&&"KILLED"!==e.state.runState&&"FAILED"!==e.state.runState||(clearInterval(r),i.events.triggerEvent("processFailed",{error:e.state.errorMsg,state:e.state.runState})),"FINISHED"===e.state.runState&&e.setting.serviceInfo&&(clearInterval(r),i.events.triggerEvent("processCompleted",{result:e}))}).catch(function(e){clearInterval(r),i.events.triggerEvent("processFailed",{error:e})})},t)}serviceProcessFailed(e){super.serviceProcessFailed(e)}}class wt extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/buffers"),this.CLASS_NAME="SuperMap.BuffersAnalystJobsService"}destroy(){super.destroy()}getBuffersJobs(){super.getJobs(this.url)}getBuffersJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addBuffersJob(e,t){super.addJob(this.url,e,St,t)}}class Ct{constructor(e){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.BurstPipelineAnalystParameters"}destroy(){this.sourceNodeIDs=null,this.edgeID=null,this.nodeID=null,this.isUncertainDirectionValid=null}}class Mt extends tt{constructor(e,i){super(e,i),this.format=t.GEOJSON,this.CLASS_NAME="SuperMap.NetworkAnalystServiceBase"}destroy(){super.destroy(),this.format=null}serviceProcessCompleted(e,i){var r;(e=ee.transformResult(e))&&this.format===t.GEOJSON&&"function"==typeof this.toGeoJSONResult&&(r=this.toGeoJSONResult(e)),r||(r=e),this.events.triggerEvent("processCompleted",{result:r,options:i})}toGeoJSONResult(e){return null}}class At extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.BurstPipelineAnalystService"}destroy(){super.destroy()}processAsync(e){if(!(e instanceof Ct))return null;var t,i=this;if(i.url=ee.urlPathAppend(i.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,i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}class Tt extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.ChartFeatureInfoSpecsService"}destroy(){super.destroy(),ee.reset(this)}processAsync(){var e=this;e.isTempLayers||ee.urlPathAppend(e.url,"chartFeatureInfoSpecs"),e.request({method:"GET",params:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}class Et{constructor(e){this.isQueryPoint=null,this.isQueryLine=null,this.isQueryRegion=null,this.attributeFilter=null,this.chartFeatureInfoSpecCode=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryFilterParameter"}destroy(){var e=this;e.isQueryPoint=null,e.isQueryLine=null,e.isQueryRegion=null,e.attributeFilter=null,e.chartFeatureInfoSpecCode=null}toJson(){var e="";return e+='"isQueryPoint":'+this.isQueryPoint+",",e+='"isQueryLine":'+this.isQueryLine+",",e+='"isQueryRegion":'+this.isQueryRegion+",",this.attributeFilter&&(e+='"attributeFilter": "'+this.attributeFilter+'",'),e="{"+(e+='"chartFeatureInfoSpecCode":'+this.chartFeatureInfoSpecCode)+"}"}}class Lt{constructor(e){this.queryMode=null,this.bounds=null,this.chartLayerNames=null,this.chartQueryFilterParameters=null,this.returnContent=!0,this.startRecord=0,this.expectCount=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.ChartQueryParameters"}destroy(){var e=this;e.queryMode=null,e.bounds=null,e.chartLayerNames=null,e.chartQueryFilterParameters=null,e.returnContent=!0,e.startRecord=0,e.expectCount=null}getVariablesJson(){var e="";if(e+='"queryMode":"'+this.queryMode+'",',this.chartLayerNames&&this.chartLayerNames.length){for(var t=[],i=this.chartLayerNames.length,r=0;r0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(i+=","),i+=t[e];return i+="]"}}class Rt extends tt{constructor(e,t){(t=t||{}).EVENT_TYPES=["broadcastSocketConnected","broadcastSocketClosed","broadcastSocketError","broadcastFailed","broadcastSucceeded","subscribeSocketConnected","subscribeSocketClosed","subscribeSocketError","messageSucceeded","setFilterParamSucceeded"],super(e,t),this.geometry=null,this.prjCoordSys=null,this.excludeField=null,ee.extend(this,t),this.CLASS_NAME="SuperMap.DataFlowService"}initBroadcast(){var e=this;return this.broadcastWebSocket=this._connect(ee.urlPathAppend(e.url,"broadcast")),this.broadcastWebSocket.onopen=function(t){e.broadcastWebSocket.isOpen=!0,t.eventType="broadcastSocketConnected",e.events.triggerEvent("broadcastSocketConnected",t)},this.broadcastWebSocket.onclose=function(t){e.broadcastWebSocket&&(e.broadcastWebSocket.isOpen=!1),t.eventType="broadcastSocketClosed",e.events.triggerEvent("broadcastSocketClosed",t)},this.broadcastWebSocket.onerror=function(t){t.eventType="broadcastSocketError",e.events.triggerEvent("broadcastSocketError",t)},this}broadcast(e){this.broadcastWebSocket&&this.broadcastWebSocket.isOpen?(this.broadcastWebSocket.send(JSON.stringify(e)),this.events.triggerEvent("broadcastSucceeded")):this.events.triggerEvent("broadcastFailed")}initSubscribe(){var e=this;return this.subscribeWebSocket=this._connect(ee.urlPathAppend(e.url,"subscribe")),this.subscribeWebSocket.onopen=function(t){e.subscribeWebSocket.send(e._getFilterParams()),t.eventType="subscribeSocketConnected",e.events.triggerEvent("subscribeSocketConnected",t)},this.subscribeWebSocket.onclose=function(t){t.eventType="subscribeWebSocketClosed",e.events.triggerEvent("subscribeWebSocketClosed",t)},this.subscribeWebSocket.onerror=function(t){t.eventType="subscribeSocketError",e.events.triggerEvent("subscribeSocketError",t)},this.subscribeWebSocket.onmessage=function(t){e._onMessage(t)},this}setExcludeField(e){return this.excludeField=e,this.subscribeWebSocket.send(this._getFilterParams()),this}setGeometry(e){return this.geometry=e,this.subscribeWebSocket.send(this._getFilterParams()),this}unSubscribe(){this.subscribeWebSocket&&(this.subscribeWebSocket.close(),this.subscribeWebSocket=null)}unBroadcast(){this.broadcastWebSocket&&(this.broadcastWebSocket.close(),this.broadcastWebSocket=null)}destroy(){tt.prototype.destroy.apply(this,arguments);this.geometry=null,this.prjCoordSys=null,this.excludeField=null,this.unBroadcast(),this.unSubscribe()}_getFilterParams(){var e={filterParam:{prjCoordSys:this.prjCoordSys,excludeField:this.excludeField,geometry:this.geometry}};return ee.toJSON(e)}_onMessage(e){if(e.data&&e.data.indexOf("filterParam")>=0){var t=JSON.parse(e.data);return e.filterParam=t,e.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",e)}var i=JSON.parse(e.data);e.featureResult=i,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}_connect(e){return e=je.appendCredential(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}}class Bt{constructor(e){e=e||{},this.bounds=null,this.dataSourceName=null,this.description=null,this.encodeType=null,this.isReadOnly=null,this.name=null,this.prjCoordSys=null,this.tableName=null,this.type=null,ee.extend(this,e);var t=this.bounds;t&&(this.bounds=new se(t.leftBottom.x,t.leftBottom.y,t.rightTop.x,t.rightTop.y)),this.CLASS_NAME="SuperMap.DatasetInfo"}destroy(){ee.reset(this)}toServerJSONObject(){var e={};return(e=ee.copyAttributes(e,this)).bounds&&e.bounds.toServerJSONObject&&(e.bounds=e.bounds.toServerJSONObject()),e}}class Gt{constructor(e){this.operation=S.UNION,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.OverlayAnalystParameters"}destroy(){this.operation=null}}class Ut extends Gt{constructor(e){super(e),this.operateDataset=null,this.operateDatasetFields=[],this.operateDatasetFilter=new ft,this.operateRegions=[],this.sourceDataset=null,this.sourceDatasetFields=[],this.sourceDatasetFilter=new ft,this.tolerance=0,this.resultSetting=new pt,ee.extend(this,e),this.CLASS_NAME="SuperMap.DatasetOverlayAnalystParameters"}destroy(){super.destroy();var e=this;if(e.operateDataset=null,e.operateDatasetFields=null,e.operateDatasetFilter&&(e.operateDatasetFilter.destroy(),e.operateDatasetFilter=null),e.operateRegions){for(var t=0,i=e.operateRegions,r=i.length;t0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.facilityPathList)return e;var t=new Oe;return e.facilityPathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}class mi{constructor(e){this.expectedSupplyCenterCount=null,this.isFromCenter=!1,this.supplyCenters=null,this.turnWeightField=null,this.weightName=null,ee.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,i=e.supplyCenters,r=i.length;t0&&(t+=","),t+=ee.toJSON(e[r]);return t+="]"}toGeoJSONResult(e){if(!e)return null;var t=new Oe;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}class gi{constructor(e){this.centers=null,this.hasLeastTotalCost=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,ee.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 vi extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindMTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof gi){var t,i=this,r=i.getJson(e.isAnalyzeById,e.centers),s=i.getJson(e.isAnalyzeById,e.nodes);i.url=ee.urlPathAppend(i.url,"mtsppath"),t={centers:r,nodes:s,parameter:ee.toJSON(e.parameter),hasLeastTotalCost:e.hasLeastTotalCost},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.pathList)return null;var t=new Oe;return e.pathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}class bi{constructor(e){this.isAnalyzeById=!1,this.hasLeastEdgeCount=null,this.nodes=null,this.parameter=new Ft,ee.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 _i extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof bi){var t,i=this;i.url=ee.urlPathAppend(i.url,"path"),t={hasLeastEdgeCount:e.hasLeastEdgeCount,parameter:ee.toJSON(e.parameter),nodes:i.getJson(e.isAnalyzeById,e.nodes)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new Oe;return e.pathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}class Si{constructor(e){this.isAnalyzeById=!1,this.isCenterMutuallyExclusive=!1,this.centers=null,this.isFromCenter=!1,this.weights=null,this.parameter=new Ft,ee.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 xi extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindServiceAreasService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Si){var t,i=this;i.url=ee.urlPathAppend(i.url,"servicearea"),t={isFromCenter:e.isFromCenter,isCenterMutuallyExclusive:e.isCenterMutuallyExclusive,parameter:ee.toJSON(e.parameter),centers:i.getJson(e.isAnalyzeById,e.centers),weights:i.getJson(!0,e.weights)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJson(e,t){var i="[",r=t?t.length:0;if(!1===e)for(let e=0;e0&&(i+=","),i+='{"x":'+t[e].x+',"y":'+t[e].y+"}";else if(!0===e)for(let e=0;e0&&(i+=","),i+=t[e];return i+="]"}toGeoJSONResult(e){if(!e||!e.serviceAreaList)return e;var t=new Oe;return e.serviceAreaList.map(function(e){return e.serviceRegion&&(e.serviceRegion=t.toGeoJSON(e.serviceRegion)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e.routes&&(e.routes=t.toGeoJSON(e.routes)),e}),e}}class wi{constructor(e){this.endNodeAssigned=!1,this.isAnalyzeById=!1,this.nodes=null,this.parameter=new Ft,ee.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 Ci extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.FindTSPPathsService"}destroy(){super.destroy()}processAsync(e){if(e instanceof wi){var t,i=this;i.url=ee.urlPathAppend(i.url,"tsppath"),t={parameter:ee.toJSON(e.parameter),endNodeAssigned:e.endNodeAssigned,nodes:i.getNodesJson(e)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getNodesJson(e){var t,i,r,s,n="";if(!1===e.isAnalyzeById){for(t="[",i=0,r=(s=e.nodes).length;i0&&(t+=","),t+='{"x":'+s[i].x+',"y":'+s[i].y+"}";n+=t+="]"}else if(!0===e.isAnalyzeById){let t="[",i=e.nodes,r=i.length;for(let e=0;e0&&(t+=","),t+=i[e];n+=t+="]"}return n}toGeoJSONResult(e){if(!e||!e.tspPathList)return null;var t=new Oe;return e.tspPathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}class Mi{constructor(e){this.routeTable=null,this.routeIDField=null,this.attributeFilter=null,this.eventTable=null,this.eventRouteIDField=null,this.measureField=null,this.measureStartField=null,this.measureEndField=null,this.measureOffsetField=null,this.errorInfoField=null,this.retainedFields=null,this.dataReturnOption=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GenerateSpatialDataParameters"}destroy(){var e=this;e.routeTable&&(e.routeTable=null),e.routeIDField=null,e.attributeFilter=null,e.eventTable=null,e.eventRouteIDField=null,e.measureField=null,e.measureStartField=null,e.measureEndField=null,e.measureOffsetField=null,e.errorInfoField=null,e.dataReturnOption&&(e.dataReturnOption.destroy(),e.dataReturnOption=null)}}class Ai extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GenerateSpatialDataService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Mi){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){var t="datasets/"+e.routeTable+"/linearreferencing/generatespatialdata";return this.url=ee.urlPathAppend(this.url,t),this.url=ee.urlAppend(this.url,"returnContent=true"),ee.toJSON(e)}}class Ti extends Gt{constructor(e){super(e),e&&e.operateGeometry&&(this.operateGeometry=e.operateGeometry),e&&e.sourceGeometry&&(this.sourceGeometry=e.sourceGeometry),e&&e.operateGeometries&&(this.operateGeometries=e.operateGeometries),e&&e.sourceGeometries&&(this.sourceGeometries=e.sourceGeometries),e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GeometryOverlayAnalystParameters"}destroy(){super.destroy();var e=this;e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.sourceGeometries&&(e.sourceGeometries.destroy(),e.sourceGeometries=null),e.sourceGeometry&&(e.sourceGeometry.destroy(),e.sourceGeometry=null),e.operateGeometries&&(e.operateGeometries.destroy(),e.operateGeometries=null)}static toObject(e,t){for(var i in e)if("sourceGeometry"===i)t.sourceGeometry=Le.fromGeometry(e.sourceGeometry);else if("sourceGeometries"===i){for(var r=[],s=0;s=0;e--)this.points[e].destroy();this.points=null}}static toObject(e,t){for(var i in e)"clipRegion"===i?t.clipRegion=Le.fromGeometry(e.clipRegion):t[i]=e[i]}}class Oi extends tt{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,i,r){const s={parameter:t=t||null,environment:i=i||null};this._processAsync({url:`${this.url}/${e}/execute`,executeParamter:s,callback:r})}submitJob(e,t,i,r){t=t||null,i=i||null;const s=JSON.stringify({parameter:t,environments:i});this._processAsync({url:`${this.url}/${e}/jobs`,method:"POST",callback:r,params:s})}waitForJobCompletion(e,t,i,r){const s=this,n=setInterval(function(){s._processAsync({url:`${s.url}/${t}/jobs/${e}`,serviceProcessCompleted:function(e,t){const i=e.state.runState;switch(t.statusCallback&&t.statusCallback(i),i){case"FINISHED":clearInterval(n),s.events.triggerEvent("processCompleted",{result:e,options:t});break;case"FAILED":case"CANCELED":clearInterval(n),s.events.triggerEvent("processFailed",{result:e,options:t})}},callback:r})},i.interval)}getJobInfo(e,t,i){this._processAsync({url:`${this.url}/${e}/jobs/${t}`,callback:i})}cancelJob(e,t,i){this._processAsync({url:`${this.url}/${e}/jobs/${t}/cancel`,callback:i})}getJobs(e,t){let i=`${this.url}/jobs`;e&&(i=`${this.url}/${e}/jobs`),this._processAsync({url:i,callback:t})}getResults(e,t,i,r){let s=`${this.url}/${e}/jobs/${t}/results`;i&&(s=`${s}/${i}`),this._processAsync({url:s,callback:r})}_processAsync({url:e,method:t,callback:i,paramter:r,serviceProcessCompleted:s,serviceProcessFailed:n}){let a=++this.eventCount,o={scope:this,processCompleted:function(e){if(a===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(o),!1},processFailed:function(e){if((a===e.error.eventId||a===e.eventId)&&i)return i(e),this.events&&this.events.un(o),!1}};this.events.on(o),this.request({url:e,method:t||"GET",params:r,headers:{"Content-type":"application/json"},scope:this,success(e,t){e.eventId=a,(s||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 Pi{constructor(e){this.dataset=null,this.sourceFilter=null,this.referenceFilter=null,this.spatialRelationType=null,this.isBorderInside=null,this.returnFeature=null,this.returnGeoRelatedOnly=null,this.startRecord=0,this.expectCount=500,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.GeoRelationAnalystParameters"}destroy(){var e=this;e.sourceFilter&&e.sourceFilter.destroy(),e.sourceFilter=null,e.referenceFilter&&e.referenceFilter.destroy(),e.referenceFilter=null,e.dataset=null,e.spatialRelationType=null,e.isBorderInside=null,e.returnFeature=null,e.returnGeoRelatedOnly=null,e.startRecord=null,e.expectCount=null}}class Ni extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GeoRelationAnalystService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Pi){var t=this;t.url=ee.urlPathAppend(t.url,"datasets/"+e.dataset+"/georelation");var i=ee.toJSON(e);t.url=ee.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:i,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class Ii extends tt{constructor(e,t){super(e,t),t&&(this.datasource=null,this.dataset=null,this.eventCount=0,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.DatasetService")}destroy(){super.destroy();this.datasource=null,this.dataset=null}getDatasetsService(e,t){const i=ee.urlPathAppend(this.url,`datasources/name/${e}/datasets`);this.processAsync(i,"GET",t)}getDatasetService(e,t,i){const r=ee.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(r,"GET",i)}setDatasetService(e,t){if(!e)return;const i=ee.urlPathAppend(this.url,`datasources/name/${e.datasourceName}/datasets/name/${e.datasetName}`);delete e.datasourceName,this.processAsync(i,"PUT",t,e)}deleteDatasetService(e,t,i){const r=ee.urlPathAppend(this.url,`datasources/name/${e}/datasets/name/${t}`);this.processAsync(r,"DELETE",i)}processAsync(e,t,i,r){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(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=s,a.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,a.serviceProcessFailed(e,t)}};r&&(o.data=ee.toJSON(r)),a.request(o)}}class Fi{constructor(e){this.datasetNames=null,this.targetEpsgCode=null,this.targetPrj=null,this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.returnCountOnly=!1,this.maxFeatures=null,this.hasGeometry=!0,this.aggregations=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesParametersBase"}destroy(){var e=this;e.datasetNames=null,e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.hasGeometry=null,e.maxFeatures=null,e.targetEpsgCode=null,e.targetPrj=null,e.aggregation&&(e.aggregation=null)}}class ki extends Fi{constructor(e){super(e),this.getFeatureMode=ki.getFeatureMode.BOUNDS,this.bounds=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,ee.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,i,r;return i={leftBottom:{x:e.bounds.left,y:e.bounds.bottom},rightTop:{x:e.bounds.right,y:e.bounds.top}},r={datasetNames:e.datasetNames,getFeatureMode:ki.getFeatureMode.BOUNDS,bounds:i,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new ft).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode=ki.getFeatureMode.BOUNDS_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),e.aggregations&&(r.aggregations=e.aggregations),ee.toJSON(r)}}ki.getFeatureMode={BOUNDS:"BOUNDS",BOUNDS_ATTRIBUTEFILTER:"BOUNDS_ATTRIBUTEFILTER"};class Di extends tt{constructor(e,i){super(e,i),i=i||{},this.returnContent=!0,this.fromIndex=0,this.toIndex=19,this.hasGeometry=!0,this.maxFeatures=null,this.format=t.GEOJSON,ee.extend(this,i),this.url=ee.urlPathAppend(this.url,"featureResults"),this.CLASS_NAME="SuperMap.GetFeaturesServiceBase"}destroy(){super.destroy();var e=this;e.returnContent=null,e.fromIndex=null,e.toIndex=null,e.maxFeatures=null,e.format=null,e.hasGeometry=null}processAsync(e){if(e){var t,i=this,r=!0;i.returnContent=e.returnContent,i.fromIndex=e.fromIndex,i.toIndex=e.toIndex,i.maxFeatures=e.maxFeatures,i.hasGeometry=e.hasGeometry,i.returnContent&&(r=!1),null!=i.fromIndex&&null!=i.toIndex&&!isNaN(i.fromIndex)&&!isNaN(i.toIndex)&&i.fromIndex>=0&&i.toIndex>=0&&!r&&(i.url=ee.urlAppend(i.url,`fromIndex=${i.fromIndex}&toIndex=${i.toIndex}`)),e.returnCountOnly&&(i.url=ee.urlAppend(i.url,"&returnCountOnly="+e.returnContent)),t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}serviceProcessCompleted(e,i){if(e=ee.transformResult(e),this.format===t.GEOJSON&&e.features){var r=new Oe;e.features=r.toGeoJSON(e.features)}this.events.triggerEvent("processCompleted",{result:e,options:i})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ri extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){return ki.toJsonParameters(e)}}class Bi extends Fi{constructor(e){super(e),this.bufferDistance=null,this.attributeFilter=null,this.geometry=null,this.fields=null,ee.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,i,r;return r=Le.fromGeometry(e.geometry),i={datasetNames:e.datasetNames,getFeatureMode:"BUFFER",bufferDistance:e.bufferDistance,geometry:r},e.fields&&((t=new ft).name=e.datasetNames,t.fields=e.fields,i.queryParameter=t),e.attributeFilter&&(i.attributeFilter=e.attributeFilter,i.getFeatureMode="BUFFER_ATTRIBUTEFILTER"),e.maxFeatures&&!isNaN(e.maxFeatures)&&(i.maxFeatures=e.maxFeatures),"boolean"==typeof e.hasGeometry&&(i.hasGeometry=e.hasGeometry),e.targetEpsgCode&&(i.targetEpsgCode=e.targetEpsgCode),!e.targetEpsgCode&&e.targetPrj&&(i.targetPrj=e.targetPrj),ee.toJSON(i)}}class Gi extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByBufferService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Bi)return Bi.toJsonParameters(e)}}class Ui extends Fi{constructor(e){super(e),this.getFeatureMode="SPATIAL",this.geometry=null,this.fields=null,this.attributeFilter=null,this.spatialQueryMode=a.CONTAIN,ee.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,i,r;return i=Le.fromGeometry(e.geometry),r={datasetNames:e.datasetNames,getFeatureMode:"SPATIAL",geometry:i,spatialQueryMode:e.spatialQueryMode},e.fields&&((t=new ft).name=e.datasetNames,t.fields=e.fields,r.queryParameter=t),e.attributeFilter&&(r.attributeFilter=e.attributeFilter,r.getFeatureMode="SPATIAL_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),e.aggregations&&(r.aggregations=e.aggregations),ee.toJSON(r)}}class ji extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){return Ui.toJsonParameters(e)}}class zi extends Fi{constructor(e){super(e),this.getFeatureMode="ID",this.IDs=null,this.fields=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetFeaturesByIDsParameters"}destroy(){super.destroy();var e=this;if(e.IDs=null,e.getFeatureMode=null,e.fields){for(;e.fields.length>0;)e.fields.pop();e.fields=null}}static toJsonParameters(e){var t,i;return t={datasetNames:e.datasetNames,getFeatureMode:"ID",ids:e.IDs},e.fields&&((i=new ft).name=e.datasetNames,i.fields=e.fields,t.queryParameter=i),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),ee.toJSON(t)}}class Vi extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesByIDsService"}destroy(){super.destroy()}getJsonParameters(e){return zi.toJsonParameters(e)}}class Ji extends Fi{constructor(e){super(e),this.getFeatureMode="SQL",this.queryParameter=null,ee.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),ee.toJSON(t)}}class qi extends Di{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.GetFeaturesBySQLService"}destroy(){super.destroy()}getJsonParameters(e){return Ji.toJsonParameters(e)}}class Hi extends tt{constructor(e,t){super(e,t),this.datasource=null,this.dataset=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.GetFieldsService"}destroy(){super.destroy();this.datasource=null,this.dataset=null}processAsync(){var e=this;e.url=ee.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 Wi{constructor(e){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.GetGridCellInfosParameters"}destroy(){this.datasetName=null,this.dataSourceName=null,this.X=null,this.Y=null}}class Yi extends tt{constructor(e,t){super(e,t),this.datasetName=null,this.dataSourceName=null,this.datasetType=null,this.X=null,this.Y=null,t&&ee.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 Wi){ee.extend(this,e);var i=this;i.url=ee.urlPathAppend(i.url,`datasources/${i.dataSourceName}/datasets/${i.datasetName}`),i.queryRequest(i.getDatasetInfoCompleted.bind(i),i.getDatasetInfoFailed.bind(i),t)}}queryRequest(e,t,i){let r=++this.eventCount,s={scope:this,processCompleted:function(e){if(r===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(s),!1},processFailed:function(e){if((r===e.error.eventId||r===e.eventId)&&i)return i(e),this.events&&this.events.un(s),!1}};this.events.on(s);this.request({method:"GET",data:null,scope:this,success(t,s){t.eventId=r,e(t,s,i)},failure(e,i){e.error&&(e.error.eventId=r),e.eventId=r,t(e,i)}})}getDatasetInfoCompleted(e,t,i){e=ee.transformResult(e),this.datasetType=e.datasetInfo.type,this.queryGridInfos(i)}queryGridInfos(e){var t=this;t.url=ee.urlPathAppend(t.url,"GRID"==t.datasetType?"gridValue":"imageValue"),null!=t.X&&null!=t.Y&&(t.url=ee.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 Xi{constructor(e,t){if(!e)return this;this.memoryData=null,this.type=e,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.Theme"}destroy(){this.memoryData&&(this.memoryData.destroy(),this.memoryData=null),this.type=null}toServerJSONObject(){}}class Qi{constructor(e){this.align=y.BASELINECENTER,this.backColor=new Me(255,255,255),this.foreColor=new Me(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&&ee.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 Qi(e);return ee.copy(t,e),t.backColor=Me.fromJson(e.backColor),t.foreColor=Me.fromJson(e.foreColor),t}}class Zi{constructor(e){this.caption=null,this.end=0,this.start=0,this.visible=!0,this.style=new Qi,e&&ee.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 Zi;return ee.copy(t,e),t}}}class Ki{constructor(e){this.caption=null,this.style=new Ae,this.unique=null,this.visible=!0,e&&ee.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=ee.copyAttributes(e,this)).style&&e.style.toServerJSONObject&&(e.style=e.style.toServerJSONObject()),e}static fromObj(e){var t=new Ki;return ee.copy(t,e),t.style=Ae.fromJson(e.style),t}}class $i{constructor(e){this.offsetFixed=!1,this.offsetX="0.0",this.offsetY="0.0",e&&ee.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 $i;return ee.copy(t,e),t}}}class er{constructor(e){this.defaultStyle=null,this.separator=null,this.separatorEnabled=!1,this.splitIndexes=null,this.styles=new Qi,e&&ee.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,i=e.styles,r=i.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=ee.copyAttributes(e,this)).defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],i=e.items.length,r=0;r0)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 mr;ee.copy(t,e);var i=e.items,r=i?i.length:0;t.items=[];for(var s=0;s0?e[0].subLayers.layers:null)?i.length:0,this.handleLayers(r,i),this.events.triggerEvent("processCompleted",{result:e[0],options:t})}handleLayers(e,t){var i;if(e)for(var r=0;r0)this.handleLayers(t[r].subLayers.layers.length,t[r].subLayers.layers);else switch(t[r].ugcLayerType){case"THEME":(i=new _r).fromJson(t[r]),t[r]=i;break;case"GRID":(i=new Sr).fromJson(t[r]),t[r]=i;break;case"IMAGE":(i=new xr).fromJson(t[r]),t[r]=i;break;case"VECTOR":(i=new wr).fromJson(t[r]),t[r]=i}}}}class Mr{constructor(e){e&&(this.bounds=null,this.searchRadius=0,this.zValueFieldName=null,this.zValueScale=1,this.resolution=null,this.filterQueryParameter=null,this.outputDatasetName=null,this.outputDatasourceName=null,this.pixelFormat=null,this.dataset=null,this.inputPoints=null,this.InterpolationAnalystType="dataset",this.clipParam=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.InterpolationAnalystParameters")}destroy(){var e=this;e.bounds=null,e.searchRadius=null,e.zValueFieldName=null,e.zValueScale=null,e.resolution=null,e.filterQueryParameter=null,e.outputDatasetName=null,e.pixelFormat=null}static toObject(e,t){for(var i in e)if("inputPoints"===i&&"geometry"===e.InterpolationAnalystType){for(var r=[],s=0;s=200&&e.code<300||0==e.code||304===e.code,r=e.code&&i;!e.code||r?this.events&&this.events.triggerEvent("processCompleted",{result:e,options:t}):this.events.triggerEvent("processFailed",{error:e,options:t})}}class kr{constructor(e){e&&(this.dataset=null,this.extractRegion=null,this.expression=null,this.isZip=!1,this.ignoreNoValue=!1,this.targetDatasource=null,this.resultGridName=null,this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.MathExpressionAnalysisParameters")}destroy(){var e=this;e.dataset=null,e.bounds=null,e.expression=null,e.isZip=!0,e.ignoreNoValue=!0,e.targetDatasource=null,e.resultGridName=null,e.deleteExistResultDataset=null}static toObject(e,t){for(var i in e)if("dataset"!==i&&(t[i]=e[i]),"extractRegion"===i&&e[i]){for(var r=e[i].components[0].components,s={},n=[],a=r.length,o=0;o(e.fieldNames=n[s].fieldCaptions,e)),this.format===t.GEOJSON&&(n[s].features=r.toGeoJSON(n[s].features)));this.events.triggerEvent("processCompleted",{result:e,options:i})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}getQueryParameters(e){return new Ot({customParams:e.customParams,expectCount:e.expectCount,networkType:e.networkType,queryOption:e.queryOption,queryParams:e.queryParams,startRecord:e.startRecord,prjCoordSys:e.prjCoordSys,holdTime:e.holdTime})}}class Jr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByBoundsService"}destroy(){super.destroy()}getJsonParameters(e){if(!(e instanceof zr))return null;var t,i="",r=e.bounds;return t=this.getQueryParameters(e),i+="'queryMode':'BoundsQuery','queryParameters':",i+=ee.toJSON(t),i="{"+(i+=",'bounds': {'rightTop':{'y':"+r.top+",'x':"+r.right+"},'leftBottom':{'y':"+r.bottom+",'x':"+r.left+"}}")+"}"}}class qr extends Ot{constructor(e){super(e=e||{}),this.geometry=null,this.isNearest=null,this.returnContent=!0,ee.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 Hr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByDistanceService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof qr){var t="",i=this.getQueryParameters(e),r=Le.fromGeometry(e.geometry);return t+=e.isNearest?"'queryMode':'FindNearest','queryParameters':":"'queryMode':'DistanceQuery','queryParameters':",t+=ee.toJSON(i),t="{"+(t+=",'geometry':"+ee.toJSON(r)+",'distance':"+e.distance)+"}"}}}class Wr extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,this.geometry=null,this.spatialQueryMode=a.INTERSECT,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryByGeometryParameters"}destroy(){super.destroy();this.returnContent=null,this.geometry=null,this.spatialQueryMode=null}}class Yr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryByGeometryService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Wr){var t,i="",r=e.geometry,s=Le.fromGeometry(r);return t=this.getQueryParameters(e),i+="'queryMode':'SpatialQuery','queryParameters':",i="{"+(i+=ee.toJSON(t)+",'geometry':"+ee.toJSON(s)+",'spatialQueryMode':"+ee.toJSON(e.spatialQueryMode))+"}"}}}class Xr extends Ot{constructor(e){super(e=e||{}),this.returnContent=!0,ee.extend(this,e),this.CLASS_NAME="SuperMap.QueryBySQLParameters"}destroy(){super.destroy();this.returnContent=null}}class Qr extends Vr{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.QueryBySQLService"}destroy(){super.destroy()}getJsonParameters(e){if(e instanceof Xr){var t,i="";return t=this.getQueryParameters(e),i+="'queryMode':'SqlQuery','queryParameters':",i="{"+(i+=ee.toJSON(t))+"}"}}}class Zr{constructor(e,t){this.options=t||{},this.url=e}queryByBounds(e,t,i){var r=this;new Jr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:r._processFormat(i)}).processAsync(e)}queryByDistance(e,t,i){var r=this;new Hr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:i}).processAsync(e)}queryBySQL(e,t,i){var r=this;new Qr(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},format:i}).processAsync(e)}queryByGeometry(e,t,i){var r=this;new Yr(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},format:i}).processAsync(e)}_processFormat(e){return e||t.GEOJSON}}class Kr{constructor(e){if(!e)return this;this.sourceRoute=null,this.point=null,this.tolerance=null,this.isIgnoreGap=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.RouteCalculateMeasureParameters"}destroy(){var e=this;e.sourceRoute=null,e.point=null,e.tolerance&&(e.tolerance=null),e.isIgnoreGap&&(e.isIgnoreGap=!1)}}class $r extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.RouteCalculateMeasureService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Kr){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){return this.url=ee.urlPathAppend(this.url,"geometry/calculatemeasure"),this.url=ee.urlAppend(this.url,"returnContent=true"),ee.toJSON(e)}}class es{constructor(e){if(!e)return this;this.sourceRoute=null,this.dataset=null,this.routeIDField=null,this.routeID=null,this.type=null,this.measure=null,this.offset=0,this.isIgnoreGap=!1,this.startMeasure=null,this.endMeasure=null;var t=e.sourceRoute,i={};if(t&&t instanceof X&&t.components){i.type=t.type,i.parts=t.parts;for(var r=[],s=0,n=t.components.length;s0&&(i+='"subLayers":'+e.toJSON()),i+=',"visible":true,',i+='"name":"'+this.getMapName(this.mapUrl)+'"',i+="}]",t.request({method:"PUT",data:i,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}createTempLayerComplete(e){(e=ee.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 i=t.lastIndexOf("/");return t.substring(i+1,t.length)}serviceProcessCompleted(e,t){null!=(e=ee.transformResult(e))&&null!=this.lastparams&&(e.newResourceID=this.lastparams.resourceID),this.events.triggerEvent("processCompleted",{result:e,options:t})}}class ls{constructor(e){e&&(this.datasetName="",this.datasetQuery="",this.geometryQuery="",this.mode=a.CONTAIN,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsParameter")}destroy(){this.datasetName=null,this.datasetQuery=null,this.geometryQuery=null,this.mode=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class hs extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/query"),this.CLASS_NAME="SuperMap.SingleObjectQueryJobsService"}destroy(){super.destroy()}getQueryJobs(){super.getJobs(this.url)}getQueryJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addQueryJob(e,t){super.addJob(this.url,e,ls,t)}}class us{constructor(e){e=e||{},this.keyWord=null,this.returnPosition=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.StopQueryParameters"}destroy(){ee.reset(this)}}class cs extends tt{constructor(e,t){super(e,t),t=t||{},ee.extend(this,t),this.CLASS_NAME="SuperMap.StopQueryService"}destroy(){super.destroy(),ee.reset(this)}processAsync(e){if(e instanceof us){var t=this;t.url=ee.urlPathAppend(t.url,"stops/keyword/"+e.keyWord),t.request({method:"GET",params:{returnPosition:e.returnPosition},scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}}class ds{constructor(e){e&&(this.datasetName="",this.groupField="",this.attributeField="",this.statisticModes="",this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SummaryAttributesJobsParameter")}destroy(){this.datasetName=null,this.groupField=null,this.attributeField=null,this.statisticModes=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class ps extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/summaryattributes"),this.CLASS_NAME="SuperMap.SummaryAttributesJobsService"}destroy(){super.destroy()}getSummaryAttributesJobs(){super.getJobs(this.url)}getSummaryAttributesJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addSummaryAttributesJob(e,t){super.addJob(this.url,e,ds,t)}}class fs{constructor(e){e&&(this.datasetName="",this.regionDataset="",this.query="",this.resolution=100,this.meshType=0,this.statisticModes=D.AVERAGE,this.fields="",this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,ee.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 bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"type"!==i?"output"!==i?("SUMMARYMESH"===e.type&&"regionDataset"!==i||"SUMMARYREGION"===e.type&&!r(["meshType","resolution","query"],i))&&(t.analyst=t.analyst||{},"query"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):t.type=e[i]:(t.input=t.input||{},t.input[i]=e[i]);function r(e,t){for(var i=e.length;i--;)if(e[i]===t)return!0;return!1}}}class ms extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/aggregatepoints"),this.CLASS_NAME="SuperMap.SummaryMeshJobsService"}destroy(){super.destroy()}getSummaryMeshJobs(){super.getJobs(this.url)}getSummaryMeshJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addSummaryMeshJob(e,t){super.addJob(this.url,e,fs,t)}}class ys{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=k.METER,this.type=R.SUMMARYMESH,this.output=null,this.mappingParameters=null,ee.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 bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"type"!==i&&"type"!==i?"output"!==i?("SUMMARYREGION"===e.type||"SUMMARYMESH"===e.type&&"regionDataset"!==i)&&(t.analyst=t.analyst||{},"query"===i&&e[i]?t.analyst[i]=e[i].toBBOX():t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):t.type=e[i]:(t.input=t.input||{},t.input[i]=e[i])}}class gs extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/summaryregion"),this.CLASS_NAME="SuperMap.SummaryRegionJobsService"}destroy(){super.destroy()}getSummaryRegionJobs(){super.getJobs(this.url)}getSummaryRegionJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addSummaryRegionJob(e,t){super.addJob(this.url,e,ys,t)}}class vs{constructor(e){this.maxWeight=null,this.nodeID=null,this.resourceValue=null,this.type=null,e&&ee.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 vs({maxWeight:e.maxWeight,nodeID:e.nodeID,resourceValue:e.resourceValue,type:e.type})}}class bs extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.SurfaceAnalystService"}destroy(){super.destroy()}processAsync(e){if(e instanceof zt){var t,i=this;t=i.getJsonParameters(e),i.request({method:"POST",data:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}getJsonParameters(e){var t="",i={};if(e instanceof Vt)this.url=ee.urlPathAppend(this.url,"datasets/"+e.dataset+"/"+e.surfaceAnalystMethod.toLowerCase()),Vt.toObject(e,i),t=ee.toJSON(i);else{if(!(e instanceof Ei))return;this.url=ee.urlPathAppend(this.url,"geometry/"+e.surfaceAnalystMethod.toLowerCase()),t=ee.toJSON(e)}return this.returnContent=!0,t}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class _s{constructor(e){e&&(this.dataset=null,this.zFactor=1,this.averageCurvatureName=null,this.profileCurvatureName="",this.planCurvatureName="",this.deleteExistResultDataset=!1,ee.extend(this,e),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationParameters")}destroy(){var e=this;e.dataset=null,e.zFactor=1,e.averageCurvatureName=null,e.profileCurvatureName=null,e.planCurvatureName=null,e.deleteExistResultDataset=!0}static toObject(e,t){for(var i in e)"dataset"!==i&&(t[i]=e[i])}}class Ss extends lt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TerrainCurvatureCalculationService"}destroy(){super.destroy()}processAsync(e){var t=this,i={};e instanceof _s&&(t.url=ee.urlPathAppend(t.url,"datasets/"+e.dataset+"/terraincalculation/curvature")),_s.toObject(e,i);var r=ee.toJSON(i);t.url=ee.urlAppend(t.url,"returnContent=true"),t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}class xs{constructor(e){this.flowEnabled=!1,this.leaderLineDisplayed=!1,this.leaderLineStyle=new Ae,e&&ee.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 xs;return ee.copy(t,e),t.leaderLineStyle=Ae.fromJson(e.leaderLineStyle),t}}}class ws{constructor(e){this.caption=null,this.color=new Me,this.end=0,this.start=0,this.visible=!0,e&&ee.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=ee.copyAttributes(e,this)).color&&e.color.toServerJSONObject&&(e.color=e.color.toServerJSONObject()),e}static fromObj(e){if(e){var t=new ws;return ee.copy(t,e),t.color=Me.fromJson(e.color),t}}}class Cs extends Xi{constructor(e){super("GRIDRANGE",e),this.items=null,this.rangeMode=f.EQUALINTERVAL,this.rangeParameter=0,this.colorGradientType=m.YELLOW_RED,this.reverseColor=!1,e&&ee.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 Cs;ee.copy(t,e);var i=e.items,r=i?i.length:0;t.items=[];for(var s=0;s0)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=ee.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],i=e.items.length,r=0;r0&&(1===s.length?i+="'displayFilter':\""+s[0]+'",':i+="'displayFilter':\""+s[a]+'",'),(n=e.displayOrderBy)&&n.length>0&&(1===n.length?i+="'displayOrderBy':'"+n[0]+"',":i+="'displayOrderBy':'"+n[a]+"',"),(t=e.fieldValuesDisplayFilter)&&(i+="'fieldValuesDisplayFilter':"+ee.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[a]&&(i+="'joinItems':["+ee.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;i+="'datasetInfo': {'name': '"+e.datasetNames[l]+"','dataSourceName': '"+e.dataSourceNames[h]+"'}},"}else i+="},"}e.themes&&e.themes.length>0&&(i=i.substring(0,i.length-1)),i+="]},";var u=this.url.split("/");return i+="'name': '"+u[u.length-2]+"'}]"}}class Os extends lt{constructor(e,t){super(e,t),this.mode=null,t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.ThiessenAnalystService"}destroy(){super.destroy(),this.mode=null}processAsync(e){var t={},i=this;e instanceof qt?(i.mode="datasets",i.url=ee.urlPathAppend(i.url,"datasets/"+e.dataset+"/thiessenpolygon"),qt.toObject(e,t)):e instanceof Li&&(i.mode="geometry",i.url=ee.urlPathAppend(i.url,"geometry/thiessenpolygon"),Li.toObject(e,t));var r=ee.toJSON(t);this.returnContent=!0,i.request({method:"POST",data:r,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}dataFormat(){return[t.GEOJSON,t.ISERVER,t.FGB]}}class Ps extends lt{constructor(e,t){super(e,t),t&&ee.extend(this,t),this.CLASS_NAME="SuperMap.GeometryBatchAnalystService"}processAsync(e){var t=this;t.url=ee.urlPathAppend(t.url,"geometry/batchanalyst"),t.url=ee.urlAppend(t.url,"returnContent=true&ignoreAnalystParam=true");var i=t._processParams(e),r=ee.toJSON(i);t.request({method:"POST",data:r,scope:t,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}_processParams(e){var t=this;if(ee.isArray(e)){var i=[];return e.map(function(e){return i.push(t._toJSON(e)),e}),i}}_toJSON(e){var t={};if("buffer"===e.analystName)t.analystName="buffer",t.param={},yt.toObject(e.param,t.param);else if("overlay"===e.analystName)t.analystName="overlay",t.param={},Ti.toObject(e.param,t.param);else if("interpolationDensity"===e.analystName)t.analystName="interpolationDensity",t.param={},Mr.toObject(e.param,t.param);else if("interpolationidw"===e.analystName)t.analystName="interpolationidw",t.param={},Mr.toObject(e.param,t.param);else if("interpolationRBF"===e.analystName)t.analystName="interpolationRBF",t.param={},Mr.toObject(e.param,t.param);else if("interpolationKriging"===e.analystName)t.analystName="interpolationKriging",t.param={},Mr.toObject(e.param,t.param);else{if("thiessenpolygon"!==e.analystName)return e;t.analystName="thiessenpolygon",t.param={},Li.toObject(e.param,t.param)}return t}destroy(){super.destroy()}}class Ns extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TilesetsService"}destroy(){super.destroy()}processAsync(){if(this.url){var e=this;e.url=ee.urlPathAppend(e.url,"tilesets"),e.request({method:"GET",scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}}class Is{constructor(e){e&&(this.datasetName="",this.datasetTopology="",this.tolerance="",this.rule=B.REGIONNOOVERLAP,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TopologyValidatorJobsParameter")}destroy(){this.datasetName=null,this.datasetTopology=null,this.tolerance=null,this.rule=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class Fs extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/topologyvalidator"),this.CLASS_NAME="SuperMap.TopologyValidatorJobsService"}destroy(){super.destroy()}getTopologyValidatorJobs(){super.getJobs(this.url)}getTopologyValidatorJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addTopologyValidatorJob(e,t){super.addJob(this.url,e,Is,t)}}class ks{constructor(e){e=e||{},this.lineID=null,this.lineName=null,this.lineAliasName=null,this.startStopIndex=null,this.startStopName=null,this.startStopAliasName=null,this.endStopIndex=null,this.endStopName=null,this.endStopAliasName=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransferLine"}destroy(){ee.reset(this)}static fromJson(e){if(e)return new ks({lineID:e.lineID,lineName:e.lineName,lineAliasName:e.lineAliasName,startStopIndex:e.startStopIndex,startStopName:e.startStopName,startStopAliasName:e.startStopAliasName,endStopIndex:e.endStopIndex,endStopName:e.endStopName,endStopAliasName:e.endStopAliasName})}}class Ds{constructor(e){e=e||{},this.transferLines=null,this.points=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransferPathParameters"}destroy(){ee.reset(this)}static toJson(e){if(e)return ee.toJSON(e)}}class Rs extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferPathService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Ds){var t,i=this;i.url=ee.urlPathAppend(i.url,"path"),t={points:ee.toJSON(e.points),transferLines:ee.toJSON(e.transferLines)},i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class Bs{constructor(e){e=e||{},this.solutionCount=6,this.transferPreference=E.NONE,this.transferTactic=T.LESS_TIME,this.walkingRatio=null,this.points=!1,this.evadeLines=null,this.evadeStops=null,this.priorLines=null,this.priorStops=null,this.travelTime=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.TransferSolutionParameters"}destroy(){ee.reset(this)}static toJson(e){if(e)return ee.toJSON(e)}}class Gs extends tt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.TransferSolutionService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Bs){var t,i=this;i.url=ee.urlPathAppend(i.url,"solutions"),t={points:ee.toJSON(e.points),walkingRatio:e.walkingRatio,transferTactic:e.transferTactic,solutionCount:e.solutionCount,transferPreference:e.transferPreference},e.evadeLines&&(t.evadeLines=ee.toJSON(e.evadeLines)),e.evadeStops&&(t.evadeStops=ee.toJSON(e.evadeStops)),e.priorLines&&(t.priorLines=ee.toJSON(e.priorLines)),e.priorStops&&(t.priorStops=ee.toJSON(e.priorStops)),e.travelTime&&(t.travelTime=e.travelTime),i.request({method:"GET",params:t,scope:i,success:i.serviceProcessCompleted,failure:i.serviceProcessFailed})}}}class Us{constructor(e){e&&(this.edgeId="",this.fromNodeId="",this.toNodeId="",this.weightField="",this.edgeWeight="",ee.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 js{constructor(e){e&&(this.datasourceName=null,this.datasetName=null,this.datasetType=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.CreateDatasetParameters")}destroy(){this.datasourceName=null,this.datasetName=null,this.datasetType=null}}class zs extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateEdgeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Us){var t=this,i=t.parse(e);t.url=ee.urlPathAppend(t.url,i);var r=e.edgeWeight?e.edgeWeight:null;t.request({method:"PUT",scope:t,data:r,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}parse(e){if(e){var t="";for(var i in e)if(""!==e[i]&&"edgeWeight"!==e[i])switch(i){case"edgeId":t+="/edgeweight/"+e[i];break;case"fromNodeId":t+="/fromnode/"+e[i];break;case"toNodeId":t+="/tonode/"+e[i];break;case"weightField":t+="/weightfield/"+e[i]}return t}}}class Vs{constructor(e){e&&(this.nodeId="",this.fromEdgeId="",this.toEdgeId="",this.weightField="",this.turnNodeWeight="",ee.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 Js extends Mt{constructor(e,t){super(e,t),this.CLASS_NAME="SuperMap.UpdateTurnNodeWeightService"}destroy(){super.destroy()}processAsync(e){if(e instanceof Vs){var t=this,i=t.parse(e);t.url=ee.urlPathAppend(t.url,i);var r=e.turnNodeWeight?e.turnNodeWeight:null;t.request({method:"PUT",scope:t,data:r,success:t.serviceProcessCompleted,failure:t.serviceProcessFailed})}}parse(e){if(e){var t="";for(var i in e)if(""!==e[i]&&"turnNodeWeight"!==e[i])switch(i){case"nodeId":t+="/turnnodeweight/"+e[i];break;case"fromEdgeId":t+="/fromedge/"+e[i];break;case"toEdgeId":t+="/toedge/"+e[i];break;case"weightField":t+="/weightfield/"+e[i]}return t}}}class qs{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&&ee.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 Hs{constructor(e){e=e||{},this.datasetName="",this.datasetVectorClip="",this.geometryClip="",this.mode=I.CLIP,this.output=null,this.mappingParameters=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.VectorClipJobsParameter"}destroy(){this.datasetName=null,this.datasetVectorClip=null,this.geometryClip=null,this.mode=null,this.output instanceof bt&&(this.output.destroy(),this.output=null),this.mappingParameters instanceof _t&&(this.mappingParameters.destroy(),this.mappingParameters=null)}static toObject(e,t){for(var i in e)"datasetName"!==i?"output"!==i?(t.analyst=t.analyst||{},t.analyst[i]=e[i],"mappingParameters"===i&&(t.analyst[i]=t.analyst[i]||{},t.analyst.mappingParameters=e[i])):(t.output=t.output||{},t.output=e[i]):(t.input=t.input||{},t.input[i]=e[i])}}class Ws extends xt{constructor(e,t){super(e,t),this.url=ee.urlPathAppend(this.url,"spatialanalyst/vectorclip"),this.CLASS_NAME="SuperMap.VectorClipJobsService"}destroy(){super.destroy()}getVectorClipJobs(){super.getJobs(this.url)}getVectorClipJob(e){super.getJobs(ee.urlPathAppend(this.url,e))}addVectorClipJob(e,t){super.addJob(this.url,e,Hs,t)}}class Ys{constructor(e){e=e||{},this.type=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.RasterFunctionParameter"}destroy(){this.type=null}}class Xs{constructor(e){this.name=null,this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobCustomItems",ee.extend(this,e)}destroy(){this.name=null,this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={name:this.name};return this.title&&(e.title=this.title),this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),ee.toJSON(e)}}class Qs{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobImage",ee.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl&&(e.picAsUrl=this.picAsUrl),this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),ee.toJSON(e)}}class Zs{constructor(e){this.name=null,this.layerType=null,this.url=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayers",ee.extend(this,e)}destroy(){this.name=null,this.layerType=null,this.url=null}}class Ks{constructor(e){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers=null,this.customItems=null,this.CLASS_NAME="SuperMap.WebPrintingJobLegendOptions",ee.extend(this,e)}destroy(){this.title=null,this.picAsUrl=null,this.picAsBase64=null,this.layers instanceof Zs&&(this.layers.destroy(),this.layers=null),this.customItems instanceof Xs&&(this.customItems.destroy(),this.customItems=null)}toJSON(){var e={title:this.title||""};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64?e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,""):this.customItems&&(e.customItems=this.customItems),ee.toJSON(e)}}class $s{constructor(e){this.center=null,this.scale=null,this.layerNames=null,this.image=null,this.layers=null,this.CLASS_NAME="SuperMap.WebPrintingJobLittleMapOptions",ee.extend(this,e)}destroy(){this.center=null,this.scale=null,this.layerNames=null,this.image instanceof Qs&&(this.image.destroy(),this.image=null),this.layers instanceof Zs&&(this.layers.destroy(),this.layers=null)}toJSON(){var e={scale:this.scale,center:this.center};return this.layerNames?e.layerNames=this.layerNames:this.layers&&(e.layers=this.layers),this.image&&(e.image=this.image),ee.toJSON(e)}}class en{constructor(e){this.picAsUrl=null,this.picAsBase64=null,this.CLASS_NAME="SuperMap.WebPrintingJobNorthArrowOptions",ee.extend(this,e)}destroy(){this.picAsUrl=null,this.picAsBase64=null}toJSON(){var e={};return this.picAsUrl?e.picAsUrl=this.picAsUrl:this.picAsBase64&&(e.picAsBase64=this.picAsBase64.replace(/^data:.+;base64,/,"")),ee.toJSON(e)}}class tn{constructor(e){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null,this.CLASS_NAME="SuperMap.WebPrintingJobScaleBarOptions",ee.extend(this,e)}destroy(){this.scaleText=null,this.orientation=null,this.type=null,this.intervals=null,this.unit=null}toJSON(){var e={scaleText:this.scaleText||"",type:this.type||"BAR",intervals:this.intervals||"",unit:this.unit||"METER"};return this.orientation&&(e.orientation=this.orientation),ee.toJSON(e)}}class rn{constructor(e){this.type=null,this.url=null,this.token=null,this.value=null,this.CLASS_NAME="SuperMap.WebPrintingJobContent",ee.extend(this,e)}destroy(){this.type="WEBMAP",this.url=null,this.token=null,this.value=null}toJSON(){var e={type:this.type};return this.token&&(e.token=this.token),this.url?e.url=this.url:this.value&&(e.value=this.value),ee.toJSON(e)}}class sn{constructor(e){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions=null,this.northArrowOptions=null,this.littleMapOptions=null,this.legendOptions=null,this.CLASS_NAME="SuperMap.WebPrintingJobLayoutOptions",ee.extend(this,e)}destroy(){this.templateName=null,this.title=null,this.subTitle=null,this.author=null,this.copyright=null,this.scaleBarOptions instanceof tn&&(this.scaleBarOptions.destroy(),this.scaleBarOptions=null),this.northArrowOptions instanceof en&&(this.northArrowOptions.destroy(),this.northArrowOptions=null),this.littleMapOptions instanceof $s&&(this.littleMapOptions.destroy(),this.littleMapOptions=null),this.legendOptions instanceof Ks&&(this.legendOptions.destroy(),this.legendOptions=null)}toJSON(){var e={templateName:this.templateName,title:this.title,subTitle:this.subTitle,author:this.author,copyright:this.copyright};return this.scaleBarOptions&&(e.scaleBarOptions=this.scaleBarOptions),this.northArrowOptions&&(e.northArrowOptions=this.northArrowOptions),this.littleMapOptions&&(e.littleMapOptions=this.littleMapOptions),this.legendOptions&&(e.legendOptions=this.legendOptions),ee.toJSON(e)}}class nn{constructor(e){this.format=null,this.dpi=96,this.scale=null,this.rotation=null,this.center=null,this.CLASS_NAME="SuperMap.WebPrintingJobExportOptions",ee.extend(this,e)}destroy(){this.format=null,this.dpi=null,this.scale=null,this.rotation=null,this.center=null,this.outputSize=null}toJSON(){var e={format:this.format||"PDF",dpi:this.dpi,scale:this.scale,center:this.center};return this.rotation&&(e.rotation=this.rotation),this.outputSize&&(e.outputSize=this.outputSize),ee.toJSON(e)}}class an extends tt{constructor(e,t){super(e,t),t&&ee.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 i=this;i.processAsync(`jobs/${e}`,"GET",function(r){i.rollingProcess(r,i._processUrl(`jobs/${e}`),t)})}getPrintingJobResult(e,t){this.processAsync(`jobs/${e}/result`,"GET",t)}getLayoutTemplates(e){this.processAsync("layouts","GET",e)}rollingProcess(e,t,i){var r=this;if(e)var s=setInterval(function(){let e=++r.eventCount,n={scope:this,processCompleted:function(t){if(e===t.result.eventId&&i)return delete t.result.eventId,i(t),r.events.un(n),!1},processFailed:function(t){if((e===t.error.eventId||e===t.eventId)&&i)return i(t),r.events.un(n),!1}};r.events.on(n),r.request({url:t,method:"GET",scope:r,success:function(t,i){switch(t.eventId=e,t.status){case"FINISHED":clearInterval(s),r.serviceProcessCompleted(t,i);break;case"ERROR":clearInterval(s),r.serviceProcessFailed(t,i);break;case"RUNNING":r.events.triggerEvent("processRunning",t)}},failure:r.serviceProcessFailed})},1e3)}processAsync(e,t,i,r){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if(s===e.error.eventId||s===e.eventId)return i(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=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,this.serviceProcessFailed(e,t)}};r&&(a.data=ee.toJSON(r)),this.request(a)}_processUrl(e){return e?ee.urlPathAppend(this.url,e):this.url}}class on extends tt{constructor(e,t){super(e,t),this.options=t||{},t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.ImageCollectionService"}destroy(){super.destroy()}getLegend(e,t){var i={collectionId:this.options.collectionId},r=ee.convertPath("/collections/{collectionId}/legend",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"GET",params:e,callback:t})}getStatistics(e){var t={collectionId:this.options.collectionId},i=ee.convertPath("/collections/{collectionId}/statistics",t),r=ee.urlPathAppend(this.url,i);this._processAsync({url:r,method:"GET",callback:e})}getTileInfo(e){var t={collectionId:this.options.collectionId},i=ee.convertPath("/collections/{collectionId}/tileInfo",t),r=ee.urlPathAppend(this.url,i);this._processAsync({url:r,method:"GET",callback:e})}deleteItemByID(e,t){var i={collectionId:this.options.collectionId,featureId:e},r=ee.convertPath("/collections/{collectionId}/items/{featureId}",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"DELETE",callback:t})}getItemByID(e,t){var i={collectionId:this.options.collectionId,featureId:e},r=ee.convertPath("/collections/{collectionId}/items/{featureId}",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"GET",callback:t})}_processAsync({url:e,method:t,callback:i,params:r}){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(e),this.events&&this.events.un(n),!1}};this.events.on(n),this.request({method:t||"GET",url:e,params:r,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)}})}}class ln extends tt{constructor(e,t){super(e,t),this.options=t||{},t&&ee.extend(this,t),this.eventCount=0,this.CLASS_NAME="SuperMap.ImageService"}destroy(){super.destroy()}getCollections(e){var t=ee.convertPath("/collections"),i=ee.urlPathAppend(this.url,t);this._processAsync({url:i,mehtod:"GET",callback:e})}getCollectionByID(e,t){var i={collectionId:e},r=ee.convertPath("/collections/{collectionId}",i),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,mehtod:"GET",callback:t})}search(e,t){var i={...e||{}},r=ee.convertPath("/search"),s=ee.urlPathAppend(this.url,r);this._processAsync({url:s,method:"POST",data:i,callback:t})}_processAsync({url:e,method:t,callback:i,data:r}){let s=++this.eventCount,n=this,a={scope:this,processCompleted:function(e){if(s===e.result.eventId&&i)return delete e.result.eventId,i(e),this.events&&this.events.un(a),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&i)return i(e),this.events&&this.events.un(a),!1}};this.events.on(a),this.request({method:t||"GET",url:e,data:r,scope:this,success(e,t){e.eventId=s,n.serviceProcessCompleted(e,t)},failure(e,t){e.error&&(e.error.eventId=s),e.eventId=s,n.serviceProcessFailed(e,t)}})}}class hn{constructor(e){this.include=void 0,this.exclude=void 0,this.CLASS_NAME="SuperMap.FieldsFilter",ee.extend(this,e)}destroy(){this.include=void 0,this.exclude=void 0}static constructFromObject(e,t){return e&&(t=t||new hn,e.hasOwnProperty("include")&&(t.include=e.include),e.hasOwnProperty("exclude")&&(t.exclude=e.exclude)),t}}class un{constructor(e){this.field=void 0,this.direction=un.Direction.ASC,this.CLASS_NAME="SuperMap.Sortby",ee.extend(this,e)}destroy(){this.field=void 0,this.direction="ASC"}static constructFromObject(e,t){return e&&(t=t||new un,e.hasOwnProperty("field")&&(t.field=e.field),e.hasOwnProperty("direction")&&(t.direction=e.direction)),t}}un.Direction={ASC:"ASC",DESC:"DESC"};class cn{constructor(e){this.bbox=void 0,this.collections=void 0,this.ids=void 0,this.limit=void 0,this.fields=void 0,this.query=void 0,this.sortby=void 0,this.CLASS_NAME="SuperMap.ImageSearchParameter",ee.extend(this,e)}destroy(){var e=this;e.bbox=void 0,e.collections=void 0,e.ids=void 0,e.limit=void 0,e.fields=void 0,e.query=void 0,e.sortby=void 0}static constructFromObject(e,t){return e&&(t=t||new cn,e.hasOwnProperty("bbox")&&(t.bbox=e.bbox),e.hasOwnProperty("collections")&&(t.collections=e.collections),e.hasOwnProperty("ids")&&(t.ids=e.ids),e.hasOwnProperty("limit")&&(t.limit=e.limit),e.hasOwnProperty("fields")&&(t.fields=hn.constructFromObject&&hn.constructFromObject(e.fields,{})||e.fields),e.hasOwnProperty("query")&&(t.query=e.query),e.hasOwnProperty("sortby")&&(t.sortby=e.sortby,e.sortby&&(t.sortby=e.sortby.map(e=>un.constructFromObject&&un.constructFromObject(e,{})||e)))),t}}class dn{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",ee.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 dn,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}}dn.StretchType={NONE:"NONE",GAUSSIAN:"GAUSSIAN",PERCENTCLIP:"PERCENTCLIP",MINIMUMMAXIMUM:"MINIMUMMAXIMUM",STANDARDDEVIATION:"STANDARDDEVIATION"};class pn{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",ee.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 pn,e.hasOwnProperty("displayMode")&&(t.displayMode=e.displayMode),e.hasOwnProperty("displayBands")&&(t.displayBands=e.displayBands),e.hasOwnProperty("stretchOption")&&(t.stretchOption=dn.constructFromObject&&dn.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}}pn.DisplayMode={COMPOSITE:"COMPOSITE",STRETCHED:"Stretched"},pn.InterpolationMode={NEARESTNEIGHBOR:"NEARESTNEIGHBOR",HIGHQUALITYBILINEAR:"HIGHQUALITYBILINEAR",DEFAULT:"DEFAULT"};class fn{constructor(e){this.girdFuncName="GFHillShade",this.Azimuth=315,this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFHillShade",ee.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 fn,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 mn{constructor(e){this.girdFuncName="GFAspect",this.Azimuth=void 0,this.CLASS_NAME="SuperMap.ImageGFAspect",ee.extend(this,e)}destroy(){this.girdFuncName="GFAspect",this.Azimuth=void 0}static constructFromObject(e,t){return e&&(t=t||new mn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Azimuth")&&(t.Azimuth=e.Azimuth)),t}}class yn{constructor(e){this.girdFuncName="GFOrtho",this.CLASS_NAME="SuperMap.ImageGFOrtho",ee.extend(this,e)}destroy(){this.girdFuncName="GFOrtho"}static constructFromObject(e,t){return e&&(t=t||new yn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName)),t}}class gn{constructor(e){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1,this.CLASS_NAME="SuperMap.ImageGFSlope",ee.extend(this,e)}destroy(){this.girdFuncName="GFSlope",this.Altitude=45,this.ZFactor=1}static constructFromObject(e,t){return e&&(t=t||new gn,e.hasOwnProperty("girdFuncName")&&(t.girdFuncName=e.girdFuncName),e.hasOwnProperty("Altitude")&&(t.Altitude=e.Altitude),e.hasOwnProperty("ZFactor")&&(t.ZFactor=e.ZFactor)),t}}class vn{constructor(e){e=e||{},ee.extend(this,e),this.CLASS_NAME="SuperMap.OnlineServiceBase"}request(e,t,i,r={}){return t=je.appendCredential(t),r.crossOrigin=this.options.crossOrigin,r.headers=this.options.headers,Ue.commit(e,t,i,r).then(function(e){return e.json()})}}class bn extends vn{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,ee.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){ee.extend(e,t)})}}getPublishedServices(){return this.dataItemServices}getAuthorizeSetting(){return this.authorizeSetting}}const _n=function(){try{return elasticsearch}catch(e){return{}}}();var Sn=i.n(_n);class xn{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 i=e;if(e instanceof Array){i=[];for(var r=0,s=e.length;rn&&(n=e+o+100,r.width=n,i=!0),t+l>a&&(a=t+l+100,r.height=a,i=!0),e<-o&&(n+=o=100*Math.ceil(-e/100),r.width=n,i=!0),t<-l&&(a+=l=100*Math.ceil(-t/100),r.height=a,i=!0),i&&s.translate(o,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i1)for(var s=0,n=r-1;s1?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 i=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=i[0],e[2]=i[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=[],i=0;return e.replace(/[\d.]+/g,function(e){i<3?e|=0:e=+e,t[i++]=e}),t}convert(e,t){if(!this.isCalculableColor(e))return e;var i=this.getData(e),r=i[3];return void 0===r&&(r=1),e.indexOf("hsb")>-1?i=this._HSV_2_RGB(i):e.indexOf("hsl")>-1&&(i=this._HSL_2_RGB(i)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?i=this._RGB_2_HSB(i):t.indexOf("hsl")>-1&&(i=this._RGB_2_HSL(i)),i[3]=r,this.toColor(i,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,i=(240&e)<<4,r=15&e;e="#"+((1<<24)+(t<<4)+t+(i<<4)+i+(r<<4)+r).toString(16).slice(1)}return e}lift(e,t){if(!this.isCalculableColor(e))return e;var i=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var r=this.getData(e),s=0;s<3;s++)r[s]=1===i?r[s]*(1-t)|0:(255-r[s])*t+r[s]|0;return"rgb("+r.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,i){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===i&&(i=.5);for(var r=2*(i=1-this.adjust(i,[0,1]))-1,s=this.getData(this.toRGBA(e)),n=this.getData(this.toRGBA(t)),a=s[3]-n[3],o=((r*a==-1?r:(r+a)/(1+r*a))+1)/2,l=1-o,h=[],u=0;u<3;u++)h[u]=s[u]*o+n[u]*l;var c=s[3]*i+n[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===s[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,i,r=(e=this.normalize(e)).match(this.colorRegExp);if(null===r)throw new Error("The color format error");var s,n=[];if(r[2])s=[(t=r[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],n=this.map(s,function(e){return wn.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(r[4]){var a=r[4].split(",");i=a[3],s=a.slice(0,3),n=this.map(s,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),wn.prototype.adjust.call(this,e,[0,255])}),void 0!==i&&n.push(this.adjust(parseFloat(i),[0,1]))}else if(r[5]||r[6]){var o=(r[5]||r[6]).split(","),l=parseInt(o[0],0)/360,h=o[1],u=o[2];i=o[3],(n=this.map([h,u],function(e){return wn.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==i&&n.push(this.adjust(parseFloat(i),[0,1]))}return n}alpha(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var i=this.getData(this.toRGBA(e));return i[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(i,"rgba")}map(e,t){if("function"!=typeof t)throw new TypeError;for(var i=e?e.length:0,r=0;r=t[1]&&(e=t[1]),e}isCalculableColor(e){return e instanceof Array||"string"==typeof e}_HSV_2_RGB(e){var t,i,r,s=e[0],n=e[1],a=e[2];if(0===n)t=255*a,i=255*a,r=255*a;else{var o=6*s;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,i=255*p,r=255*f}return[t,i,r]}_HSL_2_RGB(e){var t,i,r,s=e[0],n=e[1],a=e[2];if(0===n)t=255*a,i=255*a,r=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,s+1/3),i=255*this._HUE_2_RGB(l,o,s),r=255*this._HUE_2_RGB(l,o,s-1/3)}return[t,i,r]}_HUE_2_RGB(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}_RGB_2_HSB(e){var t,i,r=e[0]/255,s=e[1]/255,n=e[2]/255,a=Math.min(r,s,n),o=Math.max(r,s,n),l=o-a,h=o;if(0===l)t=0,i=0;else{i=l/o;var u=((o-r)/6+l/2)/l,c=((o-s)/6+l/2)/l,d=((o-n)/6+l/2)/l;r===o?t=d-c:s===o?t=1/3+u-d:n===o&&(t=2/3+c-u),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,i*=100,h*=100]}_RGB_2_HSL(e){var t,i,r=e[0]/255,s=e[1]/255,n=e[2]/255,a=Math.min(r,s,n),o=Math.max(r,s,n),l=o-a,h=(o+a)/2;if(0===l)t=0,i=0;else{i=h<.5?l/(o+a):l/(2-o-a);var u=((o-r)/6+l/2)/l,c=((o-s)/6+l/2)/l,d=((o-n)/6+l/2)/l;r===o?t=d-c:s===o?t=1/3+u-d:n===o&&(t=2/3+c-u),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,i*=100,h*=100]}}var Cn=new wn;var Mn=function(e){var t;if(e===l.METER)t=1;else if(e===l.DEGREE)t=2*Math.PI*6378137/360;else if(e===l.KILOMETER)t=.001;else if(e===l.INCH)t=1/.025399999918;else{if(e!==l.FOOT)return t;t=.3048}return t};function An(e,t,i,r,s=22){var n=[];if(e&&e.length>0)for(let t=0;tl&&(o[r]=o[r].slice(i-l),l=i)}function f(e){var s,n,a,u;if(e instanceof Function)return e.call(h.parsers);if("string"==typeof e)s=t.charAt(i)===e?e:null,n=1,p();else{if(p(),!(s=e.exec(o[r])))return null;n=s[0].length}if(s){var c=i+=n;for(u=i+o[r].length-n;i=0&&"\n"!==r.charAt(o);o--)i.column++;return new Error([i.filename,i.line,i.column,i.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},h={parse:function(s){var n,h=null;if(i=r=l=a=0,o=[],t=s.replace(/\r\n/g,"\n"),e.filename&&(u.env.inputs[e.filename]=t),o=function(e){for(var i,r,s,n,a=0,o=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,l=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,u=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,c=0,d=e[0],p=0;p0?"missing closing `}`":"missing opening `{`"}),e.map(function(e){return e.join("")})}([[]]),h)throw m(h);var c=function(e,t){var i=e.specificity,r=t.specificity;return i[0]!=r[0]?r[0]-i[0]:i[1]!=r[1]?r[1]-i[1]:i[2]!=r[2]?r[2]-i[2]:r[3]-i[3]};return(n=new On.Tree.Ruleset([],f(this.parsers.primary))).root=!0,n.toList=function(e){e.error=function(t){e.errors||(e.errors=new Error("")),e.errors.message?e.errors.message+="\n"+m(t).message:e.errors.message=m(t).message},e.frames=e.frames||[];var t=this.flatten([],[],e);return t.sort(c),t},n},parsers:{primary:function(){for(var e,t=[];(e=f(this.rule)||f(this.ruleset)||f(this.comment))||f(/^[\s\n]+/)||(e=f(this.invalid));)e&&t.push(e);return t},invalid:function(){var e=f(/^[^;\n]*[;\n]/);if(e)return new On.Tree.Invalid(e,n)},comment:function(){var e;if("/"===t.charAt(i))return"/"===t.charAt(i+1)?new On.Tree.Comment(f(/^\/\/.*/),!0):(e=f(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new On.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===t.charAt(i)||"'"===t.charAt(i)){var e=f(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new On.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(f("[")){var e=f(/(^[^\]]+)/);if(f("]"))return e?new On.Tree.Field(e[1]):void 0}},comparison:function(){var e=f(/^=~|=|!=|<=|>=|<|>/);if(e)return e},keyword:function(){var e=f(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new On.Tree.Keyword(e)},call:function(){var e,t;if(e=/^([\w\-]+|%)\(/.exec(o[r])){if("url"===(e=e[1]))return null;i+=e.length;if(f("("),t=f(this.entities.arguments),f(")"))return e?new On.Tree.Call(e,t,i):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(i)&&f(/^url\(/)){e=f(this.entities.quoted)||f(this.entities.variable)||f(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return f(")")?new On.Tree.URL(void 0!==e.value||e instanceof On.Tree.Variable?e:new On.Tree.Quoted(e)):new On.Tree.Invalid(e,n,"Missing closing ) in URL.")}},variable:function(){var r,s=i;if("@"===t.charAt(i)&&(r=f(/^@[\w-]+/)))return new On.Tree.Variable(r,s,e.filename)},hexcolor:function(){var e;if("#"===t.charAt(i)&&(e=f(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new On.Tree.Color(e[1])},keywordcolor:function(){var e=o[r].match(/^[a-z]+/);if(e&&e[0]in On.Tree.Reference.data.colors)return new On.Tree.Color(On.Tree.Reference.data.colors[f(/^[a-z]+/)])},dimension:function(){var e=t.charCodeAt(i);if(!(e>57||e<45||47===e)){var r=f(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return r?new On.Tree.Dimension(r[1],r[2],n):void 0}}},variable:function(){var e;if("@"===t.charAt(i)&&(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),i=f(this.entities.url)||f(this.entities.keyword);return e||t||i},end:function(){var e;return f(";")||("string"==typeof(e="}")?t.charAt(i)===e:!!e.test(o[r]))},element:function(){var e=f(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new On.Tree.Element(e)},attachment:function(){var e=f(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(e)return e[1]},selector:function(){for(var e,r,s,a,o,l=[],h=new On.Tree.Filterset,u=[],c=0,d=0;(s=f(this.element))||(o=f(this.zoom))||(a=f(this.filter))||(e=f(this.attachment));){if(c++,s)l.push(s);else if(o)u.push(o),d++;else if(a){var p=h.add(a);if(p)throw m({message:p,index:i-1});d++}else{if(r)throw m({message:"Encountered second attachment name.",index:i-1});r=e}var y=t.charAt(i);if("{"===y||"}"===y||";"===y||","===y)break}if(c)return new On.Tree.Selector(h,u,l,r,d,n)},filter:function(){c();var t,i,r;if(f("[")&&(t=f(/^[a-zA-Z0-9\-_]+/)||f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.keyword)||f(this.entities.field))&&(t instanceof On.Tree.Quoted&&(t=new On.Tree.Field(t.toString())),(i=f(this.entities.comparison))&&(r=f(this.entities.quoted)||f(this.entities.variable)||f(this.entities.dimension)||f(this.entities.keyword)||f(this.entities.field)))){if(!f("]"))throw m({message:"Missing closing ] of filter.",index:n-1});return t.is||(t=new On.Tree.Field(t)),new On.Tree.Filter(t,i,r,n,e.filename)}},zoom:function(){c();var e,t;if(f(/^\[\s*zoom/g)&&(e=f(this.entities.comparison))&&(t=f(this.entities.variable)||f(this.entities.dimension))&&f("]"))return new On.Tree.Zoom(e,t,n);d()},block:function(){var e;if(f("{")&&(e=f(this.primary))&&f("}"))return e},ruleset:function(){var e,t,i=[];for(c();e=f(this.selector);){for(i.push(e);f(this.comment););if(!f(","))break;for(;f(this.comment););}if(e)for(;f(this.comment););if(i.length>0&&(t=f(this.block))){if(1===i.length&&i[0].elements.length&&"Map"===i[0].elements[0].value){var r=new On.Tree.Ruleset(i,t);return r.isMap=!0,r}return new On.Tree.Ruleset(i,t)}d()},rule:function(){var r,s,o=t.charAt(i);if(c(),"."!==o&&"#"!==o&&(r=f(this.variable)||f(this.property))){if((s=f(this.value))&&f(this.end))return new On.Tree.Rule(r,s,n,e.filename);a=i,d()}},font:function(){for(var e,t=[],i=[];e=f(this.entity);)i.push(e);if(t.push(new On.Tree.Expression(i)),f(","))for(;(e=f(this.expression))&&(t.push(e),f(",")););return new On.Tree.Value(t)},value:function(){for(var e,t=[];(e=f(this.expression))&&(t.push(e),f(",")););return t.length>1?new On.Tree.Value(t.map(function(e){return e.value[0]})):1===t.length?new On.Tree.Value(t):void 0},sub:function(){var e;if(f("(")&&(e=f(this.expression))&&f(")"))return e},multiplication:function(){var e,t,i,r;if(e=f(this.operand)){for(;(i=f("/")||f("*")||f("%"))&&(t=f(this.operand));)r=new On.Tree.Operation(i,[r||e,t],n);return r||e}},addition:function(){var e,r,s,a;if(e=f(this.multiplication)){for(;(s=f(/^[-+]\s+/)||" "!=t.charAt(i-1)&&(f("+")||f("-")))&&(r=f(this.multiplication));)a=new On.Tree.Operation(s,[a||e,r],n);return a||e}},operand:function(){return f(this.sub)||f(this.entity)},expression:function(){for(var e,t=[];e=f(this.addition)||f(this.entity);)t.push(e);if(t.length>0)return new On.Tree.Expression(t)},property:function(){var e=f(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(e)return e[1]}}}}parse(e){var t=this.parser;return this.ruleSet=t.parse(e)}toShaders(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var i={},r=[];this._toShaders(i,r,t);for(var s=[],n={},a=0,o=t.length;a=0){if(!t.featureFilter){var n=s+r.length,a=i.indexOf(")",n+1),o="featureId&&(featureId"+i.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){"+i+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+i+"; 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}),s.push(c),n[r[a]]=!0}Object.defineProperty(c,"zoom",{configurable:!0,enumerable:!1,value:l.zoom})}return s}}return null}_toShaders(e,t,i){for(let r=0,s=i.length;r= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};On.mapnik_reference={version:{latest:Pn,"2.1.1":Pn}},On.Tree={},On.Tree.operate=function(e,t,i){switch(e){case"+":return t+i;case"-":return t-i;case"*":return t*i;case"%":return t%i;case"/":return t/i}},On.Tree.functions={rgb:function(e,t,i){return this.rgba(e,t,i,1)},rgba:function(e,t,i,r){var s=this,n=[e,t,i].map(function(e){return s.number(e)});return r=s.number(r),n.some(isNaN)||isNaN(r)?null:new On.Tree.Color(n,r)},stop:function(e){var t,i;return arguments.length>1&&(t=arguments[1]),arguments.length>2&&(i=arguments[2]),{is:"tag",val:e,color:t,mode:i,toString:r=>'\n\t"}},hsl:function(e,t,i){return this.hsla(e,t,i,1)},hsla:function(e,t,i,r){if([e=this.number(e)%360/360,t=this.number(t),i=this.number(i),r=this.number(r)].some(isNaN))return null;var s=i<=.5?i*(t+1):i+t-i*t,n=2*i-s;return this.rgba(255*a(e+1/3),255*a(e),255*a(e-1/3),r);function a(e){return 6*(e=e<0?e+1:e>1?e-1:e)<1?n+(s-n)*e*6:2*e<1?s:3*e<2?n+(s-n)*(2/3-e)*6:n}},hue:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new On.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new On.Tree.Dimension(e.toHSL().a):null},saturate:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.s+=t.value/100,i.s=this.clamp(i.s),this.hsla_simple(i)},desaturate:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.s-=t.value/100,i.s=this.clamp(i.s),this.hsla_simple(i)},lighten:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.l+=t.value/100,i.l=this.clamp(i.l),this.hsla_simple(i)},darken:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.l-=t.value/100,i.l=this.clamp(i.l),this.hsla_simple(i)},fadein:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.a+=t.value/100,i.a=this.clamp(i.a),this.hsla_simple(i)},fadeout:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL();return i.a-=t.value/100,i.a=this.clamp(i.a),this.hsla_simple(i)},spin:function(e,t){if(!("toHSL"in e))return null;var i=e.toHSL(),r=(i.h+t.value)%360;return i.h=r<0?360+r:r,this.hsla_simple(i)},replace:function(e,t,i){return"field"===e.is?e.toString+".replace("+t.toString()+", "+i.toString()+")":e.replace(t,i)},mix:function(e,t,i){var r=i.value/100,s=2*r-1,n=e.toHSL().a-t.toHSL().a,a=((s*n==-1?s:(s+n)/(1+s*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*r+t.alpha*(1-r);return new On.Tree.Color(l,h)},greyscale:function(e){return this.desaturate(e,new On.Tree.Dimension(100))},"%":function(e){for(var t=Array.prototype.slice.call(arguments,1),i=e.value,r=0;r.5?h/(2-a-o):h/(a+o),a){case i:e=(r-s)/h+(r=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}toColor(){return new On.Tree.Color([this.value,this.value,this.value])}round(){return this.value=Math.round(this.value),this}toString(){return this.value.toString()}operate(e,t,i){return"%"===this.unit&&"%"!==i.unit?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===i.unit?"*"===t||"/"===t||"%"===t?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new On.Tree.Dimension(On.Tree.operate(t,this.value,this.value*i.value*.01),this.unit):new On.Tree.Dimension(On.Tree.operate(t,this.value,i.value),this.unit||i.unit)}},On.Tree.Element=class{constructor(e){this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")}specificity(){return["id"===this.type?1:0,"class"===this.type?1:0]}toString(){return this.value}},On.Tree.Expression=class{constructor(e){this.is="expression",this.value=e}ev(e){return this.value.length>1?new On.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}toString(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}},On.Tree.Field=class{constructor(e){this.is="field",this.value=e||""}toString(){return'["'+this.value.toUpperCase()+'"]'}ev(){return this}},On.Tree.Filter=class{constructor(e,t,i,r,s){this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=t,this.val=i,this.index=r,this.filename=s,this.id=this.key+this.op+this.val}ev(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}toString(){return"["+this.id+"]"}},On.Tree.Filterset=class{constructor(){this.filters={}}toJS(e){function t(e){var t=e.op;"="===t&&(t="==");var i=e.val;void 0!==e._val&&(i=e._val.toString(!0)),e.key&&"scale"===e.key.value?i=+i:"string"!=typeof i&&"object"!=typeof i||(i="'"+i+"'");var r="attributes";return r+"&&"+r+e.key+"&&"+r+e.key+" "+t+i}var i=[];for(var r in this.filters)i.push(t(this.filters[r]));return i.join(" && ")}toString(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join("\t")}ev(e){for(var t in this.filters)this.filters[t].ev(e);return this}clone(){var e=new On.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}cloneWith(e){var t=[];for(var i in e.filters){var r=this.addable(e.filters[i]);if(!1===r)return!1;!0===r&&t.push(e.filters[i])}if(!t.length)return null;var s=new On.Tree.Filterset;for(i in this.filters)s.filters[i]=this.filters[i];for(;i=t.shift();)s.add(i);return s}addable(e){var t=e.key.toString(),i=e.val.toString();switch(i.match(/^[0-9]+(\.[0-9]*)?_match/)&&(i=parseFloat(i)),e.op){case"=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val.toString()==i&&null:void 0===this.filters[t+"!="+i]&&(!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i)&&(!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i)&&!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val"]&&this.filters[t+">"].val>=i?null:void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i?null:void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val":return t+"="in this.filters?!(this.filters[t+"="].val<=i)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=i)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i)||null));case">=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val"]&&this.filters[t+">"].val>=i?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=i)||null));case"<":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>=i)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=i)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].vali)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=i)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>i)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=i?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=i)||null))}}conflict(e){var t=e.key.toString(),i=e.val.toString();return isNaN(parseFloat(i))||(i=parseFloat(i)),("="===e.op&&void 0!==this.filters[t+"="]&&i!=this.filters[t+"="].val.toString()||"!="===e.op&&void 0!==this.filters[t+"="]&&i==this.filters[t+"="].val.toString()||"="===e.op&&void 0!==this.filters[t+"!="]&&i===this.filters[t+"!="].val.toString())&&e.toString()+" added to "+this.toString()+" produces an invalid filter"}add(e,t){var i,r=e.key.toString(),s=e.op,n=this.conflict(e);if(n)return n;if("="===s){for(var a in this.filters)this.filters[a].key===r&&delete this.filters[a];this.filters[r+"="]=e}else if("!="===s)this.filters[r+"!="+e.val]=e;else if("=~"===s)this.filters[r+"=~"+e.val]=e;else if(">"===s){for(var o in this.filters)this.filters[o].key===r&&this.filters[o].val<=e.val&&delete this.filters[o];this.filters[r+">"]=e}else if(">="===s){for(var l in this.filters)i=+this.filters[l].val.toString(),this.filters[l].key===r&&i",this.filters[r+">"]=e):this.filters[r+">="]=e}else if("<"===s){for(var h in this.filters)i=+this.filters[h].val.toString(),this.filters[h].key===r&&i>=e.val&&delete this.filters[h];this.filters[r+"<"]=e}else if("<="===s){for(var u in this.filters)i=+this.filters[u].val.toString(),this.filters[u].key===r&&i>e.val&&delete this.filters[u];void 0!==this.filters[r+"!="+e.val]?(delete this.filters[r+"!="+e.val],e.op="<",this.filters[r+"<"]=e):this.filters[r+"<="]=e}}},On.Tree.Fontset=class{constructor(e,t){this.fonts=t,this.name="fontset-"+e.effects.length}},On.Tree.Invalid=class{constructor(e,t,i){this.is="invalid",this.chunk=e,this.index=t,this.type="syntax",this.message=i||"Invalid code: "+this.chunk}ev(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}},On.Tree.Keyword=class{ev(){return this}constructor(e){this.value=e;var t={transparent:"color",true:"boolean",false:"boolean"};this.is=t[e]?t[e]:"keyword"}toString(){return this.value}},On.Tree.Literal=class{constructor(e){this.value=e||"",this.is="field"}toString(){return this.value}ev(){return this}},On.Tree.Operation=class{constructor(e,t,i){this.is="operation",this.op=e.trim(),this.operands=t,this.index=i}ev(e){var t,i=this.operands[0].ev(e),r=this.operands[1].ev(e);return"undefined"===i.is||"undefined"===r.is?{is:"undefined",value:"undefined"}:(i instanceof On.Tree.Dimension&&r instanceof On.Tree.Color&&("*"===this.op||"+"===this.op?(t=r,r=i,i=t):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),i instanceof On.Tree.Quoted&&r instanceof On.Tree.Quoted&&"+"!==this.op?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):i instanceof On.Tree.Field||r instanceof On.Tree.Field||i instanceof On.Tree.Literal||r instanceof On.Tree.Literal?"color"===i.is||"color"===r.is?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new On.Tree.Literal(i.ev(e).toString(!0)+this.op+r.ev(e).toString(!0)):void 0===i.operate?(e.error({message:"Cannot do math with type "+i.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):i.operate(e,this.op,r))}},On.Tree.Quoted=class{constructor(e){this.is="string",this.value=e||""}toString(e){var t=this.value.replace(/&/g,"&"),i=t.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===e?"'"+i+"'":t}ev(){return this}operate(e,t,i){return new On.Tree.Quoted(On.Tree.operate(t,this.toString(),i.toString(this.contains_field)))}},On.Tree.Reference={_validateValue:{font:function(e,t){return!e.validation_data||!e.validation_data.fonts||-1!=e.validation_data.fonts.indexOf(t)}},setData:function(e){this.data=e,this.selector_cache=function(e){var t={};for(var i in e.symbolizers)for(var r in e.symbolizers[i])e.symbolizers[i][r].hasOwnProperty("css")&&(t[e.symbolizers[i][r].css]=[e.symbolizers[i][r],i,r]);return t}(e),this.mapnikFunctions=function(e){var t={};for(var i in e.symbolizers)for(var r in e.symbolizers[i])if("functions"===e.symbolizers[i][r].type)for(var s=0;s1?Array.prototype.push.apply(i,r.find(new On.Tree.Selector(null,null,e.elements.slice(1)),t)):i.push(r);break}}),this._lookups[r]=i)}evZooms(e){for(var t=0;tOn.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+On.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t}return this}toString(){for(var e="",t=0;t<=On.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<3&&(t=Array.prototype.slice.call(t,1));for(var r=this._handlers[e],s=r.length,n=0;n4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var r=t[t.length-1],s=this._handlers[e],n=s.length,a=0;a-this.EPSILON&&ethis.EPSILON||e<-this.EPSILON}cubicAt(e,t,i,r,s){var n=1-s;return n*n*(n*e+3*s*t)+s*s*(s*r+3*n*i)}cubicDerivativeAt(e,t,i,r,s){var n=1-s;return 3*(((t-e)*n+2*(i-t)*s)*n+(r-i)*s*s)}cubicRootAt(e,t,i,r,s,n){var a=r+3*(t-i)-e,o=3*(i-2*t+e),l=3*(t-e),h=e-s,u=o*o-3*a*l,c=o*l-9*a*h,d=l*l-3*o*h,p=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(o))n[0]=0;else{let e=-l/o;e>=0&&e<=1&&(n[p++]=e)}else{var f=c*c-4*u*d;if(this.isAroundZero(f)){var m=c/u;let e=-o/a+m,t=-m/2;e>=0&&e<=1&&(n[p++]=e),t>=0&&t<=1&&(n[p++]=t)}else if(f>0){let e=Math.sqrt(f),t=u*o+1.5*a*(-c+e),i=u*o+1.5*a*(-c-e),r=(-o-((t=t<0?-Math.pow(-t,this.ONE_THIRD):Math.pow(t,this.ONE_THIRD))+(i=i<0?-Math.pow(-i,this.ONE_THIRD):Math.pow(i,this.ONE_THIRD))))/(3*a);r>=0&&r<=1&&(n[p++]=r)}else{var y=(2*u*o-3*a*c)/(2*Math.sqrt(u*u*u)),g=Math.acos(y)/3,v=Math.sqrt(u),b=Math.cos(g);let e=(-o-2*v*b)/(3*a),t=(-o+v*(b+this.THREE_SQRT*Math.sin(g)))/(3*a),i=(-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),i>=0&&i<=1&&(n[p++]=i)}}return p}cubicExtrema(e,t,i,r,s){var n=6*i-12*t+6*e,a=9*t+3*r-3*e-9*i,o=3*t-3*e,l=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(n)){let e=-o/n;e>=0&&e<=1&&(s[l++]=e)}}else{var h=n*n-4*a*o;if(this.isAroundZero(h))s[0]=-n/(2*a);else if(h>0){let e=Math.sqrt(h),t=(-n+e)/(2*a),i=(-n-e)/(2*a);t>=0&&t<=1&&(s[l++]=t),i>=0&&i<=1&&(s[l++]=i)}}return l}cubicSubdivide(e,t,i,r,s,n){var a=(t-e)*s+e,o=(i-t)*s+t,l=(r-i)*s+i,h=(o-a)*s+a,u=(l-o)*s+o,c=(u-h)*s+h;n[0]=e,n[1]=a,n[2]=h,n[3]=c,n[4]=c,n[5]=u,n[6]=l,n[7]=r}cubicProjectPoint(e,t,i,r,s,n,a,o,l,h,u){var c,d=this.vector.create(),p=this.vector.create(),f=this.vector.create(),m=.005,y=1/0;d[0]=l,d[1]=h;for(let l=0;l<1;l+=.05){p[0]=this.cubicAt(e,i,s,a,l),p[1]=this.cubicAt(t,r,n,o,l);let h=this.vector.distSquare(d,p);h=0&&u=0&&h<=1&&(s[l++]=h)}}else{var u=a*a-4*n*o;if(this.isAroundZero(u)){let e=-a/(2*n);e>=0&&e<=1&&(s[l++]=e)}else if(u>0){let e=Math.sqrt(u),t=(-a+e)/(2*n),i=(-a-e)/(2*n);t>=0&&t<=1&&(s[l++]=t),i>=0&&i<=1&&(s[l++]=i)}}return l}quadraticExtremum(e,t,i){var r=e+i-2*t;return 0===r?.5:(e-t)/r}quadraticProjectPoint(e,t,i,r,s,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,i,s,a),c[1]=this.quadraticAt(t,r,n,a);let o=this.vector.distSquare(u,c);o=0&&ln-2?n-1:d+1][0]+s[0],e[d>n-2?n-1:d+1][1]+s[1]],u=[e[d>n-3?n-1:d+2][0]+s[0],e[d>n-3?n-1:d+2][1]+s[1]]);let m=p*p,y=p*m;a.push([h(r[0],f[0],o[0],u[0],p,m,y),h(r[1],f[1],o[1],u[1],p,m,y)])}return a;function h(e,t,i,r,s,n,a){var o=.5*(i-e),l=.5*(r-t);return(2*(t-i)+o+l)*a+(-3*(t-i)-2*o-l)*n+o*s+t}}static SUtil_dashedLineTo(e,t,i,r,s,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,i),void e.lineTo(r,s);var l=r-t,h=s-i,u=Math.floor(Math.sqrt(l*l+h*h)/n);l/=u,h/=u;for(var c=!0,d=0;d0){for(var s=this.isInsidePolygon(t.pointList,u,c),n=e.holePolygonPointLists,a=!1,o=0,l=n.length;ot+o&&a>r+o||ae+o&&n>i+o||nt+c&&u>r+c&&u>n+c&&u>o+c||ue+c&&h>i+c&&h>s+c&&h>a+c||ht+h&&l>r+h&&l>n+h||le+h&&o>i+h&&o>s+h||oi||c+u=h)return!0;if(n){var d=r;r=this.normalizeRadian(s),s=this.normalizeRadian(d)}else r=this.normalizeRadian(r),s=this.normalizeRadian(s);r>s&&(s+=h);var p=Math.atan2(l,o);return p<0&&(p+=h),p>=r&&p<=s||p+h>=r&&p+h<=s}isInsideBrokenLine(e,t,i,r){for(var s=Math.max(t,10),n=0,a=e.length-1;ni*i}isInsideRect(e,t,i,r,s,n){return s>=e&&s<=e+i&&n>=t&&n<=t+r}isInsideCircle(e,t,i,r,s){return(r-e)*(r-e)+(s-t)*(s-t)t&&n>r||ns?rt&&h>r&&h>n&&h>o||h1&&this.swapExtrema(),f=u.cubicAt(t,r,n,o,d[0]),g>1&&(m=u.cubicAt(t,r,n,o,d[1]))),2==g?bt&&o>r&&o>n||o=0&&c<=1){var d=0,p=l.quadraticAt(t,r,n,c);for(let r=0;ra||(h[r]a?0:ni||o<-i)return 0;let u=Math.sqrt(i*i-o*o);if(l[0]=-u,l[1]=u,Math.abs(r-s)>=h){r=0,s=h;var c=n?1:-1;return a>=l[0]+e&&a<=l[1]+e?c:0}if(n){let e=r;r=this.normalizeRadian(s),s=this.normalizeRadian(e)}else r=this.normalizeRadian(r),s=this.normalizeRadian(s);r>s&&(s+=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>=r&&e<=s||e+h>=r&&e+h<=s)&&(e>Math.PI/2&&e<1.5*Math.PI&&(t=-t),d+=t)}}return d}isInsidePath(e,t,i,r,s){for(var n=0,a=0,o=0,l=0,h=0,u=!0,c=!0,d="stroke"===(i=i||"fill")||"both"===i,p="fill"===i||"both"===i,f=0;f0&&(p&&(n+=this.windingLine(a,o,l,h,r,s)),0!==n))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==m.command&&(c=!1,a=l,o=h)}switch(m.command){case"M":a=y[0],o=y[1];break;case"L":if(d&&this.isInsideLine(a,o,y[0],y[1],t,r,s))return!0;p&&(n+=this.windingLine(a,o,y[0],y[1],r,s)),a=y[0],o=y[1];break;case"C":if(d&&this.isInsideCubicStroke(a,o,y[0],y[1],y[2],y[3],y[4],y[5],t,r,s))return!0;p&&(n+=this.windingCubic(a,o,y[0],y[1],y[2],y[3],y[4],y[5],r,s)),a=y[4],o=y[5];break;case"Q":if(d&&this.isInsideQuadraticStroke(a,o,y[0],y[1],y[2],y[3],t,r,s))return!0;p&&(n+=this.windingQuadratic(a,o,y[0],y[1],y[2],y[3],r,s)),a=y[2],o=y[3];break;case"A":var g=y[0],v=y[1],b=y[2],_=y[3],S=y[4],x=y[5],w=Math.cos(S)*b+g,C=Math.sin(S)*_+v;c?(c=!1,l=w,h=C):n+=this.windingLine(a,o,w,C);var M=(r-g)*_/b+g;if(d&&this.isInsideArcStroke(g,v,_,S,S+x,1-y[7],t,M,s))return!0;p&&(n+=this.windingArc(g,v,_,S,S+x,1-y[7],M,s)),a=Math.cos(S+x)*b+g,o=Math.sin(S+x)*_+v;break;case"z":if(d&&this.isInsideLine(a,o,l,h,t,r,s))return!0;u=!0}}return p&&(n+=this.windingLine(a,o,l,h,r,s)),0!==n}getTextWidth(e,t){var i=e+":"+t;if(this._textWidthCache[i])return this._textWidthCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t);for(var r=0,s=0,n=(e=(e+"").split("\n")).length;sthis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),r}getTextHeight(e,t){var i=e+":"+t;if(this._textHeightCache[i])return this._textHeightCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split("\n");var r=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[i]=r,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),r}},Hn.Util_color=new wn,Hn.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="SuperMap.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(e,t,i){if(0!==e.length){for(var r=e[0][0],s=e[0][0],n=e[0][1],a=e[0][1],o=1;os&&(s=l[0]),l[1]a&&(a=l[1])}t[0]=r,t[1]=n,i[0]=s,i[1]=a}}cubeBezier(e,t,i,r,s,n){var a=new Jn,o=[];a.cubicExtrema(e[0],t[0],i[0],r[0],o);for(let s=0;ss&&!n?s+=2*Math.PI:rr&&(c[0]=Math.cos(p)*i+e,c[1]=Math.sin(p)*i+t,l.min(a,c,a),l.max(o,c,o))}},Hn.Util_curve=new Jn,Hn.Util_env=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Env";var e,t,i,r,s,n,a,o,l,h,u,c,d,p,f,m,y,g,v,b,_,S=this;return e=navigator.userAgent,t=S.os={},i=S.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),s=e.match(/(Android);?[\s\/]+([\d.]+)?/),n=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),o=!n&&e.match(/(iPhone\sOS)\s([\d_]+)/),l=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),h=l&&e.match(/TouchPad/),u=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),d=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),f=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),m=e.match(/PlayBook/),y=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!y,_=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!y,(i.webkit=!!r)&&(i.version=r[1]),s&&(t.android=!0,t.version=s[2]),o&&!a&&(t.ios=t.iphone=!0,t.version=o[2].replace(/_/g,".")),n&&(t.ios=t.ipad=!0,t.version=n[2].replace(/_/g,".")),a&&(t.ios=t.ipod=!0,t.version=a[3]?a[3].replace(/_/g,"."):null),l&&(t.webos=!0,t.version=l[2]),h&&(t.touchpad=!0),d&&(t.blackberry=!0,t.version=d[2]),p&&(t.bb10=!0,t.version=p[2]),f&&(t.rimtabletos=!0,t.version=f[2]),m&&(i.playbook=!0),u&&(t.kindle=!0,t.version=u[1]),c&&(i.silk=!0,i.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(i.silk=!0),y&&(i.chrome=!0,i.version=y[1]),g&&(i.firefox=!0,i.version=g[1]),v&&(i.ie=!0,i.version=v[1]),b&&(e.match(/Safari/)||t.ios)&&(i.safari=!0),_&&(i.webview=!0),v&&(i.ie=!0,i.version=v[1]),t.tablet=!!(n||m||s&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(s||o||l||d||p||y&&e.match(/Android/)||y&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:i,os:t,canvasSupported:!!document.createElement("canvas").getContext}}destory(){return!0}},Hn.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}},Hn.Util_http=new class{constructor(){this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Http"}get(e,t,i){if("object"==typeof e){var r=e;e=r.url,t=r.onsuccess,i=r.onerror}var s=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");s.open("GET",e,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status>=200&&s.status<300||304===s.status?t&&t(s.responseText):i&&i(),s.onreadystatechange=new Function,s=null)},s.send(null)}},Hn.Util_log=new class{constructor(){return this.CLASS_NAME="SuperMap.LevelRenderer.Tool.Log",function(){if(0!=+qn.debugMode)if(1==+qn.debugMode)for(let e in arguments)throw new Error(arguments[e]);else if(+qn.debugMode>1)for(let e in arguments)console.log(arguments[e])}}destory(){return!0}},Hn.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}},Hn.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,i){return e[0]=t[0]*i[0]+t[2]*i[1],e[1]=t[1]*i[0]+t[3]*i[1],e[2]=t[0]*i[2]+t[2]*i[3],e[3]=t[1]*i[2]+t[3]*i[3],e[4]=t[0]*i[4]+t[2]*i[5]+t[4],e[5]=t[1]*i[4]+t[3]*i[5]+t[5],e}translate(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e}rotate(e,t,i){var r=t[0],s=t[2],n=t[4],a=t[1],o=t[3],l=t[5],h=Math.sin(i),u=Math.cos(i);return e[0]=r*u+a*h,e[1]=-r*h+a*u,e[2]=s*u+o*h,e[3]=-s*h+u*o,e[4]=u*n+h*l,e[5]=u*l-h*n,e}scale(e,t,i){var r=i[0],s=i[1];return e[0]=t[0]*r,e[1]=t[1]*s,e[2]=t[2]*r,e[3]=t[3]*s,e[4]=t[4]*r,e[5]=t[5]*s,e}invert(e,t){var i=t[0],r=t[2],s=t[4],n=t[1],a=t[3],o=t[5],l=i*a-n*r;return l?(l=1/l,e[0]=a*l,e[1]=-n*l,e[2]=-r*l,e[3]=i*l,e[4]=(r*o-a*s)*l,e[5]=(n*s-i*o)*l,e):null}mulVector(e,t,i){var r=t[0],s=t[2],n=t[4],a=t[1],o=t[3],l=t[5];return e[0]=i[0]*r+i[1]*s+n,e[1]=i[0]*a+i[1]*o+l,e}},Hn.Util=new xn,Hn.Util_vector=new Vn;class Wn{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=Hn.Util_vector.create(),function(t){this.transform||(this.transform=Hn.Util_matrix.create());var i=this.transform;function r(e){return e>-5e-5&&e<5e-5}Hn.Util_vector.sub(e,t,this.position),r(e[0])&&r(e[1])||(Hn.Util_vector.normalize(e,e),i[2]=e[0]*this.scale[1],i[3]=e[1]*this.scale[1],i[0]=e[1]*this.scale[0],i[1]=-e[0]*this.scale[0],i[4]=this.position[0],i[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||Hn.Util_matrix.create();if(Hn.Util_matrix.identity(t),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;let r=i(e[0])||i(e[1]);r&&Hn.Util_matrix.translate(t,t,e),Hn.Util_matrix.scale(t,t,this.scale),r&&(e[0]=-e[0],e[1]=-e[1],Hn.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 r=i(e[0])||i(e[1]);r&&Hn.Util_matrix.translate(t,t,e),Hn.Util_matrix.rotate(t,t,this.rotation[0]),r&&(e[0]=-e[0],e[1]=-e[1],Hn.Util_matrix.translate(t,t,e))}}else 0!=+this.rotation&&Hn.Util_matrix.rotate(t,t,this.rotation);(i(this.position[0])||i(this.position[1]))&&Hn.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Hn.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Hn.Util_matrix.copy(this.transform,this.parent.transform))}function i(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],i=this.position,r=this.scale,s=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)),i[0]=e[4],i[1]=e[5],r[0]=t,r[1]=n,r[2]=r[3]=0,s[0]=Math.atan2(-e[1]/n,e[0]/t),s[1]=s[2]=0}function a(e){return e>5e-5||e<-5e-5}}}class Yn extends(J(zn,Wn)){constructor(e){var t;super(e),e=e||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,ee.extend(this,e),this.id=this.id||ee.createUniqueID("smShape_"),this.CLASS_NAME="SuperMap.LevelRenderer.Shape",this.getTansform=(t=[],function(e,i){var r=[e,i];return this.needTransform&&this.transform&&(Hn.Util_matrix.invert(t,this.transform),Hn.Util_matrix.mulVector(r,t,[e,i,1]),e==r[0]&&i==r[1]&&this.updateNeedTransform()),r})}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(e,t){var i=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,i),i.brushType){case"both":this.setCtxGlobalAlpha(e,"fill",i),e.fill(),i.lineWidth>0&&(this.setCtxGlobalAlpha(e,"stroke",i),e.stroke()),this.setCtxGlobalAlpha(e,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",i),i.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",i);break;default:this.setCtxGlobalAlpha(e,"fill",i),e.fill(),this.setCtxGlobalAlpha(e,"reset",i)}this.drawText(e,i,this.style),this.afterBrush(e)}beforeBrush(e,t){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),t&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i}afterBrush(e){e.restore()}setContext(e,t){for(var i=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],r=0,s=i.length;r=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height&&Hn.Util_area.isInside(this,this.style,e,t)}drawText(e,t,i){if(void 0!==t.text&&!1!==t.text){var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var s,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=(i||t).__rect||this.getRect(i||t);switch(h){case"inside":a=c.x+c.width/2,o=c.y+c.height/2,s="center",n="middle","stroke"!=t.brushType&&r==t.color&&(e.fillStyle="#fff");break;case"left":a=c.x-l,o=c.y+c.height/2,s="end",n="middle";break;case"right":a=c.x+c.width+l,o=c.y+c.height/2,s="start",n="middle";break;case"top":a=c.x+c.width/2,o=c.y-l,s="center",n="bottom";break;case"bottom":a=c.x+c.width/2,o=c.y+c.height+l,s="center",n="top"}}break;case"start":case"end":var d=0,p=0,f=0,m=0;if(void 0!==t.pointList){var y=t.pointList;if(y.length<2)return;var g=y.length;switch(h){case"start":d=y[0][0]+u[0],p=y[1][0]+u[0],f=y[0][1]+u[1],m=y[1][1]+u[1];break;case"end":d=y[g-2][0]+u[0],p=y[g-1][0]+u[0],f=y[g-2][1]+u[1],m=y[g-1][1]+u[1]}}else d=t.xStart+u[0]||0,p=t.xEnd+u[0]||0,f=t.yStart+u[1]||0,m=t.yEnd+u[1]||0;switch(h){case"start":s=dr&&(r=l[0]),l[1]s&&(s=l[1]))}return e.__rect={x:t,y:i,width:r-t,height:s-i},e.__rect}getRectNoRotation(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,i=this.refOriginalPosition,r=Hn.Util_area.getTextHeight("ZH",e.textFont),s=Hn.Util_area.getTextWidth(e.text,e.textFont),n=Hn.Util_area.getTextHeight(e.text,e.textFont),a=e.x+i[0];"end"==e.textAlign||"right"==e.textAlign?a-=s:"center"==e.textAlign&&(a-=s/2),t="top"==e.textBaseline?e.y+i[1]:"bottom"==e.textBaseline?e.y+i[1]-n:e.y+i[1]-n/2;var o,l=!1;if(e.maxWidth){var h=parseInt(e.maxWidth);h-1&&(s+=!0===l?r/3*(s/o):r/3));return{x:a,y:t,width:s,height:n}}getTextBackground(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var r=this.getRectNoRotation(e),s=e.x+i[0],n=e.y+i[1],a=[];if(e.textRotation&&0!==e.textRotation){let t=e.textRotation,i=this.getRotatedLocation(r.x,r.y,s,n,t),o=this.getRotatedLocation(r.x+r.width,r.y,s,n,t),l=this.getRotatedLocation(r.x+r.width,r.y+r.height,s,n,t),h=this.getRotatedLocation(r.x,r.y+r.height,s,n,t);a.push(i),a.push(o),a.push(l),a.push(h)}else{let e=[r.x,r.y],t=[r.x+r.width,r.y],i=[r.x+r.width,r.y+r.height],s=[r.x,r.y+r.height];a.push(e),a.push(t),a.push(i),a.push(s)}return e.__textBackground=a,e.__textBackground}getRotatedLocation(e,t,i,r,s){var n,a,o=new Array;return t=-t,r=-r,s=-s,n=(e-i)*Math.cos(s/180*Math.PI)-(t-r)*Math.sin(s/180*Math.PI)+i,a=(e-i)*Math.sin(s/180*Math.PI)+(t-r)*Math.cos(s/180*Math.PI)+r,o[0]=n,o[1]=-a,o}}class Zn extends Yn{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 i=this.refOriginalPosition,r=t.x+i[0],s=t.y+i[1];return e.moveTo(r+t.r,s),e.arc(r,s,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,i=this.refOriginalPosition,r=e.x+i[0],s=e.y+i[1],n=e.r;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(r-n-t/2),y:Math.round(s-n-t/2),width:2*n+t,height:2*n+t},e.__rect}}class Kn extends Yn{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 i=this.style;t&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),e.save(),this.setContext(e,i),this.setTransform(e);var r=!1;"fill"!=i.brushType&&"both"!=i.brushType&&void 0!==i.brushType||(e.beginPath(),"dashed"==i.lineType||"dotted"==i.lineType||"dot"==i.lineType||"dash"==i.lineType||"dashdot"==i.lineType||"longdash"==i.lineType||"longdashdot"==i.lineType?this.buildPath(e,{lineType:"solid",lineWidth:i.lineWidth,pointList:i.pointList}):(this.buildPath(e,i),r=!0),e.closePath(),this.setCtxGlobalAlpha(e,"fill",i),e.fill(),this.setCtxGlobalAlpha(e,"reset",i)),i.lineWidth>0&&("stroke"==i.brushType||"both"==i.brushType)&&(r||(e.beginPath(),this.buildPath(e,i)),this.setCtxGlobalAlpha(e,"stroke",i),e.stroke(),this.setCtxGlobalAlpha(e,"reset",i)),this.drawText(e,i,this.style);var s=ee.cloneObject(i);if(s.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var n=this.holePolygonPointLists,a=n.length,o=0;o0&&("stroke"==s.brushType||"both"==s.brushType)?(r||(e.beginPath(),this.buildPath(e,s)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",s),e.stroke(),this.setCtxGlobalAlpha(e,"reset",s)):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 i=this.refOriginalPosition,r=t.pointList;if(!(r.length<2))if(t.smooth&&"spline"!==t.smooth){var s,n,a,o=Hn.SUtil_smoothBezier(r,t.smooth,!0,t.smoothConstraint,i);e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(var l=r.length,h=0;hn&&(n=l[h][0]+i[0]),l[h][1]+i[1]o&&(o=l[h][1]+i[1]);return r="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(s-r/2),y:Math.round(a-r/2),width:n-s+r,height:o-a+r},e.__rect}}class $n extends Yn{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 i=this.refOriginalPosition,r=t.pointList;if(!(r.length<2)){var s=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var n,a,o,l=Hn.SUtil_smoothBezier(r,t.smooth,!1,t.smoothConstraint,i);e.moveTo(r[0][0]+i[0],r[0][1]+i[1]);for(let t=0;tu&&(i*=u/(a=i+r),r*=u/a),s+n>u&&(s*=u/(a=s+n),n*=u/a),r+s>c&&(r*=c/(a=r+s),s*=c/a),i+n>c&&(i*=c/(a=i+n),n*=c/a),e.moveTo(l+i,h),e.lineTo(l+u-r,h),0!==r&&e.quadraticCurveTo(l+u,h,l+u,h+r),e.lineTo(l+u,h+c-s),0!==s&&e.quadraticCurveTo(l+u,h+c,l+u-s,h+c),e.lineTo(l+n,h+c),0!==n&&e.quadraticCurveTo(l,h+c,l,h+c-n),e.lineTo(l,h+i),0!==i&&e.quadraticCurveTo(l,h,l+i,h)}buildPath(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+i[0],t.y+i[1]),e.lineTo(t.x+i[0]+t.width,t.y+i[1]),e.lineTo(t.x+i[0]+t.width,t.y+i[1]+t.height),e.lineTo(t.x+i[0],t.y+i[1]+t.height),e.lineTo(t.x+i[0],t.y+i[1])),e.closePath()}getRect(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,i=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+i[0]-t/2),y:Math.round(e.y+i[1]-t/2),width:e.width+t,height:e.height+t},e.__rect)}}class ia extends Yn{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 i=this.refOriginalPosition,r=t.x+i[0],s=t.y+i[1],n=t.r0||0,a=t.r,o=t.startAngle,l=t.endAngle,h=t.clockWise||!1;o=Hn.Util_math.degreeToRadian(o),l=Hn.Util_math.degreeToRadian(l),h||(o=-o,l=-l);var u=Hn.Util_math.cos(o),c=Hn.Util_math.sin(o);e.moveTo(u*n+r,c*n+s),e.lineTo(u*a+r,c*a+s),e.arc(r,s,a,o,l,!h),e.lineTo(Hn.Util_math.cos(l)*n+r,Hn.Util_math.sin(l)*n+s),0!==n&&e.arc(r,s,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,i=Hn.Util_vector.create(),r=Hn.Util_vector.create(),s=Hn.Util_vector.create(),n=Hn.Util_vector.create(),a=e.x+t[0],o=e.y+t[1],l=e.r0||0,h=e.r,u=Hn.Util_math.degreeToRadian(e.startAngle),c=Hn.Util_math.degreeToRadian(e.endAngle),d=e.clockWise;return d||(u=-u,c=-c),l>1?Hn.Util_computeBoundingBox.arc(a,o,l,u,c,!d,i,s):(i[0]=s[0]=a,i[1]=s[1]=o),Hn.Util_computeBoundingBox.arc(a,o,h,u,c,!d,r,n),Hn.Util_vector.min(i,i,r),Hn.Util_vector.max(s,s,n),e.__rect={x:i[0],y:i[1],width:s[0]-i[0],height:s[1]-i[1]},e.__rect}}class ra{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 Fn){let e=new Object;e.x=t.x,e.y=t.y,e.r=t.r,e=ee.copyAttributesWithClip(e,t.style,["x","y"]);let i=new Xn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","style","highlightStyle"]),i}if(t instanceof kn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=ee.copyAttributesWithClip(e,t.style,["pointList"]);let i=new $n;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}if(t instanceof Dn){if(!t.pointList)return null;let e=new Object;e.pointList=t.pointList,e=ee.copyAttributesWithClip(e,t.style,["pointList"]);let i=new Kn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["pointList","style","highlightStyle"]),i}if(t instanceof Rn){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=ee.copyAttributesWithClip(e,t.style,["x","y","width","height"]);let i=new ta;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","width","height","style","highlightStyle"]),i}if(t instanceof Bn){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=ee.copyAttributesWithClip(e,t.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new ia;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}if(t instanceof Gn){let e=new Object;e.x=t.x,e.y=t.y,e.text=t.text,e=ee.copyAttributesWithClip(e,t.style,["x","y","text"]);let i=new Qn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","text","style","highlightStyle"]),i}if(t instanceof Un){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=ee.copyAttributesWithClip(e,t.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new ea;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","image","width","height","style","highlightStyle"]),i}if(t instanceof jn){let e=new Object;e.x=t.x,e.r=t.r,e.y=t.y,e=ee.copyAttributesWithClip(e,t.style,["x","y","r"]);let i=new Zn;return i.style=ra.transformStyle(e),i.highlightStyle=ra.transformStyle(t.highlightStyle),ee.copyAttributesWithClip(i,t,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(e){var t={},i=["normal","normal","normal","12","arial,sans-serif"],r=[!0,!1];for(var s in e)switch(s){case"fill":r[0]=e[s];break;case"fillColor":t.color=e[s];break;case"stroke":r[1]=e[s];break;case"strokeWidth":t.lineWidth=e[s];break;case"strokeLinecap":t.lineCap=e[s];break;case"strokeLineJoin":t.lineJoin=e[s];break;case"strokeDashstyle":t.lineType=e[s];break;case"pointRadius":t.r=e[s];break;case"label":t.text=e[s];break;case"labelRect":t.labelRect=e[s];break;case"fontColor":t.textColor=e[s];break;case"fontStyle":i[0]=e[s];break;case"fontVariant":i[1]=e[s];break;case"fontWeight":i[2]=e[s];break;case"fontSize":var n="";e[s]&&e[s].toString().indexOf("px")<0&&(n="px"),i[3]=e[s]+n;break;case"fontFamily":i[4]=e[s];break;case"fontOpacity":t.opacity=e[s];break;case"labelPosition":t.textPosition=e[s];break;case"labelAlign":t.textAlign=e[s];break;case"labelBaseline":t.textBaseline=e[s];break;case"labelRotation":t.textRotation=e[s];break;default:t[s]=e[s]}return t.textFont=i.join(" "),!0===r[0]&&!1===r[1]?t.brushType="fill":!1===r[0]&&!0===r[1]?t.brushType="stroke":!0===r[0]&&!0===r[1]?t.brushType="both":t.brushType="fill",null==t.lineWidth&&(t.lineWidth=1),t}static Background(e,t,i){var r=i||{},s=new Rn(t[0],t[3],Math.abs(t[2]-t[0]),Math.abs(t[3]-t[1]));return s.style={fillColor:"#f3f3f3"},r.backgroundStyle&&ee.copyAttributesWithClip(s.style,r.backgroundStyle),r.backgroundRadius&&(s.style.radius=r.backgroundRadius),s.clickable=!1,s.hoverable=!1,e.createShape(s)}static GraphAxis(e,t,i,r){var s=t,n=i||{},a=[],o=[],l=!!n.useXReferenceLine&&n.useXReferenceLine,h=n.axisYTick&&!isNaN(n.axisYTick)?n.axisYTick:0,u=[],c=[];if(0==h){if(c.push([s[0],s[3]-5]),c.push([s[0],s[1]]),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){let e=parseInt(n.axis3DParameter),t=[s[0]-e,s[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([s[0],s[1]])}c.push([s[2]+5,s[1]])}else{var d=Math.abs(s[1]-s[3])/h,p=s[3];c.push([s[0],p-5]);for(var f=0;f=15){let e=parseInt(n.axis3DParameter),t=[s[0]-e,s[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([s[0],s[1]])}c.push([s[2]+5,s[1]])}if(n.axisUseArrow){var y=[[s[2]+5,s[1]+4],[s[2]+13,s[1]],[s[2]+5,s[1]-4]],g=[[s[0]-4,s[3]-5],[s[0],s[3]-13],[s[0]+4,s[3]-5]],v=new Dn(y);v.style={fillColor:"#008acd"},ee.copyAttributesWithClip(v.style,n.axisStyle),o.push(e.createShape(v));var b=new Dn(g);if(b.style={fillColor:"#008acd"},ee.copyAttributesWithClip(b.style,n.axisStyle),o.push(e.createShape(b)),n.axis3DParameter&&!isNaN(n.axis3DParameter)&&n.axis3DParameter>=15){var _=new Dn(u);_.style={fillColor:"#008acd"},ee.copyAttributesWithClip(_.style,n.axisStyle),o.push(e.createShape(_))}}var S=new kn(c);S.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},n.axisStyle&&ee.copyAttributesWithClip(S.style,n.axisStyle),S.clickable=!1,S.hoverable=!1;var x=[e.createShape(S)],w=[];if(n.axisYLabels&&n.axisYLabels.length&&n.axisYLabels.length>0){var C=n.axisYLabels;let t=C.length;var M=[0,0];if(n.axisYLabelsOffset&&n.axisYLabelsOffset.length&&(M=n.axisYLabelsOffset),1==t){let t=new Gn(s[0]-5+M[0],s[3]+M[1],C[0]);t.style={labelAlign:"right"},n.axisYLabelsStyle&&ee.copyAttributesWithClip(t.style,n.axisYLabelsStyle),t.clickable=!1,t.hoverable=!1,w.push(e.createShape(t))}else for(var A=s[3],T=Math.abs(s[1]-s[3])/(t-1),E=0;E0){let t=n.axisXLabels,i=t.length,a=[0,0];if(n.axisXLabelsOffset&&n.axisXLabelsOffset.length&&(a=n.axisXLabelsOffset),r&&r.xPositions&&r.xPositions.length&&r.xPositions.length==i){let o=r.xPositions;for(let r=0;r=0&&i[s]&&ee.copyAttributesWithClip(a,i[s]),r&&r.length&&void 0!==n)for(var o=r,l=o.length,h=parseFloat(n),u=0;u=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}resetLocation(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var i=this.width,r=this.height,s=this.location;return this.chartBounds=new se(s[0]-i/2,s[1]+r/2,s[0]+i/2,s[1]-r/2),this.resetLinearGradient(),s}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var e=this.shapes,t=this.location,i=0,r=e.length;i=0?r.push(parseFloat(s[a].toString()).toFixed(i)):r.push(parseFloat(s[a].toString()))}catch(e){throw new Error("not a number")}return r.length===t.length&&r};class aa extends na{constructor(e,t,i,r,s,n){super(e,t,i,r,s,n),this.setting=null,r&&r.codomain&&(this.setting=r,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,i=this.height,r=this.location;this.origonPoint=[r[0]-t/2,r[1]-i/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+i,s[0]+t,s[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]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}}class oa extends sa{constructor(e,t,i,r,s){if(super(e,t),e.geometry&&e.geometry instanceof X){this.dataBounds=e.geometry.getBounds(),this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=i||{},this.CLASS_NAME="SuperMap.Feature.Theme.Vector",this.style=i||{},r&&ee.copyAttributesWithClip(this,r,["shapeOptions","dataBounds"]),s&&ee.copyAttributesWithClip(this.shapeOptions,s);var n=e.geometry;this.lonlat=this.dataBounds.getCenterLonLat(),this.location=this.getLocalXY(this.lonlat),n instanceof ce?this.lineToTF(n):n instanceof he?this.lineToTF(n):n instanceof oe||(n instanceof ae?this.multiPointToTF(n):n instanceof de?this.multiLineStringToTF(n):n instanceof pe?this.multiPolygonToTF(n):n instanceof fe?this.polygonToTF(n):n instanceof ne||(n instanceof le?this.pointToTF(n):n instanceof me?this.rectangleToTF(n):n instanceof ue&&this.geoTextToTF(n)))}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}lineToTF(e){for(var t=e.components,i=[],r=[],s=this.location,n=[],a=this.nodesClipPixel,o=0;o0){var h=n[n.length-1];if(Math.abs(h[0]-r[0])<=a&&Math.abs(h[1]-r[1])<=a)continue}n.push(r)}if(n.length<2)return null;var u=new Object;(u=ee.copyAttributesWithClip(u,this.style,["pointList"])).pointList=n;var c=new $n({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&&ee.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}multiPointToTF(e){for(var t=e.components,i=[],r=[],s=this.location,n=[],a=this.nodesClipPixel,o=0;o0){var h=n[n.length-1];if(Math.abs(h[0]-r[0])<=a&&Math.abs(h[1]-r[1])<=a)continue}n.push(r);var u=new Object;u.r=6,(u=ee.copyAttributesWithClip(u,this.style)).x=r[0],u.y=r[1];var c=new Xn({style:u,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(c.highlightStyle=this.highlightStyle),c.refOriginalPosition=s,c.refDataID=this.data.id,c.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(c,this.shapeOptions),this.shapes.push(c)}}multiLineStringToTF(e){for(var t=e.components,i=0;i0){var d=n[n.length-1];if(Math.abs(d[0]-r[0])<=l&&Math.abs(d[1]-r[1])<=l)continue}n.push(r)}}else{a=[];for(var p=0;p0){var f=a[a.length-1];if(Math.abs(f[0]-r[0])<=l&&Math.abs(f[1]-r[1])<=l)continue}a.push(r)}}a.length<2||o.push(a)}if(!(n.length<2)){var m={};(m=ee.copyAttributesWithClip(m,this.style,["pointList"])).pointList=n;var y=new Kn({style:m,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(y.highlightStyle=this.highlightStyle),y.refOriginalPosition=this.location,y.refDataID=this.data.id,y.isHoverByRefDataID=this.isMultiHover,o.length>0&&(y.holePolygonPointLists=o),this.shapeOptions&&ee.copyAttributesWithClip(y,this.shapeOptions),this.shapes.push(y)}}rectangleToTF(e){var t=this.location,i=new re(e.x,e.y),r=this.layer.map.getResolution(),s=this.getLocalXY(i),n=new Object;n.r=6,(n=ee.copyAttributesWithClip(n,this.style)).x=s[0]-t[0],n.y=s[1]-t[1]-2*e.width/r,n.width=e.width/r,n.height=e.height/r;var a=new ta({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&&ee.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}geoTextToTF(e){var t=this.location,i=this.getLocalXY(e),r=new Object;r.r=6,(r=ee.copyAttributesWithClip(r,this.style,["x","y","text"])).x=i[0]-t[0],r.y=i[1]-t[1],r.text=e.text;var s=new Qn({style:r,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(s.highlightStyle=this.highlightStyle),s.refOriginalPosition=t,s.refDataID=this.data.id,s.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&ee.copyAttributesWithClip(s,this.shapeOptions),this.shapes.push(s)}updateAndAddShapes(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,i=0,r=this.shapes.length;i0}addRoot(e){e instanceof la&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}delRoot(e){if(void 0===e){for(var t=0;t=0&&(this.delFromMap(s.id),this._roots.splice(n,1),s instanceof la&&s.delChildrenFromStorage(this))}}addToMap(e){return e instanceof la&&(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 la&&(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 ua{constructor(e,t){this.root=e,this.storage=t,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,ua.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="SuperMap.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",this.root.appendChild(i),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=ua.createDom(ee.createUniqueID("SuperMap.Theme_background_"),"div",this),i.appendChild(this._bgDom),this._bgDom.onselectstart=n,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var r=new ca(ee.createUniqueID("_highLightLayer_"),this);this._layers.hover=r,i.appendChild(r.dom),r.initContext(),r.dom.onselectstart=n,r.dom.style["-webkit-user-select"]="none",r.dom.style["user-select"]="none",r.dom.style["-webkit-touch-callout"]="none";var s=this;function n(){return!1}this.updatePainter=function(e,t){s.refreshShapes(e,t)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(e){return this.refresh(e,!0),this}refresh(e,t){var i=this.storage.getShapeList(!0);return this._paintList(i,t),"function"==typeof e&&e(),this}_paintList(e,t){var i,r,s;for(var n in void 0===t&&(t=!1),this._updateLayerStatus(e),this._layers)"hover"!==n&&(this._layers[n].unusedCount++,this._layers[n].updateTransform());for(var a=[],o=0,l=e.length;o0&&e>this._zlevelList[0]){for(s=0;se);s++);r=this._layers[this._zlevelList[s]]}this._zlevelList.splice(s+1,0,e),t=new ca(ee.createUniqueID("_levelLayer_"+e),this);var n=r?r.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 xn).merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}getLayers(){return this._layers}_updateLayerStatus(e){var t=this._layers,i={};for(let e in t)"hover"!==e&&(i[e]=t[e].elCount,t[e].elCount=0);for(let i=0;i0?1.1:1/1.1,i=this.painter.getLayers(),r=!1;for(var s in i)if("hover"!==s){var n=i[s],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,r=!0}}r&&this.painter.refresh(),this._dispatchAgency(this._lastHover,qn.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=Hn.Util_event.getX(e),this._mouseY=Hn.Util_event.getY(e);var t=this._mouseX-this._lastX,i=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 r="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var s=this.painter.getLayers(),n=!1;for(var a in s)if("hover"!==a){var o=s[a];o.panable&&(r="move",o.position[0]+=t,o.position[1]+=i,n=!0,o.dirty=!0)}n&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?r="move":this._hasfound&&this._lastHover.clickable&&(r="pointer"),this.root.style.cursor=r,this._dispatchAgency(this._lastHover,qn.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(qn.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,qn.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,qn.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&&Hn.Util_event.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;s--){var n=i[s];if(void 0!==n.zlevel&&(e=this.painter.getLayer(n.zlevel,e),r[0]=this._mouseX,r[1]=this._mouseY,e.needTransform&&(Hn.Util_matrix.invert(t,e.transform),Hn.Util_vector.applyTransform(r,r,t))),this._findHover(n,r[0],r[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 i=0;!this._lastHover&&i=0&&this._clips.splice(t,1)}_update(){var e=(new Date).getTime(),t=e-this._time,i=this._clips,r=i.length,s=[],n=[];for(let t=0;t=0&&!(m[b]<=a);b--);b=Math.min(b,h-2)}else{for(b=M;ba);b++);b=Math.min(b-1,h-2)}M=b,A=a;var o=m[b+1]-m[b];if(0!==o){if(_=(a-m[b])/o,n)if(x=y[b],S=y[0===b?b:b-1],w=y[b>h-2?h-1:b+1],C=y[b>h-3?h-1:b+2],c)ma._catmullRomInterpolateArray(S,x,w,C,_,_*_,_*_*_,r(e,l),p);else{let t;t=d?ma.rgba2String(T):ma._catmullRomInterpolate(S,x,w,C,_,_*_,_*_*_),i(e,l,t)}else if(c)ma._interpolateArray(y[b],y[b+1],_,r(e,l),p);else{let t;d?(ma._interpolateArray(y[b],y[b+1],_,T,1),t=ma.rgba2String(T)):t=ma._interpolateNumber(y[b],y[b+1],_),i(e,l,t)}for(b=0;b0){let e=n.SheetNames[0],i=Aa.utils.sheet_to_csv(n.Sheets[e]);t&&t.call(r,i)}}catch(e){i&&i.call(r,e)}},s.onerror=function(e){i&&i.call(r,e)},this.rABF&&s.readAsArrayBuffer(e.file)},processDataToGeoJson(e,t,i,r,s){let n=null;if("EXCEL"===e||"CSV"===e)n=this.processExcelDataToGeoJson(t),i&&i.call(s,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:r&&r.call(s,Ma.i18n("msg_dataInWrongGeoJSONFormat")),i&&i.call(s,n)}else r&&r.call(s,Ma.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson(e){let t=this.string2Csv(e),i=t.colTitles,r=-1,s=-1;for(let e=0,t=i.length;ee.json()).then(r=>{if(!1!==r.succeed)if(r.dataItemServices&&r.dataItemServices.length>0){let s;r.dataItemServices.forEach(r=>{if("RESTDATA"===r.serviceType&&"PUBLISHED"===r.serviceStatus)s=r;else{if("RESTMAP"!==r.serviceType||"PUBLISHED"!==r.serviceStatus)return void i.getDatafromContent(e,t);s=r}}),s&&i.getDatafromRest(s.serviceType,s.address,t)}else i.getDatafromContent(e,t);else i._fireFailedEvent(r)}).catch(e=>{console.log(e),i._fireFailedEvent(e)})}getDatafromContent(e,t){let i={result:{}},r=this;e+="/content.json?pageSize=9999999¤tPage=1",Ue.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(Ma.i18n("msg_jsonResolveFiled"));let t=this._formatGeoJSON(e.content);i.result.features={type:e.content.type,features:t}}else if("EXCEL"===e.type||"CSV"===e.type){let t=this._excelData2Feature(e.content);i.result.features={type:"FeatureCollection",features:t}}t(i,"content")}}else r._fireFailedEvent(e)},this).catch(e=>{console.log(e),r._fireFailedEvent(e)})}getDatafromRest(e,t,i){let r=this,s=this.datasets.withCredentials;if("RESTDATA"===e){let e,n,a=`${t}/data/datasources`;Ue.get(a,null,{withCredentials:s}).then(e=>e.json()).then(o=>{e=o.datasourceNames[0],a=`${t}/data/datasources/${e}/datasets`,Ue.get(a,null,{withCredentials:s}).then(e=>e.json()).then(s=>(n=s.datasetNames[0],r.getDatafromRestData(`${t}/data`,[e+":"+n],i),[e+":"+n])).catch(function(e){r._fireFailedEvent(e)})}).catch(function(e){r._fireFailedEvent(e)})}else{let e,n,a,o=`${t}/maps`;Ue.get(o,null,{withCredentials:s}).then(e=>e.json()).then(l=>{e=l[0].name,a=l[0].path,o=o=`${t}/maps/${e}/layers`,Ue.get(o,null,{withCredentials:s}).then(e=>e.json()).then(e=>(n=e[0].subLayers.layers[0].caption,r.getDatafromRestMap(n,a,i),n)).catch(function(e){r._fireFailedEvent(e)})}).catch(function(e){r._fireFailedEvent(e)})}}getDatafromRestData(e,t,i){let r=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,e=>{i(e,"RESTDATA")},e=>{console.log(e),r._fireFailedEvent(e)})}getDatafromRestMap(e,t,i){let r=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,e=>{i(e,"RESTMAP")},e=>{console.log(e),r._fireFailedEvent(e)})}_getFeatureBySQL(e,t,i,r,s){let n,a,o,l={name:t.join().replace(":","@")};Object.assign(l,i),n=new ft(l),o=new Ji({queryParameter:n,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),(a=new qi(e,{eventListeners:{processCompleted:e=>{r&&r(e)},processFailed:e=>{s&&s(e)}}})).processAsync(o)}_queryFeatureBySQL(e,t,i,r,s,a,o,l,h,u){var c,d,p={name:t};Object.assign(p,i),c=new ft(p),r&&(c.fields=r);var f={queryParams:[c]};u&&(f.queryOption=n.ATTRIBUTE),l&&(f.startRecord=l),h&&(f.expectCount=h),s&&(f.prjCoordSys={epsgCode:s}),d=new Xr(f),this._queryBySQL(e,d,e=>{"processCompleted"===e.type?a(e):o(e)})}_queryBySQL(e,t,i,r){new Qr(e,{eventListeners:{scope:this,processCompleted:i,processFailed:i},format:this._processFormat(r)}).processAsync(t)}_processFormat(e){return e||t.GEOJSON}_formatGeoJSON(e){let t=e.features;return t.forEach((e,t)=>{e.properties.index=t}),t}_excelData2Feature(e){let t=e.colTitles,i=-1,r=-1;for(let e=0,s=t.length;e0&&e.forEach(function(e){e.xAxis&&t.xField.push({field:e.xAxis.field,name:e.xAxis.name}),e.yAxis&&t.yField.push({field:e.yAxis.field,name:e.yAxis.name})})}getDatasetInfo(e){this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new Ea(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:e=>{this.events.triggerEvent("getdatafailed",e)}}))}_getDatasetInfoSuccess(e){let t=this.datasets.url,i=t.indexOf("rest");if(i>0){let r=t.indexOf("/",i+5),s=t.substring(i+5,r),n=t.substring(0,i+4)+"/data";if("maps"===s){let s=t.indexOf("/",r+1),a=t.substring(r+1,s);n=t.substring(0,i+4)+"/maps/"+a,e.result.dataUrl=n,this._getLayerFeatures(e)}else"data"===s&&(e.result.dataUrl=n,this._getDataFeatures(e))}}_getDataInfoSuccess(e,t){let i=this;"RESTMAP"===t?i._getChartDatasFromLayer(e):i._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,i={};if(t.length){let e=t[0],r=[],s=[];for(let t in e.properties)r.push(t),s.push(this._getDataType(e.properties[t]));i={features:t,fieldCaptions:r,fieldTypes:s,fieldValues:[]};for(let e in s){let r=[];for(let s in t){let n=t[s],a=i.fieldCaptions[e],o=n.properties[a];r.push(o)}i.fieldValues.push(r)}this.createChart(i)}}}_getChartDatasFromLayer(e){if(e.result.recordsets){let t=e.result.recordsets[0],i=t.features.features;this.features=t.features;let r={};if(i.length){r={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]};for(let e in r.fieldCaptions){let t=[];for(let s in i){let n=i[s],a=r.fieldCaptions[e],o=n.properties[a];t.push(o)}r.fieldValues.push(t)}this.createChart(r)}}}_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,i){this.updateChart=i,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 i=this.grid,r=this._createChartSeries(this.calculatedData,e),s=[];for(let e in this.calculatedData.XData)s.push({value:this.calculatedData.XData[e].fieldsData});let n={type:"category",name:this.xField[0].name||"X",data:s,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&&(i=t.grid),t.tooltip&&(o=t.tooltip),t.backgroundColor&&(l=t.backgroundColor)),{backgroundColor:l,grid:i,series:r,xAxis:n,yAxis:a,tooltip:o}}}_createChartDatas(e){let t=0,i=[],r=e.fieldCaptions,s=this;r.forEach(function(e,i){s.xField[0]&&e===s.xField[0].field&&(t=i)}),this.yFieldName="",this.yField.forEach(function(e,t){0!==t&&(s.yFieldName=s.yFieldName+","),s.yFieldName=s.yFieldName+e.name,r.forEach(function(t,r){t===e.field&&i.push(r)})});let n=this._getAttrData(e,t),a=[];if(i.length>0)i.forEach(function(t){let i=[];for(let r in e.fieldValues[t])i.push({value:e.fieldValues[t][r]});a.push(i)});else{let e=[],t=[],i=n.length;for(let r=0;r0;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{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 i=document.createElement("div"),r=document.createElement("div");r.setAttribute("class","component-citytabpag__py-key"),r.innerHTML=e,i.appendChild(r);const s=document.createElement("div");s.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 i=document.createElement("li");i.setAttribute("class","disable");const r=document.createElement("span");i.appendChild(r),0===t?(r.id="first",r.setAttribute("class","supermapol-icons-first")):1===t?(r.id="prev",r.setAttribute("class","supermapol-icons-prev")):2===t?(r.id="next",r.setAttribute("class","supermapol-icons-next")):3===t&&(r.id="last",r.setAttribute("class","supermapol-icons-last")),e.appendChild(i)}}_changePageEvent(e){const t=e.target;if("disable"===t.parentElement.classList[0])return;let i;if(t.id)i=t.id;else{if(!Number(t.innerHTML))return;i=Number(t.innerHTML)}this._prePageNum(i),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)}}let Ua={getFileType:e=>/^.*\.(?:xls|xlsx)$/i.test(e)?Sa.EXCEL:/^.*\.(?:csv)$/i.test(e)?Sa.CSV:/^.*\.(?:geojson|json)$/i.test(e)?Sa.GEOJSON:null};var ja=i(618),za=i.n(ja);function Va(e,t){const i=t&&t.styles&&t.styles.style,r=t&&t.captionFields&&t.captionFields.captionField,s={nodes:[],edges:[]};return e.forEach(e=>{const t=e.path;if(t){const{nodes:e,edges:n}=function(e,t,i){const r={nodes:[],edges:[]};return e.forEach(e=>{if(qa(e)){const i=Wa(e,t);r.edges.push(i)}else{const s=Ha(e,t,i);r.nodes.push(s)}}),r}(t,i,r);s.nodes.push(...e),s.edges.push(...n)}else if(qa(e)){const t=Wa(e,i);s.edges.push(t)}else{const t=Ha(e,i,r);s.nodes.push(t)}}),{nodes:Ja(s.nodes),edges:Ja(s.edges,"edgeId")}}function Ja(e,t="id"){return za()(e,t)}function qa(e){return e.hasOwnProperty("start")&&e.hasOwnProperty("end")}function Ha(e,t,i){const{id:r,properties:s,lables:n}=e,a=t?function(e,t){if(!t)return{};const{id:i,labels:r}=e,s=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 i=t.getType(),r=t.getModel();return i&&r&&"node"===i?this.isCollpased(r.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()}},i={type:"fruchterman",gravity:5},r={},s={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(Za().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:{...i,...t},defaultNode:r,defaultEdge:s,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={...i,...e.layout||{},...!1!==e.animate?t:{}},e.defaultNode={...r,...e.defaultNode||{}},e.defaultEdge={...s,...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(Za().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,i=e.scrollHeight;this.graph.changeSize(t,i),this.graph.refresh()})}zoom(e,t,i,r){this.graph.zoom(e,t,i,r)}zoomTo(e,t,i,r){this.graph.zoomTo(e,t,i,r)}fitView(e,t,i,r){this.graph.fitView(e,t,i,r)}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,i=this.graph.getHeight()/2,r=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-r.x,i-r.y)}_setToolBarStyle(){$a()("\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 i=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(i,"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 i=t.item;e.setAutoPaint(!1),e.getNodes().forEach(function(t){e.clearItemStates(t)}),e.setItemState(i,"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,i=this.graph){return i.getNeighbors(e,t)}findById(e,t=this.graph){return t.findById(e)}find(e,t,i=this.graph){return i.find(e,t)}findAll(e,t,i=this.graph){return i.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,i=[];this._collapseFunc(e,i),this.collpasedData[t]=i,this._expandCollapseNode(i)}isCollpased(e){return!!this.collpasedData[e]}_collapseFunc(e,t=[]){const i=this.getNeighbors(e,"target"),r=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,i=this.graph){i.showItem(e,t)}hideItem(e,t,i=this.graph){i.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,i=this.graph){i.addItem(e,t)}removeItem(e,t=this.graph){t.removeItem(e)}updateItem(e,t,i=this.graph){i.updateItem(e,t)}refreshItem(e,t=this.graph){t.refreshItem(e)}refreshPositions(e=this.graph){e.refreshPositions()}on(e,t,i=this.graph){i.on(e,t)}off(e,t,i=this.graph){i.off(e,t)}toDataURL(e,t,i=this.graph){i.toDataURL(e,t)}bindNodeDefaultDragEvent(e=this.graph){e.on("node:dragstart",function(e){to(e)}),e.on("node:drag",function(e){to(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 to(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 io=i(465),ro=i.n(io);class so{constructor(e,t="G6"){this.graph=null,this.config=ro()(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 Va(e,t)}static dataFromKnowledgeGraphQuery(e){return Va(e)}handleNodeStatus(e){const{expand:t,collapse:i,hidden:r}=e;this.expandNodes(t),this.collapseNodes(i),this.hideNodes(r)}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 eo)}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,i,r){this.graphRender.zoom(e,t,i,r)}zoomTo(e,t,i,r){this.graphRender.zoomTo(e,t,i,r)}fitView(e,t,i,r){this.graphRender.fitView(e,t,i,r)}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 i=t.labelCfg&&t.labelCfg.fontSize||this.defaultNode&&this.defaultNode.labelCfg&&this.defaultNode.labelCfg.fontSize||14;return t.label=function(e,t,i){const r=1*i;t*=1.6;if((e=>{let t=0;for(let i=0;i0&&e.charCodeAt(i)<128?t++:t+=2;return t})(e)*r>t){const i=Math.floor((t-20)/r),s=e.substring(0,i);return(e.substring(i).length+"…".length)*r>t?s+"\n"+e.substring(i,i+i-2)+"…":0==e.substring(i).length?s:s+"\n"+e.substring(i)}return e}(t.label,e,i),t}):t:[]}clear(e=this.graph){e&&e.clear()}destroy(e=this.graph){e&&e.destroy()}}e.Lang=Ma,e.i18n=e.Lang.i18n,e.Util={...e.Util,...ee},e.Browser=Q,e.INCHES_PER_UNIT=te,e.METERS_PER_INCH=ie,e.DOTS_PER_INCH=$,e.IS_GECKO=K,e.setCORS=function(e){ke=e},e.isCORS=Be,e.setRequestTimeout=function(e){return De=e},e.getRequestTimeout=Ge,e.FetchRequest=Ue,e.inherit=function(e,t){var i,r,s,n=function(){};for(n.prototype=t.prototype,e.prototype=new n,i=2,r=arguments.length;i{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 i=this;this.viewModel.updateData(e,t,function(e){i._updateChart(e),i.addChart&&i.addChart()})}_createChart(e){this.echart=Ca.init(document.getElementById(this.domID),null,{renderer:"canvas"});let t=this.viewModel._createChartOptions(e);this.echart.setOption(t),this.addChart&&this.addChart()}_updateChart(e){this.echart&&(this.echart.clear(),this.echart.setOption(e))}},e.Components.ChartViewModel=La,e.Components.MessageBox=wa,e.Components.AttributesPopContainer=ka,e.Components.CityTabsPage=Ra,e.Components.CommonContainer=Pa,e.Components.DropDownBox=Ia,e.Components.IndexTabsPageContainer=Da,e.Components.NavTabsPage=Ba,e.Components.PaginationContainer=Ga,e.Components.PopContainer=Fa,e.Components.Select=Na,e.Components.TemplateBase=Oa,e.Components.FileReaderUtil=Ta,e.TimeControlBase=Pe,e.TimeFlowControl=class extends Pe{constructor(e,t){super(t);var i=this;i.callback=e,Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),i=this,r=function(){},s=function(){return i.apply(this instanceof r&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,s.prototype=new r,s}),i.update=i.update.bind(i),i.oldTime=i.currentTime,i.CLASS_NAME="SuperMap.TimeFlowControl"}updateOptions(e){e=e||{},super.updateOptions(e)}start(){var e=this;e.running||(e.running=!0,e.reverse?e.currentTime===e.startTime&&(e.oldTime=e.endTime,e.currentTime=e.oldTime):e.oldTime===e.endTime&&(e.currentTime=e.startTime,e.oldTime=e.currentTime),e.tick())}stop(){super.stop();var e=this;e.oldTime=e.currentTime,e.running&&(e.running=!1),e.intervalId&&window.clearTimeout(e.intervalId)}destroy(){super.destroy(),this.oldTime=null,this.callback=null}tick(){var e=this;e.intervalId&&window.clearInterval(e.intervalId),e.intervalId=null,e.update(),e.intervalId=window.setInterval(e.update,e.frequency)}update(){var e=this;if(e.running)if(e.callback&&e.callback(e.currentTime),e.reverse){if(e.currentTime===e.startTime){if(!e.repeat)return e.running=!1,null;e.oldTime=e.endTime,e.currentTime=e.oldTime}else e.currentTime=e.oldTime,e.oldTime-=e.speed;e.oldTime<=e.startTime&&(e.oldTime=e.startTime)}else{if(e.currentTime===e.endTime){if(!e.repeat)return e.running=!1,e.stop(),null;e.stop(),e.currentTime=e.startTime,e.oldTime=e.currentTime,e.start()}else e.oldTime=e.currentTime,e.currentTime+=e.speed;e.currentTime>=e.endTime&&(e.currentTime=e.endTime)}}},e.Format=e.Format||we,e.Format.GeoJSON=Oe,e.Format.JSON=Ce,e.Format.WKT=class extends we{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=[],i=0,r=e.components.length;i0&&s.push(","),i=t[n].geometry,s.push(this.extractGeometry(i));return r&&s.push(")"),s.join("")}extractGeometry(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")":null}},e.iManager=class extends ze{constructor(e){super(e)}load(){return this.request("GET",this.serviceUrl+"/web/api/service.json")}createIServer(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/server.json",new Ve(e))}createIPortal(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/portal.json",new Ve(e))}iServerList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/server.json")}iPortalList(){return this.request("GET",this.serviceUrl+"/icloud/web/nodes/portal.json")}startNodes(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/started.json",e)}stopNodes(e){return this.request("POST",this.serviceUrl+"/icloud/web/nodes/stopped.json",e)}},e.iManagerCreateNodeParam=Ve,e.iManagerServiceBase=ze,e.iPortal=class extends Je{constructor(e,t){super(e,t),this.iportalUrl=e,t=t||{},this.withCredentials=t.withCredentials||!1}load(){return Ue.get(this.iportalUrl+"/web")}queryResources(e){if(!(e instanceof qe))return new Promise(function(e){e("queryParams is not instanceof iPortalQueryParam !")});var t=this,i=this.iportalUrl+"/gateway/catalog/resource/search.json";return e.t=(new Date).getTime(),this.request("GET",i,e).then(function(e){var i=[];(e.content||[]).forEach(function(e){i.push(new We(t.iportalUrl,e))});let r=new He;return r.content=i,r.total=e.total,r.currentPage=e.currentPage,r.pageSize=e.pageSize,r.aggregations=e.aggregations,r})}updateResourcesShareSetting(e){if(!(e instanceof Ye))return new Promise(function(e){e("shareParams is not instanceof iPortalShareParam !")});var t=e.resourceType.replace("_","").toLowerCase()+"s";"datas"===t&&(t="mycontent/"+t);var i={ids:e.ids,entities:e.entities},r=this.iportalUrl+"/web/"+t+"/sharesetting.json";return this.request("PUT",r,JSON.stringify(i)).then(function(e){return e})}},e.iPortalAddDataParam=Ze,e.iPortalAddResourceParam=Xe,e.iPortalDataConnectionInfoParam=et,e.iPortalDataMetaInfoParam=Ke,e.iPortalDataStoreInfoParam=$e,e.iPortalQueryParam=qe,e.iPortalQueryResult=He,e.iPortalRegisterServiceParam=Qe,e.iPortalResource=We,e.iPortalServiceBase=Je,e.iPortalShareEntity=class{constructor(e){e=e||{},this.permissionType="",this.entityType="",this.entityName="GUEST",this.entityId=null,ee.extend(this,e)}},e.iPortalShareParam=Ye,e.iPortalUser=class extends Je{constructor(e){super(e),this.iportalUrl=e}deleteResources(e){var t=e.resourceType.replace("_","").toLowerCase(),i=this.iportalUrl+"/web/"+t+"s.json?ids="+encodeURI(JSON.stringify(e.ids));return"data"===t?(i=this.iportalUrl+"/web/mycontent/datas/delete.json",this.request("POST",i,JSON.stringify(e.ids))):this.request("DELETE",i)}addMap(e){if(!(e instanceof Xe))return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},i=this.iportalUrl+"/web/maps/batchaddmaps.json";return this.request("POST",i,JSON.stringify(t)).then(function(e){return e})}addScene(e){if(!(e instanceof Xe))return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");let t={rootUrl:e.rootUrl,tags:e.tags,authorizeSetting:e.entities},i=this.iportalUrl+"/web/scenes/batchaddscenes.json";return this.request("POST",i,JSON.stringify(t)).then(function(e){return e})}registerService(e){if(!(e instanceof Qe))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},i=this.iportalUrl+"/web/services.json";return this.request("POST",i,JSON.stringify(t)).then(e=>e)}getErrMsgPromise(e){return new Promise(t=>{t(e)})}uploadDataRequest(e,t){var i=this.iportalUrl+"/web/mycontent/datas/"+e+"/upload.json";return this.request("POST",i,t)}addData(e,t){if(!(e instanceof Ze))return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");var i,r=this.iportalUrl+"/web/mycontent/datas.json",s={fileName:e.fileName,tags:e.tags,type:e.type},n=e.type.toLowerCase();if("excel"===n||"csv"===n){if(!(e.dataMetaInfo instanceof Ke))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");i={xField:e.dataMetaInfo.xField,yField:e.dataMetaInfo.yField},"csv"===n&&(i.fileEncoding=e.dataMetaInfo.fileEncoding),s.coordType="WGS84",s.dataMetaInfo=i}else if("hdfs"===n||"hbase"===n){if(!(e.dataMetaInfo instanceof Ke))return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");if(!(e.dataMetaInfo.dataStoreInfo instanceof $e))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,i={url:e.dataMetaInfo.url,dataStoreInfo:a};break;case"hbase":if(!(e.dataMetaInfo.dataStoreInfo.connectionInfo instanceof et))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",i={dataStoreInfo:a}}s.dataMetaInfo=i}return this.request("POST",r,JSON.stringify(s)).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 i=e.dataId,r=e.dataServiceId,s=e.serviceType,n=this.iportalUrl+"/web/mycontent/datas/"+i+"/publishstatus.json?serviceType="+s;return r&&(n+="&dataServiceId="+r),this.request("PUT",n,JSON.stringify(t)).then(e=>t?(r||(r=e.customResult),r):e)}getDataPublishedStatus(e,t){var i=this.iportalUrl+"/web/mycontent/datas/"+e+"/publishstatus.json?dataServiceId="+t+"&forPublish=true";return this.request("GET",i)}unPublishDataService(e){return this.publishOrUnpublish(e,!1)}publishDataService(e){return this.publishOrUnpublish(e,!0)}},e.AddressMatchService=st,e.AggregationParameter=nt,e.AreaSolarRadiationParameters=ot,e.AreaSolarRadiationService=ht,e.BucketAggParameter=at,e.BufferAnalystParameters=dt,e.BufferAnalystService=gt,e.BufferDistance=ut,e.BuffersAnalystJobsParameter=St,e.BuffersAnalystJobsService=wt,e.BufferSetting=ct,e.BurstPipelineAnalystParameters=Ct,e.BurstPipelineAnalystService=At,e.ChartFeatureInfoSpecsService=Tt,e.ChartQueryFilterParameter=Et,e.ChartQueryParameters=Lt,e.ChartQueryService=Pt,e.ClipParameter=class{constructor(e){this.clipDatasetName=null,this.clipDatasourceName=null,this.clipRegion=null,this.isClipInRegion=!0,this.isExactClip=null,e&&ee.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 ee.toJSON({isClipInRegion:this.isClipInRegion,clipDatasetName:this.clipDatasetName,clipDatasourceName:this.clipDatasourceName,isExactClip:this.isExactClip,clipRegion:Le.fromGeometry(this.clipRegion)})}},e.ColorDictionary=Nt,e.CommonServiceBase=tt,e.ComputeWeightMatrixParameters=kt,e.ComputeWeightMatrixService=Dt,e.CreateDatasetParameters=js,e.DataFlowService=Rt,e.DataReturnOption=pt,e.DatasetBufferAnalystParameters=mt,e.DatasetInfo=Bt,e.DatasetOverlayAnalystParameters=Ut,e.DatasetService=Ii,e.DatasetSurfaceAnalystParameters=Vt,e.DatasetThiessenAnalystParameters=qt,e.DatasourceConnectionInfo=vt,e.DatasourceService=Ht,e.DensityAnalystService=Yt,e.DensityKernelAnalystParameters=Wt,e.EditFeaturesParameters=Xt,e.EditFeaturesService=Qt,e.FacilityAnalyst3DParameters=Zt,e.FacilityAnalystSinks3DParameters=Kt,e.FacilityAnalystSinks3DService=$t,e.FacilityAnalystSources3DParameters=ei,e.FacilityAnalystSources3DService=ti,e.FacilityAnalystStreamParameters=ii,e.FacilityAnalystStreamService=ri,e.FacilityAnalystTracedown3DParameters=si,e.FacilityAnalystTracedown3DService=ni,e.FacilityAnalystTraceup3DParameters=ai,e.FacilityAnalystTraceup3DService=oi,e.FacilityAnalystUpstream3DParameters=li,e.FacilityAnalystUpstream3DService=hi,e.FieldParameters=ui,e.FieldsFilter=hn,e.FieldStatisticService=di,e.FieldStatisticsParameters=ci,e.FilterParameter=ft,e.FindClosestFacilitiesParameters=pi,e.FindClosestFacilitiesService=fi,e.FindLocationParameters=mi,e.FindLocationService=yi,e.FindMTSPPathsParameters=gi,e.FindMTSPPathsService=vi,e.FindPathParameters=bi,e.FindPathService=_i,e.FindServiceAreasParameters=Si,e.FindServiceAreasService=xi,e.FindTSPPathsParameters=wi,e.FindTSPPathsService=Ci,e.GenerateSpatialDataParameters=Mi,e.GenerateSpatialDataService=Ai,e.GeoCodingParameter=it,e.GeoDecodingParameter=rt,e.GeoHashGridAggParameter=class extends at{constructor(e){super(),this.precision=5,ee.extend(this,e),this.aggType=G.GEOHASH_GRID,this.CLASS_NAME="SuperMap.GeoHashGridAggParameter"}destroy(){super.destroy(),this.aggType=null,this.precision=null}static toJsonParameters(e){var t={aggName:e.aggName,aggFieldName:e.aggFieldName,aggType:e.aggType,precision:e.precision};return ee.toJson(t)}},e.GeometryBatchAnalystService=Ps,e.GeometryBufferAnalystParameters=yt,e.GeometryOverlayAnalystParameters=Ti,e.GeometrySurfaceAnalystParameters=Ei,e.GeometryThiessenAnalystParameters=Li,e.GeoprocessingService=Oi,e.GeoRelationAnalystParameters=Pi,e.GeoRelationAnalystService=Ni,e.GetFeaturesByBoundsParameters=ki,e.GetFeaturesByBoundsService=Ri,e.GetFeaturesByBufferParameters=Bi,e.GetFeaturesByBufferService=Gi,e.GetFeaturesByGeometryParameters=Ui,e.GetFeaturesByGeometryService=ji,e.GetFeaturesByIDsParameters=zi,e.GetFeaturesByIDsService=Vi,e.GetFeaturesBySQLParameters=Ji,e.GetFeaturesBySQLService=qi,e.GetFeaturesParametersBase=Fi,e.GetFeaturesServiceBase=Di,e.GetFieldsService=Hi,e.GetGridCellInfosParameters=Wi,e.GetGridCellInfosService=Yi,e.GetLayersInfoService=Cr,e.Grid=Sr,e.HillshadeParameter=class extends Ys{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.zFactor=1,this.type=j.HILLSHADE,ee.extend(this,e),this.CLASS_NAME="SuperMap.HillshadeParameter"}destroy(){super.destroy(),this.altitude=null,this.azimuth=null,this.zFactor=null}toJSON(){return{altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,type:this.type}}},e.Image=xr,e.ImageCollectionService=on,e.ImageGFAspect=mn,e.ImageGFHillShade=fn,e.ImageGFOrtho=yn,e.ImageGFSlope=gn,e.ImageRenderingRule=pn,e.ImageSearchParameter=cn,e.ImageService=ln,e.ImageStretchOption=dn,e.InterpolationAnalystParameters=Mr,e.InterpolationAnalystService=Or,e.InterpolationDensityAnalystParameters=Tr,e.InterpolationIDWAnalystParameters=Er,e.InterpolationKrigingAnalystParameters=Lr,e.InterpolationRBFAnalystParameters=Ar,e.JoinItem=vr,e.KernelDensityJobParameter=Pr,e.KernelDensityJobsService=Nr,e.LabelImageCell=class extends Ir{constructor(e){super(e),this.height=0,this.pathField=null,this.rotation=0,this.width=0,this.sizeFixed=!1,this.type="IMAGE",e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LabelImageCell"}destroy(){var e=this;e.height=null,e.pathField=null,e.rotation=null,e.width=null,e.sizeFixed=null}},e.LabelMatrixCell=Ir,e.LabelMixedTextStyle=er,e.LabelSymbolCell=class extends Ir{constructor(e){super(e),this.style=new Ae,this.symbolIDField=null,this.type="SYMBOL",e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LabelSymbolCell"}destroy(){this.style&&(this.style.destroy(),this.style=null),this.symbolIDField=null}},e.LabelThemeCell=class extends Ir{constructor(e){super(e),this.themeLabel=new sr,this.type="THEME",e&&ee.extend(this,e),this.CLASS_NAME=" SuperMap.LabelThemeCell"}destroy(){this.themeLabel&&(this.themeLabel.destroy(),this.themeLabel=null)}},e.LayerStatus=class{constructor(e){this.layerName=null,this.isVisible=null,this.displayFilter=null,this.fieldValuesDisplayFilter=null,e&&ee.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":'+ee.toJSON(this.fieldValuesDisplayFilter)),e+=t,e+="}"}},e.LinkItem=class{constructor(e){this.datasourceConnectionInfo=null,this.foreignKeys=null,this.foreignTable=null,this.linkFields=null,this.linkFilter=null,this.name=null,this.primaryKeys=null,e&&ee.extend(this,e),this.CLASS_NAME="SuperMap.LinkItem"}destroy(){var e=this;e.datasourceConnectionInfo instanceof vt&&(e.datasourceConnectionInfo.destroy(),e.datasourceConnectionInfo=null),e.foreignKeys=null,e.foreignTable=null,e.linkFields=null,e.linkFilter=null,e.name=null,e.primaryKeys=null}},e.MappingParameters=_t,e.MapService=Fr,e.MathExpressionAnalysisParameters=kr,e.MathExpressionAnalysisService=Dr,e.MeasureParameters=Rr,e.MeasureService=Br,e.MetricsAggParameter=class extends nt{constructor(e){super(),this.aggType=U.AVG,ee.extend(this,e),this.CLASS_NAME="SuperMap.MetricsAggParameter"}destroy(){super.destroy(),this.aggType=null}},e.NDVIParameter=class extends Ys{constructor(e){super(e),this.redIndex=0,this.nirIndex=1,this.colorMap="0:ffffe5ff;0.1:f7fcb9ff;0.2:d9f0a3ff;0.3:addd8eff;0.4:78c679ff;0.5:41ab5dff;0.6:238443ff;0.7:006837ff;1:004529ff",this.type=j.NDVI,ee.extend(this,e),this.CLASS_NAME="SuperMap.NDVIParameter"}destroy(){super.destroy(),this.redIndex=null,this.nirIndex=null,this.colorMap=null}toJSON(){return{redIndex:this.redIndex,nirIndex:this.nirIndex,colorMap:this.colorMap,type:this.type}}},e.NetworkAnalystServiceBase=Mt,e.OutputSetting=bt,e.OverlapDisplayedOptions=class{constructor(e){e=e||{},this.allowPointOverlap=!0,this.allowPointWithTextDisplay=!0,this.allowTextOverlap=!1,this.allowTextAndPointOverlap=!0,this.allowThemeGraduatedSymbolOverlap=!1,this.allowThemeGraphOverlap=!1,this.horizontalOverlappedSpaceSize=0,this.verticalOverlappedSpaceSize=0,ee.extend(this,e),this.ugcLayer=new yr(e),this.CLASS_NAME="SuperMap.OverlapDisplayedOptions"}destroy(){ee.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 i in e)e.hasOwnProperty(i)&&(t+="'"+i+"':"+e[i]+",");return t=t.substr(0,t.length-1),t+="}"}},e.OverlayAnalystParameters=Gt,e.OverlayAnalystService=Gr,e.OverlayGeoJobParameter=Ur,e.OverlayGeoJobsService=jr,e.PointWithMeasure=Te,e.ProcessingServiceBase=xt,e.QueryByBoundsParameters=zr,e.QueryByBoundsService=Jr,e.QueryByDistanceParameters=qr,e.QueryByDistanceService=Hr,e.QueryByGeometryParameters=Wr,e.QueryByGeometryService=Yr,e.QueryBySQLParameters=Xr,e.QueryBySQLService=Qr,e.QueryParameters=Ot,e.QueryService=Zr,e.RasterFunctionParameter=Ys,e.Route=Ee,e.RouteCalculateMeasureParameters=Kr,e.RouteCalculateMeasureService=$r,e.RouteLocatorParameters=es,e.RouteLocatorService=ts,e.ServerColor=Me,e.ServerFeature=is,e.ServerGeometry=Le,e.ServerStyle=Ae,e.ServerTextStyle=Qi,e.ServerTheme=_r,e.SetDatasourceParameters=rs,e.SetLayerInfoParameters=class{constructor(e){e=e||{},this.resourceID=null,this.tempLayerName=null,this.layerInfo=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SetLayerInfoParameters"}destroy(){this.resourceID=null,this.tempLayerName=null,this.layerInfo=null}},e.SetLayerInfoService=ss,e.SetLayersInfoParameters=class{constructor(e){e=e||{},this.isTempLayers=null,this.resourceID=null,this.layersInfo=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.SetLayersInfoParameters"}destroy(){this.isTempLayers=null,this.resourceID=null,this.layersInfo=null}},e.SetLayersInfoService=ns,e.SetLayerStatusParameters=as,e.SetLayerStatusService=os,e.SingleObjectQueryJobsParameter=ls,e.SingleObjectQueryJobsService=hs,e.Sortby=un,e.SpatialAnalystBase=lt,e.StopQueryParameters=us,e.StopQueryService=cs,e.SummaryAttributesJobsParameter=ds,e.SummaryAttributesJobsService=ps,e.SummaryMeshJobParameter=fs,e.SummaryMeshJobsService=ms,e.SummaryRegionJobParameter=ys,e.SummaryRegionJobsService=gs,e.SupplyCenter=vs,e.SurfaceAnalystParameters=zt,e.SurfaceAnalystParametersSetting=jt,e.SurfaceAnalystService=bs,e.TerrainCurvatureCalculationParameters=_s,e.TerrainCurvatureCalculationService=Ss,e.Theme=Xi,e.ThemeDotDensity=cr,e.ThemeFlow=xs,e.ThemeGraduatedSymbol=pr,e.ThemeGraduatedSymbolStyle=dr,e.ThemeGraph=ur,e.ThemeGraphAxes=ar,e.ThemeGraphItem=hr,e.ThemeGraphSize=or,e.ThemeGraphText=lr,e.ThemeGridRange=Cs,e.ThemeGridRangeItem=ws,e.ThemeGridUnique=As,e.ThemeGridUniqueItem=Ms,e.ThemeLabel=sr,e.ThemeLabelAlongLine=ir,e.ThemeLabelBackground=rr,e.ThemeLabelItem=Zi,e.ThemeLabelText=tr,e.ThemeLabelUniqueItem=Ts,e.ThemeMemoryData=class{constructor(e,t){this.srcData=e,this.targetData=t,this.CLASS_NAME="SuperMap.ThemeMemoryData"}destroy(){this.srcData=null,this.targetData=null}toJSON(){if(this.srcData&&this.targetData){for(var e="",t=Math.min(this.srcData.length,this.targetData.length),i=0;i0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}return null}},e.ThemeOffset=$i,e.ThemeParameters=Es,e.ThemeRange=mr,e.ThemeRangeItem=fr,e.ThemeService=Ls,e.ThemeUnique=nr,e.ThemeUniqueItem=Ki,e.ThiessenAnalystParameters=Jt,e.ThiessenAnalystService=Os,e.TilesetsService=Ns,e.TopologyValidatorJobsParameter=Is,e.TopologyValidatorJobsService=Fs,e.TransferLine=ks,e.TransferPathParameters=Ds,e.TransferPathService=Rs,e.TransferSolutionParameters=Bs,e.TransferSolutionService=Gs,e.TransportationAnalystParameter=Ft,e.TransportationAnalystResultSetting=It,e.UGCLayer=yr,e.UGCMapLayer=gr,e.UGCSubLayer=br,e.UpdateDatasetParameters=qs,e.UpdateEdgeWeightParameters=Us,e.UpdateEdgeWeightService=zs,e.UpdateTurnNodeWeightParameters=Vs,e.UpdateTurnNodeWeightService=Js,e.Vector=wr,e.VectorClipJobsParameter=Hs,e.VectorClipJobsService=Ws,e.WebPrintingJobContent=rn,e.WebPrintingJobCustomItems=Xs,e.WebPrintingJobExportOptions=nn,e.WebPrintingJobImage=Qs,e.WebPrintingJobLayers=Zs,e.WebPrintingJobLayoutOptions=sn,e.WebPrintingJobLegendOptions=Ks,e.WebPrintingJobLittleMapOptions=$s,e.WebPrintingJobNorthArrowOptions=en,e.WebPrintingJobParameters=class{constructor(e){e&&(this.content=null,this.layoutOptions=null,this.exportOptions=null,ee.extend(this,e),this.CLASS_NAME="SuperMap.WebPrintingJobParameters")}destroy(){this.content instanceof rn&&(this.content.destroy(),this.content=null),this.layoutOptions instanceof sn&&(this.layoutOptions.destroy(),this.layoutOptions=null),this.exportOptions instanceof nn&&(this.exportOptions.destroy(),this.exportOptions=null)}},e.WebPrintingJobScaleBarOptions=tn,e.WebPrintingService=an,e.Online=class{constructor(){this.rootUrl="https://www.supermapol.com",this.webUrl=this.rootUrl+"/web";var e=this.webUrl+"/mycontent";this.mDatasUrl=e+"/datas",this.CLASS_NAME="SuperMap.Online"}load(){return Ue.get(this.rootUrl).then(function(e){return e})}login(){je.loginOnline(this.rootUrl,!0)}queryDatas(e){var t=this,i=t.mDatasUrl;return e&&(e=e.toJSON()),Ue.get(i,e).then(function(e){if(e&&e.content&&!(e.content.length<1)){for(var i=[],r=e.content,s=r.length,n=0;ni[1])return;var n=this.calculateXShapeInfo();if(n){var a=n.xPositions,o=n.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,r,t,n)));for(var l=0;l=t.length&&(i%=t.length);var l=t[i][0],h=t[i][1],u=(new wn).getLinearGradient(a,0,o,0,[[0,l],[1,h]]);s.style.color=u}}}},e.Feature.Theme.Bar3D=class extends na{constructor(e,t,i,r,s){super(e,t,i,r,s),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 i=this.dataViewBox,r=this.dataValues;if(!(r.length<1)){for(let e=0,i=r.length;et[1])return;var s=this.calculateXShapeInfo();if(s){var n=s.xPositions,a=s.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ra.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(ra.GraphAxis(this.shapeFactory,i,e,s)));var o=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10;for(let s=0;s0?this.DVBUnitValue=e.maxR/(s[1]-s[0]):this.DVBUnitValue=e.maxR;var n=this.DVBUnitValue,a=r[0]*n+e.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!s||!(r[0]s[1]))){var o=this.DVBCenterPoint,l=new jn(o[0],o[1],a);l.style=ra.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?l.style.fillColor=e.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=ra.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:r[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}},e.Feature.Theme.Graph=na,e.Feature.Theme.Line=class extends na{constructor(e,t,i,r,s,n){super(e,t,i,r,s,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,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var r=this.DVBUnitValue,s=this.dataValues;if(!(s.length<1)){var n=this.calculateXShapeInfo();if(n){var a,o,l=n.xPositions;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,t,e,n));for(var h=[],u=[],c=0,d=s.length;ci[1])return null;a=l[c],o=t[1]-(s[c]-i[0])/r;var p=new Fn(a,o);p.style=ra.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,c,s[c]),p.highlightStyle=ra.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:s[c]},u.push(this.shapeFactory.createShape(p));var f=[a,o];h.push(f)}var m=new kn(h);m.style=ra.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),m.clickable=!1,m.hoverable=!1;var y=this.shapeFactory.createShape(m);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var e,t=this.dataViewBox,i=this.setting,r=this.dataValues.length;if(r<1)return null;var s=[],n=this.DVBWidth,a=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2==i.xShapeBlank.length){var o=n-((e=i.xShapeBlank)[0]+e[1]);if(o<=r)return null;a=o/(r-1)}else e=[a=n/(r+1),a,a];for(var l=0,h=0;hr[1])return;var s=0;for(let e=0;e=360&&(l=359.9999999);var p=new Bn(a[0],a[1],u,o,l);if(void 0===e.sectorStyleByFields){var f=c%t.length;p.style=ra.ShapeStyleTool(null,e.sectorStyle,t,null,f)}else p.style=ra.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,c,i[c]);p.highlightStyle=ra.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:i[c]},this.shapes.push(this.shapeFactory.createShape(p)),o=l}this.shapesConvertToRelativeCoordinate()}}}},e.Feature.Theme.Point=class extends na{constructor(e,t,i,r,s,n){super(e,t,i,r,s,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,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var r=this.DVBUnitValue,s=this.dataValues,n=this.calculateXShapeInfo();if(n){var a,o,l=n.xPositions;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(ra.Background(this.shapeFactory,this.chartBox,e)),this.shapes=this.shapes.concat(ra.GraphAxis(this.shapeFactory,t,e,n));for(var h=0,u=s.length;hi[1])return null;a=l[h],o=t[1]-(s[h]-i[0])/r;var c=new Fn(a,o);c.style=ra.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,h,s[h]),c.highlightStyle=ra.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:s[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var e,t=this.dataViewBox,i=this.setting,r=this.dataValues.length;if(r<1)return null;var s=[],n=this.DVBWidth,a=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2==i.xShapeBlank.length){var o=n-((e=i.xShapeBlank)[0]+e[1]);if(o<=r)return null;a=o/(r-1)}else e=[a=n/(r+1),a,a];for(var l=0,h=0;hr[1])return;var s=0;for(let e=0;e=0&&t.innerRingRadiust.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),i})}_distance(e,t,i,r){return Math.sqrt((e-i)*(e-i)+(t-r)*(t-r))}_getMeterPerMapUnit(e){let t;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}},e.ArrayStatistic=class{static newInstance(){return this.geostatsInstance||(this.geostatsInstance=new window.geostats),this.geostatsInstance}static getInstance(e){let t=this.newInstance();return t.setSerie(e),t}static getArrayStatistic(e,t){return e.length?"Sum"===t||"求和"===t?this.getSum(e):"Maximum"===t||"最大值"===t?this.getMax(e):"Minimum"===t||"最小值"===t?this.getMin(e):"Average"===t||"平均值"===t?this.getMean(e):"Median"===t||"中位数"===t?this.getMedian(e):"times"===t||"计数"===t?this.getTimes(e):void 0:0}static getArraySegments(e,t,i){return"offset"===t?this.getEqInterval(e,i):"jenks"===t?this.getJenks(e,i):"square"===t?this.getMin(e)>=0&&this.getSqrtInterval(e,i):"logarithm"===t?this.getMin(e)>0&&this.getGeometricProgression(e,i):void 0}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)}},e.ColorsPickerUtil=class{static createCanvas(e,t){var i=document.createElement("canvas");return i.height=e,i.width=t,i.getContext("2d")}static getLinearGradient(e,t,i,r,s){this._ctx||(this._ctx=this.getContext());for(var n=this._ctx.createLinearGradient(e,t,i,r),a=s.length,o=1/(a-1),l=0,h=0;h=t)if("RANGE"===i)for(s=0;sthis.bounds.max.x?this.bounds.max.x:e.x,e.y=e.ythis.bounds.max.y?this.bounds.max.y:e.y);var i=this._proj.inverse([e.x,e.y]);return new(ao().LatLng)(i[1],i[0],t)},_projFromCodeDef:function(e,t){if(t)lo().defs(e,t);else if(void 0===lo().defs[e]){var i=e.split(":");if(i.length>3&&(e=i[i.length-3]+":"+i[i.length-1]),void 0===lo().defs[e])throw"No projection definition for code "+e}return lo()(e)},getUnits:function(){return this._proj.oProj.units||"degrees"}});var ho=ao().Class.extend({includes:ao().CRS,options:{transformation:new(ao().Transformation)(1,0,-1,0)},initialize:function(e,t){var i,r,s;if(t.bounds&&4===t.bounds.length){const[e,i,r,s]=t.bounds;t.bounds=[[e,i],[r,s]]}if(ao().Proj._isProj4Obj(e)?(i=(r=e).srsCode,t=t||{},this.projection=new(ao().Proj.Projection)(r,t.bounds,t.wrapLng)):(i=e,s=(t=t||{}).def||"",this.projection=new(ao().Proj.Projection)(i,s,t.bounds,t.wrapLng)),ao().Util.setOptions(this,t),this.options.wrapLng&&(this.wrapLng=this.options.wrapLng),this.code=i,this.transformation=this.options.transformation,this.options.dpi=this.options.dpi||96,this.options.bounds&&(this.options.bounds=ao().bounds(this.options.bounds)),!this.options.origin&&this.options.bounds&&(this.options.origin=[this.options.bounds.min.x,this.options.bounds.max.y]),this.options.origin&&(this.options.origin instanceof ao().Point&&(this.options.origin=[this.options.origin.x,this.options.origin.y]),this.transformation=new(ao().Transformation)(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales&&this.options.scales.length>0)this.scales=this.options.scales,this._scales=this._toProj4Scales(this.options.scales,this.options.dpi);else if(this.options.scaleDenominators&&this.options.scaleDenominators.length>0){this.scales=[];for(let e=0;e0){this._scales=[];for(let e=this.options.resolutions.length-1;e>=0;e--)this.options.resolutions[e]&&(this._scales[e]=1/this.options.resolutions[e])}else this.options.bounds&&(this._scales=this._getDefaultProj4ScalesByBounds(this.options.bounds));this._rectify(),this.infinite=!this.options.bounds},_rectify:function(){if(this._scales&&(this.resolutions||(this.resolutions=[],this.resolutions=this._proj4ScalesToResolutions(this._scales)),!this.scales)){this.scales=[];for(let t=0;t© SuperMap iClient",Common:{attribution:"Map Data © SuperMap iServer"},Online:{attribution:"Map Data © SuperMap Online"},ECharts:{attribution:"© 2018 百度 ECharts"},MapV:{attribution:"© 2018 百度 MapV "},Turf:{attribution:"© turfjs"},Baidu:{attribution:"Map Data © 2018 Baidu - GS(2016)2089号 - Data © 长地万方"},Cloud:{attribution:"Map Data ©2014 SuperMap - GS(2014)6070号-data©Navinfo"},Tianditu:{attribution:"Map Data "}};ao().Control.Attribution.include({options:{position:"bottomright",prefix:co.Prefix}}),ao().Map.include({latLngToAccurateContainerPoint:function(e){var t=this.project(ao().latLng(e))._subtract(this.getPixelOrigin());return ao().point(t).add(this._getMapPanePos())}}),function(e){e.map(e=>(e.defaultFunction=e.prototype.toGeoJSON,e.include({toGeoJSON:function(t){return e.defaultFunction.call(this,t||10)}}),e))}([ao().Polyline,ao().Polygon,ao().Marker,ao().CircleMarker,ao().Circle,ao().LayerGroup]);var po=ao().Evented.extend({options:{url:null,proxy:null,withCredentials:!1,crossOrigin:null},initialize:function(e,t){e&&(e=e.indexOf("/")!==e.length-1?e:e.substr(0,e.length-1)),this.url=e,ao().setOptions(this,t),this.fire("initialized",this)},destroy:function(){this.fire("destroy",this)}}),fo=po.extend({options:{projection:null},initialize:function(e,t){t=t||{},ao().setOptions(this,t),t.projection&&(this.options.projection=t.projection),po.prototype.initialize.call(this,e,t)},getMapInfo:function(e){var t=this;new Fr(t.url,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection}).processAsync(e)},getWkt(e){var t=this;new Fr(`${t.url}/prjCoordSys.wkt`,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,withoutFormatSuffix:!0,crossOrigin:t.options.crossOrigin,headers:t.options.headers,projection:t.options.projection}).processAsync(e)},getTilesets:function(e){var t=this;new Ns(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()}}),mo=ao().Control.extend({options:{layer:null,position:"topleft",title:"switch tile version",tooltip:"top",collapsed:!0,nextText:"+",lastText:"-",ico:"V",orientation:"horizontal",switch:!0},onAdd:function(){"vertical"!==this.options.orientation&&(this.options.orientation="horizontal");var e=this._initLayout();return this.options.layer&&this.setLayer(this.options.layer),e},setContent:function(e){var t=ao().Util.extend({},e);this.setVersionName(t.desc).setToolTip(t.desc)},setVersionName:function(e){var t=e;return e||(t=this.getValue()),this._sliderValue.innerHTML=t,this},setToolTip:function(e){return this.tooltip.innerHTML=e,this},updateLength:function(e){e>0&&(this.length=e,this.max=this.length-1,this.slider.setAttribute("max",this.max))},setLayer:function(e){e&&(this.options.layer=e);var t=this,i=t.options.layer;i.on("tilesetsinfoloaded",function(e){var i=e&&e.tileVersions;t.update(i)}),i.on("tileversionschanged",function(e){var i=e&&e.tileVersion;t.setContent(i)}),t.getTileSetsInfo()},update:function(e){this.tileVersions=e||[],this.updateLength(this.tileVersions.length)},getTileSetsInfo:function(){var e=this;e.options.layer&&new fo(e.options.layer._url).getTilesets(function(t){e.options.layer.setTileSetsInfo(t.result)})},removeLayer:function(){this.options.layer=null},nextTilesVersion:function(){return this.firstLoad?(this.options.layer.nextTilesVersion(),this.firstLoad=!1,this):parseInt(this.slider.value)>this.max-1?this:(this.slider.value=parseInt(this.slider.value)+1,this.options.layer.nextTilesVersion(),this)},lastTilesVersion:function(){return parseInt(this.slider.value)"+i+"",e}});ao().Map.mergeOptions({logoControl:!0}),ao().Map.addInitHook(function(){!this._logoAdded&&this.options.logoControl&&(!0===this.options.logoControl?this.logoControl=new yo:this.options.logoControl instanceof ao().Control&&(this.logoControl=this.options.logoControl),this.logoControl&&(this.addControl(this.logoControl),this._logoAdded=!0))});const go=function(e){return"[object Array]"==Object.prototype.toString.call(e)},vo={toSuperMapBounds:e=>(e&&-1!==["FeatureCollection","Feature"].indexOf(e.type)&&(e=ao().geoJSON(e).getBounds()),e instanceof ao().LatLngBounds?new se(e.getSouthWest().lng,e.getSouthWest().lat,e.getNorthEast().lng,e.getNorthEast().lat):e instanceof ao().Bounds?new se(e.min.x,e.min.y,e.max.x,e.max.y):go(e)?new se(e[0],e[1],e[2],e[3]):new se),isArray:go,toProcessingParam(e){var t={};if(e.length<1)t="";else{for(var i=[],r=0;r-1?i:Math.log(e/(1/this.resolutions[0]))/Math.LN2},distance:function(e,t){var i=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(i*i+r*r)},infinite:!1}),Lo=function(e){return new Eo(e)},Oo=function(e){return e?(new Oe).toGeoJSON(e):e},Po=function(e){if(!e)return e;var t,i=new Oe;if(-1!=["FeatureCollection","Feature","Geometry"].indexOf(e.type))t=i.read(e,e.type);else if("function"==typeof e.toGeoJSON){var r=e.toGeoJSON();t=r?i.read(r,r.type):e}var s=t||e;return ao().Util.isArray(t)&&(1===t.length?s=t[0]:t.length>1&&(s=[],t.map(function(e){return s.push(e.geometry),e}))),s&&s.geometry?s.geometry:s},No=Mn,Io=function(e,t,i){var r=e*t*(1/.0254)*No(i);return r=1/r},Fo=function(e,t,i){var r=e*t*(1/.0254)*No(i);return r=1/r},ko=function(e){return e>1?1/e:e},Do=function(e,t,i,r){return r=r||6378137,i=i||"",e>0&&t>0?(e=ko(e),"degree"===i.toLowerCase()||"degrees"===i.toLowerCase()||"dd"===i.toLowerCase()?254/t/e/(2*Math.PI*r/360)/1e4:254/t/e/1e4):-1},Ro=function(e,t=ao().CRS.EPSG4326,i){let r=null,s=null;if(-1===["FeatureCollection","Feature","Geometry"].indexOf(e.type))if(e.toGeoJSON)e=e.toGeoJSON();else if(e instanceof ao().LatLngBounds)e=ao().rectangle(e).toGeoJSON();else{if(!(e instanceof ao().Bounds))throw new Error("This tool only supports data conversion in geojson format or Vector Layers of Leaflet.");e=ao().rectangle([[e.getTopLeft().x,e.getTopLeft().y],[e.getBottomRight().x,e.getBottomRight().y]]).toGeoJSON()}const n={point:function(e){return s(e)},multipoint:function(e){return n.linestring.apply(this,[e])},linestring:function(e){let t=[],i=null;for(let r=0,s=e.length;r(this._map.options.maxZoom||18)||e<(this._map.options.minZoom||0))this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null);else{var i=this._getImageParams(t);i?this._requestImage(i,t):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)}}},_calculateBounds:function(e){var t=this._map.options.crs.project(e.getNorthEast()),i=this._map.options.crs.project(e.getSouthWest());return ao().bounds(t,i)},_compriseBounds:function(e){var t={leftBottom:{x:e.getBottomLeft().x,y:e.getTopRight().y},rightTop:{x:e.getTopRight().x,y:e.getBottomLeft().y}};return JSON.stringify(t)},_calculateImageSize:function(e){return new(ao().Bounds)(this._map.latLngToLayerPoint(e.getNorthWest()),this._map.latLngToLayerPoint(e.getSouthEast())).getSize()}}),Vo=ao().TileLayer.extend({options:{version:"1.0.0",style:"",tilematrixSet:"",format:"image/png",tileSize:256,matrixIds:null,layer:"",requestEncoding:"KVP",attribution:"",noWrap:!0},initialize:function(e,t){this._url=e,ao().setOptions(this,t);var i=this.options;if("REST"===i.requestEncoding){this.formatSuffix="."+({"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"}[i.format]||i.format.split("/").pop()||"png")}else i.requestEncoding="KVP"},getTileUrl:function(e){var t=this._getZoomForUrl(),i=this.options.matrixIds?this.options.matrixIds[t].identifier:t,r=this._url.indexOf("?"),s=r>-1?this._url.substring(0,this._url.indexOf("?")):this._url,n=r>-1?this._url.substring(this._url.indexOf("?")):"";s=ao().Util.template(s,{s:this._getSubdomain(e)});var a={service:"WMTS",request:"GetTile",version:this.options.version,style:this.options.style,tilematrixSet:this.options.tilematrixSet,format:this.options.format,width:this.options.tileSize,height:this.options.tileSize,layer:this.options.layer,tilematrix:i,tilerow:e.y,tilecol:e.x};if(this.options.tileProxy&&(s=this.options.tileProxy+s),"KVP"===this.options.requestEncoding)s+=ao().Util.getParamString(a,s);else if("REST"===this.options.requestEncoding){s+="/"+a.layer+"/"+a.style+"/"+a.tilematrixSet+"/"+a.tilematrix+"/"+a.tilerow+"/"+a.tilecol+this.formatSuffix}return s=ee.urlAppend(s,n),s=je.appendCredential(s)}}),Jo=function(e,t){return new Vo(e,t)},qo=Vo.extend({layerLabelMap:{vec:"cva",ter:"cta",img:"cia"},layerZoomMap:{vec:18,ter:14,img:18},options:{layerType:"vec",isLabel:!1,attribution:co.Tianditu.attribution,url:"https://t{s}.tianditu.gov.cn/{layer}_{proj}/wmts?",zoomOffset:1,key:"",dpi:96,style:"default",format:"tiles",subdomains:[0,1,2,3,4,5,6,7],bounds:[[-90,-180],[90,180]],noWrap:!0},initialize:function(e){e=e||{},ao().setOptions(this,e),this.options.layer=this.options.isLabel?this.layerLabelMap[this.options.layerType]:this.options.layerType,this.options.maxZoom=this.layerZoomMap[this.options.layerType]-1,Vo.prototype.initialize.call(this,this.options.url,this.options),ao().stamp(this),this.options.key&&(this._url=`${this._url}tk=${this.options.key}`)},onAdd:function(e){this.options.tilematrixSet="EPSG:4326"===e.options.crs.code?"c":"w",this._url=this._url.replace("{layer}",this.options.layer).replace("{proj}",this.options.tilematrixSet),Vo.prototype.onAdd.call(this,e)},_isValidTile:function(e){const t=this._map.options.crs;if(!t.infinite){const i=this._globalTileRange;if((!t.wrapLng||this.options.noWrap)&&(e.xi.max.x)||!t.wrapLat&&(e.yi.max.y))return!1}if(!this.options.bounds)return!0;const i=this._tileCoordsToBounds(e);return ao().latLngBounds(this.options.bounds).overlaps(i)}}),Ho=ao().TileLayer.extend({options:{layersID:null,redirect:!1,transparent:!0,cacheEnabled:!0,clipRegionEnabled:!1,clipRegion:null,prjCoordSys:null,overlapDisplayed:!1,overlapDisplayedOptions:null,tileversion:null,crs:null,format:"png",tileProxy:null,attribution:co.Common.attribution,subdomains:null},initialize:function(e,t){this._url=e,ao().TileLayer.prototype.initialize.apply(this,arguments),ao().setOptions(this,t),ao().stamp(this),this.tileSetsIndex=-1,this.tempIndex=-1},onAdd:function(e){this._crs=this.options.crs||e.options.crs,ao().TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this.getScaleFromCoords(e),i=this._getLayerUrl()+"&scale="+t+"&x="+e.x+"&y="+e.y;return this.options.tileProxy&&(i=this.options.tileProxy+encodeURIComponent(i)),this.options.cacheEnabled||(i+="&_t="+(new Date).getTime()),this.options.subdomains&&(i=ao().Util.template(i,{s:this._getSubdomain(e)})),i},getScale:function(e){var t=e||this._map.getZoom();return this.scales[t]},getScaleFromCoords:function(e){var t,i=this;return i.scales&&i.scales[e.z]?i.scales[e.z]:(i.scales=i.scales||{},t=i.getDefaultScale(e),i.scales[e.z]=t,t)},getDefaultScale:function(e){var t=this._crs;if(t.scales)return t.scales[e.z];var i=this._tileCoordsToBounds(e),r=t.project(i.getNorthEast()),s=t.project(i.getSouthWest()),n=this.options.tileSize,a=Math.max(Math.abs(r.x-s.x)/n,Math.abs(r.y-s.y)/n),o=l.METER;if(t.code){var h=t.code.split(":");if(h&&h.length>1){var u=parseInt(h[1]);o=u&&u>=4e3&&u<=5e3?l.DEGREE:l.METER}}return Io(a,96,o)},setTileSetsInfo:function(e){this.tileSets=e,ao().Util.isArray(this.tileSets)&&(this.tileSets=this.tileSets[0]),this.tileSets&&(this.fire("tilesetsinfoloaded",{tileVersions:this.tileSets.tileVersions}),this.changeTilesVersion())},lastTilesVersion:function(){this.tempIndex=this.tileSetsIndex-1,this.changeTilesVersion()},nextTilesVersion:function(){this.tempIndex=this.tileSetsIndex+1,this.changeTilesVersion()},changeTilesVersion:function(){var e=this;if(null!=e.tileSets&&!(e.tempIndex===e.tileSetsIndex||this.tempIndex<0)){var t=e.tileSets.tileVersions;if(t&&e.tempIndex=0){var i=t[e.tempIndex].name;e.mergeTileVersionParam(i)&&(e.tileSetsIndex=e.tempIndex,e.fire("tileversionschanged",{tileVersion:t[e.tempIndex]}))}}},updateCurrentTileSetsIndex:function(e){this.tempIndex=e},mergeTileVersionParam:function(e){return!!e&&(this.requestParams.tileversion=e,this._paramsChanged=!0,this.redraw(),this._paramsChanged=!1,!0)},_getLayerUrl:function(){return this._paramsChanged&&(this._layerUrl=this._createLayerUrl()),this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){let e=ee.urlPathAppend(this._url,`tileImage.${this.options.format}`);return this.requestParams=this.requestParams||this._getAllRequestParams(),e=ee.urlAppend(e,no.Util.getParamString(this.requestParams)),e=je.appendCredential(e),this._layerUrl=e,e},_getAllRequestParams:function(){var e=this.options||{},t={},i=this.options.tileSize;i instanceof ao().Point||(i=ao().point(i,i)),t.width=i.x,t.height=i.y,t.redirect=!0===e.redirect,t.transparent=!0===e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),e.prjCoordSys&&(t.prjCoordSys=JSON.stringify(e.prjCoordSys)),e.layersID&&(t.layersID=e.layersID.toString()),e.clipRegionEnabled&&e.clipRegion&&(e.clipRegion=Le.fromGeometry(Po(e.clipRegion)),t.clipRegionEnabled=e.clipRegionEnabled,t.clipRegion=JSON.stringify(e.clipRegion));var r=this._crs;if(r.options&&r.options.origin)t.origin=JSON.stringify({x:r.options.origin[0],y:r.options.origin[1]});else if(r.projection&&r.projection.bounds){var s=r.projection.bounds,n=ao().point(s.min.x,s.max.y);t.origin=JSON.stringify({x:n.x,y:n.y})}return!1===e.overlapDisplayed?(t.overlapDisplayed=!1,e.overlapDisplayedOptions&&(t.overlapDisplayedOptions=e.overlapDisplayedOptions)):t.overlapDisplayed=!0,!0===t.cacheEnabled&&e.tileversion&&(t.tileversion=e.tileversion.toString()),e.rasterfunction&&(t.rasterfunction=JSON.stringify(e.rasterfunction)),t}}),Wo=function(e,t){return new Ho(e,t)},Yo=i(545),Xo=i.n(Yo),Qo={TEXT:{fontSize:"14px",fontFamily:"Arial Unicode MS Regular,Microsoft YaHei",textAlign:"left",color:"rgba(255,255,255,0)",fillColor:"rgba(80,80,80,1)",weight:1,globalAlpha:1},POINT:{fillColor:"#ffcc00",color:"#cc3333",weight:1,radius:3,opacity:1},LINE:{color:"rgba(0,0,0,0)",weight:1,lineCap:"butt",lineJoin:"round",dashOffset:0,dashArray:[],opacity:1},REGION:{color:"rgba(0,0,0,0)",fillColor:"rgba(0,0,0,0)",weight:1,lineCap:"butt",lineJoin:"round",dashOffset:0,opacity:1,fillOpacity:1,dashArray:[]}},Zo={TEXT:{"text-size":"fontSize","text-face-name":"fontFamily","text-align":"textAlign","text-name":"textName","text-weight":"fontWeight","text-halo-color":"color","text-fill":"fillColor","text-comp-op":"globalCompositeOperation"},POINT:{"point-file":"iconUrl","point-fill":"fillColor","point-radius":"radius","point-halo-color":"color","point-comp-op":"globalCompositeOperation"},LINE:{"line-color":"color","line-width":"weight","line-cap":"lineCap","line-join":"lineJoin","line-dash-offset":"dashOffset","line-opacity":"opacity","line-dasharray":"dashArray","line-comp-op":"globalCompositeOperation"},REGION:{"line-color":"color","line-width":"weight","line-cap":"lineCap","line-join":"lineJoin","line-dash-offset":"dashOffset","line-opacity":"opacity","line-dasharray":"dashArray","polygon-fill":"fillColor","polygon-opacity":"fillOpacity","polygon-comp-op":"globalCompositeOperation"}},Ko={lineWidth:{leafletStyle:"weight",type:"number",unit:"mm",defaultValue:.1},fillForeColor:{leafletStyle:"fillColor",type:"color",defaultValue:"rgba(0,0,0,0)"},foreColor:{leafletStyle:"color",type:"color",defaultValue:"rgba(0,0,0,0)"},markerSize:{leafletStyle:"markerSize",type:"number",unit:"mm",defaultValue:2.4},lineColor:{leafletStyle:"color",type:"color",defaultValue:"#000000"}},$o={clear:"",src:"",dst:"","src-over":"source-over","dst-over":"destination-over","src-in":"source-in","dst-in":"destination-in","src-out":"source-out","dst-out":"destination-out","src-atop":"source-atop","dst-atop":"destination-atop",xor:"xor",plus:"lighter",minus:"",multiply:"",screen:"",overlay:"",darken:"",lighten:"lighter","color-dodge":"","color-burn":"","hard-light":"","soft-light":"",difference:"",exclusion:"",contrast:"",invert:"","invert-rgb":"","grain-merge":"","grain-extract":"",hue:"",saturation:"",color:"",value:""};class el{constructor(e){this.cartoCSS=null,this.mapUrl=e}pretreatedCartoCSS(e,t){t&&(e=this.processCharacters(e)),this.cartoCSS=this.cartoCSS||{};var i=new On(e).getShaders();if(i)for(var r=0;r-1;t--)if(e.indexOf(n[t])>-1){s=e.replace(n[t],i[n[t]]);break}s=s.replace(/[#]/gi,"#"),i[e]=r,t=t.replace(new RegExp(s,"g"),r)}),t=(t=t.replace(/[#]/gi,"\n#")).replace(/\[zoom/gi,"[scale")}}pickShader(e){if(!this.cartoCSS)return null;var t=e.replace(/[@#\s]/gi,"___");return this.cartoCSS[t]}getDefaultStyle(e){var t={},i=Qo[e];for(var r in i){var s=i[r];t[r]=s}return t}getStyleFromiPortalMarker(e){return 0==e.indexOf("./")?null:ao().icon({iconUrl:e,iconSize:ao().point(48,43),iconAnchor:ao().point(24,43),popupAnchor:ao().point(0,-43)})}getStyleFromiPortalStyle(e,t,i){var r=i?JSON.parse(i):null,s={};if("Point"===t||"MultiPoint"===t){var n=r||e.pointStyle;return n.externalGraphic?0==n.externalGraphic.indexOf("./")?null:ao().icon({iconUrl:n.externalGraphic,iconSize:ao().point(n.graphicWidth,n.graphicHeight),iconAnchor:ao().point(-n.graphicXOffset,-n.graphicYOffset),popupAnchor:ao().point(0,-n.graphicHeight)}):(s.radius=n.pointRadius,s.color=n.strokeColor,s.opacity=n.strokeOpacity,s.lineCap=n.strokeLineCap,s.weight=n.strokeWidth,s.fillColor=n.fillColor,s.fillOpacity=n.fillOpacity,s.dashArray=this.dashStyle(n,1),s)}if("LineString"===t||"MultiLineString"===t||"Box"===t){var a=r||e.lineStyle;return s.color=a.strokeColor,s.opacity=a.strokeOpacity,s.fillOpacity=a.fillOpacity,s.lineCap=a.strokeLineCap,s.weight=a.strokeWidth,s.dashArray=this.dashStyle(a,1),s}if("Polygon"===t||"MultiPolygon"===t){var o=r||e.polygonStyle;return s.color=o.strokeColor,s.opacity=o.strokeOpacity,s.lineCap=o.strokeLineCap,s.weight=o.strokeWidth,s.fillColor=o.fillColor,s.fillOpacity=o.fillOpacity,s.dashArray=this.dashStyle(o,1),s}}dashStyle(e,t){if(!e)return[];var i=e.strokeWidth*t,r=e.strokeDashstyle;switch(r){case"solid":return[];case"dot":return[1,4*i];case"dash":return[4*i,4*i];case"dashdot":return[4*i,4*i,1,4*i];case"longdash":return[8*i,4*i];case"longdashdot":return[8*i,4*i,1,4*i];default:return r?ee.isArray(r)?r:(r=q.trim(r).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(","):[]}}getValidStyleFromCarto(e,t,i,r,s){if(!i)return null;var n=r.type,a=r.properties.attributes||{},o=this.getDefaultStyle(n);s=void 0===s||s,a.FEATUREID=r.properties.id,a.SCALE=t;for(var l,h,u=Zo[n],c=0,d=i.length;c7?0:s.fillSymbolID,u=s.lineSymbolID>5?0:s.lineSymbolID;for(var c in s){var d=Ko[c];if(d){var p=d.leafletStyle;switch(d.type){case"number":{let e=s[c];d.unit&&(e=e*$*te[d.unit]*2.5),r[p]=e;break}case"color":{var f=s[c];let e,t=1;if("fillColor"===p)0!==h&&1!==h||(t=1-h,e="rgba("+f.red+","+f.green+","+f.blue+","+t+")");else if("color"===p){if(0===u||5===u)t=0===u?1:0;else{var m=[1,0];switch(u){case 1:m=[9.7,3.7];break;case 2:m=[3.7,3.7];break;case 3:m=[9.7,3.7,2.3,3.7];break;case 4:m=[9.7,3.7,2.3,3.7,2.3,3.7]}r.lineDasharray=m}e="rgba("+f.red+","+f.green+","+f.blue+","+t+")"}r[p]=e;break}}}}return t.textField&&(r.textAlign="LEFT"),r}}var tl=ao().Class.extend({initialize:function(e){var t=(e=e||{}).latLng||e._latLng;this._latLng=ao().latLng(t.lat,t.lng),this._style=e.style||e._canvas,this.attributes=e.attributes,this.id=e.id?e.id:null},getId(){return this.id},setId(e){this.id=e},setLatLng:function(e){this._latLng=e},setCanvas:function(e){this._style=e},setAttributes:function(e){this.attributes=e},getLatLng:function(){return this._latLng},getCanvas:function(){return this._style},getAttributes:function(){return this.attributes},setStyle:function(e){this._style=e},getStyle:function(){return this._style}}),il=ao().Class.extend({initialize:function(e,t){this.geometry=e,this.attributes=t},toFeature:function(){let e=this.geometry;if(e.toGeoJSON){const t=e.toGeoJSON();return t.properties=this.attributes,(new Oe).read(t)[0]}if(3===e.length)e=new ue(e[1],e[0],e[2]);else if(2===e.length)e=new le(e[0],e[1]);else if(e instanceof ao().LatLng)e=new le(e.lng,e.lat);else if(e instanceof ao().Point)e=new le(e.x,e.y);else if(e instanceof ao().CircleMarker){var t=e.getLatLng();e=new le(t.lng,t.lat)}return new xe(e,this.attributes)},reverseLatLngs:function(e){ao().Util.isArray(e)||(e=[e]);for(var t=0;t0&&t._reset(),t.addTFEvents(),t.mouseMoveHandler=function(e){var i=e.layerPoint;t.currentMousePosition=ao().point(i.x+t.movingOffset[0],i.y+t.movingOffset[1])},e.on("mousemove",t.mouseMoveHandler),t.update(e.getBounds())}else e.removeLayer(t)},addFeatures:function(e){},redrawThematicFeatures:function(e){},destroyFeatures:function(e){if(void 0===e&&(e=this.features),e){this.removeFeatures(e),Array.isArray(e)||(e=[e]);for(var t=e.length-1;t>=0;t--)e[t].destroy()}},removeFeatures:function(e){var t=this;if(e){if(e===t.features)return t.removeAllFeatures();ao().Util.isArray(e)||"function"==typeof e||(e=[e]);for(var i=[],r=0;rh)){var y=o[0];o.splice(0,1),delete a[y]}}}}if(t.renderer.render(),r&&t.options.isHoverAble&&t.options.isMultiHover){var g=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(g)}},createThematicFeature:function(e){var t=this,i=t.getStyleByData(e);e.style&&t.isAllowFeatureStyle&&(i=ee.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=t.options.nodesClipPixel,r.isHoverAble=t.options.isHoverAble,r.isMultiHover=t.options.isMultiHover,r.isClickAble=t.options.isClickAble,r.highlightStyle=ra.transformStyle(t.highlightStyle);for(var s=new oa(e,t,ra.transformStyle(i),r),n=0;n0;if(t.themeField&&o&&i.attributes){var l=t.themeField,h=i.attributes;for(var u in h)if(l===u){n=!0,a=h[u];break}}if(n)for(var c=0,d=s.length;c0;if(t.themeField&&o&&i.attributes){var l=t.themeField,h=i.attributes;for(var u in h)if(l===u){n=!0,a=h[u];break}}if(n)for(var c=0,d=s.length;c=s[c].start&&a<=s[c].end:a>=s[c].start&&a0&&0==this.labelFeatures.length)for(var t=this.setLabelsStyle(this.features),i=0,r=t.length;i=0&&p.x<=h.x&&p.y>=0&&p.y<=h.y){if(i.style.minZoomLevel>-1&&u<=i.style.minZoomLevel)continue;if(i.style.maxZoomLevel>-1&&u>i.style.maxZoomLevel)continue;var f=null;i.isStyleChange?(i.isStyleChange=null,f=this.calculateLabelBounds(i,p)):f=i.geometry.bsInfo.w&&i.geometry.bsInfo.h?this.calculateLabelBounds2(i,p):this.calculateLabelBounds(i,p);var m=new se(0,h.y,h.x,0),y=f.length;if(this.options.isAvoid){var g=this.getAvoidInfo(m,f);if(g){if("left"===g.aspectW){i.style.labelXOffset+=g.offsetX;for(let e=0;e=s[l].start&&a=s[l].start&&ao&&(o=i,l="top")}if(t.y>e.bottom){let i=Math.abs(t.y-e.bottom);i>o&&(o=i,l="bottom")}if(t.xa&&(a=i,h="left")}if(t.x>e.right){let i=Math.abs(t.x-e.right);i>a&&(a=i,h="right")}}}},isQuadrilateralOverLap:function(e,t){var i=e.length,r=t.length;if(5!==i||5!==r)return null;var s=!1;for(let r=0;r=0&&e.options.fontOpacity<1&&(i.globalAlpha=e.options.fontOpacity),i.fillText){i.font=r,i.textAlign=e.options.textAlign,i.textBaseline=e.options.textBaseline;let s=e.options.vfactor,o=i.measureText("Mg").height||i.measureText("xx").width;t.y+=o*s*(a-1);for(let r=0;r0;){var s=t.pop(),n=s.type,a=s.layerType=s.layerType||"BASE_LAYER";"OVERLAY_LAYER"!==a&&(n=a),this.createLayer(n,s)}this.fire("maploaded",{map:this._map})}},createCRS:function(e,t,i,r,s){return e<0?new Eo({bounds:s,origin:r,resolutions:i}):910112===e||910102===e?bo:(910111===e&&(e=3857),910101===e&&(e=4326),uo("EPSG:"+e,{origin:r,resolutions:i,bounds:s}))},createMap:function(e){var t=e.crs||ao().CRS.EPSG3857,i=ao().latLngBounds(t.unproject(e.bounds.min),t.unproject(e.bounds.max));this._map=ao().map(this.options.map,{center:i.getCenter(),maxZoom:e.maxZoom||22,minZoom:e.minZoom||0,zoom:e.zoom||0,crs:t,renderer:ao().canvas()}),t instanceof Eo?this._map.setZoom(e.zoom?e.zoom+2:2,{maxZoom:e.maxZoom||22}):this._map.fitBounds(i,{maxZoom:e.maxZoom||22})},getResolutionsFromScales:function(e,t,i,r){for(var s=[],n=0;n{var t=ao().geoJSON(e.result,{pointToLayer:function(e,t){var i=new(ao().Marker)(t);return i.setStyle=function(e){e&&i.setIcon(e)},i},coordsToLatLng:a,style:function(e){return this.cartoCSSToLeaflet.getStyleFromiPortalStyle(r||{},e.geometry.type,e.properties.style)},opacity:s});this.options.featureLayerPopupEnable&&t.bindPopup(n.options.featureLayerPopup||n.defaultFeatureLayerPopup),this.addLayer(t)})}},getFeaturesBySQL:function(e,t,i,r,s,n){var a=new Ji({queryParameter:{name:i+"@"+t,attributeFilter:r=r||"SMID > 0"},datasetNames:[t+":"+i],fromIndex:0,toIndex:1e5});hl(e).getFeaturesBySQL(a,n,s)},createThemeLayer:function(e){var t,i=e.themeSettings&&JSON.parse(e.themeSettings),r=i.type;if(e.themeSettings=i,(t="HEAT"===r?this.createHeatLayer(e,i):"UNIQUE"===r?this.createUniqueLayer(e,i):"RANGE"===r?this.createRangeLayer(e,i):this.createBaseThemeLayer(e,i))&&(this.addFeature2ThemeLayer(e,t),t.on("add",e=>{this.registerThemeEvent(e.target)})),i&&i.labelField){var s=this.createLabelLayer(e,i);s.on("add",e=>{this.registerThemeEvent(e.target)}),t.labelLayer=s}return t},createBaseThemeLayer:function(e,t){let i=e.style,r=e.opacity,s=t.vectorType,n=i.pointStyle;n.fill="LINE"!==s;var a={};a.radius=n.pointRadius,a.color=n.strokeColor,a.opacity=n.strokeOpacity,a.lineCap=n.strokeLineCap,a.weight=n.strokeWidth,a.fillColor=n.fillColor,a.fillOpacity=n.fillOpacity;var o=(e,t)=>ao().circleMarker(t,a);return n.unicode&&(o=((e,t)=>new ul(t,n))),ao().geoJSON({type:"GeometryCollection",geometries:[]},{pointToLayer:o,opacity:r})},createUniqueLayer:function(e,t){for(var i=e.title,r=t.field,s=[],n=t.settings,a=e.isVisible,o=e.opacity,l=t.vectorType,h=0;h0?{fillColor:"#ffffff"}:n[0].style;var o=ao().Util.extend(new Nn,i);o.fontWeight="bold",o.fontSize="14px",o.labelRect=!0,o.strokeColor=o.fillColor,o.fontColor=t.labelColor,t.labelFont&&(o.fontFamily=t.labelFont);var l=new ol(r,{visibility:a,opacity:.7});return this.registerThemeEvent(l),l.style=o,l.themeField=s,l.styleGroups=[],l},createHeatLayer:function(e,t){let i,r=t.colors||["blue","cyan","lime","yellow","red"],s={};for(let e=0,t=r.length,i=1;e0&&n.push(s[o]);else for(var h=0,u=(s=r.parseFeatureFromJson(t.content)).length;h0&&n.push(s[h]);var c=e.prjCoordSys&&e.prjCoordSys.epsgCode;a?r.changeFeatureLayerEpsgCode(c,"4326",i,n,function(e){E(e)}):E(n)},function(){});else{for(var g=[],v=e.features,b=0,_=v.length;b<_;b++){var S=v[b];if(Xo()({attr:S.attributes},y).length>0){var x=S.geometry.points[0].x,w=S.geometry.points[0].y,C=new le(x,w),M=new xe(C,S.attributes,S.style);g.push(M)}}E(g)}}else if(s){var A=e.datasourceName;u=(h=(l=e.subLayers&&JSON.parse(e.subLayers)).length&&l.length>0?l[0]:l)&&h.name,this.getFeaturesBySQL(e.url,A,u,p.filter,t.ISERVER,t=>{var r,s,n=t.result,o=[];if(n&&n.features){for(var l=0,h=(r=n.features).length;l0?l[0]:l)&&h.name;var T=e.prjCoordSys&&e.prjCoordSys.epsgCode;this.getFeaturesBySQL(c,d,u,f,t.ISERVER,function(e){a?r.changeFeatureLayerEpsgCode(T,"4326",i,e,function(e){E(e)}):E(e)})}}function E(t){if(i&&i.labelLayer instanceof ol&&r.addFeature2LabelLayer(i.labelLayer,t,e),ao().HeatLayer&&i instanceof ao().HeatLayer){var s=[];for(let e=0,r=t.length;e0){for(n=0,a=r.length;ne.json()).then(e=>{var r=e;t||void 0===t.length||(r=r[0]),this.fire("coordconvertsuccess",{newCoors:r}),i.call(this,r)}).catch(e=>{this.actived&&this.fire("coordconvertfailed",{err:e})})},getSQLFromFilter:function(e){return e?" * where ("+(e=e.replace(/=/g,"==").replace(/and|AND/g,"&&").replace(/or|OR/g,"||").replace(/>==/g,">=").replace(/<==/g,"<="))+")":" * where (1==1||1>=0)"},getAttributesObjFromTable:function(e,t){if(0!==e.length&&0!==t.length){for(var i=[],r=0;re.json()).then(e=>{t&&t(e)}).catch(e=>i&&i(e))},getCartoCSS2Obj:function(e){var t,i=!1;return e.indexOf("}")>-1?(i=(e=JSON.parse(e)).needTransform,t=e.isAddFile):"needTransform"===e?(i=!0,t=!1):t="true"===e,{isAddFile:t,needTransform:i}},registerThemeEvent:function(e){e.on("click",t=>{if(!e.map)return;let i;this.selectedFeature&&(this.fire("featureunselected",{feature:this.selectedFeature}),this.selectedFeature=null),t.target&&t.target.refDataID&&(i=e.getFeatureById(t.target.refDataID)),i&&(this.selectedFeature=i,this.fire("featureselected",{feature:i}))}),e.on("mousemove",t=>{if(e.map&&t.target&&t.target.refDataID){let i;t.target&&t.target.refDataID&&(i=e.getFeatureById(t.target.refDataID)),i&&this.fire("featuremousemove",{feature:i})}})},SERVER_TYPE_MAP:{"EPSG:4326":"WGS84","EPSG:3857":"MERCATOR","EPSG:900913":"MERCATOR","EPSG:102113":"MERCATOR","EPSG:910101":"GCJ02","EPSG:910111":"GCJ02MERCATOR","EPSG:910102":"BD","EPSG:910112":"BDMERCATOR"}}),dl=ao().TileLayer.extend({options:{collectionId:null,sqlFilter:null,ids:null,names:null,renderingRule:null,format:"png",zoomOffset:1,transparent:!0,cacheEnabled:!0,tileProxy:null,attribution:co.Common.attribution,subdomains:null},initialize:function(e,t){this._url=e,ao().TileLayer.prototype.initialize.apply(this,arguments),ao().setOptions(this,t),ao().stamp(this)},onAdd:function(e){ao().TileLayer.prototype.onAdd.call(this,e)},getTileUrl:function(e){var t=this._getLayerUrl()+"&z="+this._getZoomForUrl()+"&x="+e.x+"&y="+e.y;return this.options.tileProxy&&(t=this.options.tileProxy+encodeURIComponent(t)),this.options.cacheEnabled||(t+="&_t="+(new Date).getTime()),this.options.subdomains&&(t=ao().Util.template(t,{s:this._getSubdomain(e)})),t},_getLayerUrl:function(){return this._layerUrl||this._createLayerUrl()},_createLayerUrl:function(){let e=ee.urlPathAppend(this._url,`/collections/${this.options.collectionId}/tile.${this.options.format}`);return this.requestParams=this.requestParams||this._getAllRequestParams(),e=ee.urlAppend(e,no.Util.getParamString(this.requestParams)),e=je.appendCredential(e),this._layerUrl=e,e},_getAllRequestParams:function(){var e=this.options||{},t={};return t.transparent=!0===e.transparent,t.cacheEnabled=!(!1===e.cacheEnabled),e.sqlFilter&&(t.sqlFilter=e.sqlFilter),e.renderingRule&&(t.renderingRule=JSON.stringify(e.renderingRule)),e.ids&&(t.ids=e.ids.join(",")),e.names&&(t.names=e.names.join(",")),t}});function pl(e,t){const{maxZoom:i=22}=t||{},{bounds:r,prjCoordSys:s,dpi:n,visibleScales:a,coordUnit:o}=e,l=An(a,r,n,o,i);if(fl(s))return function(e){let t={bounds:ao().bounds([e.left,e.bottom],[e.right,e.top]),origin:ao().point(e.left,e.top)};return new Eo(t)}(r);const h=yl(s);return ml(h)?function(e,{bounds:t,dpi:i,resolutions:r}){const s=lo()(e,"EPSG:4326").forward([t.left,0],!0),n=lo()(e,"EPSG:4326").forward([t.right,0],!0);let a={wrapLng:[parseInt(s[0]),parseInt(n[0])],bounds:ao().bounds([t.left,t.bottom],[t.right,t.top]),origin:[t.left,t.top],dpi:i};r&&r.length>0&&(a.resolutions=r);return new ho(e,a)}(h,{bounds:r,dpi:n,resolutions:l}):void 0}function fl(e){return"PCS_NON_EARTH"===e.type}function ml(e,t=!0){try{lo()(e)}catch(i){return t&&console.error(`The projection of ${e} is missing, please register the projection of ${e} first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection`),!1}return!0}function yl(e){const{type:t,epsgCode:i}=e;return"PCS_NON_EARTH"==t?"":"EPSG:"+i}var gl=po.extend({options:{geometry:null,prjCoordSys:null,excludeField:null},initialize:function(e,t){t=t||{},ao().setOptions(this,t),t.projection&&(this.options.prjCoordSys=t.projection),po.prototype.initialize.call(this,e,t),this.dataFlow=new Rt(e,t),this.dataFlow.events.on({broadcastSocketConnected:this._defaultEvent,broadcastSocketError:this._defaultEvent,broadcastFailed:this._defaultEvent,broadcastSucceeded:this._defaultEvent,subscribeSocketConnected:this._defaultEvent,subscribeSocketError:this._defaultEvent,messageSucceeded:this._defaultEvent,setFilterParamSucceeded:this._defaultEvent,scope:this})},initBroadcast:function(){return this.dataFlow.initBroadcast(),this},broadcast:function(e){this.dataFlow.broadcast(e)},initSubscribe:function(){return this.dataFlow.initSubscribe(),this},setExcludeField:function(e){return this.dataFlow.setExcludeField(e),this.options.excludeField=e,this},setGeometry:function(e){return this.dataFlow.setGeometry(e),this.options.geometry=e,this},unSubscribe:function(){this.dataFlow.unSubscribe()},unBroadcast:function(){this.dataFlow.unBroadcast()},_defaultEvent:function(e){this.fire(e.eventType||e.type,e)}});const vl=function(){try{return mapv}catch(e){return{}}}();var bl=vl.baiduMapLayer?vl.baiduMapLayer.__proto__:Function;var _l=ao().Layer.extend({options:{attributionPrefix:null,attribution:co.MapV.attribution},initialize:function(e,t,i){i=i||{},this.dataSet=e||{},this.mapVOptions=t||{},this.render=this.render.bind(this),ao().Util.setOptions(this,i),this.options.attributionPrefix&&(this.options.attribution=this.options.attributionPrefix+this.options.attribution),this.canvas=this._createCanvas(),ao().stamp(this)},onAdd:function(e){this._map=e;var t=this.getPane(),i=this.container=ao().DomUtil.create("div","leaflet-layer leaflet-zoom-animated",t);i.appendChild(this.canvas);var r=e.getSize();i.style.width=r.x+"px",i.style.height=r.y+"px",this.renderer=new class extends bl{constructor(e,t,i,r){super(e,i,r),bl&&(r=r||{},this.init(r),this.argCheck(r),this.canvasLayer=t,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this._moveStartEvent=this.moveStartEvent.bind(this),this._moveEndEvent=this.moveEndEvent.bind(this),this._zoomStartEvent=this.zoomStartEvent.bind(this),this.bindEvent())}clickEvent(e){var t=this.map.containerPointToLayerPoint([0,0]),i=this.devicePixelRatio=this.canvasLayer.devicePixelRatio=window.devicePixelRatio||1,r=e.layerPoint;super.clickEvent(ao().point((r.x-t.x)/i,(r.y-t.y)/i),e)}mousemoveEvent(e){var t=e.layerPoint;super.mousemoveEvent(t,e)}bindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.on("click",this.clickEvent),this.options.methods.mousemove&&e.on("mousemove",this.mousemoveEvent)),this.map.on("movestart",this._moveStartEvent),this.map.on("moveend",this._moveEndEvent),this.map.on("zoomstart",this._zoomStartEvent)}destroy(){this.unbindEvent(),this.clearData(),this.animator&&this.animator.stop(),this.animator=null,this.canvasLayer=null}unbindEvent(){var e=this.map;this.options.methods&&(this.options.methods.click&&e.off("click",this.clickEvent),this.options.methods.mousemove&&e.off("mousemove",this.mousemoveEvent)),this.map.off("movestart",this._moveStartEvent),this.map.off("moveend",this._moveEndEvent),this.map.off("zoomstart",this._zoomStartEvent)}getContext(){return this.canvasLayer.getCanvas().getContext(this.context)}addData(e,t){var i=e;e&&e.get&&(i=e.get()),this.dataSet.add(i),this.update({options:t})}update(e){var t=e||{},i=t.data;i&&i.get&&(i=i.get()),void 0!=i&&this.dataSet.set(i),super.update({options:t.options})}getData(){return this.dataSet}removeData(e){if(this.dataSet){var t=this.dataSet.get({filter:function(t){return null==e||"function"!=typeof e||!e(t)}});this.dataSet.set(t),this.update({options:null})}}clearData(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}_canvasUpdate(e){if(this.canvasLayer){var t=this,i=t.options.animation,r=this.getContext(),s=this.map;if(t.isEnabledTime()){if(void 0===e)return void this.clear(r);"2d"===this.context&&(r.save(),r.globalCompositeOperation="destination-out",r.fillStyle="rgba(0, 0, 0, .1)",r.fillRect(0,0,r.canvas.width,r.canvas.height),r.restore())}else this.clear(r);if("2d"===this.context)for(var n in t.options)r[n]=t.options[n];else r.clear(r.COLOR_BUFFER_BIT);if(!(t.options.minZoom&&s.getZoom()t.options.maxZoom)){var a=s.getBounds(),o=a.getEast()-a.getWest(),l=a.getNorth()-a.getSouth(),h=s.getSize(),u=o/h.x,c=l/h.y,d=No("DEGREE")*u,p=this.canvasLayer.getTopLeft(),f=s.latLngToAccurateContainerPoint(p),m={transferCoordinate:function(e){var i,r={x:(i="2d"===t.context?s.latLngToAccurateContainerPoint(ao().latLng(e[1],e[0])):{x:(e[0]-p.lng)/u,y:(p.lat-e[1])/c}).x-f.x,y:i.y-f.y};return[r.x,r.y]}};void 0!==e&&(m.filter=function(t){var r=i.trails||10;return e&&t.time>e-r&&t.time{this.update({data:this.data,options:this.mapVOptions})})),r.icon=o,(n.options.iconSize||o.style.height)&&(this.mapVOptions.offset={x:0,y:-(n.options.iconSize[1]||o.style.height)/2}),this.options.deg&&(r.deg=this.options.deg,"function"==typeof r.deg&&this.idCache[t]&&this.data[this.idCache[t]]&&(r.deg=r.deg(e.featureResult,ao().latLng(i.coordinates[1],i.coordinates[0]),this.data[this.idCache[t]])))}if(s instanceof ao().CircleMarker){this.mapVOptions.draw="simple";const e=this._toMapvStyle(s);for(const t in e)e.hasOwnProperty(t)&&(r[t]=e[t])}}else if(this.options.style){const t=this._toMapvStyle(this.options.style(e.featureResult));for(const e in t)t.hasOwnProperty(e)&&(r[e]=t[e])}void 0==this.idCache[t]?(this.data.push(r),this.idCache[t]=this.data.length-1):this.data[this.idCache[t]]=r,new Date-this._last>200&&(this._last=new Date,this.update({data:this.data,options:this.mapVOptions}))},_toMapvStyle:function(e){const t={draw:"simple"};return t.strokeStyle=e.color,t.lineWidth=e.width,t.globalAlpha=e.fillOpacity||e.opacity,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.fillStyle=e.fillColor,t.size=e.radius,t}}),xl=ao().GeoJSON.extend({initialize:function(e,t){(t=t||{}).style&&!t.pointToLayer&&(t.pointToLayer=function(e,i){return ao().circleMarker(i,t.style())}),ao().Util.setOptions(this,t),this._layers={},ao().stamp(this),this.url=e,this.idCache={}},onMessageSuccessed:function(e){const t=e.featureResult,i=e.featureResult.properties[this.options.idField];let r=null;void 0!==i&&this.idCache[i]?(r=this.getLayer(this.idCache[i]),this._updateLayerData(r,t)):((r=ao().GeoJSON.geometryToLayer(t,this.options)).feature=ao().GeoJSON.asFeature(t),this.addLayer(r),void 0!==i&&(this.idCache[i]=this.getLayerId(r))),this.options.onEachFeature&&this.options.onEachFeature(t,r)},_updateLayerData:function(e,t){t.properties&&(e.feature.properties=t.properties);var i=[];switch(t.geometry.type){case"Point":i=ao().GeoJSON.coordsToLatLng(t.geometry.coordinates),e.setLatLng(i);break;case"LineString":i=ao().GeoJSON.coordsToLatLngs(t.geometry.coordinates,0),e.setLatLngs(i);break;case"MultiLineString":case"Polygon":i=ao().GeoJSON.coordsToLatLngs(t.geometry.coordinates,1),e.setLatLngs(i);break;case"MultiPolygon":i=ao().GeoJSON.coordsToLatLngs(t.geometry.coordinates,2),e.setLatLngs(i)}}}),wl=ao().LayerGroup.extend({options:{geometry:null,prjCoordSys:null,excludeField:null,idField:"id",render:"normal"},initialize:function(e,t){t=t||{},ao().Util.setOptions(this,t),this.url=e,this._layers={},this.dataService=new gl(this.url,{geometry:this.options.geometry,prjCoordSys:this.options.prjCoordSys,excludeField:this.options.excludeField})},onAdd:function(e){this.dataService.initSubscribe(),this.dataService.on("subscribeSocketConnected",e=>this.fire("subscribesucceeded",e)),this.dataService.on("subscribeSocketError",e=>this.fire("subscribefailed",e)),this.dataService.on("messageSucceeded",e=>this._onMessageSuccessed(e)),this.dataService.on("setFilterParamSucceeded",e=>this.fire("setfilterparamsucceeded",e)),"mapv"===this.options.render?this.addLayer(new Sl(this.url,this.options)):this.addLayer(new xl(this.url,this.options)),ao().LayerGroup.prototype.onAdd.call(this,e)},onRemove:function(e){ao().LayerGroup.prototype.onRemove.call(this,e),this.dataService&&this.dataService.unSubscribe()},setExcludeField:function(e){return this.dataService.setExcludeField(e),this.options.excludeField=e,this},setGeometry:function(e){return this.dataService.setGeometry(e),this.options.geometry=e,this},_onMessageSuccessed:function(e){this.getLayers().map(t=>(t.onMessageSuccessed&&(t.onMessageSuccessed(e),this.fire("dataupdated",{layer:t,data:e.featureResult})),t))}});const Cl=ao().Layer.extend({includes:[],_echartsContainer:null,_map:null,_ec:null,_echartsOptions:null,options:{attribution:co.ECharts.attribution,loadWhileAnimating:!1},initialize:function(e,t){ao().Util.setOptions(this,t),this.setOption(e)},setOption:function(e,t,i){const r=e.baseOption||e;r.LeafletMap=r.LeafletMap||{roam:!0},r.animation=!0===r.animation,this._echartsOptions=e,this._ec&&this._ec.setOption(e,t,i)},getEcharts:function(){return this._ec},_disableEchartsContainer:function(){this._echartsContainer.style.visibility="hidden"},_enableEchartsContainer:function(){this._echartsContainer.style.visibility="visible"},onAdd:function(e){this._map=e,this._initEchartsContainer(),this._ec=Ca.init(this._echartsContainer),this._ec.leafletMap=e;const t=this;e.on("zoomstart",function(){t._disableEchartsContainer()}),!t.options.loadWhileAnimating&&e.on("movestart",function(){t._disableEchartsContainer()}),Ca.registerAction({type:"LeafletMapLayout",event:"LeafletMapLayout",update:"updateLayout"},function(e){}),Ca.registerCoordinateSystem("leaflet",Ml),Ca.extendComponentModel({type:"LeafletMap",getBMap:function(){return this.__LeafletMap},defaultOption:{roam:!1}}),Ca.extendComponentView({type:"LeafletMap",render:function(e,i,r){let s=!0,n=i.scheduler.ecInstance.leafletMap;const a=r.getZr().painter.getViewportRoot(),o=n.options.zoomAnimation&&ao().Browser.any3d;a.className=" leaflet-layer leaflet-zoom-"+(o?"animated":"hide")+" echarts-layer";const l=ao().DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);a.style[l]="50% 50%";const h=e.coordinateSystem,u=r.getZr().painter.getLayers();Tl(t._map,a);const c=function(){if(s)return;const i=Tl(t._map,a);if(!t.options.loadWhileAnimating){for(let e in u)u.hasOwnProperty(e)&&u[e]&&(n=u[e].ctx)&&n.clearRect&&n.clearRect(0,0,n.canvas.width,n.canvas.height);t._enableEchartsContainer()}var n;h.setMapOffset(i),e.__mapOffset=i,r.dispatchAction({type:"LeafletMapLayout"})};function d(){s||(r.dispatchAction({type:"LeafletMapLayout"}),t._enableEchartsContainer())}t._oldMoveHandler&&n.off(t.options.loadWhileAnimating?"move":"moveend",t._oldMoveHandler),t._oldZoomEndHandler&&n.off("zoomend",t._oldZoomEndHandler),n.on(t.options.loadWhileAnimating?"move":"moveend",c),n.on("zoomend",d),t._oldMoveHandler=c,t._oldZoomEndHandler=d,s=!1}}),this._ec.setOption(this._echartsOptions)},onRemove:function(){this._ec.clear(),this._ec.dispose(),delete this._ec,ao().DomUtil.remove(this._echartsContainer),this._oldZoomEndHandler&&(this._map.off("zoomend",this._oldZoomEndHandler),this._oldZoomEndHandler=null),this._oldMoveHandler&&(this._map.off(this.options.loadWhileAnimating?"move":"moveend",this._oldMoveHandler),this._oldMoveHandler=null),this._resizeHandler&&(this._map.off("resize",this._resizeHandler),this._resizeHandler=null),delete this._map},_initEchartsContainer:function(){const e=this._map.getSize(),t=document.createElement("div");t.style.position="absolute",t.style.height=e.y+"px",t.style.width=e.x+"px",t.style.zIndex=10,this._echartsContainer=t,this.getPane().appendChild(this._echartsContainer);const i=this;function r(e){let t=e.newSize;i._echartsContainer.style.width=t.x+"px",i._echartsContainer.style.height=t.y+"px",i._ec.resize()}this._map.on("resize",r),this._resizeHandler=r}});function Ml(e){this._LeafletMap=e,this.dimensions=["lng","lat"],this._mapOffset=Al(e)}function Al(e){const t=e.containerPointToLayerPoint([0,0]);return[t.x||0,t.y||0]}function Tl(e,t){const i=Al(e);return t.style.left=i[0]+"px",t.style.top=i[1]+"px",i}Ml.prototype.dimensions=["lng","lat"],Ml.prototype.setMapOffset=function(e){this._mapOffset=e},Ml.prototype.getBMap=function(){return this._LeafletMap},Ml.prototype.prepareCustoms=function(){const e=Ca.util,t=this.getViewRect();return{coordSys:{type:"leaflet",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:e.bind(this.dataToPoint,this),size:e.bind(function(t,i){return i=i||[0,0],e.map([0,1],function(e){const r=i[e],s=t[e]/2,n=[],a=[];return n[e]=r-s,a[e]=r+s,n[1-e]=a[1-e]=i[1-e],Math.abs(this.dataToPoint(n)[e]-this.dataToPoint(a)[e])},this)},this)}}},Ml.prototype.dataToPoint=function(e){null===e[1]&&(e[1]=ao().CRS.EPSG3857.projection.MAX_LATITUDE);const t=this._LeafletMap.latLngToLayerPoint([e[1],e[0]]),i=this._mapOffset;return[t.x-i[0],t.y-i[1]]},Ml.prototype.fixLat=function(e){return e>=90?89.99999999999999:e<=-90?-89.99999999999999:e},Ml.prototype.pointToData=function(e){let t=this._mapOffset,i=this._LeafletMap.layerPointToLatLng([e[0]+t[0],e[1]+t[1]]);return[i.lng,i.lat]},Ml.prototype.getViewRect=function(){const e=this._LeafletMap.getSize();return new Ca.graphic.BoundingRect(0,0,e.x,e.y)},Ml.prototype.getRoamTransform=function(){return Ca.matrix.create()},Ml.dimensions=Ml.prototype.dimensions,Ml.create=function(e){let t,i=e.scheduler.ecInstance.leafletMap;e.eachComponent("LeafletMap",function(e){t||(t=new Ml(i)),e.coordinateSystem=t,e.coordinateSystem.setMapOffset(e.__mapOffset||Al(i))}),e.eachSeries(function(e){"leaflet"===e.get("coordinateSystem")&&(t||(t=new Ml(i)),e.coordinateSystem=t,e.animation=!0===e.animation)})};function El(e){var t=document.createElement("canvas");return t&&t.getContext(e)}var Ll=ao().Class.extend({options:{radius:10,angele:60,spaceAngle:0,count:3,fill:!1,stroke:!0,color:"#3388ff",weight:1,lineCap:"round",lineJoin:"round",fillColor:"#66ccff",fillOpacity:.2,fillRule:"evenodd",opacity:1,strokeWidth:1},initialize:function(e){e=e||{},ao().Util.setOptions(this,e),this._canvas=document.createElement("canvas"),this._canvas.width=2*(this.options.radius+this.options.weight),this._canvas.height=2*(this.options.radius+this.options.weight),this._ctx=this._canvas.getContext("2d");var t=void 0===this.options.strokeWidth?1:this.options.strokeWidth;this.options.width=2*(this.options.radius+t)+1,this._initStyle()},getStyle:function(){return this._canvas},drawSector:function(e,t,i,r,s,n){s=s/180*Math.PI,n=n/180*Math.PI,e.moveTo(t,i),e.lineTo(t+r*Math.cos(s),i+r*Math.sin(s)),e.arc(t,i,r,s,n),e.lineTo(t,i)},_initStyle:function(){var e=0,t=this.options,i=t.angle;if(t.spaceAngle=360/t.count-t.angle,!(t.spaceAngle<0)){this._ctx.beginPath(),this.anchor=[t.width/2,t.width/2];for(var r=0;r=0;t--){let s,n,a;const o=i.latLngToLayerPoint(r[t].getLatLng());let l=r[t].getStyle();if(!l&&this.defaultStyle&&(l=this.defaultStyle),l.img){let e=l.img.width,t=l.img.height;l.size&&l.size[0]&&l.size[1]&&(e=l.size[0],t=l.size[1]);const i=l.anchor||[e/2,t/2];s=ao().point(o.x-i[0],o.y-i[1]),n=ao().point(s.x+e,s.y+t)}else s=ao().point(o.x-l.width/2,o.y-l.height/2),n=ao().point(o.x+l.width/2,o.y+l.height/2);if((a=ao().bounds(s,n)).contains(e))return r[t]}return null},containsPoint:function(e){return!!this._getGraphicAtPoint(e)},_handleClick:function(e){e.target=null;const t=this.layer,i=t._map,r=this._getGraphicAtPoint(i.latLngToLayerPoint(e.latlng));if(r)return this.layer._renderer._ctx.canvas.style.cursor="pointer",e.target=r,void("click"===e.type&&t.options.onClick&&t.options.onClick.call(t,r,e));this.layer._renderer._ctx.canvas.style.cursor="auto"},_clearBuffer:Nl});ao().Canvas.include({drawGraphics:function(e,t){var i=this;i._drawing&&e.forEach(function(e){var r=e.getStyle();!r&&t&&(r=t),r.img?i._drawImage.call(i,i._ctx,r,e.getLatLng()):i._drawCanvas.call(i,i._ctx,r,e.getLatLng())})},_drawCanvas:function(e,t,i){var r=t,s=this._map.latLngToLayerPoint(i),n=s.x-r.width/2,a=s.y-r.height/2,o=r.width,l=r.height;e.drawImage(r,n,a,o,l)},_drawImage:function(e,t,i){var r,s;if(t.size){var n=t.size;r=n[0],s=n[1]}else r=t.img.width,s=t.img.height;var a=this._coordinateToPoint(i),o=ao().point(a),l=ao().point(t.anchor||[r/2,s/2]);a=[o.x-l.x,o.y-l.y],e.drawImage(t.img,a[0],a[1],r,s)},_coordinateToPoint:function(e){if(!this._map)return e;var t=e;ao().Util.isArray(e)?t=ao().latLng(e[0],e[1]):e instanceof ao().LatLng&&(t=ao().latLng(e.lat,e.lng));var i=this._map.latLngToLayerPoint(t);return[i.x,i.y]}});const Fl=ao().Util.falseFn,kl=function(){let e=document.createElement("div"),t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(let i=0;i-1&&(this._data=e),this._renderLayer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0}),this._refreshData();let t=this._getLayerState();t.data=this._data||[],this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),this._renderLayer.setState(t)},drawGraphics:function(e){this._clearBuffer();let t=this.layer._map.getSize();this._container.width!==t.x&&(this._container.width=t.x),this._container.height!==t.y&&(this._container.height=t.y);let i=this.layer._map.getPanes().mapPane._leaflet_pos;this._container.style[kl]="translate("+-Math.round(i.x)+"px,"+-Math.round(i.y)+"px)",this._data=e||[],this._renderLayer||this._createInnerRender(),this._draw()},_initContainer:function(){this._container=this._createCanvas(this.options.width,this.options.height),this._layerContainer=this.options.container,this._wrapper=ao().DomUtil.create("div","deck-wrapper",this._layerContainer),this._wrapper.appendChild(this._container)},_createCanvas:function(e,t){let i=ao().DomUtil.create("canvas","graphicLayer leaflet-layer leaflet-zoom-hide");return i.oncontextmenu=ao().Util.falseFn,i.width=e,i.height=t,i.style.width=e+"px",i.style.height=t+"px",i},_pixelToMeter:function(e){const t=this.layer._map.getBounds();return e*((t.getEast()-t.getWest())/this.layer._map.getSize().x*(6378137*Math.PI/180))},_createInnerRender:function(){let e=this,t=this._getLayerState(),{color:i,radius:r,opacity:s,highlightColor:n,radiusScale:a,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,outline:u}=t,c={id:"scatter-plot",data:e._data,pickable:Boolean(this.options.onClick)||Boolean(this.options.onHover),autoHighlight:!0,color:i,opacity:s,radius:r,radiusScale:a,highlightColor:n,radiusMinPixels:o,radiusMaxPixels:l,strokeWidth:h,coordinateSystem:this._isWGS84()?window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS:window.DeckGL.COORDINATE_SYSTEM.LNGLAT,isGeographicCoordinateSystem:this._isWGS84(),outline:u,getPosition:function(e){if(!e)return[0,0,0];let t=e.getLatLng();return t&&[t.lng,t.lat,0]},getColor:function(t){let i=e._getLayerDefaultStyle(),r=t&&t.options;return r&&r.color||i.color},getRadius:function(t){let i=e._getLayerDefaultStyle(),r=t&&t.getStyle();return r&&r.radius||i.radius},updateTriggers:{getColor:[i],getRadius:[r]}},d=this;this.options.onClick&&(c.onClick=function(){d._container.style.cursor="pointer",d.options.onClick.apply(d,arguments)}),this.options.onHover&&(c.onHover=function(){d._container.style.cursor="pointer",d.options.onHover.apply(d,arguments)}),e._renderLayer=new window.DeckGL.ScatterplotLayer(c)},_getLayerDefaultStyle:function(){if(this._layerDefaultStyleCache)return this._layerDefaultStyleCache;let{color:e,opacity:t,radius:i,radiusScale:r,radiusMinPixels:s,radiusMaxPixels:n,strokeWidth:a,outline:o}=this.layer.options;return i=this._pixelToMeter(i),this._layerDefaultStyleCache={color:e,opacity:t,radius:i,radiusScale:r,radiusMinPixels:s,radiusMaxPixels:n,strokeWidth:a,outline:o},this._layerDefaultStyleCache},_getLayerState:function(){let e=this.layer.getState();return e.zoom=e.zoom-1,e},_draw:function(){let e=this._getLayerState();this._refreshData(),e.data=this._data||[];let t={};for(let i in e)t[i]=e[i];this._layerDefaultStyleCache=null,this._renderLayer.setNeedsRedraw(!0),t.layers=[this._renderLayer],t.canvas=this._container,t.onBeforeRender=this._onBeforeRender.bind(this),t.onAfterRender=this._onAfterRender.bind(this),t.coordinateSystem=this._isWGS84()?window.DeckGL.COORDINATE_SYSTEM.LNGLAT_OFFSETS:window.DeckGL.COORDINATE_SYSTEM.LNGLAT,t.isGeographicCoordinateSystem=this._isWGS84(),this.deckGL?this.deckGL.setProps(t):this.deckGL=new window.DeckGL.experimental.DeckGLJS(t)},_clearBuffer:function(){if(this.deckGL){let e=this.deckGL.layerManager;e&&e.context.gl.clear(e.context.gl.COLOR_BUFFER_BIT)}return this},_refreshData:function(){let e=this._data||[],t=ao().Util.isArray(e)?[].concat(e):[e];this._renderLayer.props.data||(this._renderLayer.props.data=[]),this._renderLayer.props.data.length=0;for(let e=0;e=0;t--){let i=e[t],r=ee.indexOf(this.graphics,i);-1!==r&&this.graphics.splice(r,1)}this.update()},setStyle:function(e){let t=this.options,i={color:t.color,radius:t.radius,opacity:t.opacity,highlightColor:t.highlightColor,radiusScale:t.radiusScale,radiusMinPixels:t.radiusMinPixels,radiusMaxPixels:t.radiusMaxPixels,strokeWidth:t.strokeWidth,outline:t.outline};this.options=ao().Util.extend(this.options,i,e),this.defaultStyle=this._getDefaultStyle(this.options),this.update()},update:function(){this._layerRenderer.update(this.graphics)},clear:function(){this.removeGraphics()},getRenderer:function(){return this._renderer},getState:function(){let e=this._map,t=e.getSize().x,i=e.getSize().y,r=e.getCenter(),s=r.lng,n=r.lat,a=Ul[this._crs.code]||0;Gl[this._crs.code]&&this._crs.resolutions&&this._crs.resolutions.length>0&&(a=Math.round(Math.log2(Gl[this._crs.code]/this._crs.resolutions[0])));let o={longitude:s,latitude:n,zoom:e.getZoom()+a,maxZoom:e.getMaxZoom()+a,pitch:0,bearing:0},l={};for(let e in o)l[e]=o[e];l.width=t,l.height=i;let h=this.options;return l.color=h.color,l.radius=h.radius,l.opacity=h.opacity,l.highlightColor=h.highlightColor,l.radiusScale=h.radiusScale,l.radiusMinPixels=h.radiusMinPixels,l.radiusMaxPixels=h.radiusMaxPixels,l.strokeWidth=h.strokeWidth,l.outline=h.outline,l},_resize:function(){let e=this._map.getSize();this._container.width=e.x,this._container.height=e.y,this._container.style.width=e.x+"px",this._container.style.height=e.y+"px";let t=this._map.containerPointToLayerPoint([0,0]);ao().DomUtil.setPosition(this._container,t),this._update()},_moveEnd:function(){this._layerRenderer instanceof Dl&&this._update()},_createRenderer:function(){let e,t=this._map,i=t.getSize().x,r=t.getSize().y;if(this.options.render===Rl[0])e=new Il(this,{width:i,height:r,renderer:t.getRenderer(this)});else{let s=ao().Util.setOptions({},Bl),n=ao().Util.setOptions({options:s},this.options);(n=ao().Util.setOptions(this,n)).container=t.getPane("overlayPane"),n.width=i,n.height=r,e=new Dl(this,n)}return e.defaultStyle=this.defaultStyle,this._layerRenderer=e,this._layerRenderer.getRenderer()},_update:function(){this._map&&this._updatePath()},_updatePath:function(){let e=this._getGraphicsInBounds();this._renderer.drawGraphics(e,this.defaultStyle)},_project:function(){let e=this;e._getGraphicsInBounds().map(function(t){let i=e._map.latLngToLayerPoint(t.getLatLng()),r=e._clickTolerance(),s=[t._anchor+r,t._anchor+r];return t._pxBounds=new(ao().Bounds)(i.subtract(s),i.add(s)),t}),e._pxBounds=ao().bounds(ao().point(0,0),ao().point(this._container.width,this._container.height))},_getDefaultStyle:function(e){const t={};if(e.color){t.fill=!0;const i=this.toRGBA(e.color);t.color=i,t.fillColor=i}return e.opacity&&(t.opacity=e.opacity,t.fillOpacity=e.opacity),e.radius&&(t.radius=e.radius),e.strokeWidth&&(t.weight=e.strokeWidth),e.outline&&(t.stroke=e.outline),new Ol(t).getStyle()},toRGBA:e=>`rgba(${e[0]},${e[1]},${e[2]},${(e[3]||255)/255})`,_getGraphicsInBounds:function(){let e=[],t=this._map.getBounds();return this.graphics.map(function(i){return t.contains(i.getLatLng())&&e.push(i),i}),e},_handleClick:function(e){this._layerRenderer._handleClick(e)},beforeAdd:ao().Util.falseFn,_containsPoint:function(e){return this._layerRenderer.containsPoint(e)}});var zl=rl.extend({options:{isOverLay:!0},initialize:function(e,t,i){var r=[];r.push(e),r.push(i),rl.prototype.initialize.apply(this,r),this.chartsType=t,this.themeFields=i&&i.themeFields?i.themeFields:null,this.charts=i&&i.charts?i.charts:[],this.cache=i&&i.cache?i.cache:{},this.chartsSetting=i&&i.chartsSetting?i.chartsSetting:{}},setChartsType:function(e){this.chartsType=e,this.redraw()},addFeatures:function(e){var t=this;t.fire("beforefeaturesadded",{features:e}),this.features=this.toiClientFeature(e),t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures())},redrawThematicFeatures:function(e){var t=this;t.renderer.clearAll();var i=t.features;if(this.options.alwaysMapCRS&&e&&e instanceof ao().LatLngBounds){var r=this._map.options.crs;e=ao().bounds(r.project(e.getSouthWest()),r.project(e.getNorthEast()))}e=vo.toSuperMapBounds(e);for(var s=0,n=i.length;s=i.left&&a.x<=i.right&&a.y>=i.top&&a.y<=i.bottom){r=!0;break}}return r},clearCache:function(){this.cache={},this.charts=[]},removeFeatures:function(e){this.clearCache(),rl.prototype.removeFeatures.call(this,e)},removeAllFeatures:function(){this.clearCache(),rl.prototype.removeAllFeatures.apply(this,arguments)},redraw:function(){return this.clearCache(),rl.prototype.redraw.apply(this,arguments)},clear:function(){var e=this;e.renderer&&(e.renderer.clearAll(),e.renderer.refresh()),e.removeAllFeatures(),e.clearCache()},getWeightFieldValue:function(e,t,i){if((void 0===i||isNaN(i))&&(i=0),!e.attributes)return i;var r=e.attributes[t];return(void 0===r||isNaN(r))&&(r=i),r},_sortChart:function(){this.charts&&this.charts.sort(function(e,t){return void 0===e.__overlayWeight&&void 0===t.__overlayWeight?0:void 0!==e.__overlayWeight&&void 0===t.__overlayWeight?-1:void 0===e.__overlayWeight&&void 0!==t.__overlayWeight?1:void 0!==e.__overlayWeight&&void 0!==t.__overlayWeight?parseFloat(e.__overlayWeight)1?i.weight/10:i.weight)):t.setAttribute("stroke","none"),i.fill?(t.setAttribute("fill",i.fillColor||i.color),t.setAttribute("fill-opacity",i.fillOpacity)):t.setAttribute("fill","none")}});var $l=ao().CircleMarker.extend({includes:Zl.prototype,statics:{iconCache:{}},initialize:function(e,t){Zl.prototype.initialize.call(this,e),this._makeFeatureParts(e,t)},getLatLng:void 0,render:function(e,t){Zl.prototype.render.call(this,e,t),this._radius=t.radius||ao().CircleMarker.prototype.options.radius,this._updatePath()},_makeFeatureParts:function(e,t){t=t||{x:1,y:1};var i=e.geometry[0];"object"==typeof i[0]&&"x"in i[0]?(this._point=ao().point(i[0]).scaleBy(t),this._empty=ao().Util.falseFn):(this._point=ao().point(i).scaleBy(t),this._empty=ao().Util.falseFn)},makeInteractive:function(){this._updateBounds()},updateStyle:function(e,t){return this._radius=t.radius||this._radius,this._updateBounds(),Zl.prototype.updateStyle.call(this,e,t)},_updateBounds:function(){if(this.options.iconUrl&&this.options.iconSize){var e=ao().point(this.options.iconSize),t=e&&e.divideBy(2,!0),i=this._point.subtract(t);this._pxBounds=new(ao().Bounds)(i,i.add(e))}else ao().CircleMarker.prototype._updateBounds.call(this)},_updatePath:function(){this.options.iconUrl?this._renderer._updateIcon(this):ao().CircleMarker.prototype._updatePath.call(this)},_getImage:function(){if(!this.options.iconUrl)return null;var e=this.options.iconUrl,t=$l.iconCache[e];if(!t){var i=this.options.iconSize||[50,50];t=$l.iconCache[e]=this._createIcon(e,i)}return t},_createIcon:function(e,t){var i=e;if(!i)throw new Error("iconUrl not set in Icon options (see the docs).");var r=document.createElement("img");r.src=i,r.className="leaflet-marker-icon "+(this.layerName||"");var s=t;if("number"==typeof s&&(s=[s,s]),s){var n=ao().point(s),a=ao().point(n&&n.divideBy(2,!0));n&&(r.style.width=n.x+"px",r.style.height=n.y+"px"),a&&(r.style.marginLeft=-a.x+"px",r.style.marginTop=-a.y+"px")}return r.onload=function(){s||(r.style.width=this.width+"px",r.style.height=this.height+"px")},r},_containsPoint:function(e){return this.options.iconUrl?this._pxBounds.contains(e):ao().CircleMarker.prototype._containsPoint.call(this,e)}}),eh={_makeFeatureParts:function(e,t){t=t||{x:1,y:1};var i,r=e.geometry;this._parts=[];for(var s=0;s-1?new ah(r):new oh(r)).getTile().then(function(t){e.render(t,i)})},render:function(e,t){if(e){for(var i=this,r=i.renderer,s=i.layer,n=0;n0&&a[a.length-1]}t.properties.textField=n}i.vectorTileLayerStyles=i.vectorTileLayerStyles||{};var o=i.vectorTileLayerStyles[r];if(o)return t=this._mergeFeatureTextField(t,o),o;var l=this.getScaleFromCoords(e),h=this.cartoCSSToLeaflet.pickShader(r)||[];for(var u in o=[],h)for(var c=h[u],d=0;d1){var u=parseInt(h[1]);o=u&&u>=4e3&&u<=5e3?l.DEGREE:l.METER}}return Io(a,96,o)},_mergeFeatureTextField:function(e,t){if(!this.options.serverCartoCSSStyle||!t||"TEXT"!==e.type)return e;var i=t;ao().Util.isArray(t)||(i=[t]);for(var r=0;r0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)},convertFastToPixelPoints:function(e){var t,i,r,s,n,a,o,l=[],h=e.getEast()-e.getWest(),u=e.getNorth()-e.getSouth(),c=this._map.getSize();s=h/c.x>u/c.y?h/c.x:u/c.y,this.useRadius=this.useGeoUnit?parseInt(this.radius/s):this.radius;for(var d=0;d0&&this.maxWidth>0))return!1;var i=this.canvasContext;this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var r=0;r=0;i--)e.addInt32(t[i]);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 i=t.length-1;i>=0;i--)e.addFloat64(t[i]);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 i=t.length-1;i>=0;i--)e.addFloat64(t[i]);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 i=t.length-1;i>=0;i--)e.addFloat64(t[i]);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 i=t.length-1;i>=0;i--)e.addFloat64(t[i]);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 i=t.length-1;i>=0;i--)e.addInt64(t[i]);return e.endVector()}},{key:"startTmVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addType",value:function(e,t){e.addFieldInt8(6,t,ph.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 i=t.length-1;i>=0;i--)e.addOffset(t[i]);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,i,r,s,n,a,o,l,h){return e.startGeometry(t),e.addEnds(t,i),e.addXy(t,r),e.addZ(t,s),e.addM(t,n),e.addT(t,a),e.addTm(t,o),e.addType(t,l),e.addParts(t,h),e.endGeometry(t)}}],(i=[{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):ph.Unknown}},{key:"parts",value:function(t,i){var r=this.bb.__offset(this.bb_pos,18);return r?(i||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+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}}])&&_h(t.prototype,i),r&&_h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function wh(e,t){for(var i=[],r=0;r>1]),i.push(s)}return i}function Ch(e,t,i){if(!i||0===i.length)return[wh(e,t)];var r,s=0,n=Array.from(i).map(function(t){return e.slice(s,s=t<<1)});return t&&(s=0,r=Array.from(i).map(function(e){return t.slice(s,s=e)})),n.map(function(e,t){return wh(e,r?r[t]:void 0)})}function Mh(e,t){var i=t;if(i===ph.Unknown&&(i=e.type()),i===ph.GeometryCollection){for(var r=[],s=0;s=0;i--)e.addInt8(t[i]);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 i=t.length-1;i>=0;i--)e.addOffset(t[i]);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,i,r,s){return e.startFeature(t),e.addGeometry(t,i),e.addProperties(t,r),e.addColumns(t,s),e.endFeature(t)}}],(i=[{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 xh).__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 i=this.bb.__offset(this.bb_pos,8);return i?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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}}])&&Eh(t.prototype,i),r&&Eh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Oh=(new TextEncoder,new TextDecoder);function Ph(e,t){var i={};if(!t||0===t.length)return i;var r=e.propertiesArray();if(!r)return i;for(var s=new DataView(r.buffer,r.byteOffset),n=e.propertiesLength(),a=0;a=0;i--)e.addFloat64(t[i]);return e.endVector()}},{key:"startEnvelopeVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addGeometryType",value:function(e,t){e.addFieldInt8(2,t,ph.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 i=t.length-1;i>=0;i--)e.addOffset(t[i]);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)}}],(i=[{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):ph.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 i=this.bb.__offset(this.bb_pos,18);return i?(t||new Th).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 kh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"title",value:function(e){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"metadata",value:function(e){var t=this.bb.__offset(this.bb_pos,30);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&Dh(t.prototype,i),r&&Dh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Bh(e){for(var t=Rh.getRootAsHeader(e),i=t.featuresCount(),r=t.indexNodeSize(),s=[],n=0;ne)){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function Wh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var r,s,n=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw s}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yh(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Yh(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 Yh(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);ithis.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],"]")}}])&&Qh(t.prototype,i),r&&Qh(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),a=r.minX,o=r.minY,l=r.maxX,h=r.maxY,Jh.info("tree items: ".concat(t,", nodeSize: ").concat(i)),u=tu(t,i),c=u[0][0],void 0,m=u.length-1,d=new n([0,1],m),p=[d],Jh.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(t,", nodeSize: ").concat(i,", levelBounds: ").concat(u)),f=Hh().mark(function e(){var r,d,f,m,y,g,v,b,_,S,x,w;return Hh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=p.shift(),Jh.debug("popped node: ".concat(r,", queueLength: ").concat(p.length)),d=r.startNode(),f=d>=c,m=Wh(u[r.level()],2),y=m[1],g=Math.min(r.endNode()+i,y),v=g-d,e.next=9,new Kh(s(d*$h,v*$h),0);case 9:b=e.sent,_=new Float64Array(b),S=new Uint32Array(b),x=Hh().mark(function e(i){var s,u,m,y,g,v,b,x;return Hh().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(l<_[(s=5*(i-d))+0])){e.next=3;break}return e.abrupt("return",0);case 3:if(!(h<_[s+1])){e.next=5;break}return e.abrupt("return",0);case 5:if(!(a>_[s+2])){e.next=7;break}return e.abrupt("return",0);case 7:if(!(o>_[s+3])){e.next=9;break}return e.abrupt("return",0);case 9:if(u=S[8+(s<<1)],m=S[9+(s<<1)],y=su(m,u),!f){e.next=17;break}return g=function(){if(i ").concat(y)),b.extendEndNodeToNewOffset(y),e.abrupt("return",0);case 23:void 0,w=r.level()-1,x=new n([y,y+1],w),void 0!==b&&b.level()==x.level()?Jh.info("Same level, but too far away. Pushing new request at offset: ".concat(y," rather than merging with distant ").concat(b)):Jh.info("Pushing new level for ".concat(x," onto queue with nearestNodeRange: ").concat(b," since there's not already a range for this level.")),p.push(x);case 26:case"end":return e.stop()}var w},e)}),w=d;case 14:if(!(w=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:s}}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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){o=!0,n=e},f:function(){try{a||null==i.return||i.return()}finally{if(o)throw n}}}}function hu(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==i)return;var r,s,n=[],a=!0,o=!1;try{for(i=i.call(e);!(a=(r=i.next()).done)&&(n.push(r.value),!t||n.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==i.return||i.return()}finally{if(o)throw s}}return n}(e,t)||uu(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 uu(e,t){if(e){if("string"==typeof e)return cu(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?cu(e,t):void 0}}function cu(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function pu(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function fu(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){pu(n,r,s,a,o,"next",e)}function o(e){pu(n,r,s,a,o,"throw",e)}a(void 0)})}}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yu(e,t){for(var i=0;izh.global.extraRequestThreshold()&&(Jh.info("Pushing new feature batch, since gap ".concat(_," was too large")),a.push(o),o=[]),o.push([m,g]);case 23:l=!1,i.next=9;break;case 26:i.next=32;break;case 28:i.prev=28,i.t0=i.catch(7),h=!0,u=i.t0;case 32:if(i.prev=32,i.prev=33,!l||null==c.return){i.next=37;break}return i.next=37,_u(c.return());case 37:if(i.prev=37,!h){i.next=40;break}throw u;case 40:return i.finish(37);case 41:return i.finish(32);case 42:return t.headerClient.logUsage("header+index"),o.length>0&&a.push(o),S=a.flatMap(function(e){return t.readFeatureBatch(e)}),i.delegateYield(Su(wu(Gh.ZN.merge(S))),"t1",46);case 46:case"end":return i.stop()}},i,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return nu.length+au+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(){return new Au(this.headerClient.httpClient)}},{key:"readFeatureBatch",value:function(e){var t=this;return vu(du().mark(function i(){var r,s,n,a,o,l,h,u,c,d,p;return du().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:r=hu(e[0],1),s=r[0],n=hu(e[e.length-1],2),a=n[0],o=n[1],l=a+o-s,h=t.buildFeatureClient(),u=lu(e),i.prev=7,u.s();case 9:if((c=u.n()).done){i.next=17;break}return d=hu(c.value,1),p=d[0],i.next=13,_u(t.readFeature(h,p,l));case 13:return i.next=15,i.sent;case 15:i.next=9;break;case 17:i.next=22;break;case 19:i.prev=19,i.t0=i.catch(7),u.e(i.t0);case 22:return i.prev=22,u.f(),i.finish(22);case 25:h.logUsage("feature");case 26:case"end":return i.stop()}},i,null,[[7,19,22,25]])}))()}},{key:"readFeature",value:function(){var e=fu(du().mark(function e(t,i,r){var s,n,a,o,l,h,u;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=i+this.lengthBeforeFeatures(),e.next=3,t.getRange(s,4,r,"feature length");case 3:return a=e.sent,n=new DataView(a).getUint32(0,!0),e.next=7,t.getRange(s+4,n,r,"feature data");case 7:return o=e.sent,l=new Uint8Array(o),(h=new Uint8Array(n+au)).set(l,au),(u=new bh.cZ(h)).setPosition(au),e.abrupt("return",Lh.getRootAsFeature(u));case 14:case"end":return e.stop()}},e,this)}));return function(t,i,r){return e.apply(this,arguments)}}()}],[{key:"open",value:function(){var t=fu(du().mark(function t(i){var r,s,n,a,o,l,h,u,c,d,p;return du().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=2024,s=new Au(i),n=function(){var e,t=0;for(e=0;e<3;e++){t+=Math.pow(16,e)*$h}return t}(),a=r+n,Jh.debug("fetching header. minReqLength: ".concat(a," (assumedHeaderLength: ").concat(r,", assumedIndexLength: ").concat(n,")")),t.t0=Uint8Array,t.next=8,s.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 nu[t]===e})){t.next=13;break}throw Jh.error("bytes: ".concat(o," != ").concat(nu)),new Error("Not a FlatGeobuf file");case 13:return Jh.debug("magic bytes look good"),t.next=16,s.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 Jh.debug("headerLength: ".concat(l)),t.next=24,s.getRange(12,l,a,"header");case 24:return u=t.sent,c=new bh.cZ(new Uint8Array(u)),d=Bh(c),p=eu(d.featuresCount,d.indexNodeSize),Jh.debug("completed: opening http reader"),t.abrupt("return",new e(s,d,l,p));case 30:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()}]),e}(),Au=function(){function e(t){mu(this,e),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,this.httpClient="string"==typeof t?new Tu(t):t}return gu(e,[{key:"getRange",value:function(){var e=fu(du().mark(function e(t,i,r,s){var n,a,o;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bytesEverUsed+=i,n=t-this.head,a=n+i,!(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(i,r),this.bytesEverFetched+=o,Jh.debug("requesting for new Range: ".concat(t,"-").concat(t+i-1)),e.next=10,this.httpClient.getRange(t,o,s);case 10:return this.buffer=e.sent,this.head=t,e.abrupt("return",this.buffer.slice(0,i));case 13:case"end":return e.stop()}},e,this)}));return function(t,i,r,s){return e.apply(this,arguments)}}()},{key:"logUsage",value:function(e){var t=e.split(" ")[0],i=this.bytesEverUsed,r=this.bytesEverFetched,s=(100*i/r).toFixed(2);Jh.info("".concat(t," bytes used/requested: ").concat(i," / ").concat(r," = ").concat(s,"%"))}}]),e}(),Tu=function(){function e(t){mu(this,e),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t}return gu(e,[{key:"getRange",value:function(){var e=fu(du().mark(function e(t,i,r){var s,n;return du().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=i,s="bytes=".concat(t,"-").concat(t+i-1),Jh.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(r,"), bytes: (this_request: ").concat(i,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(s)),e.next=6,fetch(this.url,{headers:{Range:s}});case 6:return n=e.sent,e.abrupt("return",n.arrayBuffer());case 8:case"end":return e.stop()}},e,this)}));return function(t,i,r){return e.apply(this,arguments)}}()}]),e}();function Eu(e){"@babel/helpers - typeof";return(Eu="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 Lu(){Lu=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function o(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(e){o=function(e,t,i){return e[t]=i}}function l(e,t,i,r){var s=t&&t.prototype instanceof c?t:c,n=Object.create(s.prototype),a=new w(r||[]);return n._invoke=function(e,t,i){var r="suspendedStart";return function(s,n){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw n;return M()}for(i.method=s,i.arg=n;;){var a=i.delegate;if(a){var o=_(a,i);if(o){if(o===u)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var l=h(e,t,i);if("normal"===l.type){if(r=i.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r="completed",i.method="throw",i.arg=l.arg)}}}(e,i,a),n}function h(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function c(){}function d(){}function p(){}var f={};o(f,s,function(){return this});var m=Object.getPrototypeOf,y=m&&m(m(C([])));y&&y!==t&&i.call(y,s)&&(f=y);var g=p.prototype=c.prototype=Object.create(f);function v(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){var r;this._invoke=function(s,n){function a(){return new t(function(r,a){!function r(s,n,a,o){var l=h(e[s],e,n);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==Eu(c)&&i.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,o)},function(e){r("throw",e,a,o)}):t.resolve(c).then(function(e){u.value=e,a(u)},function(e){return r("throw",e,a,o)})}o(l.arg)}(s,n,r,a)})}return r=r?r.then(a,a):a()}}function _(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(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 r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var s=r.arg;return s?s.done?(t[e.resultName]=s.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(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 x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function Ou(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function Pu(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){Ou(n,r,s,a,o,"next",e)}function o(e){Ou(n,r,s,a,o,"throw",e)}a(void 0)})}}function Nu(e){var t,i,r,s=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(i&&null!=(t=e[i]))return t.call(e);if(r&&null!=(t=e[r]))return new Iu(t.call(e));i="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Iu(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(Iu=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 i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new Iu(e)}function Fu(e){return new Ru(e,0)}function ku(e){return function(){return new Du(e.apply(this,arguments))}}function Du(e){var t,i;function r(t,i){try{var n=e[t](i),a=n.value,o=a instanceof Ru;Promise.resolve(o?a.v:a).then(function(i){if(o){var l="return"===t?"return":"next";if(!a.k||i.done)return r(l,i);i=e[l](i).value}s(n.done?"return":"normal",i)},function(e){r("throw",e)})}catch(e){s("throw",e)}}function s(e,s){switch(e){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?r(t.key,t.arg):i=null}this._invoke=function(e,s){return new Promise(function(n,a){var o={key:e,arg:s,resolve:n,reject:a,next:null};i?i=i.next=o:(t=i=o,r(e,s))})},"function"!=typeof e.return&&(this.return=void 0)}function Ru(e,t){this.v=e,this.k=t}function Bu(){return(Bu=ku(Lu().mark(function e(t,i,r){var s,n,a,o,l,h,u,c,d,p;return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=Ih(t),n=function(){var e=Pu(Lu().mark(function e(t){return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.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,Fu(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 nu[t]===e})){e.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return e.t2=Uint8Array,e.next=12,Fu(n(4,"header length"));case 12:return e.t3=e.sent,a=new e.t2(e.t3),o=new bh.cZ(a),l=o.readUint32(0),e.t4=Uint8Array,e.next=19,Fu(n(l,"header data"));case 19:if(e.t5=e.sent,a=new e.t4(e.t5),o=new bh.cZ(a),h=Bh(o),r&&r(h),u=h.indexNodeSize,c=h.featuresCount,!(u>0)){e.next=29;break}return d=eu(c,u),e.next=29,Fu(n(d,"entire index, w/o rect"));case 29:return e.next=31,Fu(Uu(n,h,i));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 Gu(){return(Gu=ku(Lu().mark(function e(t,i,r,s){var n,a,o,l,h,u,c;return Lu().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fu(Mu.open(t));case 2:n=e.sent,Jh.debug("opened reader"),s&&s(n.header),a=!1,o=!1,e.prev=7,h=Nu(n.selectBbox(i));case 9:return e.next=11,Fu(h.next());case 11:if(!(a=!(u=e.sent).done)){e.next=18;break}return c=u.value,e.next=15,r(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,Fu(h.return());case 29:if(e.prev=29,!o){e.next=32;break}throw l;case 32:return e.finish(29);case 33:return e.finish(24);case 34:case"end":return e.stop()}},e,null,[[7,20,24,34],[25,,29,33]])}))).apply(this,arguments)}function Uu(e,t,i){return ju.apply(this,arguments)}function ju(){return(ju=Pu(Lu().mark(function e(t,i,r){var s,n,a,o,l;return Lu().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!==(s=new e.t0(e.t1)).byteLength){e.next=7;break}return e.abrupt("return");case 7:return n=new bh.cZ(s),a=n.readUint32(0),e.t2=Uint8Array,e.next=12,t(a,"feature data");case 12:return e.t3=e.sent,s=new e.t2(e.t3),(o=new Uint8Array(a+4)).set(s,4),(n=new bh.cZ(o)).setPosition(au),l=Lh.getRootAsFeature(n),e.abrupt("return",r(l,i));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function zu(e,t){return{type:"FeatureCollection",features:function(e,t,i){if(!e.subarray(0,3).every(function(e,t){return nu[t]===e}))throw new Error("Not a FlatGeobuf file");var r=new bh.cZ(e),s=r.readUint32(nu.length);r.setPosition(nu.length+au);var n=Bh(r);i&&i(n);var a=nu.length+au+s,o=n.indexNodeSize,l=n.featuresCount;o>0&&(a+=eu(l,o));for(var h=[];a=0;--s){var n=this.tryEntries[s],a=n.completion;if("root"===n.tryLoc)return r("end");if(n.tryLoc<=this.prev){var o=i.call(n,"catchLoc"),l=i.call(n,"finallyLoc");if(o&&l){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),x(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var s=r.arg;x(i)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function Yu(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function Xu(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){Yu(n,r,s,a,o,"next",e)}function o(e){Yu(n,r,s,a,o,"throw",e)}a(void 0)})}}function Qu(e){var t,i,r,s=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(i&&null!=(t=e[i]))return t.call(e);if(r&&null!=(t=e[r]))return new Zu(t.call(e));i="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Zu(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(Zu=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 i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new Zu(e)}Du.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Du.prototype.next=function(e){return this._invoke("next",e)},Du.prototype.throw=function(e){return this._invoke("throw",e)},Du.prototype.return=function(e){return this._invoke("return",e)};var Ku=ao().LayerGroup.extend({initialize:function(e,t){this.options=t||{},this.strategy=this.options.strategy||"bbox",this._layers={},this.url=e,this.previousLayer=null,this.loadedExtentsRtree_=new(vh()),this.extent=this.options.extent,this._cacheIds=[],this._validatedId=!1,this._checked=!1,this.idField=this.options.idField||"SmID",this._updateFeaturesFn=this._updateFeatures.bind(this),ao().Util.setOptions(this,t)},onAdd:function(e){this.map=e;var t=[];if("bbox"===this.strategy){var i=e.getBounds();t=[i.getWest(),i.getSouth(),i.getEast(),i.getNorth()],e.on("moveend",this._updateFeaturesFn)}if(this.extent){var r=function(e,t){const i=[];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]?i[0]=e[0]:i[0]=t[0],e[1]>t[1]?i[1]=e[1]:i[1]=t[1],e[2]{t.push(`match p=(n)-[]-(m) where id(n)=${e} return p;`)}),t}processAsync({url:e,params:t,method:i,callback:r}){let s=++this.eventCount,n={scope:this,processCompleted:function(e){if(s===e.result.eventId&&r)return delete e.result.eventId,r(e),this.events&&this.events.un(n),!1},processFailed:function(e){if((s===e.error.eventId||s===e.eventId)&&r)return delete e.eventId,r(e),this.events&&this.events.un(n),!1}};this.events.on(n);const a={method:i,url:e,scope:this,success(e,t){e.eventId=s,this.serviceProcessCompleted(e,t)},failure(e,t){e.eventId=s,this.serviceProcessFailed(e,t)}};t&&(a.params=t),this.request(a)}_getGraphMapData(e){return new Promise((t,i)=>{this.getGraphMap(e,e=>{"processFailed"===e.type?i(e.error):""===e.result.data?i("无数据"):t(e.result.graphMap)})})}_queryDataBySql(e){return new Promise((t,i)=>{this.query(e,e=>{"processFailed"===e.type?i(e.error):t(e.result)})})}}(this.url,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 ec=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t);this._addressMatchService=new st(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},code:function(e,t){this._addressMatchService.code(ee.urlPathAppend(this.url,"geocoding"),e,t)},decode:function(e,t){this._addressMatchService.decode(ee.urlPathAppend(this.url,"geodecoding"),e,t)}});var tc=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._chartServiceBase=new class{constructor(e,t){this.url=e,this.options=t||{}}queryChart(e,t,i){var r=this,s=e,n=r._processFormat(i);new Pt(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},format:n}).processAsync(s)}getChartFeatureInfo(e){var t=this,i=ee.urlPathAppend(t.url,"chartFeatureInfoSpecs");new Tt(i,{proxy:t.options.proxy,withCredentials:t.options.withCredentials,crossOrigin:t.options.crossOrigin,headers:t.options.headers,eventListeners:{scope:t,processCompleted:e,processFailed:e}}).processAsync()}_processFormat(e){return e||t.GEOJSON}}(e,i)},queryChart:function(e,t,i){e=this._processParams(e),this._chartServiceBase.queryChart(e,t,i)},getChartFeatureInfo:function(e){this._chartServiceBase.getChartFeatureInfo(e)},_processParams:function(e){if(!e)return{};e.returnContent=null==e.returnContent||e.returnContent,e.chartQueryFilterParameters&&!ao().Util.isArray(e.chartQueryFilterParameters)&&(e.chartQueryFilterParameters=[e.chartQueryFilterParameters]),e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds))},_processFormat:function(e){return e||t.GEOJSON}}),ic=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._datasetService=new Ii(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getDatasets:function(e,t){e&&this._datasetService.getDatasetsService(e,t)},getDataset:function(e,t,i){e&&t&&this._datasetService.getDatasetService(e,t,i)},setDataset(e,t){if(e instanceof js||e instanceof qs){if(e instanceof js)var i={datasetType:e.datasetType,datasourceName:e.datasourceName,datasetName:e.datasetName};else e instanceof qs&&(i={datasetName:e.datasetName,datasourceName:e.datasourceName,isFileCache:e.isFileCache,description:e.description,prjCoordSys:e.prjCoordSys,charset:e.charset});this._datasetService.setDatasetService(i,t)}},deleteDataset:function(e,t,i){this._datasetService.deleteDatasetService(e,t,i)}}),rc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._datasourceService=new Ht(this.url,{proxy:this.proxy,withCredentials:this.withCredentials,crossOrigin:this.crossOrigin,headers:this.headers})},getDatasources:function(e){this._datasourceService.getDatasourcesService(e)},getDatasource:function(e,t){e&&this._datasourceService.getDatasourceService(e,t)},setDatasource:function(e,t){if(!(e instanceof rs))return;const i={description:e.description,coordUnit:e.coordUnit,distanceUnit:e.distanceUnit,datasourceName:e.datasourceName};this._datasourceService.setDatasourceService(i,t)}});var sc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._fieldService=new class{constructor(e,t){this.url=e,this.options=t||{}}getFields(e,t){var i=this;new Hi(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},datasource:e.datasource,dataset:e.dataset}).processAsync()}getFieldStatisticsInfo(e,t){if(e instanceof ci){var i=this,r=e.fieldName,s=e.statisticMode;s&&!Array.isArray(s)&&(s=[s]),i.currentStatisticResult={fieldName:r},i._statisticsCallback=t,s.forEach(t=>{i.currentStatisticResult[t]=null,i._fieldStatisticRequest(e.datasource,e.dataset,r,t)})}}_fieldStatisticRequest(e,t,i,r){var s=this;new di(s.url,{eventListeners:{scope:s,processCompleted:s._processCompleted.bind(s),processFailed:s._statisticsCallback},datasource:e,dataset:t,field:i,statisticMode:r,crossOrigin:s.options.crossOrigin,headers:s.options.headers}).processAsync()}_processCompleted(e,t){var i=this,r=!0,s=e.result;for(var n in this.currentStatisticResult&&null==i.currentStatisticResult[s.mode]&&(this.currentStatisticResult[s.mode]=s.result),i.currentStatisticResult)if(null==i.currentStatisticResult[n]){r=!1;break}r&&i._statisticsCallback({result:i.currentStatisticResult,options:t})}}(e,t)},getFields:function(e,t){this._fieldService.getFields(e,t)},getFieldStatisticsInfo:function(e,t){this._fieldService.getFieldStatisticsInfo(e,t)}}),nc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._gridCellQueryService=new Yi(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getGridCellInfos:function(e,t){if(!e)return null;this._gridCellQueryService.processAsync(e,t)}});const ac=po.extend({initialize:function(e,t){t=t||{},ao().setOptions(this,t),po.prototype.initialize.call(this,e,t),this.headers={},this.crossOrigin=!0,this.withCredentials=!0,this.proxy=!0,this._geoprocessingJobsService=new Oi(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getTools:function(e){this._geoprocessingJobsService.getTools(e)},getTool:function(e,t){this._geoprocessingJobsService.getTool(e,t)},execute:function(e,t,i,r){this._geoprocessingJobsService.execute(e,t,i,r)},submitJob:function(e,t,i,r){this._geoprocessingJobsService.submitJob(e,t,i,r)},waitForJobCompletion:function(e,t,i,r){this._geoprocessingJobsService.waitForJobCompletion(e,t,i,r)},getJobInfo:function(e,t,i){this._geoprocessingJobsService.getJobInfo(e,t,i)},cancelJob:function(e,t,i){this._geoprocessingJobsService.cancelJob(e,t,i)},getJobs:function(e,t){this._geoprocessingJobsService.getJobs(e,t)},getResults:function(e,t,i,r){this._geoprocessingJobsService.getResults(e,t,i,r)}});var oc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._layerInfoService=new class{constructor(e,t){this.url=e,this.options=t||{}}getLayersInfo(e){var t=this;new Cr(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 i=this,r=e.resourceID,s=e.tempLayerName,n=e.layerInfo;if(r&&s){var a=ee.urlPathAppend(i.url,"tempLayersSet/"+r+"/"+s);new ss(a,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(n)}}}setLayersInfo(e,t){if(e){var i=this,r=e.resourceID,s=!!e.isTempLayers&&e.isTempLayers,n=e.layersInfo;s&&!r||!n||new ns(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t},resourceID:r,isTempLayers:s}).processAsync(n)}}setLayerStatus(e,t){if(e){var i=this;new os(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{processCompleted:t,processFailed:t}}).processAsync(e)}}}(e,t)},getLayersInfo:function(e){this._layerInfoService.getLayersInfo(e)},setLayerInfo:function(e,t){this._layerInfoService.setLayerInfo(e,t)},setLayersInfo:function(e,t){this._layerInfoService.setLayersInfo(e,t)},setLayerStatus:function(e,t){this._layerInfoService.setLayerStatus(e,t)}}),lc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t)},measureDistance:function(e,t){return this.measure(o.DISTANCE,e,t),this},measureArea:function(e,t){return this.measure(o.AREA,e,t),this},measure:function(e,t,i){if(t instanceof Rr){var r=this;t.geometry&&(t.geometry=Po(t.geometry)),new Br(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,measureMode:e}).processAsync(t,i)}}});var hc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._networkAnalyst3DService=new class{constructor(e,t){this.url=e,this.options=t||{}}sinksFacilityAnalyst(e,t){var i=this;new $t(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:t,processFailed:t}}).processAsync(e)}sourcesFacilityAnalyst(e,t){var i=this;new ti(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}}).processAsync(e)}traceUpFacilityAnalyst(e,t){var i=this;new oi(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}}).processAsync(e)}traceDownFacilityAnalyst(e,t){var i=this;new ni(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}}).processAsync(e)}upstreamFacilityAnalyst(e,t){var i=this;new hi(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}}).processAsync(e)}}(e,t)},sinksFacilityAnalyst:function(e,t){this._networkAnalyst3DService.sinksFacilityAnalyst(e,t)},sourcesFacilityAnalyst:function(e,t){this._networkAnalyst3DService.sourcesFacilityAnalyst(e,t)},traceUpFacilityAnalyst:function(e,t){this._networkAnalyst3DService.traceUpFacilityAnalyst(e,t)},traceDownFacilityAnalyst:function(e,t){this._networkAnalyst3DService.traceDownFacilityAnalyst(e,t)},upstreamFacilityAnalyst:function(e,t){this._networkAnalyst3DService.upstreamFacilityAnalyst(e,t)}});var uc=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._networkAnalystService=new class{constructor(e,t){this.url=e,this.options=t||{}}burstPipelineAnalyst(e,t){var i=this;new At(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}}).processAsync(e)}computeWeightMatrix(e,t){var i=this;new Dt(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}}).processAsync(e)}findClosestFacilities(e,t,i){var r=this;new fi(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},format:r._processFormat(i)}).processAsync(e)}streamFacilityAnalyst(e,t,i){var r=this;new ri(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},format:r._processFormat(i)}).processAsync(e)}findLocation(e,t,i){var r=this;new yi(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},format:r._processFormat(i)}).processAsync(e)}findPath(e,t,i){var r=this;new _i(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},format:r._processFormat(i)}).processAsync(e)}findTSPPaths(e,t,i){var r=this;new Ci(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},format:r._processFormat(i)}).processAsync(e)}findMTSPPaths(e,t,i){var r=this;new vi(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},format:r._processFormat(i)}).processAsync(e)}findServiceAreas(e,t,i){var r=this;new xi(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},format:r._processFormat(i)}).processAsync(e)}updateEdgeWeight(e,t){var i=this;new zs(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}}).processAsync(e)}updateTurnNodeWeight(e,t){var i=this;new Js(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}}).processAsync(e)}_processFormat(e){return e||t.GEOJSON}}(e,i)},burstPipelineAnalyst:function(e,t){e=this._processParams(e),this._networkAnalystService.burstPipelineAnalyst(e,t)},computeWeightMatrix:function(e,t){e=this._processParams(e),this._networkAnalystService.computeWeightMatrix(e,t)},findClosestFacilities:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findClosestFacilities(e,t,i)},streamFacilityAnalyst:function(e,t,i){e=this._processParams(e),this._networkAnalystService.streamFacilityAnalyst(e,t,i)},findLocation:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findLocation(e,t,i)},findPath:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findPath(e,t,i)},findTSPPaths:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findTSPPaths(e,t,i)},findMTSPPaths:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findMTSPPaths(e,t,i)},findServiceAreas:function(e,t,i){e=this._processParams(e),this._networkAnalystService.findServiceAreas(e,t,i)},updateEdgeWeight:function(e,t){this._networkAnalystService.updateEdgeWeight(e,t)},updateTurnNodeWeight:function(e,t){this._networkAnalystService.updateTurnNodeWeight(e,t)},_processParams:function(e){if(!e)return{};if(e.centers&&ao().Util.isArray(e.centers)&&e.centers.map(function(t,i){return e.centers[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.centers[i]}),e.nodes&&ao().Util.isArray(e.nodes)&&e.nodes.map(function(t,i){return e.nodes[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.nodes[i]}),e.event&&e.event instanceof ao().LatLng&&(e.event={x:e.event.lng,y:e.event.lat}),e.facilities&&ao().Util.isArray(e.facilities)&&e.facilities.map(function(t,i){return e.facilities[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.facilities[i]}),e.parameter&&e.parameter.barrierPoints){var t=e.parameter.barrierPoints;ao().Util.isArray(t)?t.map(function(t,i){return e.parameter.barrierPoints[i]=t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t,e.parameter.barrierPoints[i]}):e.parameter.barrierPoints=[t instanceof ao().LatLng?{x:t.lng,y:t.lat}:t]}return e},_processFormat:function(e){return e||t.GEOJSON}});var cc=po.extend({initialize:function(e,i){i=i||{},ao().setOptions(this,i),po.prototype.initialize.call(this,e,i),this.kernelDensityJobs={},this.summaryMeshJobs={},this.queryJobs={},this.summaryRegionJobs={},this.vectorClipJobs={},this.overlayGeoJobs={},this.buffersJobs={},this.topologyValidatorJobs={},this.summaryAttributesJobs={},this._processingService=new class{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 i=this,r=i._processFormat(t);new Nr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getKernelDensityJobs()}getKernelDensityJob(e,t,i){var r=this,s=r._processFormat(i);new Nr(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},format:s}).getKernelDensityJob(e)}addKernelDensityJob(e,t,i,r){var s=this,n=s._processFormat(r);new Nr(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,processRunning:function(e){s.kernelDensityJobs[e.id]=e.state}},format:n}).addKernelDensityJob(e,i)}getKernelDensityJobState(e){return this.kernelDensityJobs[e]}getSummaryMeshJobs(e,t){var i=this,r=i._processFormat(t);new ms(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getSummaryMeshJobs()}getSummaryMeshJob(e,t,i){var r=this,s=r._processFormat(i);new ms(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},format:s}).getSummaryMeshJob(e)}addSummaryMeshJob(e,t,i,r){var s=this,n=s._processFormat(r);new ms(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,processRunning:function(e){s.summaryMeshJobs[e.id]=e.state}},format:n}).addSummaryMeshJob(e,i)}getSummaryMeshJobState(e){return this.summaryMeshJobs[e]}getQueryJobs(e,t){var i=this,r=i._processFormat(t);new hs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getQueryJobs()}getQueryJob(e,t,i){var r=this,s=r._processFormat(i);new hs(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},format:s}).getQueryJob(e)}addQueryJob(e,t,i,r){var s=this,n=s._processFormat(r);new hs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.queryJobs[e.id]=e.state}},format:n}).addQueryJob(e,i)}getQueryJobState(e){return this.queryJobs[e]}getSummaryRegionJobs(e,t){var i=this,r=i._processFormat(t);new gs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getSummaryRegionJobs()}getSummaryRegionJob(e,t,i){var r=this,s=r._processFormat(i);new gs(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},format:s}).getSummaryRegionJob(e)}addSummaryRegionJob(e,t,i,r){var s=this,n=s._processFormat(r);new gs(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,processRunning:function(e){s.summaryRegionJobs[e.id]=e.state}},format:n}).addSummaryRegionJob(e,i)}getSummaryRegionJobState(e){return this.summaryRegionJobs[e]}getVectorClipJobs(e,t){var i=this,r=i._processFormat(t);new Ws(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getVectorClipJobs()}getVectorClipJob(e,t,i){var r=this,s=r._processFormat(i);new Ws(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},format:s}).getVectorClipJob(e)}addVectorClipJob(e,t,i,r){var s=this,n=s._processFormat(r);new Ws(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,processRunning:function(e){s.vectorClipJobs[e.id]=e.state}},format:n}).addVectorClipJob(e,i)}getVectorClipJobState(e){return this.vectorClipJobs[e]}getOverlayGeoJobs(e,t){var i=this,r=i._processFormat(t);new jr(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getOverlayGeoJobs()}getOverlayGeoJob(e,t,i){var r=this,s=r._processFormat(i);new jr(r.url,{proxy:r.options.proxy,withCredentials:r.options.withCredentials,crossOrigin:r.options.crossOrigin,headers:r.options.headers,eventListeners:{scope:r,processCompleted:t,processFailed:t},format:s}).getOverlayGeoJob(e)}addOverlayGeoJob(e,t,i,r){var s=this,n=s._processFormat(r);new jr(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,processRunning:function(e){s.overlayGeoJobs[e.id]=e.state}},format:n}).addOverlayGeoJob(e,i)}getoverlayGeoJobState(e){return this.overlayGeoJobs[e]}getBuffersJobs(e,t){var i=this,r=i._processFormat(t);new wt(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getBuffersJobs()}getBuffersJob(e,t,i){var r=this,s=r._processFormat(i);new wt(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},format:s}).getBuffersJob(e)}addBuffersJob(e,t,i,r){var s=this,n=s._processFormat(r);new wt(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.buffersJobs[e.id]=e.state}},format:n}).addBuffersJob(e,i)}getBuffersJobState(e){return this.buffersJobs[e]}getTopologyValidatorJobs(e,t){var i=this,r=i._processFormat(t);new Fs(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getTopologyValidatorJobs()}getTopologyValidatorJob(e,t,i){var r=this,s=r._processFormat(i);new Fs(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},format:s}).getTopologyValidatorJob(e)}addTopologyValidatorJob(e,t,i,r){var s=this,n=s._processFormat(r);new Fs(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.topologyValidatorJobs[e.id]=e.state}},format:n}).addTopologyValidatorJob(e,i)}getTopologyValidatorJobState(e){return this.topologyValidatorJobs[e]}getSummaryAttributesJobs(e,t){var i=this,r=i._processFormat(t);new ps(i.url,{proxy:i.options.proxy,withCredentials:i.options.withCredentials,crossOrigin:i.options.crossOrigin,headers:i.options.headers,eventListeners:{scope:i,processCompleted:e,processFailed:e},format:r}).getSummaryAttributesJobs()}getSummaryAttributesJob(e,t,i){var r=this,s=r._processFormat(i);new ps(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},format:s}).getSummaryAttributesJob(e)}addSummaryAttributesJob(e,t,i,r){var s=this,n=s._processFormat(r);new ps(s.url,{proxy:s.options.proxy,withCredentials:s.options.withCredentials,crossOrigin:s.options.crossOrigin,headers:s.options.headers,eventListeners:{scope:s,processCompleted:t,processFailed:t,processRunning:function(e){s.summaryAttributesJobs[e.id]=e.state}},format:n}).addSummaryAttributesJob(e,i)}getSummaryAttributesJobState(e){return this.summaryAttributesJobs[e]}_processFormat(e){return e||t.GEOJSON}}(e,i)},getKernelDensityJobs:function(e,t){this._processingService.getKernelDensityJobs(e,t)},getKernelDensityJob:function(e,t,i){this._processingService.getKernelDensityJob(e,t,i)},addKernelDensityJob:function(e,t,i,r){let s=this._processParams(e);this._processingService.addKernelDensityJob(s,t,i,r)},getKernelDensityJobState:function(e){return this._processingService.getKernelDensityJobState(e)},getSummaryMeshJobs:function(e,t){this._processingService.getSummaryMeshJobs(e,t)},getSummaryMeshJob:function(e,t,i){this._processingService.getSummaryMeshJob(e,t,i)},addSummaryMeshJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addSummaryMeshJob(e,t,i,r)},getSummaryMeshJobState:function(e){return this._processingService.getSummaryMeshJobState(e)},getQueryJobs:function(e,t){this._processingService.getQueryJobs(e,t)},getQueryJob:function(e,t,i){this._processingService.getQueryJob(e,t,i)},addQueryJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addQueryJob(e,t,i,r)},getQueryJobState:function(e){return this._processingService.getQueryJobState(e)},getSummaryRegionJobs:function(e,t){this._processingService.getSummaryRegionJobs(e,t)},getSummaryRegionJob:function(e,t,i){this._processingService.getSummaryRegionJob(e,t,i)},addSummaryRegionJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addSummaryRegionJob(e,t,i,r)},getSummaryRegionJobState:function(e){return this._processingService.getSummaryRegionJobState(e)},getVectorClipJobs:function(e,t){this._processingService.getVectorClipJobs(e,t)},getVectorClipJob:function(e,t,i){this._processingService.getVectorClipJob(e,t,i)},addVectorClipJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addVectorClipJob(e,t,i,r)},getVectorClipJobState:function(e){return this._processingService.getVectorClipJobState(e)},getOverlayGeoJobs:function(e,t){this._processingService.getOverlayGeoJobs(e,t)},getOverlayGeoJob:function(e,t,i){this._processingService.getOverlayGeoJob(e,t,i)},addOverlayGeoJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addOverlayGeoJob(e,t,i,r)},getoverlayGeoJobState:function(e){return this._processingService.getoverlayGeoJobState(e)},getBuffersJobs:function(e,t){this._processingService.getBuffersJobs(e,t)},getBuffersJob:function(e,t,i){this._processingService.getBuffersJob(e,t,i)},addBuffersJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addBuffersJob(e,t,i,r)},getBuffersJobState:function(e){return this._processingService.getBuffersJobState(e)},getTopologyValidatorJobs:function(e,t){this._processingService.getTopologyValidatorJobs(e,t)},getTopologyValidatorJob:function(e,t,i){this._processingService.getTopologyValidatorJob(e,t,i)},addTopologyValidatorJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addTopologyValidatorJob(e,t,i,r)},getTopologyValidatorJobState:function(e){return this._processingService.getTopologyValidatorJobState(e)},getSummaryAttributesJobs:function(e,t){this._processingService.getSummaryAttributesJobs(e,t)},getSummaryAttributesJob:function(e,t,i){this._processingService.getSummaryAttributesJob(e,t,i)},addSummaryAttributesJob:function(e,t,i,r){e=this._processParams(e),this._processingService.addSummaryAttributesJob(e,t,i,r)},getSummaryAttributesJobState:function(e){return this._processingService.getSummaryAttributesJobState(e)},_processParams:function(e){return e?(e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds)),e.query&&(e.query=vo.toSuperMapBounds(e.query)),e.geometryQuery&&(e.geometryQuery=vo.toProcessingParam(e.geometryQuery)),e.geometryClip&&(e.geometryClip=vo.toProcessingParam(e.geometryClip)),e):{}}}),dc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._queryService=new Zr(e,t)},queryByBounds:function(e,t,i){e=this._processParams(e),this._queryService.queryByBounds(e,t,i)},queryByDistance:function(e,t,i){e=this._processParams(e),this._queryService.queryByDistance(e,t,i)},queryBySQL:function(e,t,i){e=this._processParams(e),this._queryService.queryBySQL(e,t,i)},queryByGeometry:function(e,t,i){e=this._processParams(e),this._queryService.queryByGeometry(e,t,i)},_processParams:function(e){return e?(e.returnContent=null==e.returnContent||e.returnContent,e.queryParams&&!ao().Util.isArray(e.queryParams)&&(e.queryParams=[e.queryParams]),e.bounds&&(e.bounds=vo.toSuperMapBounds(e.bounds)),e.geometry&&(e.geometry instanceof ao().Point?e.geometry=new le(e.geometry.x,e.geometry.y):e.geometry=Po(e.geometry)),e):{}}});var pc=po.extend({initialize:function(e,i){po.prototype.initialize.call(this,e,i),this._spatialAnalystService=new class{constructor(e,t){this.url=e,this.options=t||{}}getAreaSolarRadiationResult(e,t,i){var r=this;new ht(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},format:r._processFormat(i)}).processAsync(e)}bufferAnalysis(e,t,i){var r=this;new gt(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},format:r._processFormat(i)}).processAsync(e)}densityAnalysis(e,t,i){var r=this;new Yt(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},format:r._processFormat(i)}).processAsync(e)}generateSpatialData(e,t,i){var r=this;new Ai(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},format:r._processFormat(i)}).processAsync(e)}geoRelationAnalysis(e,t,i){var r=this;new Ni(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},format:r._processFormat(i)}).processAsync(e)}interpolationAnalysis(e,t,i){var r=this;new Or(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},format:r._processFormat(i)}).processAsync(e)}mathExpressionAnalysis(e,t,i){var r=this;new Dr(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},format:r._processFormat(i)}).processAsync(e)}overlayAnalysis(e,t,i){var r=this;new Gr(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},format:r._processFormat(i)}).processAsync(e)}routeCalculateMeasure(e,t,i){var r=this;new $r(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},format:r._processFormat(i)}).processAsync(e)}routeLocate(e,t,i){var r=this;new ts(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},format:r._processFormat(i)}).processAsync(e)}surfaceAnalysis(e,t,i){var r=this;new bs(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},format:r._processFormat(i)}).processAsync(e)}terrainCurvatureCalculate(e,t,i){var r=this;new Ss(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},format:r._processFormat(i)}).processAsync(e)}thiessenAnalysis(e,t,i){var r=this;new Os(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},format:r._processFormat(i)}).processAsync(e)}geometrybatchAnalysis(e,t,i){for(var r=new Ps(this.url,{eventListeners:{scope:this,processCompleted:t,processFailed:t},format:this._processFormat(i)}),s=[],n=0;nao().Util.isArray(e)?{x:e[0],y:e[1]}:e instanceof le||e instanceof ao().Point?{x:e.x,y:e.y}:e instanceof ao().LatLng?{x:e.lng,y:e.lat}:e}),gc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._imageService=new ln(this.url,{proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getCollections:function(e){this._imageService.getCollections(e)},getCollectionByID:function(e,t){this._imageService.getCollectionByID(e,t)},search:function(e,t){this._imageService.search(e,t)}}),vc=po.extend({initialize:function(e,t){po.prototype.initialize.call(this,e,t),this._imageCollectionService=new on(this.url,{collectionId:this.options.collectionId,proxy:this.options.proxy,withCredentials:this.options.withCredentials,crossOrigin:this.options.crossOrigin,headers:this.options.headers})},getLegend:function(e,t){this._imageCollectionService.getLegend(e,t)},getStatistics:function(e){this._imageCollectionService.getStatistics(e)},getTileInfo:function(e){this._imageCollectionService.getTileInfo(e)},deleteItemByID(e,t){this._imageCollectionService.deleteItemByID(e,t)},getItemByID(e,t){this._imageCollectionService.getItemByID(e,t)}}),bc=ao().Control.extend({options:{position:"topright",style:(e,t)=>t?ao().circleMarker(t,{fillColor:"blue",weight:1,opacity:1,color:"blue",fillOpacity:.6}):{fillColor:"blue",weight:1,opacity:1,color:"blue",fillOpacity:.6},onEachFeature:null},initialize(e){ao().setOptions(this,e),this._event=new(ao().Evented),this.rootContainer=null},onAdd(e){return this.map=e,this.rootContainer=this._initView(),this.rootContainer},on(e,t){this._event.on(e,t)},off(e,t){t?this._event.off(e,t):this._event.off(e)},_initView(){},_preventMapEvent(e,t){e&&t&&(e.addEventListener("mouseover",function(){t.dragging.disable(),t.scrollWheelZoom.disable(),t.doubleClickZoom.disable()}),e.addEventListener("mouseout",function(){t.dragging.enable(),t.scrollWheelZoom.enable(),t.doubleClickZoom.enable()}))}}),_c=ao().Evented.extend({initialize(){this.fileModel=new class{constructor(e){this.FileTypes=Sa,this.FileConfig=xa,this.loadFileObject=e&&e.loadFileObject?e.loadFileObject:[]}set(e,t){this[e]=t}get(e){return this[e]}}},readFile(e){let t=e.target,i=t.files[0];if(i.size>this.fileModel.FileConfig.fileMaxSize)return this.fire("filesizeexceed",{messageType:"warring",message:Ma.i18n("msg_fileSizeExceeded")}),!1;let r=t.value,s=i.name,n=Ua.getFileType(s);if(!n)return this.fire("errorfileformat",{messageType:"failure",message:Ma.i18n("msg_fileTypeUnsupported")}),!1;""!==s&&(this.fileModel.set("loadFileObject",{file:i,filePath:r,fileName:s,fileType:n}),this._readData())},_readData(){const e=this,t=this.fileModel.loadFileObject.fileType;Ta.readFile(t,{file:this.fileModel.loadFileObject.file,path:this.fileModel.loadFileObject.filePath},i=>{Ta.processDataToGeoJson(t,i,e=>{e&&this.fire("openfilesucceeded",{result:e,layerName:this.fileModel.loadFileObject.fileName.split(".")[0]})},t=>{e.fire("openfilefailed",{messageType:"failure",message:t})},this)},()=>{e.fire("openfilefailed",{messageType:"failure",message:Ma.i18n("msg_openFileFail")})},this)}}),Sc=bc.extend({options:{layer:null},initialize(e){bc.prototype.initialize.apply(this,[e]),this.viewModel=new _c},setViewStyle(e,t){this.rootContainer.style[e]=t},_initView(){const e=ao().DomUtil.create("div","component-openfile");return e.id="openFile",this.fileSelect=ao().DomUtil.create("div","",e),this.label=ao().DomUtil.create("label","component-openfile__span--select",this.fileSelect),this.label.htmlFor="input_file",ao().DomUtil.create("div","supermapol-icons-upload",this.label),ao().DomUtil.create("span","component-openfile__span",this.label).appendChild(document.createTextNode(Ma.i18n("text_chooseFile"))),this.fileInput=ao().DomUtil.create("input","component-openfile__input",this.fileSelect),this.fileInput.id="input_file",this.fileInput.type="file",this.fileInput.accept=".json,.geojson,.csv,.xls,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel",this.fileInput.onchange=(e=>{this.messageBox.closeView(),this.viewModel.readFile(e)}),this.messageBox=new wa,this.viewModel.on("filesizeexceed",e=>{this.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("errorfileformat",e=>{this.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("openfilefailed",e=>{this.messageBox.showView(e.message,e.messageType),this._event.fire("openfilefailed",e)}),this.viewModel.on("readdatafail",e=>{this.messageBox.showView(e.message,e.messageType)}),this.viewModel.on("openfilesucceeded",e=>{this._event.fire("openfilesucceeded",e)}),this._preventMapEvent(e,this.map),e}});class xc{constructor(e){this.layers=[],e&&e.length>0&&this.addLayers(e),this.currentLayerDataModel=null}addLayers(e,t,i,r){for(let s=0;s0?r.operatingAttributeNames:r.attributeNames).length;a0?this.fire("searchlayersucceeded",{result:i}):this.fire("searchfailed",{searchType:"searchLayersField"})}},searchFromCityLocalSearchService(e){if(this.searchCache[e])this.fire("geocodesucceeded",{result:this.searchCache[e]});else{this.geoCodeParam.keyWords=e||this.geoCodeParam.city;const t=this;let i=this._getSearchUrl(this.geoCodeParam);Ue.get(i).then(e=>e.json()).then(e=>{if(e.error||0===e.poiInfos.length)t.fire("searchfailed",{searchType:"searchGeocodeField"});else if(e.poiInfos){const i=t._dataToGeoJson(e.poiInfos,t.geoCodeParam);t.fire("geocodesucceeded",{result:i})}})}},addSearchLayers(e){this.dataModel.addLayers(e,e=>{this.fire("newlayeradded",{layerName:e.layerName})},null,this)},panToLayer(e){this.dataModel.layers[e]&&this.map.flyToBounds(this.dataModel.layers[e].layer.getBounds())},panToCity(e){this.geoCodeParam.keyWords=e,this.geoCodeParam.city=e;const t=this;let i=this._getSearchUrl(this.geoCodeParam);Ue.get(i).then(e=>e.json()).then(e=>{if(e.poiInfos.length>0){const i=ao().latLng(e.poiInfos[0].location.y,e.poiInfos[0].location.x);t.map.setView(i,8)}else t.fire("searchfailed",{searchType:"cityGeocodeField"})})},_dataToGeoJson(e,t){let i=[];for(let r=0;r{"SPAN"===e.target.nodeName&&e.target.innerText&&(this.viewModel.panToCity(e.target.innerHTML),this.messageBox.closeView(),s.removeChild(s.firstChild),s.insertBefore(document.createTextNode(e.target.innerHTML),s.firstChild),this.isSearchLayer=!1)}),s.appendChild(document.createTextNode(e.content.getElementsByTagName("span")[0].innerText))}const o=function(){const t=document.createElement("div");t.setAttribute("class","component-search__layers");const i=document.createElement("div");i.setAttribute("class","component-search-layers-content"),t.appendChild(i);const r=document.createElement("div");r.setAttribute("class","component-search__layers__header");const n=document.createElement("div");n.setAttribute("class","load-btn"),r.appendChild(n);const a=document.createElement("span");a.setAttribute("class","supermapol-icons-poi-load"),n.appendChild(a);const o=document.createElement("span");o.appendChild(document.createTextNode(Ma.i18n("text_loadSearchCriteria"))),n.appendChild(o);const l=document.createElement("div");l.setAttribute("class","save-btn"),r.appendChild(l);const h=document.createElement("span");h.setAttribute("class","supermapol-icons-poi-save"),l.appendChild(h);const u=document.createElement("span");u.appendChild(document.createTextNode(Ma.i18n("text_saveSearchCriteria"))),l.appendChild(u);const c=document.createElement("div");return c.setAttribute("class","component-search__layers__body"),c.onclick=(t=>{e.clearSearchResult();let i=null;if("component-search__layers__itme__singleselect"===t.target.classList[0])i=t.target;else{if("component-single-default-img"!==t.target.classList[0]&&"single-label"!==t.target.classList[0])return;i=t.target.parentNode}document.getElementsByClassName("component-single-checked-img").length>0&&document.getElementsByClassName("component-single-checked-img")[0].setAttribute("class","component-single-default-img"),i.firstChild.setAttribute("class","component-single-checked-img"),e.currentSearchLayerName=i.lastChild.innerText,e.isSearchLayer=!0,s.removeChild(s.firstChild),s.insertBefore(document.createTextNode(e.currentSearchLayerName),s.firstChild),e.viewModel.panToLayer(e.currentSearchLayerName),e.messageBox.closeView()}),i.appendChild(c),t}();let l=[];a&&l.push({title:Ma.i18n("title_searchCity"),content:a}),l.push({title:Ma.i18n("title_searchLayer"),content:o});const h=new Ba({tabs:l}),u=h.getElement();h.closeView(),i.appendChild(u),r.onclick=(()=>{u.hidden?h.showView():h.closeView()}),i.appendChild(r),s.innerText||s.appendChild(document.createTextNode(Ma.i18n("text_label_chooseSearchLayers")));const c=document.createElement("div");c.setAttribute("class","component-search__input");const d=document.createElement("input");d.type="text",d.placeholder=Ma.i18n("text_label_searchTips"),c.appendChild(d),this.poiInput=d;const p=document.createElement("span");p.setAttribute("class","supermapol-icons-close"),p.hidden=!0,c.appendChild(p),i.appendChild(c);const f=document.createElement("div");f.setAttribute("class","component-search-icon supermapol-icons-search");const m=new Ga;this._resultDomObj=m,f.onclick=(()=>{m.closeView(),this.clearSearchResult(),this.messageBox.closeView(),h.closeView();const e=this.poiInput.value.trim();""!==e?this.isSearchLayer?this.viewModel.search(e,this.currentSearchLayerName):this.viewModel.search(e):this.messageBox.showView(Ma.i18n("msg_searchKeywords"))}),d.onkeypress=(e=>{if(13==e.which){var t=document.createEvent("HTMLEvents");t.initEvent("click",!1,!0),f.dispatchEvent(t)}}),i.appendChild(f);const y=function(){const t=m.getElement();return t.style.position="absolute",t.style.top="44px",t.style.right="0",m.closeView(),m.content.onclick=(t=>{let i=null;if("component-search-result-info"===t.target.parentNode.className)i=t.target.parentNode.parentNode;else if("component-search__resultitme"===t.target.parentNode.className)i=t.target.parentNode;else{if("component-search__resultitme"!==t.target.className)return;i=t.target}document.getElementsByClassName("component-search__resultitme-selected").length>0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),i.firstChild.classList.add("component-search__resultitme-selected");let r=i.children[1].firstChild.innerText;e._linkageFeature(r)}),t}();return i.appendChild(y),p.onclick=(e=>{this.clearSearchResult(),d.value="",e.target.hidden=!0,m.closeView()}),d.oninput=(()=>{p.hidden=!1}),this.messageBox=new wa,this._addViewModelListener(),t.appendChild(i),this._preventMapEvent(t,this.map),t},_createSearchLayerItem(e){const t=document.createElement("div");t.setAttribute("class","component-search__layers__itme");const i=document.createElement("div");i.setAttribute("class","component-search__layers__itme__singleselect");const r=document.createElement("div");r.setAttribute("class","component-single-default-img"),i.appendChild(r);const s=document.createElement("span");s.setAttribute("class","single-label"),s.innerHTML=e,i.appendChild(s),t.appendChild(i),document.getElementsByClassName("component-search__layers__body")[0].appendChild(t)},_createResultItem(e,t){const i=document.createElement("div");i.setAttribute("class","component-search__resultitme");let r=document.createElement("div");"Point"===e||"MultiPoint"===e?r.setAttribute("class","supermapol-icons-marker-layer component-search-result-icon"):"LineString"===e||"MultiLineString "===e?r.setAttribute("class","supermapol-icons-line-layer component-search-result-icon"):"Polygon"===e||"MultiPolygon"===e?r.setAttribute("class","supermapol-icons-polygon-layer component-search-result-icon"):r.setAttribute("class","supermapol-icons-point-layer component-search-result-icon"),i.appendChild(r);const s=document.createElement("div");s.setAttribute("class","component-search-result-info");const n=document.createElement("div");s.appendChild(n);const a=document.createElement("div");return t.name?(n.innerHTML=t.name,a.innerHTML=t.address,s.appendChild(a)):n.innerHTML=t.filterAttributeName+": "+t.filterAttributeValue,i.appendChild(s),document.createElement("div").setAttribute("class","component-checkbox component-checkbox-default-img"),i},_addViewModelListener(){this.viewModel.on("searchlayerschanged",e=>{for(let t=0;t{this._createSearchLayerItem(e.layerName)}),this.viewModel.on("searchlayersucceeded",e=>{const t=e.result;this.clearSearchResult(),this.searchResultLayer=ao().featureGroup(t,{pointToLayer:this.options.style,style:this.options.style}).bindPopup(function(e){if(e.feature.properties)return new ka({attributes:e.feature.properties}).getElement()}).addTo(this.map),this.searchResultLayer.eachLayer(e=>{this.options.onEachFeature?this.options.onEachFeature(e.toGeoJSON(),e):this._featureOnclickEvent.bind(this)(e.toGeoJSON(),e)}),this.searchLayersData=t,this._prepareResultData(t),this._event.fire("searchlayersucceeded",{result:this.searchResultLayer.toGeoJSON()})}),this.viewModel.on("geocodesucceeded",e=>{const t=e.result;this.clearSearchResult(),this.searchResultLayer=ao().geoJSON(t,{pointToLayer:this.options.style,style:this.options.style,onEachFeature:this.options.onEachFeature||this._featureOnclickEvent.bind(this)}).bindPopup(function(e){if(e.feature.properties)return new ka({attributes:e.feature.properties}).getElement()}).addTo(this.map),this.searchLayersData=t,this._prepareResultData(t),this._event.fire("geocodesucceeded",{result:t})}),this.viewModel.on("searchfailed",e=>{let t="";t="searchGeocodeField"===e.searchType?Ma.i18n("msg_searchGeocodeField"):"cityGeocodeField"===e.searchType?Ma.i18n("msg_cityGeocodeField"):Ma.i18n("msg_getFeatureField"),this.messageBox.showView(t),this._event.fire("searchfailed",{message:t})})},_prepareResultData(e){this.currentResult=e;let t=Math.ceil(e.length/this.perPageDataNum);this._resultDomObj.setPageLink(t),this._createResultListByPageNum(1,e),this._resultDomObj.showView(),this._resultDomObj.setLinkageEvent(function(e){i._createResultListByPageNum(e,i.currentResult)});const i=this},_createResultListByPageNum(e,t){let i,r=0;1===e&&t.lengtht.length?(r=this.perPageDataNum*(e-1),i=t.length-1):(r=this.perPageDataNum*(e-1),i=e*this.perPageDataNum-1);const s=document.createElement("div");for(let e=r;e<=i;e++){let i,r="Point";t[e].filterAttribute?(r=t[e].feature.geometry.type,i=t[e].filterAttribute):i=t[e].properties,s.appendChild(this._createResultItem(r,i))}this._resultDomObj.setContent(s),this._resultDomObj.showView(),s.firstChild.getElementsByClassName("component-search-result-icon")[0].classList.add("component-search__resultitme-selected");const n=s.firstChild.getElementsByClassName("component-search-result-info")[0].firstChild.innerText;!this._selectMarkerFeature&&this._linkageFeature(n)},_flyToBounds(e){const t=e.getSouthWest(),i=e.getNorthEast();t.lat===i.lat&&t.lng===i.lng?this.map.flyTo(t):this.map.fitBounds(e)},_linkageFeature(e){let t="";t=this.isSearchLayer?e.split(":")[1].trim():e,this._selectFeature&&this._selectFeature.addTo(this.map),this.searchResultLayer.eachLayer(e=>{(!t||e.filterAttribute&&e.filterAttribute.filterAttributeValue===t||e.feature.properties&&e.feature.properties.name===t)&&(e.remove(),this._setSelectedLayerStyle(e))})},clearSearchResult(){this.searchResultLayer&&(this.map.closePopup(),!this.isSearchLayer&&this.map.removeLayer(this.searchResultLayer),this._selectMarkerFeature&&this.map.removeLayer(this._selectMarkerFeature),this._selectFeaturethis&&this.map.removeLayer(this._selectFeature),this._selectMarkerFeature=null,this._selectFeature=null,this.searchResultLayer=null,this.currentResult=null)},_featureOnclickEvent(e,t){t.on("click",()=>{let i,r,s=document.getElementsByClassName("component-pagination__link")[0];this._resultDomObj._changePageEvent({target:s.children[0].children[0]}),this._selectFeature&&this._selectFeature.addTo(this.map),t.remove();for(let s=0;s1)for(let e=1;e0&&document.getElementsByClassName("component-search__resultitme-selected")[0].classList.remove("component-search__resultitme-selected"),e.firstChild.classList.add("component-search__resultitme-selected"),this._setSelectedLayerStyle(t)}},this)},_setSelectedLayerStyle(e){let t;this._selectMarkerFeature&&this._selectMarkerFeature.remove(),this._selectMarkerFeature=null,this._selectFeature=e,this._selectMarkerFeature=ao().geoJSON(e.toGeoJSON(),{pointToLayer:(e,t)=>ao().marker(t,{icon:ao().divIcon({className:"component-select-marker-icon",iconAnchor:[15,0]})}),style:{fillColor:"red",weight:1,opacity:1,color:"red",fillOpacity:.2}}).addTo(this.map),this._selectMarkerFeature.bindPopup(function(){return new ka({attributes:e.feature.properties}).getElement()},{closeOnClick:!1}).openPopup().addTo(this.map),this._flyToBounds(this.searchResultLayer.getBounds()),e.getLatLng?t=e.getLatLng():e.getCenter&&(t=e.getCenter()),this.map.setView(t)}}),Ac=ao().Evented.extend({options:{_defaultLayerOptions:{style:null,onEachFeature:function(e,t){let i="属性信息如下:
";for(let t in e.properties)i+=t+": "+e.properties[t]+"
";t.bindPopup(i)}}},initialize(e,t=null){if(!e)return new Error("Cannot find map, fileModel.map cannot be null.");this.map=e,ao().Util.extend(this.options._defaultLayerOptions,t),this.options._defaultLayerOptions.pointToLayer=this.options._defaultLayerOptions.style,this.popupsStatus=!0,this.dataFlowStatus=!1,this.dataFlowUrl="",this.currentFeatures=[],this.dataFlowLayer=null},subscribe(e){if(this.dataFlowUrl===e){if(this.dataFlowStatus)return void this.fire("dataflowservicesubscribed")}else this.dataFlowUrl=e;this.dataFlowStatus=!0,this.dataFlowLayer&&(this.dataFlowLayer.remove(),this.dataFlowLayer=null);const t=new wl(e,this.options._defaultLayerOptions);t.on("subscribesucceeded",e=>{this.fire("subscribesucceeded",{result:e})}),t.on("subscribefailed",e=>{this.fire("subscribefailed",{result:e})}),t.on("dataupdated",e=>{this.fire("dataupdated",{result:e});let t=e.layer.getBounds(),i=vo.toSuperMapBounds(this.map.getBounds()),r=vo.toSuperMapBounds(t);i.intersectsBounds(r)||(r.left===r.right&&r.top===r.bottom?this.map.setView(t.getCenter()):this.map.flyToBounds(t)),this.popupsStatus&&this.openPopups()}),t.addTo(this.map),this.dataFlowLayer=t},cancelSubscribe(){this.dataFlowLayer&&(this.dataFlowStatus=!1,this.dataFlowLayer.dataService.unSubscribe(),this.dataFlowLayer.remove(),this.dataFlowLayer=null)},openPopups(){if(this.popupsStatus=!0,this.dataFlowLayer){const e=this.dataFlowLayer.getLayers();for(let t=0;t{n.value="",e.target.hidden=!0}),n.oninput=(()=>{a.hidden=!1}),s.appendChild(a),r.appendChild(s),i.appendChild(r);const o=document.createElement("div");o.setAttribute("class","component-dataflow__container");const l=document.createElement("div");l.setAttribute("class","component-checkbox-container");const h=document.createElement("div");h.setAttribute("class","component-checkbox-default component-checkbox-selected-img"),h.checked=!0,l.appendChild(h);const u=document.createElement("div");u.setAttribute("class","component-label component-label-selected"),u.innerHTML=Ma.i18n("text_displayFeaturesInfo"),l.appendChild(u),h.onclick=(e=>{e.target.checked=!e.target.checked,e.target.checked?(u.setAttribute("class","component-label component-label-selected"),e.target.setAttribute("class","component-checkbox-default component-checkbox-selected-img"),this.viewModel.openPopups()):(u.setAttribute("class","component-label"),e.target.setAttribute("class","component-checkbox-default component-checkbox-default-img"),this.viewModel.closePopups())}),o.appendChild(l),i.appendChild(o);const c=document.createElement("div");c.setAttribute("class","component-dataflow__container component-init-center");const d=document.createElement("button");d.setAttribute("class","component-button-default"),d.innerHTML=Ma.i18n("text_subscribe"),d.onclick=(()=>{const e=n.value;""!==e?this.viewModel.subscribe(e):this.messageBox.showView(Ma.i18n("msg_inputDataFlowUrlFirst"))}),c.appendChild(d);const p=document.createElement("button");return p.setAttribute("class","component-button-default"),p.innerHTML=Ma.i18n("text_cancelSubscribe"),p.onclick=(()=>{this.viewModel.cancelSubscribe()}),c.appendChild(p),i.appendChild(c),this.messageBox=new wa,this.viewModel.on("dataflowservicesubscribed",()=>{this.messageBox.showView(Ma.i18n("msg_dataflowservicesubscribed"))}),this.viewModel.on("subscribesucceeded",()=>{this.messageBox.showView(Ma.i18n("msg_subscribesucceeded"))}),this.viewModel.on("dataupdated",e=>{this.messageBox.closeView(),this._event.fire("dataupdated",e)}),this._preventMapEvent(t,this.map),t}});class Ec{constructor(e,t){this.layerName=e,this.layer=t}}class Lc extends ao().Evented{initialize(e){this.workerUrl=e,this.turfLayers=[]}getLayersData(e){let t={},i={},r={},s={};for(let t=0;t{if(0===i.data.features.length)n.fire("analysisfailed");else{n.fire("analysissucceeded",{data:i.data});let r=ao().geoJSON(i.data,{style:{color:"#1060C2",weight:3},onEachFeature:function(e,t){e.properties&&t.bindPopup(new ka(e.properties).getElement()),t.on({mouseover:function(){t.setStyle({color:"#ffffff",weight:5})},mouseout:function(){t.setStyle({color:"#1060C2",weight:3})},click:function(){t.setStyle({color:"#ffffff",weight:5})}})}}).addTo(t);n.turfLayers.push(r),n.fire("layerloaded",{layer:r,name:e.resultLayersName}),n.worker.terminate()}})}else if("buffer"===e.analysisMethod){let r=this,s={analysisMethod:"buffer",radius:e.radius,unit:e.unit,isSave:e.isSaveStatus,isUnion:e.isUnion,geoJson:i};this.worker.postMessage(s),this.worker.onmessage=(i=>{let s=ao().geoJSON(i.data,{style:{color:"#ffffff",fillColor:"#1060C2",fillOpacity:.5,weight:1.5},onEachFeature:function(e,t){e.properties&&t.bindPopup(new ka(e.properties).getElement()),t.on({mouseover:function(){t.setStyle({color:"#ffffff",fillColor:"rgb(46,40,79)",fillOpacity:.5,weight:5})},mouseout:function(){t.setStyle({color:"#ffffff",fillColor:"#1060C2",fillOpacity:.5,weight:1.5})},click:function(){t.setStyle({color:"#ffffff",fillColor:"rgb(46,40,79)",fillOpacity:.5,weight:2})}})}}).addTo(t);r.turfLayers.push(s),r.fire("layerloaded",{layer:s,name:e.resultLayersName}),r.worker.terminate()})}}clearLayers(){for(let e in this.turfLayers)this.turfLayers[e].clearLayers();this.fire("layersremoved",{layers:this.turfLayers})}cancelAnalysis(){this.worker.terminate()}}var Oc=bc.extend({initialize:function(e,t){if(!e)throw new Error("workerUrl is required");this.workerUrl=e,bc.prototype.initialize.apply(this,[t])},onAdd:function(e){return this.map=e,bc.prototype.onAdd.apply(this,[e])},addLayer:function(e){this.layers=this.layers||[],this.layers.push(e);let t=this.viewModel.getLayersData(this.layers);this.fillDataToView(t)},fillDataToView:function(e){if(!e)return;this.fillData=e;let t={};switch(document.getElementById("dropDownTop").getAttribute("data-value")){case"isolines":case"buffer":t=e.point}if("{}"==JSON.stringify(t))return;let i=[];for(let e in t)i.push(e);let r=document.getElementById("layersSelect"),s=document.getElementById("layerSelectName");r.innerHTML="",s.title=i[0],s.innerHTML=i[0],this._createOptions(r,i),this.layerSelectObj.optionClickEvent(r,s,this.layersSelectOnchange);let n=t[s.title],a=n.fields,o=n.fieldsValue;this.currentData=n,this.currentFillData=t;let l=document.getElementById("fieldsSelect");l.innerHTML="";let h=document.getElementById("fieldsSelectName");h.innerHTML=a[0],h.title=a[0],this._createOptions(l,a),this.fieldsSelectObj.optionClickEvent(l,h,this.fieldsSelectOnchange);let u=h.title,c=document.getElementById("getValueTextArea");c.value=o[u].toString().replace(/,/g,",\r\n"),c.setAttribute("data-value",o[u]);let d=document.getElementById("resultLayersName");switch(document.getElementById("dropDownTop").getAttribute("data-value")){case"isolines":d.value=Ma.i18n("text_label_isolines")+s.title;break;case"buffer":d.value=Ma.i18n("text_label_buffer")+s.title}},_initView:function(){this.workerUrl&&(this.viewModel=new Lc(this.workerUrl));let e=new Pa({title:Ma.i18n("title_clientComputing")}).getElement();e.classList.add("component-analysis"),e.children[0].style.fontSize="12px";let t=[{title:Ma.i18n("text_isoline"),dataValue:"isolines",remark:Ma.i18n("text_extractDiscreteValue"),icon:{className:"component-analyst-isoline-img"}},{title:Ma.i18n("text_buffer"),dataValue:"buffer",remark:Ma.i18n("text_specifyTheDistance"),icon:{className:"component-analyst-buffer-img"}}],i=e.children[1];i.classList.add("component-content--scroll"),i.classList.add("component-content--analysis");let r=new Ia(t).getElement();i.appendChild(r);let s=r.children[0].children[0],n=r.children[0].children[2].children[0];s.children[0].id="dropDownTop";let a=ao().DomUtil.create("div","component-analysis__container",i),o=ao().DomUtil.create("div","component-analysis__container__analysisLayer",a),l=ao().DomUtil.create("div","component-analysis__selecttool",o);l.id="layerSelectControl";let h={optionsArr:[""],labelName:Ma.i18n("text_label_analysisLayer")},u=new Na(h),c=u.getElement();this.layerSelectObj=u,l.appendChild(c);let d=c.children[1].children[0];d.id="layerSelectName",c.children[1].children[2].children[0].children[0].id="layersSelect";let p=ao().DomUtil.create("div","component-analysis__container__analysistype",a),f=ao().DomUtil.create("div","component-clientcomputation__isoline",p),m={optionsArr:[""],labelName:Ma.i18n("text_label_extractField"),optionsClickCb:this.fieldsSelectOnchange},y=ao().DomUtil.create("div","component-analysis__selecttool",f),g=new Na(m),v=g.getElement();this.fieldsSelectObj=g;let b=v.children[1].children[0];b.id="fieldsSelectName";let _=v.children[1].children[2].children[0].children[0];_.id="fieldsSelect",y.appendChild(v);let S=ao().DomUtil.create("div","component-analysis__container",f);ao().DomUtil.create("span","component-textarea__name",S).innerHTML=Ma.i18n("text_label_extractedValue");let x=ao().DomUtil.create("div","component-textarea",S);x.id="getValueText";let w=ao().DomUtil.create("div","",x),C=ao().DomUtil.create("div","component-scrollarea-content",w);C.setAttribute("tabindex","1");let M=ao().DomUtil.create("textarea","component-textarea__content",C);M.id="getValueTextArea",M.setAttribute("rows","20");let A=ao().DomUtil.create("div","",f);ao().DomUtil.create("span","",A).innerHTML=Ma.i18n("text_label_distanceAttenuation");let T=ao().DomUtil.create("input","",A);T.value="3";let E=ao().DomUtil.create("div","",f);ao().DomUtil.create("span","",E).innerHTML=Ma.i18n("text_label_gridSize");let L=ao().DomUtil.create("input","",E);L.value="30";let O=ao().DomUtil.create("div","component-clientcomputation__buffer hidden",p),P=ao().DomUtil.create("div","component-clientcomputation__buffer--radius",O);ao().DomUtil.create("span","",P).innerHTML=Ma.i18n("text_label_bufferRadius");let N=ao().DomUtil.create("div","",P),I=ao().DomUtil.create("input","buffer-radius-input",N);I.id="bufferRadiusInput",I.value="10",I.setAttribute("placeholder",Ma.i18n("text_label_defaultkilometers"));let F=ao().DomUtil.create("div","component-clientcomputation__buffer--unit",N);F.id="bufferUnit";let k={optionsArr:[Ma.i18n("text_option_kilometer")],labelName:Ma.i18n("text_label_unit")},D=new Na(k).getElement(),R=D.children[1].children[0];R.id="bufferUnitSelectName",D.children[1].children[2].children[0].children[0].id="bufferUnitSelect",D.children[0].style.display="none",F.appendChild(D);let B=ao().DomUtil.create("div","",P),G=ao().DomUtil.create("div","component-clientcomputation__buffer--issaveattrs",B);G.id="saveAttrsContainer";let U=ao().DomUtil.create("div","checkbox checkbox-fault",G);U.id="saveAttrsCheckbox";let j=ao().DomUtil.create("div","lable",G);j.id="saveAttrsLabel",j.innerHTML=Ma.i18n("text_retainOriginal");let z=ao().DomUtil.create("div","component-clientcomputation__buffer--isunion",B);z.id="isUnionContainer";let V=ao().DomUtil.create("div","checkbox checkbox-fault",z);V.id="isUnionCheckbox";let J=ao().DomUtil.create("div","lable",z);J.innerHTML=Ma.i18n("text_mergeBuffer"),J.id="isUnionLabel";let q=ao().DomUtil.create("div","component-analysis__container__resultLayersName",a);ao().DomUtil.create("span","",q).innerHTML=Ma.i18n("text_label_resultLayerName");let H=ao().DomUtil.create("input","",q);H.id="resultLayersName";let W=ao().DomUtil.create("div","component-analysis__container__analysisbtn",a),Y=ao().DomUtil.create("div","component-analysis__analysisbtn",W),X=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis",Y);X.innerHTML=Ma.i18n("btn_analyze");let Q=ao().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",Y),Z=ao().DomUtil.create("div","component-analysis__analysisbtn--analysising",Q),K=ao().DomUtil.create("div","component-analysis__svg-container",Z);K.id="analyse_background",K.innerHTML='\n \n \n \n \n ',ao().DomUtil.create("span","",Z).innerHTML=Ma.i18n("btn_analyzing");let $=ao().DomUtil.create("button","component-analysis__analysisbtn--cancel",Q);$.innerHTML=Ma.i18n("btn_cancelAnalysis");let ee=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",Y);ee.innerHTML=Ma.i18n("btn_emptyTheAnalysisLayer");for(let e=0;e{s.innerHTML=n.children[e].outerHTML,s.children[0].id="dropDownTop";let t=document.getElementById("layersSelect"),r=document.getElementById("layerSelectName"),a=n.children[e].getAttribute("data-value"),o={};switch(a){case"buffer":f.classList.add("hidden"),O.classList.remove("hidden"),i.style.height="422px",H.value=Ma.i18n("text_label_buffer")+r.title,o=this.fillData.point;break;case"isolines":f.classList.remove("hidden"),O.classList.add("hidden"),i.style.height="712px",H.value=Ma.i18n("text_label_isolines")+r.title,o=this.fillData.point}if(this.currentFillData===o)return;if(t.innerHTML="","{}"==JSON.stringify(o))return H.value="",r.title="",void(r.innerHTML="");let l=[];for(let e in o)l.push(e);r.title=l[0],r.innerHTML=l[0],this._createOptions(t,l),this.layerSelectObj.optionClickEvent(t,r,this.layersSelectOnchange),"buffer"===a?H.value=Ma.i18n("text_label_buffer")+l[0]:"isolines"===a&&(H.value=Ma.i18n("text_label_isolines")+l[0]),this.currentData=o[r.title],this.currentFillData=o});this.fieldsSelectOnchange=function(e){if(this.currentData){let t=this.currentData,i=e.title;M.value=t.fieldsValue[i].toString().replace(/,/g,",\r\n"),M.setAttribute("data-value",t.fieldsValue[i])}}.bind(this),this.layersSelectOnchange=function(e){if(this.currentData){let t=e.title,i=this.currentFillData[t];this.currentData=i,_.innerHTML="",this._createOptions(_,i.fields);let r=document.getElementById("fieldsSelectName"),s=i.fields[0];r.title=s,r.innerHTML=s;let n=s;this.fieldsSelectObj.optionClickEvent(_,r,this.fieldsSelectOnchange),M.value=i.fieldsValue[n].toString().replace(/,/g,",\r\n"),M.setAttribute("data-value",i.fieldsValue[n]);let a=document.getElementById("dropDownTop").getAttribute("data-value");switch(a){case"buffer":H.value=Ma.i18n("text_label_buffer")+t;break;case"isolines":H.value=Ma.i18n("text_label_isolines")+t}}}.bind(this);let te=!0,ie=!1;return j.classList.add("selected"),U.classList.add("checkbox-active"),G.onclick=(()=>{te?(U.classList.add("checkbox-fault"),U.classList.remove("checkbox-active"),j.classList.remove("selected"),te=!1):(U.classList.add("checkbox-active"),U.classList.remove("checkbox-fault"),j.classList.add("selected"),te=!0,ie&&(V.classList.add("checkbox-fault"),V.classList.remove("checkbox-active"),ie=!1))}),z.onclick=(()=>{ie?(V.classList.add("checkbox-fault"),V.classList.remove("checkbox-active"),J.classList.remove("selected"),ie=!1):(V.classList.add("checkbox-active"),V.classList.remove("checkbox-fault"),J.classList.add("selected"),ie=!0,te&&(U.classList.add("checkbox-fault"),U.classList.remove("checkbox-active"),te=!1))}),this.messageBox=new wa,X.onclick=(()=>{let e;switch(Q.style.display="block",X.style.display="none",document.getElementById("dropDownTop").getAttribute("data-value")){case"isolines":e=function(){let e=document.getElementById("dropDownTop").getAttribute("data-value"),t=document.getElementById("resultLayersName").value,i=d.title,r=b.title,s=M.value.replace(/[\r\n]/g,"").split(",").toString(),n=T.value,a=L.value;return{analysisMethod:e,analysisLayers:i,analysisFields:r,analysisFieldsValue:s,analysisBreaks:n,analysisCellSize:a,resultLayersName:t}}();break;case"buffer":e=function(){let e=document.getElementById("dropDownTop"),t=document.getElementById("resultLayersName").value,i=d.title,r=e.getAttribute("data-value"),s=I.value,n=R.title;return{analysisMethod:r,analysisLayers:i,radius:s,unit:n,resultLayersName:t,isSaveStatus:te,isUnion:ie}}()}this.viewModel.analysis(e,this.map),this.viewModel.on("layerloaded",e=>{Q.style.display="none",X.style.display="block",this._event.fire("analysissucceeded",{layer:e.layer,name:e.name})}),this.viewModel.on("analysisfailed",()=>{Q.style.display="none",X.style.display="block",this.messageBox.showView(Ma.i18n("msg_resultIsEmpty"),"failure"),this._event.fire("analysisfailed")})}),$.onclick=(()=>{Q.style.display="none",X.style.display="block",this.viewModel.cancelAnalysis()}),ee.onclick=(()=>{this.viewModel.on("layersremoved",e=>{this._event.fire("layersremoved",{layers:e.layers})}),this.viewModel.clearLayers()}),this._preventMapEvent(e,this.map),e},_createOptions(e,t){for(let i in t){let r=document.createElement("div"),s=t[i];r.className="component-selecttool__option",r.title=s,r.innerHTML=s,r.setAttribute("data-value",s),e.appendChild(r)}}});class Pc{constructor(e){this.layerName=e.layerName,this.layer=e.layer,this.fields=e.fields||null}}class Nc extends ao().Evented{initialize(e){this.processingUrl=e}getDatasetsName(){let e=this.processingUrl;this.dataset=[],this.dataset.datasetNames=[],this.dataset.childUrl=[];let t="http://"+e.split("/")[2],i=t+"/iserver/services/datacatalog/rest/datacatalog/sharefile.json",r=t+"/iserver/services/datacatalog/rest/datacatalog/relationship/datasets.json",s=this;Ue.get(i).then(function(e){return e.json()}).then(function(e){s.dataset.datasetNames=s.dataset.datasetNames.concat(e.datasetNames),s.dataset.childUrl=s.dataset.childUrl.concat(e.childUriList);let t=s;Ue.get(r).then(function(e){return e.json()}).then(function(e){t.dataset.datasetNames=t.dataset.datasetNames.concat(e.datasetNames),t.dataset.childUrl=t.dataset.childUrl.concat(e.childUriList);let i=[];for(let e in t.dataset.datasetNames)i[t.dataset.datasetNames[e]]=t.dataset.childUrl[e];t.fire("datasetsloaded",{result:{dataset:t.dataset,datasetHash:i}})})})}getDatasetInfo(e){let t,i=this;Ue.get(e).then(function(e){return e.json()}).then(function(e){let r=e.datasetInfo;"LINE"===r.datasetType||"LINE"===r.type?t="LINE":"POINT"===r.datasetType||"POINT"===r.type||"CSV"===r.type?t="POINT":"REGION"!==r.datasetType&&"REGION"!==r.type||(t="REGION");let s=[],n=r.fieldInfos||r.fieldInfo||null;if(n){for(let e in n)s.push(n[e].name);i.fire("datasetinfoloaded",{result:{type:t,fields:s}})}else{let r=e.childUriList[0].replace("//fields","/fields");Ue.get(r).then(function(e){return e.json()}).then(function(e){let r=e.fieldNames,s=[];for(let e in r)s.push(r[e]);i.fire("datasetinfoloaded",{result:{type:t,fields:s}})})}})}}class Ic extends ao().Evented{initialize(e){this.processingUrl=e}getDatasetsName(){let e=this.processingUrl;this.resultLayers=[],this.datasetNames=[],this.distributedAnalysisModel=new Nc(e),this.distributedAnalysisModel.getDatasetsName();let t=this;this.distributedAnalysisModel.on("datasetsloaded",function(e){t.fire("datasetsloaded",{result:e.result})})}getDatasetInfo(e){this.distributedAnalysisModel.getDatasetInfo(e);let t=this;this.distributedAnalysisModel.on("datasetinfoloaded",function(e){let i=e.result.type,r=e.result.fields;t.fire("datasetinfoloaded",{result:{type:i,fields:r}})})}analysis(e,t){let i=new cc(this.processingUrl);if(e.analysisParam instanceof Pr){let r=e.analysisParam,s=this;i.addKernelDensityJob(r,function(i){i.error?s.fire("analysisfailed",{error:i.error}):i.result.setting.serviceInfo.targetServiceInfos.map(function(i){return"RESTMAP"===i.serviceType&&Ue.get(i.serviceAddress+"/maps").then(function(e){return e.json()}).then(function(i){let r=i[0].path;s.fire("analysissucceed",{result:i});let n=Wo(r,{noWrap:!0,transparent:!0});s.resultLayers.push(n),n.addTo(t);let a=new Date,o=e.resultLayerName||a.getTime();s.fire("layerloaded",{layer:n,name:o})}),i})})}}clearLayers(){for(let e in this.resultLayers)this.resultLayers[e].remove();this.fire("layersremoved",{layers:this.resultLayers}),this.resultLayers=[]}}var Fc=bc.extend({initialize:function(e,t){bc.prototype.initialize.apply(this,[t]),this.viewModel=new Ic(e)},onAdd:function(e){return this._fillDataToView(),bc.prototype.onAdd.apply(this,[e])},_fillDataToView:function(){this.viewModel.on("datasetsloaded",e=>{let t=e.result.dataset.datasetNames;this.datasetSelect.innerHTML="",this._createOptions(this.datasetSelect,t),this.datasetSelectObj.optionClickEvent(this.datasetSelect,this.datasetSelectName,this.datasetSelectOnchange),this.dataHash=e.result.datasetHash}),this.viewModel.getDatasetsName()},_initView:function(){let e=new Pa({title:Ma.i18n("title_distributedAnalysis")}).getElement();e.classList.add("component-analysis"),e.children[0].style.fontSize="12px";let t=ao().DomUtil.create("div","component-content component-content--scroll component-content--analysis",e),i=[{title:Ma.i18n("text_densityAnalysis"),dataValue:"density",remark:Ma.i18n("text_CalculateTheValuePerUnitArea"),icon:{className:"component-analyst-density-img"}}],r=new Ia(i).getElement();t.appendChild(r);let s=r.children[0].children[0].children[0],n=ao().DomUtil.create("div","component-analysis__container",t),a=ao().DomUtil.create("div","analysistype",n),o=ao().DomUtil.create("div","component-analysis__container__analysisLayer",a),l=ao().DomUtil.create("div","component-analysis__selecttool",o),h={optionsArr:[Ma.i18n("text_option_selectDataset")],labelName:Ma.i18n("text_label_dataset"),optionsClickCb:te.bind(this)},u=new Na(h),c=u.getElement();this.datasetSelectObj=u,l.appendChild(c);let d=c.children[1].children[0];this.datasetSelectName=d;let p=c.children[1].children[2].children[0].children[0];p.children[0].style.display="none",this.datasetSelect=p;let f=ao().DomUtil.create("div","component-analysis__idw",o),m=[{optionsArr:[Ma.i18n("text_option_simplePointDensityAnalysis"),Ma.i18n("text_option_nuclearDensityAnalysis")],labelName:Ma.i18n("text_label_analyticalMethod")},{optionsArr:[Ma.i18n("text_option_quadrilateral"),Ma.i18n("text_option_hexagon")],labelName:Ma.i18n("text_label_meshType")}],y=ao().DomUtil.create("div","component-analysis__idw__selecttool",f);for(let e in m){let t=new Na(m[e]).getElement();y.appendChild(t)}let g={optionsArr:[Ma.i18n("text_option_notSet")],labelName:Ma.i18n("text_label_weightField")},v=new Na(g),b=v.getElement();y.appendChild(b),this.weightFieldsSelectObj=v;let _=y.children[0].children[1].children[0];_.setAttribute("data-value","0");let S=y.children[0].children[1].children[2].children[0].children[0];this._setEleAtribute(["0","1"],"data-value",S.children);let x=y.children[1].children[1].children[0];x.setAttribute("data-value","0");let w=y.children[1].children[1].children[2].children[0].children[0];this._setEleAtribute(["0","1"],"data-value",w.children);let C=y.children[2].children[1].children[0],M=y.children[2].children[1].children[2].children[0].children[0],A=[{spanName:Ma.i18n("text_label_queryRange"),value:""}];for(let e in A)this._creatInputBox(A[e],y);let T=y.children[3].children[1];T.setAttribute("placeholder",Ma.i18n("text_label_queryRangeTips")),T.title=Ma.i18n("text_label_queryRangeTips");let E={labelName:Ma.i18n("text_label_gridSizeInMeters"),selectOptions:{optionsArr:["Meter","Kilometer","Yard","Foot","Mile"]}},L=this._creatUnitSelectBox(E,y),O=L.children[1].children[0];O.value="1000";let P=L.children[1].children[1].children[0].children[0].children[0],N={labelName:Ma.i18n("text_label_searchRadius"),selectOptions:{optionsArr:["Meter","Kilometer","Yard","Foot","Mile"]}},I=this._creatUnitSelectBox(N,y),F=I.children[1].children[0];F.value="300";let k=I.children[1].children[1].children[0].children[0].children[0],D={labelName:Ma.i18n("text_label_areaUnit"),optionsArr:["SquareMile","SquareMeter","Hectare","Acre","SquareFoot","SquareYard"]},R=new Na(D).getElement();y.appendChild(R);let B=R.children[1].children[0],G=ao().DomUtil.create("div","range-content",a),U={optionsArr:[Ma.i18n("text_option_notSet"),Ma.i18n("text_option_equidistantSegmentation"),Ma.i18n("text_option_logarithm"),Ma.i18n("text_option_equalCountingSegment"),Ma.i18n("text_option_squareRootSegmentation")],labelName:Ma.i18n("text_label_thematicMapSegmentationMode"),optionsClickCb:function(e){"NOTSET"!==e.getAttribute("data-value")?(V.classList.remove("hidden"),J.classList.remove("hidden")):(V.classList.add("hidden"),J.classList.add("hidden"))}};G.appendChild(new Na(U).getElement());let j=G.children[0].children[1].children[0];j.setAttribute("data-value","NOTSET");let z=G.children[0].children[1].children[2].children[0].children[0];this._setEleAtribute(["NOTSET","EQUALINTERVAL","LOGARITHM","QUANTILE","SQUAREROOT"],"data-value",z.children);let V=this._creatInputBox({spanName:Ma.i18n("text_label_thematicMapSegmentationParameters"),value:"20"},G);V.classList.add("hidden");let J=new Na({optionsArr:[Ma.i18n("text_option_greenOrangePurpleGradient"),Ma.i18n("text_option_greenOrangeRedGradient"),Ma.i18n("text_option_rainbowGradient"),Ma.i18n("text_option_spectralGradient"),Ma.i18n("text_option_terrainGradient")],labelName:Ma.i18n("text_label_thematicMapColorGradientMode")}).getElement();G.appendChild(J),J.classList.add("hidden");let q=J.children[1].children[2].children[0].children[0],H=J.children[1].children[0];H.setAttribute("data-value","GREENORANGEVIOLET");this._setEleAtribute(["GREENORANGEVIOLET","GREENORANGERED","RAINBOW","SPECTRUM","TERRAIN"],"data-value",q.children);let W=ao().DomUtil.create("div","",a);ao().DomUtil.create("span","",W).innerHTML=Ma.i18n("text_label_resultLayerName");let Y=ao().DomUtil.create("input","component-distributeanalysis__input",W),X=ao().DomUtil.create("div","component-analysis__container__analysisbtn",n),Q=ao().DomUtil.create("div","component-analysis__analysisbtn",X),Z=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis",Q);Z.innerHTML=Ma.i18n("btn_analyze");let K=ao().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",Q),$=ao().DomUtil.create("div","component-analysis__analysisbtn--analysising",K);$.style.width="200px",ao().DomUtil.create("div","component-analysis__svg-container",$).innerHTML='\n \n \n \n \n ',ao().DomUtil.create("span","",$).innerHTML=Ma.i18n("btn_analyzing");let ee=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",Q);function te(e){if(this.messageBox.closeView(),this.dataHash){M.innerHTML="";let t=this.dataHash[e.title],i=this;this.viewModel.on("datasetinfoloaded",function(e){C.title=Ma.i18n("text_option_notSet"),C.innerHTML=Ma.i18n("text_option_notSet"),M.innerHTML="";let t=s.getAttribute("data-value"),r=e.result.type,n=e.result.fields;"density"===t&&("REGION"===r||"LINE"===r?i.messageBox.showView(Ma.i18n("msg_datasetOrMethodUnsupport"),"failure"):(i.messageBox.closeView(),i._createOptions(M,n),i.weightFieldsSelectObj.optionClickEvent(M,C)))}),this.viewModel.getDatasetInfo(t)}}return ee.id="deleteLayersBtn",ee.innerHTML=Ma.i18n("btn_emptyTheAnalysisLayer"),this.messageBox=new wa,this.datasetSelectOnchange=te.bind(this),Z.onclick=(()=>{this.messageBox.closeView();let e=function(){let e,t,i=s.getAttribute("data-value"),r=_.getAttribute("data-value"),n=x.getAttribute("data-value"),a=T.value,o=P.title,l=k.title,h=B.title,u=H.getAttribute("data-value"),c=j.getAttribute("data-value"),p=new Date,f=Y.value||p.getTime();e="NOTSET"===c?"":{rangeMode:c,rangeCount:V.value,colorGradientType:u};"density"===i&&(t=new Pr({datasetName:d.title,method:r,meshType:n,resolution:O.value,fields:C.title,radius:F.value,meshSizeUnit:o,radiusUnit:l,areaUnit:h,query:a,mappingParameters:new _t({rangeMode:e.rangeMode,rangeCount:e.rangeCount,colorGradientType:e.colorGradientType})}));return{analysisParam:t,resultLayerName:f}}();d.title===Ma.i18n("text_option_selectDataset")?this.messageBox.showView(Ma.i18n("msg_selectDataset"),"failure"):C.title===Ma.i18n("text_option_notSet")?this.messageBox.showView(Ma.i18n("msg_setTheWeightField"),"failure"):(this.messageBox.closeView(),K.style.display="block",Z.style.display="none",this.viewModel.on("layerloaded",e=>{K.style.display="none",Z.style.display="block",this._event.fire("analysissucceeded",{layer:e.layer,name:e.name})}),this.viewModel.on("analysisfailed",e=>{this.messageBox.showView(Ma.i18n("msg_theFieldNotSupportAnalysis"),"failure"),K.style.display="none",Z.style.display="block",this._event.fire("analysisfailed",{error:e.error})}),this.viewModel.analysis(e,this.map))}),ee.onclick=(()=>{this.viewModel.on("layersremoved",e=>{this._event.fire("layersremoved",{layers:e.layers})}),this.viewModel.clearLayers()}),this._preventMapEvent(e,this.map),e},_createOptions(e,t){for(let i in t){let r=document.createElement("div");r.className="component-selecttool__option",r.title=t[i],r.innerHTML=t[i],r.setAttribute("data-value",t[i]),e.appendChild(r)}},_creatInputBox(e,t){let i=ao().DomUtil.create("div","",t);ao().DomUtil.create("span","",i).innerHTML=e.spanName;let r=ao().DomUtil.create("input","",i);return r.value=e.value,r.className="component-distributeanalysis__input",i},_creatUnitSelectBox(e,t){let i=ao().DomUtil.create("div","component-clientcomputation__buffer--radius",t);ao().DomUtil.create("span","",i).innerHTML=e.labelName;let r=ao().DomUtil.create("div","",i);ao().DomUtil.create("input","buffer-radius-input",r);let s=ao().DomUtil.create("div","component-clientcomputation__buffer--unit",r),n=e.selectOptions,a=new Na(n).getElement();return s.appendChild(a),i},_setEleAtribute(e,t,i){for(let r=0;r1){let r={optionsArr:e,labelName:Ma.i18n("text_label_queryMode"),optionsClickCb:this.queryModeltOnchange},s=new Na(r).getElement();t.appendChild(s),i=s.children[1].children[0],s.children[1].classList.add("dataservice-select");let n=s.children[1];n.classList.add("dataservice-select"),n.classList.add("querymodel-select")}else{let t=ao().DomUtil.create("span","",o);t.innerHTML=Ma.i18n("text_label_queryMode"),i=ao().DomUtil.create("div","component-servicequery__querymode-selectname",o);let r=ao().DomUtil.create("span","",i);e instanceof Array?r.innerHTML=e[0]:r.innerHTML=e,i.title=r.innerHTML,this.queryModeltOnchange(i)}return i.id="queryModelSelectName",i}.bind(this),this.queryModeltOnchange=H.bind(this),this.creatQueryModeSelect(i,l);let h=ao().DomUtil.create("div","component-analysis__container component-textarea--dataservice__container",n),u=ao().DomUtil.create("span","textarea-name",h);u.innerHTML=Ma.i18n("text_label_IDArrayOfFeatures");let c=ao().DomUtil.create("div","component-textarea component-textarea--dataservice",h);c.id="getfeaturesIdArr";let d=ao().DomUtil.create("div","scrollarea",c),p=ao().DomUtil.create("div","component-scrollarea-content",d);p.setAttribute("tabindex","1");let f=ao().DomUtil.create("textarea","component-textarea__content",p);f.value="[1,2,3]",f.id="getValueTextArea";let m=ao().DomUtil.create("div","component-servicequery__maxfeatures-container hidden",n),y={spanName:Ma.i18n("text_label_maxFeatures"),value:"1000"},g=this._creatInputBox(y,m).children[1];g.classList.add("max-features-input");let v=ao().DomUtil.create("div","component-servicequery__distance-container hidden",n),b={spanName:Ma.i18n("text_label_bufferDistance"),value:"10"},_=this._creatInputBox(b,v).children[1],S=ao().DomUtil.create("div","component-analysis__container component-textarea--dataservice__container hidden",n),x=ao().DomUtil.create("span","textarea-name",S),w=ao().DomUtil.create("div","",S),C=ao().DomUtil.create("div","component-servicequery__rangeicon-container",w);x.innerHTML=Ma.i18n("text_label_queryRange1");let M=ao().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-polygon-layer bounds",C),A=ao().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-line-layer hidden",C),T=ao().DomUtil.create("div","component-servicequery__rangeicon supermapol-icons-point-layer hidden",C),E=ao().DomUtil.create("div","component-textarea component-textarea--rangequery",w);E.id="getfeaturesIdArr";let L=ao().DomUtil.create("div","",E),O=ao().DomUtil.create("div","component-scrollarea-content",L);O.setAttribute("tabindex","1");let P=ao().DomUtil.create("textarea","component-textarea__content component-textarea--rangequery__content",O);P.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}';let N=ao().DomUtil.create("div","component-servicequery__spatialquerymode-container hidden",n),I={optionsArr:["CONTAIN","CROSS","DISJOINT","IDENTITY","INTERSECT","NONE","OVERLAP","TOUCH","WITHIN"],labelName:Ma.i18n("text_label_spatialQueryMode")},F=ao().DomUtil.create("div","component-analysis__selecttool",N),k=new Na(I).getElement();k.children[1].classList.add("dataservice-select"),F.appendChild(k);let D=k.children[1].children[0];D.id="spatialQueryModeSelectName",k.children[1].children[2].classList.add("component-servicequery__spatialquerymode__selectcontent");let R=ao().DomUtil.create("div","component-analysis__container__analysisbtn",n),B=ao().DomUtil.create("div","component-analysis__analysisbtn",R),G=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis",B);G.innerHTML=Ma.i18n("btn_query");let U=ao().DomUtil.create("div","component-analysis__analysisbtn--analysing-container hidden",B),j=ao().DomUtil.create("div","component-analysis__analysisbtn--analysising component-servicequery__querybtn--querying",U);ao().DomUtil.create("div","component-analysis__svg-container",j).innerHTML='\n \n \n \n \n ',ao().DomUtil.create("span","",j).innerHTML=Ma.i18n("btn_querying");let z=ao().DomUtil.create("button","component-analysis__analysisbtn--analysis component-analysis__analysisbtn--deletelayers",B);z.innerHTML=Ma.i18n("btn_emptyTheRresultLayer"),H(i[0]);let V,J,q=this;function H(e){let t;switch(t=e.title?e.title:e,m.classList.add("hidden"),S.classList.add("hidden"),v.classList.add("hidden"),A.classList.add("hidden"),T.classList.add("hidden"),M.classList.remove("bounds"),N.classList.add("hidden"),u.innerHTML=Ma.i18n("text_label_featureFilter"),f.value="SMID<10","BUFFER"!==t&&"SPATIAL"!==t||(S.classList.remove("hidden"),x.innerHTML=Ma.i18n("text_label_geometricObject"),P.value='{"type":"Feature","properties":{},"geometry":{"type":"Point","coordinates":[84.90234375,40.25390625]}}',A.classList.remove("hidden"),T.classList.remove("hidden")),t){case"ID":u.innerHTML=Ma.i18n("text_label_IDArrayOfFeatures"),f.value="[1,2,3]";break;case"SQL":m.classList.remove("hidden");break;case"BOUNDS":S.classList.remove("hidden"),x.innerHTML=Ma.i18n("text_label_queryRange"),P.value='{"leftBottom":{"x":-5,"y":-5},"rightTop":{"x":5,"y":5}}',M.classList.add("bounds");break;case"BUFFER":v.classList.remove("hidden");break;case"SPATIAL":N.classList.remove("hidden")}}return G.onclick=(()=>{this.messageBox.closeView(),U.style.display="block",G.style.display="none";let e=function(){let e,t=q.dataSetNames,i=document.getElementById("queryModelSelectName").title,r=f.value;if("ID"===i){let i=f.value,r=i.substring(1,i.length-1).split(",");e=new zi({IDs:r,datasetNames:t})}else if("SQL"===i){let i=g.value;e=new Ji({queryParameter:{attributeFilter:r},datasetNames:t,maxFeatures:i})}else if("BOUNDS"===i){if(!V){let e=JSON.parse(P.value);V=ao().bounds([e.leftBottom.x,e.leftBottom.y],[e.rightTop.x,e.rightTop.y])}e=new ki({attributeFilter:r,datasetNames:t,bounds:V})}else if("BUFFER"===i){let i=_.value,s=JSON.parse(P.value),n=J||s;e=new Bi({attributeFilter:r,datasetNames:t,bufferDistance:i,geometry:n})}else if("SPATIAL"===i){let i=D.title,s=JSON.parse(P.value),n=J||s;e=new Ui({attributeFilter:r,datasetNames:t,spatialQueryMode:i,geometry:n})}return e}();this.viewModel.on("getfeaturessucceeded",e=>{U.style.display="none",G.style.display="block",0===e.result.features.length&&this.messageBox.showView(Ma.i18n("msg_dataReturnedIsEmpty"),"success"),this._event.fire("getfeaturessucceeded",{result:e.result})}),this.viewModel.on("getfeaturesfailed",e=>{U.style.display="none",G.style.display="block",this.messageBox.showView(e.error.errorMsg,"failure"),this._event.fire("getfeaturesfailed",{error:e.error})}),this.viewModel.getFeatures(e,this.map)}),M.onclick=(e=>{let t=document.getElementById("queryModelSelectName").title;J&&J.remove(),"BOUNDS"===t?this.map.pm.enableDraw("Rectangle"):this.map.pm.enableDraw("Poly"),e.stopPropagation(),e.preventDefault()}),A.onclick=(e=>{J&&J.remove(),this.map.pm.enableDraw("Line"),e.stopPropagation(),e.preventDefault()}),T.onclick=(e=>{J&&J.remove(),this.map.pm.enableDraw("Marker"),e.stopPropagation(),e.preventDefault()}),this.map.on("pm:create",e=>{if("Rectangle"===e.shape){let t=(J=e.layer).getBounds();V=ao().bounds([t._southWest.lng,t._southWest.lat],[t._northEast.lng,t._northEast.lat]);let i={leftBottom:{x:t._southWest.lng,y:t._southWest.lat},rightTop:{x:t._northEast.lng,y:t._northEast.lat}};P.value=JSON.stringify(i)}"Marker"===e.shape&&(J=e.layer,P.value=JSON.stringify(e.layer.toGeoJSON()),this.map.pm.disableDraw("Marker")),"Line"===e.shape&&(J=e.layer,P.value=JSON.stringify(e.layer.toGeoJSON())),"Polygon"===e.shape&&(J=e.layer,P.value=JSON.stringify(e.layer.toGeoJSON()))}),z.onclick=(()=>{this.viewModel.clearLayers()}),this._preventMapEvent(e,this.map),e},_creatInputBox(e,t){let i=ao().DomUtil.create("div","",t);return ao().DomUtil.create("span","",i).innerHTML=e.spanName,ao().DomUtil.create("input","",i).value=e.value,i}});ao().supermap={...e,Components:{...e.Components},...ao().supermap},ao().supermap.components=ao().supermap.components||{},ao().supermap.Components=ao().supermap.Components||{},ao().supermap.control=ao().supermap.control||{},ao().supermap.Util={},ao().Util.toGeoJSON=Oo,ao().supermap.Util.toGeoJSON=Oo,ao().Util.toSuperMapGeometry=Po,ao().supermap.Util.toSuperMapGeometry=Po,ao().Util.resolutionToScale=Io,ao().supermap.Util.resolutionToScale=Io,ao().Util.scaleToResolution=Fo,ao().supermap.Util.scaleToResolution=Fo,ao().Util.getMeterPerMapUnit=No,ao().supermap.Util.getMeterPerMapUnit=No,ao().Util.GetResolutionFromScaleDpi=Do,ao().supermap.Util.getResolutionFromScaleDpi=Do,ao().supermap.Util.GetResolutionFromScaleDpi=Do,ao().Util.NormalizeScale=ko,ao().supermap.Util.normalizeScale=ko,ao().supermap.Util.NormalizeScale=ko,ao().Util.transform=Ro,ao().supermap.Util.transform=Ro,ao().Proj=ao().Proj||{},ao().supermap.Proj=ao().supermap.Proj||{},ao().Proj.CRS=uo,ao().supermap.Proj.crs=uo,ao().supermap.Proj.CRS=ho,ao().Projection={},ao().supermap.Projection=ao().supermap.Projection||{},ao().Projection.NonProjection=To,ao().supermap.Projection.nonProjection=To,ao().supermap.Projection.NonProjection=Ao,ao().supermap.CRS=ao().supermap.CRS||{},ao().CRS.NonEarthCRS=Lo,ao().supermap.CRS.NonEarthCRS=Eo,ao().supermap.CRS.nonEarthCRS=Lo,ao().CRS.BaiduCRS=bo,ao().supermap.CRS.BaiduCRS=bo,ao().CRS.TianDiTu_WGS84CRS=So,ao().supermap.CRS.TianDiTu_WGS84CRS=So,ao().CRS.TianDiTu_MercatorCRS=Mo,ao().supermap.CRS.TianDiTu_MercatorCRS=Mo,ao().CRS.TianDiTu_Mercator=Mo,ao().supermap.CRS.TianDiTu_Mercator=Mo,ao().CRS.TianDiTu_WGS84=So,ao().supermap.CRS.TianDiTu_WGS84=So,ao().CRS.Baidu=bo,ao().supermap.CRS.Baidu=bo,ao().supermap.CommontypesConversion=vo,ao().supermap.components.clientComputationLayer=function(e){return new Pc(e)},ao().supermap.Components.ClientComputationLayer=Pc,ao().supermap.components.clientComputation=function(e){return new Oc(e)},ao().supermap.Components.ClientComputation=Oc,ao().supermap.components.clientComputationViewModel=function(e){return new Lc(e)},ao().supermap.Components.ClientComputationViewModel=Lc,ao().supermap.components.geoJSONLayerWithName=function(e,t){return new Ec(e,t)},ao().supermap.Components.GeoJSONLayerWithName=Ec,ao().supermap.components.GeoJsonLayersDataModel=xc,ao().supermap.Components.GeoJsonLayersDataModel=xc,ao().supermap.components.dataFlow=function(e){return new Tc(e)},ao().supermap.Components.DataFlow=Tc,ao().supermap.components.dataFlowViewModel=function(e){return new Ac(e)},ao().supermap.Components.DataFlowViewModel=Ac,ao().supermap.components.dataServiceQuery=function(e,t,i){return new Rc(e,t,i)},ao().supermap.Components.DataServiceQuery=Rc,ao().supermap.components.dataServiceQueryViewModel=Dc,ao().supermap.Components.DataServiceQueryViewModel=kc,ao().supermap.components.DistributedAnalysisModel=Nc,ao().supermap.Components.DistributedAnalysisModel=Nc,ao().supermap.components.distributedAnalysis=function(e){return new Fc(e)},ao().supermap.Components.DistributedAnalysis=Fc,ao().supermap.components.distributedAnalysisViewModel=function(e){return new Ic(e)},ao().supermap.Components.DistributedAnalysisViewModel=Ic,ao().supermap.components.openFile=function(e){return new Sc(e)},ao().supermap.Components.OpenFile=Sc,ao().supermap.components.openFileViewModel=function(e){return new _c(e)},ao().supermap.Components.OpenFileViewModel=_c,ao().supermap.components.search=function(e){return new Mc(e)},ao().supermap.Components.Search=Mc,ao().supermap.components.searchViewModel=function(e){return new Cc(e)},ao().supermap.Components.SearchViewModel=Cc,ao().supermap.components.componentsViewBase=function(e){return new bc(e)},ao().supermap.Components.ComponentsViewBase=bc,ao().supermap.control.changeTileVersion=function(e){return new mo(e)},ao().supermap.control.ChangeTileVersion=mo,ao().supermap.control.logo=function(e){return new yo(e)},ao().supermap.control.Logo=yo,ao().supermap.baiduTileLayer=Go,ao().supermap.BaiduTileLayer=Bo,ao().supermap.cloudTileLayer=jo,ao().supermap.CloudTileLayer=Uo,ao().supermap.imageMapLayer=function(e,t){return new zo(e,t)},ao().supermap.ImageMapLayer=zo,ao().supermap.imageTileLayer=function(e,t){return new dl(e,t)},ao().supermap.ImageTileLayer=dl,ao().supermap.tiandituTileLayer=function(e){return new qo(e)},ao().supermap.TiandituTileLayer=qo,ao().supermap.tiledMapLayer=Wo,ao().supermap.TiledMapLayer=Ho,ao().supermap.wmtsLayer=Jo,ao().supermap.WMTSLayer=Vo,ao().supermap.webmap=function(e,t){return new cl(e,t)},ao().supermap.WebMap=cl,ao().supermap.initMap=function(e,t){const i=(t=t||{}).mapOptions||{},r=t.layerOptions||{};return new Promise((t,s)=>{new fo(e).getMapInfo(async n=>{if("processCompleted"===n.type){const{prjCoordSys:s}=n.result,a=yl(s);fl(s)||await async function(e,t){if(!ml(t,!1)){const i=await async function(e){return new Promise((t,i)=>{new fo(e,{withoutFormatSuffix:!0}).getWkt(e=>{if("processCompleted"!==e.type)i();else{const i=e.result.data;t(i)}})})}(e);i&&lo().defs(t,i)}}(e,a);const o=function(e,t){const{bounds:i,center:r,scale:s,visibleScales:n,prjCoordSys:a,dpi:o,coordUnit:l}=e,{maxZoom:h=22}=t,u=An(n,i,o,l,h),c=pl({prjCoordSys:a,bounds:i,dpi:o,visibleScales:n,coordUnit:l},{maxZoom:h}),d=c.resolutions||u;return{crs:c,center:function(e,{center:t,bounds:i}){const r="string"==typeof e?e:e.code;return"number"!=typeof t.x&&"number"!=typeof t.y&&(t={lat:(i.bottom+i.top)/2,lng:(i.left+i.right)/2}),"EPSG:4326"===r?{lat:t.y,lng:t.x}:e.unproject(ao().point(t.x,t.y))}(c,{center:r,bounds:i}),zoom:function({scale:e,dpi:t,coordUnit:i},r){return function(e,t){let i,r=0;for(let s=0;sMath.abs(e-t[s])&&(i=Math.abs(e-t[s]),r=s);return r}(Fo(e,t,i),r)}({scale:s,dpi:o,coordUnit:l},d),maxZoom:(p=u,p.length>0?p.length-1:22)};var p}(n.result,i),l=ao().map("map",{...o,...i}),h=new Ho(e,{...{noWrap:!0},...r});return h.addTo(l),void t({map:l,layer:h})}s()})})},ao().supermap.crsFromMapJSON=pl,ao().supermap.CartoCSSToLeaflet=el,ao().supermap.DefaultStyle=Qo,ao().supermap.CartoStyleMap=Zo,ao().supermap.ServerStyleMap=Ko,ao().supermap.CompOpMap=$o,ao().supermap.circleStyle=function(e){return new Ol(e)},ao().supermap.CircleStyle=Ol,ao().supermap.cloverStyle=function(e){return new Ll(e)},ao().supermap.CloverStyle=Ll,ao().supermap.graphic=function(e){return new tl(e)},ao().supermap.Graphic=tl,ao().supermap.imageStyle=function(e){return new Pl(e)},ao().supermap.ImageStyle=Pl,ao().supermap.themeFeature=function(e,t){return new il(e,t)},ao().supermap.ThemeFeature=il,ao().supermap.dataFlowLayer=function(e,t){return new wl(e,t)},ao().supermap.DataFlowLayer=wl,ao().supermap.echartsLayer=function(e,t){return new Cl(e,t)},ao().supermap.EchartsLayer=Cl,ao().supermap.graphicLayer=function(e,t){return new jl(e,t)},ao().supermap.GraphicLayer=jl,ao().supermap.graphThemeLayer=function(e,t,i){return new zl(e,t,i)},ao().supermap.GraphThemeLayer=zl,ao().supermap.heatMapFeature=function(e,t){return new mh(e,t)},ao().supermap.HeatMapFeature=mh,ao().supermap.heatMapLayer=function(e,t){return new yh(e,t)},ao().supermap.HeatMapLayer=yh,ao().supermap.labelThemeLayer=function(e,t){return new ol(e,t)},ao().supermap.LabelThemeLayer=ol,ao().supermap.mapVLayer=function(e,t,i){return new _l(e,t,i)},ao().supermap.MapVLayer=_l,ao().supermap.rangeThemeLayer=function(e,t){return new al(e,t)},ao().supermap.RangeThemeLayer=al,ao().supermap.rankSymbolThemeLayer=function(e,t,i){return new Vl(e,t,i)},ao().supermap.RankSymbolThemeLayer=Vl,ao().supermap.tiledVectorLayer=function(e,t){return new ch(e,t)},ao().supermap.TileVectorLayer=ch,ao().supermap.TiledVectorLayer=ch,ao().supermap.turfLayer=function(e){return new fh(e)},ao().supermap.TurfLayer=fh,ao().supermap.FGBLayer=Ku,ao().supermap.FGBLayer=function(e,t){return new Ku(e,t)},ao().supermap.unicodeMarker=function(e,t){return new ul(e,t)},ao().supermap.UnicodeMarker=ul,ao().supermap.uniqueThemeLayer=function(e,t){return new nl(e,t)},ao().supermap.UniqueThemeLayer=nl,ao().supermap.VectorTileFormat=lh,ao().supermap.addressMatchService=function(e,t){return new ec(e,t)},ao().supermap.AddressMatchService=ec,ao().supermap.chartService=function(e,t){return new tc(e,t)},ao().supermap.ChartService=tc,ao().supermap.dataFlowService=function(e,t){return new gl(e,t)},ao().supermap.DataFlowService=gl,ao().supermap.datasetService=function(e,t){return new ic(e,t)},ao().supermap.DatasetService=ic,ao().supermap.datasourceService=function(e,t){return new rc(e,t)},ao().supermap.DatasourceService=rc,ao().supermap.featureService=hl,ao().supermap.FeatureService=ll,ao().supermap.fieldService=function(e,t){return new sc(e,t)},ao().supermap.FieldService=sc,ao().supermap.geoprocessingService=function(e,t){return new ac(e,t)},ao().supermap.GeoprocessingService=ac,ao().supermap.gridCellInfosService=function(e,t){return new nc(e,t)},ao().supermap.GridCellInfosService=nc,ao().supermap.imageCollectionService=function(e,t){return new vc(e,t)},ao().supermap.ImageCollectionService=vc,ao().supermap.imageService=function(e,t){return new gc(e,t)},ao().supermap.ImageService=gc,ao().supermap.layerInfoService=function(e,t){return new oc(e,t)},ao().supermap.LayerInfoService=oc,ao().supermap.mapService=function(e,t){return new fo(e,t)},ao().supermap.MapService=fo,ao().supermap.measureService=function(e,t){return new lc(e,t)},ao().supermap.MeasureService=lc,ao().supermap.networkAnalyst3DService=function(e,t){return new hc(e,t)},ao().supermap.NetworkAnalyst3DService=hc,ao().supermap.networkAnalystService=function(e,t){return new uc(e,t)},ao().supermap.NetworkAnalystService=uc,ao().supermap.processingService=function(e,t){return new cc(e,t)},ao().supermap.ProcessingService=cc,ao().supermap.queryService=function(e,t){return new dc(e,t)},ao().supermap.QueryService=dc,ao().supermap.ServiceBase=po,ao().supermap.spatialAnalystService=function(e,t){return new pc(e,t)},ao().supermap.SpatialAnalystService=pc,ao().supermap.themeService=function(e,t){return new fc(e,t)},ao().supermap.ThemeService=fc,ao().supermap.trafficTransferAnalystService=function(e,t){return new mc(e,t)},ao().supermap.TrafficTransferAnalystService=mc,ao().supermap.webPrintingJobService=function(e,t){return new yc(e,t)},ao().supermap.WebPrintingJobService=yc,ao().supermap.KnowledgeGraphService=$u,ao().supermap.GraphMap=class extends ao().Evented{initialize(e,t){if(!e)return;this.graph=null,this.EVENT_TYPES=["loaded"];const i=e.split("/").pop();this.url=e.replace(`/graphmaps/${i}`,""),this.createGraphMap(i,t)}async createGraphMap(e,t){this.knowledgeGraphService=this.createKnowledgeGraphService(this.url,t);const i=await this.knowledgeGraphService.getGraphMapData(e),r=so.dataFromGraphMap(i.data,i.graphMap);this.graph=new so(t&&t.config),this.graph.on("beforelayout",()=>{this.fire(this.EVENT_TYPES[0])}),this.graph.setData(r),this.graph.handleNodeStatus(function(e){const{expand:t,collapse:i,hidden:r}=e.dataContent;return{expand:t&&JSON.parse(t),collapse:i&&JSON.parse(i),hidden:r&&JSON.parse(r)}}(i.graphMap))}createKnowledgeGraphService(e,t){return new $u(e,t)}},ao().supermap.CommonUtil=ee})(),(()=>{"use strict"})()})();