!function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}Object.values||(Object.values=function(t){if(t!==Object(t))throw new TypeError("Object.values called on a non-object");var e,n=[];for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(t[e]);return n}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=0;n<(arguments.length<=1?0:arguments.length-1);n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},writable:!0,configurable:!0});var r=n((function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),i=e(r),o=e(n((function(t){function e(t,e){for(var n=0;n=0;i--)n>(e=t[i])&&(n=e),r1&&void 0!==arguments[1]?arguments[1]:{},n=document.createElement(t);for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.setAttribute(r,e[r]);return n},getCurrentStyle:function(t){return window.getComputedStyle(t,null)}},E=function(){var t,e,n=function(t,e){var n,r,i="eii",o="dac",a="hem",s="llm",u=function(t,e){return t+e},h="constructor",c=function(t,e){return t(e)},l=function(t,e){return t+e};function f(t,e){for(var n=i;"mill"!==n;)switch(n){case"llm":return c;case"eii":var r=t.length;n=o;break;case a:for(var u=0;u0?"&":"?";for(var c in n=Object.assign({},{jsonpCallback:"jsonp",timeout:5e4,jsonp:"callback"},n),e)({}).hasOwnProperty.call(e,c)&&(a="object"===i(e[c])?c+"="+JSON.stringify(e[c]):c+"="+e[c],s.push(a));function l(){r.parentNode&&r.parentNode.removeChild(r),window[u]=null}return t+=h+s.join("&"),o=document.getElementsByTagName("script")[0]||document.head,t=t+"&"+n.jsonp+"="+u,t+=E()(t),(r=document.createElement("script")).src=t,r.type="text/javascript",o.parentNode.appendChild(r,o),new Promise((function(t,e){window[u]=function(e){if(e&&"string"==typeof e)try{e=JSON.parse(e)}catch(t){e={},console.error("[ERROR] Parse Error.")}t(e),l()},r.onerror=function(t){l(),e({errno:-2,errmsg:"[ERROR] Load Error: ".concat(t),data:{}})}}))},T=function(){function t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._size=0,this._cache=void 0,this.keyList=[],this._options=void 0,this._size=t,this._cache=new window.Map;var n={clearCallback:null};this._options=Object.assign({},n,e)}var e=t.prototype;return e.setData=function(t,e){0!==this._size&&(this._cache.size>=this._size&&this._removeOld(),this._cache.has(t)||this.keyList.push(t),this._cache.set(t,e))},e.getData=function(t){return this._cache.get(t)},e._removeOld=function(){for(var t=Math.round(.6*this._size),e=0;e=0;n--)(e=t.vpoints[n]).topoDir=e.dir,t.topoArray.push(e);return t.topoArray},this.getRoadWidth=function(){return void 0===t.roadWidth&&(t.currentRoad||(t.currentRoad=t.getCurrentRoad()),t.currentRoad?t.roadWidth=t.currentRoad.roadWidth:t.roadWidth=0),t.roadWidth}};function S(t){var e={};return e.panoId=t.PID,e.panoType=t.Type,e.rid=t.RID,e.dir=t.DIR,e.roadName=t.RoadName,e.order=t.Order,e.panoX=t.X/100,e.panoY=t.Y/100,void 0!==t.CPointX&&void 0!==t.CPointY&&(e.cPoint={x:t.CPointX/100,y:t.CPointY/100}),e}function P(t){if(!t)return console.error("Get none from server"),null;var e=t.result;if(e&&0!==e.error)return console.error("Get error from server"),null;var n=t.content;if(void 0===n||0===n.length||void 0===n[0])return console.error("Get empty data from server"),null;var r=n[0],i=new R,o=r.Roll,a={};if(i.panoId=r.ID,r.Inters instanceof Array){var s=r.Inters[0];void 0!==s&&(i.iid=s.IID)}if(i.panoType=r.Type,i.panoX=(r.X||0)/100,i.panoY=(r.Y||0)/100,i.panoZ=(r.Z||0)/100,i.heading=void 0!==r.MoveDir?r.MoveDir:0,i.northDir=r.NorthDir,i.fixHeading=void 0!==r.Heading?r.Heading:270-r.NorthDir,i.fixPitch=r.Pitch,i.fixRoll=90o?0:o,i.deviceHeight=r.DeviceHeight,i.date=r.Date||i.date,i.time=r.Time,i.provider=void 0!==r.Provider?r.Provider:i.provider,i.admission=r.Admission||i.admission,i.timeLine=r.TimeLine||[],i.roadName=r.Rname,r.Roads){var u=r.Roads;i.roads=u.map((function(t){return a[t.ID]=t.Name,function(t){var e=new C;if(e.rid=t.ID,e.roadName=t.Name,e.roadWidth=void 0!==t.Width?t.Width/100:0,e.isCurrentRoad=t.IsCurrent||0,t.Panos)for(var n=t.Panos,r=0,i=n.length;r>16)+(e>>16)+(n>>16)<<16|65535&n}function O(t,e,n,r,i,o){return D((a=D(D(e,t),D(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function I(t,e,n,r,i,o,a){return O(e&n|~e&r,t,e,i,o,a)}function L(t,e,n,r,i,o,a){return O(e&r|n&~r,t,e,i,o,a)}function B(t,e,n,r,i,o,a){return O(e^n^r,t,e,i,o,a)}function k(t,e,n,r,i,o,a){return O(n^(e|~r),t,e,i,o,a)}function U(t,e){var n,r,i,o,a;t[e>>5]|=128<>>9<<4)]=e;var s=1732584193,u=-271733879,h=-1732584194,c=271733878;for(n=0;n>5]>>>e%32&255);return n}function F(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e>5]|=(255&t.charCodeAt(e/8))<>>4&15)+r.charAt(15&e);return i}function z(t){return unescape(encodeURIComponent(t))}function V(t){return function(t){return N(U(F(t),8*t.length))}(z(t))}function G(t,e){return function(t,e){var n,r,i=F(t),o=[],a=[];for(o[15]=a[15]=void 0,i.length>16&&(i=U(i,8*t.length)),n=0;n<16;n+=1)o[n]=909522486^i[n],a[n]=1549556828^i[n];return r=U(o.concat(F(e)),512+8*e.length),N(U(a.concat(r),640))}(z(t),z(e))}var H,W,Z,q,Y=function(t,e,n){return e?n?G(e,t):j(G(e,t)):n?V(t):j(V(t))},X=function(t,e){return A(t,{},{jsonp:"fn"})},K=function(t,e){if("PANORAMA"===t){var n="";n=window._BMapSecurityConfig&&window._BMapSecurityConfig.serviceHost?window._BMapSecurityConfig.serviceHost+"?qt=pano_entry&v=gl":"https://api.map.baidu.com/?qt=pano_entry&v=gl&ak="+window.BMAP_AUTHENTIC_KEY,"function"==typeof e?X(n).then((function(t){e()})).catch((function(t){})):X(n+"&callback="+e)}},Q=function(t){if("PANORAMA"===t)alert("您需要申请全景地图服务使用权限")},J=(W=null,Z=0,q=H||5e3,function(t){var e=(1e5*Math.random()).toFixed(0);window["cbk"+e]=function(t){t&&void 0!==t.error&&0===t.error||K("PANORAMA",(function(t){t&&void 0!==t.error&&0===t.error||Q("PANORAMA")}))},Z+=t,W||(W=setTimeout((function(){var t="";t=window._BMapSecurityConfig&&window._BMapSecurityConfig.serviceHost?window._BMapSecurityConfig.serviceHost+"?qt=pano_count&v=gl&consume="+Z:"https://api.map.baidu.com/?qt=pano_count&v=gl&ak="+window.BMAP_AUTHENTIC_KEY+"&consume="+Z,X(t+"&callback=window.cbk"+e),Z=0,W=null}),q))}),$=function(t,e){var n=(e=e||{}).counter?e.counter:1,r=!1!==e.isCounter,i=Date.parse(new Date),o=i/1e3,a=t+"-"+(o+1800)+"-"+i+"-"+window.BMAP_AUTHENTIC_KEY+"-SJvEY5h37ZDh5pHS",s=Y(a),u="auth_key="+(o+1800)+"-"+i+"-"+window.BMAP_AUTHENTIC_KEY+"-"+s;return r&&J(n),u},tt=function(){function t(e){var n=this;this.getPanoById=function(e){var r;r="".concat(t.SERVICE_URL,"?qt=sdata&sid=").concat(e,"&").concat($("/")),n.getDataByUrl(r).then((function(t){var e=P(t);if(null===e)throw new Error("数据解析异常");return n._cache.setData(r,t),n._pano.dispatchEvent(d.DATA_LOADED,{data:e}),n._pano.dispatchEvent(d.ID_CHANGED,e.panoId),n._pano.dispatchEvent(d.POSITION_CHANGED,new f(e.panoX,e.panoY)),e})).catch((function(t){n._pano.dispatchEvent({type:d.PANO_ERROR,data:t})}))},this.getPanoByLocation=function(e,r){var i;i="".concat(t.SERVICE_URL,"?qt=qsdata&x=").concat(e.lng,"&y=").concat(e.lat).concat(r?"&r="+r:"","&action=1&").concat($("/")),n.getDataByUrl(i).then((function(t){var r=P(t);n._cache.setData(i,t),n._pano.dispatchEvent(d.DATA_LOADED,{data:r}),n._pano.dispatchEvent(d.POSITION_CHANGED,e)})).catch((function(t){n._pano.dispatchEvent({type:d.PANO_ERROR,data:t})}))},this._pano=e,this._cache=new T(10)}return t.prototype.getDataByUrl=function(t){var e=this._cache.getData(t);return e?Promise.resolve(e):A(t,{},{jsonp:"fn"})},t}();tt.SERVICE_URL="//apisv0.bdimg.com/";var et=n((function(t){function e(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports})),nt=e(et),rt=n((function(t){var e=r.default;function n(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ t.exports=n=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new T(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return R()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=f(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=l;var d={};function p(){}function v(){}function m(){}var g={};c(g,s,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(C([])));_&&_!==i&&o.call(_,s)&&(g=_);var x=m.prototype=p.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,n){function r(i,a,s,u){var h=f(t[i],t,a);if("throw"!==h.type){var c=h.arg,l=c.value;return l&&"object"==e(l)&&o.call(l,"__await")?n.resolve(l.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(l).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,u)}))}u(h.arg)}var i;this._invoke=function(t,e){function o(){return new n((function(n,i){r(t,e,n,i)}))}return i=i?i.then(o,o):o()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,d;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function C(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}));e(rt);var it=rt(),ot=it;try{regeneratorRuntime=it}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=it:Function("r","regeneratorRuntime = r")(it)}function at(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}const st={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function ut(t,{precision:e=st.precision}={}){return t=function(t){return Math.round(t/st.EPSILON)*st.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function ht(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ct(t,e,n){const r=st.EPSILON;n&&(st.EPSILON=n);try{if(t===e)return!0;if(ht(t)&&ht(e)){if(t.length!==e.length)return!1;for(let n=0;n0?", ":"")+ut(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e=0&&t=0&&t0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},cross:function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},lerp:function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},random:function(t,e){e=e||1;var n=2*gt()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},transformMat2:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},transformMat2d:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},transformMat3:function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},transformMat4:Ct,rotate:function(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t},angle:function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))},zero:function(t){return t[0]=0,t[1]=0,t},str:function(t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},equals:function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=vt*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=vt*Math.max(1,Math.abs(r),Math.abs(o))},len:St,sub:Pt,mul:Dt,div:Ot,dist:It,sqrDist:Lt,sqrLen:Bt,forEach:kt});function Nt(t,e,n){const r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function Ft(){var t=new mt(3);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function jt(t){var e=new mt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function zt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Vt(t,e,n){var r=new mt(3);return r[0]=t,r[1]=e,r[2]=n,r}function Gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ht(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Wt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Zt(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function qt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function Yt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Xt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function Kt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function Qt(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function Jt(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function $t(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function te(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function ee(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ne(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function re(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],h=e[2],c=i*h-o*u,l=o*s-r*h,f=r*u-i*s,d=i*f-o*l,p=o*c-r*f,v=r*l-i*c,m=2*a;return c*=m,l*=m,f*=m,d*=2,p*=2,v*=2,t[0]=s+c+d,t[1]=u+l+p,t[2]=h+f+v,t}function ie(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function oe(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function ae(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function se(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),h=u&&$t(t,e)/u;return Math.acos(Math.min(Math.max(h,-1),1))}function ue(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=vt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=vt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=vt*Math.max(1,Math.abs(i),Math.abs(s))}var he=Wt,ce=Zt,le=qt,fe=Xt,de=Kt,pe=zt,ve=Qt,me=function(){var t=Ft();return function(e,n,r,i,o,a){var s,u;for(n||(n=3),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(l-d)/m,t[1]=(f-u)/m,t[2]=(s-h)/m):a>c&&a>p?(m=2*Math.sqrt(1+a-c-p),t[3]=(l-d)/m,t[0]=.25*m,t[1]=(s+h)/m,t[2]=(f+u)/m):c>p?(m=2*Math.sqrt(1+c-a-p),t[3]=(f-u)/m,t[0]=(s+h)/m,t[1]=.25*m,t[2]=(l+d)/m):(m=2*Math.sqrt(1+p-a-c),t[3]=(s-h)/m,t[0]=(f+u)/m,t[1]=(l+d)/m,t[2]=.25*m),t}function qe(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,h=o+o,c=a+a,l=i*u,f=i*h,d=i*c,p=o*h,v=o*c,m=a*c,g=s*u,y=s*h,_=s*c,x=r[0],b=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(f+_)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-_)*b,t[5]=(1-(l+m))*b,t[6]=(v+g)*b,t[7]=0,t[8]=(d+y)*M,t[9]=(v-g)*M,t[10]=(1-(l+p))*M,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Ye(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,h=n*a,c=r*a,l=r*s,f=i*a,d=i*s,p=i*u,v=o*a,m=o*s,g=o*u;return t[0]=1-l-p,t[1]=c+g,t[2]=f-m,t[3]=0,t[4]=c-g,t[5]=1-h-p,t[6]=d+v,t[7]=0,t[8]=f+m,t[9]=d-v,t[10]=1-h-l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Xe(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),h=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*h,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*h,t[15]=0,t}function Ke(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var Qe=Ke;function Je(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),h=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*h,t[15]=1,t}var $e=Je;function tn(t,e,n,r){var i,o,a,s,u,h,c,l,f,d,p=e[0],v=e[1],m=e[2],g=r[0],y=r[1],_=r[2],x=n[0],b=n[1],M=n[2];return Math.abs(p-x)0&&(c*=d=1/Math.sqrt(d),l*=d,f*=d);var p=u*f-h*l,v=h*c-s*f,m=s*l-u*c;return(d=p*p+v*v+m*m)>0&&(p*=d=1/Math.sqrt(d),v*=d,m*=d),t[0]=p,t[1]=v,t[2]=m,t[3]=0,t[4]=l*m-f*v,t[5]=f*p-c*m,t[6]=c*v-l*p,t[7]=0,t[8]=c,t[9]=l,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function nn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var rn=Ue,on=nn,an=Object.freeze({__proto__:null,create:Pe,clone:De,copy:Oe,fromValues:function(t,e,n,r,i,o,a,s,u,h,c,l,f,d,p,v){var m=new mt(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=u,m[9]=h,m[10]=c,m[11]=l,m[12]=f,m[13]=d,m[14]=p,m[15]=v,m},set:function(t,e,n,r,i,o,a,s,u,h,c,l,f,d,p,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=h,t[9]=c,t[10]=l,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=m,t},identity:Ie,transpose:Le,invert:Be,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],h=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];return t[0]=s*(f*g-d*m)-l*(u*g-h*m)+v*(u*d-h*f),t[1]=-(r*(f*g-d*m)-l*(i*g-o*m)+v*(i*d-o*f)),t[2]=r*(u*g-h*m)-s*(i*g-o*m)+v*(i*h-o*u),t[3]=-(r*(u*d-h*f)-s*(i*d-o*f)+l*(i*h-o*u)),t[4]=-(a*(f*g-d*m)-c*(u*g-h*m)+p*(u*d-h*f)),t[5]=n*(f*g-d*m)-c*(i*g-o*m)+p*(i*d-o*f),t[6]=-(n*(u*g-h*m)-a*(i*g-o*m)+p*(i*h-o*u)),t[7]=n*(u*d-h*f)-a*(i*d-o*f)+c*(i*h-o*u),t[8]=a*(l*g-d*v)-c*(s*g-h*v)+p*(s*d-h*l),t[9]=-(n*(l*g-d*v)-c*(r*g-o*v)+p*(r*d-o*l)),t[10]=n*(s*g-h*v)-a*(r*g-o*v)+p*(r*h-o*s),t[11]=-(n*(s*d-h*l)-a*(r*d-o*l)+c*(r*h-o*s)),t[12]=-(a*(l*m-f*v)-c*(s*m-u*v)+p*(s*f-u*l)),t[13]=n*(l*m-f*v)-c*(r*m-i*v)+p*(r*f-i*l),t[14]=-(n*(s*m-u*v)-a*(r*m-i*v)+p*(r*u-i*s)),t[15]=n*(s*f-u*l)-a*(r*f-i*l)+c*(r*u-i*s),t},determinant:ke,multiply:Ue,translate:Ne,scale:Fe,rotate:je,rotateX:ze,rotateY:Ve,rotateZ:Ge,fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],h=Math.hypot(a,s,u);return h0?(n[0]=2*(s*a+c*r+u*o-h*i)/l,n[1]=2*(u*a+c*i+h*r-s*o)/l,n[2]=2*(h*a+c*o+s*i-u*r)/l):(n[0]=2*(s*a+c*r+u*o-h*i),n[1]=2*(u*a+c*i+h*r-s*o),n[2]=2*(h*a+c*o+s*i-u*r)),He(t,e,n),t},getTranslation:function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},getScaling:We,getRotation:Ze,fromRotationTranslationScale:qe,fromRotationTranslationScaleOrigin:function(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],h=o+o,c=a+a,l=s+s,f=o*h,d=o*c,p=o*l,v=a*c,m=a*l,g=s*l,y=u*h,_=u*c,x=u*l,b=r[0],M=r[1],w=r[2],E=i[0],A=i[1],T=i[2],C=(1-(v+g))*b,R=(d+x)*b,S=(p-_)*b,P=(d-x)*M,D=(1-(f+g))*M,O=(m+y)*M,I=(p+_)*w,L=(m-y)*w,B=(1-(f+v))*w;return t[0]=C,t[1]=R,t[2]=S,t[3]=0,t[4]=P,t[5]=D,t[6]=O,t[7]=0,t[8]=I,t[9]=L,t[10]=B,t[11]=0,t[12]=n[0]+E-(C*E+P*A+I*T),t[13]=n[1]+A-(R*E+D*A+L*T),t[14]=n[2]+T-(S*E+O*A+B*T),t[15]=1,t},fromQuat:Ye,frustum:Xe,perspectiveNO:Ke,perspective:Qe,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),h=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=h,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*h*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Je,ortho:$e,orthoZO:function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),h=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=h,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*h,t[15]=1,t},lookAt:tn,targetTo:en,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:nn,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],h=t[7],c=t[8],l=t[9],f=t[10],d=t[11],p=t[12],v=t[13],m=t[14],g=t[15],y=e[0],_=e[1],x=e[2],b=e[3],M=e[4],w=e[5],E=e[6],A=e[7],T=e[8],C=e[9],R=e[10],S=e[11],P=e[12],D=e[13],O=e[14],I=e[15];return Math.abs(n-y)<=vt*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-_)<=vt*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-x)<=vt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-b)<=vt*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-M)<=vt*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-w)<=vt*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-E)<=vt*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-A)<=vt*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(c-T)<=vt*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(l-C)<=vt*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(f-R)<=vt*Math.max(1,Math.abs(f),Math.abs(R))&&Math.abs(d-S)<=vt*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(p-P)<=vt*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(v-D)<=vt*Math.max(1,Math.abs(v),Math.abs(D))&&Math.abs(m-O)<=vt*Math.max(1,Math.abs(m),Math.abs(O))&&Math.abs(g-I)<=vt*Math.max(1,Math.abs(g),Math.abs(I))},mul:rn,sub:on});function sn(){var t=new mt(4);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function un(t){var e=new mt(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function hn(t,e,n,r){var i=new mt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function cn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ln(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function fn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function dn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function pn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t}function vn(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function mn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function gn(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(n,r,i,o)}function yn(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o}function _n(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function xn(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function bn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function Mn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function wn(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function En(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function An(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Tn(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],h=e[3];return Math.abs(n-a)<=vt*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=vt*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=vt*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-h)<=vt*Math.max(1,Math.abs(o),Math.abs(h))}var Cn,Rn=dn,Sn=pn,Pn=vn,Dn=gn,On=yn,In=_n,Ln=xn,Bn=function(){var t=sn();return function(e,n,r,i,o,a){var s,u;for(n||(n=4),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s=1);do{s=(i=2*gt()-1)*i+(o=2*gt()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*n,t[1]=e*r,t[2]=e*i*u,t[3]=e*o*u,t},transformMat4:En,transformQuat:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],h=n[3],c=h*r+s*o-u*i,l=h*i+u*r-a*o,f=h*o+a*i-s*r,d=-a*r-s*i-u*o;return t[0]=c*h+d*-a+l*-u-f*-s,t[1]=l*h+d*-s+f*-a-c*-u,t[2]=f*h+d*-u+c*-s-l*-a,t[3]=e[3],t},zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},exactEquals:An,equals:Tn,sub:Rn,mul:Sn,div:Pn,dist:Dn,sqrDist:On,len:In,sqrLen:Ln,forEach:Bn});!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(Cn||(Cn={}));const Un=45*Math.PI/180,Nn=1,Fn=.1,jn=500,zn=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class Vn extends we{static get IDENTITY(){return function(){Hn||(Hn=new Vn,Object.freeze(Hn));return Hn}()}static get ZERO(){return function(){Gn||(Gn=new Vn([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Gn));return Gn}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Cn}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,n,r,i,o,a,s,u,h,c,l,f,d,p,v){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=h,this[10]=c,this[11]=l,this[12]=f,this[13]=d,this[14]=p,this[15]=v,this.check()}setRowMajor(t,e,n,r,i,o,a,s,u,h,c,l,f,d,p,v){return this[0]=t,this[1]=i,this[2]=u,this[3]=f,this[4]=e,this[5]=o,this[6]=h,this[7]=d,this[8]=n,this[9]=a,this[10]=c,this[11]=p,this[12]=r,this[13]=s,this[14]=l,this[15]=v,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(zn)}fromObject(t){return this.check()}fromQuaternion(t){return Ye(this,t),this.check()}frustum(t){const{left:e,right:n,bottom:r,top:i,near:o=Fn,far:a=jn}=t;return a===1/0?function(t,e,n,r,i,o){const a=2*o/(n-e),s=2*o/(i-r),u=(n+e)/(n-e),h=(i+r)/(i-r),c=-1,l=-1,f=-2*o;t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=h,t[10]=c,t[11]=l,t[12]=0,t[13]=0,t[14]=f,t[15]=0}(this,e,n,r,i,o):Xe(this,e,n,r,i,o,a),this.check()}lookAt(t){const{eye:e,center:n=[0,0,0],up:r=[0,1,0]}=t;return tn(this,e,n,r),this.check()}ortho(t){const{left:e,right:n,bottom:r,top:i,near:o=Fn,far:a=jn}=t;return $e(this,e,n,r,i,o,a),this.check()}orthographic(t){const{fovy:e=Un,aspect:n=Nn,focalDistance:r=1,near:i=Fn,far:o=jn}=t;Wn(e);const a=e/2,s=r*Math.tan(a),u=s*n;return this.ortho({left:-u,right:u,bottom:-s,top:s,near:i,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}=t;return Wn(e),Qe(this,e,n,r,i),this.check()}determinant(){return ke(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}transpose(){return Le(this,this),this.check()}invert(){return Be(this,this),this.check()}multiplyLeft(t){return Ue(this,t,this),this.check()}multiplyRight(t){return Ue(this,this,t),this.check()}rotateX(t){return ze(this,this,t),this.check()}rotateY(t){return Ve(this,this,t),this.check()}rotateZ(t){return Ge(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return je(this,this,t,e),this.check()}scale(t){return Fe(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Ne(this,this,t),this.check()}transform(t,e){return 4===t.length?(dt(e=En(e||[-0,-0,-0,-0],t,this),4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:n}=t;let r;switch(n){case 2:r=Ct(e||[-0,-0],t,this);break;case 3:r=ee(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return dt(r,t.length),r}transformAsVector(t,e){let n;switch(t.length){case 2:n=function(t,e,n){const r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}(e||[-0,-0],t,this);break;case 3:n=Nt(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return dt(n,t.length),n}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,n){return this.identity().translate([t,e,n])}}let Gn,Hn;function Wn(t){if(t>2*Math.PI)throw Error("expected radians")}function Zn(){var t=new mt(4);return mt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function qn(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Yn(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Xn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],h=n[2],c=n[3];return t[0]=r*c+a*s+i*h-o*u,t[1]=i*c+a*u+o*s-r*h,t[2]=o*c+a*h+r*u-i*s,t[3]=a*c-r*s-i*u-o*h,t}function Kn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=n*u,t[1]=r*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function Qn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=Math.sqrt(n*n+r*r+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=.5*Math.log(n*n+r*r+i*i+o*o),t}function Jn(t,e,n,r){var i,o,a,s,u,h=e[0],c=e[1],l=e[2],f=e[3],d=n[0],p=n[1],v=n[2],m=n[3];return(o=h*d+c*p+l*v+f*m)<0&&(o=-o,d=-d,p=-p,v=-v,m=-m),1-o>vt?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*h+u*d,t[1]=s*c+u*p,t[2]=s*l+u*v,t[3]=s*f+u*m,t}function $n(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}function tr(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),h=Math.sin(r),c=Math.cos(r);return t[0]=o*u*c-a*s*h,t[1]=a*s*c+o*u*h,t[2]=a*u*h-o*s*c,t[3]=a*u*c+o*s*h,t}var er,nr,rr,ir,or,ar,sr=un,ur=hn,hr=cn,cr=ln,lr=fn,fr=Xn,dr=mn,pr=Mn,vr=wn,mr=_n,gr=mr,yr=xn,_r=yr,xr=bn,br=An,Mr=Tn,wr=(er=Ft(),nr=Vt(1,0,0),rr=Vt(0,1,0),function(t,e,n){var r=$t(e,n);return r<-.999999?(te(er,nr,e),pe(er)<1e-6&&te(er,rr,e),Jt(er,er),Yn(t,er,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(te(er,e,n),t[0]=er[0],t[1]=er[1],t[2]=er[2],t[3]=1+r,xr(t,t))}),Er=(ir=Zn(),or=Zn(),function(t,e,n,r,i,o){return Jn(ir,e,i,o),Jn(or,n,r,o),Jn(t,ir,or,2*o*(1-o)),t}),Ar=(ar=Ee(),function(t,e,n,r){return ar[0]=n[0],ar[3]=n[1],ar[6]=n[2],ar[1]=r[0],ar[4]=r[1],ar[7]=r[2],ar[2]=-e[0],ar[5]=-e[1],ar[8]=-e[2],xr(t,$n(t,ar))}),Tr=Object.freeze({__proto__:null,create:Zn,identity:qn,setAxisAngle:Yn,getAxisAngle:function(t,e){var n=2*Math.acos(e[3]),r=Math.sin(n/2);return r>vt?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n},getAngle:function(t,e){var n=pr(t,e);return Math.acos(2*n*n-1)},multiply:Xn,rotateX:function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s,t},rotateY:function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s,t},rotateZ:function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t},calculateW:function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},exp:Kn,ln:Qn,pow:function(t,e,n){return Qn(t,e),dr(t,t,n),Kn(t,t),t},slerp:Jn,random:function(t){var e=gt(),n=gt(),r=gt(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=o*Math.sin(2*Math.PI*r),t[3]=o*Math.cos(2*Math.PI*r),t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t},conjugate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},fromMat3:$n,fromEuler:tr,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},clone:sr,fromValues:ur,copy:hr,set:cr,add:lr,mul:fr,scale:dr,dot:pr,lerp:vr,length:mr,len:gr,squaredLength:yr,sqrLen:_r,normalize:xr,exactEquals:br,equals:Mr,rotationTo:wr,sqlerp:Er,setAxes:Ar});function Cr(t){return Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr(t)}var Rr=function(t){return"[object String]"===Object.prototype.toString.call(t)},Sr=function(t){var e="[object Function]"===Object.prototype.toString.call(t),n="[object AsyncFunction]"===Object.prototype.toString.call(t);return e||n},Pr=365611;function Dr(t,e){this.type=t,this.returnValue=!0,this.target=e||null,this.currentTarget=null}var Or=function(){function t(){this.__listeners=void 0}var e=t.prototype;return e.on=function(){for(var t=arguments.length,e=new Array(t),n=0;nl?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(i,o),t[2]=0):(t[0]=Math.asin(-2*(n*i-r*o)),t[1]=Math.atan2(2*(n*r+i*o),s-u-h+a),t[2]=Math.atan2(2*(r*i+n*o),-s-u+h+a)),t}var Lr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.DefaultOrder;this.isEuler=!0,this._x=void 0,this._y=void 0,this._z=void 0,this._order=void 0,this._onChangeCallback=void 0,this._x=e,this._y=n,this._z=r,this._order=i,this._onChangeCallback=function(){}}var e=t.prototype;return e.set=function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this._x=t,this._y=e,this._z=n,r&&this._onChangeCallback(),this},e.clone=function(){return new t(this._x,this._y,this._z,this._order)},e.copy=function(t){return t.isEuler?(this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this):this},e.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},e.toVector3=function(){return Vt(this._x,this._y,this._z)},e.onChange=function(t){"function"==typeof t&&(this._onChangeCallback=t)},o(t,[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"order",get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}]),t}();function Br(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}Lr.DefaultOrder="XYZ";var kr=function(t){return 180*t/Math.PI},Ur=function(t){function e(){var n;return(n=t.call(this)||this).isObject3D=!0,n.uuid=Br(),n.name="",n.parent=null,n.children=[],n.visible=!0,n.position=Ft(),n.rotation=new Lr,n.scale=Vt(1,1,1),n.quaternion=Zn(),n.up=jt(e.DefaultUp),n.modelMatrix=Pe(),n.worldMatrix=Pe(),n.modelMatrixNeedUpdate=!1,n.worldMatrixNeedsUpdate=!1,n.rotation.onChange((function(){n.modelMatrixNeedUpdate=!0})),n}c(e,t);var n=e.prototype;return n.rotateX=function(t){this.rotation.x=t},n.rotateY=function(t){this.rotation.y=t},n.rotateZ=function(t){this.rotation.z=t},n.translate=function(t,e,n){var r=Vt(t,e,n);return this.position=Ht(this.position,this.position,r),this.modelMatrixNeedUpdate=!0,this},n.setPosition=function(t,e,n){var r=Vt(t,e,n);return ue(this.position,r)||(this.position=r,this.modelMatrixNeedUpdate=!0),this},n.lookAt=function(t,e,n){var r=this.up,i=this.position,o=Vt(t,e,n),a=en(Pe(),i,o,r),s=Ze(Zn(),a),u=Ir(Ft(),s);this.rotation.set(kr(u[0]),kr(u[1]),kr(u[2]))},n.setVisible=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.visible!==t&&(this.visible=t,e))for(var n=0,r=this.children.length;n0&&void 0!==arguments[0]&&arguments[0];!0!==this.modelMatrixNeedUpdate&&!0!==t||this.updateMatrix(),!0===this.worldMatrixNeedsUpdate&&(this.parent?Ue(this.worldMatrix,this.parent.worldMatrix,this.modelMatrix):Oe(this.worldMatrix,this.modelMatrix),this.worldMatrixNeedsUpdate=!1,t=!0);for(var e=0,n=this.children.length;e ".concat(t)),this;if(t instanceof Array){for(var e=0,n=t.length;e0&&this.children.forEach((function(e){e.traverse(t)}))},n.clone=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=new e;if(n.up=jt(this.up),n.scale=jt(this.scale),n.position=jt(this.position),n.rotation=this.rotation.clone(),n.quaternion=sr(this.quaternion),n.modelMatrix=De(this.modelMatrix),n.worldMatrix=De(this.worldMatrix),n.visible=this.visible,this.children.length&&t)for(var r=0,i=this.children.length;ri&&(i=l),f>o&&(o=f),d>a&&(a=d)}var p=Vt(e,n,r),v=Vt(i,o,a);return this.set(p,v),this},e.getCenter=function(){return this.isInvalid()?Ft():Vt((this.max[0]+this.min[0])/2,(this.max[1]+this.min[1])/2,(this.max[2]+this.min[2])/2)},e.isInvalid=function(){return this.max[0]3&&void 0!==arguments[3]&&arguments[3];if(this.isBufferAttribute=!0,this.name="",this.type=void 0,this.array=void 0,this.itemSize=void 0,this.count=void 0,this.normalized=void 0,this.usage=void 0,this.needUpdate=void 0,Array.isArray(e))throw new TypeError("BufferAttribute: array should be a Typed Array.");if(this.name="BufferAttribute",this.array=e,this.itemSize=n,this.count=void 0!==e?e.length/n:0,this.normalized=!0===i,this.usage=35044,this.needUpdate=!0,void 0===r){var o=this.array;this.type=t.FLOAT,o instanceof Int8Array?this.type=t.BYTE:o instanceof Uint8Array?this.type=t.UNSIGNED_BYTE:o instanceof Int16Array?this.type=t.SHORT:o instanceof Uint16Array?this.type=t.UNSIGNED_SHORT:o instanceof Int32Array?this.type=t.INT:o instanceof Uint32Array&&(this.type=t.UNSIGNED_INT)}else this.type=r}t.isBufferAttribute=function(e){var n=!1;return e&&e instanceof t&&(n=!0),n};var e=t.prototype;return e.setUsage=function(t){return this.usage=t,this},e.setArray=function(t){return this.array.set(t),this},t}();Fr.BYTE=5120,Fr.UNSIGNED_BYTE=5121,Fr.SHORT=5122,Fr.UNSIGNED_SHORT=5123,Fr.INT=5124,Fr.UNSIGNED_INT=5125,Fr.FLOAT=5126;var jr=function(t){function e(e,n,r,i){var o;return(o=t.call(this,new Uint8Array(e),n,r,i)||this).name="Uint8BufferAttribute",o}return c(e,t),e}(Fr),zr=function(t){function e(e,n,r,i){var o;return(o=t.call(this,new Uint16Array(e),n,r,i)||this).name="Uint16BufferAttribute",o}return c(e,t),e}(Fr),Vr=function(t){function e(e,n,r,i){var o;return(o=t.call(this,new Uint32Array(e),n,r,i)||this).name="Uint32BufferAttribute",o}return c(e,t),e}(Fr),Gr=function(t){function e(e,n,r,i){var o;return(o=t.call(this,new Float32Array(e),n,r,i)||this).name="Float32ArrayAttribute",o}return c(e,t),e}(Fr),Hr=function(t){function e(e,n,r,i){var o;if(Array.isArray(e)){var a=function(t){for(var e,n=Number.MAX_VALUE,r=-Number.MAX_VALUE,i=t.length-1;i>=0;i--)n>(e=t[i])&&(n=e),r65535?Uint32Array:Uint16Array)(e)}else o=e;return t.call(this,o,n,r,i)||this}return c(e,t),e}(Fr),Wr=0,Zr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]&&arguments[0];!0===this.autoUpdate&&t.prototype.updateWorldMatrix.call(this,e)},n.clone=function(n){return void 0===n&&(n=new e),t.prototype.clone.call(this,n),n.autoUpdate=this.autoUpdate,n},e}(Ur),Jr=function(t){function e(){var e;return(e=t.call(this)||this).type="Geometry",e.vertices=[],e.verticesBufferData=new Float32Array,e.indicesBufferData=new Uint16Array,e.uvtsBufferData=new Float32Array,e.groupsNeedUpdate=!1,e}return c(e,t),e}(Or),$r=new be,ti=new be,ei=new be,ni=new be,ri=new be,ii=function(){function t(t,e){this.origin=void 0,this.direction=void 0,this.origin=t||new be,this.direction=e||new be(0,0,-1)}var e=t.prototype;return e.set=function(t,e){return this.origin.copy(t),this.direction.copy(e),this},e.setFromCamera=function(t,e){var n=new be(e.position[0],e.position[1],e.position[2]),r=(new Vn).fromArray(e.projectionMatrix),i=e.worldMatrix,o=new Me(t[0],t[1],.5,1).transform(r).transform(i),a=o.x,s=o.y,u=o.z,h=new be(a,s,u).sub(n).normalize();this.set(n,h)},e.getPointByLen=function(t,e){var n=void 0!==e?e:new be;return n.copy(this.direction),n.scale(t),n.add(this.origin),n},e.intersectTriangle_Old=function(t,e,n){var r,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0,a=$r.copy(e).subtract(t),s=ti.copy(n).subtract(t),u=ei.copy(a).cross(s),h=ni.copy(this.origin).subtract(t),c=this.direction.dot(u);if(0c))return null;r=-1,c=-c}s.copy((new be).copy(h).cross(s));var l=r*this.direction.dot(s);if(0>l)return null;var f=r*this.direction.dot((new be).copy(h).cross(a));if(0>f)return null;if(l+f>c)return null;var d=-r*h.dot(u);return 0>d?null:this.getPointByLen(d/c,o)},e.intersectTriangle=function(t,e,n){var r=arguments.length>4?arguments[4]:void 0,i=1e-6,o=$r.subVectors(e,t),a=ti.subVectors(n,t),s=ei.copy(this.direction).cross(a),u=o.dot(s);if(u>-i&&u1)return null;var f=ri.copy(c).cross(o),d=h*this.direction.dot(f);if(d<0||l+d>1)return null;var p=a.dot(f)*h;return p>i?{distance:p,point:this.getPointByLen(p,r)}:null},e.intersectSphere=function(t,e,n){var r=(new be).subtract(t,this.origin),i=r.dot(this.direction),o=r.dot(r)-i*i,a=e*e;if(o>a)return null;var s=Math.sqrt(a-o),u=i-s,h=i+s;return 0>u&&0>h?null:0>u?this.getPointByLen(h,n):this.getPointByLen(u,n)},t}();function oi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ai(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ai(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ai(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=r.maxTextures?r.usedTextureUnits=0:r.usedTextureUnits+=1,t},this.resetUsedTextureUnits=function(){r.usedTextureUnits=0},this.setTexture=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t instanceof hi)r.setCubeTexture(t,e);else{var n=r.gl;n.activeTexture(n.TEXTURE0+e),t.needsUpdate?(t.init(n),r.uploadTexture(n,t)):n.bindTexture(n.TEXTURE_2D,t.glTexture)}},this.setTextureForRenderTarget=function(t){var e=r.gl;t.glTexture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,t.glTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),r.setTextureParameter(e);var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.texImage2D(e.TEXTURE_2D,0,n,t.width,t.height,0,i,o,null)},this.uploadTexture=function(t,e){e.init(t),t.bindTexture(t.TEXTURE_2D,e.glTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),r.setTextureParameter(t),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.image),e.needsUpdate=!1},this.setTextureParameter=function(t){t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},this.gl=t,this.maxTextureSize=n,this.maxTextures=e}return t.prototype.setCubeTexture=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.image;if(6!==n.length)throw new Error("[setCubeTexture] CubeTexture need six images, but get\n ".concat(n.length,"\n "));var r=this.gl;if(t.needsUpdate){t.init(r),r.activeTexture(r.TEXTURE0+e),r.bindTexture(r.TEXTURE_CUBE_MAP,t.glTexture),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,t.flipY),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_CUBE_MAP,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);for(var i=0;i<6;i++){var o=n[i];r.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,o)}t.needsUpdate=!1}else r.bindTexture(r.TEXTURE_CUBE_MAP,t.glTexture)},t}(),li=n((function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{};return(e=t.call(this)||this).map=null,e.color=[1,0,0,1],e.type="BasicMaterial",e.opacity=1,e.depthTest=!0,e.vertexShader=Ri,e.fragmentShader=Si,e.uniforms={uSampler:{type:"t",value:null},uColor:{type:"4f",value:[1,0,0,1]},uOpacity:{type:"1f",value:e.opacity}},e.setValues(n),e}c(e,t);var n=e.prototype;return n.setOpacity=function(t){this.uniforms.uOpacity.value=t,this.opacity=t},n.setColor=function(t){!Array.isArray(t)||t.length<4||(this.uniforms.uColor.value=t,this.color=t)},n.setMap=function(t){var e=this;t&&(t instanceof Promise?t.then((function(t){e.uniforms.uSampler.value=t instanceof ui==!0?t:new ui(t)})).catch((function(t){return console.error(t)})):!0===t.isTexture&&(this.uniforms.uSampler.value=t),this.map=t)},o(e,[{key:"defines",get:function(){var t=new Ci;return t.useColor=!!this.color,t.useUV=!!this.map,t.getDefines()}}]),e}(Ai),Di=function(t){var e=this;this.gl=void 0,this.newAttributes=new Uint8Array(16),this.enabledAttributes=new Uint8Array(16),this.currentDepthTest=!1,this.currentDepthWrite=!0,this.currentColorWrite=!0,this.currentDoubleSided=!1,this.currentFlipSided=!1,this.initAttributes=function(){for(var t=0,n=e.newAttributes.length;t0&&o.precision>0,u=i&&a&&i.precision>0&&a.precision>0;return"highp"!==t||s?"mediump"!==t||u||(t="lowp",console.warn("[WebGLCapability] mediump is not supported, using lowp by default.")):u?(t="mediump",console.warn("[WebGLCapability] highp is not supported, using mediump by default.")):(t="lowp",console.warn("[WebGLCapability] highp and mediump is not supported, using lowp by default.")),t},this.gl=t,this.maxTextures=this.getMaxTextures(),this.maxVertexShaderTextureUnits=this.getMaxVertexShaderTextureUnits(),this.maxFragmentShaderTextureUnits=this.getMaxFragmentShaderTextureUnits(),this.maxTextureSize=this.getMaxTextureSize(),this.maxVerticesOneDraw=this.getMaxVerticesOneDraw()},Ii=0,Li=function(t,e,n){var r=t.createShader(n);if(!r)throw new Error("Something went wrong while compile the shader.");return t.shaderSource(r,e),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)||console.error("Error compiling shader: ".concat(t.getShaderInfoLog(r))),r},Bi=function(){function t(t,e,n){this.usedTimes=void 0,this.id=void 0,this.code=void 0,this.program=void 0,this.attributes=void 0,this.uniforms=void 0,this.gl=void 0,this.parameters=void 0,this.precision=void 0,this.gl=t,this.parameters=e,this.precision=n.precision||"highp",this.usedTimes=1,this.id=Ii++;var r=e.defines,i=void 0===r?"":r,o=e.vertexShader,a=e.fragmentShader;this.code=i+o+a,this.program=this.createProgram(t,e,this.precision),this.attributes=this.fetchAttributes(t,this.program),this.uniforms=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i={},o=r.length;if(!o)return i;for(var a=0;a2&&void 0!==arguments[2]?arguments[2]:"highp",r=e.vertexShader,i=e.fragmentShader,o=e.defines,a=void 0===o?"":o,s=["precision ".concat(n," float;"),"uniform mat4 modelMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat4 mvpMatrix;","attribute vec3 position;","attribute vec2 uv;",""].join("\n"),u=t.createProgram(),h=["precision ".concat(n," float;"),""].join("\n"),c=Li(t,s+a+r,t.VERTEX_SHADER),l=Li(t,h+a+i,t.FRAGMENT_SHADER);if(!u)throw new Error("Something went wrong while createProgram.");return t.attachShader(u,c),t.attachShader(u,l),t.linkProgram(u),u},e.fetchAttributes=function(t,e){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.state=void 0,this.domElement=void 0,this.capability=void 0,this.textureOperation=void 0,this._gl=void 0,this.parameters=void 0,this.programs=void 0,this.viewportInfo=void 0,this.autoDisposeProgram=!0,this.currentCacheState=void 0,this.setSize=function(e,n){var r=t.parameters,i=r.canvas,o=r.pixelRatio;i.style.width="".concat(e,"px"),i.style.height="".concat(n,"px"),i.width=e*o,i.height=n*o,t.setViewport(0,0,e,n)},this.setViewport=function(e,n,r,i){var o=t.parameters.pixelRatio,a=t.viewportInfo;a.x=e*o,a.y=n*o,a.width=r*o,a.height=i*o,t._gl.viewport.apply(t._gl,Object.values(a))},this.setClearColor=function(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;!0===t.parameters.premultipliedAlpha&&(e*=i,n*=i,r*=i),t._gl.clearColor(e,n,r,i)},this.getContext=function(){return t._gl},this.forceContextLoss=function(){try{var e=t._gl.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch(t){console.error("[WebGLRenderer] WEBGL_lose_context error: ",t)}},this.initScene=function(e){!0===e.visible&&e.traverse((function(e){!0===e.visible&&e instanceof Kr&&t.initMesh(e)}))},this.initMesh=function(e){!0===e.visible&&(!0!==e.__webglInit&&(e.__webglInit=!0,e.addEventListener("removed",t.onObjectRemoved)),e.geometry&&t.checkAndUpdateGeometry(e.geometry),e.children&&e.children.length>0&&e.children.forEach((function(e){t.initMesh(e)})))},this.checkAndUpdateGeometry=function(e){!0!==e.__webglInit&&(e.__webglInit=!0,e.addEventListener("removed",t.onGeometryRemove),e.groupsNeedUpdate=!0),!0===e.groupsNeedUpdate&&("BufferGeometry"===e.type?t.updateBufferGeometry(e):t.updateGeometryBuffer(e,t._gl.STATIC_DRAW),e.groupsNeedUpdate=!1)},this.updateGeometryBuffer=function(e,n){var r=e.verticesBufferData,i=e.uvtsBufferData,o=e.indicesBufferData,a=e.borderVerticesBufferData,s=t._gl;03&&void 0!==arguments[3])||arguments[3],o=t._gl;t.textureOperation.resetUsedTextureUnits(),t.checkAndUpdateMaterial(r.material);var a=n.program,s=a.getUniforms();return a.id!==t.currentCacheState.programId&&(o.useProgram(a.program),t.currentCacheState.programId=a.id),!1!==i&&bi(o,n.uniformsList,t.textureOperation),t.updateMVPMatrix(s,e,r),a},this.checkAndUpdateMaterial=function(e){void 0!==e&&(!0!==e.__webglInit&&(e.__webglInit=!0,e.addEventListener("removed",t.onMaterialRomove),e.needsUpdate=!0),!0===e.needsUpdate&&(t.updateMaterial(e),e.needsUpdate=!1))},this.updateMaterial=function(e){e.program&&t.removeMaterial(e);for(var n=null,r=t.programs.length,i=e.defines,o=(void 0===i?"":i)+e.vertexShader+e.fragmentShader,a=r-1;a>=0;a--){var s=t.programs[a];if(s.code===o){(n=s).usedTimes++;break}}if(null===n){var u={uniforms:e.uniforms,defines:e.defines||"",vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};n=new Bi(t._gl,u,{precision:t.parameters.precision}),t.programs.push(n)}e.program=n,e.uniformsList=[];var h=0,c=n.uniforms,l=e.uniforms;for(var f in l)if(Object.prototype.hasOwnProperty.call(l,f)){var d=c[f];d&&(e.uniformsList[h]=[l[f],d],h++)}},this.updateMVPMatrix=function(e,n,r){if(void 0!==e.mvpMatrix){var i=De(n.projectionMatrix);Ue(i,i,n.viewMatrix),Ue(i,i,r.worldMatrix),t._gl.uniformMatrix4fv(e.mvpMatrix,!1,i),t._gl.uniformMatrix4fv(e.modelMatrix,!1,r.worldMatrix),t._gl.uniformMatrix4fv(e.viewMatrix,!1,n.viewMatrix),t._gl.uniformMatrix4fv(e.projectionMatrix,!1,n.projectionMatrix)}t.currentCacheState.camera=n},this.renderGeometryWithProgram=function(e,n,r){var i=t._gl,o=t.currentCacheState.curRenderTarget;if(e.uniforms.showDebugLine&&i.uniform1i(e.uniforms.showDebugLine,0),"BufferGeometry"===n.type?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,n.indexesBuffer):i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,n.glIndicesBuffer),null!==o&&void 0!==o.glFrameBuffer){var a=i.checkFramebufferStatus(i.FRAMEBUFFER);if(i.FRAMEBUFFER_COMPLETE!==a)return t.removeRenderTarget(o),void(t.currentCacheState.curRenderTarget=null)}n.indexes&&n.indexes.count>0?i.drawElements(i.TRIANGLES,n.indexes.count,i.UNSIGNED_SHORT,0):i.drawArrays(i.TRIANGLES,0,n.attributes.position.count)},this.onObjectRemoved=function(e){e.target.traverse((function(e){e.removeEventListener("removed",t.onObjectRemoved),t.removeObject(e)}))},this.onGeometryRemove=function(e){var n=e.target;n.removeEventListener("removed",t.onGeometryRemove),t.removeGeometry(n)},this.onMaterialRomove=function(e){var n=e.target;n.removeEventListener("removed",t.onMaterialRomove),t.removeMaterial(n)},this.onRenderTargetRemove=function(e){var n=e.target;n.removeEventListener("removed",t.onRenderTargetRemove),t.removeRenderTarget(n)},this.removeObject=function(t){t.geometry&&delete t.geometry.__webglInit,delete t.__webglInit},this.removeGeometry=function(e){delete e.__webglInit,t.deleteBuffers(e),t.currentCacheState.geometryProgramId=null},this.deleteBuffers=function(e){["glVerticesBuffer","glUvtsBuffer","glIndicesBuffer","glBorderVerticesBuffer"].forEach((function(n){t._gl.deleteBuffer(e[n]),void 0!==e[n]&&0=0;i--){var o=r[i];if(o.program===n){o.usedTimes--,0===o.usedTimes&&!1!==t.autoDisposeProgram&&(r.splice(i,1),t._gl.deleteProgram(n));break}}}},this.removeRenderTarget=function(e){t._gl.deleteRenderbuffer(e.glDepthBuffer),e.glDepthBuffer=null,t._gl.deleteTexture(e.glTexture),e.glTexture=null,t._gl.deleteFramebuffer(e.glFrameBuffer),e.glFrameBuffer=null},this.parameters=Object.assign({},ki,e),e&&!e.canvas&&(this.parameters.canvas=document.createElement("canvas")),this.initGL(),this.programs=[],this.viewportInfo={x:0,y:0,width:this.parameters.canvas.width,height:this.parameters.canvas.height},this.parameters.width&&this.parameters.height&&this.setSize(this.parameters.width,this.parameters.height),this.domElement=this.parameters.canvas,this.state=new Di(this._gl),this.state.setDefaultGLState.apply(this.state,Object.values(this.viewportInfo)),this.currentCacheState={programId:null,geometryProgramId:null,materialId:null,camera:null,curRenderTarget:null},this.capability=new Oi(this._gl);var n=this.capability.maxTextures,r=this.capability.maxTextureSize;this.textureOperation=new ci(this._gl,n,r)}var e=t.prototype;return e.clearBuffer=function(){var t=this._gl;t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)},e.initGL=function(){var t=this,e=this.parameters,n=e.canvas,r=e.context,i=e.alpha,o=e.depth,a=e.stencil,s=e.antialias,u=e.premultipliedAlpha,h=e.preserveDrawingBuffer;try{var c={alpha:i,depth:o,stencil:a,antialias:s,premultipliedAlpha:u,preserveDrawingBuffer:h},l=r||n.getContext("webgl",c)||n.getContext("experimental-webgl",c)||n.getContext("moz-webgl",c)||n.getContext("webkit-3d",c);if(!l)throw null!==n.getContext?"Error creating WebGL context with your provided attributes.":"Error creating WebGL context.";this._gl=l,n.addEventListener("webglcontextlost",(function(e){e.preventDefault(),void 0!==t.state&&(t.resetGLState(),t.state.setDefaultGLState.apply(t.state,Object.values(t.viewportInfo)))}),!1)}catch(t){console.error("[WebGLRenderer] Create webgl error: ",t)}},e.resetGLState=function(){this.currentCacheState={programId:null,geometryProgramId:null,materialId:null,camera:null,curRenderTarget:null},this.state.reset()},e.setRenderTarget=function(t){var e=this._gl;void 0!==t&&null===t.glFrameBuffer&&(t.addEventListener("removed",this.onRenderTargetRemove),t.glFrameBuffer=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,t.glFrameBuffer),this.textureOperation.setTextureForRenderTarget(t),t.glDepthBuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,t.glDepthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.width,t.height),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.glTexture,0),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.glDepthBuffer),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.bindFramebuffer(e.FRAMEBUFFER,null))},e.render=function(t,e,n){if(e.isCamera){var r=this._gl;if(t.updateWorldMatrix(),e.updateWorldMatrix(),e.updateProjectionMatrix(),this.currentCacheState.camera=null,void 0!==n)this.setRenderTarget(n),this.currentCacheState.curRenderTarget=n,r.bindFramebuffer(r.FRAMEBUFFER,n.glFrameBuffer),r.viewport(0,0,n.width,n.height);else{var i=this.viewportInfo,o=i.width,a=i.height;this.currentCacheState.curRenderTarget=null,r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,o,a)}this.initScene(t),this.renderScene(t,e)}else console.error("[WebGLRenderer] Camera is not leagal.")},e.updateBufferGeometry=function(t){var e=this._gl,n=t.getIndexes(),r=t.getAttribute();for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var o=i+"Buffer",a=r[i],s=a.array,u=a.usage;t[o]=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t[o]),e.bufferData(e.ARRAY_BUFFER,s,u)}n&&(t.indexesBuffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexesBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,n.array,n.usage))},e.updateVerticesAttribute2=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._gl,i=!1,o="".concat(e.id,"_").concat(t.id);if(o!==this.currentCacheState.geometryProgramId){this.currentCacheState.geometryProgramId=o,this.state.initAttributes(),i=!0;var a=e.getAttribute();for(var s in a)if(Object.prototype.hasOwnProperty.call(a,s)){var u=s+"Buffer",h=a[s],c=h.itemSize,l=h.type,f=h.normalized;0<=t.attributes[s]&&(!0!==n&&(r.bindBuffer(r.ARRAY_BUFFER,e[u]),r.vertexAttribPointer(t.attributes[s],c,l,f,0,0)),this.state.enableAttribute(t.attributes[s]))}}return this.state.disableUnusedAttributes(),i},e.updateVerticesAttribute=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._gl,i=!1,o="".concat(e.id,"_").concat(t.id);if(o!==this.currentCacheState.geometryProgramId){this.currentCacheState.geometryProgramId=o,this.state.initAttributes(),i=!0;var a=t.getAttributes();0<=a.position&&(!0!==n&&(r.bindBuffer(r.ARRAY_BUFFER,e.glVerticesBuffer),r.vertexAttribPointer(a.position,3,r.FLOAT,!1,0,0)),this.state.enableAttribute(a.position)),0<=a.uv&&void 0!==e.glUvtsBuffer&&(r.bindBuffer(r.ARRAY_BUFFER,e.glUvtsBuffer),r.vertexAttribPointer(a.uv,2,r.FLOAT,!1,0,0),this.state.enableAttribute(a.uv))}return this.state.disableUnusedAttributes(),i},t}(),Ni=function(t){function e(e,n,r,i,o,a){var s;switch((s=t.call(this)||this).addIntoBuffer=function(t,e,n){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2]},s.get3DVertex=function(t,e){var n;switch(e){case"x":n=Vt(0,t[0],t[1]);break;case"y":n=Vt(t[0],0,t[1]);break;default:n=Vt(t[0],t[1],0)}return n},s.zeroAxis=void 0!==o?o:"z",s.zeroAxis){case"x":s.normal=Vt(-1,0,0);break;case"y":default:s.normal=Vt(0,-1,0);break;case"z":s.normal=Vt(0,0,-1)}a=void 0!==a?a:{},s.showBorder=!(!1===a.showBorder),s.borderWidth=void 0!==a.borderWidth?a.borderWidth:1,s.borderColor=void 0!==a.borderColor?a.borderColor:[0,0,0,1];var u,h,c,l=.5*e,f=.5*n,d=r||1,p=i||1,v=e/d,m=n/p,g=(d+1)*(p+1);s.verticesBufferData=new Float32Array(3*g),s.uvtsBufferData=new Float32Array(2*g),s.indicesBufferData=new(g>65535?Uint32Array:Uint16Array)(d*p*6);for(var y=0,_=0,x=0;x<=p;x++){u=x*m-f;for(var b=0;b<=d;b++)c=_t(b*v-l,u),h=s.get3DVertex(c,s.zeroAxis),s.vertices.push(h),s.addIntoBuffer(s.verticesBufferData,h,y),s.uvtsBufferData[_]=b/d,s.uvtsBufferData[_+1]=1-x/p,y+=3,_+=2}for(var M,w,E,A,T=0,C=0;C0;O-=d+1)s.addIntoBuffer(s.borderVerticesBufferData,s.vertices[O],S),S+=3;for(var I=d-1;I>0;I--)s.addIntoBuffer(s.borderVerticesBufferData,s.vertices[I],S),S+=3;return s}return c(e,t),e}(Jr),Fi="z",ji=function(t){function e(n,r,i,o){var a,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};a=t.call(this)||this;var u=e.buildPlane(n,r,i,o,s),h=u.uvs,c=u.indices,l=u.normals,f=u.vertices;return a.name="PlaneBufferGeometry",a.setAttribute("position",new Gr(f,3)),a.setAttribute("normals",new Gr(l,3)),a.setAttribute("uv",new Gr(h,2)),a.setIndexes(c),a}return c(e,t),e.buildPlane=function(t,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=o.normalAxis,s=void 0===a?Fi:a,u=o.useBack,h=void 0!==u&&u,c=o.normalDest,l=void 0===c?0:c,f=.5*t,d=.5*n,p=r||1,v=i||1,m=t/p,g=n/v,y=e.getNormal(s,h),_=[],x=[],b=[],M=[],w=0;w<=v;w++)for(var E=w*g-d,A=0;A<=p;A++){var T=A*m-f,C=e.get3DVertex([T,E],s,l);b.push.apply(b,mi(C)),_.push(A/p,1-w/v),M.push.apply(M,mi(y))}for(var R=0;R1&&void 0!==arguments[1]&&arguments[1],r=n?-1:1;switch(t){case"x":e=[r,0,0];break;case Fi:e=[0,0,r];break;default:e=[0,r,0]}return e},e}(Zr);ji.get3DVertex=function(t,e){var n,r=xi(t,2),i=r[0],o=r[1],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;switch(e){case"x":n=[a,i,o];break;case"y":n=[i,a,o];break;default:n=[i,o,a]}return n};var zi=function(t){function e(e,n,r,i,o,a){var s;(s=t.call(this)||this).name="BoxGeometry";var u=s.initBox(e,n,r,i,o,a),h=u.uvs,c=u.normals,l=u.vertices,f=u.indices;return s.setAttribute("position",new Gr(l,3)),s.setAttribute("normals",new Gr(c,3)),s.setAttribute("uv",new Gr(h,2)),s.setIndexes(f),s}return c(e,t),e.prototype.initBox=function(t,e,n,r,i,o){var a=[],s=ji.buildPlane,u=s(n,e,o,i,{normalAxis:"x",normalDest:t/2}),h=s(n,e,o,i,{normalAxis:"x",useBack:!0,normalDest:-t/2}),c=s(t,n,r,o,{normalAxis:"y",normalDest:e/2}),l=s(t,n,r,o,{normalAxis:"y",useBack:!0,normalDest:-e/2}),f=s(t,e,r,i,{normalAxis:"z",normalDest:n/2}),d=s(t,e,r,i,{normalAxis:"z",useBack:!0,normalDest:-n/2});a.push(u,h,c,l,f,d);for(var p=0,v=[],m=[],g=[],y=[],_=function(t){var e=a[t],n=e.uvs,r=e.vertices,i=e.normals,o=e.indices,s=p;v=v.concat(n),m=m.concat(r),g=g.concat(i),y=y.concat(o.map((function(t){return s+t}))),p+=r.length/3},x=0;x<6;x++)_(x);return{uvs:v,vertices:m,normals:g,indices:y}},e}(Zr),Vi=function(t){function e(e,n){var r;return(r=t.call(this)||this).width=void 0,r.height=void 0,r.glFrameBuffer=null,r.glDepthBuffer=null,r.flipY=!1,r.premultiplyAlpha=!1,r.glTexture=null,r.width=e,r.height=n,r}return c(e,t),e}(Or);function Gi(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Hi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hi(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Hi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0){var o=i.split("/");e.push(o)}}for(var a=e[0],s=1,u=e.length-1;s=0?n-1:n+e/3)},e.parseUVIndex=function(t,e){var n=parseInt(t,10);return 2*(n>=0?n-1:n+e/2)},t}();function Zi(t){return new Promise((function(e,n){var r=new Image;r.src=t,r.crossOrigin="Anonymous",r.onload=function(){e(r)},r.onerror=function(t){n(t)}}))}function qi(t){if(6!==t.length)throw new Error("[loadCubeTexture] param urls need len six. [px, nx, py, ny, pz, nz]");return new Promise((function(e,n){for(var r=0,i=new hi,o=i.image,a=function(a){Zi(t[a]).then((function(t){r++,o[a]=t,6===r&&(i.needsUpdate=!0,e(i))})).catch((function(t){console.error(t),n(t)}))},s=0;s<6;s++)a(s)}))}var Yi=function(t){function e(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return(e=t.call(this)||this).isCamera=!0,e.viewMatrix=Pe(),e.projectionMatrix=Pe(),e.projectionMatrixNeedUpdate=!1,e._far=void 0,e._near=void 0,e._far=r,e._near=n,e}return c(e,t),e.prototype.updateWorldMatrix=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t.prototype.updateWorldMatrix.call(this,e),Be(this.viewMatrix,this.worldMatrix)},o(e,[{key:"near",get:function(){return this._near},set:function(t){this._near=t,this.projectionMatrixNeedUpdate=!0}},{key:"far",get:function(){return this._far},set:function(t){this._far=t,this.projectionMatrixNeedUpdate=!0}}]),e}(Ur),Xi=function(t){function e(e,n,r,i,o,a){var s;return(s=t.call(this,o,a)||this)._left=void 0,s._right=void 0,s._top=void 0,s._bottom=void 0,s._top=r,s._left=e,s._right=n,s._bottom=i,s.updateProjectionMatrix(!0),s}c(e,t);var n=e.prototype;return n.updateProjectionMatrix=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===t||!0===this.projectionMatrixNeedUpdate){var e=(this.right-this.left)/2,n=(this.top-this.bottom)/2,r=(this.right+this.left)/2,i=(this.top+this.bottom)/2,o=r-e,a=r+e,s=i+n,u=i-n;Ie(this.projectionMatrix),$e(this.projectionMatrix,o,a,s,u,this.near,this.far),this.projectionMatrixNeedUpdate=!1}},n.clone=function(n){return void 0===n&&(n=new e(0,0,0,0,0,0)),t.prototype.clone.call(this,n),n.left=this.left,n.right=this.right,n.top=this.top,n.bottom=this.bottom,n.near=this.near,n.far=this.far,n.updateProjectionMatrix(),n.updateWorldMatrix(),n},o(e,[{key:"top",get:function(){return this._top},set:function(t){t!==this._top&&(this._top=t,this.projectionMatrixNeedUpdate=!0)}},{key:"left",get:function(){return this._left},set:function(t){t!==this._left&&(this._left=t,this.projectionMatrixNeedUpdate=!0)}},{key:"right",get:function(){return this._right},set:function(t){t!==this._right&&(this._right=t,this.projectionMatrixNeedUpdate=!0)}},{key:"bottom",get:function(){return this._bottom},set:function(t){t!==this._bottom&&(this._bottom=t,this.projectionMatrixNeedUpdate=!0)}}]),e}(Yi),Ki=function(t){function e(e,n,r,i){var o;return(o=t.call(this,r,i)||this).type="PerspectiveCamera",o._fov=void 0,o._aspect=void 0,o._fov=e,o._aspect=n,o.updateProjectionMatrix(!0),o}c(e,t);var n=e.prototype;return n.updateProjectionMatrix=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!0!==t&&!0!==this.projectionMatrixNeedUpdate||(Ie(this.projectionMatrix),Qe(this.projectionMatrix,this.fov*Math.PI/180,this.aspect,this.near,this.far),this.projectionMatrixNeedUpdate=!1)},n.clone=function(n){return void 0===n&&(n=new e(0,0,0,0)),t.prototype.clone.call(this,n),n.fov=this.fov,n.aspect=this.aspect,n.near=this.near,n.far=this.far,n.updateProjectionMatrix(),n.updateWorldMatrix(),n},o(e,[{key:"fov",get:function(){return this._fov},set:function(t){t!==this._fov&&(this._fov=t,this.projectionMatrixNeedUpdate=!0)}},{key:"aspect",get:function(){return this._aspect},set:function(t){t!==this._aspect&&(this._aspect=t,this.projectionMatrixNeedUpdate=!0)}}]),e}(Yi),Qi=Object.freeze({__proto__:null,Mesh:Kr,Scene:Qr,Geometry:Jr,Object3D:Ur,Raycaster:si,Texture:ui,CubeTexture:hi,TextureOperation:ci,Material:Ai,BasicMaterial:Pi,BufferGeometry:Zr,WebGLRenderer:Ui,PlaneGeometry:Ni,BoxGeometry:zi,WebGLRenderTarget:Vi,PlaneBufferGeometry:ji,Box3:Nr,OBJLoader:Wi,loadImage:Zi,loadTexture:function(t,e,n){return Zi(t).then((function(t){var n=new ui(t);return e&&e(n),n})).catch((function(t){n&&n(t)}))},loadCubeTexture:qi,Vec2:Ut,Vec3:ge,Vec4:kn,Mat3:Se,Mat4:an,Quat:Tr,quatToEuler:Ir,BufferAttribute:Fr,Uint8BufferAttribute:jr,Uint16BufferAttribute:zr,Uint32BufferAttribute:Vr,Float32ArrayAttribute:Gr,UintBufferAttribute:Hr,OrthographicCamera:Xi,PerspectiveCamera:Ki}),Ji=function(){function t(t){this.pano=void 0,this.panoData=void 0,this._meshs=new Kr,this.pano=t}return o(t,[{key:"camera",get:function(){return this.pano.camera}},{key:"meshs",get:function(){return this._meshs},set:function(t){this._meshs=t}}]),t}(),$i=["varying vec3 v_normal;","void main(void){"," gl_Position = mvpMatrix * vec4(position, 1.0);"," v_normal = normalize(position.xyz);","}"].join("\n"),to=["uniform samplerCube uSampler;","uniform float uOpacity;","varying vec3 v_normal;","void main(void){"," vec4 textureColor = textureCube(uSampler, normalize(v_normal));"," gl_FragColor = vec4(textureColor.rgb, textureColor.a * uOpacity);","}"].join("\n"),eo=function(t){function e(e){var n;return(n=t.call(this,e)||this).initMesh(),n}c(e,t);var n=e.prototype;return n.initMesh=function(){var t=new zi(8,8,8,1,1,1),e=new Ai;e.vertexShader=$i,e.fragmentShader=to,e.uniforms={vColor:{type:"4f",value:[1,0,0,1]},uSampler:{type:"t",value:null},uOpacity:{type:"1f",value:1}};var n=new Kr(t,e);n.visible=!1,n.setScale(-1,1,1),this.meshs=n},n.setData=function(t){var e=this;if(!t.image||6!==t.image.length)throw new Error("天空盒模型需要6张纹理,但只获取到 ".concat(t.image?t.image.length:0,"张"));this.panoData=t;var n=this.meshs;qi(t.image).then((function(t){n.material.uniforms.uSampler.value=t,n.visible=!0,e.pano.emit({type:d.REFRESH,log:"[Refresh Log] 立方贴图加载完成, 渲染一帧"})})).catch((function(t){return console.error(t)}))},n.update=function(){},n.draw=function(){},e}(Ji),no=function(t){return t},ro=function(t){return t*t},io=function(t){return-t*(t-2)},oo=ro,ao=io,so=Object.freeze({__proto__:null,linear:no,reverse:function(t){return 1-t},easeInQuad:ro,easeInCubic:function(t){return Math.pow(t,3)},easeOutQuad:io,easeOutCubic:function(t){return Math.pow(t-1,3)+1},easeInOutQuad:function(t){return t<.5?t*t*2:-2*(t-2)*t-1},easeInOutCubic:function(t){return t<.5?4*Math.pow(t,3):4*Math.pow(t-1,3)+1},easeInOutSine:function(t){return(1-Math.cos(Math.PI*t))/2},easeIn:oo,easeOut:ao}),uo=function(){},ho=function(){function t(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:no;this.from=void 0,this.to=void 0,this.duration=void 0,this.easingFn=void 0,this._isPlaying=!1,this._autoTimer=null,this._startTime=null,this._onUpdateCallback=uo,this._onEndCallback=uo,this.start=function(){return r._isPlaying||(r._isPlaying=!0,r._startTime=r.getNow()),r},this.stop=function(){return r._isPlaying=!1,r},this.startAndAutoUpdate=function(){if(r._isPlaying)return r;r.start(),r._autoTimer=null;return function t(){r.update(),r._autoTimer=requestAnimationFrame(t)}(),r},this.onEnd=function(t){return"function"==typeof t?r._onEndCallback=t:console.warn("[Warning] onUpdate required a funtion"),r},this.onUpdate=function(t){return"function"==typeof t?r._onUpdateCallback=t:console.warn("[Warning] onUpdate required a funtion"),r},this.update=function(){if(!r._isPlaying)return!1;var t=r.from,e=r.to,n=r.getNow(),i=r.easingFn,o=r._startTime;if(o>n)return!1;var a=(n-o)/r.duration,s=t+(e-t)*i(a=0===r.duration||a>1?1:a);return r._onUpdateCallback(s),1===a&&r.handleEnd(),!0},this.from=t,this.to=e,this.duration=n,this.easingFn=i}var e=t.prototype;return e.getNow=function(){return Date.now()},e.handleEnd=function(){this._isPlaying=!1,this._autoTimer=null,this._onEndCallback()},t}(),co=function(t,e,n){var r=.5*e,i=.5*n;return _t((t[0]-r)/r,(i-t[1])/i)},lo=function(t,e,n){var r=.5*e,i=.5*n;return _t((t[0]+1)*r,(1-t[1])*i)},fo=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:100,o=sn(),a=co(t,n,r),s=hn(a[0],a[1],i,1),u=Pe(),h=e.worldMatrix;return Be(u,e.projectionMatrix),En(o,s,u),En(o,o,h),o},po=function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=hn(e[0],e[1],e[2],1);if(En(o,o,t.viewMatrix),0=0&&a<=n&&s>=0&&s<=r&&(u=!0),u},mo=Object.freeze({__proto__:null,viewportToNormalizeProjection:co,normalizeProjectionToViewport:lo,viewportToWorld:fo,worldToViewport:po,isCoordsInView:vo}),go=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;this.getVertexs=function(){return e.vertexs},this.getFacesVertex=function(){return e.facesVertex},this.generateTextureCoord=function(n,r,i){var o=e.facesVertex[Math.round(e.facesVertex.length/2)];if(o){for(var a=[],s=Math.pow(2,5-i),u=r%s,h=n%s,c=t.H_SEGS/e.cols,l=1/c,f=1/((t.V_SEGS-1)/e.rows),d=0;d0?s<0&&(u=360-u):u=s>0?180-u:180+u,u%=360,r=a>e._x3?7:a>e._x2?6:a>e._x1?5:a>0?4:a>-e._x1?3:a>-e._x2?2:a>-e._x3?1:0;var h=Math.floor(u/22.5),c=t.H_SEGS;return[h,r,h+r*(c/(c/e.cols))]},this.viewportToSphereCoord=function(t,n,r,i){var o=e.radius,a=fo(t,i,n,r),s=xi(a,3),u=s[0],h=s[1],c=s[2],l=o/Math.sqrt(u*u+h*h+c*c);return[u*l,h*l,c*l]},this.getFaceVertex=function(n,r){var i=t.H_SEGS/e.cols,o=r+n*(t.H_SEGS/i);return e.facesVertex[o]},this.radius=n,this.rows=t.DEFAULT_COLS/2,this.cols=t.DEFAULT_COLS,this.vertexs=null,this.facesVertex=[],this.facesVertexIndice=[],this.init()}var e=t.prototype;return e.init=function(){var t=this.getSphereVertexInfo();this.facesVertexIndice=this.getSphereFacesIndices(),this.vertexs=t.vertexs,this.facesVertex=t.facesVertex,this.calcConst()},e.calcConst=function(){var t=360/this.cols;this._x1=Math.cos(g(3*t))*this.radius,this._x2=Math.cos(g(2*t))*this.radius,this._x3=Math.cos(g(1*t))*this.radius},e.getSphereVertexInfo=function(){for(var e,n=[],r=[],i=this.radius,o=t.H_SEGS,a=t.V_SEGS,s=360/o,u=180/(a-1),h=o/this.cols,c=o/h,l=0,f=0,d=[],p=0;p0&&p%h==0){var b=f+(l-1)*c;r[b].push(_,v,x),y>0&&y%h==0&&r[b-1]&&r[b-1].push(_,v,x),y===o-1&&r[b].push(d[0],d[1],d[2])}0===f&&0===y&&(d=[_,v,x]),y>0&&y%h==0&&r[e-1]&&r[e-1].push(_,v,x),l2&&void 0!==arguments[2]?arguments[2]:"";this.imageInstancePool=void 0,this.tileImagesCache=void 0,this.textureInfo=void 0,this.pano=void 0,this.udtVersion=void 0,this.cdnList=void 0,this.calcTileKey=function(t,e,n,r){return"".concat(t,"_").concat(e,"_").concat(n,"_").concat(r)},this.loadImage=function(t,e,n,i){var o=r.calcTileKey(t,e,n,i),a=r.getTilesUrl(t,{x:e,y:n},i),s=r.tileImagesCache.getData(o);return new Promise((function(t,e){s?t(s._loaded?s:null):((s=r.imageInstancePool.getImageInstance()).crossOrigin="anonymous",s._loaded=!1,s.onload=function(){s._loaded=!0,t(s)},s.onerror=function(t){console.error("Tile ".concat(o," load error => "),t),e(t)},s.src=a,r.tileImagesCache.setData(o,s))}))},this.loadTexture=function(t,e,n,i){var o=r.calcTileKey(t,e,n,i),a=r.textureInfo.getData(o);return new Promise((function(s,u){a&&a.loaded?s(a):r.loadImage(t,e,n,i).then((function(t){if(!t)return null;var e=new ui(t);1!==i&&r.textureInfo.setData(o,e),s(e)})).catch((function(t){console.error("[TextureManager] loadTexture fail => ".concat(t)),u(null)}))}))},this.loadTopoTexture=function(t){var e=0,n=new Image;return new Promise((function(r){n.onload=function(){var t=new ui(n);t.flipY=!1,r(t)},n.onerror=function(){2>e?(e++,n.src="".concat(t,"&random=").concat((new Date).getTime())):r(null)},n.crossOrigin="anonymous",n.src=t}))},this.clear=function(){r.textureInfo.clear()},this.pano=e,this.udtVersion=i,this.cdnList=n||e.opts.tileBaseUrls,this.imageInstancePool=new yo,this.tileImagesCache=new T(t.MAX_TILE_CACHED,{clearCallback:function(t){r.imageInstancePool.freeImage(t)}}),this.textureInfo=new T(t.MAX_TILE_CACHED,{clearCallback:function(t){t.destory()}})}var e=t.prototype;return e.getRandomCDN=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.length;return t[Math.floor(Math.random()*e)]},e.getTilesUrl=function(e,n,r){return this.getRandomCDN(this.cdnList)+(t.TILE_URL_TEMPLATE+"&".concat($("/",{isCounter:!0}))).replace("{udt}",this.udtVersion).replace("{sid}",e).replace("{x}","".concat(n.x)).replace("{y}","".concat(n.y)).replace("{zoom}","".concat(r))},t}();_o.MAX_TILE_CACHED=160,_o.TILE_URL_TEMPLATE="?qt=pdata&sid={sid}&pos={y}_{x}&z={zoom}&udt={udt}&from=H5";var xo=["attribute vec2 uvBack;","varying mediump vec2 vTextureCoordBack;","varying mediump vec2 vTextureCoord;","void main(void) {"," gl_Position = mvpMatrix * vec4(position, 1.0);"," vTextureCoordBack = uvBack;"," vTextureCoord = uv;","}"].join("\n"),bo=["precision mediump float;","varying vec2 vTextureCoordBack;","varying vec2 vTextureCoord;","uniform sampler2D uSamplerBack;","uniform sampler2D uSampler;","uniform bool uDrawThumb;","uniform bool uDrawBack;","uniform float uAlpha;","void main(void) {"," if (uDrawThumb) {"," gl_FragColor = texture2D(uSamplerBack, vTextureCoordBack);"," return;"," }"," if (uAlpha == 1.0) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);"," return;"," }"," if (uDrawBack) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha + texture2D(uSamplerBack, vTextureCoordBack) * (1.0 - uAlpha);"," } else {"," vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));"," gl_FragColor = vec4(textureColor.rgb, textureColor.a * uAlpha);"," }","}"].join("\n"),Mo=["varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = mvpMatrix * vec4(position, 1.0);"," vTextureCoord = uv;","}"].join("\n"),wo=["precision mediump float;","uniform sampler2D uSampler;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord);","}"].join("\n"),Eo=["varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = mvpMatrix * vec4(position, 1.0);"," vTextureCoord = uv;","}"].join("\n"),Ao=["uniform sampler2D uSampler;","uniform float uOpacity;","varying vec2 vTextureCoord;","void main(void){"," vec4 textureColor = texture2D(uSampler, vTextureCoord);"," gl_FragColor = vec4(textureColor.rgb, textureColor.a * uOpacity);","}"].join("\n"),To=["varying highp vec3 vTextureCoord;","void main(void){"," gl_Position = mvpMatrix * vec4(position, 1.0);"," vTextureCoord = vec3(uv, 1.0) * length(position);","}"].join("\n"),Co=["uniform sampler2D uSampler;","uniform float uOpacity;","varying vec3 vTextureCoord;","uniform bool showDebugLine;","uniform vec4 vColor;","void main(void){"," if (!showDebugLine) {"," vec4 textureColor = texture2DProj(uSampler, vTextureCoord);"," gl_FragColor = vec4(textureColor.rgb, textureColor.a * uOpacity);"," } else {"," gl_FragColor = vec4(vColor.rgb, vColor.a);"," }","}"].join("\n"),Ro=function(){function t(e,n,r,i){this.nodes=void 0,this.level=void 0,this.key=void 0,this.nodes=[],this.level=e,this.key="".concat(r,"_").concat(i),e0},e.getNodeKeysByLevel=function(t){if(to&&(p=o);for(var b=d;b<=p;b++)for(var M=v;M<=m;M++){var w=b<0?b+i:b;n.checkAndLoadTile(t,w,M,n._imgZoom),l.push([M,w])}}n.hitTile=l,l.forEach((function(t){var e=xi(t,2),r=e[0],i=e[1],o="".concat(r,"_").concat(i,"_").concat(n._imgZoom);if(void 0===n.tileInfoCache[o]){var a=new Ro(n._imgZoom,5,r,i).getNodeKeysByLevel(5);n.tileInfoCache[o]=a}}))}},n.draw=function(){var t=n.meshs;if(!n.faceRange||!n.curThumbTexture)return!1;t.children=[];for(var e=function(e,r){var i=n.curThumbTexture,o=n.textureManager.calcTileKey(n.panoData.panoId,e,r,n._imgZoom),a=n.textureManager.textureInfo.getData(o),s=!1,u=null;if(a?!(u=a).finished&&u.aniInfo&&u.aniInfo&&u.aniInfo.update():i&&(s=!0,u=i),u){var h="".concat(r,"_").concat(e,"_").concat(n._imgZoom),c=n.meshCache[h];if(!c){if(!(c=n.createTileMesh(r,e)))return;n.meshCache[h]=c}if(!c.material)return;var l=c.material.uniforms;l.uSamplerBack.value=i,s?l.uDrawThumb.value=!0:(l.uDrawThumb.value=!1,l.uSampler.value=u,l.uAlpha.value=u.alpha),t.add(c)}},r=0;rS&&(E=Math.min.apply(Math,mi(b.filter((function(t){return t>S}))))),C.max-C.min>S&&(A=Math.max.apply(Math,mi(w.filter((function(t){return tA&&(E-=R);var P=this.getImgIndexByFaceColRow(E,_),D=xi(P,2),O=D[0],I=D[1],L=this.getImgIndexByFaceColRow(A,x),B=xi(L,2);return[[E,A,_,x],[O,B[0],I,B[1]]]},n.updateRangeInfo=function(){var t=this.getTileBoundary(),e=xi(t,2),n=e[0],r=e[1];this.imgRange=r,this.faceRange=n},n.getImgIndexByFaceColRow=function(t,e,n){n=n||this._imgZoom;var r=Math.pow(2,5-n),i=Math.floor(t/r),o=Math.floor(e/r);return[i,o=this.imgColsRows[n].rows-o-1,i+o*go.DEFAULT_COLS/r]},n.normalizeNum=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t;r .5) {\n damp_factor = (1.0 - progress) * 2.0;\n }\n\n float cut_factor = clamp(wave_width * damp_factor - abs(current_radius - len), 0.0, 1.0);\n float waves_factor = waves * len / radius;\n uv_offset = (p / len) * cos((waves_factor - progress * speed) * 3.14) * amp * cut_factor;\n\n uv += uv_offset;\n\n vec4 t_image = texture2D(uSampler, fract(tc + uv));\n\n // gl_FragColor = t_image;\n gl_FragColor = vec4(t_image.rgb, t_image.a * uOpacity);\n }\n",t.uniforms={uSampler:{type:"t",value:this.snapshot},uCenter:{type:"2f",value:[.5,.5]},uOpacity:{type:"1f",value:1},progress:{type:"1f",value:0},speed:{type:"1f",value:4},waves:{type:"1f",value:14},band:{type:"1f",value:.3},amp:{type:"1f",value:.3},aspect:{type:"1f",value:n/r},radius:{type:"1f",value:1}},this.material=t,t},t}(),No=function(){function t(t,e,n,r){var i=this;this.startAni=function(){i.animation.start()},this.update=function(){i.animation.update()},this.pano=t,this.distance=n,this.refinedDir=e,this.camera=this.pano.camera,this.cameraBase=this.pano.camera.clone(),this.handleEnd=r,this.initAni()}return t.prototype.initAni=function(){var t=this,e=this.distance,n=this.refinedDir,r=Math.cos(g(n)),i=Math.sin(g(n));this.animation=new ho(0,1,400,so.easeOutQuad).onUpdate((function(n){var o=e*n,a=r*o,s=i*o;t.camera.setPosition(a,0,s),t.pano.dispatchEvent({debug:!0,type:d.REFRESH,log:"[Refresh Log] 前进动画, 渲染一帧"})})).onEnd((function(){t.handleEnd&&t.handleEnd()}))},t}(),Fo=function(t,e,n,r){this.x=t||0,this.y=e||0,this.width=n||0,this.height=r||0},jo=function(t,e){var n=this;this.angleDegreeDelta=function(t,e){var n=Math.abs(t-e);return n>180?360-n:n},this.getRoad=function(t,e,n,r,i){for(var o,a=[],s=[[-t/2,-e,-10],[-t/2,-e,-20],[t/2,-e,-10],[t/2,-e,-20]],u=s.length,h=0;h.7&&(i=r-.7),r<.3&&(i=.3-r),n.x=n.x+n.width*i,n},this.fixInnerRectSize=function(t,e,n){var r,i,o,a,s=t;s.width/n>.12&&(a=(o=.12*n)*(s.width/s.height),r=s.x+(s.width-o)*(e.x-s.x)/s.width,i=s.y+(s.height-a)*(e.y-s.y)/s.height,s=new Fo(r,i,o,a));var u=s.width/s.height;return a=s.height,u>1.2&&(a=s.height*u/1.2),u<.9&&(a=s.height*u/.9),i=s.y+s.height-a,s.height=a,s.y=i,s},this.panoData=t.panoData,this.camera=t.camera,this.projectionMatrix=this.camera.projectionMatrix,this.fov=g(this.camera.fov),this.traverseDir=e,this.cameraHeading=t.getPov().heading||0,this.isMovingForward=this.angleDegreeDelta(this.cameraHeading,this.traverseDir)<=90,this.roadWith=Math.min(1.5*this.panoData.getRoadWidth(),10),this.deviceHeight=this.panoData.deviceHeight||2.2,this.panoWidth=t._container.clientWidth,this.panoHeight=t._container.clientHeight;var r=this.angleDegreeDelta(this.cameraHeading,this.traverseDir)>45;this.snapshotRatio=r?1:1.8,this.projectionRoadInfos=this.getRoad(this.roadWith,this.deviceHeight,this.projectionMatrix,this.panoWidth,this.panoHeight),this.vanishPoint=this.calculateVanishPoint(this.projectionRoadInfos,this.snapshotRatio,this.panoWidth,this.panoHeight),this.innerRect=this.getInnerRect(this.vanishPoint,this.projectionRoadInfos,this.panoWidth,this.panoHeight,this.snapshotRatio),this.outerRect=this.getOuterRect(this.panoWidth,this.panoHeight,this.snapshotRatio),this.focusLength=.5*this.panoHeight/Math.tan(.75*this.fov),this.vanishPointDeltaX=this.vanishPoint.x-this.outerRect.x-.5*this.outerRect.width,this.vanishPointDeltaY=this.vanishPoint.y-this.outerRect.y-.5*this.outerRect.height},zo={FAR:[10,10,0],LEFT:[0,10,30],RIGHT:[0,10,30],TOP:[10,0,30],BOTTOM:[10,0,30]},Vo={FAR:["innerTopLeftVertex","innerBottomRightVertex"],LEFT:["outerTopLeftVertex","innerBottomLeftVertex"],RIGHT:["innerTopRightVertex","outerBottomRightVertex"],TOP:["outerTopLeftVertex","innerTopRightVertex"],BOTTOM:["innerBottomLeftVertex","outerBottomRightVertex"]},Go=Object.keys(zo),Ho=function(t){function e(e,n){var r;if((r=t.call(this)||this).createSkeleton=function(t){var e=t.vanishPoint,n=t.innerRect,r=t.outerRect,i=t.focusLength,o=r.y+r.height-n.y-n.height,a=e.y-n.y,s=e.x-n.x,u=n.x+n.width-e.x,h=r.y+r.height-e.y,c=o*i/(h-o),l=u*(i+c)/i,f=-(s*(i+c)/i),d=h+a*(i+c)/i-h,p=-h,v=c/5;return{innerTopLeftVertex:{x:f,y:d,z:-c},innerBottomLeftVertex:{x:f,y:p,z:-c},innerTopRightVertex:{x:l,y:d,z:-c},innerBottomRightVertex:{x:l,y:p,z:-c},outerTopLeftVertex:{x:f,y:d,z:v},outerTopRightVertex:{x:l,y:d,z:v},outerBottomLeftVertex:{x:f,y:p,z:v},outerBottomRightVertex:{x:l,y:p,z:v}}},r.modelSkeleton=function(t,e){var n=[],i=[];return Go.forEach((function(o){var a=xi(Vo[o],2),s=a[0],u=a[1],h=n.length/3;n=n.concat(r.calculatePlaneVertex(t[s],t[u],o,e)),i=i.concat(r.calculateIndices(o,h))})),[n,i]},r.calculatePlaneVertex=function(t,e,n,i){for(var o,a=[],s=xi(zo[n],3),u=s[0],h=s[1],c=s[2],l=r.linerInterpolate(t.x,e.x,u),f=r.linerInterpolate(t.y,e.y,h),d=r.linerInterpolate(t.z,e.z,c),p=0;p<=u;p++)for(var v=0;v<=h;v++)for(var m=0;m<=c;m++)En(o=hn(l[p],f[v],d[m],1),o,i),o[0]=o[0]/o[3],o[1]=o[1]/o[3],o[2]=o[2]/o[3],a.push(o[0],o[1],o[2]);return a},r.calculateIndices=function(t,e){var n=[],r=zo[t];r=r.filter((function(t){return t>0}));for(var i=xi(r,2),o=i[0],a=i[1],s=0,u=0,h=0,c=0,l=0;l0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.x=t,this.y=e}return t.prototype.equals=function(t){return t&&t.x===this.x&&t.y===this.y},t}(),Yo=function(){function t(t,e){var n=this;this.setData=function(t,e){n.panoData=t,n.nextPanoData=e},this.sceneChangeHandler=function(){if(n.panoData&&n.nextPanoData)return new Promise((function(t){var e=n.isStreet(n.panoData.panoType),r=n.isStreet(n.nextPanoData.panoType),i=n.snapshotFn(),o=n.pano.animationType;if(o&&["waterwave","fade"].indexOf(o)>-1)switch(o){case"waterwave":n.prepareWaterWave(i),t();break;case"fade":n.prepareFade(i),t()}else r&&e?(n.setDir(),n.prepareTraverse(i).then((function(e){n.prepareFade(e),t()}))):(n.prepareFade(i),t())}))},this.setSnapshot=function(t){n.snapshot=t},this.pano=t,this.snapshotFn=e,this.panoData=null,this.nextPanoData=null,this.changeAni=null,this.animateDir=0}var e=t.prototype;return e.draw=function(){if(this.changeAni){var t=this.changeAni,e=t.scene,n=t.camera;this.changeAni.update(),this.pano.renderer.render(e,n)}},e.setDir=function(){if(this.panoData&&this.nextPanoData){var t=this.nextPanoData.panoId,e=this.panoData.getTopos().filter((function(e){return e&&e.panoId===t}));if(e.length){var n=e[0].topoDir;this.animateDir=n}else this.animateDir=this.pano.getPov().heading||0}},e.prepareJump=function(){var t=this,e=this.calcJumpDistance();return new Promise((function(n){t.changeAni=new No(t.pano,t.animateDir,e,(function(){t.changeAni=null,n()})),t.changeAni.startAni(),t.pano.dispatchEvent({debug:!0,log:"穿梭动画,渲染一帧",type:d.REFRESH})}))},e.prepareTraverse=function(t){var e=this,n=this.calcJumpDistance();return new Promise((function(r){e.changeAni=new Zo(e.pano,n,t,e.animateDir,(function(){var t=e.snapshotFn(e.changeAni.scene,e.changeAni.camera);r(t),e.changeAni=null})),e.changeAni.start(),e.pano.dispatchEvent({debug:!0,log:"穿梭动画,渲染一帧",type:d.REFRESH})}))},e.prepareFade=function(t){var e=this;this.changeAni=new ko(this.pano,t,(function(){e.changeAni=null,e.pano.emit(d.SCENE_CHANGE_END)}))},e.prepareWaterWave=function(t){var e=this;this.changeAni=new Uo(this.pano,t,(function(){e.changeAni=null,e.pano.emit(d.SCENE_CHANGE_END)}))},e.calcJumpDistance=function(){var t,e,n=300,r=(t=new qo(this.panoData.panoX,this.panoData.panoY),e=new qo(this.nextPanoData.panoX,this.nextPanoData.panoY),t&&e?Math.round(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))):0);"number"==typeof r&&(n*=Math.pow(r,1/4));return n},e.isStreet=function(t){return t===p.TYPE_STREET},t}(),Xo=function(){function t(t,e){var n=e.fov,r=void 0===n?145:n,i=e.cameraY,o=void 0===i?3e3:i,a=e.handleEnd;this._pano=void 0,this.originFov=void 0,this.originRotateX=void 0,this.originRotateY=void 0,this.targetFov=void 0,this.targetCameraY=void 0,this.handleEnd=void 0,this.animate=void 0,this._pano=t,this.originFov=this.camera.fov,this.originRotateX=this.camera.rotation.x,this.originRotateY=this.camera.rotation.y,this.targetFov=r,this.targetCameraY=o,this.handleEnd=a,this.init()}var e=t.prototype;return e.start=function(){this._pano.dispatchEvent({type:d.REFRESH,debug:!0,log:"开场动画动画起始,渲染一帧"}),this.animate.start()},e.update=function(){this.animate.update()},e.init=function(){var t=this,e=this.camera;this.handleCameraChange(0),this.animate=new ho(0,1,p.FISHEYE_DURATION,so.easeInOutQuad).onUpdate((function(e){t.handleCameraChange(e),t._pano.dispatchEvent({type:d.REFRESH,debug:!0,log:"开场动画动画,渲染一帧"})})).onEnd((function(){e.fov=t.originFov,e.rotateX(t.originRotateX),e.rotateY(t.originRotateY),e.setPosition(0,0,0),e.updateWorldMatrix(),e.updateProjectionMatrix(),t._pano.dispatchEvent({type:d.REFRESH,debug:!0,log:"开场动画动画结束,渲染一帧"}),t.handleEnd()}))},e.handleCameraChange=function(t){var e=this.camera,n=this.targetCameraY,r=this.targetFov-(this.targetFov-this.originFov)*t,i=(this.originRotateX- -90)*t-90,o=this.originRotateY*t;e.fov=r,e.rotateX(i),e.rotateY(o),e.setPosition(0,n-n*t,0),e.updateWorldMatrix(),e.updateProjectionMatrix()},o(t,[{key:"camera",get:function(){return this._pano.camera}}]),t}();function Ko(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Qo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qo(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Qo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=u&&t<=h&&n>=c&&n<=l){i=!1,a.handleClick();break}}}catch(t){o.e(t)}finally{o.f()}return i},this.pano=t}var e=t.prototype;return e.handleAdd=function(t){t&&t.id&&(this.overlays.some((function(e){return e.id===t.id}))||(this.overlays.push(t),this.isReady&&t.init(this.pano)))},e.handleRemove=function(t){for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:100;e.renderThreadId&&(clearTimeout(e.renderThreadId),e.renderThreadId=null),e.renderThreadId=window.setTimeout((function(){e.isRAFRuning=!1,e.renderThreadId=null}),t),e.isRAFRuning||(e.isRAFRuning=!0,e.renderFrame())},this.resize=function(){var t=e.pano.getContainer();e.renderer.setSize(t.clientWidth,t.clientHeight)};var n=window.devicePixelRatio||1,r=t.getContainer();this.pano=t,this.renderer=new Ui({premultipliedAlpha:!1,preserveDrawingBuffer:t.opts.enableCapture||!1,antialias:!(n>1),pixelRatio:n,width:r.clientWidth,height:r.clientHeight}),this.renderer.setSize(r.clientWidth,r.clientHeight),t.getPanes().tileLayer.appendChild(this.renderer.domElement),this.gl=this.renderer.getContext(),this.camera=new Ki(75,r.clientWidth/r.clientHeight,.01,67e3),this.scene=new Qr,t.gl=this.gl,t.canvas=this.renderer.domElement,t.scene=this.scene,t.camera=this.camera,t.cameraNoFix=this.cameraNoFix,t.renderer=this.renderer,t.renders=[],this.sceneChange=new Yo(t,this.getSnapshot),this.initModule()}var e=t.prototype;return e.initModule=function(){var t=this.pano;this.sphereRender=new So(t),this.linkGLRender=new Bo(t),this.overlayManager=new Jo(t),this.skyboxRender=new eo(t),this.pano.renders.push(this.sphereRender,this.linkGLRender,this.overlayManager,this.skyboxRender)},e.reset=function(){this.scene.remove(this.sphereRender.meshs),this.scene.remove(this.linkGLRender.meshs)},e.getModule=function(t){var e,n=null,r=$o(this.pano.renders);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.name===t){n=i;break}}}catch(t){r.e(t)}finally{r.f()}return n},e.renderFrame=function(){!1!==this.isRAFRuning?(this.openingAni&&this.openingAni.update(),this.sphereRender.draw(),this.renderer.render(this.scene,this.camera),this.overlayManager.draw(),this.sceneChange.draw(),this.requestId=requestAnimationFrame(this.renderFrame.bind(this))):this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=null)},e.startFishEyeAni=function(){var t=this;this.pano.fisheye&&(this.openingAni=new Xo(this.pano,{handleEnd:function(){t.openingAni=null,t.pano.fisheye=!1}}),setTimeout((function(){t.openingAni.start(),t.startRenderThread()}),p.FISHEYE_DELAY))},e.updateProjectionMatrix=function(t,e){var n=this.pano.getFov(e),r=this.pano.getContainerSize(),i=r.width/r.height;t.fov=n,t.aspect=i,t.updateProjectionMatrix()},e.updateCameraHeadingAndPitch=function(t){var e=this.pano.getPov(),n=e.heading,r=e.pitch,i=this.panoData,o=i.fixHeading,a=void 0===o?0:o,s=i.fixPitch,u=void 0===s?0:s,h=i.fixRoll,c=void 0===h?0:h;t.rotateX(r-u),t.rotateY(-n+a),t.rotateZ(c),t.updateWorldMatrix()},e.safeCall=function(t,e,n){var r=this.getModule(t);if(r&&r[e])return r[e].apply(r,n||[]);throw new Error("[safeCall] get module error => ".concat(t))},o(t,[{key:"isCanUpdate",get:function(){var t=this.sceneChange.changeAni,e=this.openingAni;return this.panoData&&!(t||e)}}]),t}(),na=function(){function t(t){var e=this;this.updateAnglePerPixel=function(){e._anglePerPixel=e._pano.calcAnglePerPixel()},this.destroy=function(){e.bindEvent(!1)},this._pano=t,this._displayZoom=t.getZoom(),this._anglePerPixel=t.calcAnglePerPixel(),this._container=t.getContainer(),this.lock=!1,this.clickTimer=null,this.dragAni=null,this.state={initPos:null,initHeading:0,initPitch:0,lastDiffPos:null,moveDiffPos:null,isTouchDown:!1,isTouchMove:!1,startTime:0,lastMoveTime:0}}var e=t.prototype;return e.init=function(){if(!this._initialized){if(this._initialized=!0,this.isMobile=navigator.userAgent.toLowerCase().match(/ipod|ipad|iphone|android/),this.isMobile){this.EVENTS={START:"touchstart",MOVING:"touchmove",END:"touchend",OUT:"touchcancel",WHEEL:"gesturechange",DOMMouseScroll:"DOMMouseScroll"};var t=this._container.getBoundingClientRect?this._container.getBoundingClientRect():{},e=t.left,n=void 0===e?0:e,r=t.top,i=void 0===r?0:r;this.getPagePosition=function(t){var e=t.touches.length>0?t.touches[0]:t.changedTouches[0];return{x:e.pageX-n,y:e.pageY-i}}}else this.EVENTS={START:"mousedown",MOVING:"mousemove",END:"mouseup",OUT:"mouseout",WHEEL:"mousewheel"},this.getPagePosition=function(t){return{x:t.offsetX,y:t.offsetY}};this.bindEvent()}},e.bindEvent=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=document.body,n=this.EVENTS,r=n.START,i=n.MOVING,o=n.END,a=this._pano._svContainer,s=t?"addEventListener":"removeEventListener";a[s](r,this.handleDown.bind(this)),a[s](i,this.handleMove.bind(this)),e[s](o,this.handleUp.bind(this))},e.handleDown=function(t){this.dragAni&&this.dragAni.stop();var e=this.state,n=this.getPagePosition(t),r=this._pano.getPov();e.initPos=n,e.isTouchDown=!0,e.initHeading=r.heading,e.initPitch=r.pitch,e.startTime=x(),this._pano.dispatchEvent(d.TOUCH_START,t)},e.handleMove=function(t){if(this.state.isTouchDown){this.state.isTouchMove=!0;var e=this.calcDiffPos(this.state.initPos,this.getPagePosition(t));this.setPov(e),this.state.moveDiffPos=e,this.state.lastDiffPos=e,this.state.lastMoveTime=x(),t.preventDefault(),t.stopPropagation()}},e.handleUp=function(t){var e=this;if(this.state.isTouchDown){var n=!0,r=this.getPagePosition(t);if(t.pos=r,this.state.isTouchDown=!1,this._pano.dispatchEvent(d.TOUCH_END,t),this._pano.renders.length)for(var i=0;i10||Math.abs(s)>10)){var u=this.calcDiffPos(this.state.initPos,this.getPagePosition(t)),h=2*Math.sqrt(Math.pow(u.x,2)+Math.pow(u.y,2))/(.008*(r-n.startTime)),c=[u.x>0?1:-1,u.y>0?1:-1],l=Math.abs(u.x),f=Math.abs(u.y),p=Math.atan2(f,l),v=Math.cos(p)*h,m=Math.sin(p)*h;-1===c[0]&&(v=-v),-1===c[1]&&(m=-m),this.dragAni&&this.dragAni.stop();var g=this._pano.getPov(),y=g.heading,_=g.pitch;n.initHeading=y,n.initPitch=_;this.dragAni=new ho(0,1,400,(function(t){return.3125*t-.15625*t*t})).onUpdate((function(t){var n=(t*=6.4)*v,r=t*m;e.setPov({x:n,y:r})})).onEnd((function(){e.dragAni=null,e._pano.dispatchEvent({type:d.POV_CHANGED_END})})).startAndAutoUpdate()}else this._pano.dispatchEvent({type:d.POV_CHANGED_END})},e.calcDiffPos=function(t,e){return t&&e?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}},t}();function ra(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ia(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ia(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function ia(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n180?(u+=360,c=r.heading-u):c<-180&&(u-=360,c=r.heading-u),new ho(0,1,400,so["ease-out"]).onUpdate((function(t){a({heading:u+t*c,pitch:h+t*l})})).onEnd((function(){})).startAndAutoUpdate()}else a(r)}else e.handlePovChange(r)})),e.on(d.ZOOM_CHANGED,(function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.panoGLRender.isCanUpdate){var r=t.preZoom,i=e.getZoom();if(r!==i){var o=n.noAnimation||!1;if(t.zoomChangeAni&&(t.zoomChangeAni.stop(),t.zoomChangeAni=null),o)return t.op.updateAnglePerPixel(),t.panoGLRender.updateProjectionMatrix(e.camera),t.panoGLRender.update(),void(t.preZoom=i);var a=400;t.zoomChangeAni=new ho(r,i,a,so.easeOutCubic).onUpdate((function(n){t.panoGLRender.updateProjectionMatrix(e.camera,n),t.panoGLRender.update(n)})).onEnd((function(){t.zoomChangeAni=null,t.preZoom=i})).startAndAutoUpdate()}}})),e.on(d.DOUBLE_CLICK,(function(){t.panoGLRender.isCanUpdate&&(v.isMobile&&(3===e.getZoom()?e.setZoom(2):e.setZoom(3)))})),e.on(d.REFRESH,(function(e){var n=e.duration||200;t.panoGLRender.startRenderThread(n),t.debug&&e.log&&e.debug&&console.warn(e.log)})),e.on(d.SET_ID,(function(e){if(!t.panoServiceLock&&e.id){t.panoServiceLock=!0,window.getPanoById=t.panoService.getPanoById;var n=(1e5*Math.random()).toFixed(0);BMapGL._rd=BMapGL._rd||{},BMapGL._rd["_cbk"+n]=function(t){t&&void 0!==t.error&&0===t.error?window.getPanoById(e.id):Q("PANORAMA"),delete BMapGL._rd["_cbk"+n]},K("PANORAMA","BMapGL._rd._cbk"+n)}})),e.on(d.SET_POSITION,(function(e){if(!t.panoServiceLock&&e.point){t.panoServiceLock=!0,window.getPanoByLocation=t.panoService.getPanoByLocation;var n=(1e5*Math.random()).toFixed(0);BMapGL._rd=BMapGL._rd||{},BMapGL._rd["_cbk"+n]=function(t){t&&void 0!==t.error&&0===t.error?window.getPanoByLocation(e.point):Q("PANORAMA"),delete BMapGL._rd["_cbk"+n]},K("PANORAMA","BMapGL._rd._cbk"+n)}})),e.on(d.SIZE_CHANGED,(function(){t.op.updateAnglePerPixel(),t.panoGLRender.resize(),t.panoGLRender.updateProjectionMatrix(e.camera),t.panoGLRender.update()})),e.on(d.THUMB_LOADED,(function(){t.panoGLRender.onThumbLoaded(),t.panoGLRender.update()})),e.on(d.OVERLAY_ADD,(function(e){t.panoGLRender.overlayManager.handleAdd(e)})),e.on(d.OVERLAY_REMOVE,(function(e){t.panoGLRender.overlayManager.handleRemove(e)})),e.on(d.OVERLAYS_CLEAR,(function(){t.panoGLRender.overlayManager.destroy()})),e.on(d.LINK_VISIBLE_CHANGE,(function(e){"boolean"==typeof e.value&&(t.panoGLRender.safeCall("PanoLinkRender","setVisible",[e.value]),t.pano.dispatchEvent(d.REFRESH))})),e.on(d.DESTROY,(function(){t.op.destroy(),t.resizeOb&&t.resizeOb.disconnect(),t.checkSizeTimer&&clearInterval(t.checkSizeTimer),t.panoGLRender.renderer.forceContextLoss(),e.canvas.removeEventListener("webglcontextlost",t.onWebGLContextLost,!1)}));var n=v.isFirefox?"DOMMouseScroll":"mousewheel",r=new Date;e._svContainer.addEventListener(n,(function(t){if(e.opts.enableScrollWheelZoom&&e.opts.visible){var n=new Date;if(n-r<400)return;r=n;var i=-t.detail/3||t.wheelDelta/120,o=e.getZoom()+i;e.setZoom(o),t.preventDefault()}}))},e.getImgZoom=function(){return this.pano.calcDisplayZoom().imgZoom},e.handleContextStatus=function(){this.pano.canvas.addEventListener("webglcontextlost",this.onWebGLContextLost,!1)},e.onWebGLContextLost=function(t){t.preventDefault(),setTimeout((function(){window.location.reload()}),200)},t}();function aa(t,e,n){t.addEventListener(e,n,!1)}var sa=function(t){function e(e,n){var r;(r=t.call(this)||this).panoData=null,r.opts=void 0,r.useAnimation=!1,r.backupUseAnimation=r.useAnimation,r.animationType="",r.fisheye=!1,r.canvas=void 0,r.camera=void 0,r.renderer=void 0,r.gl=void 0,r.scene=void 0,r.cameraNoFix=void 0,r.renders=void 0,r.closeBtn=null,r.navigator=null,r._container=void 0,r._pov={heading:0,pitch:0},r._id=null,r._position=null,r._zoom=2,r._displayZoomResultsCache={},r._svContainer=void 0,r._eventManager=void 0,r._panes=void 0,r.addCloseButton=function(t){var e=r.closeBtn=document.createElement("div");e.className="pano_close",e.style.cssText=["position:absolute","right:10px","top:10px","padding: 5px 8px;","cursor:pointer","border-radius: 4px","font-size: 14px","background-color: rgba(0,0,0,.55)","z-index: 99","color: #fff"].join(";"),e.innerText="关闭",e.title="退出全景",e.onclick=function(){r.hide(),t&&t()},r._svContainer.appendChild(e)},r.getContainer=function(){return r._container},r.getContainerSize=function(){var t=r._container;return new l(t.clientWidth,t.clientHeight)},r.getPanes=function(){return r._panes},r.show=function(){r.opts.visible=!0,w.show(r._svContainer)},r.hide=function(){r.opts.visible=!1,w.hide(r._svContainer)},r.getZoom=function(){return r._zoom},r.setZoom=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t!==r._zoom&&(t>p.MAX_ZOOM&&(t=p.MAX_ZOOM),ts&&(o=s),o512;)c++,l=360/(2*Math.pow(2,c-2)*h);if(c>a){var f=c-a;l*=Math.pow(2,f),c=a}c1&&void 0!==arguments[1]?arguments[1]:{};r.useAnimation=e.animation||!1,r.fisheye=e.fisheye||!1,r.animationType=e.animationType||"",r.dispatchEvent(d.SET_ID,{id:t})},r.setPosition=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r.useAnimation=e.animation||!1,r.fisheye=e.fisheye||!1,r.animationType=e.animationType||"",r.dispatchEvent(d.SET_POSITION,{point:t})};var o={minImageZoom:p.TILE_MIN_ZOOM,maxImageZoom:p.TILE_MAX_ZOOM,minPitch:p.MIN_PITCH,maxPitch:p.MAX_PITCH,radius:p.RADIUS,tileBaseUrls:p.TILE_BASE_URLS,linksControl:!0,navigationControl:!0,enableScrollWheelZoom:!0,enableCapture:!1,visible:!0};r.opts=Object.assign({},o,n);var s="string"==typeof e?document.querySelector(e):e;if(!s)throw new Error("全景引擎宿主容器不存在");return r._container=s,r._init(),r}c(e,t);var n=e.prototype;return n.getPosition=function(){return this.position},n.setOptions=function(t){var e;for(e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=!0;if("object"!==i(t[e])&&(n=t[e]!==this.opts[e]),this.opts[e]=t[e],!n)continue;switch(e){case"linksControl":this.dispatchEvent(d.LINK_VISIBLE_CHANGE,{value:t[e]});break;case"navigationControl":var r=!!t[e],o=this.navigator;r?o.show():o.hide()}}},n.capture=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.canvas){var e=this.canvas,n=t.quality||.8,r=t.type||"image/jpeg",i=e.toDataURL(r,n);return i}},n.addOverlay=function(t){this.dispatchEvent(d.OVERLAY_ADD,t)},n.removeOverlay=function(t){this.dispatchEvent(d.OVERLAY_REMOVE,t)},n.clearOverlays=function(){this.dispatchEvent(d.OVERLAYS_CLEAR)},n.destroy=function(){this.dispatchEvent(d.DESTROY)},n._init=function(){this._createDoms(),this.navigator=function(t){function e(t){this._initialize(t)}return m(e.prototype,{_initialize:function(t){this._pano=t,this.imgPath=t.opts.imgPath||"//api0.map.bdimg.com/images/",this._zoomInEnabled=!0,this._zoomOutEnabled=!0,this._render(),this._bind()},_render:function(){this._container=w.create("div");var t=this._container.style;t.position="absolute",t.left="10px",t.top="10px",t.zIndex=99;var e=this._container;e.innerHTML=this._generateHtml(),v.isPc?(this._panBtnContainer=e.children[2],this._panBtns=[this._panBtnContainer.children[0],this._panBtnContainer.children[1],this._panBtnContainer.children[2],this._panBtnContainer.children[3]],this._svgDirGroup=e.children[1].childNodes[0],this._zoomContainer=e.children[3]):v.isMobile&&(this._zoomContainer=e.children[0]),this._btnZoomIn=this._zoomContainer.children[0],this._btnZoomOut=this._zoomContainer.children[1],v.isMobile&&(this._zoomContainer.style.left=this._zoomContainer.style.top="0",this._zoomContainer.style.width="36px",this._zoomContainer.style.height="78px",this._btnZoomIn.style.width=this._btnZoomOut.style.width="33px",this._btnZoomIn.style.height=this._btnZoomOut.style.height="36px",this._btnZoomOut.style.top="37.5px"),this._pano.getZoom()>=p.MAX_ZOOM&&this._setZoomBtnEnabled("zoomIn",!1),this._pano.getZoom()<=p.MIN_ZOOM&&this._setZoomBtnEnabled("zoomOut",!1),this._pano._svContainer.appendChild(e)},_generateHtml:function(){var t=[];return v.isPc&&(t.push(this._generatePanHtml()),t.push(this._generateDirHtml()),t.push(this._generatePanBtnHtml())),t.push(this._generateZoomContainerHtml()),t.join("")},_generateDirHtml:function(){return''},_generatePanHtml:function(){return'
'},_generatePanBtnHtml:function(){return'
'},_generateZoomContainerHtml:function(){var t="background-image:url('"+this.imgPath+"st-navictrl.png');background-repeat:no-repeat;background-position:-74px 0;";return v.isMobile&&(t="background-image:url('"+this.imgPath+"st-navictrl-hd.png');background-repeat:no-repeat;background-position:0 0;background-size:180px 78px;"),'
'},_bind:function(){var t=this._pano,e=this;if(v.isPc){aa(this._panBtns[0],"click",(function(){var e=t.getPov();t.setPov({heading:e.heading,pitch:e.pitch+30},{animation:!0})})),aa(this._panBtns[1],"click",(function(){var e=t.getPov();t.setPov({heading:e.heading-45,pitch:e.pitch},{animation:!0})})),aa(this._panBtns[2],"click",(function(){var e=t.getPov();t.setPov({heading:e.heading+45,pitch:e.pitch},{animation:!0})})),aa(this._panBtns[3],"click",(function(){var e=t.getPov();t.setPov({heading:e.heading,pitch:e.pitch-30},{animation:!0})}));for(var n=0;n=p.MAX_ZOOM?e._setZoomBtnEnabled("zoomIn",!1):t.getZoom()<=p.MIN_ZOOM?e._setZoomBtnEnabled("zoomOut",!1):(e._setZoomBtnEnabled("zoomIn",!0),e._setZoomBtnEnabled("zoomOut",!0))}))},_redrawZoomBtn:function(t,e){t&&(v.isMobile&&(e=(e+74)/24*36),this._zoomContainer.style.backgroundPosition=e+"px 0")},show:function(){this._container.style.display=""},hide:function(){this._container.style.display="none"},_calcAngle:function(t){var e=(t=window.event||t).pageX||t.clientX,n=t.pageY||t.clientY,r=this._pano.getContainer().getBoundingClientRect();e=e-r.left-50,n=-(n-r.top-50);var i=Math.atan2(n,e)/Math.PI*180;return i<90?90-i:450-i},_setZoomBtnEnabled:function(t,e){if("zoomIn"===t)if(e){this._zoomInEnabled=!0,this._btnZoomIn.style.cursor="pointer";var n=-74;v.isMobile&&(n=0),this._zoomContainer.style.backgroundPosition=n+"px 0"}else{this._zoomInEnabled=!1,this._btnZoomIn.style.cursor="";var r=-170;v.isMobile&&(r=-144),this._zoomContainer.style.backgroundPosition=r+"px 0"}if("zoomOut"===t)if(e){this._zoomOutEnabled=!0,this._btnZoomOut.style.cursor="pointer";var i=-74;v.isMobile&&(i=0),this._zoomContainer.style.backgroundPosition=i+"px 0"}else{this._zoomOutEnabled=!1,this._btnZoomOut.style.cursor="";var o=-146;v.isMobile&&(o=-108),this._zoomContainer.style.backgroundPosition=o+"px 0"}}}),new e(t)}(this),this._eventManager=new oa(this)},n._createDoms=function(){var t=this._container,e=w.create("div"),n=e.style;n.overflow="hidden",n.position="absolute",n.zIndex="20",n.top=n.left="0px",n.height=n.width="100%",n.backgroundColor="#e5e3df",n.display="none",n.cursor="grab",e.addEventListener("mousedown",(function(){return n.cursor="grabbing"})),e.addEventListener("mouseup",(function(){return n.cursor="grab"})),this._svContainer=e,this._panes={tileLayer:this._createContainer("1"),maskLayer:this._createContainer("2"),linksLayer:this._createContainer("3"),overlayLayer:this._createContainer("4"),effectLayer:this._createContainer("5")},e.appendChild(this._panes.tileLayer),e.appendChild(this._panes.linksLayer),e.appendChild(this._panes.overlayLayer),e.appendChild(this._panes.effectLayer),b()||(e.appendChild(this._panes.maskLayer),this._panes.maskLayer.style.width="".concat(t.clientWidth,"px"),this._panes.maskLayer.style.height="".concat(t.clientHeight,"px"),this._panes.maskLayer.style.overflow="hidden"),t.appendChild(e),"absolute"!==w.getCurrentStyle(t).position&&(t.style.position="relative")},n._createContainer=function(t){var e=w.create("div"),n=e.style;return n.position="absolute",n.top=n.left="0",n.zIndex=t||"0",e},n.calcMobileFovy=function(t){var e=this.getContainerSize(),n=e.width,r=e.height,i=240/Math.pow(2,t),o=n/2/Math.tan(g(i/2)),a=Math.atan2(r/2,o);return 2*y(a)},n.calcPCFovy=function(t){return 90-15*(t-1)},o(e,[{key:"imageZoom",get:function(){return this.calcDisplayZoom().imgZoom}},{key:"panoId",get:function(){return this.panoData?this.panoData.panoId:""}},{key:"panoNorthDir",get:function(){return this.panoData?this.panoData.northDir:0}},{key:"position",get:function(){return this.panoData&&"number"==typeof this.panoData.panoX&&"number"==typeof this.panoData.panoY?new f(this.panoData.panoX,this.panoData.panoY):null}}]),e}(Or),ua={dom:null,anchor:null,width:null,height:null,altitude:2,sphereZ:null,useUV:!1},ha=function(t){function e(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n=t.call(this)||this).visible=!0,n.worldCoord=void 0,n.pov=void 0,n.id=n.genId(),n._pano=void 0,n.lastPanoPosition=null,n.initialized=!1,n.position=void 0,n.options=void 0,n.position=e,n.options=Object.assign({},ua,r),n.pov=null,n}c(e,t);var n=e.prototype;return n.getPov=function(){return this.pov},n.genId=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return Number("".concat(Math.random().toString().substr(3,t)).concat(Date.now())).toString(36)},n.init=function(t){t&&!this.initialized&&(this._pano=t,this.lastPanoPosition=this._pano.position,this.worldCoord=this.options.useUV?this.calcCoordsByUV():this.calcCoordsByMC(),this.worldCoord&&(this.initialized=!0,this.add(),this.draw()))},n.calcCoordsByMC=function(){var t=this._pano.position;if(t&&this.position){var e,n=this.position,r=n.lng-t.lng,i=n.lat-t.lat,o=Math.atan2(r,i);o<0&&(o+=2*Math.PI),o=Math.round(y(o));var a=500,s=this.options,u=s.sphereZ,h=s.altitude;null===u?e=25*h:(e=u||0,a=Math.sqrt(Math.pow(r,2)+Math.pow(i,2)+Math.pow(e,2)));var c=y(Math.asin(e/a));c=c>90?90:c<-90?-90:c;var l=_(o+this._pano.panoNorthDir),f=this.radius,d=Math.cos(g(c))*f;d=Math.round(100*d)/100;var p=Math.cos(g(l))*d,v=Math.sin(g(c))*f,m=Math.sin(g(l))*d;return this.pov={heading:o,pitch:c},Vt(p,v,m)}},n.calcCoordsByUV=function(){if(this.position){var t=this.radius,e=this.position,n=xi(e,2),r=n[0],i=n[1],o=2*r*Math.PI,a=(i-.5)*Math.PI,s=Math.cos(a)*Math.cos(o)*t,u=Math.sin(a)*t,h=Math.cos(a)*Math.sin(o)*t;return this.pov={heading:_(y(o)-this._pano.panoNorthDir),pitch:y(a)},Vt(s,u,h)}},n.add=function(){var t=this.options,e=t.width,n=t.height;if(this.dom){var r=this._pano,i=this.dom;i.style.position="absolute",r.getPanes().overlayLayer.appendChild(i),"number"!=typeof e&&(this.options.width=i.clientWidth),"number"!=typeof n&&(this.options.height=i.clientHeight),r.dispatchEvent({type:"onoverlaydomadded",overlay:this})}},n.remove=function(){var t=this.dom;t&&t.parentNode&&t.parentNode.removeChild(t)},n.povToPointGL=function(){if(!this.worldCoord)return null;var t=this._pano,e=t.camera,n=t.getContainerSize(),r=n.width,i=n.height;return po(e,this.worldCoord,r,i)},n.draw=function(){if(this.initialized&&this.visible&&this._pano&&this._pano.panoData&&this.dom){var t=this.lastPanoPosition,e=this._pano.position;t.lng===e.lng&&t.lat===e.lat||(this.lastPanoPosition=e,this.worldCoord=this.options.useUV?this.calcCoordsByUV():this.calcCoordsByMC());var n=this.dom,r=this.povToPointGL();if(n.style.visibility="hidden",r){var i=this.calcAnchor(),o="".concat(r[0]-i.width,"px"),a="".concat(r[1]-i.height,"px");if(isNaN(r[0])||isNaN(r[1]))return;n.style.visibility="visible",n.style.webkitTransform="translate(".concat(o,", ").concat(a,")"),n.style.transform="translate(".concat(o,", ").concat(a,")")}}},n.handleClick=function(){this.dispatchEvent("click")},n.calcAnchor=function(){var t=this.options,e=t.anchor,n=t.width,r=void 0===n?0:n,i=t.height;return e||new l(r/2,(void 0===i?0:i)/2)},n.show=function(){this.visible=!0,this.dom&&(this.dom.style.display="")},n.hide=function(){this.visible=!1,this.dom&&(this.dom.style.display="none")},o(e,[{key:"radius",get:function(){return this._pano?this._pano.opts.radius:0}},{key:"dom",get:function(){return this.options.dom}}]),e}(Or),ca=function(t){function e(e,n){var r=n.position,i=n.altitude,o=void 0===i?2:i,a=n.costomStyle,s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=document.createElement("div"),r={backgroundColor:"rgba(29, 29, 29, 0.8)",fontSize:"14px",padding:"7px 14px",height:"19px",color:"#fff",whiteSpace:"nowrap",borderRadius:"4px"};return m(n.style,r,e),n.innerText=t,n}(e,void 0===a?{}:a);return t.call(this,r,{dom:s,altitude:o})||this}return c(e,t),e}(ha);t.Converters=mo,t.Engines=Qi,t.EventType=d,t.PanoLabel=ca,t.PanoOverlay=ha,t.PanoramaService=function(){var t=this;this.getPanoById=function(e,n){var r;r="".concat(tt.SERVICE_URL,"?qt=sdata&sid=").concat(e,"&").concat($("/")),t.request(r).then((function(t){n&&n(t)})).catch((function(t){n&&n(null)}))},this.getPanoByLocation=function(e,n,r){var i;i="".concat(tt.SERVICE_URL,"?qt=qsdata&x=").concat(e.lng,"&y=").concat(e.lat).concat(n?"&r="+n:"","&action=1&").concat($("/")),t.request(i).then((function(t){r&&r(t)})).catch((function(t){r&&r(null)}))},this.request=function(t){return A(t,{},{jsonp:"fn"})}},t.Point=f,t.getPanoControl=function(t,e){var n,r,i,o=(e=e||{}).imgPath||"//api.map.baidu.com/images/";function a(e){e.call(this),this.defaultAnchor=t.ControlAnchor.TOP_RIGHT,this.defaultOffset=new t.Size(10,10),this._isOn=!1}return n=a,r=t.Control,(i=Object.create(r.prototype)).constructor=n,n.prototype=i,m(a.prototype,{initialize:function(t){return this._map=t,this._render(),this._bind(),this._container},_render:function(){var t=this,n=w.create("div");n.innerHTML='全景',n.title="进入全景",m(n.style,{width:"49px",height:"51px",color:"#565656",background:'url("'.concat(o,'st-control.png")'),position:"absolute",cursor:"pointer",fontFamily:"arial,sans-serif",fontSize:"13px",textAlign:"center",boxShadow:"0px 0px 3px rgba(0, 0, 0, 0.3)",MozBoxShadow:"0px 0px 3px rgba(0, 0, 0, 0.3)",WebkitBoxShadow:"0px 0px 3px rgba(0, 0, 0, 0.3)"}),this._container=n;var r=this._map.getContainer();r.appendChild(n);var i={visible:!1};e.imgPath&&(i.imgPath=[e.imgPath]),e.tileBaseUrl&&(i.tileBaseUrls=[e.tileBaseUrl]),this._pano=new sa(r,i),this._pano.addCloseButton((function(){t.isMapEnableWheelZoom&&t._map.enableScrollWheelZoom()}));var a=this._scout=w.create("div");m(a.style,{position:"absolute",width:"24px",height:"41px",cursor:"pointer",backgroundImage:'url("'.concat(o,'st-scout.png")'),backgroundRepeat:"no-repeat",backgroundPosition:"-24px 0",overflow:"hidden",display:"none",zIndex:11}),r.appendChild(a);var s=this._infoWindow=w.create("div");m(s.style,{position:"absolute",width:"112px",height:"119px",backgroundImage:'url("'.concat(o,'st-infowindow.gif")'),backgroundRepeat:"no-repeat",backgroundPosition:"0 0",display:"none",cursor:"pointer",zIndex:12});var u=this._thumb=w.create("img");s.appendChild(u),u.src=o+"st-noresult.png",m(u.style,{width:"100px",height:"75px",left:"6px",top:"6px",position:"absolute"});var h=this._stDescription=w.create("div");m(h.style,{position:"absolute",top:"85px",fontFamily:"arial,sans-serif",fontSize:"13px",paddingLeft:"6px"}),s.appendChild(h),r.appendChild(s)},_updateView:function(){var t=this._container.style;this._isOn||this._isOver?(t.backgroundPosition="-49px 0",t.color="#fff"):(t.backgroundPosition="0 0",t.color="#565656")},_bind:function(){var n=this;this._pano.on("dataload",(function(t){var r=t.data;r?(n._currentSvId=r.panoId,e.tileBaseUrl?n._thumb.src="".concat(e.tileBaseUrl,"?&sid=").concat(r.panoId,"&pos=0_0&z=0"):n._thumb.src="//apisv0.bdimg.com/?qt=pdata&sid=".concat(r.panoId)+"&pos=0_0&z=0&from=H5&".concat($("/")),n._stDescription.innerHTML=r.roadName):(n._currentSvId=null,n._thumb.src=o+"st-noresult.png",n._stDescription.innerHTML="")}));var r=this;v.isPc&&(this._container.addEventListener("mouseover",(function(){r._isOver=!0,r._updateView()})),this._container.addEventListener("mouseout",(function(){r._isOver=!1,r._updateView()}))),this._container.addEventListener("click",(function(){r._isOn?r._close():r._open()})),this._map.getContainer().addEventListener("mousemove",(function(e){if(r._isOn){var n,i;if(e=window.event||e,r._map.container&&r._map.container.getBoundingClientRect){var a=r._map.container.getBoundingClientRect(),s=e.clientX,u=e.clientY;n=new qo(s-a.left,u-a.top),i=r._map.pixelToPoint(n)}else{var h=e.pageX||e.clientX,c=e.pageY||e.clientY,l=function(t){for(var e={left:0,top:0};t&&t.offsetParent;)e.left+=t.offsetLeft,e.top+=t.offsetTop,t=t.offsetParent;return e}(r._map.container);n=new qo(h-l.left,c-l.top),i=r._map.pixelToPoint(n)}if(""!==r._scout.style.display&&v.isPc&&(r._scout.style.display="",r._infoWindow.style.display=""),r._scout.style.left=n.x-12+"px",r._scout.style.top=n.y-41-2+"px",r._prePixel=r._curPixel,r._curPixel=n,r._prePixel){var f=n.x-r._prePixel.x;f>0?r._scout.style.backgroundPosition="-48px 0":f<0&&(r._scout.style.backgroundPosition="0 0")}r._curPixel.y<170?r._infoStatus=2:r._infoStatus=1,r._curPixel.x<66&&(r._infoStatus=3),r._curPixel.x>r._map.getSize().width-56-10&&(r._infoStatus=4);var d=1===r._infoStatus||2===r._infoStatus?112:126,p=1===r._infoStatus||2===r._infoStatus?119:105;1!==r._infoStatus&&2!==r._infoStatus||(r._infoWindow.style.left=r._curPixel.x-Math.round(d/2)+"px",1===r._infoStatus?(r._infoWindow.style.top=r._curPixel.y-p-42+"px",r._infoWindow.style.backgroundPosition="0 0",r._thumb.style.top="6px",r._thumb.style.bottom="",r._stDescription.style.top="85px",r._stDescription.style.bottom=""):(r._infoWindow.style.top=r._curPixel.y+2+"px",r._infoWindow.style.backgroundPosition="-112px 0",r._thumb.style.top="",r._thumb.style.bottom="6px",r._stDescription.style.top="",r._stDescription.style.bottom="85px"),r._infoWindow.style.width="112px",r._infoWindow.style.height="119px",r._thumb.style.left="6px",r._stDescription.style.left="0"),3!==r._infoStatus&&4!==r._infoStatus||(r._infoWindow.style.top=r._curPixel.y-Math.round(p/2)-20+"px",3===r._infoStatus?(r._infoWindow.style.left=r._curPixel.x+12+"px",r._infoWindow.style.backgroundPosition="0 -119px",r._thumb.style.left="20px",r._stDescription.style.left="14px"):(r._infoWindow.style.left=r._curPixel.x-12-d+"px",r._infoWindow.style.backgroundPosition="-126px -119px",r._thumb.style.left="6px",r._stDescription.style.left="0"),r._infoWindow.style.width="126px",r._infoWindow.style.height="105px"),r._infoWindow.style.backgroundImage='url("'.concat(o,'st-infowindow.gif")'),r._timerId&&(clearTimeout(r._timerId),r._timerId=null),r._timerId=setTimeout((function(){r._currentPoint=i,r._scout.style.backgroundPosition="-24px 0";var e=r._map.lnglatToMercator(i.lng,i.lat);r._pano.setPosition(new t.Point(e[0],e[1]))}),200)}})),this._map.addEventListener("click",(function(t){r._isOn&&v.isMobile&&(r._pano.setPosition(t.point),r._pano.show(),r._close()),r._isOn&&r._currentSvId&&(r._pano.setId(r._currentSvId),r._pano.show(),r._map.config.enableWheelZoom&&(r._map.disableScrollWheelZoom(),r.isMapEnableWheelZoom=!0),r._close())}))},_open:function(){this._isOn||(this._isOn=!0,this._map.addTileLayer(this._panoCoverageLayer),v.isPc&&(this._preDefaultCursor=this._map.getDefaultCursor(),this._preDraggingCursor=this._map.getDraggingCursor(),this._map.setDefaultCursor("pointer"),this._map.setDraggingCursor("pointer"))),this._updateView()},_close:function(){this._isOn&&(this._map.removeTileLayer(this._panoCoverageLayer),v.isPc&&(this._scout.style.display="none",this._infoWindow.style.display="none",this._map.setDefaultCursor(this._preDefaultCursor),this._map.setDraggingCursor(this._preDraggingCursor)),this._isOn=!1),this._updateView()}}),new a(t.Control)},t.getStreetViewCoverageLayer=function(t){var e=new t.TileLayer({transparentPng:!0,dataType:1,cacheSize:32});return e.zIndex=110,e.getTilesUrl=window.PANORAMA_URL?function(t,e){var n=window.PANORAMA_URL+"/tile",r=t.x,i=t.y;return window.BMAPGL_84&&(i=Math.pow(2,e)-i-1),"".concat(n,"?customid=panorama&x=").concat(r,"&y=").concat(i,"&z=").concat(e,"&type=WGS84")}:function(t,e){var n=["//apisv0.bdimg.com/","//apisv1.bdimg.com/"],r=(Math.abs(t.x)+Math.abs(t.y))%n.length;return"".concat(n[r],"?udt=").concat("20150114","&qt=tile&styles=").concat("pl","&x=").concat(t.x,"&y=").concat(t.y,"&z=").concat(e).replace(/-(\d+)/gi,"M$1")+"&"+$("/",{isCounter:!1})},e},t.init=function(t,e){return new sa(t,e)},Object.defineProperty(t,"__esModule",{value:!0})}(this.Pano=this.Pano||{}); window.BMapGL=window.BMapGL||{};(function(bS,gi){var fK=fK||{version:"20150702",emptyFn:function(){}};(function(){fK._log=[];var i=0;var C={};fK.BaseClass=function(lO){C[(this.hashCode=(lO||fK.BaseClass.guid()))]=this;if(!lO&&typeof iF!=="undefined"&&iF.sendMessage){var T=this.toString();if(!T||T.indexOf("[object")===0){T=this._className}if(T){iF.sendMessage(T)}}};fK.BaseClass.guid=function(){return"mz_"+(i++).toString(36)};fK.BaseClass.create=function(){var T=new fK.BaseClass();T.decontrol();return T};var e=fK.instance=fK.I=function(T){return C[T]};fK.BaseClass.prototype.dispose=function(){if(this.hashCode){delete C[this.hashCode]}for(var T in this){if(typeof this[T]!="function"){delete this[T]}}};fK.BaseClass.prototype.getHashCode=function(){if(!this.hashCode){C[(this.hashCode=fK.BaseClass.guid())]=this}return this.hashCode};fK.BaseClass.prototype.decontrol=function(){delete C[this.hashCode]};fK.BaseClass.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};fK.BaseClass.prototype._wlog=function(lO,lP){var T=fK._log;if(T.length>100){T.reverse().length=50;T.reverse()}T[T.length]="["+lO+"]["+(this._className||"Object")+" "+this.hashCode+"] "+lP}})();Function.prototype.inherits=function(lO,T){var e,lP,lR=this.prototype,lQ=function(){};lQ.prototype=lO.prototype;lP=this.prototype=new lQ();if(typeof(T)=="string"){lP._className=T}for(e in lR){lP[e]=lR[e]}this.prototype.constructor=lR.constructor;lR=lQ=null;return lP};fK.BaseEvent=function(e,i){this.type=e;this.returnValue=true;this.target=i||null;this.currentTarget=this.srcElement=null;this.cancelBubble=false;this.domEvent=null};fK.BaseClass.prototype.on=fK.BaseClass.prototype.addEventListener=function(C,i){if(typeof i!=="function"){return this._wlog("error","addEventListener:"+i+" is not a function")}if(!this._listeners){this._listeners={}}var e=this._listeners;if(C.indexOf("on")!==0){C="on"+C}if(typeof e[C]!=="object"){e[C]={}}var T=i.hashCode||fK.BaseClass.guid();i.hashCode=T;if(e[C][T]){this._wlog("warning","repeat key:"+T)}e[C][T]=i};fK.BaseClass.prototype.off=fK.BaseClass.prototype.removeEventListener=function(C,i){if(typeof i=="function"){i=i.hashCode}else{if(typeof i!=="string"&&typeof i!=="undefined"){return}}if(!this._listeners){this._listeners={}}if(C.indexOf("on")!=0){C="on"+C}var e=this._listeners;if(!e[C]){return}if(i===undefined){e[C]={};return}if(e[C][i]){delete e[C][i]}};fK.BaseClass.prototype.fire=fK.BaseClass.prototype.dispatchEvent=function(T){if(!this._listeners){this._listeners={}}var C,e=this._listeners,lO=T.type;T.target=T.srcElement=T.target||T.srcElement||this;T.currentTarget=this;if(typeof this[lO]=="function"){this[lO](T)}if(typeof e[lO]=="object"){for(C in e[lO]){if(typeof e[lO][C]=="function"){e[lO][C].call(this,T)}}}return T.returnValue};fK.BaseEvent.prototype.inherit=function(C){var i=this;this.domEvent=C=window.event||C;i.clientX=C.clientX||C.pageX;i.clientY=C.clientY||C.pageY;i.offsetX=C.offsetX||C.layerX;i.offsetY=C.offsetY||C.layerY;i.screenX=C.screenX;i.screenY=C.screenY;i.ctrlKey=C.ctrlKey||C.metaKey;i.shiftKey=C.shiftKey;i.altKey=C.altKey;return i};fK.Browser=(function(){var C=navigator.userAgent;var lO=0;var e=0;var lP=0;var i=0;var lT=0;var lR=0;var lS=0;var lQ=0;var T=0;var lU=0;if(typeof window.opera==="object"&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(C)){lP=parseFloat(RegExp.$2)}else{if(/OPR(\/(\d+)(\..?)?)/.test(C)){lP=parseInt(RegExp.$2,10)}else{if(/Edge\/((\d+)\.\d+)/.test(C)){lO=parseInt(RegExp.$2,10)}else{if(/MSIE (\d+(\.\d+)?)/.test(C)){e=parseFloat(RegExp.$1)}else{if(C.indexOf("Trident")>-1&&/rv:(\d+(\.\d+)?)/.test(C)){e=parseInt(RegExp.$1,10)}else{if(/Firefox(\s|\/)(\d+(\.\d+)?)/.test(C)){lT=parseFloat(RegExp.$2)}else{if(navigator.vendor==="Netscape"&&/Netscape(\s|\/)(\d+(\.\d+)?)/.test(C)){lS=parseFloat(RegExp.$2)}else{if(C.indexOf("Safari")>-1&&/Version\/(\d+(\.\d+)?)/.test(C)){i=parseFloat(RegExp.$1)}}}}}}}}if(C.indexOf("Trident")>-1&&/Trident\/(\d+(\.\d+)?)/.test(C)){lQ=parseInt(RegExp.$1,10)}else{if(!e&&!lO&&C.indexOf("Gecko")>-1&&C.indexOf("KHTML")===-1&&/rv\:(\d+(\.\d+)?)/.test(C)){T=parseFloat(RegExp.$1)}else{if(!lO&&/chrome\/(\d+(\.\d+)?)/i.test(C)){lR=parseFloat(RegExp.$1)}else{if(!lO&&/AppleWebKit\/(\d+(\.\d+)?)/.test(C)){lU=parseInt(RegExp.$1,10)}}}}var lV={edge:lO,ie:e,firefox:lT,netscape:lS,opera:lP,safari:i,chrome:lR,gecko:T,trident:lQ,webkit:lU};return lV})();window.FeBrowser=fK.Browser;fK.Dom={};fK.Dom.createDom=function(i,e){if(fK.isIE&&e&&e.name){i="<"+i+' name="'+fK.String.escapeHTML(e.name)+'">'}var C=document.createElement(i);if(e){fK.Dom.setProperties(C,e)}return C};fK.Dom.getOffset=function(T){var lQ=fK.Dom.getOwnerDocument(T);var lP=fK.isGecko>0&&lQ.getBoxObjectFor&&fK.Dom.getStyle(T,"position")=="absolute"&&(T.style.top===""||T.style.left==="");var lR={left:0,top:0};var i=(fK.isIE&&!fK.isStrict)?lQ.body:lQ.documentElement;if(T==i){return lR}var C=null;var lO;if(T.getBoundingClientRect){lO=T.getBoundingClientRect();lR.left=lO.left+Math.max(lQ.documentElement.scrollLeft,lQ.body.scrollLeft);lR.top=lO.top+Math.max(lQ.documentElement.scrollTop,lQ.body.scrollTop);lR.left-=lQ.documentElement.clientLeft;lR.top-=lQ.documentElement.clientTop;if(fK.isIE&&!fK.isStrict){lR.left-=2;lR.top-=2}}else{if(lQ.getBoxObjectFor&&!lP){lO=lQ.getBoxObjectFor(T);var e=lQ.getBoxObjectFor(i);lR.left=lO.screenX-e.screenX;lR.top=lO.screenY-e.screenY}else{C=T;do{lR.left+=C.offsetLeft;lR.top+=C.offsetTop;if(fK.isWebkit>0&&fK.Dom.getStyle(C,"position")=="fixed"){lR.left+=lQ.body.scrollLeft;lR.top+=lQ.body.scrollTop;break}C=C.offsetParent}while(C&&C!=T);if(fK.isOpera>0||(fK.isWebkit>0&&fK.Dom.getStyle(T,"position")=="absolute")){lR.top-=lQ.body.offsetTop}C=T.offsetParent;while(C&&C!=lQ.body){lR.left-=C.scrollLeft;if(!fK.isOpera||C.tagName!="TR"){lR.top-=C.scrollTop}C=C.offsetParent}}}return lR};fK.Dom.getOwnerDocument=function(e){return e.nodeType==9?e:e.ownerDocument||e.document};fK.Dom.setProperties=function(i,e){fK.each(e,function(T,C){fK.Dom._setProperty(i,C,T)})};fK.Dom._setProperty=function(i,e,C){if(e=="style"){i.style.cssText=C}else{if(e=="class"){i.className=C}else{if(e=="for"){i.htmlFor=C}else{if(e in fK.Dom._DIRECT_ATTRIBUTE_MAP){i.setAttribute(fK.Dom._DIRECT_ATTRIBUTE_MAP[e],C)}else{i[e]=C}}}}};fK.Dom._DIRECT_ATTRIBUTE_MAP={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder"};fK.G=function(){for(var C=[],T=arguments.length-1;T>-1;T--){var lO=arguments[T];C[T]=null;if(typeof lO=="object"&&lO&&lO.dom){C[T]=lO.dom}else{if((typeof lO=="object"&&lO&&lO.tagName)||lO==window||lO==document){C[T]=lO}else{if(typeof lO=="string"&&(lO=document.getElementById(lO))){C[T]=lO}}}}return C.length<2?C[0]:C};fK.ac=function(e,i){if(!(e=this.G(e))){return}i=this.trim(i);if(!new RegExp("(^| )"+i.replace(/(\W)/g,"\\$1")+"( |$)").test(e.className)){e.className=e.className.split(/\s+/).concat(i).join(" ")}};fK.addClassName=fK.ac;fK.each=function(lP,e){if(typeof e!="function"){return lP}if(lP){if(lP.length===undefined){for(var C in lP){e.call(lP[C],lP[C],C)}}else{for(var T=0,lO=lP.length;T0&&!window.opera){/MSIE (\d+(\.\d+)?)/.test(navigator.userAgent);fK.isIE=parseFloat(RegExp.$1)}})();fK.rc=function(e,i){if(!(e=this.G(e))){return}i=this.trim(i);var C=e.className.replace(new RegExp("(^| +)"+i.replace(/(\W)/g,"\\$1")+"( +|$)","g"),"$2");if(e.className!=C){e.className=C}};fK.removeClassName=fK.rc;fK.show=function(){this.each(arguments,function(e){if(e=fK.G(e)){e.style.display=""}})};fK.trim=function(e){return e.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};fK.getElementsByClassName=function(e,i){if(e.getElementsByClassName){return e.getElementsByClassName(i)}else{return(function C(lU,lS){if(lS==null){lS=document}var lR=[],lQ=lS.getElementsByTagName("*"),T=lQ.length,lT=new RegExp("(^|\\s)"+lU+"(\\s|$)"),lP,lO;for(lP=0,lO=0;lP-1};fK.insertHTML=function(T,e,C){T=fK.G(T);if(T===null){return T}var i,lO;if(T.insertAdjacentHTML){T.insertAdjacentHTML(e,C)}else{i=T.ownerDocument.createRange();e=e.toUpperCase();if(e=="AFTERBEGIN"||e=="BEFOREEND"){i.selectNodeContents(T);i.collapse(e=="AFTERBEGIN")}else{lO=e=="BEFOREBEGIN";i[lO?"setStartBefore":"setEndAfter"](T);i.collapse(lO)}i.insertNode(i.createContextualFragment(C))}return T};if(typeof HTMLElement!="undefined"&&HTMLElement.prototype.__lookupGetter__&&!HTMLElement.prototype.__lookupGetter__("children")&&!window.opera){try{HTMLElement.prototype.__defineGetter__("children",function(){for(var C=[],T=0,lP,lO=0,e=this.childNodes.length;lO-1};fK.isEmptyObject=function(C){if(Object.prototype.toString.call(C)==="[object Object]"){for(var e in C){return false}return true}else{return false}};window.BMAPGL_LANGUAGE_ZH="zh";window.BMAPGL_LANGUAGE_EN="en";window.BMAP_LANGUAGE_ZH="zh";window.BMAP_LANGUAGE_EN="en";window.BMAP_LANGUAGE_ZH_TW="zh-TW";window.BMAP_LANGUAGE_ES="es";window.BMAP_LANGUAGE_PT="pt";window.BMAP_LANGUAGE_FR="fr";window.BMAP_LANGUAGE_DE="de";window.BMAP_LANGUAGE_TH="th";window.BMAP_LANGUAGE_JA="ja";window.BMAP_LANGUAGE_KO="ko";window.BMAP_LANGUAGE_TR="tr";window.BMAP_LANGUAGE_IT="it";window.BMAP_LANGUAGE_RU="ru";window.BMAP_LANGUAGE_MS="ms";window.BMAP_LANGUAGE_VI="vi";window.BMAP_LANGUAGE_ID="id";var cz=[];if(window.B_HOST_TILE_ONLINE_URLS&&window.B_HOST_TILE_ONLINE_URLS.length>=4){cz=window.B_HOST_TILE_ONLINE_URLS}var cc=window.location.protocol==="http:"?"http:":"https:";var fe={apiVersion:"gl",urlProtocol:cc,fontFamily:'Arial,Helvetica,"PingFang SC","Hiragino Sans GB",STHeiti,"Microsoft YaHei",Tahoma,sans-serif',mapStyleNameIdPair:{"default":0,"grayed-out":1},gs:{},mapHost:cc+"//map.baidu.com",apiHost:window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]?window._BMapSecurityConfig["serviceHost"]:cc+"//api.map.baidu.com",apiIMG:cc+"//api.map.baidu.com/images",apiBosIMG:cc+"//mapopen-website-wiki.cdn.bcebos.com/jsapi/images",staticHost:cc+"//webmap0.bdimg.com",imgPath:cc+"//webmap0.bdimg.com/image/api/",tileDomain:[cc+"//"+(cz[0]||"apimaponline0.bdimg.com"),cc+"//"+(cz[1]||"apimaponline1.bdimg.com"),cc+"//"+(cz[2]||"apimaponline2.bdimg.com"),cc+"//"+(cz[3]||"apimaponline3.bdimg.com")],enTileDomain:[cc+"//api.map.baidu.com"],apiTestUrl:cc+"//apitest.map.baidu.com",panoTilePath:cc+"//apisv1.bdimg.com/",rasterTilePath:"/tile/",vectorTilePath:"/pvd/",enVectorTilePath:"/api_enpvd",originTilePath:[cc+"//pcor.baidu.com"],stylePath:cc+"//maponline0.bdimg.com/sty/",bosPath:cc+"//mapopen-pub-jsapigl.bj.bcebos.com/assets/images/",getIconSetPath:function(e){var i="map_icons2x/";if(typeof e==="string"&&this.mapStyleNameIdPair[e]>0){i="map_icons2x_"+(this.mapStyleNameIdPair[e]-1)+"/"}return this.stylePath+i},getMapStyleFiles:function(C){var lO=true;if(typeof C==="string"&&C!=="default"){lO=false}var lP=lO?"":"_"+(this.mapStyleNameIdPair[C]-1);var i=bT();var T="udt="+i.udt+"&v="+i.ver;var e=this.stylePath;return[e+"icons_2x"+lP+".js?"+T,e+"fs"+lP+".js?"+T,e+"indoor_fs.js?"+T]},tvc:{ditu:{normal:{version:"088",updateDate:"20250110"},satellite:{version:"009",updateDate:"20250110"},normalTraffic:{version:"081",updateDate:"20250110"},satelliteTraffic:{version:"083",updateDate:"20250110"},mapJS:{version:"104",updateDate:"20250110"},satelliteStreet:{version:"083",updateDate:"20250110"},earthVector:{version:"001",updateDate:"20250110"}},webapp:{high_normal:{version:"001",updateDate:"20250110"},lower_normal:{version:"002",updateDate:"20250110"}},api_for_mobile:{vector:{version:"002",updateDate:"20250110"},vectorIcon:{version:"002",updateDate:"20250110"}}},msv:{mapstyle:{version:"001",updateDate:"20241224"}}};fe.gs[BMAP_LANGUAGE_ZH]="GS(2025)4125";fe.gs[BMAP_LANGUAGE_EN]="GS(2025)0741";fe.getGS=function(e){if(e===BMAP_LANGUAGE_ZH){return"GS(2025)4125"}else{if(e===BMAP_LANGUAGE_EN){return"GS(2025)0741"}else{return"GS(2025)4125"}}};fe.imgResources={blankGIF:fe.staticHost+"/res/litemapapi/v1d1/images/blank.gif?20170501",markerPng:fe.staticHost+"/res/litemapapi/v1d1/images/marker.png?20170501",locPng:fe.staticHost+"/res/litemapapi/v1d1/images/loc.png?20180918",locNewPng:fe.staticHost+"/res/litemapapi/v1d1/images/loc_new.png?20190314",zoomPng:fe.staticHost+"/res/litemapapi/v1d1/images/zoombtn.png?20180918",mapLogoPng:fe.staticHost+"/res/litemapapi/v1d1/images/logo-2x.png?20190226"};var G=fe;var kF="ruler.cur";if(fK.Browser.ie||fK.Browser.edge){fK.extend(G,{distCursor:"url("+G.imgPath+kF+"),crosshair",defaultCursor:"url("+G.imgPath+"openhand.cur),default",draggingCursor:"url("+G.imgPath+"closedhand.cur),move"})}else{if(fK.Browser.firefox){fK.extend(G,{distCursor:"url("+G.imgPath+kF+"),crosshair",defaultCursor:"-moz-grab",draggingCursor:"-moz-grabbing"})}else{if(fK.Browser.chrome||fK.Browser.safari){fK.extend(G,{distCursor:"url("+G.imgPath+kF+") 2 6,crosshair",defaultCursor:"url("+G.imgPath+"openhand.cur) 8 8,default",draggingCursor:"url("+G.imgPath+"closedhand.cur) 8 8,move"});if(fK.Platform.macintosh){G.defaultCursor="-webkit-grab";G.draggingCursor="-webkit-grabbing"}}else{fK.extend(G,{distCursor:"url("+G.imgPath+kF+"),crosshair",defaultCursor:"url("+G.imgPath+"openhand.cur),default",draggingCursor:"url("+G.imgPath+"closedhand.cur),move"})}}}bS=bS||{};bS.version="gl";if(!bS.coordType){bS.coordType="BMAP_COORD_BD09"}if(!bS.apiVersion){bS.apiVersion="gl"}bS._register=[];bS.register=function(e){this._register[this._register.length]=e};bS.guid=1;bS.getGUID=function(e){return(e||"")+bS.guid++};var fy=window.BMAP_AUTHENTIC_KEY||"";function X(e,i,T){var C=new Date();C.setTime(C.getTime()+T*24*60*60*1000);document.cookie=e+"="+escape(i)+";expires="+C.toGMTString()}function bl(e,i){if(localStorage){return localStorage.setItem(e,i)}if(sessionStorage){return sessionStorage.setItem(e,i)}}bS.getSeckeyCid=function(){var i=+new Date();var e=cc+"//dlswbr.baidu.com/heicha/mw/abclite-2063-s.js?_t="+i;hL.load(e,j9)};function j9(){if(window.___abvk){bl("SECKEY_ABVK",window.___abvk)}}window.__abbaidu_2063_cb=function(i){var e=JSON.parse(i);bl("BMAP_SECKEY",e.data)};bS.bmapVerifyCbk=function(lO){if(lO&&lO.popup===1&&lO.error_msg){cW(lO.error_msg,{from:"verify"})}else{if(lO&&lO.error!==0){bS=null;BMapGL=null;var lP="百度未授权使用地图API,可能是因为您提供的密钥不是有效的百度地图开放平台密钥,或此密钥未对本应用的百度地图JavaScriptAPI授权。您可以访问如下网址了解如何获取有效的密钥:https://lbs.baidu.com/apiconsole/key#。";switch(lO.error){case 101:lP="您所使用的密钥ak有问题,不支持jsapi服务,可以访问该网址了解如何获取有效密钥:http://lbsyun.baidu.com/apiconsole/key#。";break;case 102:lP="MCODE参数不存在,mobile类型MCODE参数必需,详情查看:http://lbsyun.baidu.com/apiconsole/key#。";break;case 200:lP="APP不存在,AK有误请检查再重试,详情查看:http://lbsyun.baidu.com/apiconsole/key#。";break;case 201:lP="APP被您禁用啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 202:lP="APP被管理员删除啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 203:lP="APP类型错误,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 210:lP="APP IP校验失败,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 220:lP="APP Referer校验失败。请检查该ak设置的白名单与访问所有的域名是否一致。详情查看:http://lbsyun.baidu.com/apiconsole/key#";break;case 230:lP="APP Mcode码校验失败,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 240:lP="APP服务被禁用了,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 250:lP="该用户不存在... 请登录 https://lbs.baidu.com 的控制台,注册成为开发者申请ak吧。";break;case 251:lP="该用户被自己删除啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情。";break;case 252:lP="该用户被管理员删除啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 了解如何获取有效密钥,或请联系我们了解详情。";break;case 260:lP="您所使用的密钥AK不包含该服务呢,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看服务选择情况,或请联系我们了解详情。";break;case 261:lP="您所使用的密钥AK的该服务被禁用啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看服务选择情况,或请联系我们了解详情。";break;case 401:lP="您所使用的AK并发超限了,请登录 http://lbsyun.baidu.com/cashier/quota#/home 了解详情。";break;case 302:lP="您所使用的AK天配额超限了,请登录 http://lbsyun.baidu.com/cashier/quota#/home 了解详情。";break}alert(lP);var C=document.getElementsByClassName("bmap-container");if(C){for(var T=0;Ti){this._removeOld()}if(!e[C]){e.push(T)}e[C]=T;T._key_=C};jn.prototype.getHitRate=function(){return Math.round(this._totalHitTimes/this._totalGetTimes*1000)/1000};jn.prototype.getData=function(i){var e=this._cache[i];if(e){this._totalHitTimes++}this._totalGetTimes++;return e};jn.prototype.removeData=function(lO){if(this._options.clearCallback){this._options.clearCallback(this._cache[lO])}var C=this._cache;var lP=C[lO];for(var T=0,e=C.length;T=0;lO--){var T=this._cache[lO]._key_;if(!lP[T]){C.splice(lO,1);if(this._options.clearCallback){this._options.clearCallback(C[T])}delete C[T]}}};jn.prototype.getDataCount=function(){return this._cache.length};var iV="B_NORMAL_MAP";var ce="B_EARTH_MAP";var hY="B_SATELLITE_MAP";function ke(){}fK.extend(ke.prototype,{centerAndZoomIn:function(lS,C,lT){var lQ=this;if(!lS&&!C){return}lS=lS||this.centerPoint;C=C||this.zoomLevel;C=this._getProperZoom(C).zoom;if(this.mapType===ce){if(!this._earth){this.mapType=iV;this.temp.originMapType=ce;function lR(){lQ._earth=new bS.Earth(lQ,{showRealSunlight:lQ.config.showRealSunlight,showMilkyway:lQ.config.showMilkyway,earthBackground:lQ.config.earthBackground});lQ._proxyEarthEvents();lQ._changeEarthMapType(ce);fK.extend(lQ,bS.EarthView.prototype);if(!lQ._navigationCtrl&&lQ.config.showControls){lQ._navigationCtrl=new bS.NavigationControl3D(lQ)}delete lQ.temp.originMapType}h6.load("earth",function(){if(bS["FeatureStyle"+lQ.config.style]){lR()}else{lQ.loadMapStyleFiles(function(){lR()})}})}}this.lastLevel=this.zoomLevel||C;this.zoomLevel=C;var lO=new gC("onload");lO.point=lS;lO.zoom=C;this.centerPoint=this.restrictCenter(new c4(lS.lng,lS.lat));if(this.centerPoint.zoom){this.zoomLevel=this.centerPoint.zoom}this.defaultZoomLevel=this.defaultZoomLevel||this.zoomLevel;this.defaultCenter=this.defaultCenter||this.centerPoint;if(!this.loaded&&!(this.temp.originMapType===ce)){var i=this.config.defaultMaxBounds;var lP=new p(i,"baidu",this.mapType);var T=new iE({mapType:this.mapType,copyright:lP,customLayer:false,baseLayer:true,tileTypeName:"web"});T._isInnerLayer=true;this.addTileLayer(T);if(this.mapType===hY&&this._isHybridShow===true){this._addHybirdMap()}}this.dispatchEvent(lO);this.loaded=true;lT=lT||{};lT.callback&&lT.callback()},_setPlatformPosition:function(lT,lS,lW){lW=lW||{};if(lT===0&&lS===0&&!lW.point){return}if(isNaN(lW.initMapOffsetX)){lW.initMapOffsetX=this.offsetX}if(isNaN(lW.initMapOffsetY)){lW.initMapOffsetY=this.offsetY}var lU=lT+lW.initMapOffsetX;var lR=lS+lW.initMapOffsetY;if(lW.point){var i=this.restrictCenter(lW.point);if(!i.equals(this.centerPoint)){this.centerPoint=i.clone();this.fire(new gC("oncenter_changed"))}}else{var T=this.offsetX-lU;var e=this.offsetY-lR;var C=this.getZoomUnits();var lQ=this.centerPoint.lng;var lP=this.centerPoint.lat;var lO=new c4(lQ,lP);this.centerPoint=this.restrictCenter(new c4(lO.lng+T*C,lO.lat-e*C),C);this.fire(new gC("oncenter_changed"));if(this.zoomLevel<10){lU=this.offsetX-(this.centerPoint.lng-lO.lng)/C;lR=this.offsetY+(this.centerPoint.lat-lO.lat)/C}}this.offsetX=lU;this.offsetY=lR;var lV=this.platform.style;lV.left=lU+"px";lV.top=lR+"px";this.maskLayer.style.left=-lU+"px";this.maskLayer.style.top=-lR+"px";if(lW.dispatchEvent!==false){this.dispatchEvent(new gC("onmoving"))}},zoomTo:function(e,lQ,lU){lU=lU||{};lU.zoomCenter=lQ;if(lU.noAnimation!==true){this.deepZoomTo(e,lU);return}if(typeof e!=="number"){return}var lO=e1[this.mapType];if(!lO){return}var C=e;e=this._getProperZoom(e).zoom;if(e===this.zoomLevel){var lR=new gC("onzoomexceeded");lR.targetZoom=C;this.dispatchEvent(lR);lU.callback&&lU.callback();return}this.lastLevel=this.zoomLevel;if(lQ){this.temp._cPoint=lQ;this.temp._cPixel=this.pointToPixelIn(lQ)}else{if(this.getInfoWindow()){var lT=this.getInfoWindow().getPoint();this.temp._cPixel=this.pointToPixelIn(lT);this.temp._cPoint=lT}}if(this.config.zoomCenter){lQ=this.config.zoomCenter;this.temp._cPoint=lQ;this.temp._cPixel=this.pointToPixelIn(lQ)}if(lQ||this.temp.infoWin&&this.temp.infoWin.isOpen()){var i=this.temp._cPoint;var lS=this.temp._cPixel;var T=this.getZoomUnits(e);var lP=new c4(i.lng+T*(this.width/2-lS.x),i.lat-T*(this.height/2-lS.y));this.centerPoint=this.restrictCenter(lP,T,e);if(this.centerPoint.zoom){e=this.centerPoint.zoom}}if(lU.fireEvent!==false){this.dispatchEvent(new gC("onzoomstart"))}if(e!==this.zoomLevel){this.zoomLevel=e;this.dispatchEvent(new gC("onzooming"));this.dispatchEvent(new gC("onzoomstartcode"))}if(lU.fireEvent!==false){this.dispatchEvent(new gC("onzoomend"))}if(lU.callback){lU.callback()}},deepZoomMedia:function(e){var i=this;if(!i.temp.isStdCtrlBusy){i.temp.isStdCtrlBusy=true;i.deepZoomTo(i.zoomLevel+e);setTimeout(function(){i.temp.isStdCtrlBusy=false},400)}},deepZoomTo:function(lR,T){T=T||{};var lP=lR-this.zoomLevel;var lO=this._getProperZoom(lR);if(lO.exceeded){var e=new gC("onzoomexceeded");e.targetZoom=lR;this.dispatchEvent(e);return}var i;if(T.zoomCenter){i=this.pointToPixelIn(T.zoomCenter)}else{if(this.getInfoWindow()){i=this.pointToPixelIn(this.getInfoWindow().getPoint(),{zoom:this.lastLevel})}else{var i=new f8(this.width/2,this.height/2)}}this.lastLevel=this.zoomLevel;var lQ=this.deepZoom||new aP(this);var C=lP>0?1:-1;lQ.zoomMap(i,lP,C,null,T)},flyToIn:function(lS,e){if(e===this.zoomLevel){this.panToIn(lS);return}var lP=this._getProperZoom(e);if(lP.exceeded){var lT=new gC("onzoomexceeded");lT.targetZoom=e;this.dispatchEvent(lT);return}var lR=e-this.zoomLevel;var C=new f8(this.width/2,this.height/2);var i=this.pointToPixelIn(lS);var lQ=new kp(i.x-C.x,i.y-C.y);this.lastLevel=this.zoomLevel;if(Math.abs(lR)>=4||Math.abs(lQ.width)>this.width||Math.abs(lQ.height)>this.height){this.centerAndZoomIn(lS,e);return}var lO=this.deepZoom||new aP(this);var T=lR>0?1:-1;lO.zoomMap(i,lR,T,lQ)},panToIn:function(i,C){C=C||{};if(!i||i.equals(this.centerPoint)){C.callback&&C.callback();return}var T=this.pointToPixelIn(i);var e=Math.round(this.width/2);var lO=Math.round(this.height/2);if(Math.abs(e-T.x)>this.width||Math.abs(lO-T.y)>this.height||C.noAnimation===true){this._panToIn(e-T.x,lO-T.y,i);C.callback&&C.callback()}else{this._panBy(e-T.x,lO-T.y,C)}},_panToIn:function(i,e,T){var C=this.temp;if(C.operating===true){return}if(C.dragAni){C.dragAni.stop();C.dragAni=null;this.dispatchEvent(new gC("onmoveend"))}this.dispatchEvent(new gC("onmovestart"));this._setPlatformPosition(i,e,{point:T});this.dispatchEvent(new gC("onmoveend"))},panBy:function(i,e,C){C=C||{};i=Math.round(i)||0;e=Math.round(e)||0;if(Math.abs(i)<=this.width&&Math.abs(e)<=this.height&&C.noAnimation!==true){this._panBy(i,e,C)}else{this._panToIn(i,e);C.callback&&C.callback()}},_panBy:function(i,e,lO){if(this.temp.operating===true){return}lO=lO||{};this.dispatchEvent(new gC("onmovestart"));var T=this;var C=T.temp;C.pl=T.offsetX;C.pt=T.offsetY;if(C.tlPan){C.tlPan.cancel()}if(C.dragAni){C.dragAni.stop();C.dragAni=null;this.dispatchEvent(new gC("onmoveend"))}C.tlPan=new gr({fps:lO.fps||T.config.fps,duration:lO.duration||T.config.actionDuration,transition:lO.transition||hz.easeInOutQuad,render:function(lP){this.terminative=T.temp.operating;if(T.temp.operating){return}T._setPlatformPosition(Math.ceil(i*lP),Math.ceil(e*lP),{initMapOffsetX:C.pl,initMapOffsetY:C.pt})},finish:function(lP){T.dispatchEvent(new gC("onmoveend"));T.temp.tlPan=false;if(T.temp.stopArrow===true){T.temp.stopArrow=false;if(T.temp.arrow!==0){T._arrow()}}lO.callback&&lO.callback()}})},getCenterIn:function(){return this.centerPoint},getZoom:function(){return this.zoomLevel},setTilt:function(){},getTilt:function(){return this._tilt},setHeading:function(){},getHeading:function(){return this._heading},restrictCenter:function(lV,i,e){this.isRestrict=false;i=i||this.getZoomUnits();e=e||this.zoomLevel;var lT=this.pixelToPointIn(new f8(this.width,0),{center:lV,zoom:e});var lR=this.pixelToPointIn(new f8(0,this.height),{center:lV,zoom:e});var lW=lV.lng;var l1=lV.lat;if(this.config.restrictBounds!==null&&!this.config.restrictBounds.isEmpty()){var l0=this.config.restrictBounds;var T=l0.getSouthWest();var lY=l0.getNorthEast();var lU=kz.convertLL2MC(T);var lP=kz.convertLL2MC(lY);lV.lng=this.calcNewLngByBounds(lW,lR,lT,lU.lng,lP.lng,i);lV.lat=this.calcNewLatByBounds(l1,lR,lT,lU.lat,lP.lat,i);return lV}var lS=this.pixelToPointIn(new f8(0,0),{center:lV,zoom:e});var lO=this.pixelToPointIn(new f8(0,this.height),{center:lV,zoom:e});if(this.zoomLevel<5){if(lS.lat>iX.MAX_LAT&&lO.latiX.MAX_LAT){this.isRestrict=true;lV.lat=iX.MAX_LAT-this.height/2*i}else{if(lO.lat=iX.HIGH_RES_MIN_RATIO?2:1,enableEarth:dF.ifEnableEarth(),defaultMaxBounds:new je(new c4(-21364736,-10616832),new c4(23855104,15859712)),showControls:false,indoorControl:false,showRealSunlight:true,showMilkyway:true,earthBackground:null,showStreetLayer:true,showVectorStreetLayer:false,showVectorLine:false,textureScale:1,minZoom:null,maxZoom:null,earthUseRound:true,earthMinZoom:null,earthMaxZoom:null,earthSun:true,earthClouds:true,earthMarkerShowAllTime:true,earthOpacity:null,earthFixAxis:false,style:"default",showCustomIndoor:true,backgroundColor:null,enableIconClick:false,autoSafeArea:false,ak:null,webgl2:false,restrictCenter:true,restrictBounds:null,smaa:false,preserveDrawingBuffer:false,privateOn:false,privateRegions:null,popRightClick:false,videoMuted:true,overlayTop:false,highRegion:{lineOpt:null,focusOpt:false},forceReload:true,textureSizeHeight:4096*2,markerUseRound:true,fontFamily:G.fontFamily||"sans-serif",extendTiles:0,enableAdaptiveMinZoom:true,showCopyrightOnMobile:false,zoomWithCenter:false,};for(var C in i){if(i.hasOwnProperty(C)){this.config[C]=i[C];if(C==="fixCenterWhenResize"){this.config.enableResizeOnCenter=i[C]}}}if(i.style){if(i.style["styleId"]&&i.style["styleId"].length<32){this.config.style=i.style["styleId"]}else{this.config.style=i.style}}this._setTextRenderType();this._displayOptions={language:BMAP_LANGUAGE_ZH,poi:true,poiText:true,poiIcon:true,overlay:true,layer:true,building:true,indoor:true,street:true,skyColors:["rgba(226, 237, 248, 0)","rgba(186, 211, 252, 1)"],isFlat:false,labelMargin:0,buildingSideGradation:false};if(i.displayOptions){for(var e in i.displayOptions){if(i.displayOptions.hasOwnProperty(e)){this._displayOptions[e]=i.displayOptions[e]}}}if(this._displayOptions.language!==BMAP_LANGUAGE_ZH){this._displayOptions.isEn=true;this._setTextRenderType("canvas")}else{this._displayOptions.isEn=false}this.updateFocusOptions(i.focusOptions,true);if(this.config.restrictCenter===false){this._enableTiltZoom=0;this._enableHeadingZoom=0}},getLanguage:function(){return this._displayOptions.language},changeLanguage:function(i){if(i!==BMAP_LANGUAGE_ZH&&i!==BMAP_LANGUAGE_EN){throw new Error("language must be BMAP_LANGUAGE_ZH or BMAP_LANGUAGE_EN")}if(this._displayOptions.language!==i){this._displayOptions.language=i;this._displayOptions.isMultiLanguage=false;if(i!==BMAP_LANGUAGE_ZH){this._displayOptions.isEn=true;if(this.config.textRenderType==="image"){this._setTextRenderType("canvas")}}else{this._displayOptions.isEn=false}this.fire(new gC("onlanguage_change"));this.fire(new gC("onstyle_willchange"));this.fire(new gC("onstyle_loaded"));var e=new gC("onlayer_update");e.name="na";this.fire(e)}},enablePreferredLanguage:function(lO){if(!lO){var T=(navigator.language||navigator.userLanguage||"zh").toLowerCase();var i=["zh","en","zh-tw","es","pt","fr","de","th","ja","ko","tr","it","ru","ms","vi","id"];if(i.indexOf(T)!==-1){lO=T}else{if(T.indexOf("-")>-1){var C=T.split("-")[0];if(i.indexOf(C)!==-1){lO=C}}}if(!lO){lO=BMAP_LANGUAGE_ZH}}if(this._displayOptions.language!==lO){this._displayOptions.language=lO;if(lO!==BMAP_LANGUAGE_ZH){this._displayOptions.isEn=true;this._displayOptions.isMultiLanguage=true;if(this.config.textRenderType==="image"){this._setTextRenderType("canvas")}}else{this._displayOptions.isEn=false;delete this._displayOptions.isMultiLanguage}this.fire(new gC("onlanguage_change"));this.fire(new gC("onstyle_willchange"));this.fire(new gC("onstyle_loaded"));var e=new gC("onlayer_update");e.name="na";this.fire(e)}},disablePreferredLanguage:function(){this._displayOptions.language=BMAP_LANGUAGE_ZH;this._displayOptions.isEn=false;delete this._displayOptions.isMultiLanguage;this.fire(new gC("onlanguage_change"));this.fire(new gC("onstyle_willchange"));this.fire(new gC("onstyle_loaded"));var e=new gC("onlayer_update");e.name="na";this.fire(e)},updateFocusOptions:function(e,C){this._spotOptions={open:false,gray:false,involve:1,focus:0,other:7156516};if(e){for(var i in e){if(e.hasOwnProperty(i)){this._spotOptions[i]=e[i]}}}if(this._webglMapScene&&this._webglMapScene._painter){this._webglMapScene._painter._hightLightEnable()}if(!C){this._drawFrame()}},getMinZoom:function(){var C;if(e1[this.mapType][this._renderType]){C=e1[this.mapType][this._renderType].minZoom}else{C=e1[this.mapType].minZoom}if(this.config.minZoom!==null&&this.config.minZoom>=C){C=this.config.minZoom}if(this.mapType==="B_EARTH_MAP"){return C}if(this.config.enableAdaptiveMinZoom){var i=this.getSize();var e=this.worldSize(C);while(ee){T=true;C=e}if(this._renderType!=="webgl"){C=Math.round(C)}return{zoom:C,exceeded:T}},getContainer:function(){return this.container},getZoomUnits:function(C){if(this.mapType===ce){return Math.pow(2,18-this._earth.getImageZoom())}var e=e1[this.mapType];if(typeof e!=="object"){return null}var i=C||this.zoomLevel;return Math.pow(2,(e.zoomLevelBase-i))},pointToPixelIn:function(lW,lY){if(!lW){return}lY=lY||{};if(this.mapType===ce){var T;if(!lW._llPt){T=kz.convertMC2LL(lW);lW._llPt=T}T=lW._llPt;var lS=null;var C=null;if(typeof lY.zoom==="number"){var lV=this._earth;var lX=lV._getEarthZoomByImgZoom(lY.zoom);if(lX<=3){lS=lV._generateTmpPMatrix(lX)}C=lV._generateTmpMVMatrix(lV.getCenter(),lX)}var lO=this._earth.fromLatLngToPixel(T,{useRound:false,isCalcOnBack:true,matrixInfo:{modelViewMatrix:C,projectionMatrix:lS}});return lO}if((this._heading%360===0&&this._tilt===0)||!this._webglMapCamera){var lU=this.getZoomUnits(lY.zoom);var lQ=lY.center||this.centerPoint;var i=this.width/2;var lP=this.height/2;var lT=(lW.lng-lQ.lng)/lU+i;var lR=(lQ.lat-lW.lat)/lU+lP;if(lY.useRound!==false){lT=Math.round(lT);lR=Math.round(lR)}return new f8(lT,lR)}var e=this._webglMapCamera.fromMCToScreenPixel(lW.lng,lW.lat,lY);if(lY.useRound===false){return e}e.x=Math.round(e.x);e.y=Math.round(e.y);return e},pixelToPointIn:function(e,lU){if(!e){return}lU=lU||{};if(this.mapType===ce){if(typeof lU.zoom==="number"){var lS=this._earth;var lP=null;var C=null;var lT=lS._getEarthZoomByImgZoom(lU.zoom);if(lT<=3){lP=lS._generateTmpPMatrix(lT)}C=lS._generateTmpMVMatrix(lS.getCenter(),lT)}var i=this._earth.fromPixelToLatLng(e,{matrixInfo:{modelViewMatrix:C,projectionMatrix:lP}});if(i===null){return null}return kz.convertLL2MC(i)}if((this._heading%360!==0||this._tilt>0)&&this._webglMapCamera){return this._webglMapCamera.fromScreenPixelToMC(e.x,e.y,lU)}var lQ=lU.center||this.centerPoint;var lR=this.getZoomUnits(lU.zoom);var lO=lQ.lng+lR*(e.x-this.width/2);var T=lQ.lat-lR*(e.y-this.height/2);return new c4(lO,T)},pointToOverlayPixelIn:function(e,T){T=T||{};var C=this.pointToPixelIn(e,{zoom:T.zoom,center:T.center,forLabel:true,frustumTest:true,useRound:T.useRound});if(!C){return}if(T.fixPosition&&this.mapType!=="B_EARTH_MAP"){var lO=this.getSize();var i=this.worldSize(T.zoom);if(C.x>lO.width){while(C.x>lO.width){C.x-=i}}else{if(C.x<0){while(C.x<0){C.x+=i}}}}if(this._renderType==="webgl"){return C}C.x-=this.offsetX;C.y-=this.offsetY;return C},overlayPixelToPointIn:function(i,e){if(!i){return}var C=i.clone();if(this._renderType!=="webgl"){C.x+=this.offsetX;C.y+=this.offsetY}return this.pixelToPointIn(C,e)},getProjection:function(){return new kz()},lnglatToMercator:function(e,T){var i=new c4(e,T);var C=kz.convertLL2MC(i);return[C.lng,C.lat]},lngLatToMercator:function(e,i){return this.lnglatToMercator(e,i)},mercatorToLnglat:function(i,e){if(isNaN(i)||isNaN(e)){return[]}i=parseFloat(i);e=parseFloat(e);var T=new c4(i,e);var C=kz.convertMC2LL(T);return[C.lng,C.lat]},mercatorToLngLat:function(i,e){return this.mercatorToLnglat(i,e)},getBoundsIn:function(){if(!this._bounds){return}var l0=arguments[0];if(this.mapType===ce&&this._earth){var lU=this._earth.getCustomBounds();if(!lU){return this.config.defaultMaxBounds}var lT=lU.getSouthWest();var e=lU.getNorthEast();if(lT.lng>e.lng){e.lng=180}var mh=kz.convertLL2MC(lT);var l7=kz.convertLL2MC(e);var lX=this.config.defaultMaxBounds;var l6=Math.max(mh.lng,lX.sw.lng);var l5=Math.max(mh.lat,lX.sw.lat);var lZ=Math.min(l7.lng,lX.ne.lng);var lY=Math.min(l7.lat,lX.ne.lat);var l2=new je(new c4(l6,l5),new c4(lZ,lY));l2.pointBottomLeft=new c4(l6,l5);l2.pointBottomRight=new c4(lZ,l5);l2.pointTopLeft=new c4(l6,lY);l2.pointTopRight=new c4(lZ,lY);l2.setMinMax();l2.makeNormalizedPoint(this._earth.getHeading());return l2}l0=l0||{};var lO=l0.margins||[0,0,0,0];var mc=this.pixelToPointIn({x:lO[3],y:this.height-lO[2]},l0);var mg=this.pixelToPointIn({x:this.width-lO[1],y:lO[0]},l0);var l4=typeof l0.heading==="number"?l0.heading:(this._heading%360);var C=typeof l0.tilt==="number"?l0.tilt:this._tilt;var lW=this._webglMapCamera;if((l4===0&&C===0)||!lW){this._bounds.setSouthWest(mc);this._bounds.setNorthEast(mg);this._bounds.pointBottomLeft=mc;this._bounds.pointBottomRight=new c4(mg.lng,mc.lat);this._bounds.pointTopRight=mg;this._bounds.pointTopLeft=new c4(mc.lng,mg.lat);this._bounds.setMinMax();this._bounds.makeNormalizedPoint(l4);return this._bounds}var l3=this.pixelToPointIn({x:lO[3],y:lO[0]},l0);var T=lW.getPosition();var mi=Math.sqrt(Math.pow(l3.lng-T[0],2)+Math.pow(l3.lat-T[1],2));var md=this.getZoomUnits();var mk=mi/md;var ma=lW._frustumSideLen;var lS=lW._fovy;if(this._projectionMatrix3D!=="ortho"&&(mk>ma||(90-C)lQ){lQ=l9[me].lng}if(l9[me].latlV){lV=l9[me].lat}}this._bounds.setSouthWest(new c4(mf,ml));this._bounds.setNorthEast(new c4(lQ,lV));this._bounds.pointTopLeft=l3;this._bounds.pointTopRight=mg;this._bounds.pointBottomRight=l1;this._bounds.pointBottomLeft=mc;this._bounds.makeNormalizedPoint(l4);this._bounds.setMinMax();return this._bounds},getExtendBounds:function(){var C=jf.getInstance("na");var lX=this.getZoom();var e=Math.floor(lX);var lV=C.getDataZoom(lX);lV=cD(lV,lG.minDataZoom,lG.maxDataZoom);var lP=e;var lT=C.getTileSize(lX);var l3=C.getBaseTileSize(lX);var lQ=this.getBoundsIn();if(!lQ){return}var lU=C.getMercatorSize(lX,lV);var l0;var lW;var l5;var l1;var lZ=map.getCenterIn();lZ=fO.calcLoopCenterPoint(lZ);var T=Math.floor(lZ.lng/lU);var l6=Math.floor(lZ.lat/lU);var l4=0;var lR=0;lQ=fO.calcLoopMapBounds(lQ,lZ);if(lQ.ne.lng>fO._mc180X){var lO=fO.getSpaceDistanceInPixel(lV);l4=Math.ceil(lO/l3)}if(lQ.sw.lng19505879.362428114||lQ.sw.lat<-15949096.637571886){lQ.ne.lat=19505879.362428114;lQ.sw.lat=-15949096.637571886}var l2=[Math.floor(lQ.sw.lng/lU)-lR,Math.floor(lQ.sw.lat/lU)];var i=[Math.floor(lQ.ne.lng/lU)+l4,Math.floor(lQ.ne.lat/lU)];l0=l2[0]-this.config.extendTiles;lW=i[0]+1+this.config.extendTiles;l5=l2[1]-this.config.extendTiles;l1=i[1]+1+this.config.extendTiles;var lY=kz.tileToBoundRange({col:lW,row:l1,baseTileSize:l3,zoom:lV});var lS=kz.tileToBoundRange({col:l0,row:l5,baseTileSize:l3,zoom:lV});this.mapExtendBounds=new je(lS.LL.sw,lY.LL.ne);return this.mapExtendBounds},isLoaded:function(){return !!this.loaded},_getBestLevel:function(i,lW){var lP=0;if(this._renderType==="webgl"&&!cl()){lP=100}var lQ=lW.margins||[10,10,10,10];var T=lW.zoomFactor||0;var lR=lQ[1]+lQ[3];var lO=lQ[0]+lQ[2];var e=this.getMinZoom();var lV=this.getMaxZoom();var lU=i.toSpan();var lT=lU.width/(this.width-lR-lP);var lS=lU.height/(this.height-lO-lP);var C=18-s(Math.max(lT,lS));if(ClV){C=lV}C+=T;if(this._renderType!=="webgl"){C=Math.floor(C)}return C},getViewportIn:function(lW,lO){if(this.mapType===ce){lW=lW||[];var lQ=[];for(var lX=0;lX=0;lV--){lR.extend(lP[lV])}if(lR.isEmpty()){return lS}}var l1=lR.getCenter();var e=this._getBestLevel(lR,lO);if(lO.margins){var C=lO.margins;var l0=(C[1]-C[3])/2;var lT=(C[0]-C[2])/2;var lZ=this.getZoomUnits(e);l1.lng=l1.lng+lZ*l0;l1.lat=l1.lat+lZ*lT}return{center:l1,zoom:e}},setViewportIn:function(T,lO){if(this.mapType===ce){var lS;if(T&&T.center){var C=kz.convertMC2LL(T.center);var lQ=this._earth._getEarthZoomByImgZoom(T.zoom,C);lS={center:C,zoom:lQ}}else{lS=[];for(var lP=0;lPiX.MAX_DRAG_TILT_L2){i.setTilt(iX.MAX_DRAG_TILT_L2,{callback:function(){i._changeEarthMapType(e)}})}else{i._changeEarthMapType(e)}},_changeEarthMapType:function(C){var T=this;var lQ=T.tileMgr.tileLayers;if(this.mapType===hY){this._clearSatelliteOverlayState()}if(this._mapTypeChangAni){this._mapTypeChangAni.stop()}var lP;if(this._earth){lP=this._earth.getEarthCanvas()}if(!this._earth){this.maskLayer.style.opacity=1;this.maskLayer.style.zIndex=999;this.maskLayer.style.background="#000"}this._mapTypeChangAni=new gr({duration:400,render:function(e){if(!T._earth){return}lP.style.opacity=e},finish:function(){for(var e=lQ.length-1,lR=e;lR>=0;lR--){var lT=lQ[lR].tilesDiv;if(lT){lT.style.visibility="hidden"}if(lQ[lR]._isInnerLayer&&T._renderType!=="webgl"){T.removeTileLayer(lQ[lR])}}T._mapTypeChangAni=null;T._mapTypeChanging=false;function lS(){var lX=T.getZoom()-2;var lY=T.getCenterIn();var lV=kz.convertMC2LL(lY);T._earth=new bS.Earth(T,{center:lV,zoom:lX,showRealSunlight:T.config.showRealSunlight,showMilkyway:T.config.showMilkyway,earthBackground:T.config.earthBackground});if(T.config&&T.config.earthMaxZoom&&T._earth){T._earth.setMaxZoom(T.config.earthMaxZoom)}if(T.config&&T.config.earthMinZoom&&T._earth){T._earth.setMinZoom(T.config.earthMinZoom)}T._proxyEarthEvents();var lU=T.mapType;T.mapType=C;var lW=new gC("onmaptypechange");lW.zoomLevel=this.zoomLevel;lW.mapType=C;lW.exMapType=lU;T.dispatchEvent(lW);T._setMapTypeStatus(C);fK.extend(T,bS.EarthView.prototype);if(!T._navigationCtrl&&T.config.showControls){T._navigationCtrl=new fN(T)}}if(!T._earth){if(bS["FeatureStyle"+T.config.style]){lS()}else{T.loadMapStyleFiles(function(){lS()})}}if(parseInt(T.maskLayer.style.opacity,10)===1){setTimeout(function(){T.maskLayer.style.zIndex=9;T.maskLayer.style.opacity=0},1000)}}});if(!this._earth){return}var i=this.mapType;this.mapType=C;var lO=new gC("onmaptypechange");lO.zoomLevel=this.zoomLevel;lO.mapType=C;lO.exMapType=i;this.dispatchEvent(lO);T._setMapTypeStatus(C);fK.extend(T,bS.EarthView.prototype)},getMapStyleId:function(){if(typeof this.config.style==="string"){return this.config.style}return this.config.mapStyleId||"custom"},getAreaStyleId:function(){return this.config.areaStyleId||"areaStyle"},_printLog:function(e){var i;switch(e){case"mapvgl":i=249;break;case"mapvthree":i=248;break;case"bmapdraw":i=247;break;default:break}if(i){iF.sendMessage("Map","library",e)}},_setMapTypeStatus:function(C){var lR=arguments[1];if(C===ce){var lP=this._earth.getEarthCanvas();if(lP){lP.style.display=""}var lS={noAnimation:true};if(this.earthMinZoom){this._earth.setMinZoom(this.earthMinZoom);this.earthMinZoom=undefined}if(this.earthMaxZoom){this._earth.setMaxZoom(this.earthMaxZoom);this.earthMaxZoom=undefined}this._earth.setCenter(kz.convertMC2LL(this.centerPoint),lS);this._earth.setImageZoom(this.zoomLevel,lS);this._earth.setTilt(this.getTilt(),lS);this._earth.setHeading(this.getHeading(),lS);if(this.config.showStreetLayer){this._earth.showStreetLayer()}else{this._earth.hideStreetLayer()}}else{if(this.preMapType===ce&&this._earth){var lQ=this._earth;var T=lQ.getMapZoom();var lO=lQ._imageRawZoom||T;var i=lO-T;var e=lQ.getCenter();if(this._renderType==="webgl"){this._tilt=lQ.getTilt();if(this.zoomLevel>7){this._heading=lQ.getHeading();lR&&lR(e,T);return}if(lQ.getHeading()!==0){lQ.setTilt(this.getTilt());lQ.setHeading(this.getHeading(),{callback:function(){lR&&lR(e,T)}})}else{lR&&lR(e,T)}return}if(i<0.1&&lQ.getTilt()===0&&lQ.getHeading()===0){lR&&lR(e,T);return}lQ.setTilt(0);lQ.setHeading(0);lQ.setZoom(lQ.getZoom()-i,{callback:function(){lR&&lR(e,T)}})}}},_proxyEarthEvents:function(){var lO=this;var lP=this._earth;lP.on("tilesload",function(i){lO.fire(i)});lP.on("centerandzoom",function(i){lO.dispatchEvent(new gC("onmoveend"));lO.dispatchEvent(new gC("onzoomend"))});function T(i){lO.fire(i)}var e=["zoomstart","zoomend","tilesload","sunlighttime_change","sunlighttime_clear","centerandzoom","animation_start","animation_stop","movestart","moveend","moving","dragstart","dragend","dragging"];for(var C=0;C=3?e:3},setEarthMinZoom:function(e){var i=e-2>=1?e-2:1;if(this.mapType==="B_EARTH_MAP"){this._earth.setMinZoom(i);this.earthMinZoom=undefined;return}this.earthMinZoom=i},setCenterIn:function(e,i){i=i?i:{};i.tilt=i.tilt?i.tilt:this.getTilt();i.heading=i.heading?i.heading:this.getHeading();this.panToIn(e,i)},getRenderType:function(){return this._renderType},getSolarInfo:function(T){T=T||this._initDate;var C=gn(T);var e=kz.convertLL2MC(new c4(C[0],C[1]));var lV=e.latLng;var lQ=kz.convertMC2LL(this.centerPoint);var lS=T.getUTCHours();var lU=lS+24*lQ.lng/360;var lT=lU-12;var lR=lT*60*0.25;var lP=Math.asin(Math.sin(jU(lQ.lat))*Math.sin(jU(lV.lat))+Math.cos(jU(lQ.lat))*Math.cos(jU(lV.lat))*Math.cos(jU(lR)));var lO=Math.asin(Math.sin(jU(lR))*Math.cos(jU(lV.lat))/Math.cos(lP));var i="north";if(lQ.lat=19){return iX.MAX_DRAG_TILT}else{if(e<=18){if(e=this._enableTiltZoom-2){return(1-(this._enableTiltZoom-e)/2)*iX.MAX_DRAG_TILT_L2}return 0}return iX.MAX_DRAG_TILT_L2}else{return(iX.MAX_DRAG_TILT-iX.MAX_DRAG_TILT_L2)*(e-18)+iX.MAX_DRAG_TILT_L2}}},worldSize:function(i){var e=i||this.zoomLevel;return iX.WORLD_SIZE_MC/this.getZoomUnits(e)},setTrafficOn:function(T,e){var i=this;if(T&&Number(T)>1){lb.setZIndex(Number(T))}e=e||{};if(e.reload){var C=e.reloadTime||5*60*1000;lb.reloadTimer=setInterval(function(){lb.clearCache();var lO=new gC("onupdate");i.fire(lO)},C)}iF.sendMessage("Map","traffic");this.addTileLayer(lb)},setTrafficOff:function(){if(lb.reloadTimer){clearInterval(lb.reloadTimer)}this.removeTileLayer(lb)},showOverlayContainer:function(){this.setDisplayOptions({overlay:true})},hideOverlayContainer:function(){this.setDisplayOptions({overlay:false})},addLabelsToMapTile:function(lQ,lP){iF.sendMessage("Map","bindtype","custom_label");for(var T=0;T-1&&bS[C]){e.push(C)}}return e},setCopyrightOffset:function(T,i){var C=new gC("oncopyrightoffsetchange",{logo:T,cpy:i});this.dispatchEvent(C)},_setTextRenderType:function(e){if(e){this.config.textRenderType=e;return}if(this.config.textRenderType!==null){return}if(cl()){this.config.textRenderType="canvas"}else{if(typeof this.config.style==="string"){this.config.textRenderType="image"}else{this.config.textRenderType="canvas"}}},destroy:function(){this._destroyed=true;this.disableAutoResize();this.off("size_changed");this.off("zoom_changed");this.fire(new gC("ondestroy"));var e=this.config.mapStyleId||0;delete bS["customStyleInfo_"+e];delete bS["FeatureStyle"+e];if(lb.reloadTimer){clearInterval(lb.reloadTimer)}bS.BMAP_INSTANCES&&(bS.BMAP_INSTANCES-=1);if(!bS.BMAP_INSTANCES){this.destroyStyle();window.FeatureStyle=null;window.iconSetInfo_high=null;window.indoorStyle=null}this.config={};this.clearSpots();this._webGLStateId&&ez.WebGLState.remove(this._webGLStateId);this.container.onselectstart=null;this.container.style.backgroundImage="";this.container.innerHTML="";this.maskLayer=null;this.platform=null;iF.kill();c0.kill();kg.kill();if(this._listeners){for(var i in this._listeners){if(this._listeners.hasOwnProperty(i)){this.off(i)}}}var C=this;setTimeout(function(){C._listeners=null;C._bounds=null;C.tileLabels=[];C._overlayMgrGL=null;C._overlayMgr=null;C._mapIcon=null;if(C._mouse){C._mouse._drag=null;C._mouse=null}C.deepZoom=null;C.tileMgr=null;C.indexToRgb=null;C.toFormatCoords=null;C._webglMapCamera=null;C._normalLayerMgr=null;C._webglPainter=null;C._webglMapScene=null;C._indoorMgr=null;if(C._renderType==="webgl"){if(C._spotsMgr&&C._spotsMgr.destroy){C._spotsMgr.destroy()}C._spotsMgr=null;C._workerMgr=null;C.jobScheduler=null;C.benchmark=null;C._featureMgr=null;C._labelProcessor=null;C._customLabelMgr=null}if(C.cpyCtrl){C.cpyCtrl._map=null;C.cpyCtrl=null}C.logoCtrl=null;C._spotDataOnCanvas=null;C._navigationCtrl=null;if(C.hashCode){C.dispose()}},100)},destroyStyle:function(){var e=[];var lO=Object.keys(bS);for(var T=0;T-1||C.indexOf("iconSetInfo")>-1||C.indexOf("indoorStyle")>-1){e.push(C)}}for(var T=0;T-1&&e[lQ]["featureType"]!=="INTERNATIONALIZEICONICON"){lS.push(e[lQ])}else{lR.push(e[lQ])}}var lW=G.apiHost+"/";var lV=G.apiHost+"/";if(window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]){var lW=window._BMapSecurityConfig["serviceHost"]+"custom/"+this.version+"/mapstyle?version="+4+"&qt=custom_v2&is_all=true&is_new=1&";var lV=window._BMapSecurityConfig["serviceHost"]+"custom/"+this.version+"/mapstyle?version="+4+"&qt=custom_v2&is_all=true&is_new=1&space=indoor&"}else{var lW=lW+"custom/"+this.version+"/mapstyle?version="+4+"&ak="+lT+"&qt=custom_v2&is_all=true&is_new=1&";var lV=lV+"custom/"+this.version+"/mapstyle?version="+4+"&ak="+lT+"&qt=custom_v2&is_all=true&is_new=1&space=indoor&"}var lP=this.styleJson2styleStringV2(lR,lX);var C=this.styleJson2styleStringV2(lS,lY);lW+="styles="+encodeURIComponent(lP);lV+="styles="+encodeURIComponent(C);if(T&&T.os&&T.sv){lW+="&os="+T.os+"&sv="+T.sv;lV+="&os="+T.os+"&sv="+T.sv}var lO=new Date()["getTime"]();lW+="&timeStamp="+lO;lW+=kN()(lW);lV+="&timeStamp="+lO;lV+=kN()(lV);var lU={custom:{url:lW,id:"customStyleInfo_"+lZ,},indoor:{url:lV,id:"indoorStyleInfo_"+lZ,},hasInfoor:lS.length>0,};return lU},styleJson2styleStringV2:function(e,lR){var lV={featureType:"t",elementType:"e",visibility:"v",color:"c",opacity:"o",lightness:"l",saturation:"s",weight:"w",level:"z",hue:"h",fontsize:"f",image:"i"};var lX={all:"all",geometry:"g","geometry.fill":"g.f","geometry.stroke":"g.s",labels:"l","labels.text.fill":"l.t.f","labels.text.stroke":"l.t.s","labels.text":"l.t","labels.icon":"l.i","geometry.topfill":"g.tf","geometry.sidefill":"g.sf",texture:"t"};var lY=[];for(var T=this.map.getMinZoom();T<=this.map.getMaxZoom();T++){lR.zoomFrontStyle[T]={}}lR.zoomFrontStyle.main={};var C=false;for(var T=0;!!e[T];T++){var lW=e[T];if(this.isOnlyZoomStyler(lW)){continue}var lU=this.getFrontZoom(lW);if((lW.featureType==="land"||lW.featureType==="all"||lW.featureType==="background")&&typeof lW.elementType==="string"&&(lW.elementType==="geometry"||lW.elementType==="texture"||lW.elementType==="geometry.fill"||lW.elementType==="all")&&lW.stylers&&!C){if(lW.stylers["color"]){lR.bmapLandColor=lW.stylers["color"]}if(lW.stylers["image"]){lR.bmapLandFillTexture=lW.stylers["image"]}if(lW.stylers["opacity"]){lR.bmapLandColor=lW.stylers["opacity"]}if(lW.stylers["visibility"]&&lW.stylers["visibility"]==="off"){lR.bmapLandColor="#00000000"}if(lW.featureType==="land"){C=true}}if(lW.featureType==="building"&&typeof lW.elementType==="string"&&lW.elementType==="geometry.fill"){lR.buildingFill=true}if(lW.featureType==="roadarrow"&&lW.elementType==="labels.icon"&&lW.stylers){var lS=lW.stylers["visibility"];lR.zoomFrontStyle[lU]["bmapRoadarrowVisibility"]=lS}var lO={};fK.extend(lO,lW);var lQ=lO.stylers;delete lO.stylers;fK.extend(lO,lQ);var lP=[];for(var lT in lV){if(lO[lT]){if(this.isEditorZoomKeys(lT)){continue}if(lT==="elementType"){lP.push(lV[lT]+":"+lX[lO[lT]])}else{if(lT==="image"){lP.push(lV[lT]+":"+encodeURIComponent(encodeURIComponent(lO[lT])))}else{switch(lO[lT]){case"poilabel":lO[lT]="poi";break;case"districtlabel":lO[lT]="label";break}lP.push(lV[lT]+":"+lO[lT])}}}}if(lP.length>2){lY.push(lP.join("|"))}}return lY.join(",")},getFrontZoom:function(e){var i=e.stylers["level"];if(i===undefined){return"main"}else{return parseInt(i,10)}},isZoomConfig:function(e){var i=e.stylers["level"];if(i===undefined){return false}else{return true}},isOnlyZoomStyler:function(e){var i={};fK.extend(i,e.stylers);delete i.curZoomRegionId;delete i.curZoomRegion;delete i.level;if(fK.isEmptyObject(i)){return true}else{return false}},isSelectZoom:function(i,e){var C=i.stylers["level"];if(C===undefined){return true}else{if(C===e+""){return true}else{return false}}},isEditorZoomKeys:function(e){var i={curZoomRegionId:true,curZoomRegion:true};if(i[e]){return true}else{return false}},getZoomRegion:function(e,i){var T=e.stylers["level"];var C={};fK.extend(C,i);if(T===undefined){return C}else{C[parseInt(T,10)]=true;return C}},onStyleDataBack:function(C,i,e,T){if(this._default){this.parseStyleData(C,i,e,T)}else{this._dataList.push({method:"parseStyleData",arguments:[C,i,e,T]})}},parseStyleData:function(lO,C,i,lQ){lO=JSON.parse(lO);var T="Feature";if(C.indexOf("indoor")!==-1){T="indoor"}if(lO.status===0&&lO.data&&lO.data.style&&lO.data.style.length===3){if(!i.baseFs){if(this.version==="v3"){var e=JSON.parse(JSON.stringify(bS[T+"StyleDefault"]));i.baseFs=this.combindStyle(e,lO.data.style)}else{i.baseFs=lO.data.style}}}else{if(!i.baseFs){i.baseFs=bS[T+"StyleDefault"]}}var lP=i.baseFs;this.updateFrontFeatureStyle(i);lQ&&lQ()},updateFrontFeatureStyle:function(C){if(C.zoomFrontStyle.main["bmapRoadarrowVisibility"]){for(var e=this.map.getMinZoom();e<=this.map.getMaxZoom();e++){if(!C.zoomFrontStyle[e]["bmapRoadarrowVisibility"]){C.zoomFrontStyle[e]["bmapRoadarrowVisibility"]=C.zoomFrontStyle.main["bmapRoadarrowVisibility"]}}}},getMapStyleFiles:function(T,lQ,e,C){var i=T.split("?")[0];var lP=T.split("?")[1];var lO=new XMLHttpRequest();lO.open("POST",i,true);lO.setRequestHeader("Content-type","application/x-www-form-urlencoded");lO.timeout=10000;lO.ontimeout=function(){C&&C()};lO.onreadystatechange=function(lR){if(this.readyState===4){if(this.status===200){lQ&&lQ(this.responseText)}else{e&&e()}}};lO.send(lP);return lO},getDefaultStyle:function(i){var e=this;hL.load(G.getMapStyleFiles("default"),function(){bS.FeatureStyleDefault=window.FeatureStyle;bS.iconSetInfoDefault=window.iconSetInfo_high;bS.iconSetInfoCustom=window.iconSetInfo_high;bS.indoorStyleDefault=window.indoorStyle;e._default=true;e.syncDataList.call(e);i&&i()})},syncDataList:function(){if(this._default){for(var C=0,e=this._dataList.length;C0){lR=lO.verticesLength[C-1]}end=lO.verticesLength[C];var lP=[];var T="";if(lO.vertex){lP=lO.vertex;T="building3d"}else{if(lO.data[0]){lP=lO.data[0];T=lO.type}else{continue}}var lQ=this.calcDrawMc(lP.slice(lR,end),T,e);this.map.addAreaSpot(lQ,{userData:{styleId:lO.styleIds[C],type:"mapstyle"}})}},addLabelIntoAreaSpots:function(e){if(A.environment!=="customEditor"){return}for(var lO=0;lOlQ){return lQ}while(lRC){lR=lO}else{lQ=lO}lO=(lQ-lR)*0.5+lR}return lO};cO.prototype.solve=function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))};var hz={};function gr(C){var e={duration:1000,fps:30,delay:0,transition:hz.linear,dropLastAnimation:false};if(C){for(var T in C){e[T]=C[T]}}if(C.beginTime){this._beginTime=C.beginTime}this._callbacks=[];this._options=e;if(e.delay){var lO=this;setTimeout(function(){lO._doStart()},e.delay)}else{this._doStart()}this._pauseTime=0}gr.INFINITE="INFINITE";gr.prototype._doStart=function(){if(this._isPausing){var e=performance.now()||new Date().getTime();this._pauseTime+=e-this._isPausing;this._isPausing=undefined}if(window.requestAnimationFrame){var i=this;i._timer=window.requestAnimationFrame(function(C){i._loop(C)})}else{this._beginTime=new Date().getTime();if(this._options.duration===gr.INFINITE){this._endTime=null}else{this._endTime=this._beginTime+this._options.duration}this._loop()}};gr.prototype.setBeginTime=function(e){this._beginTime=e};gr.prototype.setDuration=function(e){this._options.duration=e};gr.prototype._loop=function(T){var lQ=this;T=T||new Date().getTime();T=T-this._pauseTime;if(!this._beginTime){this._beginTime=T}this._endTime=this._beginTime+this._options.duration;if(lQ._endTime!==null&&T>=lQ._endTime){if(lQ._options.dropLastAnimation===false){lQ._options.render(lQ._options.transition(1),1,T)}if(typeof lQ._options.finish==="function"){lQ._options.finish(T,this)}for(var lP=0,e=lQ._callbacks.length;lP=lO.percentage&&TT){C=lP;var lO="系统于"+e.year+"年"+e.month+"月"+e.day+"日";lS="【"+i+"】"+lO+lS;try{var lT=document.createElement("iframe");lT.style.display="none";document.body.appendChild(lT);if(lT.contentWindow&&lT.contentWindow.alert){lT.contentWindow.alert(lS)}else{window.alert(lS)}document.body.removeChild(lT)}catch(lR){window.alert(lS)}c0.sendMessage("popup",lU,i)}}})();function lF(e){return e.style}function jg(i){if(fK.Browser.ie>0){i.unselectable="on";i.selectstart=function(){return false};i.onmousedown=function(C){C.preventDefault();return false}}else{var e=lF(i);e.MozUserSelect="none";e.WebkitUserSelect="none";i.addEventListener("mousedown",function(C){C.preventDefault()},false)}}function a6(e){return e&&e.parentNode&&e.parentNode.nodeType!==11}function b5(i,e){if(!i){return null}i.insertAdjacentHTML("beforeEnd",e);return i.lastChild}function gH(C,i){var T=document.createElement("div");T.innerHTML=i;var e=T.childNodes[0];return C.parentNode.insertBefore(e,C)}function ap(i){i=i||window.event;i.stopPropagation?i.stopPropagation():i.cancelBubble=true}function d(i){i=i||window.event;i.preventDefault?i.preventDefault():i.returnValue=false;return false}function iw(i){ap(i);return d(i)}function hT(){var e=document.documentElement;var i=document.body;if(e&&(e.scrollTop||e.scrollLeft)){return[e.scrollTop,e.scrollLeft]}else{if(i){return[i.scrollTop,i.scrollLeft]}else{return[0,0]}}}function jF(lO){if(!lO){return}lO.onload=lO.onerror=null;var C=lO.attributes,T,e,lP;if(C){e=C.length;for(T=0;T=e){return fd(lS,lO)}var i=lP/e;var lR=C.lng+(lO.lng-C.lng)*i;var lQ=C.lat+(lO.lat-C.lat)*i;const T={lng:lR,lat:lQ};return fd(lS,T)}function fZ(C,i){var e=Math.round((C.x+i.x)/2);var T=Math.round((C.y+i.y)/2);return new f8(e,T)}function kK(e,C){var i=[];C=C||function(lO){return lO};for(var T in e){i.push(T+"="+C(e[T]))}return i.join("&")}function cm(C,i,lP){var lQ=document.createElement(C);if(lP){lQ=document.createElementNS(lP,C)}i=i||{};for(var T in i){var lO={"for":"htmlFor","class":"cssClass"}[T]||T;if(T==="style"){lQ.style.cssText=i[T];continue}if(T==="class"){fK.ac(lQ,i[T]);continue}if(lQ.setAttribute){lQ.setAttribute(lO,i[T])}else{try{lQ[lO]=i[T]}catch(lQ){}}}return lQ}function cK(e){if(e.currentStyle){return e.currentStyle}else{if(e.ownerDocument&&e.ownerDocument.defaultView){return e.ownerDocument.defaultView.getComputedStyle(e,null)}}}function cf(e){return typeof e==="function"}function g8(e){return e===void 0}function k8(e,i){return Object.prototype.hasOwnProperty.call(e,i)}function h(lO,lP){if(g8(lO.length)){for(var T in lO){if(k8(lO,T)){lP.call(null,T,lO[T])}}}else{var C=lO.length;if(C){for(var e=0;e>4);lT=((lS&15)<<4)|(lQ>>2);lR=((lQ&3)<<6)|lP;C=C+String.fromCharCode(lV);if(lQ!==64){C=C+String.fromCharCode(lT)}if(lP!==64){C=C+String.fromCharCode(lR)}lV=lT=lR="";lU=lS=lQ=lP=""}while(T-1||e.indexOf("iPad")>-1){return true}return false}function i8(){var e=navigator.userAgent;if(e.indexOf("Android")>-1){return true}return false}function f1(){var e=navigator.userAgent;if(e.indexOf("Harmony")>-1){return true}return false}function dI(T,C){var e=T.getContainer();var i=C.getContainer();return e===i}function kZ(){var e=navigator.userAgent;if(e.indexOf("Mobile")>-1){return true}return false}function jU(e){return e*Math.PI/180}function fY(e){return e/Math.PI*180}function bY(e,lO){var T=Math.pow(10,lO);if(typeof e==="number"){return Math.round(e*T)/T}for(var C=0;Ce){C=e}}return C}function eV(e,i){while(e<0){e+=i}return e%i}function i4(i,e){return(i>=0&&e>=0)||(i<0&&e<0)}function Q(i){if(i._gl){return i._gl}var e={alpha:true,antialias:false,failIfMajorPerformanceCaveat:false,preserveDrawingBuffer:false,stencil:false};var C=i.getContext("webgl",e)||i.getContext("experimental-webgl",e);i._gl=C;return C}function jR(T,C){for(var e=0;eT||C.lati){return false}return true}function ky(lR,lQ,lP,T){var lO=aa(lP,T,lR);var C=aa(lP,T,lQ);var i=aa(lR,lQ,lP);var e=aa(lR,lQ,T);if(lO*C<0&&i*e<0){return true}else{if(lO===0&&kn(lP,T,lR)){return true}else{if(C===0&&kn(lP,T,lQ)){return true}else{if(i===0&&kn(lR,lQ,lP)){return true}else{if(e===0&&kn(lR,lQ,T)){return true}else{return false}}}}}}function iO(C,i){var e=i.parentNode;if(e.lastChild===i){e.appendChild(C)}else{e.insertBefore(C,i.nextSibling)}}function ew(lT,lU){if(lU===0){return lT}var lS=0;var lQ=0;if(!lT){throw"异常"}if(lT.length===0){return[]}for(var lO=1,C=lT.length-1;lOlS){lQ=lO;lS=lR}}var e=[];if(lS>=lU){var lW=lT.slice(0,lQ);var lV=lT.slice(lQ,lT.length);var lP=ew(lW,lU);var T=ew(lV,lU);for(var lO=0,C=lP.length;lO=lO){C.push(T[e])}}return C}function s(e){if(Math.log2){return Math.log2(e)}return Math.log(e)/Math.LN2}function dM(C,i,e){return Math.min(e,Math.max(i,C))}function az(e,i){if(!i){return e}var lP=i[0];var lO=i[1];var T=i[2];var C=i[3];var lR=[];var lQ=[];lR[0]=C*e[0]+T*e[2];lR[1]=e[1];lR[2]=-T*e[0]+C*e[2];lQ[0]=lR[0];lQ[1]=lO*lR[1]-lP*lR[2];lQ[2]=lP*lR[1]+lO*lR[2];return lQ}var q=Math.PI/180;var hK=180/Math.PI;function gn(C){var i=(C-Date.UTC(2000,0,1,12))/86400000/36525;var e=(d3.utcDay.floor(C)-C)/86400000*360-180;return[e-gb(i)*hK,eD(i)*hK]}function gb(T){var lO=bJ(T);var i=eM(T);var C=jP(T);var lP=Math.tan(jO(T)/2);lP*=lP;return lP*Math.sin(2*C)-2*lO*Math.sin(i)+4*lO*lP*Math.sin(i)*Math.cos(2*C)-0.5*lP*lP*Math.sin(4*C)-1.25*lO*lO*Math.sin(2*i)}function eD(e){return Math.asin(Math.sin(jO(e))*Math.sin(bO(e)))}function bO(e){return lz(e)-(0.00569+0.00478*Math.sin((125.04-1934.136*e)*q))*q}function lz(e){return jP(e)+kD(e)}function eM(e){return(357.52911+e*(35999.05029-0.0001537*e))*q}function jP(i){var e=(280.46646+i*(36000.76983+i*0.0003032))%360;return(e<0?e+360:e)/180*Math.PI}function kD(i){var e=eM(i);return(Math.sin(e)*(1.914602-i*(0.004817+0.000014*i))+Math.sin(e+e)*(0.019993-0.000101*i)+Math.sin(e+e+e)*0.000289)*q}function jO(e){return d6(e)+0.00256*Math.cos((125.04-1934.136*e)*q)*q}function d6(e){return(23+(26+(21.448-e*(46.815+e*(0.00059-e*0.001813)))/60)/60)*q}function bJ(e){return 0.016708634-e*(0.000042037+1.267e-7*e)}function g9(){return window.devicePixelRatio||1}function j5(C){var i;var e;var T;if(C>=0){T=Math.floor(C/65536)*65536;i=T;e=C-T}else{T=Math.floor(-C/65536)*65536;i=-T;e=C+T}return[i,e]}function dc(e){if(e.lng>=0&&e.lat>=0){return new c4(e.lng-10000000,e.lat-6000000)}if(e.lng>=0&&e.lat<0){return new c4(e.lng-10000000,e.lat+6000000)}if(e.lng<0&&e.lat>=0){return new c4(e.lng+10000000,e.lat-6000000)}if(e.lng<0&&e.lat<0){return new c4(e.lng+10000000,e.lat+6000000)}}var js=null;if(window.performance&&window.performance.now){js=function(){return performance.now()}}else{if(Date.now){js=function(){return Date.now()}}else{js=function(){return(new Date).getTime()}}}function i3(T,e,i){var C="mouseWheel";if(fK.Platform.macintosh){if(!isNaN(T)&&(T<10||T!==120)&&(e%1===0&&e<5)){C="padScroll"}if(fK.Browser.firefox&&(e%1===0&&e<5&&i===0)){C="padScroll"}}if(fK.Browser.safari&&T===12){C="mouseWheel"}return C}function b6(lW,lR){var lV=lW[0];var lU=lW[1];var T=false;for(var lQ=0,lP=lR.length-2;lQlU)!==(C>lU))&&(lV<(lS-lT)*(lU-lO)/(C-lO)+lT);if(e){T=!T}lP=lQ}return T}function i1(lO,lQ){lQ=lQ||[];var e=lQ.length;var C=0;var lP=false;for(var T=0;T=lQ[T].lat)&&(lO.lat=lQ[C].lat)&&(lO.lati){C=Math.pow(C-i+1,T)+i-1}else{if(Cthis.ll.lng&&e.lngthis.ll.lat&&e.latir){return aJ}return gk};iB.prototype.normalize=function(i,T,e,C){if(i>e){this.ll.lng=e;this.ru.lng=i}else{this.ll.lng=i;this.ru.lng=e}if(T>C){this.ll.lat=C;this.ru.lat=T}else{this.ll.lat=T;this.ru.lat=C}};function ff(i,T,e,C){this.sp={lng:i,lat:T};this.ep={lng:e,lat:C};this.mbr=new iB(i,T,e,C)}function ju(T,e,lP,lO){for(var C=0;C=e[C]&&T.lng<=e[C+1]&&T.lat>=lP[C]&&T.lat<=lP[C+1]){return true}}return false}function hg(lS){var i=lS.lng;var lR=lS.lat;var T=Math.sqrt(i*i+lR*lR);var lP=Math.atan2(lR,i);var C=T+hs(lR);var lO=lP+hr(i);var e=C*Math.cos(lO);var lQ=C*Math.sin(lO);return{lng:e+iS,lat:lQ+iR}}function bh(lS){var i=lS.lng-iS;var lR=lS.lat-iR;var T=Math.sqrt(i*i+lR*lR);var lP=Math.atan2(lR,i);var C=T-hs(lR);var lO=lP-hr(i);var e=C*Math.cos(lO);var lQ=C*Math.sin(lO);return{lng:e,lat:lQ}}function hs(e){return Math.sin(e*gA*ki)*hS}function hr(e){return Math.cos(e*gA*ki)*hQ}function aC(C,i,e){return((i.lng-C.lng)*(e.lat-C.lat)-(e.lng-C.lng)*(i.lat-C.lat))}function iY(i,e){return Math.abs(i-e)<=ir}function hA(T,C){var i=T.lat*ki;var lS=T.lng*ki;var e=C.lat*ki;var lR=C.lng*ki;var lP=Math.cos(i)*Math.cos(e);var lO=Math.cos(lS)*Math.cos(lR);var lU=Math.sin(i)*Math.sin(e);var lT=Math.sin(lS)*Math.sin(lR);var lV=lP*lO+lP*lT+lU;if(lV<-1){lV=-1}else{if(lV>1){lV=1}}var lQ=Math.acos(lV)*j0;return lQ}function m(lR,lQ){var i=lR.lat*ki;var e=lQ.lat*ki;var T=lR.lng*ki;var C=lQ.lng*ki;var lP=i-e;var lO=T-C;var lS=Math.sin(lP/2)*Math.sin(lP/2)+Math.cos(i)*Math.cos(e)*Math.sin(lO/2)*Math.sin(lO/2);return 2*Math.asin(Math.sqrt(lS))*j0}function hy(lS,C){var lU=bU(lS,C);var lT=180;var lR=90;var lQ=-180;var lO=-90;var lP=C.sp;var T=C.ep;lT=lP.lng=lT&&lU.lng<=lO&&lU.lat>=lR){return hA(lS,lU)}else{var i=m(lS,C.sp);var e=m(lS,C.ep);return iT.lat){if(aC({lng:dB[e],lat:dz[e]},{lng:dB[(e+1)%aj],lat:dz[(e+1)%aj]},T)>0){++C}}}else{if(dz[(e+1)%aj]<=T.lat){if(aC({lng:dB[e],lat:dz[e]},{lng:dB[(e+1)%aj],lat:dz[(e+1)%aj]},T)<0){--C}}}}return C===0?gk:ji}function lt(T){var lQ={};if(T.lngfJ[2]+0.4||T.lat>fJ[3]+0.4){lQ.lng=T.lng;lQ.lat=T.lat;return lQ}else{if(ju(T,fo,fn,jQ)){lQ=hg(T);return lQ}}var e=0;var lT=el;var C=0;var lR=new iB();var lS=1;if(b4(T)===gk){for(var lP=0;lPw[2]+0.4||i.lat>w[3]+0.4){C.lng=i.lng;C.lat=i.lat;return C}else{if(ju(i,cy,cw,jQ)){C=bh(i);return C}}var e=lt(i);if(i.lng===e.lng&&i.lat===e.lng){C.lng=i.lng;C.lat=i.lat;return C}return decryptPt1(i,lt)}function jN(i,e){if(e===3&&i instanceof c4){var C=lt(i);return new c4(C.lng,C.lat)}else{return i}}function fq(i,e){if(e===3&&i instanceof c4){var C=fM(i);return new c4(C.lng,C.lat)}else{if(e===5&&i instanceof c4){return new c4(i.lng,i.lat)}else{return i}}}function gR(i,e){if(i&&!ju(i,fo,fn,jQ)){return i}switch(e){case BMAP_COORD_GCJ02:var C=ey.transform([i.lng,i.lat],ey.GCJ02,ey.BD09LL);return new c4(C[0],C[1]);case BMAP_COORD_WGS84:var C=ey.transform([i.lng,i.lat],ey.WGS84,ey.BD09LL);return new c4(C[0],C[1]);case 3:var C=ey.transform([i.lng,i.lat],ey.GCJ02,ey.BD09LL);return new c4(C[0],C[1]);default:return i}}function kt(i,e){if(i&&!ju(i,fo,fn,jQ)){return i}switch(e){case BMAP_COORD_GCJ02:var C=ey.transform([i.lng,i.lat],ey.BD09LL,ey.GCJ02);return new c4(C[0],C[1]);case BMAP_COORD_WGS84:var C=ey.transform([i.lng,i.lat],ey.BD09LL,ey.WGS84);return new c4(C[0],C[1]);case 3:var C=ey.transform([i.lng,i.lat],ey.BD09LL,ey.GCJ02);return new c4(C[0],C[1]);default:return i}}function r(lP){if(!lP){lP={}}var lQ=JSON.stringify(lP);var lO=0,C,T,e;if(lQ.length===0){return lO}for(C=0,e=lQ.length;C=3){var T=lO[0]||0;var C=lO[1]||0;var e=lO[2]||0;var i=lO[3]||1}else{var T=(lO)&255;var C=(lO>>8)&255;var e=(lO>>16)&255;var i=(lO>>24)&255}if(!lO){return 0}return T+C*256+e*65536-1}function k(e){var i=true;var C=e.charAt(0);switch(C){case"\n":return"\\n";break;case"\r":return"\\r";break;case"'":return"\\'";break;case'"':return'\\"';break;case"&":return"\\&";break;case"\\":return"\\\\";break;case"\t":return"\\t";break;case"\b":return"\\b";break;case"\f":return"\\f";break;case"/":return"\\x2F";break;case"<":return"\\x3C";break;case">":return"\\x3E";break;default:i=false;break}if(!i){return e}}function b(lO){var C=lO;var T="";var e=0;for(e=0;ei-mR?mR:mS},e.offset=function(i,mR){return mQ(i=new Date(+i),null==mR?1:Math.floor(mR)),i},e.range=function(mS,i,mR){var mT=[];if(mS=e.ceil(mS),mR=null==mR?1:Math.floor(mR),!(i>mS&&mR>0)){return mT}do{mT.push(new Date(+mS))}while(mQ(mS,mR),mP(mS),i>mS);return mT},e.filter=function(i){return mJ(function(mR){for(;mP(mR),!i(mR);){mR.setTime(mR-1)}},function(mR,mS){for(;--mS>=0;){for(;mQ(mR,1),!i(mR);){}}})},C&&(e.count=function(i,mR){return mt.setTime(+i),mx.setTime(+mR),mP(mt),mP(mx),Math.floor(C(mt,mx))},e.every=function(i){return i=Math.floor(i),isFinite(i)&&i>0?i>1?e.filter(T?function(mR){return T(mR)%i===0}:function(mR){return e.count(0,mR)%i===0}):e:null}),e}function my(e){return mJ(function(i){i.setDate(i.getDate()-(i.getDay()+7-e)%7),i.setHours(0,0,0,0)},function(i,C){i.setDate(i.getDate()+7*C)},function(i,C){return(C-i-(C.getTimezoneOffset()-i.getTimezoneOffset())*ms)/mG})}function mq(e){return mJ(function(i){i.setUTCDate(i.getUTCDate()-(i.getUTCDay()+7-e)%7),i.setUTCHours(0,0,0,0)},function(i,C){i.setUTCDate(i.getUTCDate()+7*C)},function(i,C){return(C-i)/mG})}var mt=new Date,mx=new Date,mE=mJ(function(){},function(i,C){i.setTime(+i+C)},function(i,C){return C-i});mE.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?mJ(function(i){i.setTime(Math.floor(i/e)*e)},function(i,C){i.setTime(+i+C*e)},function(i,C){return(C-i)/e}):mE:null};var mN=mE.range,mL=1000,ms=60000,mI=3600000,mA=86400000,mG=604800000,lU=mJ(function(e){e.setTime(Math.floor(e/mL)*mL)},function(i,C){i.setTime(+i+C*mL)},function(i,C){return(C-i)/mL},function(e){return e.getUTCSeconds()}),mK=lU.range,mz=mJ(function(e){e.setTime(Math.floor(e/ms)*ms)},function(i,C){i.setTime(+i+C*ms)},function(i,C){return(C-i)/ms},function(e){return e.getMinutes()}),l2=mz.range,mm=mJ(function(i){var C=i.getTimezoneOffset()*ms%mI;0>C&&(C+=mI),i.setTime(Math.floor((+i-C)/mI)*mI+C)},function(i,C){i.setTime(+i+C*mI)},function(i,C){return(C-i)/mI},function(e){return e.getHours()}),mF=mm.range,mc=mJ(function(e){e.setHours(0,0,0,0)},function(i,C){i.setDate(i.getDate()+C)},function(i,C){return(C-i-(C.getTimezoneOffset()-i.getTimezoneOffset())*ms)/mA},function(e){return e.getDate()-1}),lT=mc.range,l9=my(0),mb=my(1),lP=my(2),l7=my(3),lW=my(4),mp=my(5),mw=my(6),lR=l9.range,mo=mb.range,l0=lP.range,ml=l7.range,mB=lW.range,mn=mp.range,mM=mw.range,mD=mJ(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(i,C){i.setMonth(i.getMonth()+C)},function(i,C){return C.getMonth()-i.getMonth()+12*(C.getFullYear()-i.getFullYear())},function(e){return e.getMonth()}),mO=mD.range,l6=mJ(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(i,C){i.setFullYear(i.getFullYear()+C)},function(i,C){return C.getFullYear()-i.getFullYear()},function(e){return e.getFullYear()});l6.every=function(e){return isFinite(e=Math.floor(e))&&e>0?mJ(function(i){i.setFullYear(Math.floor(i.getFullYear()/e)*e),i.setMonth(0,1),i.setHours(0,0,0,0)},function(i,C){i.setFullYear(i.getFullYear()+C*e)}):null};var lZ=l6.range,mu=mJ(function(e){e.setUTCSeconds(0,0)},function(i,C){i.setTime(+i+C*ms)},function(i,C){return(C-i)/ms},function(e){return e.getUTCMinutes()}),me=mu.range,md=mJ(function(e){e.setUTCMinutes(0,0,0)},function(i,C){i.setTime(+i+C*mI)},function(i,C){return(C-i)/mI},function(e){return e.getUTCHours()}),ma=md.range,l8=mJ(function(e){e.setUTCHours(0,0,0,0)},function(i,C){i.setUTCDate(i.getUTCDate()+C)},function(i,C){return(C-i)/mA},function(e){return e.getUTCDate()-1}),l5=l8.range,l4=mq(0),l3=mq(1),l1=mq(2),lY=mq(3),lX=mq(4),lS=mq(5),lQ=mq(6),lO=l4.range,mk=l3.range,mH=l1.range,mv=lY.range,mC=lX.range,mj=lS.range,mi=lQ.range,mh=mJ(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(i,C){i.setUTCMonth(i.getUTCMonth()+C)},function(i,C){return C.getUTCMonth()-i.getUTCMonth()+12*(C.getUTCFullYear()-i.getUTCFullYear())},function(e){return e.getUTCMonth()}),mg=mh.range,lV=mJ(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(i,C){i.setUTCFullYear(i.getUTCFullYear()+C)},function(i,C){return C.getUTCFullYear()-i.getUTCFullYear()},function(e){return e.getUTCFullYear()});lV.every=function(e){return isFinite(e=Math.floor(e))&&e>0?mJ(function(i){i.setUTCFullYear(Math.floor(i.getUTCFullYear()/e)*e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)},function(i,C){i.setUTCFullYear(i.getUTCFullYear()+C*e)}):null};var mf=lV.range;mr.timeInterval=mJ,mr.timeMillisecond=mE,mr.timeMilliseconds=mN,mr.utcMillisecond=mE,mr.utcMilliseconds=mN,mr.timeSecond=lU,mr.timeSeconds=mK,mr.utcSecond=lU,mr.utcSeconds=mK,mr.timeMinute=mz,mr.timeMinutes=l2,mr.timeHour=mm,mr.timeHours=mF,mr.timeDay=mc,mr.timeDays=lT,mr.timeWeek=l9,mr.timeWeeks=lR,mr.timeSunday=l9,mr.timeSundays=lR,mr.timeMonday=mb,mr.timeMondays=mo,mr.timeTuesday=lP,mr.timeTuesdays=l0,mr.timeWednesday=l7,mr.timeWednesdays=ml,mr.timeThursday=lW,mr.timeThursdays=mB,mr.timeFriday=mp,mr.timeFridays=mn,mr.timeSaturday=mw,mr.timeSaturdays=mM,mr.timeMonth=mD,mr.timeMonths=mO,mr.timeYear=l6,mr.timeYears=lZ,mr.utcMinute=mu,mr.utcMinutes=me,mr.utcHour=md,mr.utcHours=ma,mr.utcDay=l8,mr.utcDays=l5,mr.utcWeek=l4,mr.utcWeeks=lO,mr.utcSunday=l4,mr.utcSundays=lO,mr.utcMonday=l3,mr.utcMondays=mk,mr.utcTuesday=l1,mr.utcTuesdays=mH,mr.utcWednesday=lY,mr.utcWednesdays=mv,mr.utcThursday=lX,mr.utcThursdays=mC,mr.utcFriday=lS,mr.utcFridays=mj,mr.utcSaturday=lQ,mr.utcSaturdays=mi,mr.utcMonth=mh,mr.utcMonths=mg,mr.utcYear=lV,mr.utcYears=mf,Object.defineProperty(mr,"__esModule",{value:!0})});function fW(e){this._elemType=e;this._objCollection={}}fW.prototype.get=function(){var i=null;for(var e in this._objCollection){if(this._objCollection[e]&&this._objCollection[e]._free===true){this._objCollection[e]._free=false;return this._objCollection[e]}}i=cm(this._elemType);e=bS.getGUID("obj_pool_");this._objCollection[e]=i;return i};fW.prototype.free=function(e){if(!e){return}e._free=true;if(e.tagName.toLowerCase()==="img"){e.src="";e.crossOrigin=null;e.onload=e.onerror=null}};fW.prototype.clear=function(){for(var e in this._objCollection){if(this._objCollection[e]&&this._objCollection[e].tagName.toLowerCase==="img"){this._objCollection[e].onload=this._objCollection[e].onerror=null}}this._objCollection={}};var jm={get:function(i,lO,e,C){var T=new XMLHttpRequest();T.open("GET",i,true);T.timeout=10000;T.ontimeout=function(){C&&C()};T.onreadystatechange=function(lP){if(this.readyState===4){if(this.status===200){lO&&lO(T.responseText)}else{e&&e()}}};T.send()},post:function(i,lP,lO,e,C){var T=new XMLHttpRequest();T.open("POST",i,true);T.setRequestHeader("Content-type","application/x-www-form-urlencoded");T.timeout=10000;T.ontimeout=function(){C&&C()};T.onreadystatechange=function(lQ){if(this.readyState===4){if(this.status===200){lO&&lO(T.responseText,lP)}else{e&&e()}}};T.send(lP);return T}};var hL=(function(e){function i(lP,C,lO){if(lP.indexOf("v=")===-1){lP+="&v=gl"}var T=cm("script",{src:lP,type:"text/javascript",charset:"utf-8"});if(T.addEventListener){T.addEventListener("load",function(lR){var lQ=lR.target;lQ.parentNode.removeChild(lQ);C&&C()},false);T.addEventListener("error",function(lR){if(lR){var lQ=lR.target;lQ&&lQ.parentNode&&lQ.parentNode.removeChild(lQ)}lO&&lO(null)},false)}else{if(T.attachEvent){T.attachEvent("onreadystatechange",function(lR){var lQ=window.event.srcElement;if(lQ&&(lQ.readyState==="loaded"||lQ.readyState==="complete")){lQ.parentNode.removeChild(lQ)}C&&C()})}}e.getElementsByTagName("head")[0].appendChild(T)}return{load:function(lQ,C,T){if(typeof lQ==="string"){i(lQ,C,T)}else{if(lQ.length>0){var lP=lQ.length;for(var lO=0;lO-1){return{col:T,row:lT,zoom:lS,useZoom:C}}else{var lQ=lJ.mapZoomBaseIndex[lS];var lP=lJ.baseScaleZoom[lQ+1];if(!lP){return null}var lR=this.getFactorByZooms(lP,lS);var e=lJ.baseZoomInfo[lP];return{col:Math.floor(T/lR),row:Math.floor(lT/lR),zoom:lP,useZoom:e[e.length-1]}}return null}if(lS-1-1){return[{col:lO,row:lQ,zoom:e,useZoom:C}]}else{var l1=0;var lY=e;while(l1lX){return null}var lW=Math.pow(2,l3);var i=lO*lW;var lV=lQ*lW;var lS=e+l3;var lU=[];for(var l0=0;l0<2;l0++){var lP=i+l0;for(var lZ=0;lZ<2;lZ++){var lR=lV+lZ;lU.push({col:lP,row:lR,zoom:lS,useZoom:lS})}}return lU},getFactorByZooms:function(i,T){var C=lJ.mapZoomBaseIndex[i];var lO=lJ.mapZoomBaseIndex[T];var e=lJ.baseScaleZoomMercatorSize[C];var lP=lJ.baseScaleZoomMercatorSize[lO];return e/lP}};var dF={};var af=["swiftshader","microsoft basic render driver"];var iv=["intel","nvidia","amd","apple","geforce"];function hC(e){e=e.toLowerCase();if(af.indexOf(e)>=0){return true}if(e.indexOf("mobile")>=0){return true}return false}function c6(C){C=C.toLowerCase();for(var e=0;e=0){return true}}return false}function lH(e){if(!e){return false}if(hC(e)){return false}if(c6(e)){return true}return false}dF.ifEnableEarth=function(i){var e=dF.ifEnableEarth;if(!i&&typeof e._enable==="boolean"){return e._enable}if(dF.ifSupportWebGL()){e._enable=true;return true}e._enable=false;return false};dF.ifEnableWebGLMap=function(i){var e=dF.ifEnableWebGLMap;if(!i&&typeof e._enable==="boolean"){return e._enable}if(dF.ifSupportWebGL()){if(aT.inMapHost){e._enable=true;return true}else{if(window.Blob||window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder){e._enable=true;return true}else{e._enable=false;return false}}}e._enable=false;return false};dF.params={};dF.ifSupportWebGL=function(){var i=dF.ifSupportWebGL;if(typeof i._supportWebGL==="boolean"){return i._supportWebGL}if(!window.WebGLRenderingContext){i._supportWebGL=false;return false}var C=document.createElement("canvas");C.width=300;C.height=150;var lO=null;var lU={alpha:true,antialias:false,failIfMajorPerformanceCaveat:false,preserveDrawingBuffer:false,stencil:false};try{lO=C.getContext("webgl",lU)||C.getContext("experimental-webgl",lU)}catch(lQ){i._supportWebGL=false}if(lO===null){i._supportWebGL=false}else{i._supportWebGL=true;var lS=lO.getExtension("WEBGL_debug_renderer_info");var lR="";if(lS){lR=lO.getParameter(lS.UNMASKED_RENDERER_WEBGL);if(lH(lR)===true){i._supportWebGL=true}var lT=lO.getParameter(lS.UNMASKED_VENDOR_WEBGL);i._renderer=lR;i._vendor=lT}if(!lS&&fK.Browser.firefox){i._supportWebGL=true}if(!lS&&fK.Platform.macintosh){i._supportWebGL=true}if(lO.drawingBufferWidth!==C.width||lO.drawingBufferHeight!==C.height){i._supportWebGL=false}if(lO.getParameter(lO.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<4){i._supportWebGL=false}var T=lO.getParameter(lO.MAX_TEXTURE_SIZE);dF.params.maxTextureSize=T;if(T<4096){i._supportWebGL=false}var lP=lO.getParameter(lO.MAX_TEXTURE_IMAGE_UNITS);if(lP<8){i._supportWebGL=false}if(lO.getShaderPrecisionFormat&&!lO.getShaderPrecisionFormat(lO.FRAGMENT_SHADER,lO.HIGH_FLOAT)){iF.sendMessage("Monitor","ShaderPrecision","sys_"+lR);return i._supportWebGL}if(!lO.getShaderPrecisionFormat||!lO.getShaderPrecisionFormat(lO.FRAGMENT_SHADER,lO.HIGH_FLOAT)){iF.sendMessage("Monitor","ShaderPrecision","sys_"+lR);return i._supportWebGL}if(!lO.getShaderPrecisionFormat||lO.getShaderPrecisionFormat(lO.FRAGMENT_SHADER,lO.HIGH_FLOAT).precision<23){i._supportWebGL=false}}return i._supportWebGL};dF.ifSupportCanvas2d=function(){var lO=dF.ifSupportCanvas2d;if(typeof lO.supportCanvas2d==="boolean"){return lO.supportCanvas2d}var C=document.createElement("canvas");var i=null;try{i=C.getContext("2d")}catch(T){lO.supportCanvas2d=false}if(i===null){lO.supportCanvas2d=false}else{lO.supportCanvas2d=true}return lO.supportCanvas2d};dF.ifCanvas2dInBlackList=function(){return true};dF.ifEnableCanvas2dMap=function(){return false;var i=navigator.userAgent;var e=0;var T=0;var lO=0;if(/macintosh/ig.test(i)){var C=0;if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(i)&&!/chrome/i.test(i)){C=parseInt((RegExp["\x241"]||RegExp["\x242"]),10)}if(C>0){return false}return true}if(/windows nt (\d+\.\d)/ig.test(i)){T=parseFloat(RegExp.$1);if(T>=6.1){if(/chrome\/(\d+\.\d)/i.test(i)){e=parseFloat(RegExp.$1);if(e>=31){return true}}if(/MSIE (\d+(\.\d+)?)/.test(i)){lO=parseFloat(RegExp.$1);if(lO>=10){return true}}if(/Firefox/.test(i)){return true}if(/rv:11.0/ig.test(i)){return true}if(/edge/ig.test(i)){return true}}}return false};dF.ifSupportCSS3=function(lR,i){var lQ=document.createElement("div");var lP="Webkit Moz O ms".split(" ");var e=lP.length;var C="";var T=lQ.style;if(lR in T){C=lR}lR=lR.replace(/^[a-z]/,function(lS){return lS.toUpperCase()});while(e--){var lO=lP[e]+lR;if(lO in T){C=lO;break}}if(i){return C}else{return C.length>0?true:false}};dF.isModernBrowser=dF.ifSupportCanvas2d()&&dF.ifSupportCSS3("transform");function aK(i,e){this._size=i;this._curSize=0;this._cache={};this._least=null;this._most=null;this._options={clearCallback:null,removeOldCallback:null};e=e||{};for(var C in e){this._options[C]=e[C]}this._getDataTimes=0;this._hitTimes=0}aK.prototype.setData=function(T,lP){var i=this._cache;var C=this._size;if(C===0){return}var e=this._curSize;if(e===C){this._removeOld()}var lO;if(!i[T]){lO={key:T,data:lP,older:null,newwer:null};i[T]=lO;if(this._least===null){this._least=lO}if(this._most===null){this._most=lO}this._curSize++}else{lO=i[T];lO.data=lP;if(this._most===lO){return}lO.older&&(lO.older.newer=lO.newer);lO.newer&&(lO.newer.older=lO.older);if(this._least===lO){this._least=lO.newer}}if(this._most&&this._most!==lO){this._most.newer=lO;lO.older=this._most;this._most=lO;lO.newer=null}};aK.prototype.getData=function(e){var i=this._cache[e];this._getDataTimes++;if(i){this._hitTimes++;var C=i.data;if(this._most===i){return C}i.older&&(i.older.newer=i.newer);i.newer&&(i.newer.older=i.older);if(this._least===i){this._least=i.newer}this._most.newer=i;i.older=this._most;i.newer=null;this._most=i;return C}return null};aK.prototype.getAllData=function(){return this._cache};aK.prototype.getHitRate=function(){return this._hitTimes/this._getDataTimes};aK.prototype.removeData=function(i){var e=this._cache;var C=e[i];if(!C){return}if(this._options.clearCallback){this._options.clearCallback(C.data,C.key)}C.older&&(C.older.newer=C.newer);C.newer&&(C.newer.older=C.older);if(this._least===C){this._least=C.newer}if(this._most===C){this._most=C.older}delete e[i];this._curSize--};aK.prototype._removeOld=function(){var i=this._cache;var lO=Math.round(this._size*0.6);var T=0;var e=[];while(this._least&&T=72.004&&C<=137.8347&&i>=0.8293&&i<=55.8271}function mA(mE,mD){var mH,i,mJ,C=(mJ=300+(mH=mE-105)+2*(i=mD-35)+0.1*mH*mH+0.1*mH*i+0.1*mp(mo(mH)),mJ+=2*(20*mj(6*mH*mC)+20*mj(2*mH*mC))/3,(mJ+=2*(20*mj(mH*mC)+40*mj(mH/3*mC))/3)+2*(150*mj(mH/12*mC)+300*mj(mH/30*mC))/3),T=function(mM,mL){var mK=2*mM-100+3*mL+0.2*mL*mL+0.1*mM*mL+0.2*mp(mo(mM));return mK+=2*(20*mj(6*mM*mC)+20*mj(2*mM*mC))/3,mK+=2*(20*mj(mL*mC)+40*mj(mL/3*mC))/3,mK+2*(160*mj(mL/12*mC)+320*mj(mL*mC/30))/3}(mE-105,mD-35),mG=mD/180*mC,mF=mj(mG),mI=mp(mF=1-mi*mF*mF);return[C=180*C/(mu/mI*ml(mG)*mC),T=180*T/(mu*(1-mi)/(mF*mI)*mC)]}function mr(T){var i=T[0],C=T[1];if(!mx(i,C)){return[i,C]}var mD=mA(i,C);return[i+mD[0],C+mD[1]]}function mk(mE){var mI=mE[0],C=mE[1];if(!mx(mI,C)){return[mI,C]}for(var T=[mI,C],mG=T[0],mD=T[1],mH=mr([mG,mD]),mF=mH[0]-mI,mJ=mH[1]-C;mo(mF)>0.000001||mo(mJ)>0.000001;){mF=(mH=mr([mG-=mF,mD-=mJ]))[0]-mI,mJ=mH[1]-C}return[mG,mD]}var mv=Math.sin,mw=Math.cos,lX=Math.atan2,mz=Math.sqrt,mh=3000*Math.PI/180;function mn(T){var i=T[0]-0.0065,C=T[1]-0.006,mE=mz(i*i+C*C)-0.00002*mv(C*mh),mD=lX(C,i)-0.000003*mw(i*mh);return[mE*mw(mD),mE*mv(mD)]}function l1(T){var i=T[0],C=T[1],mE=mz(i*i+C*C)+0.00002*mv(C*mh),mD=lX(C,i)+0.000003*mw(i*mh);return[mE*mw(mD)+0.0065,mE*mv(mD)+0.006]}var me=180/Math.PI,lS=Math.PI/180,lU=6378137,mB=20037508.342789244;function l6(i){return[i[0]*me/lU,(0.5*Math.PI-2*Math.atan(Math.exp(-i[1]/lU)))*me]}function mq(T){var i=Math.abs(T[0])<=180?T[0]:T[0]-360*(T[0]<0?-1:1),C=[lU*i*lS,lU*Math.log(Math.tan(0.25*Math.PI+0.5*T[1]*lS))];return C[0]>mB&&(C[0]=mB),C[0]<-mB&&(C[0]=-mB),C[1]>mB&&(C[1]=mB),C[1]<-mB&&(C[1]=-mB),C}var l5,l4,l3,mg,l0,lP,md,ma,l9,mb,lO,l8,mf=Math.abs,ms=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],lZ=[75,60,45,30,15,0],lR=[[1.410526172116255e-8,0.00000898305509648872,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-0.03801003308653,17337981.2],[-7.435856389565537e-9,0.000008983055097726239,-0.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,0.00000898305509983578,0.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,0.32710905363475,6856817.37],[-1.981981304930552e-8,0.000008983055099779535,0.03278182852591,40.31678527705744,0.65659298677277,-4.44255534477492,0.85341911805263,0.12923347998204,-0.04625736007561,4482777.06],[3.09191371068437e-9,0.000008983055096812155,0.00006995724062,23.10934304144901,-0.00023663490511,-0.6321817810242,-0.00663494467273,0.03430082397953,-0.00466043876332,2555164.4],[2.890871144776878e-9,0.000008983055095805407,-3.068298e-8,7.47137025468032,-0.00000353937994,-0.02145144861037,-0.00001234426596,0.00010322952773,-0.00000323890364,826088.5]],mt=[[-0.0015702102444,111320.7020616939,1704480524535203,-10338987376042340,26112667856603880,-35149669176653700,26595700718403920,-10725012454188240,1800819912950474,82.5],[0.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[0.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[0.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-0.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-0.0003218135878613132,111320.7020701615,0.00369383431289,823725.6402795718,0.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,0.37238884252424,7.45]];function lY(mD,C,T){var mF=mf(C)/T[9],mE=T[0]+T[1]*mf(mD),i=T[2]+T[3]*mF+T[4]*Math.pow(mF,2)+T[5]*Math.pow(mF,3)+T[6]*Math.pow(mF,4)+T[7]*Math.pow(mF,5)+T[8]*Math.pow(mF,6);return[mE*=mD<0?-1:1,i*=C<0?-1:1]}function mm(T){for(var i=T[0],C=T[1],mE=[],mD=0;mDlZ[mD]){mE=mt[mD];break}}return lY(i,C,mE)}function lW(T){for(var i=T[0],C=T[1],mE=[],mD=0;mD=ms[mD]){mE=lR[mD];break}}return lY(i,C,mE)}function lV(C,i){if(!C){throw new Error(i)}}function l7(i){return !!i&&"[object Array]"===Object.prototype.toString.call(i)}function l2(i){return !isNaN(Number(i))&&null!==i&&!l7(i)}function lT(){for(var T=[],i=0;i=2,"Invalid input coordinate: "+mG),lV(l2(mG[0])&&l2(mG[1]),"Invalid input coordinate: "+mG),mG=mG.map(Number),mD=!0);var T=mH;return mD?T(mG):(lQ(mG,(function(mJ){var i;i=T(mJ),mJ[0]=i[0],mJ[1]=i[1]})),mG)}})})();var iL={ColorRefTable:{aliceblue:["#f0f8ff","rgb(240,248,255)"],antiquewhite:["#faebd7","rgb(250,235,215)"],aqua:["#00ffff","rgb(0,255,255)"],aquamarine:["#7fffd4","rgb(127,255,212)"],azure:["#f0ffff","rgb(240,255,255)"],beige:["#f5f5dc","rgb(245,245,220)"],bisque:["#ffe4c4","rgb(255,228,196)"],black:["#000000","rgb(0,0,0)"],blanchedalmond:["#ffebcd","rgb(255,235,205)"],blue:["#0000ff","rgb(0,0,255)"],blueviolet:["#8a2be2","rgb(138,43,226)"],brown:["#a52a2a","rgb(165,42,42)"],burlywood:["#deb887","rgb(222,184,135)"],cadetblue:["#5f9ea0","rgb(95,158,160)"],chartreuse:["#7fff00","rgb(127,255,0)"],chocolate:["#d2691e","rgb(210,105,30)"],coral:["#ff7f50","rgb(255,127,80)"],cornflowerblue:["#6495ed","rgb(100,149,237)"],cornsilk:["#fff8dc","rgb(255,248,220)"],crimson:["#dc143c","rgb(220,20,60)"],cyan:["#00ffff","rgb(0,255,255)"],darkblue:["#00008b","rgb(0,0,139)"],darkcyan:["#008b8b","rgb(0,139,139)"],darkgoldenrod:["#b8860b","rgb(184,134,11)"],darkgray:["#a9a9a9","rgb(169,169,169)"],darkgreen:["#006400","rgb(0,100,0)"],darkgrey:["#a9a9a9","rgb(169,169,169)"],darkkhaki:["#bdb76b","rgb(189,183,107)"],darkmagenta:["#8b008b","rgb(139,0,139)"],darkolivegreen:["#556b2f","rgb(85,107,47)"],darkorange:["#ff8c00","rgb(255,140,0)"],darkorchid:["#9932cc","rgb(153,50,204)"],darkred:["#8b0000","rgb(139,0,0)"],darksalmon:["#e9967a","rgb(233,150,122)"],darkseagreen:["#8fbc8f","rgb(143,188,143)"],darkslateblue:["#483d8b","rgb(72,61,139)"],darkslategray:["#2f4f4f","rgb(47,79,79)"],darkslategrey:["#2f4f4f","rgb(47,79,79)"],darkturquoise:["#00ced1","rgb(0,206,209)"],darkviolet:["#9400d3","rgb(148,0,211)"],deeppink:["#ff1493","rgb(255,20,147)"],deepskyblue:["#00bfff","rgb(0,191,255)"],dimgray:["#696969","rgb(105,105,105)"],dimgrey:["#696969","rgb(105,105,105)"],dodgerblue:["#1e90ff","rgb(30,144,255)"],firebrick:["#b22222","rgb(178,34,34)"],floralwhite:["#fffaf0","rgb(255,250,240)"],forestgreen:["#228b22","rgb(34,139,34)"],fuchsia:["#ff00ff","rgb(255,0,255)"],gainsboro:["#dcdcdc","rgb(220,220,220)"],ghostwhite:["#f8f8ff","rgb(248,248,255)"],gold:["#ffd700","rgb(255,215,0)"],goldenrod:["#daa520","rgb(218,165,32)"],gray:["#808080","rgb(128,128,128)"],green:["#008000","rgb(0,128,0)"],greenyellow:["#adff2f","rgb(173,255,47)"],grey:["#808080","rgb(128,128,128)"],honeydew:["#f0fff0","rgb(240,255,240)"],hotpink:["#ff69b4","rgb(255,105,180)"],indianred:["#cd5c5c","rgb(205,92,92)"],indigo:["#4b0082","rgb(75,0,130)"],ivory:["#fffff0","rgb(255,255,240)"],khaki:["#f0e68c","rgb(240,230,140)"],lavender:["#e6e6fa","rgb(230,230,250)"],lavenderblush:["#fff0f5","rgb(255,240,245)"],lawngreen:["#7cfc00","rgb(124,252,0)"],lemonchiffon:["#fffacd","rgb(255,250,205)"],lightblue:["#add8e6","rgb(173,216,230)"],lightcoral:["#f08080","rgb(240,128,128)"],lightcyan:["#e0ffff","rgb(224,255,255)"],lightgoldenrodyellow:["#fafad2","rgb(250,250,210)"],lightgray:["#d3d3d3","rgb(211,211,211)"],lightgreen:["#90ee90","rgb(144,238,144)"],lightgrey:["#d3d3d3","rgb(211,211,211)"],lightpink:["#ffb6c1","rgb(255,182,193)"],lightsalmon:["#ffa07a","rgb(255,160,122)"],lightseagreen:["#20b2aa","rgb(32,178,170)"],lightskyblue:["#87cefa","rgb(135,206,250)"],lightslategray:["#778899","rgb(119,136,153)"],lightslategrey:["#778899","rgb(119,136,153)"],lightsteelblue:["#b0c4de","rgb(176,196,222)"],lightyellow:["#ffffe0","rgb(255,255,224)"],lime:["#00ff00","rgb(0,255,0)"],limegreen:["#32cd32","rgb(50,205,50)"],linen:["#faf0e6","rgb(250,240,230)"],magenta:["#ff00ff","rgb(255,0,255)"],maroon:["#800000","rgb(128,0,0)"],mediumaquamarine:["#66cdaa","rgb(102,205,170)"],mediumblue:["#0000cd","rgb(0,0,205)"],mediumorchid:["#ba55d3","rgb(186,85,211)"],mediumpurple:["#9370db","rgb(147,112,219)"],mediumseagreen:["#3cb371","rgb(60,179,113)"],mediumslateblue:["#7b68ee","rgb(123,104,238)"],mediumspringgreen:["#00fa9a","rgb(0,250,154)"],mediumturquoise:["#48d1cc","rgb(72,209,204)"],mediumvioletred:["#c71585","rgb(199,21,133)"],midnightblue:["#191970","rgb(25,25,112)"],mintcream:["#f5fffa","rgb(245,255,250)"],mistyrose:["#ffe4e1","rgb(255,228,225)"],moccasin:["#ffe4b5","rgb(255,228,181)"],navajowhite:["#ffdead","rgb(255,222,173)"],navy:["#000080","rgb(0,0,128)"],oldlace:["#fdf5e6","rgb(253,245,230)"],olive:["#808000","rgb(128,128,0)"],olivedrab:["#6b8e23","rgb(107,142,35)"],orange:["#ffa500","rgb(255,165,0)"],orangered:["#ff4500","rgb(255,69,0)"],orchid:["#da70d6","rgb(218,112,214)"],palegoldenrod:["#eee8aa","rgb(238,232,170)"],palegreen:["#98fb98","rgb(152,251,152)"],paleturquoise:["#afeeee","rgb(175,238,238)"],palevioletred:["#db7093","rgb(219,112,147)"],papayawhip:["#ffefd5","rgb(255,239,213)"],peachpuff:["#ffdab9","rgb(255,218,185)"],peru:["#cd853f","rgb(205,133,63)"],pink:["#ffc0cb","rgb(255,192,203)"],plum:["#dda0dd","rgb(221,160,221)"],powderblue:["#b0e0e6","rgb(176,224,230)"],purple:["#800080","rgb(128,0,128)"],red:["#ff0000","rgb(255,0,0)"],rosybrown:["#bc8f8f","rgb(188,143,143)"],royalblue:["#4169e1","rgb(65,105,225)"],saddlebrown:["#8b4513","rgb(139,69,19)"],salmon:["#fa8072","rgb(250,128,114)"],sandybrown:["#f4a460","rgb(244,164,96)"],seagreen:["#2e8b57","rgb(46,139,87)"],seashell:["#fff5ee","rgb(255,245,238)"],sienna:["#a0522d","rgb(160,82,45)"],silver:["#c0c0c0","rgb(192,192,192)"],skyblue:["#87ceeb","rgb(135,206,235)"],slateblue:["#6a5acd","rgb(106,90,205)"],slategray:["#708090","rgb(112,128,144)"],slategrey:["#708090","rgb(112,128,144)"],snow:["#fffafa","rgb(255,250,250)"],springgreen:["#00ff7f","rgb(0,255,127)"],steelblue:["#4682b4","rgb(70,130,180)"],tan:["#d2b48c","rgb(210,180,140)"],teal:["#008080","rgb(0,128,128)"],thistle:["#d8bfd8","rgb(216,191,216)"],tomato:["#ff6347","rgb(255,99,71)"],turquoise:["#40e0d0","rgb(64,224,208)"],violet:["#ee82ee","rgb(238,130,238)"],wheat:["#f5deb3","rgb(245,222,179)"],white:["#ffffff","rgb(255,255,255)"],whitesmoke:["#f5f5f5","rgb(245,245,245)"],yellow:["#ffff00","rgb(255,255,0)"],yellowgreen:["#9acd32","rgb(154,205,50)"]},regGroup:{hex:/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,rgb:/rgb\(\s*(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])\s*,\s*(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])\s*,\s*(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])\s*\)/,rgba:/rgba\(\s*(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])\s*,\s*(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])\s*,\s*(\d|\d\d|1\d\d|2[0-4]\d|25[0-5])\s*,\s*(0|1|0\.[1-9])\s*\)/},parseHexToRgbaArray:function(lP){var lQ=lP.replace("#","");if(lQ.length===3){lQ+="f"}else{if(lQ.length===6){lQ+="ff"}}var e=[];var lO=lQ.length;var T=lO===8?2:1;for(var C=0;C=0&&lO<60){lQ=lR;lP=C;e=0}else{if(lO>=60&&lO<120){lQ=C;lP=lR;e=0}else{if(lO>=120&&lO<180){lQ=0;lP=lR;e=C}else{if(lO>=180&&lO<240){lQ=0;lP=C;e=lR}else{if(lO>=240&&lO<300){lQ=C;lP=0;e=lR}else{if(lO>=300&&lO<360){lQ=lR;lP=0;e=C}}}}}}lQ=(lQ+i)*255>255?255:(lQ+i)*255;lP=(lP+i)*255>255?255:(lP+i)*255;e=(e+i)*255>255?255:(e+i)*255;return[Math.round(lQ),Math.round(lP),Math.round(e)]},formatColorCssToRgbaArray:function(lP,C,T){T=(typeof T!=="boolean")?true:T;if(typeof lP!=="string"){return T?[0,0,0,1]:[0,0,0,255]}var i=(lP||"Black").trim().toLowerCase();var e=[];var lO=iL.ColorRefTable[i];if(lO!==undefined){i=lO[0]}e=iL.parseCSSColor(i);if(C!==undefined&&!isNaN(Number(C))){C=Number(C);e[3]=iL.fitTo(C,0,1)}else{e[3]=Number((e[3]/255).toFixed(2))}if(!T){e[3]=Math.floor(e[3]*255)}return e},fitTo:function(C,i,e){if(Ce){C=e}}return C},generateColorRamp:function(e,lT,lU,T,lZ){lU=lU||[];T=T||"#ccc";lZ=lZ||1;const C=document.createElement("canvas");const l0=C.getContext("2d");C.width=256;C.height=lZ;const lP=lT[0];const lW=lT[lT.length-1];if(e.length===lT.length){const lX=l0.createLinearGradient(0,0,256,1);for(var lS=0;lS>16)+(l7>>16)+(l6>>16);return(l5<<16)|(l6&65535)}function lY(l4,l5){return(l4<>>(32-l5))}function lT(l9,l6,l5,l4,l8,l7){return lZ(lY(lZ(lZ(l6,l9),lZ(l4,l7)),l8),l5)}function e(l6,l5,ma,l9,l4,l8,l7){return lT((l5&ma)|(~l5&l9),l6,l5,l4,l8,l7)}function lQ(l6,l5,ma,l9,l4,l8,l7){return lT((l5&l9)|(ma&~l9),l6,l5,l4,l8,l7)}function lW(l6,l5,ma,l9,l4,l8,l7){return lT(l5^ma^l9,l6,l5,l4,l8,l7)}function l2(l6,l5,ma,l9,l4,l8,l7){return lT(ma^(l5|~l9),l6,l5,l4,l8,l7)}function C(me,l9){me[l9>>5]|=128<<(l9%32);me[((l9+64)>>>9<<4)+14]=l9;var l6;var l8;var l7;var l5;var l4;var md=1732584193;var mc=-271733879;var mb=-1732584194;var ma=271733878;for(l6=0;l6>5]>>>(l6%32))&255)}return l4}function lS(l5){var l7;var l4=[];l4[(l5.length>>2)-1]=undefined;for(l7=0;l7>5]|=(l5.charCodeAt(l7/8)&255)<<(l7%32)}return l4}function lR(l4){return lX(C(lS(l4),l4.length*8))}function l3(l6,l9){var l5;var l8=lS(l6);var l4=[];var l7=[];var ma;l4[15]=l7[15]=undefined;if(l8.length>16){l8=C(l8,l6.length*8)}for(l5=0;l5<16;l5+=1){l4[l5]=l8[l5]^909522486;l7[l5]=l8[l5]^1549556828}ma=C(l4.concat(lS(l9)),512+l9.length*8);return lX(C(l7.concat(ma),512+128))}function l1(l7){var l6="0123456789abcdef";var l5="";var l4;var l8;for(l8=0;l8>>4)&15)+l6.charAt(l4&15)}return l5}function lU(l4){return unescape(encodeURIComponent(l4))}function T(l4){return lR(lU(l4))}function lV(l4){return l1(T(l4))}function i(l4,l5){return l3(lU(l4),lU(l5))}function l0(l4,l5){return l1(i(l4,l5))}function lO(l5,l6,l4){if(!l6){if(!l4){return lV(l5)}return T(l5)}if(!l4){return l0(l6,l5)}return i(l6,l5)}lP.md5=lO})(this);var di={levels:{INFO:"info",WARNING:"warning",ERROR:"error"},category:{JS:"js",RESOURCE:"resource",AJAX:"ajax"},config:{jsError:true,resourceError:true,ajaxError:true},hosts:"api.map.baidu.com|webmap0.bdimg.com|maponline0.bdimg.com|",ignoreUrl:"api.map.baidu.com/images/blank.gif",sender:true,collections:[],sendError:function(){},init:function(i,e,C){this.hosts+=i?i:"";aA&&aA(this.config,e);this.sender=true;if(C){this.sender=false}this.hosts=this.urlScope(this.hosts);this.sendError=this.notifyError();var T=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};this.config.jsError&&this.handleJavaScriptError(T);this.config.resourceError&&this.handleResourceError(T);this.config.ajaxError&&this.handleAjaxError(T)},handleJavaScriptError:function(C){var e=this;var i=C.onerror;C.onerror=function(lR,lQ,T,lP,lO){if(e.isFetch(e.category.JS)&&e.hostExit(lQ)){if(lO&&lO.stack){e.sendError({title:lR,msg:lO.stack,category:e.category.JS,level:e.levels.ERROR})}else{if(typeof lR==="string"){e.sendError({title:lR,msg:JSON.stringify({resourceUrl:lQ,rowNum:T,colNum:lP}),category:"js",level:e.levels.ERROR})}}}if(i&&cf(i)){i&&i.apply(C,arguments)}}},handleResourceError:function(i){var e=this;i.addEventListener("error",function(lP){if(lP){var lQ=lP.target||lP.srcElement;var lO=lQ instanceof HTMLScriptElement||lQ instanceof HTMLLinkElement||lQ instanceof HTMLImageElement;if(!lO){if(!i.onerror){var C=lP.filename||null;if(!e.isFetch(e.category.JS)||!e.hostExit(C)){return}if(lP.error&&lP.error.stack){e.sendError({title:lP.message,msg:lP.error.stack,category:e.category.JS,level:e.levels.ERROR})}else{if(typeof lP.message==="string"){e.sendError({title:lP.message,msg:JSON.stringify({resourceUrl:C,rowNum:lP.lineno,colNum:lP.cowno}),category:e.category.JS,level:e.levels.ERROR})}}}return}var T=lQ.src||lQ.href;if(e.isFetch(e.category.RESOURCE)&&e.hostExit(T)){e.sendError({title:lQ.nodeName,msg:T,category:e.category.RESOURCE,level:e.levels.ERROR})}}},true)},handleAjaxError:function(lP){var e=this;var lO=lP.location.protocol;if(lO==="file:"){return}if(!lP.XMLHttpRequest){return}var i=lP.XMLHttpRequest;var C=i.prototype.send;var T=function(lR){if(lR&&lR.currentTarget&&lR.currentTarget.status!==200){var lQ=lR.target.responseURL;if(e.isFetch(e.category.AJAX)&&e.hostExit(lQ)){e.sendError({title:lQ,msg:JSON.stringify({response:lR.target.response,responseURL:lQ,status:lR.target.status,statusText:lR.target.statusText}),category:e.category.AJAX,level:e.levels.ERROR})}}};i.prototype.send=function(){if(this["addEventListener"]){this["addEventListener"]("error",T);this["addEventListener"]("load",T);this["addEventListener"]("abort",T)}else{var lQ=this["onreadystatechange"];this["onreadystatechange"]=function(lR){if(this.readyState===4){T(lR)}lQ&&lQ.apply(this,arguments)}}return C.apply(this,arguments)}},notifyError:function(C){var i=C||1000;this._idleWorkerTicker=(function(T){return function(){T.runJob()}})(this);var e=this;return function(lO){if(lO.url){if(!e.isFetch(lO.category)){return}var T=lO.url||"";if(!e.hostExit(T)){return}delete lO.url}if(!navigator.onLine){return}e.collections.push(lO);e.checkJob(i)}},runJob:function(){if(this.collections.length===0){clearInterval(this.idleWork);this.idleWork=null;return}var lO=this.collections.slice(0,2);var C=kI(JSON.stringify({dataset:lO}));var T=new Date().getTime();if(window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]){var i=G.apiIMG+"/blank.gif?product=jsapi&v=gl&l="+C+"&t="+T}else{var i=G.apiIMG+"/blank.gif?product=jsapi&v=gl&l="+C+"&ak="+fy+"&t="+T}if(this.sender){try{var lQ=document.createElement("div");lQ.style="width:0;height:0;visibility: hidden;opacity: 0;z-index:-999;background-image: url("+i+");";document.querySelector("BODY").appendChild(lQ);setTimeout(function(){document.querySelector("BODY").removeChild(lQ)})}catch(lP){}}this.collections.splice(0,2);if(this.collections.length===0){clearInterval(this.idleWork);this.idleWork=null}},checkJob:function(e){if(!this.idleWork&&this._idleWorkerTicker){this.idleWork=setInterval(this._idleWorkerTicker,e)}},urlScope:function(T){var C={};var lP=Object.keys(G);if(G&&lP.length>0){for(var lO in G){if(G[lO]&&(typeof G[lO]!=="function")){C[lO]=G[lO]}}}try{var lR=JSON.stringify(C);if(lR.length>2){return T+"|"+lR}else{return T}}catch(lQ){return T}},hostExit:function(i){try{if(i&&i.indexOf("//")===0){i=window.location.protocol+i}var C=new URL(i);if(!C||!C.host){return false}var lO=C.host+C.pathname;if(this.ignoreUrl.indexOf(lO)===-1&&this.hosts.indexOf(C.host)>-1){return true}return false}catch(T){return false}},isFetch:function(e){return this.config[e+"Error"]||false}};bS.fetchDebug=di;var aV={TYPE:"TypeError",REF:"ReferenceError",SYNTAX:"SyntaxError",RANGE:"RangeError",URI:"URIError",EVAL:"EvalError",NETWORK:"NetworkError",TIMEOUT:"TimeoutError",PROMISE:"UnhandledRejection",UNKNOWN:"Unknown"};var ck={TypeError:aV.TYPE,ReferenceError:aV.REF,SyntaxError:aV.SYNTAX,RangeError:aV.RANGE,URIError:aV.URI,EvalError:aV.EVAL};var fv=8*1024;var jK={_denominatorSent:false,_numeratorSent:false,_inited:false,_mapJsHosts:[],init:function(){if(this._inited){return}this._inited=true;var lO=[G.apiHost,G.staticHost,G.apiTestUrl,G.panoTilePath,G.stylePath];if(G.tileDomain&&G.tileDomain.length){lO=lO.concat(G.tileDomain)}var e=[];for(var C=0;C-1){return i.split("//")[1].split("/")[0]}}catch(C){}return""},_isMapUrl:function(C){if(!C){return false}for(var e=0;e-1){return true}}return false},_onError:function(e,C,lO,lP){if(this._numeratorSent){return}this._numeratorSent=true;var T=this._classifyTitle(e,C)||(lP?aV.PROMISE:aV.UNKNOWN);var i=this;this._sendSla({type:"num",ak:fy,title:T},function(lR){if(!lR){return}var lQ=(lO||"")+"";if(lQ.length>fv){lQ=lQ.slice(0,fv)}i._sendDetail(lR,{type:"num",ak:fy,title:T,ua:(typeof navigator!=="undefined"&&navigator.userAgent)||"",msg:lQ})})},_sendSla:function(lO,i){if(typeof navigator!=="undefined"&&navigator.onLine===false){i&&i(null);return}var C=this._buildUrl("/jsapi_monitor/sla",lO,null);try{dQ.request(C,function(e){i&&i(e&&e.status===0?e.id:null)})}catch(T){i&&i(null)}},_sendDetail:function(C,lO){if(typeof navigator!=="undefined"&&navigator.onLine===false){return}var i=this._buildUrl("/jsapi_monitor/detail",lO,C);try{dQ.request(i,function(){})}catch(T){}},_buildUrl:function(T,C,i){var lO=kI(JSON.stringify(C));var e="from=jsapi_"+getQtVersion()+"&sla="+encodeURIComponent(lO);if(i){e+="&id="+encodeURIComponent(i)}return G.apiHost+T+"?"+e}};bS.slaDebug=jK;var iF={device:{PC:0,NA:1},config:{mask:["FFFFFFFF"],open:true},url:G.apiHost+"?qt=jsapi_log",counts:{},values:{},records:{},flushInterval:30*1000,sendMessage:function(i,C,e){},init:function(i,T){this.kill();var e=this;this.config.open=!!i;T=T||{};if(T.flushInterval){this.flushInterval=T.flushInterval}var C=T.timers||200;e._idleWorkerTicker=(function(lO){return function(){lO.runJob()}})(e);e._flushTicker=setInterval(function(){e._flushAll(C)},e.flushInterval);e._firstFlushTimer=setTimeout(function(){e._flushAll(C);e._firstFlushTimer=null},5*1000);if(typeof document!=="undefined"){document.addEventListener("visibilitychange",function(){if(document.visibilityState==="hidden"){e._flushAll(C)}})}this.sendMessage=function(lQ,lR,lO){if(window.navigator&&!navigator.onLine){return}lQ=lQ||"";lR=lR||"";lO=lO||"";var lP=lQ+"-"+lR+"-"+lO;if(!e.counts[lP]){e.counts[lP]=0}e.counts[lP]++;e.values[lP]=[lQ,lR,lO]}},_flushAll:function(T){var i=false;for(var e in this.counts){if(this.counts[e]>0){var C=this.counts[e]>10000?10000:this.counts[e];this.records[e]={value:this.values[e],count:C};this.counts[e]=0;i=true}}if(i){this.checkJob(T)}},runJob:function(){if(Object.keys(this.records).length===0){clearInterval(this.idleWork);this.idleWork=null;return}var lT=Object.keys(this.records);var lS=lT[0];var T=this.records[lS]||{};var lR=T.value||[];var lO=T.count||1;var i=new Date().getTime();var C="logCbk"+Math.floor(Math.random()*10000000000);if(bS){bS[C]=function(e){delete bS[C]}}if(window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]){var lQ=this.url+"&bmapgl2=1&v=gl&device="+(cl()?this.device.NA:this.device.PC)+"&module="+(lR[0]||"")+"&func="+(lR[1]||"")+"&subfunc="+(lR[2]||"")+"&count="+lO+"&t="+i+"&callback="+gi+"."+C}else{var lQ=this.url+"&ak="+fy+"&bmapgl2=1&v=gl&device="+(cl()?this.device.NA:this.device.PC)+"&module="+(lR[0]||"")+"&func="+(lR[1]||"")+"&subfunc="+(lR[2]||"")+"&count="+lO+"&t="+i+"&callback="+gi+"."+C}lQ+=kN()(lQ);if(this.config.open){try{hL.load(lQ);delete this.records[lS]}catch(lP){}}if(Object.keys(this.records).length===0){clearInterval(this.idleWork);this.idleWork=null}},checkJob:function(e){if(!this.idleWork&&this._idleWorkerTicker){this.idleWork=setInterval(this._idleWorkerTicker,e)}},kill:function(){if(this.idleWork){clearInterval(this.idleWork);this.idleWork=null}if(this._flushTicker){clearInterval(this._flushTicker);this._flushTicker=null}if(this._firstFlushTimer){clearTimeout(this._firstFlushTimer);this._firstFlushTimer=null}this._idleWorkerTicker=null;this.counts={};this.values={};this.records={}}};iF.init(true);var c0={device:{PC:0,NA:1},config:{open:true},url:G.apiHost+"?qt=jsapi_log",sent:{},records:{},sendMessage:function(C,T,e){if(window.navigator&&!navigator.onLine){return}C=C||"";T=T||"";e=e||"";var i=C+"-"+T+"-"+e;if(this.sent[i]){return}this.sent[i]=true;this.records[i]=[C,T,e];this.checkJob()},runJob:function(){if(Object.keys(this.records).length===0){clearInterval(this.idleWork);this.idleWork=null;return}var lP=Object.keys(this.records);var T=lP[0];var lQ=this.records[T]||[];var C=new Date().getTime();var lO="logCbk"+Math.floor(Math.random()*10000000000);if(bS){bS[lO]=function(e){delete bS[lO]}}if(window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]){var i=this.url+"&bmapgl2=1&v=gl&device="+(cl()?this.device.NA:this.device.PC)+"&module="+(lQ[0]||"")+"&func="+(lQ[1]||"")+"&subfunc="+(lQ[2]||"")+"&count=1&t="+C+"&callback="+gi+"."+lO}else{var i=this.url+"&ak="+fy+"&bmapgl2=1&v=gl&device="+(cl()?this.device.NA:this.device.PC)+"&module="+(lQ[0]||"")+"&func="+(lQ[1]||"")+"&subfunc="+(lQ[2]||"")+"&count=1&t="+C+"&callback="+gi+"."+lO}i+=kN()(i);if(this.config.open){try{hL.load(i);delete this.records[T]}catch(lR){}}if(Object.keys(this.records).length===0){clearInterval(this.idleWork);this.idleWork=null}},checkJob:function(){if(!this.idleWork){var e=this;this.idleWork=setInterval(function(){e.runJob()},200)}},kill:function(){if(this.idleWork){clearInterval(this.idleWork);this.idleWork=null}this.sent={};this.records={}}};bS.WKT=(function(){var i=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/;var e=new RegExp("^"+i.source+"(\\s"+i.source+"){1,}");return{parse:function(lS){var lV=lS.split(";");var l3=lV.pop();var l0=(lV.shift()||"").split("=").pop();var lZ=0;function lP(l5){var l4=l3.substring(lZ).match(l5);if(!l4){return null}else{lZ+=l4[0].length;return l4[0]}}function lO(l4){if(l4&&l0.match(/\d+/)){l4.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+l0}}}return l4}function lQ(){lP(/^\s*/)}function lU(){lQ();var l8=0;var l6=[];var l4=[l6];var l7=l6;var l5;while(l5=lP(/^(\()/)||lP(/^(\))/)||lP(/^(,)/)||lP(e)){if(l5==="("){l4.push(l7);l7=[];l4[l4.length-1].push(l7);l8++}else{if(l5===")"){if(l7.length===0){return null}l7=l4.pop();if(!l7){return null}l8--;if(l8===0){break}}else{if(l5===","){l7=[];l4[l4.length-1].push(l7)}else{if(!l5.split(/\s/g).some(isNaN)){Array.prototype.push.apply(l7,l5.split(/\s/g).map(parseFloat))}else{return null}}}}lQ()}if(l8!==0){return null}return l6}function lY(){var l5=[];var l4;var l6;while(l6=lP(e)||lP(/^(,)/)){if(l6===","){l5.push(l4);l4=[]}else{if(!l6.split(/\s/g).some(isNaN)){if(!l4){l4=[]}Array.prototype.push.apply(l4,l6.split(/\s/g).map(parseFloat))}}lQ()}if(l4){l5.push(l4)}else{return null}return l5.length?l5:null}function lX(){if(!lP(/^(point(\sz)?)/i)){return null}lQ();if(!lP(/^(\()/)){return null}var l4=lY();if(!l4){return null}lQ();if(!lP(/^(\))/)){return null}return{type:"Point",coordinates:l4[0]}}function l1(){if(!lP(/^(multipoint)/i)){return null}lQ();var l5=l3.substring(l3.indexOf("(")+1,l3.length-1).replace(/\(/g,"").replace(/\)/g,"");l3="MULTIPOINT ("+l5+")";var l4=lU();if(!l4){return null}lQ();return{type:"MultiPoint",coordinates:l4}}function lR(){if(!lP(/^(multilinestring)/i)){return null}lQ();var l4=lU();if(!l4){return null}lQ();return{type:"MultiLineString",coordinates:l4}}function T(){if(!lP(/^(linestring(\sz)?)/i)){return null}lQ();if(!lP(/^(\()/)){return null}var l4=lY();if(!l4){return null}if(!lP(/^(\))/)){return null}return{type:"LineString",coordinates:l4}}function lT(){if(!lP(/^(polygon(\sz)?)/i)){return null}lQ();var l4=lU();if(!l4){return null}return{type:"Polygon",coordinates:l4}}function l2(){if(!lP(/^(multipolygon)/i)){return null}lQ();var l4=lU();if(!l4){return null}return{type:"MultiPolygon",coordinates:l4}}function C(){var l4=[];var l5;if(!lP(/^(geometrycollection)/i)){return null}lQ();if(!lP(/^(\()/)){return null}while(l5=lW()){l4.push(l5);lQ();lP(/^(,)/);lQ()}if(!lP(/^(\))/)){return null}return{type:"GeometryCollection",geometries:l4}}function lW(){return lX()||T()||lT()||l1()||lR()||l2()||C()}return lO(lW())},stringify:function(C){if(C.type==="Feature"){C=C.geometry}function lP(lS){return lS.join(" ")}function T(lS){return lS.map(lP).join(", ")}function lO(lS){return lS.map(T).map(lQ).join(", ")}function lR(lS){return lS.map(lO).map(lQ).join(", ")}function lQ(lS){return"("+lS+")"}switch(C.type){case"Point":return"POINT ("+lP(C.coordinates)+")";case"LineString":return"LINESTRING ("+T(C.coordinates)+")";case"Polygon":return"POLYGON ("+lO(C.coordinates)+")";case"MultiPoint":return"MULTIPOINT ("+T(C.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON ("+lR(C.coordinates)+")";case"MultiLineString":return"MULTILINESTRING ("+lO(C.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION ("+C.geometries.map(stringify).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}}}})();var cu=(function(lP){var lT=Object.create||(function(){function C(){}return function(lZ){var lY;C.prototype=lZ;lY=new C();C.prototype=null;return lY}}());var e={};var i=e.lib={};var lU=i.Base=(function(){return{extend:function(lY){var C=lT(this);if(lY){C.mixIn(lY)}if(!C.hasOwnProperty("init")||this["init"]===C.init){C.init=function(){C.$super.init.apply(this,arguments)}}C.init.prototype=C;C.$super=this;return C},create:function(){var C=this.extend();C.init.apply(C,arguments);return C},init:function(){},mixIn:function(lY){for(var C in lY){if(lY.hasOwnProperty(C)){this[C]=lY[C]}}if(lY.hasOwnProperty("toString")){this.toString=lY.toString}},clone:function(){return this["init"].prototype.extend(this)}}}());var lW=i.WordArray=lU.extend({init:function(lY,C){lY=this.words=lY||[];if(C!=undefined){this.sigBytes=C}else{this.sigBytes=lY.length*4}},toString:function(C){return(C||lR).stringify(this)},concat:function(l3){var l0=this.words;var lZ=l3.words;var C=this.sigBytes;var l2=l3.sigBytes;this.clamp();if(C%4){for(var l1=0;l1>>2]>>>(24-(l1%4)*8))&255;l0[(C+l1)>>>2]|=lY<<(24-((C+l1)%4)*8)}}else{for(var l1=0;l1>>2]=lZ[l1>>>2]}}this.sigBytes+=l2;return this},clamp:function(){var lY=this.words;var C=this.sigBytes;lY[C>>>2]&=4294967295<<(32-(C%4)*8);lY.length=lP.ceil(C/4)},clone:function(){var C=lU.clone.call(this);C.words=this.words.slice(0);return C},random:function(l2){var l1=[];var lZ=(function(l5){var l5=l5;var l4=987654321;var l3=4294967295;return function(){l4=(36969*(l4&65535)+(l4>>16))&l3;l5=(18000*(l5&65535)+(l5>>16))&l3;var l6=((l4<<16)+l5)&l3;l6/=4294967296;l6+=0.5;return l6*(lP.random()>0.5?1:-1)}});for(var lY=0,C;lY>>2]>>>(24-(C%4)*8))&255;l0.push((l2>>>4).toString(16));l0.push((l2&15).toString(16))}return l0.join("")},parse:function(lZ){var C=lZ.length;var l0=[];for(var lY=0;lY>>3]|=parseInt(lZ.substr(lY,2),16)<<(24-(lY%8)*4)}return new lW.init(l0,C/2)}};var lO=lX.Latin1={stringify:function(l0){var l1=l0.words;var lZ=l0.sigBytes;var C=[];for(var lY=0;lY>>2]>>>(24-(lY%4)*8))&255;C.push(String.fromCharCode(l2))}return C.join("")},parse:function(lZ){var C=lZ.length;var l0=[];for(var lY=0;lY>>2]|=(lZ.charCodeAt(lY)&255)<<(24-(lY%4)*8)}return new lW.init(l0,C)}};var T=lX.Utf8={stringify:function(C){try{return decodeURIComponent(escape(lO.stringify(C)))}catch(lY){throw new Error("Malformed UTF-8 data")}},parse:function(C){return lO.parse(unescape(encodeURIComponent(C)))}};var lS=i.BufferedBlockAlgorithm=lU.extend({reset:function(){this._data=new lW.init();this._nDataBytes=0},_append:function(C){if(typeof C=="string"){C=T.parse(C)}this._data.concat(C);this._nDataBytes+=C.sigBytes},_process:function(l6){var l0=this._data;var l7=l0.words;var C=l0.sigBytes;var l3=this.blockSize;var l5=l3*4;var l4=C/l5;if(l6){l4=lP.ceil(l4)}else{l4=lP.max((l4|0)-this._minBufferSize,0)}var l2=l4*l3;var l1=lP.min(l2*4,C);if(l2){for(var lZ=0;lZ>>7))^((lU<<14)|(lU>>>18))^(lU>>>3);var l0=C[l4-2];var md=((l0<<15)|(l0>>>17))^((l0<<13)|(l0>>>19))^(l0>>>10);C[l4]=me+C[l4-7]+md+C[l4-16]}var l1=(l8&l7)^(~l8&l6);var lT=(mc&mb)^(mc&ma)^(mb&ma);var l3=((mc<<30)|(mc>>>2))^((mc<<19)|(mc>>>13))^((mc<<10)|(mc>>>22));var l2=((l8<<26)|(l8>>>6))^((l8<<21)|(l8>>>11))^((l8<<7)|(l8>>>25));var lY=l5+l2+l1+lR[l4]+C[l4];var lX=l3+lT;l5=l6;l6=l7;l7=l8;l8=(l9+lY)|0;l9=ma;ma=mb;mb=mc;mc=(lY+lX)|0}lZ[0]=(lZ[0]+mc)|0;lZ[1]=(lZ[1]+mb)|0;lZ[2]=(lZ[2]+ma)|0;lZ[3]=(lZ[3]+l9)|0;lZ[4]=(lZ[4]+l8)|0;lZ[5]=(lZ[5]+l7)|0;lZ[6]=(lZ[6]+l6)|0;lZ[7]=(lZ[7]+l5)|0},_doFinalize:function(){var lV=this._data;var lW=lV.words;var lT=this._nDataBytes*8;var lU=lV.sigBytes*8;lW[lU>>>5]|=128<<(24-lU%32);lW[(((lU+64)>>>9)<<4)+14]=i.floor(lT/4294967296);lW[(((lU+64)>>>9)<<4)+15]=lT;lV.sigBytes=lW.length*4;this._process();return this._hash},clone:function(){var lT=T.clone.call(this);lT._hash=this._hash.clone();return lT}});lc.SHA256=T._createHelper(lO);lc.HmacSHA256=T._createHmacHelper(lO)}(Math));cu.SHA256=lc.SHA256;cu.HmacSHA256=lc.HmacSHA256;var bV=(function(){try{return typeof BigInt!=="undefined"&&typeof BigInt("1")!=="undefined"}catch(i){return false}})();function bs(lP,lQ){var lO=cu.SHA256(cu.enc.Utf8.parse(lP));var T=lO.toString(cu.enc.Hex);var e=[];for(var C=0;ClO){if(lR&C){i=(i*lP)%T}lR>>=C;if(lR>lO){lP=(lP*lP)%T}}return i}catch(lQ){throw new Error("BigInt operation failed")}}function a3(e){if(typeof e==="string"){if(e.indexOf("0x")===0||e.indexOf("0X")===0){e=e.substring(2)}this.value=this.hexToArray(e)}else{if(typeof e==="number"){this.value=this.numToArray(e)}else{if(e instanceof Array){this.value=e.slice()}else{this.value=[0]}}}this.normalize()}a3.prototype.hexToArray=function(T){var e=[];for(var C=T.length-2;C>=0;C-=2){e.push(parseInt(T.substr(C,2),16))}if(T.length%2===1){e.push(parseInt(T.charAt(0),16))}return e};a3.prototype.numToArray=function(i){if(i===0){return[0]}var e=[];while(i>0){e.push(i&255);i=Math.floor(i/256)}return e};a3.prototype.normalize=function(){while(this.value.length>1&&this.value[this.value.length-1]===0){this.value.pop()}};a3.prototype.isZero=function(){return this.value.length===1&&this.value[0]===0};a3.prototype.compare=function(e){if(this.value.length!==e.value.length){return this.value.length-e.value.length}for(var C=this.value.length-1;C>=0;C--){if(this.value[C]!==e.value[C]){return this.value[C]-e.value[C]}}return 0};a3.prototype.add=function(T){var C=[];var lS=0;var lP=Math.max(this.value.length,T.value.length);for(var lQ=0;lQ0){C.push(lS)}return new a3(C)};a3.prototype.subtract=function(T){var C=[];var lR=0;var lP=Math.max(this.value.length,T.value.length);for(var lQ=0;lQ=0){var e=new a3(T.value);while(true){var i=new a3(e.value);i.value.unshift(0);if(i.compare(C)>0){break}e=i}C=C.subtract(e)}return C};function c9(lP,lR,lO){lP=lP.mod(lO);var e=new a3(1);while(!lR.isZero()){if(lR.value[0]&1){e=e.multiply(lP).mod(lO)}var lQ=0;for(var T=lR.value.length-1;T>=0;T--){var C=lR.value[T]|(lQ<<8);lR.value[T]=C>>1;lQ=C&1}lR.normalize();if(!lR.isZero()){lP=lP.multiply(lP).mod(lO)}}return e}function iQ(i){var e=i.toLowerCase().replace(/^0x/,"");if(!/^[0-9a-f]+$/.test(e)){throw new Error("invalid hex")}return new a3(e)}function fH(T,C,i,lP){if(!T||!C||!i||!lP){if(lP){lP(false)}return}if(bV){try{jX(T,C,i,lP)}catch(lO){a9(T,C,i,lP)}}else{a9(T,C,i,lP)}}function jX(C,i,e,T){bs(C,function(lV){try{var lO=BigInt(0);var lQ=BigInt(256);for(var lR=0;lR<8;lR++){lO=(lO*lQ+BigInt(lV[lR]))%e.n}var lS=k5(i);var lT=BigInt(0);if(lS=e.n){T(false);return}var lP=k1(lS,e.e,e.n);T(lP===lO)}catch(lU){a9(C,i,e,T)}})}function a9(C,i,e,T){bs(C,function(lV){try{var lO=new a3(0);var lQ=new a3(256);for(var lR=0;lR<8;lR++){lO=lO.multiply(lQ);var lU=new a3(lV[lR]);lO=lO.add(lU);lO=lO.mod(e.n)}var lS=iQ(i);if(lS.compare(new a3(0))<0||lS.compare(e.n)>=0){T(false);return}var lP=c9(lS,e.e,e.n);T(lP.compare(lO)===0)}catch(lT){T(false)}})}var eX;if(bV){eX={n:BigInt(9173503),e:BigInt(65537)}}else{eX={n:new a3(9173503),e:new a3(65537)}}if(window.B_BUSINESS_INFO){fH(window.B_BUSINESS_INFO["sign_content"],window.B_BUSINESS_INFO["signature"],eX,function(e){if(!e){var i=cd.popup_code;c0.sendMessage("sign_check","sign_error",i)}else{if(cd.business===0&&cd.unauth===1){cW(hw,{from:"vtile"})}}})}var kg=(function(){var l0={};var lZ="HIGH";var lT="FOCUS";var C={};var T;function i(l1){var l6=l1||[];for(var l7=0;l7')}else{var i='
';if(e&&e.config.autoSafeArea&&cZ()){this._safeAreaContainer=b5(this._map.container,i);this._safeAreaContainer.style.position="absolute";this._safeAreaContainer.style.bottom="env(safe-area-inset-bottom)";this._container=b5(this._safeAreaContainer,i)}else{this._container=b5(this._map.container,i)}}if(this._visible===false){this._container.style.display="none"}return this._container},_setPosition:function(){this.setAnchor(this._opts.anchor)},setAnchor:function(T){if(this.anchorFixed||typeof T!=="number"||isNaN(T)||TBMAP_ANCHOR_BOTTOM_RIGHT){T=this.defaultAnchor}this._opts.offset=this._opts.offset||this.defaultOffset;var C=this._opts.anchor;this._opts.anchor=T;if(!this._container){return}var lP=this._container;var e=this._opts.offset.width;var lO=this._opts.offset.height;lP.style.left=lP.style.top=lP.style.right=lP.style.bottom="auto";switch(T){case BMAP_ANCHOR_TOP_LEFT:lP.style.top=lO+"px";lP.style.left=e+"px";break;case BMAP_ANCHOR_TOP_RIGHT:lP.style.top=lO+"px";lP.style.right=e+"px";break;case BMAP_ANCHOR_BOTTOM_LEFT:lP.style.bottom=lO+"px";lP.style.left=e+"px";break;case BMAP_ANCHOR_BOTTOM_RIGHT:lP.style.bottom=lO+"px";lP.style.right=e+"px";break;default:break}var i=["TL","TR","BL","BR"];fK.rc(this._container,"anchor"+i[C]);fK.ac(this._container,"anchor"+i[T])},getAnchor:function(){return this._opts.anchor},setOffset:function(e){if(!e){return}this._opts=this._opts||{};this._opts.offset=new kp(e.width,e.height);if(!this._container){return}this.setAnchor(this._opts.anchor)},getOffset:function(){return this._opts.offset},getDom:function(){return this._container},show:function(){if(this._visible===true){return}this._visible=true;if(this._container){this._container.style.display=""}this.dispatchEvent(new gC("onshow"))},hide:function(){if(this._visible===false){return}this._visible=false;if(this._container){this._container.style.display="none"}this.dispatchEvent(new gC("onhide"))},isPrintable:function(){return !!this._opts.printable},isVisible:function(){if(!this._container&&!this._map){return false}return !!this._visible},_asyncLoadCode:function(){var e=this;h6.load("control",function(){if(e._asyncDraw){e._asyncDraw()}})}});var eY={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_LEFT:2,BOTTOM_RIGHT:3};bS.ControlAnchor=eY;window.BMAP_ANCHOR_TOP_LEFT=0;window.BMAP_ANCHOR_TOP_RIGHT=1;window.BMAP_ANCHOR_BOTTOM_LEFT=2;window.BMAP_ANCHOR_BOTTOM_RIGHT=3;function g3(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("CopyrightControl")}hG.call(this);e=e||{};this._opts={printable:false};fK.extend(this._opts,e);this._copyrightCollection=[];this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new kp(5,2);this.setAnchor(e.anchor);this._canShow=true;this.sateMapStyle=false;this.blockInfoWindow=false;this._asyncLoadCode()}g3.inherits(hG,"CopyrightControl");fK.extend(g3.prototype,{initialize:function(e){this._map=e;return this._container},addCopyright:function(T){var e={minZoom:0,bounds:null,content:"",mapType:""};for(var C in T){e[C]=T[C]}if(this._map){var lQ=e.minZoom;if(lQ===-1||lQthis._map.getMaxZoom()){e.minZoom=this._map.getMinZoom()}if(e.mapType!==""&&!e1[e.mapType]){e.mapType=BMAP_NORMAL_MAP}}var lO=this.getCopyright(T.id);if(lO){for(var lP in e){lO[lP]=e[lP]}}else{this._copyrightCollection.push(e)}},getCopyright:function(T){for(var C=0,e=this._copyrightCollection.length;CBMAP_NAVIGATION_CONTROL_ZOOM){this._opts.type=BMAP_NAVIGATION_CONTROL_LARGE;return}this._opts.type=e},getType:function(){return this._opts.type}});window.BMAP_MAPTYPE_CONTROL_HORIZONTAL=0;window.BMAP_MAPTYPE_CONTROL_DROPDOWN=1;window.BMAP_MAPTYPE_CONTROL_MAP=2;function B(i){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("MapTypeControl")}hG.call(this);i=i||{};this._opts={printable:false,type:i.type||BMAP_MAPTYPE_CONTROL_MAP,mapTypes:[BMAP_NORMAL_MAP,BMAP_EARTH_MAP,BMAP_HYBRID_MAP]};this.defaultAnchor=BMAP_ANCHOR_TOP_RIGHT;this.defaultOffset=new kp(10,10);this.setAnchor(i.anchor);this._opts=fK.extend(fK.extend(this._opts,{offset:this.defaultOffset,enableSwitch:true}),i);if(i.mapTypes instanceof Array){this._opts.mapTypes=i.mapTypes.slice(0)}var e=this;h6.load("control",function(){e._asyncDraw()})}B.inherits(hG,"MapTypeControl");fK.extend(B.prototype,{initialize:function(e){this._map=e;return this._container},showStreetLayer:function(e){this._map.showStreetLayer(e)}});function kC(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("ZoomControl")}hG.call(this);e=e||{};this._opts={};this._opts=fK.extend(this._opts,e);this._zoomInDisabled=false;this._zoomOutDisabled=false;this._zoomInTapped=false;this._zoomOutTapped=false;this.defaultAnchor=eY.BOTTOM_RIGHT;this.defaultOffset=new kp(15,20);this.setAnchor(e.anchor);this._asyncLoadCode()}kC.inherits(hG,"ZoomControl");fK.extend(kC.prototype,{initialize:function(e){this._map=e;return this._container}});function hl(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("LocationControl")}hG.call(this);e=e||{};this._opts={autoZoom:true,autoViewport:true,showAddressBar:G.apiVersion==="3.0",enableAutoLocation:false,locationIcon:null,};this._opts=fK.extend(this._opts,e);this.defaultAnchor=eY.BOTTOM_LEFT;this.defaultOffset=new kp(10,50);this.watchPosition=this._opts.watchPosition||false;this.useCompass=this._opts.useCompass||false;this.locMarker=null;this.locLevel=16;this.addressComponent=null;this.setAnchor(this._opts.anchor);this.onLocationStart=e.onLocationStart||null;this._asyncLoadCode()}hl.inherits(hG,"LocationControl");fK.extend(hl.prototype,{initialize:function(e){this._map=e;return this._container},startLocation:function(){this._startLocationCalled=true},location:function(){this.startLocation()},getAddressComponent:function(){return this.addressComponent},stopLocationTrace:function(){},setOptions:function(e){e=e||{};fK.extend(this._opts,e)}});function bX(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("LogoControl")}hG.call(this);e=e||{};this._opts={};this._opts=fK.extend(this._opts,e);this.defaultAnchor=eY.BOTTOM_LEFT;this.defaultOffset=new kp(5,15);if(cl()){this.defaultOffset=new kp(10,10)}this.setAnchor(e.anchor)}bX.inherits(hG,"LogoControl");fK.extend(bX.prototype,{initialize:function(i){this._map=i;var e=this._container=document.createElement("div");e.innerHTML='';i.getContainer().appendChild(e);return e}});function lj(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("OverviewMapControl")}hG.call(this);e=e||{};this._opts={printable:false,zoomInterval:4,isOpen:Boolean(e.isOpen),size:e.size||new kp(150,150),padding:5};this._opts=fK.extend(this._opts,e);this.defaultAnchor=eY.BOTTOM_RIGHT;this.defaultOffset=new kp(0,0);this.setSize(this._opts.size);this.setAnchor(this._opts.anchor);this._asyncLoadCode()}lj.inherits(hG,"OverviewMapControl");fK.extend(lj.prototype,{initialize:function(e){this._map=e;return this._container},remove:function(){hG.prototype.remove.call(this)},isOpen:function(){return this._opts.isOpen},changeView:function(){this._opts.isOpen=!this._opts.isOpen},setSize:function(e){if(!(e instanceof kp)){e=new kp(150,150)}if(e.width<=0){e.width=150}if(e.height<=0){e.height=150}this._opts.size=e},getSize:function(){return this._opts.size},});function aF(e,i){this._map=e;this._indoorInfo=i;this._visible=true;this._adjustVisible=true;this._isMobile=cl();this._sizeConfig={FLOOR_BTN_HEIGHT:this._isMobile?35:26,SWITCH_ARROW_HEIGHT:this._isMobile?20:15};this._init()}aF.prototype._init=function(){this._render();this._bindDom();this._bind();this._adjustDisplayHeight();var e=new gC("onindoor_bar_show");e.uid=this._indoorInfo.uid;e.floors=this._indoorInfo.floors;this._map.dispatchEvent(e)};aF.prototype._render=function(){if(!this._indoorInfo){return}var lR=this._isMobile;var e=this._div=cm("div");fK.ac(e,"floor-select-container");lR&&fK.ac(e,"mobile");lR&&fK.ac(e,"all-border-radius");var i=this._btnTop=cm("button");fK.ac(i,"floor-switch-top");fK.ac(i,"top-border-radius");var lP=cm("div");fK.ac(lP,"floor-switch-top-icon");i.appendChild(lP);var lO=this._btnBottom=cm("button");var C=cm("div");fK.ac(C,"floor-switch-bottom-icon");lO.appendChild(C);fK.ac(lO,"floor-switch-bottom");fK.ac(lO,"bottom-border-radius");var T=this._floorsContainer=cm("div");fK.ac(T,"floors-container");T.appendChild(this._createFloorsDom());this._div.appendChild(i);this._div.appendChild(T);this._div.appendChild(lO);var lS=0;if(this._btnTop.style.display===""){lS=2*this._sizeConfig.SWITCH_ARROW_HEIGHT}this._div.style.height=parseInt(this._floorsContainer.style.height,10)+lS+"px";this._map.getContainer().appendChild(this._div);if(!lR){var lQ=this;setTimeout(function(){lQ._div.style.right="20px"},20)}};aF.prototype._createFloorsDom=function(){if(!this._indoorInfo){return}var C=this._ol=cm("ol");var lP=this._indoorInfo.currentFloor;for(var lO=this._indoorInfo.floors.length-1;lO>=0;lO--){var lQ=this._indoorInfo.floors[lO].floorName;var e=cm("li");var T=cm("button");fK.ac(T,"btn-select-floor");if(lO===lP){fK.ac(T,"selected")}T.setAttribute("data-floor",lO);T.innerHTML=lQ;e.appendChild(T);C.appendChild(e)}return C};aF.prototype._updateUI=function(){if(!this._ol){this._render();this._bind();this._adjustDisplayHeight();return}this._ol=null;this._ol=this._createFloorsDom();this._floorsContainer.innerHTML="";this._floorsContainer.appendChild(this._ol);this._adjustDisplayHeight()};aF.prototype._bindDom=function(){var e=this;fK.on(this._floorsContainer,"click",function(T){var C=T.target||T.srcElement;if(C.tagName.toLowerCase()==="button"){e._map.showIndoor(e._indoorInfo.uid,parseInt(C.getAttribute("data-floor"),10));var i=new gC("onindoor_bar_click");i.uid=e._indoorInfo.uid;e._map.dispatchEvent(i)}});fK.on(this._floorsContainer,"mouseover",function(C){var i=C.target;if(i.tagName.toLowerCase()==="button"){fK.ac(i,"hover")}});fK.on(this._floorsContainer,"mouseout",function(C){var i=C.target;if(i.tagName.toLowerCase()==="button"){fK.rc(i,"hover")}});fK.on(this._floorsContainer,"touchstart",function(C){var i=C.target;if(i.tagName.toLowerCase()==="button"){fK.ac(i,"onmousedown")}});fK.on(this._floorsContainer,"touchend",function(C){var i=C.target;if(i.tagName.toLowerCase()==="button"){fK.rc(i,"onmousedown")}});fK.on(this._btnTop,"mouseover",function(i){if(this._disable){return}fK.ac(this,"hover")});fK.on(this._btnTop,"mouseout",function(i){fK.rc(this,"hover")});fK.on(this._btnBottom,"mouseover",function(i){if(this._disable){return}fK.ac(this,"hover")});fK.on(this._btnBottom,"mouseout",function(i){fK.rc(this,"hover")});fK.on(this._btnTop,"touchstart",function(i){if(this.className.indexOf("disable")>-1){return}fK.ac(this,"onmousedown")});fK.on(this._btnTop,"touchend",function(i){fK.rc(this,"onmousedown")});fK.on(this._btnBottom,"touchstart",function(i){if(this.className.indexOf("disable")>-1){return}fK.ac(this,"onmousedown")});fK.on(this._btnBottom,"touchend",function(i){fK.rc(this,"onmousedown")});fK.on(this._btnTop,"click",function(i){e._setBarSliderTop(parseInt(e._ol.style.top,10)+26)});fK.on(this._btnBottom,"click",function(i){e._setBarSliderTop(parseInt(e._ol.style.top,10)-26)});fK.on(this._div,"mousemove",ap);fK.on(this._div,"wheel",iw);fK.on(this._div,"mousewheel",iw);this._map.addEventListener("resize",function(){e._adjustDisplayHeight()})};aF.prototype._adjustDisplayHeight=function(){if(!this._indoorInfo){return}var lP=this._map.getSize().height;var lQ=this._sizeConfig.FLOOR_BTN_HEIGHT;var lR=lP-291-100;if(this._isMobile){lR=lP-12-108-this._map.config.bottomOffset}var e=this._indoorInfo.floors.length;var C=e*lQ;var T=e;var lT=0;var lU=this._floorsContainer.children[0];if(C>lR){this._showArrow=true;fK.rc(lU.children[0].children[0],"top-border-radius");fK.rc(lU.children[e-1].children[0],"bottom-border-radius")}else{this._showArrow=false;fK.ac(lU.children[0].children[0],"top-border-radius");fK.ac(lU.children[e-1].children[0],"bottom-border-radius")}while(C>lR){if(T===0){break}T--;lT=2*this._sizeConfig.SWITCH_ARROW_HEIGHT;C=T*lQ+lT}this._currentDisplayHeight=C;if(T<3){this._setAdjustVisbile(false)}else{this._setAdjustVisbile(true)}this._floorsContainer.style.height=T*lQ+"px";var lO=this._indoorInfo.currentFloor;var i=e-lO;var lS=lO-1;this._div.style.height=parseInt(this._floorsContainer.style.height,10)+lT+"px";var lV=-(e-(lO+Math.round(T/2)))*lQ;this._setBarSliderTop(lV);if(T=i*C){T=e-i*C;fK.ac(this._btnBottom,"disable");fK.rc(this._btnBottom,"hover");this._btnBottom._disable=true}else{fK.rc(this._btnBottom,"disable");this._btnBottom._disable=false}if(T>=0){T=0;fK.ac(this._btnTop,"disable");fK.rc(this._btnTop,"hover");this._btnTop._disable=true}else{fK.rc(this._btnTop,"disable");this._btnTop._disable=false}this._ol.style.top=T+"px"};aF.prototype._setAdjustVisbile=function(e){if(this._adjustVisible===e){return}this._adjustVisible=e;if(e&&this._visible){this._div.style.right="20px"}else{this._div.style.right="-30px"}};aF.prototype._bind=function(){var i=this._map;var e=this;i.on("indoor_status_changed",function(lR){if(e._visible===false){return}var C=e._ol;var lP=lR.uid;if(!lP){return}var lQ=lR.floor;for(var lO=0;lO=iX.HIGH_RES_MIN_RATIO?2:1;this._imgPath=G.imgPath+"earth-navi-control-pc4"+(this._imgRatio===2?"-2x.png":".png");this._enabled=true;var e=this;this._setHeadingOptions={callback:function(){e._target.setLock(false)}};this._init()}fK.extend(j2.prototype,{_init:function(){this._createDom();this._render();this._bindDom();this._bind();this._updateUI();this._checkEnable()},_checkEnable:function(){if(this._target.getZoom()>=this._target._enableHeadingZoom){this.enable()}else{this.disable()}},_createDom:function(){var i=this._div=cm("div");var e=i.style;e.position="absolute";e.zIndex=5;e.top="0";e.left="0";e.width="52px";e.height="54px";e.background="url("+this._imgPath+") no-repeat";e.backgroundSize="266px auto";this._rotateCCW=this._createButton();this._rotateCCW.title="逆时针转动";e=this._rotateCCW.style;e.left="2px";e.top="5px";e.zIndex="1";e.width="15px";e.height="42px";e.backgroundPosition="-75px -5px";this._rotateCW=this._createButton();this._rotateCW.title="顺时针转动";e=this._rotateCW.style;e.right="2px";e.top="5px";e.zIndex="1";e.width="15px";e.height="42px";e.backgroundPosition="-75px -5px";e.WebkitTransform=e.transform="scaleX(-1)";this._compass=this._createButton();this._compass.title="恢复正北方向";e=this._compass.style;e.left="19px";e.top="4px";e.width="14px";e.height="44px";e.backgroundPosition="-56px -4px";e.WebkitTransform=e.transform="rotate(0deg)";this._div.appendChild(this._rotateCCW);this._div.appendChild(this._compass);this._div.appendChild(this._rotateCW);this._domRendered=true},_createButton:function(){var e=cm("button");var i=e.style;i.position="absolute";i.outline="none";i.border="none";i.background="url("+this._imgPath+") no-repeat";i.backgroundSize="266px auto";i.cursor="pointer";return e},_render:function(){this._outContainer.appendChild(this._div)},enable:function(){this._enabled=true;if(this._domRendered){this._rotateCCW.style.cursor="pointer";this._rotateCCW.style.opacity=1;this._rotateCW.style.cursor="pointer";this._rotateCW.style.opacity=1;this._compass.style.cursor="pointer";this._compass.style.opacity=1}},disable:function(){this._enabled=false;if(this._domRendered){this._rotateCCW.style.cursor="";this._rotateCCW.style.opacity=0.4;this._rotateCW.style.cursor="";this._rotateCW.style.opacity=0.4;this._compass.style.cursor="";this._compass.style.opacity=0.4}},_bindDom:function(){jR(this._div,["mousedown","click","dblclick"]);var i=this._map;var e=this;this._rotateCW.addEventListener("click",function(){if(e._isOperating||e._enabled===false){return}if(e._target.getLock()){return}if(e._target.getHeading()===360){e._target.setHeading(0)}e._target.setLock(true);e._target.setHeading(e._target.getHeading()+90,e._setHeadingOptions);i.fire(new gC("onrotatecwclick"))},false);this._rotateCCW.addEventListener("click",function(){if(e._isOperating||e._enabled===false){return}if(e._target.getLock()){return}if(e._target.getHeading()===-360){e._target.setHeading(0)}e._target.setLock(true);e._target.setHeading(e._target.getHeading()-90,e._setHeadingOptions);i.fire(new gC("onrotateccwclick"))},false);this._rotateCW.addEventListener("mouseover",function(){if(e._enabled===false){return}this.style.backgroundPosition="-89px -5px"},false);this._rotateCW.addEventListener("mouseout",function(){if(e._enabled===false){return}this.style.backgroundPosition="-75px -5px"},false);this._rotateCCW.addEventListener("mouseover",function(){if(e._enabled===false){return}this.style.backgroundPosition="-89px -5px"},false);this._rotateCCW.addEventListener("mouseout",function(){if(e._enabled===false){return}this.style.backgroundPosition="-75px -5px"},false);this._compass.addEventListener("click",function(){if(e._isOperating||e._enabled===false){return}if(e._target.getLock()){return}e._target.setLock(true);var C=false;if(e._target.getTilt()!==0){C=true;e._target.setTilt(0,e._setHeadingOptions)}if(e._target.getHeading()%360!==0){C=true;e._target.resetHeading(e._setHeadingOptions)}if(!C){e._target.setLock(false)}i.fire(new gC("oncompassclick"))},false)},_bind:function(){var e=this;this._bindTarget(this._target);if(this._map._renderType==="webgl"){this._map.addEventListener("maptypechange",function(i){if(this.mapType==="B_EARTH_MAP"){e._target=e._map._earth}else{e._target=e._map}e._bindTarget(e._target);e._checkEnable()})}},_bindTarget:function(i){if(i===this._map&&this._mapBinded){return}if(i===this._map._earth&&this._earthBinded){return}var e=this;i.addEventListener("heading_changed",function(C){e._updateUI()});i.addEventListener("animation_start",function(C){e._isOperating=true});i.addEventListener("animation_end",function(C){e._isOperating=false});i.on("load",function(){e._checkEnable()});i.on("zoom_changed",function(){e._checkEnable()});if(i===this._map){this._mapBinded=true}else{this._earthBinded=true}},_updateUI:function(){var e=this._target.getHeading();var i=this._compass.style;i.WebkitTransform=i.transform="rotate("+e+"deg)"},hide:function(){this._div.style.display="none"},show:function(){this._div.style.display="block"}});function dr(C,i){this._map=C;this._target=C;var T=C.temp.originMapType||C.mapType;if(T==="B_EARTH_MAP"&&C._earth){this._target=C._earth}this._outContainer=i||C.getContainer();this._imgRatio=g9()>=iX.HIGH_RES_MIN_RATIO?2:1;this._imgPath=G.imgPath+"gl-navi-control-pc4"+(this._imgRatio===2?"-2x.png":".png");this._enabled=true;var e=this;this._setTiltOptions={callback:function(){e._target.setLock(false)}};this._init()}fK.extend(dr.prototype,{_init:function(){this._createDom();this._render();this._bindDom();this._bind();this._checkEnable()},_checkEnable:function(){if(this._target.getZoom()>=this._target._enableTiltZoom){this.enable()}else{this.disable()}},_createDom:function(){var e=this._div=cm("button");e.title="倾斜";var i=e.style;i.position="absolute";i.zIndex=5;i.outline="none";i.border="none";i.cursor="pointer";i.width="26px";i.height="26px";i.top="56px";i.right="13px";i.background="url("+this._imgPath+") no-repeat #fff";i.backgroundSize="266px auto";i.backgroundPosition="-110px 1px";i.boxShadow="1px 2px 1px rgba(0, 0, 0, 0.15)"},enable:function(){this._enabled=true;if(this._div){this._div.style.cursor="pointer"}this._updateUI()},disable:function(){this._enabled=false;if(this._div){this._div.style.cursor=""}this._updateUI()},_render:function(){this._outContainer.appendChild(this._div)},_bindDom:function(){var e=this;this._div.addEventListener("mousedown",function(T){if(!e._enabled){return}if(e._target.getLock()){return}var i=e._target.getTilt();var C;if(i===e._map.getCurrentMaxTilt()){C="out"}else{if(i===0){C="in"}else{C=e._preTrend?e._preTrend:"in"}}e._curTrend=C;e._clickTimer=setTimeout(function(){e._map.fire(new gC("ontiltmsdown"));e._tiltAni=new gr({duration:9999999,render:function(lO){i=e._target.getTilt();if(C==="in"&&i0){e._target.setTilt(i-1,{noAnimation:true})}}},finish:function(){e._tiltAni=null}});e._clickTimer=null},200);T.stopPropagation()},false);this._div.addEventListener("mouseup",function(i){if(!e._enabled){return}if(e._tiltAni){e._tiltAni.stop()}e._preTrend=e._curTrend},false);this._div.addEventListener("click",function(T){if(!e._enabled){return}if(!e._clickTimer){return}if(e._target.getLock()){return}clearTimeout(e._clickTimer);e._map.fire(new gC("ontiltclick"));var i=e._target.getTilt();e._target.setLock(true);T.stopPropagation();var C=e._map.getCurrentMaxTilt();if(e._curTrend==="in"){e._target.setTilt(C,e._setTiltOptions)}else{if(e._curTrend==="out"){e._target.setTilt(0,e._setTiltOptions)}else{if(i0){i=78}if(this._mouseOver){e=52}if(this._enabled===false){T=26;e=0;i=0}var lO="-"+(110+i+T+e)+"px 1px";this._div&&(this._div.style.backgroundPosition=lO);if(this._enabled){if(C>0){this._div&&(this._div.title="恢复")}else{this._div&&(this._div.title="倾斜")}}else{this._div&&(this._div.title="请放大地图后操作")}},hide:function(){this._div.style.display="none"},show:function(){this._div.style.display="block"}});function iu(i){dH.call(this);this._opts={container:null,cursor:"default",marker:true};this._opts=fK.extend(this._opts,i);this._type="contextmenu";this._map=null;this._container;this._left=0;this._top=0;this._items=[];this._rItems=[];this._dividers=[];this._enable=true;this.curPixel=null;this.curPoint=null;this._isOpen=false;var e=this;h6.load("menu",function(){e._draw()})}iu.inherits(dH,"ContextMenu");fK.extend(iu.prototype,{initialize:function(i,e){this._map=i;this._overlay=e||null},remove:function(){this._map=this._overlay=null},addItem:function(lO,e){if(!lO||lO._type!="menuitem"||lO._text==""||lO._width<=0){return}for(var T=0,C=this._items.length;Tthis._items.length-1){e=-1}lO._insertIndex=e;if(e===-1){this._items.push(lO);this._rItems.push(lO)}else{this._items.splice(e,0,lO);this._rItems.splice(e,0,lO)}},removeItem:function(T){if(!T||T._type!="menuitem"){return}for(var C=0,e=this._items.length;Cthis._items.length-1){e=-1}var i={_type:"divider",_dIndex:this._dividers.length,_insertIndex:e};this._dividers.push({dom:null});if(e===-1){this._items.push(i)}else{this._items.splice(e,0,i)}},removeSeparator:function(C){if(!this._dividers[C]){return}for(var T=0,e=this._items.length;TC){this._items[T]._dIndex--}}this._dividers.splice(C,1)},getDom:function(){return this._container},show:function(){if(this._isOpen==true){return}this._isOpen=true},hide:function(){if(this._isOpen==false){return}this._isOpen=false},setCursor:function(e){if(!e){return}this._opts.cursor=e},getItem:function(e){return this._rItems[e]},enable:function(){this._enable=true},disable:function(){this._enable=false}});function jc(C,T,i){if(!C||!T||typeof T!="function"){return}dH.call(this);this._opts={width:100,id:""};i=i||{};this._opts.width=(i.width*1)?i.width:100;this._opts.id=i.id?i.id:"";this._text=C+"";this._callback=T;this._map=null;this._type="menuitem";this._contextmenu=null;this._container=null;this._enabled=true;var e=this;h6.load("menu",function(){e._draw()})}jc.inherits(dH,"MenuItem");fK.extend(jc.prototype,{initialize:function(e,i){this._map=e;this._contextmenu=i},remove:function(){this._contextmenu=null;this._map=null},setText:function(e){if(!e){return}this._text=e+""},getDom:function(){return this._container},enable:function(){this._enabled=true},disable:function(){this._enabled=false}});function je(e,i){this.setSouthWest(e);this.setNorthEast(i)}fK.extend(je.prototype,{isEmpty:function(){return this.sw===null&&this.ne===null},equals:function(e){if(!e||e.isEmpty()||this.isEmpty()){return false}return this.sw.equals(e.sw)&&this.ne.equals(e.ne)},containsBounds:function(e){if(!e||e.isEmpty()||this.isEmpty()){return false}return(e.sw.lng>this.sw.lng&&e.ne.lngthis.sw.lat&&e.ne.latef.HALF_SIZE){e-=ef.HALF_SIZE*2}return new c4(e,(this.sw.lat+this.ne.lat)/2)}},intersects:function(C){if(!C||C.isEmpty()||this.isEmpty()){return null}if(Math.max(C.sw.lng,C.ne.lng)Math.max(this.sw.lng,this.ne.lng)||Math.max(C.sw.lat,C.ne.lat)Math.max(this.sw.lat,this.ne.lat)){return null}var lO=Math.max(this.sw.lng,C.sw.lng);var i=Math.min(this.ne.lng,C.ne.lng);var T=Math.max(this.sw.lat,C.sw.lat);var e=Math.min(this.ne.lat,C.ne.lat);return new je(new c4(lO,T),new c4(i,e))},setMinMax:function(){this.minX=this.sw?this.sw.lng:null;this.minY=this.sw?this.sw.lat:null;this.maxX=this.ne?this.ne.lng:null;this.maxY=this.ne?this.ne.lat:null},containsPoint:function(e){if(!e){return}return(e.lng>=this.sw.lng&&e.lng<=this.ne.lng&&e.lat>=this.sw.lat&&e.lat<=this.ne.lat)},extend:function(e){if(!e){return}var i=e.lng;var C=e.lat;if(!this.sw){this.sw=e.clone()}if(!this.ne){this.ne=e.clone()}if(this.sw.lng>i){this.sw.lng=i}if(this.ne.lngC){this.sw.lat=C}if(this.ne.lat=0&&e<90||e>=270&&e<360){if(this.normalizedTopRight.lng-180&&e.lat<90&&e.lat>-90){return e}return this.convertMC2LL(e)},convertMC2LL:function(e){if(e===null){return e}if(!e){return new c4(0,0)}var C;var lO;C=new c4(Math.abs(e.lng),Math.abs(e.lat));for(var T=0;T=this.MCBAND[T]){lO=this.MC2LL[T];break}}var lP=this.convertor(e,lO);return new cX(lP.lat,lP.lng)},convertLL2MC:function(lQ){if(!lQ){return new c4(0,0)}var lS=lQ.lat;var T=lQ.lng;T=this.getLoop(lQ.lng,-180,180);lS=cD(lS,-85,85);var lP;for(var lO=0;lO=this.LLBAND[lO]){lP=this.LL2MC[lO];break}}if(!lP){for(lO=0;lO1){lO=1}if(lO<-1){lO=-1}return this.EARTHRADIUS*Math.acos(lO)},getRange:function(C,i,e){if(i!=null){C=Math.max(C,i)}if(e!=null){C=Math.min(C,e)}return C},getLoop:function(C,i,e){while(C>e){C-=e-i}while(Ci-1){e=e-i}while(e<0){e=e+i}return e},getLoopBox:function(e,C){var i=this.HALF_SIZE*2;if(e[0]>0&&C[2]<0){C[2]=C[2]+i}else{if(e[0]<0&&C[0]>0){C[0]=C[0]-i}}return C},createOrUpdateTileCoord:function(C,e,T,i){if(i!==undefined){i[0]=C;i[1]=e;i[2]=T;return i}else{return[C,e,T]}},createOrUpdateTileRange:function(e,T,lO,C,i){if(i!==undefined){i.minX=e;i.maxX=T;i.minY=lO;i.maxY=C;return i}else{return{minX:e,maxX:T,minY:lO,maxY:C}}},fromEPSG4326:function(C,lS,lQ){var lO=C.length;var lP=lQ>1?lQ:2;var e=lS;if(e===undefined){if(lP>2){e=C.slice()}else{e=new Array(lO)}}for(var T=0;Tthis.MAX_SAFE_Y){lR=this.MAX_SAFE_Y}else{if(lR<-this.MAX_SAFE_Y){lR=-this.MAX_SAFE_Y}}e[T+1]=lR}return e},toEPSG4326:function(C,lR,lQ){var lO=C.length;var lP=lQ>1?lQ:2;var e=lR;if(e===undefined){if(lP>2){e=C.slice()}else{e=new Array(lO)}}for(var T=0;T90){i=90}}while(e<-180){e+=360}while(e>180){e-=360}e=e||0;i=i||0;c4.call(this,e,i)}cX.inherits(c4,"LatLng");fK.extend(cX.prototype,{equals:function(e){return(this.lat===e.lat&&this.lng===e.lng)},equalsEpsilon:function(e,i){i=i||1e-7;return(Math.abs(this.lat-e.lat)180){C=360-C}return C},toString:function(){return"LatLng"},toGeoJSON:function(){var i="Point";var C=[this.lng,this.lat];var e={type:"Feature",geometry:{type:i,coordinates:C},properties:this.properties};return e}});function de(e,i){if(e&&!i){i=e}this._sw=this._ne=null;this._swLng=this._swLat=null;this._neLng=this._neLat=null;if(e){this._sw=new cX(e.lat,e.lng);this._ne=new cX(i.lat,i.lng);this._swLng=e.lng;this._swLat=e.lat;this._neLng=i.lng;this._neLat=i.lat}}fK.extend(de.prototype,{isEmpty:function(){return !this._sw||!this._ne},equals:function(e){if(this.isEmpty()){return false}return this.getSouthWest().equals(e.getSouthWest())&&this.getNorthEast().equals(e.getNorthEast())},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},containsBounds:function(e){if(this.isEmpty()||e.isEmpty()){return false}return(e._swLng>this._swLng&&e._neLngthis._swLat&&e._neLatMath.max(this._swLng,this._neLng)||Math.max(C._swLat,C._neLat)Math.max(this._swLat,this._neLat)){return false}var lO=Math.max(this._swLng,C._swLng);var i=Math.min(this._neLng,C._neLng);var T=Math.max(this._swLat,C._swLat);var e=Math.min(this._neLat,C._neLat);this._sw=new cX(T,lO);this._ne=new cX(e,i);this._swLng=lO;this._swLat=T;this._neLng=i;this._neLat=e;return true},containsPoint:function(e){if(this.isEmpty()){return false}return(e.lng>=this._swLng&&e.lng<=this._neLng&&e.lat>=this._swLat&&e.lat<=this._neLat)},extend:function(e){var i=e.lng;var C=e.lat;if(!this._sw){this._sw=new cX(0,0)}if(!this._ne){this._ne=new cX(0,0)}if(!this._swLng||this._swLng>i){this._sw.lng=this._swLng=i}if(!this._neLng||this._neLngC){this._sw.lat=this._swLat=C}if(!this._neLat||this._neLate.lat){this._swLat=e.lat}if(this._swLng>e.lng){this._swLng=e.lng}if(this._neLat",_maskElement:null,_cursor:"default",inUse:false,show:function(e){if(!this._map){this._map=e}this.inUse=true;if(!this._maskElement){this._createMask(e)}this._maskElement.style.display="block"},_createMask:function(i){if(!this._map){this._map=i}if(!this._map){return}var e=this._maskElement=b5(this._map.container,this._html);fK.on(e,"mouseup",function(C){if(C.button==2){iw(C)}});fK.on(e,"contextmenu",iw);e.style.display="none"},getDrawPoint:function(T,lQ,lO){T=window.event||T;var i=T.offsetX||T.layerX||0;var lP=parseInt(T.offsetY)||parseInt(T.layerY)||0;var C=T.target||T.srcElement;if(C!=aq.getDom(this._map)&&lQ==true){while(C&&C!=this._map.container){if(!(C.clientWidth==0&&C.clientHeight==0&&C.offsetParent&&C.offsetParent.nodeName.toLowerCase()=="td")){i+=C.offsetLeft;lP+=C.offsetTop}C=C.offsetParent}}if(C!=aq.getDom(this._map)&&C!=this._map.container){return}if(typeof i==="undefined"||typeof lP==="undefined"){return}if(isNaN(i)||isNaN(lP)){return}if(lO){i=i+lO.x;lP=lP+lO.y}return this._map.pixelToPointIn(new f8(i,lP))},hide:function(){if(!this._map){return}this.inUse=false;if(this._maskElement){this._maskElement.style.display="none"}},getDom:function(e){if(!this._maskElement){this._createMask(e)}return this._maskElement},setCursor:function(e){this._cursor=e||"default";if(this._maskElement){this._maskElement.style.cursor=this._cursor}}};function a5(){this._type="overlay"}a5.inherits(fK.BaseClass,"Overlay");a5.getZIndex=function(i,e){i=i*1;if(!i){return 0}if(e){i=kz.convertMC2LL(new c4(0,i)).lat}return(i*-100000)<<1};fK.extend(a5.prototype,{_i:function(lQ){this._map=lQ;if(!this.domElement&&cf(this.initialize)){this.domElement=this.initialize(lQ);if(this.domElement){this.domElement.style.WebkitUserSelect="none";if(this.enableDraggingMap!==undefined&&!this.enableDraggingMap&&!(this instanceof v)){var lP=["mouseout","mouseover","click","keydown","selectstart"];var C=(window.PointerEvent||window.MSPointerEvent)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);var e=["mousedown"];if(C){if(window.PointerEvent){e=["pointerdown"]}else{if(window.MSPointerEvent){e=["MSPointerDown"]}}}for(var T=0;T=0;lQ--){if(T._customOverlays[lQ].enableMassClear!==false){this.removeOverlay(T._customOverlays[lQ]);T._customOverlays.splice(lQ,1)}}});lO.addEventListener("infowindowopen",function(lR){var lQ=this.infoWindow;if(lQ){fK.hide(lQ.popDom);fK.hide(lQ.shadowDom)}});function C(){if(this.getMapTypeId()==="B_EARTH_MAP"||this._renderType==="webgl"){if(T._zoomingOrMoving===false){this._panes.markerMouseTarget.style.display="none";T._zoomingOrMoving=true}}}function e(lS){if(this.getMapTypeId()==="B_EARTH_MAP"||this._renderType==="webgl"){if(T._zoomingOrMoving===true){if(this._panes.markerMouseTarget){this._panes.markerMouseTarget.style.display=""}T._zoomingOrMoving=false;for(var lR=0;lR1){this._config.strokeOpacity=1}if(this._config.fillOpacity<0||this._config.fillOpacity>1){this._config.fillOpacity=1}if(this._config.strokeStyle!=="solid"&&this._config.strokeStyle!=="dashed"&&this._config.strokeStyle!=="dotted"){this._config.strokeStyle="solid"}this.domElement=null;this._bounds=new je();this.points=[];this.greatCirclePoints=[];this._parseCache=[];this._holesCache=[];this._parseCacheGL=[];this._parseCacheGLRaw=[];this._areaCacheGL=[];this._strokeStyleInfoForGL=[[]];this._fillStyleInfoForGL="";this.vertexMarkers=[];this._temp={}}jS.JOININDEX={miter:0,round:1,bevel:2};jS.CAPINDEX={round:0,butt:1,square:2};jS.inherits(fk,"Graph");jS.getGraphPoints=function(i){var e=[];if(!i||i.length===0){return e}if(typeof i==="string"){var C=i.split(";");fK.each(C,function(lO){var T=lO.split(",");e.push(new c4(T[0],T[1]))})}if(i.constructor===Array&&i.length>0){e=i}return e};jS.parseTolerance={0:[0.09,0.005,0.0001,0.00001],1:[9000,500,20,1]};fK.extend(jS.prototype,{initialize:function(e){this.map=e;return null},draw:function(){},setPoints:function(e){this._clearCache();this.points=jS.getGraphPoints(e).slice(0);this._calcBounds()},setPathIn:function(e){this.setPoints(e)},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds=new je();if(!this.hasMultipleParts){fK.each(this.points,function(i){e._bounds.extend(i)})}else{fK.each(this.points,function(i){fK.each(i,function(C){e._bounds.extend(C)})})}},getPoints:function(){return this.points},getPathIn:function(){return this.points},setPointAt:function(i,e){if(!e||!this.points[i]){return}this._clearCache();this.points[i]=new c4(e.lng,e.lat);this._calcBounds()},setPositionAt:function(i,e){if(!e||!this.points[i]){return}var C=kz.convertLL2MC(e);this.setPointAt(i,C)},setOptions:function(i){i=i||{};for(var e in i){if(i.hasOwnProperty(e)){this._config[e]=i[e]}}},setStrokeColor:function(e){this._config.strokeColor=e},getStrokeColor:function(){return this._config.strokeColor},setStrokeLineCap:function(e){this._config.strokeLineCap=e},getStrokeLineCap:function(){return this._config.strokeLineCap},setStrokeLineJoin:function(e){this._config.strokeLineJoin=e},getStrokeLineJoin:function(){return this._config.strokeLineJoin},setStrokeWeight:function(e){if(e>0){this._config.strokeWeight=e}},getStrokeWeight:function(){return this._config.strokeWeight},setStrokeOpacity:function(e){if(!e||e>1||e<0){return}this._config.strokeOpacity=e},getStrokeOpacity:function(){return this._config.strokeOpacity},setFillOpacity:function(e){if(e>1||e<0){return}this._config.fillOpacity=e},getFillOpacity:function(){return this._config.fillOpacity},setStrokeStyle:function(e){if(e!=="solid"&&e!=="dashed"&&e!=="dotted"){return}this._config.strokeStyle=e},getStrokeStyle:function(){return this._config.strokeStyle},setFillColor:function(e){this._config.fillColor=e||""},getFillColor:function(){return this._config.fillColor},getBoundsIn:function(){this._bounds.setMinMax();return this._bounds},getBounds:function(){var e=this.getBoundsIn();var i=new je(kz.convertMC2LL(e.getSouthWest()),kz.convertMC2LL(e.getNorthEast()));i.setMinMax();return i},remove:function(){if(this.map){this.map.removeEventListener("onmousemove",this._graphMouseEvent);this.map.removeEventListener("onclick",this._graphClickEvent)}fk.prototype.remove.call(this);this._clearCache();var e=new gC("onlineupdate");e.action="remove";e.overlay=this;this.fire(e)},enableEditing:function(){if(this.points.length<2){return}this._config.enableEditing=true;var e=this;h6.load("poly",function(){e.addVertexs()},true)},disableEditing:function(){this._config.enableEditing=false;var e=this;h6.load("poly",function(){e.clearVertexs()},true)},getLength:function(){if(typeof this._length==="number"){return this._length}if(typeof this._config.totalLength==="number"){this._length=this._config.totalLength;return this._length}var C=0;if(this.points.length<=1){this._length=0;return C}for(var e=0;e0){lO=this.greatCirclePoints}var lP=this.getParseTolerance(e.getZoom(),1);if(!this.hasMultipleParts){var lS=ew(lO,lP);lS=jV(lS,lP)}else{var lS=[];for(var C=0;ClO.maxY){C.bottom=4;C.all+=C.bottom}}if(e>lO.maxX){C.right=2;C.all+=C.right}else{if(e=this.tokens.length-1};this.isCommandOrEnd=function(){if(this.isEnd()){return true}return this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return true;break}return false};this.getToken=function(){this.i++;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){var C=new em.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(C)};this.getAsControlPoint=function(){var C=this.getPoint();this.control=C;return C};this.getAsCurrentPoint=function(){var C=this.getPoint();this.current=C;return C};this.getReflectedControlPoint=function(){if(this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"&&this.previousCommand.toLowerCase()!="q"&&this.previousCommand.toLowerCase()!="t"){return this.current}var C=new em.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return C};this.makeAbsolute=function(C){if(this.isRelativeCommand()){C.x+=this.current.x;C.y+=this.current.y}return C};this.addMarker=function(T,lO,C){if(C!=null&&this.angles.length>0&&this.angles[this.angles.length-1]==null){this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(C)}this.addMarkerAngle(T,lO==null?null:lO.angleTo(T))};this.addMarkerAngle=function(T,C){this.points.push(T);this.angles.push(C)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var T=0;T1){lT*=Math.sqrt(l8);lS*=Math.sqrt(l8)}var l0=(lV==lR?-1:1)*Math.sqrt(((Math.pow(lT,2)*Math.pow(lS,2))-(Math.pow(lT,2)*Math.pow(mg.y,2))-(Math.pow(lS,2)*Math.pow(mg.x,2)))/(Math.pow(lT,2)*Math.pow(mg.y,2)+Math.pow(lS,2)*Math.pow(mg.x,2)));if(isNaN(l0)){l0=0}var lZ=new em.Point(l0*lT*mg.y/lS,l0*-lS*mg.x/lT);var lO=new em.Point((mb.x+lW.x)/2+Math.cos(C)*lZ.x-Math.sin(C)*lZ.y,(mb.y+lW.y)/2+Math.sin(C)*lZ.x+Math.cos(C)*lZ.y);var l6=function(mh){return Math.sqrt(Math.pow(mh[0],2)+Math.pow(mh[1],2))};var l2=function(mi,mh){return(mi[0]*mh[0]+mi[1]*mh[1])/(l6(mi)*l6(mh))};var me=function(mi,mh){return(mi[0]*mh[1]=1){mc=0}var l5=1-lR?1:-1;var ma=mf+l5*(mc/2);var i=new em.Point(lO.x+lT*Math.cos(ma),lO.y+lS*Math.sin(ma));l9.addMarkerAngle(i,ma-l5*Math.PI/2);l9.addMarkerAngle(lW,ma-l5*Math.PI);lU.addPoint(lW.x,lW.y);if(l7!=null){var l2=lT>lS?lT:lS;var l3=lT>lS?1:lT/lS;var l1=lT>lS?lS/lT:1;l7.translate(lO.x,lO.y);l7.rotate(C);l7.scale(l3,l1);l7.arc(0,0,l2,mf,mf+mc,1-lR);l7.scale(1/l3,1/l1);l7.rotate(-C);l7.translate(-lO.x,-lO.y)}}break;case"Z":case"z":if(l7!=null){l7.closePath()}l9.current=l9.start}}return lU};this.getMarkers=function(){var T=this.PathParser.getMarkerPoints();var lP=this.PathParser.getMarkerAngles();var lO=[];for(var C=0;Cthis.x2){this.x2=lO}}if(lP!=null){if(isNaN(this.y1)||isNaN(this.y2)){this.y1=lP;this.y2=lP}if(lPthis.y2){this.y2=lP}}};this.addX=function(lO){this.addPoint(lO,null)};this.addY=function(lO){this.addPoint(null,lO)};this.addBoundingBox=function(lO){this.addPoint(lO.x1,lO.y1);this.addPoint(lO.x2,lO.y2)};this.addQuadraticCurve=function(lT,lS,lP,lO,lV,lU){var lR=lT+2/3*(lP-lT);var lQ=lS+2/3*(lO-lS);var lX=lR+1/3*(lV-lT);var lW=lQ+1/3*(lU-lS);this.addBezierCurve(lT,lS,lR,lX,lQ,lW,lV,lU)};this.addBezierCurve=function(l1,l0,lS,lQ,lX,lV,l3,l2){var lT=[l1,l0],lR=[lS,lQ],lP=[lX,lV],lO=[l3,l2];this.addPoint(lT[0],lT[1]);this.addPoint(lO[0],lO[1]);for(kP=0;kP<=1;kP++){var l4=function(l8){return Math.pow(1-l8,3)*lT[kP]+3*Math.pow(1-l8,2)*l8*lR[kP]+3*(1-l8)*Math.pow(l8,2)*lP[kP]+Math.pow(l8,3)*lO[kP]};var l6=6*lT[kP]-12*lR[kP]+6*lP[kP];var l7=-3*lT[kP]+9*lR[kP]-9*lP[kP]+3*lO[kP];var l5=3*lR[kP]-3*lT[kP];if(l7==0){if(l6==0){continue}var lZ=-l5/l6;if(0=0){T=T+1}else{T=1+T}var i=this._initOptions.rotation===0?this.style.rotation:(this.style.rotation-this._initOptions.rotation);while(i<0){i+=360}var C=e.domElement.style;C.width=this._initOptions.width+"px";C.height=this._initOptions.height+"px";C.transform="rotate("+i+"deg) scale("+T+")"}if(!this.isReDraw){this._refresh(e)}}};f6.prototype._refresh=function(e){e.textureCoord=e.textureCoordGLMap=null;var i=new gC("onstatus_change");i.overlay=e;i.action="setIcon";i.imageUrlChanged=true;setTimeout(function(){e.fire(i)},100)};f6.prototype.generateRenderData=function(){var i=this.offset=this.anchor;var e=this.size;var C=[];C.push(-i.width,i.height-e.height,0);C.push(e.width-i.width,i.height-e.height,0);C.push(e.width-i.width,i.height,0);C.push(-i.width,i.height-e.height,0);C.push(e.width-i.width,i.height,0);C.push(-i.width,i.height,0);return{vertex:C}};f6.prototype.getCurrentImageUrl=function(){return this.id};f6.prototype.getRenderData=function(){this._renderData=this.generateRenderData();return this._renderData};f6.prototype.toString=function(){return"Symbol"};var go={14:"m-0.00573,-10c-5.51975,0 -9.99427,4.47453 -9.99427,9.99428c0,5.51974 4.47452,9.99425 9.99427,9.99425c5.51972,0 9.99426,-4.47452 9.99426,-9.99425c0,-5.51975 -4.47453,-9.99428 -9.99426,-9.99428zm0,17.92491c-4.37412,0 -7.93132,-3.55788 -7.93132,-7.93063c0,-4.37345 3.5572,-7.93134 7.93132,-7.93134c4.37411,0 7.93062,3.55721 7.93062,7.93134c0,4.37412 -3.55789,7.93063 -7.93062,7.93063zm-0.00068,-15.4088c-0.38027,0 -0.68696,0.30807 -0.68696,0.68765l0,6.34078l-4.15752,1.81815c-0.34794,0.15266 -0.50611,0.55837 -0.35344,0.90632c0.11278,0.25787 0.36445,0.4119 0.6292,0.4119c0.09214,0 0.18635,-0.01857 0.27575,-0.05845l4.55635,-1.99279c0.00344,-0.00137 0.00619,-0.00275 0.00894,-0.00412l0.00275,-0.00138c0.01032,-0.00413 0.01581,-0.01376 0.02545,-0.01719c0.07151,-0.03576 0.13821,-0.07771 0.19185,-0.1341c0.02337,-0.02338 0.03644,-0.05364 0.05431,-0.08045c0.03301,-0.04401 0.06946,-0.08733 0.0894,-0.14028c0.0165,-0.04126 0.01787,-0.08596 0.02613,-0.12997c0.00894,-0.04469 0.02614,-0.08389 0.02614,-0.1286l0,-6.7905c0,-0.37889 -0.30807,-0.68697 -0.68833,-0.68697z",13:"m-0.00706,-9.5c-5.24281,0 -9.49294,4.25065 -9.49294,9.49294c0,5.24331 4.25014,9.49294 9.49294,9.49294c5.24281,0 9.49294,-4.24964 9.49294,-9.49294c0,-5.2423 -4.25013,-9.49294 -9.49294,-9.49294zm3.08857,3.85997c0.61044,0 1.10279,0.96873 1.10279,2.16271s-0.49384,2.1647 -1.10279,2.1647c-0.60844,0 -1.10228,-0.96873 -1.10228,-2.16372s0.49434,-2.16369 1.10228,-2.16369zm-6.28628,0c0.60844,0 1.10228,0.96873 1.10228,2.16271s-0.49284,2.1647 -1.10228,2.1647s-1.10277,-0.96873 -1.10277,-2.16372s0.49383,-2.16369 1.10277,-2.16369zm3.21167,12.16493c-1.87667,0 -3.63373,-1.14814 -5.14663,-3.14239c1.56571,1.02156 3.27993,1.59064 5.07786,1.59064c1.90905,0 3.72343,-0.63985 5.36539,-1.78497c-1.54429,2.11685 -3.35767,3.33672 -5.29662,3.33672l-0.00001,0z",12:"m9.27295,5.92958l-2.64443,-4.57961c-0.79727,-1.37992 -2.10131,-3.63983 -2.8986,-5.01973l-2.64441,-4.57858c-0.79782,-1.38093 -2.10186,-1.38093 -2.89913,0l-2.64335,4.57858c-0.79728,1.3799 -2.10188,3.63981 -2.89916,5.01973l-2.64387,4.57961c-0.79728,1.38101 -0.14472,2.50988 1.44983,2.50988l16.37221,0c1.59561,0 2.24711,-1.12887 1.45091,-2.50988l0,0zm-8.88166,0.70811l-1.56837,0l0,-1.50484l1.56837,0l0,1.50484zm-0.07527,-2.61447l-1.41621,0l-0.14044,-6.44231l1.68427,0l-0.12761,6.44231l0,0z",11:"m8.08295,-6.56414l-3.59319,0l0,-1.43586l-8.98155,0l0,1.43586l-3.59321,0c-1.0569,0 -1.915,0.85509 -1.915,1.91159l0,9.92258c0,1.05357 0.8581,1.91158 1.915,1.91158l16.16796,0c1.05692,0 1.91501,-0.85801 1.91501,-1.91158l0,-9.92258c0,-1.0565 -0.85809,-1.91159 -1.91501,-1.91159l0,0zm-8.08397,12.66884c-3.20143,0 -5.80643,-2.60031 -5.80643,-5.79596c0,-3.19569 2.605,-5.79891 5.80643,-5.79891s5.80789,2.60322 5.80789,5.79891c0,3.19565 -2.60794,5.79596 -5.80789,5.79596zm0,-9.6804c-2.15036,0 -3.89142,1.7394 -3.89142,3.88444c0,2.14503 1.74252,3.8844 3.89142,3.8844c2.1489,0 3.89141,-1.73937 3.89141,-3.8844c0,-2.14503 -1.74105,-3.88444 -3.89141,-3.88444z",10:"m0,-10c-0.20885,0 -0.39491,0.08583 -0.55177,0.24149c-0.15674,0.15536 -0.28646,0.37838 -0.39429,0.65665c-0.21586,0.55655 -0.34853,1.33844 -0.42114,2.27477c-0.07231,0.93446 -0.08474,2.02273 -0.05447,3.18765c-2.58175,1.05925 -7.81787,3.24648 -8.23854,3.73474c-0.56001,0.65029 -0.37908,1.3954 -0.15331,1.89002l8.608,-1.75235c0.18202,2.28374 0.4407,4.5455 0.66615,6.31771c-0.8418,0.24646 -2.41323,0.73303 -2.73754,1.03474c-0.4469,0.41562 -0.4469,1.75793 -0.4469,1.75793l3.52318,-0.28665c0.08286,0.57874 0.13486,0.9163 0.13486,0.9163l0.00511,0.03042l0.02778,0l0.06486,0l0.02778,0l0.00511,-0.03042c0,0 0.05185,-0.33756 0.13486,-0.9163l3.52424,0.28665c0,0 0,-1.34231 -0.44688,-1.75793c-0.32446,-0.30172 -1.89697,-0.7895 -2.73847,-1.0358c0.22484,-1.76681 0.4832,-4.02001 0.66507,-6.29634l8.50712,1.73203c0.22561,-0.49462 0.40765,-1.23973 -0.15237,-1.89002c-0.41538,-0.48221 -5.52504,-2.62071 -8.1386,-3.69423c0.03119,-1.17999 0.01971,-2.28285 -0.05353,-3.22816l0,-0.00233c-0.07263,-0.93523 -0.20545,-1.71635 -0.42114,-2.27244c-0.10784,-0.27827 -0.23634,-0.50114 -0.3932,-0.65665c-0.15689,-0.15567 -0.34293,-0.24149 -0.55195,-0.24149l0,0l0,0l0,0l0.00001,0l0,0l-0.00003,0.00001z",3:"m-10,0l10,-10l10,10l-10,10l-10,-10z",5:"M0,0 L-5,-15 0,-10 5,-15 z",6:"M0,0 L5,15 0,10 -5,15z",7:"M-5,-15 L0,0 5,-15",8:"M-5,15 L0,0 5,15",9:"m0,-24c-4.4183,0 -8,3.58167 -8,8c0,1.42102 0.3816,2.75 1.0312,3.90601c0.1079,0.19202 0.221,0.38098 0.3438,0.56299l6.625,11.53101l6.625,-11.53101c0.102,-0.151 0.19,-0.31097 0.281,-0.46899l0.063,-0.09399c0.649,-1.15601 1.031,-2.48499 1.031,-3.90601c0,-4.41833 -3.582,-8 -8,-8zm0,4c2.209,0 4,1.79089 4,4c0,2.20898 -1.791,4 -4,4c-2.2091,0 -4,-1.79102 -4,-4c0,-2.20911 1.7909,-4 4,-4z"};var cx={BMap_Symbol_SHAPE_CIRCLE:1,BMap_Symbol_SHAPE_RECTANGLE:2,BMap_Symbol_SHAPE_RHOMBUS:3,BMap_Symbol_SHAPE_STAR:4,BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW:5,BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW:6,BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW:7,BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW:8,BMap_Symbol_SHAPE_POINT:9,BMap_Symbol_SHAPE_PLANE:10,BMap_Symbol_SHAPE_CAMERA:11,BMap_Symbol_SHAPE_WARNING:12,BMap_Symbol_SHAPE_SMILE:13,BMap_Symbol_SHAPE_CLOCK:14};function eo(i,e){f6.call(this);e=e||{};this.style={anchor:e.anchor||new kp(0,0),fillColor:e.fillColor||"#000",fillOpacity:e.fillOpacity||0,scale:e.scale||1,rotation:e.rotation||0,strokeColor:e.strokeColor||"#000",strokeOpacity:e.strokeOpacity===undefined?1:e.strokeOpacity,strokeWeight:e.strokeWeight};this._type=(typeof i==="number")?i:"UserDefined";this._anchor=this.style.anchor;this._originOffset=new kp(0,0);this.anchor=new kp(0,0);this._rawPath=i;this._buildPath(true)}eo.inherits(f6,"SVGSymbol");eo.generateKey=function(T,i){if(!T){return null}if(parseInt(T)){T=parseInt(T)}if(typeof T==="number"){if(!go[T]&&![0,1,2,0,4][T]){return null}}var e={anchor:i.anchor||new kp(0,0),fillColor:i.fillColor||"#000",fillOpacity:i.fillOpacity||0,scale:i.scale||1,rotation:i.rotation||0,strokeColor:i.strokeColor||"#000",strokeOpacity:i.strokeOpacity===undefined?1:i.strokeOpacity,strokeWeight:i.strokeWeight};var C=r({path:T,style:e});return"symbol_svg_icon_"+C};fK.extend(eo.prototype,{_buildPath:function(lY){var lS=this;var lU=lS._rawPath;if(parseInt(lU)){lU=parseInt(lU)}if(go[lU]){lU=go[lU]}lS.id=eo.generateKey(lU,lS.style);if(!lS.id){return}switch(lU){case cx.BMap_Symbol_SHAPE_CIRCLE:var lV=lS._calSize(2),lT=lV,l3=lS.style.scale,lO=lS._anchor;this.size=new kp(lV,lT);this.anchor=new kp(lV/2+lO.width*l3,lT/2+lO.height*l3);lS.path=cx.BMap_Symbol_SHAPE_CIRCLE;break;case cx.BMap_Symbol_SHAPE_RECTANGLE:var lV=lS._calSize(4),lT=lS._calSize(2),lO=lS._anchor,l0=lS.style.strokeWeight!==undefined?lS.style.strokeWeight:lS.style.scale,l3=lS.style.scale;this.size=new kp(lV,lT);this._originOffset=new kp(Math.floor(-l0/2),Math.floor(-l0/2));this.anchor=new kp(lV/2+lO.width*l3,lT/2+lO.height*l3);lS.path=cx.BMap_Symbol_SHAPE_RECTANGLE;break;case cx.BMap_Symbol_SHAPE_STAR:var lV=lS._calSize(20),lT=lV,lO=lS._anchor,l3=lS.style.scale;this.size=new kp(lV,lT);this.anchor=new kp(lV/2+lO.width*l3,lT/2+lO.height*l3);lS.path=cx.BMap_Symbol_SHAPE_STAR;break;default:var lU=new em(lU),T=lU.bounds(),lX=lS.style.rotation*Math.PI/180,l0=lS.style.strokeWeight!==undefined?lS.style.strokeWeight:lS.style.scale,l3=lS.style.scale,lO=lS._anchor;var l2=new kp(Math.floor(T.x1*l3-l0/2),Math.floor(T.y1*l3-l0/2)),e={topleft:new f8(Math.floor(T.x1*l3-l0/2)-l3*lO.width,Math.floor(T.y1*l3-l0/2)-l3*lO.height),bottomleft:new f8(Math.floor(T.x1*l3-l0/2)-l3*lO.width,Math.ceil(T.y2*l3-l0/2)-l3*lO.height),topright:new f8(Math.ceil(T.x2*l3+l0/2)-l3*lO.width,Math.floor(T.y1*l3-l0/2)-l3*lO.height),bottomright:new f8(Math.ceil(T.x2*l3+l0/2)-l3*lO.width,Math.ceil(T.y2*l3+l0/2)-l3*lO.height)},i={},l1=[],lR=[];var lZ=e.topleft.x===0?0:Math.atan(e.topleft.y/e.topleft.x),C=lZ+lX;for(var lW in e){var lQ=Math.cos(lX)*e[lW].x-Math.sin(lX)*e[lW].y,lP=Math.sin(lX)*e[lW].x+Math.cos(lX)*e[lW].y;i[lW]=new f8(lQ,lP);l1.push(lQ);lR.push(lP)}xmax=Math.max.apply(Math,l1),ymax=Math.max.apply(Math,lR),xmin=Math.min.apply(Math,l1),ymin=Math.min.apply(Math,lR);this.size=new kp(Math.ceil(xmax-xmin),Math.ceil(ymax-ymin));this.anchor=new kp(-xmin,-ymin);this._originOffset=new kp(xmin-i.topleft.x,ymin-i.topleft.y);this._innerOffset=new f8(l2.width,l2.height);this._rotationAngle=lX;lS.path=lU;break}this.imageSize=new kp(this.size.width,this.size.height);this.offset=this.anchor;if(lY){this.resetInitOptions()}},_calSize:function(e){if(this.style.strokeWeight){return e*this.style.scale+this.style.strokeWeight%3+this.style.strokeWeight}else{return e*this.style.scale+this.style.scale+this.style.scale%2}},render:function(C){var lT=this,T=this.style.scale,lU,lV=this.size;if(this.context){lU=this.context;if(this.context.canvas.width/2!==this.size.width||this.context.canvas.height/2!==this.size.height){this.context.canvas.width=this.size.width*2;this.context.canvas.height=this.size.height*2}lU.clearRect(0,0,this.size.width*2,this.size.height*2);lU.fillStyle=iL.convert2rgba(lT.style.fillColor,lT.style.fillOpacity);lU.strokeStyle=iL.convert2rgba(lT.style.strokeColor,lT.style.strokeOpacity);lU.save()}else{return false}lU.scale(2,2);lU.lineCap="round";lU.lineJoin="round";lU.lineWidth=lT.style.strokeWeight||T;if(lT._originOffset){lU.translate(-lT._originOffset.width,-lT._originOffset.height)}if(lT._rotationAngle){lU.rotate(lT._rotationAngle)}if(lT._innerOffset){lU.translate(-lT._innerOffset.x,-lT._innerOffset.y)}switch(lT.path){case cx.BMap_Symbol_SHAPE_CIRCLE:lU.arc(lV.width/2,lV.height/2,T,0,2*Math.PI);break;case cx.BMap_Symbol_SHAPE_RECTANGLE:lU.rect(0,0,4*T,2*T);break;case cx.BMap_Symbol_SHAPE_STAR:lU.beginPath();var lP=lV.width/2,lR=T*10;var lO=(2*Math.PI)/10;for(var lQ=11;lQ!=0;lQ--){var e=lR*(lQ%2+1)/2;var lS=lO*lQ;lU.lineTo((e*Math.sin(lS))+lP,(e*Math.cos(lS))+lP)}lU.closePath();break;default:lU.lineWidth=lU.lineWidth/T;lU.scale(T,T);lT.path.draw(lU)}lU.fill();lU.stroke();lU.restore();this.data=lU.getImageData(0,0,this.size.width*2,this.size.height*2);return true},setPath:function(e){this._rawPath=e;this._buildPath();this.update()},setAnchor:function(e){this._anchor=this.style.anchor=e;this._buildPath();this.update()},setRotation:function(e){this.style.rotation=e;this._buildPath();this.update()},setScale:function(e){this.style.scale=e;this._buildPath();this.update()},setStrokeWeight:function(e){this.style.strokeWeight=e;this._buildPath();this.update()},setStrokeColor:function(e){e=iL.convert2rgba(e,this.style.strokeOpacity);this.style.strokeColor=e;this._buildPath();this.update()},setStrokeOpacity:function(e){this.style.strokeOpacity=e;this._buildPath();this.update()},setFillOpacity:function(e){this.style.fillOpacity=e;this._buildPath();this.update()},setFillColor:function(e){this.style.fillColor=e;this._buildPath();this.update()}});bS.SymbolShapeType=cx;(function(){for(var e in cx){if(cx.hasOwnProperty(e)){window[e]=cx[e]}}})();function kW(lP,T,C){if(!lP||!T){return}this.imageUrl=null;this.imageDom=null;if(typeof lP==="string"){this.imageUrl=lP}else{this.imageDom=lP;if(!this.imageDom.id){this.imageDom.id=bS.getGUID("icon_dom_")}}this.size=T;var lO=new kp(Math.floor(T.width/2),Math.floor(T.height/2));var i={offset:lO,imageOffset:new kp(0,0)};C=C||{};for(var e in C){i[e]=C[e]}if(C.anchor){i.offset=C.anchor}this.anchor=this.offset=i.offset;this.imageOffset=i.imageOffset;this.infoWindowOffset=C.infoWindowOffset||this.offset;this.printImageUrl=C.printImageUrl||"";this.imageSize=C.imageSize||this.size;this.srcSetObject={};this.setImageSrcset(C.srcset||C.srcSet)}kW.prototype.setImageUrl=function(e){if(!e){return}this.imageUrl=e;this._renderData=null};kW.prototype.getCurrentImageUrl=function(){if(window.devicePixelRatio>1&&this.srcSetObject["2x"]){return this.srcSetObject["2x"]}return this.imageUrl};kW.prototype.setPrintImageUrl=function(e){if(!e){return}this.printImageUrl=e};kW.prototype.setSize=function(e){if(!e){return}this.size=new kp(e.width,e.height);this._renderData=null};kW.prototype.setOffset=function(e){if(!e){return}this.anchor=this.offset=new kp(e.width,e.height);this._renderData=null};kW.prototype.setAnchor=function(e){this.setOffset(e)};kW.prototype.setImageOffset=function(e){if(!e){return}this.imageOffset=new kp(e.width,e.height);this._renderData=null};kW.prototype.setInfoWindowOffset=function(e){if(!e){return}this.infoWindowOffset=new kp(e.width,e.height)};kW.prototype.setImageSize=function(e){if(!e){return}this.imageSize=new kp(e.width,e.height)};kW.prototype.setImageSrcset=function(C){var e="";if(!C){return}for(var i in C){if(C.hasOwnProperty(i)){this.srcSetObject[i]=C[i];e=C[i]+" "+i+","}}this.srcSet=e};kW.prototype.toString=function(){return"Icon"};kW.prototype.generateRenderData=function(lP){var C=this.offset;var e=this.size;var lR=this.imageOffset;var lQ=[];lQ.push(-C.width,C.height-e.height,0);lQ.push(e.width-C.width,C.height-e.height,0);lQ.push(e.width-C.width,C.height,0);lQ.push(-C.width,C.height-e.height,0);lQ.push(e.width-C.width,C.height,0);lQ.push(-C.width,C.height,0);if(lP!==0){for(var lO=0;lO730){this._config.width=730}}if(this._config.height!==0){if(this._config.height<60){this._config.height=60}if(this._config.height>650){this._config.height=650}}if(this._config.maxWidth!==0){if(this._config.maxWidth<220){this._config.maxWidth=220}if(this._config.maxWidth>730){this._config.maxWidth=730}}this.isWinMax=false;this.IMG_PATH=G.imgPath;this.overlay=null;var e=this;h6.load("infowindow",function(){e._draw()})}eK.inherits(fK.BaseClass,"InfoWindow");fK.extend(eK.prototype,{setWidth:function(e){e=e*1;if(!e&&e!==0||isNaN(e)||e<0){return}if(e!==0){if(e<220){e=220}if(e>730){e=730}}this._config.width=e},setHeight:function(e){e=e*1;if(!e&&e!==0||isNaN(e)||e<0){return}if(e!==0){if(e<60){e=60}if(e>650){e=650}}this._config.height=e},setMaxWidth:function(e){e=e*1;if(!e&&e!==0||isNaN(e)||e<0){return}if(e!==0){if(e<220){e=220}if(e>730){e=730}}this._config.maxWidth=e},setTitle:function(e){this._config.title=e||""},setContent:function(e){this.content=e||""},getContent:function(){return this.content},setMaxContent:function(e){this._config.maxContent=e||""},redraw:function(){},enableAutoPan:function(){this._config.enableAutoPan=true},disableAutoPan:function(){this._config.enableAutoPan=false},enableCloseOnClick:function(){this._config.enableCloseOnClick=true},disableCloseOnClick:function(){this._config.enableCloseOnClick=false},enableMaximize:function(){this._config.enableMaximize=true},disableMaximize:function(){this._config.enableMaximize=false},show:function(){this._visible=true},hide:function(){this._visible=false},close:function(){this.hide()},dispose:function(){fK.BaseClass.prototype.decontrol.call(this)},maximize:function(){this.isWinMax=true},restore:function(){this.isWinMax=false},setConfig:function(i){if(!i){return}for(var e in i){if(typeof(this._config[e])===typeof(i[e])){this._config[e]=i[e]}}},isVisible:function(){return this.isOpen()},isOpen:function(){return false},getPointIn:function(){if(this.overlay&&this.overlay.getPoint){return this.overlay.getPoint()}},getTitle:function(){return this._config.title||""},getPosition:function(){if(G.apiVersion==="3.0"){if(this.overlay&&this.overlay.getPosition){return this.overlay.getPosition()}}return this.latLng},getPoint:function(){var e=this.getPointIn();return kt(kz.convertMC2LL(e),this.map.config.coordType)},getOffset:function(){return this._config.offset},dispose:function(){fK.BaseClass.prototype.decontrol.call(this)},toString:function(){return"InfoWindow"}});iX.prototype.openInfoWindow=function(lP,e,T){if(G.apiVersion==="3.0"){return this._openInfoWindow30(lP,e)}var lO=e;var C=(T&&T.coordType)||BMapGL.coordType;lO=gR(lO,C);lP.latLng=new cX(lO.lat,lO.lng);var i=kz.convertLL2MC(lO);this.openInfoWindowIn(lP,i)};iX.prototype._openInfoWindow30=function(T,e){if(!(T instanceof eK)||!e){return}T.latLng=new cX(e.lat,e.lng);var i=this.temp;if(!i.marker){var C=new kW(G.imgPath+"blank.gif",{width:1,height:1});i.marker=new lp(e,{icon:C,offset:new kp(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openInfoWindow(T)};iX.prototype.closeInfoWindow=function(){var e=this.temp.infoWin||this.temp._infoWin;if(e&&e.overlay){e.overlay.closeInfoWindow()}};iX.prototype.openInfoWindowIn=function(T,e){if(!T||T.toString()!=="InfoWindow"||!e||e.toString()!=="Point"){return}var i=this.temp;if(!i.marker){var C=new kW(G.imgPath+"blank.gif",{width:1,height:1});i.marker=new lp(e,{icon:C,width:1,height:1,offset:new kp(0,0),infoWindowOffset:new kp(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openInfoWindow(T)};fk.prototype.openInfoWindow=function(e){if(this.map){this.map.closeInfoWindow();e._visible=true;this.map.temp._infoWin=e;e.overlay=this;fK.BaseClass.call(e,e.hashCode)}};fk.prototype.closeInfoWindow=function(){if(this.map&&this.map.temp._infoWin){this.map.temp._infoWin._visible=false;this.map.temp._infoWin.decontrol();this.map.temp._infoWin=null}};function bx(C,i){fk.call(this);this.content=C;this.map=null;this.domElement=null;this._config={width:0,offset:new kp(0,0),styles:{backgroundColor:"#fff",border:"1px solid #f00",padding:"1px",whiteSpace:"nowrap",fontSize:"12px",zIndex:"80",MozUserSelect:"none"},enableClicking:true,point:null,enableMassClear:true};i=i||{};this.setConfig(i);if(this._config.width<0){this._config.width=0}this.point=this._config.point;var e=this;h6.load("marker",function(){e._draw()})}bx.inherits(fk,"Label");fK.extend(bx.prototype,{setPoint:function(e){if(e&&e.toString()==="Point"&&!this.getMarker()){this.point=this._config.point=gR(e,this.coordType)}},setContent:function(e){this.content=e},getContent:function(e){return this.content},setOpacity:function(e){if(e>=0&&e<=1){this._config.opacity=e}},setOffset:function(e){if(!e||e.toString()!=="Size"){return}this._config.offset=new kp(e.width,e.height)},getOffset:function(){return this._config.offset},setStyle:function(e){e=e||{};this._config.styles=fK.extend(this._config.styles,e)},setStyles:function(e){this.setStyle(e)},setTitle:function(e){this._config.title=e||""},getTitle:function(){return this._config.title},setMarker:function(e){if(this._marker&&this._marker!==e){this._marker._config.label=null}this._marker=e;if(e){this.point=this._config.point=e.getPoint()}else{this.point=this._config.point=null}},getMarker:function(){return this._marker||null},getPositionIn:function(){return this.getPoint()},});function i7(C,i){var T={};for(var e in i){if(i.hasOwnProperty(e)){if(e==="position"){if(G.apiVersion==="3.0"){T.point=gR(i[e],BMapGL.coordType)}else{T.point=kz.convertLL2MC(gR(i[e],BMapGL.coordType))}this.latLng=gR(i[e],BMapGL.coordType)}else{T[e]=i[e]}}}bx.call(this,C,T)}i7.inherits(bx,"LabelOut");fK.extend(i7.prototype,{toString:function(){return"Label"},setPosition:function(e){this.latLng=new cX(e.lat,e.lng);var i;if(G.apiVersion==="3.0"){i=e}else{i=kz.convertLL2MC(e)}this.setPoint(i)},getPosition:function(){return kt(this.latLng,this.coordType)}});window.BMAP_ANIMATION_DROP=1;window.BMAP_ANIMATION_BOUNCE=2;function lp(e,i){fk.call(this);i=i||{};this.delFlag=i.delFlag;this.coordType=i.coordType||BMapGL.coordType;this.point=e;this._rotation=i.rotation||0;this._rotationOrigin=0;this.map=null;this._animation=null;this.domElement=null;this.iconDom=null;this.infoWindowDom=null;this.siblingElement=null;this.textureCoord=null;this.textureCoordGLMap=null;this.collisionDetectionFailed=false;this._config={offset:new kp(0,0),opacity:1,icon:null,title:"",infoWindow:null,label:null,zIndex:null,baseZIndex:0,clickable:true,zIndexFixed:false,isTop:false,enableMassClear:true,enableDragging:false,raiseOnDrag:false,restrictDraggingArea:false,startAnimation:"",enableCollisionDetection:false,rank:0,enableDraggingMap:false,autoFollowHeadingChanged:false,enableClicking:true,draggingCursor:G.draggingCursor,};this.setOptions(i);if(this._config.zIndex!==undefined){this.zIndex=this._config.zIndex}this._addlog();this._isDragging=false;var C=this;h6.load("marker",function(){C._draw()})}lp.TOP_ZINDEX=a5.getZIndex(-90)+1000000;lp.DRAG_ZINDEX=lp.TOP_ZINDEX+1000000;lp._injectMethond=function(e){fK.extend(lp.prototype,e)};lp.inherits(fk,"Marker");fK.extend(lp.prototype,{toString:function(){return"Marker"},_addlog:function(){var e=1;var i="normal";if(this._config.icon instanceof eo){e=2;i="svg_symbol"}else{if(this._config.icon instanceof f6){e=3;i="custom_symbol"}}iF.sendMessage("Marker","icontype",i)},setOptions:function(e){this.setConfig(e);if(!e.icon){this._config.icon=new kW(G.imgPath+"marker_red.png",new kp(23,25),{offset:new kp(10,25),infoWindowOffset:new kp(10,0)})}},setIcon:function(e){if(e){this._config.icon=e;this.textureCoord=this.textureCoordGLMap=null}},getIcon:function(){return this._config.icon},setLabel:function(e){if(!(e instanceof bx)){return}this._config.label=e;e._config.enableMassClear=this._config.enableMassClear;e.setPoint(this.point)},getLabel:function(){return this._config.label},enableDragging:function(){this._config.enableDragging=true},disableDragging:function(){this._config.enableDragging=false},setPoint:function(e){if(e){this.point=this._config.point=new c4(e.lng,e.lat);if(G.apiVersion==="3.0"&&!this.delFlag){this.latLng=kt(e,BMapGL.coordType)}else{this.latLng=kt(kz.convertMC2LL(e),BMapGL.coordType)}}},setPositionIn:function(e){this.setPoint(e)},getPositionIn:function(){return this.getPoint()},setTop:function(i,e){this._config.isTop=!!i;if(i){this._addi=e||0}},setTitle:function(e){this._config.title=e||""},getTitle:function(){return b(this._config.title)},setOffset:function(e){if(e){this._config.offset=e}},getOffset:function(){return this._config.offset},setAnimation:function(e){this._animation=e},setRank:function(e){this._config.rank=e},getRank:function(){return this._config.rank},setRotation:function(e){while(e<0){e+=360}this._rotation=e%360},setRotationOrigin:function(e){while(e<0){e+=360}this._rotationOrigin=e%360},getRotation:function(){return this._rotation},getShadow:function(){console.error("Warning: GL版本暂不支持设置marker阴影图")},setShadow:function(){console.error("Warning: GL版本暂不支持获取marker阴影图")}});function v(e,T){var i=BMapGL.coordType;if(T&&T.coordType){i=T.coordType}var lO=gR(e,i);this.latLng=new cX(lO.lat,lO.lng);var C;if(G.apiVersion==="3.0"&&!this.delFlag){C=lO}else{C=kz.convertLL2MC(lO)}lp.call(this,C,T)}v.inherits(lp,"MarkerOut");fK.extend(v.prototype,{toString:function(){return"Marker"},toGeoJSON:function(){var i="Point";var C=[this.latLng.lng,this.latLng.lat];var e={type:"Feature",geometry:{type:i,coordinates:C},properties:this.properties};return e},updateByGeoJSON:function(C){var e=new hu();var lP=e.readFeaturesFromObject(C)||[];for(var T=0,lO=lP.length;T1||e<0){return}this._config.fillOpacity=e;this.setDomAttribute("fillopacity",e)},getFillOpacity:function(){return this._config.fillOpacity},setFillColor:function(e){this._config.fillColor=e||"";this.setDomAttribute("fillcolor",e)},getFillColor:function(){return this._config.fillColor},setIcon:function(i){if(!i||!this.map){return}this._config.icon=i;if(this._config.icon){var e=this._config.icon.getCurrentImageUrl();var T=i.getCurrentImageUrl()!==e;this._config.icon=i;this.textureCoord=this.textureCoordGLMap=null;this.draw();var C=new gC("onstatus_change");C.overlay=this;C.action="setIcon";C.imageUrlChanged=T;this.fire(C)}},getIcon:function(){return this._config.icon},setPosition:function(e){this.latLng=new cX(e.lat,e.lng);var i=kz.convertLL2MC(e);this.setPositionIn(i)},getPosition:function(){var e=this.getPositionIn();return kt(kz.convertMC2LL(e),BMapGL.coordType)}});function gO(C,e){jS.call(this,e);this._normalizedBounds=new je();this.setPoints(C);this._addlog(e);var i=this;h6.load("poly",function(){i._draw()})}gO.inherits(jS,"Polyline");fK.extend(gO.prototype,{_addlog:function(e){var i=1;var C="normal";if(e&&e.strokeTexture){i=2;C="texture"}iF.sendMessage("Polyline","bindtype",C)},getBoundsIn:function(e){if(!e){this._bounds.setMinMax();return this._bounds}this._normalizedBounds.setMinMax();return this._normalizedBounds},setPoints:function(lQ){this._clearCache();this.points=jS.getGraphPoints(lQ).slice(0);if(this._config.geodesic===true){this.greatCirclePoints.length=0;for(var lO=0;lO15437726){if(lP.lng0){fK.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{fK.each(e.points,function(i){e._bounds.extend(i)})}e._normalizedBounds.setSouthWest(e._bounds.getSouthWest());e._normalizedBounds.setNorthEast(e._bounds.getNorthEast());if(e._normalizedBounds.sw.lng<-iX.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>iX.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-iX.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=iX.WORLD_SIZE_MC_HALF}},calcGreatCirclePoints:function(T,C){var lP=T.latLng;var lO=C.latLng;if(lP.equalsEpsilon(lO,0.00001)){return}var e=kz.getDistance(jU(lP.lng),jU(lP.lat),jU(lO.lng),jU(lO.lat));if(e<250000){return}var lT=Math.round(e/150000);var lX=this.calcAngularDistance(lP,lO);this.greatCirclePoints.push(T);var lW=lP.lng;var lV=T;for(var lQ=0;lQ30037726){if(lU.lng30037726){if(C.lng0){fK.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{fK.each(e.points,function(i){e._bounds.extend(i)})}e._normalizedBounds.setSouthWest(e._bounds.getSouthWest());e._normalizedBounds.setNorthEast(e._bounds.getNorthEast());if(e._normalizedBounds.sw.lng<-iX.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>iX.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-iX.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=iX.WORLD_SIZE_MC_HALF}},getPathIn:function(){return this._path},setPathIn:function(e){this._path=e;this.setPoints(e)},getCpsIn:function(){return this._cps},setCpsIn:function(e){this._cps=e;this.setPoints(this._path)},calcBezierPoints:function(T,lP){var C=[];for(var e=0;e0){fK.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{fK.each(e.points,function(i){fK.each(i,function(C){e._bounds.extend(C)})})}e._normalizedBounds.setSouthWest(e._bounds.getSouthWest());e._normalizedBounds.setNorthEast(e._bounds.getNorthEast());if(e._normalizedBounds.sw.lng<-iX.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>iX.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-iX.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=iX.WORLD_SIZE_MC_HALF}}});function io(C,e){jS.call(this,e);e=e||{};if(typeof e.fillOpacity==="number"){this._config.fillOpacity=e.fillOpacity}else{this._config.fillOpacity=0.6}cD(this._config.fillOpacity,0,1);if(e.fillColor===""){this._config.fillColor=""}else{this._config.fillColor=e.fillColor?e.fillColor:"#fff"}this._parseFillCacheWebGL=[];this.setPoints(C,e);var i=this;h6.load("poly",function(){i._draw()})}io.inherits(jS,"Polygon");fK.extend(io.prototype,{setPoints:function(lP){var T=[];if(typeof lP==="string"||lP.length===1||lP[0] instanceof c4||lP[0] instanceof cX||this instanceof hZ||lP.length===0){if(lP.length===1){lP=lP[0]}var e=this._processSinglePointArray(lP);this._userPoints=e.userPoints;T=e.innerPoints;this.hasMultipleParts=false}else{this._userPoints=[];for(var lO=0;lO1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new c4(innerPoints[0].lng,innerPoints[0].lat))}return{userPoints:i,innerPoints:innerPoints}},setPointAt:function(C,e,i){var T=i!==undefined&&i!==null;if(!T&&this._userPoints[0]&&this._userPoints[0][C]){T=true;i=0}if((!this._userPoints[C]&&!T)||(T&&!this._userPoints[i]&&!this._userPoints[i][C])){return}this._clearCache();if(T){this._userPoints[i][C]=new c4(e.lng,e.lat);this.points[i][C]=new c4(e.lng,e.lat);if(C===0&&!this.points[i][0].equals(this.points[i][this.points[i].length-1])){this.points[i][this.points[i].length-1]=new c4(e.lng,e.lat)}}else{this._userPoints[C]=new c4(e.lng,e.lat);this.points[C]=new c4(e.lng,e.lat);if(C===0&&!this.points[0].equals(this.points[this.points.length-1])){this.points[this.points.length-1]=new c4(e.lng,e.lat)}}this._calcBounds()},setPositionAt:function(C,e,i){var T=i!==undefined&&i!==null;if(!T&&this._userPoints[0]&&this._userPoints[0][C]){T=true;i=0}if((!this._userPoints[C]&&!T)||(T&&!(this._userPoints[i]&&this._userPoints[i][C]))){return}var lO=kz.convertLL2MC(e);this.setPointAt(C,lO,i)},getPoints:function(){var e=this._userPoints;if(e.length===0){e=this.points}return e},getPathIn:function(){return this.getPoints()}});function j3(C,e){if(!C||C.length===0){return}var i=this.setPath(C,true);io.call(this,i,e)}j3.inherits(io,"PolygonOut");fK.extend(j3.prototype,{toString:function(){return"Polygon"},toGeoJSON:function(){var lO="Polygon";var lP=[];var lR=this.getPath();if(this.hasMultipleParts){lO="Multi"+lO;for(var T=0;T1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new c4(innerPoints[0].lng,innerPoints[0].lat))}return{userPoints:i,innerPoints:innerPoints}},setPointAt:function(i,e){if(!this._userPoints[i]){return}this._clearCache();this._userPoints[i]=new c4(e.lng,e.lat);this.points[i]=new c4(e.lng,e.lat);if(i===0&&!this.points[0].equals(this.points[this.points.length-1])){this.points[this.points.length-1]=new c4(e.lng,e.lat)}this._calcBounds()},getPoints:function(){var e=this._userPoints;if(e.length===0){e=this.points}return e},getPathIn:function(){return this.getPoints()},setTopFillOpacity:function(e){if(e>1||e<0){return}this._config.topFillOpacity=e;this._setDomAttribute("topfillopacity",e)},getTopFillOpacity:function(){return this._config.topFillOpacity},setSideFillOpacity:function(e){if(e>1||e<0){return}this._config.sideFillOpacity=e;this._setDomAttribute("sidefillopacity",e)},getSideFillOpacity:function(){return this._config.sideFillOpacity},setTopFillColor:function(e){this._config.topFillColor=e||"";this._setDomAttribute("topfillcolor",e)},getTopFillColor:function(){return this._config.topFillColor},setSideFillColor:function(e){this._config.sideFillColor=e||"";this._setDomAttribute("sidefillcolor",e)},getSideFillColor:function(){return this._config.sideFillColor},setAltitude:function(e){this._config.altitude=Number(e);this.draw();var i=new gC("onlineupdate");i.overlay=this;this.dispatchEvent(i)},getAltitude:function(){return this._config.altitude}});function bM(lR,lP,lS){if(!lR||lR.length===0){return}this.userPath=lR;var e=[];if(typeof lR==="string"||lR[0] instanceof c4||lR[0] instanceof cX){var lT=this._processSinglePointArray(lR);for(var lO=0;lO1||e<0){return}this._config.opacity=e;this.doOnceDraw()},setDisplayOnMinLevel:function(e){this._config.displayOnMinLevel=e;this.doOnceDraw()},getDisplayOnMinLevel:function(){return this._config.displayOnMinLevel},setDisplayOnMaxLevel:function(e){this._config.displayOnMaxLevel=e;this.doOnceDraw()},getDisplayOnMaxLevel:function(){return this._config.displayOnMaxLevel},getOpacity:function(){return this._config.opacity},getImageURL:function(){return this._config.url},setImage:function(e,C){this._config.src=e;this._config.url=e;this._texture=null;var i=this;this.imageLoad&&this.imageLoad(this._config.src,function(T,lO){if(lO){i._texture=T;if(C){i.setBounds(C,true)}i.doOnceDraw()}})},setImageURL:function(e,i){this.setImage(e,i)},setFomular:function(e,i){if(e&&i){this._config.fomularJS=e;this._config.fomularC=i;this.fHashcode=r({str:this._config.fomularC});this.doOnceDraw()}},setIsPixelMap:function(e){this.isPixelMap=e;this.doOnceDraw()},getImagePixel:function(T){if(!this._config.isPixelMap||!this.canPixelMap()){return null}if(!this.getImageMaskPixel(T)){return null}if(this.imageObject){var C=Math.floor((T.lng-this.points[3].lng)/this.lngMC);var e=Math.floor((-T.lat+this.points[3].lat)/this.latMC);var i=Math.floor((e*this.imageObject.width+C)*4);if(C>this.imageObject.width||C<0){return null}if(e>this.imageObject.height||e<0){return null}if(i+3>this.imageObject.data.data.length){return null}return[this.imageObject.data.data[i],this.imageObject.data.data[i+1],this.imageObject.data.data[i+2],this.imageObject.data.data[i+3],]}return null},getValue:function(i){if(this._config.isPixelMap&&i&&this._config.fomularJS){if(!(i instanceof Array)){i=this.getImagePixel(i.point)}var e=this._config.fomularJS({r:i[0],g:i[1],b:i[2],a:i[3]});if(e>=this._config.clamp[0]&&e<=this._config.clamp[1]){return e}}return null},setImageObject:function(C){var e=document.createElement("canvas");e.width=C.width;e.height=C.height;var i=e.getContext("2d");i.drawImage(C,0,0,C.width,C.height);this.imageObject={width:C.width,height:C.height,data:i.getImageData(0,0,C.width,C.height)};this.updatePixelMc();i=null;e=null},updatePixelMc:function(){if(this.imageObject){var e=Math.abs(this.points[2].lng-this.points[0].lng);var i=Math.abs(this.points[2].lat-this.points[0].lat);this.lngMC=e/this.imageObject.width;this.latMC=i/this.imageObject.height}},setMaskImageObject:function(C){var e=document.createElement("canvas");e.width=C.width;e.height=C.height;var i=e.getContext("2d");i.drawImage(C,0,0,C.width,C.height);this.imageMaskObject={width:C.width,height:C.height,data:i.getImageData(0,0,C.width,C.height)};i=null;e=null},getImageMaskPixel:function(e){if(!this.imageMaskObject){return true}var T=this._toOverlayPixelsGL([e]);var lS=this.maskOverlayPixels;var lP=lS[1][0]-lS[0][0];var lO=lS[1][1]-lS[0][1];var C=Math.floor((T[0][0]-lS[0][0])/lP*this.imageMaskObject.width);var i=Math.floor((-T[0][1]+lS[1][1])/lO*this.imageMaskObject.height);var lR=Math.floor((i*this.imageMaskObject.width+C)*4);if(C>this.imageMaskObject.width||C<0){return null}if(i>this.imageMaskObject.height||i<0){return null}var lQ=this.imageMaskObject.data.data;if(lR+3>lQ.length){return false}if(lQ[lR+3]>0){if(this._config.maskData>-1&&this._config.maskData!==lQ[lR]){return false}return true}return false},doOnceDraw:function(){var e=new gC("onlineupdate");e.overlay=this;this.dispatchEvent(e)},destroy:function(){this.points=[];this.imageMaskObject=null}});function gU(T,lU){if(!T){return}lU=lU||{};var lP=[];if(lU.sysType==="fixed"){lP=T}else{if(T instanceof je){var lR=Math.min(T.sw.lng,T.ne.lng);var lO=Math.max(T.sw.lng,T.ne.lng);var lQ=Math.min(T.sw.lat,T.ne.lat);var C=Math.max(T.sw.lat,T.ne.lat);var lT=[new c4(lR,lQ),new c4(lO,lQ),new c4(lO,C),new c4(lR,C)];var e=jS.getGraphPoints(lT).slice(0);for(var lS=0;lSthis.maxZoom||e||!this.visible){this.hide(true);return false}else{this.show(true);return true}}return false},hide:function(e){if(!e){this.visible=false}this._visible=false;fK.hide(this.domElement)},show:function(e){if(!e){this.visible=true}this._visible=true;fK.show(this.domElement)},draw:function(){if(!this.div||!this.point){return}if(this.nextTick&&this.div.style.position!=="absolute"){this.div.style.opacity=0;setTimeout(function(){this.div.style.opacity=1;this.draw()}.bind(this),0)}if(this.div.children[0]){var lP=this.div.children[0].clientWidth;var e=this.div.children[0].clientHeight;if(!lP&&this.lastClientWidth){lP=this.lastClientWidth;e=this.lastClientHeight}this.lastClientWidth=lP;this.lastClientHeight=e}var T=0;var C=0;var lO=kz.convertLL2MC(this.point);var i=this.map.pointToOverlayPixelIn(lO,{useRound:false});if(!this.useTranslate){T=this.div.children[0]?lP*this.anchors[0]:0;C=this.div.children[0]?e*this.anchors[1]-(this.fixBottom?0:25):0}this.div.style.position="absolute";this.div.style.left=i.x-T+this.offsetX+"px";this.div.style.top=i.y-C+this.offsetY+"px";this.div.style.boxSizing="border-box";if(!this.isDraw()){return}},addEventListener:function(C,lO){if(!this.div||!this.map){return}var i=this;var T=this.map;function e(lS){var lQ=new gC("onclick").inherit(lS);lQ.type=lS.type;var lR=lS.srcElement||lS.target;var lP=lS.clientX||lS.pageX;var lU=lS.clientY||lS.pageY;if(lS&&lQ&&lR&&lP&&lU){var lT=fK.Dom.getOffset(T.container);lQ.pixel=new f8(lP-lT.left,lU-lT.top);lQ.latLng=T.pixelToPoint(lQ.pixel)}return lQ}switch(C){case"mouseover":if(this.div.style){this.div.style.cursor="pointer"}fK.on(this.div,"mouseover",function(lQ){i.div.style.cursor="pointer";var lP=e(lQ);i.dispatchEvent(lP);lO(lP)});break;case"mouseout":fK.on(this.div,"mouseout",function(lQ){var lP=e(lQ);i.dispatchEvent(lP);lO(lP)});break;case"click":if(this.div.style){this.div.style.cursor="pointer"}fK.on(this.div,"click",function(lQ){var lP=e(lQ);i.dispatchEvent(lP);lO(lP)});break;default:break}},setPoint:function(e,lO){if(e instanceof c4){if(!lO){this.div.innerHTML="";this.div.appendChild(this.createDom(this.properties))}this.point=gR(e,BMapGL.coordType);if(this.synUpdate){this.map.dispatchEvent(new gC("onrefresh"));return}var T=0;var C=0;if(!this.useTranslate){T=this.div.clientWidth*this.anchors[0];C=this.div.clientHeight*this.anchors[1]-(this.fixBottom?0:25)}var lP=kz.convertLL2MC(this.point);var i=this.map.pointToOverlayPixelIn(lP,{useRound:false});this.div.style.position="absolute";this.div.style.left=i.x-T+this.offsetX+"px";this.div.style.top=i.y-C+this.offsetY+"px"}},setRotation:function(lR){lR=lR+this.rotationInit;while(lR<0){lR+=360}this._rotation=lR%360;var lP=0;var C=this._rotation;if((this._rotation>90&&this._rotation<270)&&this.rotationFlip){lP=180;C-=360}else{lP=0}if(this.rotationFlip){var lT=((this.div.clientWidth||0)*this.anchors[0]||0)-(this._originOpt.offsetY||0)+(this._originOpt.offsetX||0);if(Math.abs(this._rotation-80)<=10||Math.abs(this._rotation-260)<=10){this.offsetX=lT}else{if(Math.abs(this._rotation-100)<=10||Math.abs(this._rotation-280)<=10){this.offsetX=-lT}else{this.offsetX=this._originOpt.offsetX||0}}}var i=this.div.style.transform;const lO=/translate\(([^)]+)/;const lS=i.match(lO);if(lS){const lQ=lS[1].split(",");const T=lQ[0].trim();const e=lQ[1].trim();this.div.style.transform="translate("+T+", "+e+") rotateZ("+C+"deg) rotateX("+lP+"deg)"}else{this.div.style.transform="rotateZ("+C+"deg) rotateX("+lP+"deg)"}},setRotationOrigin:function(e){while(e<0){e+=360}this._rotationOrigin=e%360;this.updateRotation()},updateRotation:function(){if(!this.map||!this.autoFollowHeadingChanged){return}var e=(this._rotationOrigin+this.map.getHeading());this.setRotation(e)},getRotation:function(){return this._rotation},getPoint:function(){return kt(this.point,BMapGL.coordType)},setProperties:function(e){if(e instanceof Object){Object.assign(this.properties,e);this.div.innerHTML="";this.div.appendChild(this.createDom(this.properties))}},getProperties:function(){return this.properties},toString:function(){return"CustomOverlay"},_getPixPos:function(C,e){var T=kz.convertLL2MC(this.point);var i=this.map.pointToOverlayPixelIn(T,{zoom:C,center:e,fixPosition:true});return i},});function gs(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("CanvasLayer")}a5.call(this);this.options=e||{};this.paneName=this.options.paneName||"labelPane";this.zIndex=this.options.zIndex||0;this.contextType=this.options.contextType||"2d";this.enableMassClear=this.options.enableMassClear!==false;this._bindedResize=null}gs.inherits(a5,"CanvasLayer");gs.prototype.initialize=function(T){this._map=T;var i=this.canvas=document.createElement("canvas");var e=this.ctx=this.canvas.getContext(this.contextType);i.style.cssText="position:absolute;left:0;top:0;pointer-events:none;z-index:"+this.zIndex+";";this.adjustSize();this.adjustRatio(e);var lO=T.getPanes()[this.paneName];if(lO){lO.appendChild(i)}var C=this;this._bindedResize=function(){if(!C.canvas||!C._map){return}C.adjustSize();C.adjustRatio(C.ctx);C.draw()};T.addEventListener("resize",this._bindedResize);return this.canvas};gs.prototype.adjustSize=function(){var i=this._map.getSize();var e=this.canvas;e.width=i.width;e.height=i.height;e.style.width=e.width+"px";e.style.height=e.height+"px"};gs.prototype.adjustRatio=function(i){var lO=i.backingStorePixelRatio||i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1;var T=(window.devicePixelRatio||1)/lO;var e=i.canvas.width;var C=i.canvas.height;i.canvas.width=e*T;i.canvas.height=C*T;i.canvas.style.width=e+"px";i.canvas.style.height=C+"px";i.scale(T,T)};gs.prototype.draw=function(){if(!this.canvas||!this._map){return}if(this._map._renderType!=="webgl"){this.canvas.style.left=-this._map.offsetX+"px";this.canvas.style.top=-this._map.offsetY+"px"}this.dispatchEvent("draw");this.options.update&&this.options.update.apply(this,arguments)};gs.prototype.remove=function(){if(this._map&&this._bindedResize){this._map.removeEventListener("resize",this._bindedResize);this._bindedResize=null}if(this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas)}this.canvas=null;this.ctx=null;this.domElement=null;this.dispatchEvent(new gC("onremove"))};gs.prototype.getContainer=function(){return this.canvas};gs.prototype.show=function(){if(!this.canvas&&this._map){this._map.addOverlay(this)}if(this.canvas){this.canvas.style.display="block"}};gs.prototype.hide=function(){if(this.canvas){this.canvas.style.display="none"}};gs.prototype.setZIndex=function(e){this.zIndex=e;if(this.canvas){this.canvas.style.zIndex=e}};gs.prototype.getZIndex=function(){return this.zIndex};var aG={};function jh(C,i){fK.BaseClass.call(this);this.content=C;this.map=null;this._config={width:0,height:0,maxWidth:600,offset:new kp(0,0),title:"",maxContent:"",enableMaximize:false,enableAutoPan:true,enableCloseOnClick:true,margin:[10,10,40,10],collisions:[[10,10],[10,10],[10,10],[10,10]],ifMaxScene:false,onClosing:function(){return true}};this.setConfig(i);if(this._config.width<50){this._config.width=50}if(this._config.width>730){this._config.width=730}if(this._config.height!=0){if(this._config.height<50){this._config.height=50}if(this._config.height>650){this._config.height=650}}if(this._config.maxWidth!==0){if(this._config.maxWidth<50){this._config.maxWidth=50}if(this._config.maxWidth>730){this._config.maxWidth=730}}this.isWinMax=false;this.IMG_PATH=G.imgPath;this.overlay=null;var e=this;h6.load("simpleInfowindow",function(){e._draw()})}jh.inherits(fK.BaseClass,"SimpleInfoWindow");fK.extend(jh.prototype,{setWidth:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<50){e=50}if(e>730){e=730}}this._config.width=e},setHeight:function(e){e=e*1;e-=10;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<50){e=50}if(e>650){e=650}}this._config.height=e},setMaxWidth:function(e){e=e*1;if(!e&&e!=0||isNaN(e)||e<0){return}if(e!=0){if(e<50){e=50}if(e>730){e=730}}this._config.maxWidth=e},setTitle:function(e){this._config.title=e||""},setContent:function(e){this.content=e||""},setMaxContent:function(e){this._config.maxContent=e||""},redraw:function(){},enableAutoPan:function(){this._config.enableAutoPan=true},disableAutoPan:function(){this._config.enableAutoPan=false},enableCloseOnClick:function(){this._config.enableCloseOnClick=true},disableCloseOnClick:function(){this._config.enableCloseOnClick=false},enableMaximize:function(){this._config.enableMaximize=true},disableMaximize:function(){this._config.enableMaximize=false},show:function(){this._visible=true},hide:function(){this._visible=false},close:function(){this.hide()},dispose:function(){fK.BaseClass.prototype.decontrol.call(this)},maximize:function(){this.isWinMax=true},restore:function(){this.isWinMax=false},setConfig:function(i){if(!i){return}for(var e in i){if(typeof(this._config[e])==typeof(i[e])){this._config[e]=i[e]}}},isVisible:function(){return this.isOpen()},isOpen:function(){return false},getPoint:function(){if(this.overlay&&this.overlay.getPoint){return this.overlay.getPoint()}},getOffset:function(){return this._config.offset},dispose:function(){fK.BaseClass.prototype.decontrol.call(this)},toString:function(){return"SimpleInfoWindow"}});iX.prototype.openSimpleInfoWindow=function(T,e){if(!T||T.toString()!="SimpleInfoWindow"||!e||e.toString()!="Point"){return}var i=this.temp;if(!i.marker){var C=new kW(G.imgPath+"blank.gif",{width:1,height:1});i.marker=new lp(e,{icon:C,width:1,height:1,offset:new kp(0,0),infoWindowOffset:new kp(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openSimpleInfoWindow(T)};iX.prototype.closeSimpleInfoWindow=function(){var e=this.temp.infoWin||this.temp._infoWin;if(e&&e.overlay){e.overlay.closeSimpleInfoWindow()}};fk.prototype.openSimpleInfoWindow=function(e){if(this.map){this.map.closeSimpleInfoWindow();e._visible=true;this.map.temp._infoWin=e;e.overlay=this;fK.BaseClass.call(e,e.hashCode)}};fk.prototype.closeSimpleInfoWindow=function(){if(this.map&&this.map.temp._infoWin){this.map.temp._infoWin._visible=false;this.map.temp._infoWin.decontrol();this.map.temp._infoWin=null}};function cM(C,e){jS.call(this,e);e=e||{};this._config.showRegion=e.showRegion||"inside";this._config.isBuildingMask=e.isBuildingMask&&true;this._config.isPoiMask=e.isPoiMask&&true;this._config.isMapMask=e.isMapMask&&true;this._config.path=C;this._parseFillCacheWebGL=[];this.setPoints(C,e);var i=this;h6.load("poly",function(){i._draw()})}cM.inherits(jS,"MapMask");fK.extend(cM.prototype,{setPoints:function(i){var e=jS.getGraphPoints(i).slice(0);this.hasMultipleParts=false;jS.prototype.setPoints.call(this,e)},setPathIn:function(e){this.setPoints(e)},_processSinglePointArray:function(e){var i=jS.getGraphPoints(e).slice(0);innerPoints=i.slice(0);if(innerPoints.length>1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new c4(innerPoints[0].lng,innerPoints[0].lat))}return{userPoints:i,innerPoints:innerPoints}},getPoints:function(){var e=this._userPoints;if(e.length===0){e=this.points}return e},getPathIn:function(){return this.getPoints()}});function lA(lP,C){if(!lP||lP.length===0){return}var lO=[];if(lP[0] instanceof c4){var e=this._processSinglePointArray(lP);for(var T=0;T=4){jZ=window.B_HOST_TILE_BASE_URLS}var lG={B_NORMAL_MAP:{tileUrls:ec(G.tileDomain,G.rasterTilePath),vectorTileUrls:ec(G.tileDomain,G.vectorTilePath),languageTileUrls:function(e){switch(e){case BMAP_LANGUAGE_ZH:return ec(G.tileDomain,G.vectorTilePath);default:if(window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]){return ec([window._BMapSecurityConfig["serviceHost"]],G.enVectorTilePath)}return ec(G.enTileDomain,G.enVectorTilePath)}},tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,webgl:{minZoom:3,maxZoom:25},zoomLevelBase:18,errorUrl:G.imgPath+"bg.png",bounds:new je(new c4(-21364736,-11708041.66),new c4(23855104,12474104.17)),imgExtend:"png"},B_SATELLITE_MAP:{tileUrls:[G.urlProtocol+"//"+(jZ[0]||"apimaponline0.bdimg.com/starpic/?qt=satepc&"),G.urlProtocol+"//"+(jZ[0]||"apimaponline1.bdimg.com/starpic/?qt=satepc&"),G.urlProtocol+"//"+(jZ[0]||"apimaponline2.bdimg.com/starpic/?qt=satepc&"),G.urlProtocol+"//"+(jZ[0]||"apimaponline3.bdimg.com/starpic/?qt=satepc&"),],tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:G.imgPath+"bg.png",bounds:new je(new c4(-21364736,-10616832),new c4(23855104,15859712)),imgExtend:"png"},B_STREET_MAP:{tileUrls:ec(G.tileDomain,G.rasterTilePath),tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:G.imgPath+"bg.png",bounds:new je(new c4(-21364736,-10616832),new c4(23855104,15859712)),imgExtend:"png"},BMAP_CUSTOM_LAYER:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:G.imgPath+"blank.gif",bounds:new je(new c4(-21364736,-10616832),new c4(23855104,15859712)),imgExtend:"png"},B_EARTH_MAP:{tileUrls:[""],tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,webgl:{minZoom:3,maxZoom:21},zoomLevelBase:18,errorUrl:G.imgPath+"blank.gif",bounds:new je(new c4(-21364736,-10616832),new c4(23855104,15859712)),imgExtend:"png"},B_NONE_MAP:{tileUrls:"",tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:G.imgPath+"bg.png",bounds:new je(new c4(-21364736,-11708041.66),new c4(23855104,12474104.17)),imgExtend:"png"}};var e1=lG;function ai(e,i,C){this._name=e;this._layers=[];if(i){this._layers=i instanceof iE?[i]:(i.slice?i.slice(0):[i])}C=C||{};this._opts={tips:C.tips||"",labelText:C.labelText||"",minZoom:C.minZoom==null?3:C.minZoom,maxZoom:C.maxZoom==null?19:C.maxZoom,tileSize:C.tileSize==null?256:C.tileSize,textColor:C.textColor||"black",errorImageUrl:C.errorImageUrl||"",bounds:C.bounds||new je(new c4(-21364736,-16023552),new c4(23855104,19431424)),projection:C.projection||new kz()};if(typeof C.id==="string"){this.id=C.id;this.mapTypeId=C.id;this._config=e1&&e1[C.id]?e1[C.id]:null}if(typeof C.compatType==="string"){this.compatType=C.compatType}}fK.extend(ai.prototype,{getName:function(){return this._name},getTips:function(){return this._opts.tips},getLabelText:function(){return this._opts.labelText},getTileLayer:function(){return this._layers[0]},getTileLayers:function(){return this._layers},getTileSize:function(){return this._opts.tileSize},getMinZoom:function(){return this._opts.minZoom},getMaxZoom:function(){return this._opts.maxZoom},getTextColor:function(){return this._opts.textColor},getProjection:function(){return this._opts.projection},getErrorImageUrl:function(){return this._opts.errorImageUrl}});function km(lP,C,e,T){var i=e1&&e1[lP]?e1[lP]:null;T=T||{};var lO={id:lP,compatType:T.compatType||"",tips:e||"",labelText:T.labelText||"",minZoom:i&&i.minZoom!=null?i.minZoom:3,maxZoom:i&&i.maxZoom!=null?i.maxZoom:19,tileSize:i&&i.tileSize!=null?i.tileSize:256,errorImageUrl:i&&i.errorUrl?i.errorUrl:"",bounds:i&&i.bounds?i.bounds.clone?i.bounds.clone():i.bounds:undefined,projection:new kz()};return new ai(C,null,lO)}ai.builtin={BMAP_NORMAL_MAP:km("B_NORMAL_MAP","地图","显示普通地图",{compatType:"BMAP_NORMAL_MAP"}),BMAP_SATELLITE_MAP:km("B_SATELLITE_MAP","卫星","显示卫星影像",{compatType:"BMAP_SATELLITE_MAP"}),BMAP_HYBRID_MAP:km("B_SATELLITE_MAP","混合","显示带有街道的卫星影像",{compatType:"BMAP_HYBRID_MAP",labelText:"路网"}),BMAP_EARTH_MAP:km("B_EARTH_MAP","地球","显示地球",{compatType:"BMAP_EARTH_MAP"}),BMAP_NONE_MAP:km("B_NONE_MAP","空白","显示空白地图",{compatType:"BMAP_NONE_MAP"})};function dk(lQ,lR,C,e,lP){if(lP&&e1[lP]){this.mapTypeName=lP}else{this.mapTypeName=iV}if(lQ&&lQ instanceof Array){var lO=true;for(var T=0;T=e1[this.mapTypeName].webgl.minZoom){if(e1[this.mapTypeName].webgl){if(lR>=e1[this.mapTypeName].webgl.minZoom){this.minZoom=lR}else{this.minZoom=e1[this.mapTypeName].webgl.minZoom}}else{if(lR>=e1[this.mapTypeName].minZoom){this.minZoom=lR}else{this.minZoom=e1[this.mapTypeName].minZoom}}}if(typeof C==="number"){if(e1[this.mapTypeName].webgl){if(C<=e1[this.mapTypeName].webgl.maxZoom){this.maxZoom=C}else{this.maxZoom=e1[this.mapTypeName].webgl.maxZoom}}else{if(C<=e1[this.mapTypeName].maxZoom){this.maxZoom=C}else{this.maxZoom=e1[this.mapTypeName].maxZoom}}}if(this.maxZoomthis.maxZoom){return false}var lP=this.containsPoint(e,lO);if(lP){return lP}for(var C=0;Cthis.maxZoom){return lO}for(var C=0;C0){lU[lQ.name]=lQ;lU.push(lQ.name)}var lY=lU.length-lW.bufferNumber;for(var lZ=0;lY>0&&lZ0&&this._transparentPng){this.img.src=G.imgPath+"blank.gif"}else{this.img.src=this.src}};iW.prototype._callCbks=function(){var C=this;for(var e=0;e8);function kH(e){this.tileLayers=[];this.map=e;this.bufferNumber=300;this.mapTiles=[];this.bufferTiles=[];this.config=e1[this.map.mapType];this.errorUrl=this.config.errorUrl;this.tileSize=this.config.tileSize;this.baseUnits=this.config.baseUnits;this.baseZoomLevel=this.config.zoomLevelBase;this.tileURLs=this.config.tileUrls;this.imgNumber=0;this.numLoading=0;this.temp={}}bS.register(function(i){if(i._renderType==="webgl"){return}var e=i.tileMgr=new kH(i);i.addEventListener("mousewheel",function(C){e.mouseWheel(C)});i.addEventListener("dblclick",function(C){e.dblClick(C)});i.addEventListener("rightdblclick",function(C){e.dblClick(C)});i.addEventListener("minuspress",function(C){e.keypress(C)});i.addEventListener("pluspress",function(C){e.keypress(C)});i.addEventListener("load",function(C){if(this.mapType===ce){return}e.loadTiles()});i.addEventListener("zoomstartcode",function(C){if(this.mapType===ce){return}e._zoom(C)});i.addEventListener("moving",function(C){if(this.mapType===ce){return}e.moveGridTiles()});i.addEventListener("resize",function(C){if(this.mapType===ce){return}e.resizeMap(C)});i.addEventListener("addtilelayer",function(C){e.addTileLayer(C)});i.addEventListener("removetilelayer",function(C){e.removeTileLayer(C)})});fK.extend(kH.prototype,{addTileLayer:function(T){var C=this;var i=T.target;C.tileLayers.push(i);if(C.map.loaded){C.moveGridTiles()}},removeTileLayer:function(lU){var lV=this;var lS=lU.target;var lQ=lS.mapType;var lP=lV.mapTiles;var lX=lV.bufferTiles;for(var C in lX){var T=C.split("-")[1];if(T==lQ){delete lX[C]}}for(var C in lP){var T=C.split("-")[1];if(T==lQ){delete lP[C]}}if(lV.zoomsDiv&&lV.zoomsDiv.parentNode){lV.zoomsDiv.parentNode.removeChild(lV.zoomsDiv);lV.zoomsDiv.innerHTML=""}var lO=lV.map;if(lO.deepZoom){var lW=lO.deepZoom.preDeepZoomDiv;if(lW&&lW.parentNode){lW.parentNode.removeChild(lW)}}for(var lT=0,lR=lV.tileLayers.length;lT=1.5?2:1;this.normalUdt=lo("ditu","normal").udt;this.numLoading=0;this.numTileLoading=0;this.firstTileLoad=false;this.retry=this.opts.retry||false;this.retryTime=this.opts.retryTime||600;this.useThumbData=false;this.useThumbData=this.opts.useThumbData||false;if(this.baseLayer){this.useThumbData=true}if(typeof this.opts.customLayer==="boolean"){this.customLayer=this.opts.customLayer}else{this.customLayer=true}}iE.inherits(dH,"TileLayer");fK.extend(iE.prototype,{isTransparentPng:function(){return this.transparentPng},getTilesUrl:function(lV,e){var lU=kc(this.mapType);var C=e1[lU];if(typeof C!=="object"){return null}var T=lV.x;var lW=lV.y;T=fO.calcLoopParam(T,e).col;var i="";if(this.opts.tileUrlTemplate){i=this.opts.tileUrlTemplate;i=i.replace(/\{X\}/,lW);i=i.replace(/\{Y\}/,T);i=i.replace(/\{Z\}/,e)}else{if(lU===iV){var lT=this.isCanvasMap?0:1;var lP=C.tileUrls[Math.abs(lW+T)%C.tileUrls.length];if(window.offLineIPAddress){lP=window.offLineIPAddress+"tile5/"}var lO=this.map.config.style;i=lP+"?qt=vtile&x="+T+"&y="+lW+"&z="+e+(lO==="default"?"":("&styleId=1"))+"&styles=pl&udt="+this.normalUdt+"&scaler="+this.scaler+"&showtext="+lT+"&ak="+fy+"&is_has_bmap_proxy="+iM+"&from=gl";i=i.replace(/-(\d+)/gi,"M$1")}if(lU===hY){var lQ=lo("ditu","satellite");var lS=lQ.ver;var lR=lQ.udt;i=C.tileUrls[Math.abs(lW+T)%C.tileUrls.length]+"u=x="+T+";y="+lW+";z="+e+";v="+lS+";type=sate&fm=46&udt="+lR;i=i.replace(/-(\d+)/gi,"M$1")}}return i},initialize:function(lQ){this.map=lQ;this.tileCache._diagOwner=lQ;if(lQ._renderType==="webgl"){var lP=null;if(this.customLayer!==false){lP=this.getTilesUrl}fK.extend(this,f4);this.labelProcessor=new kB(this);this.callbackDataQueue=[];if(lP){this.getTilesUrl=lP}var C=this;lQ.on("indoor_data_refresh",function(lR){if(!C.baseLayer){return}C._refreshIndoorData(lR.uid,lR.floor)});lQ.on("custom_labels_ready",function(lR){if(C.mapType!==iV&&lR.model==="custom"){return}if((lR.model==="custom")||lR.model==="mvt_"+C.drawIndex){C._doWorkAfterLabelImageLoad(lR.virtualTile,lR.labelCanvas,null,lR.imgKey)}});lQ.on("glmoduleloaded",function(){if(!C.baseLayer){return}C.updateAllIconsTextureCoords()});lQ.on("layer_update",function(lS){if(C.dataType===2&&lQ.customLoaded&&lQ.areaCustomLoaded){var lR=new gC("onlayer_clear");lQ.fire(lR)}});lQ.on("layer_clear",function(lR){if(C.dataType===2){C.clearCache()}});if(this.ontology&&this.ontology._initEvent){this.ontology._initEvent(lQ)}}if(!lQ.temp.layerZIndex){lQ.temp.layerZIndex=0}this.zIndex=this.zIndex||1;if(lQ.getRenderType()==="dom"){this.zIndex=lQ.tileMgr.tileLayers.length}else{if(this.baseLayer){this.zIndex=0}else{if(this.zIndex>0){this.adjustZIndex()}else{var e=lQ._featureMgr.result.bkData;this.zIndex=e.length||1}}}if(!lQ.temp.layid){lQ.temp.layid=0}if(!this.opts.mapType){this.mapType="BMAP_CUSTOM_LAYER_"+lQ.temp.layid;lQ.temp.layid++}else{this.mapType=kc(this.opts.mapType)}var T=e1[this.mapType];if(!T){e1[this.mapType]={tileUrls:[],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:19,minZoom:3,maxZoom:19,minDataZoom:3,maxDataZoom:19,zoomLevelBase:18,errorUrl:G.imgPath+"/blank.gif",bounds:new je(new c4(-21364736,-10616832),new c4(23855104,15859712)),imgExtend:"png"}}if(lQ._renderType!=="webgl"){var lO=b5(lQ.platform,'
');lO.style.display="";lO.style.left=Math.ceil(-lQ.offsetX+lQ.width/2)+"px";lO.style.top=Math.ceil(-lQ.offsetY+lQ.height/2)+"px";this.tilesDiv=lO}this.isCanvasMap=lQ.isCanvasMap();this.lastZoom=lQ.getZoom();var i=this;this.addEventListener("initDrawData",function(lR){if(i.opts.boundary){i.addBoundary(i.opts.boundary)}});lQ.on("destroy",function(){i.destroy()})},clearCache:function(){this.tileCache.clear();this.map._featureMgr.clearData(this.drawIndex);this.map._featureMgr.setLabelData([],this.drawIndex);this.map._featureMgr.clearLabelOverlayData(this.drawIndex);this.labelProcessor.iconCache.clear()},remove:function(){if(this.tilesDiv&&this.tilesDiv.parentNode){this.tilesDiv.innerHTML="";this.tilesDiv.parentNode.removeChild(this.tilesDiv)}delete this.tilesDiv},getCopyright:function(){return this.copyright},getMapType:function(){return this.mapType},adjustZIndex:function(){if(this.map&&this.map._featureMgr){var e=this.map._featureMgr.result.bkData;while(e[this.zIndex]){this.zIndex+=1}}},_getAdjoinZIndex:function(lO){var C=this.zIndex;if(this.map&&this.map._featureMgr){var e=this.map._featureMgr.result.bkData;if(lO==="up"){for(var T=this.zIndex+1;T0;T--){if(e[T]){C=T;break}}}}return C},setZIndex:function(e){this.setTargetZIndex(e)},setTargetZIndex:function(e){this.removeLabel&&this.removeLabel(this.zIndex);this.zIndex=e;this.drawIndex=e;if(this.tilesDiv){this.tilesDiv.style.zIndex=e}},calcLoopParam:function(e,i){return fO.calcLoopParam(e,i)},addBoundary:function(lP){if(!lP||!this.map){return}if(typeof lP==="string"){lP=[lP]}for(var T=0;T-1;lO--){var lP={};C=T.children[lO].style;lP.top=parseInt(C.top,10);lP.left=parseInt(C.left,10);this._zoomAniInfo[lO]=lP}},prepareLabelLayer:function(){var lO=this._map;if(this._enableCanvas2dMap&&lO.canvas2dMapMgr){if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.parentNode.removeChild(this.touchZoomLabelCanvas)}var i=lO.canvas2dMapMgr._labelCanvas;this.touchZoomLabelCanvas=i.cloneNode(false);var e=this.touchZoomLabelCanvas.getContext("2d");e.drawImage(i,0,0);lO.platform.insertBefore(this.touchZoomLabelCanvas,lO.platform.firstChild);var T=parseInt(i.style.left,10);var C=parseInt(i.style.top,10);this.touchZoomLabelCanvas.style.zIndex=9;this.touchZoomLabelCanvas.style[this._transformOriginStyleName]=(this._fixPosition.x-(lO.offsetX+T))+"px "+(this._fixPosition.y-(lO.offsetY+C))+"px";i.style.visibility="hidden"}},show:function(){if(this._animationDiv){this._animationDiv.style.visibility=""}},showLabel:function(){var i=this._map;if(this._enableCanvas2dMap&&i.canvas2dMapMgr){var e=i.canvas2dMapMgr._labelCanvas;if(e){e.style.visibility=""}if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.style.zIndex=-2;this.touchZoomLabelCanvas.style.visibility="hidden"}}},hide:function(){if(this._animationDiv){this._animationDiv.style.visibility="hidden"}if(this._preAnimationDiv){this._preAnimationDiv.style.visibility="hidden"}},hideNonAnimationLayers:function(){var T=this._map;if(T.getRenderType()==="dom"){if(T.overlayDiv){T.overlayDiv.style.visibility="hidden"}if(T.overlayDivEx){T.overlayDivEx.style.visibility="hidden"}}var lP=T.tileMgr.tileLayers;var lO;for(var C=0,e=lP.length;C-1;lW--){var lU=this._zoomAniInfo[lW];lV=T.children[lW].style;var lO=lU.left-lR.x;var C=lU.top-lR.y;lU.dx=lO*e-lO;lU.dy=C*e-C;lU.preDx=lO-lO;lU.preDy=C-C;l3=lU.preDx+(lU.dx-lU.preDx);lS=lU.preDy+(lU.dy-lU.preDy)+lT;lV.left=lU.left+l3+"px";lV.top=lU.top+lS+"px";lV.width=lV.height=256*e+"px"}if(this._enableCanvas2dMap){var l2=!l1._isIE9?"translate3d(0px, "+lT+"px, 0) scale("+e+")":"translate(0px, "+lT+"px) scale("+e+")";this.touchZoomLabelCanvas.style[lY]=l2}},setZoomFinish:function(){this._animationDiv=null},startAnimation:function(lQ){this.prepareLayer();this.hideNonAnimationLayers();var l9=this._map;if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.style.display="none"}lQ=lQ||{};var l7=lQ.zoomCount||0;var lV=lQ.fixPosition;var l5=lQ.fixMCPosition;var lT=lQ.pixOffset;this._zoomCount=l7;var T=l9.getZoom();var l8=T+l7;var e=l9.config.enableContinuousZoom;var lZ=0.5;var lU=5;var C=Math.pow(2,l7);var mb=this._baseLayerDiv;var lW={x:lV.x-parseInt(mb.style.left,10)-l9.offsetX,y:lV.y-parseInt(mb.style.top,10)-l9.offsetY};var lR=this._animationDiv;var l3=lR.children.length;var md=this._preZoomTimes;var l6=[];var l4=this._transformStyleName;var lS=this._transformOriginStyleName;for(var l2=l3-1;l2>-1;l2--){var l0={};var l1=lR.children[l2].style;l0.top=parseInt(l1.top,10);l0.left=parseInt(l1.left,10);var lP=l0.left-lW.x;var lO=l0.top-lW.y;l0.dx=lP*C-lP;l0.dy=lO*C-lO;l0.preDx=lP*md-lP;l0.preDy=lO*md-lO;l6[l2]=l0}var ma=this;var lY;var mc;var lX;this._zoomAni=new gr({fps:60,duration:e?500:1,transition:function(i){i=i*lU/(2*lZ);return lU*i-lZ*i*i},render:function(mm){mm=mm*(4*lZ)/(lU*lU);lY=md+mm*(C-md);var mf=T+s(lY);var mk=null;var mj=0;var mn=0;if(lQ.onAnimationBeforeLooping){var mo=lQ.onAnimationBeforeLooping(mm,mf);mk=mo.loopingCenter;mj=mo.yDiff;mn=mo.totalYDiff}for(var mg=l6.length-1;mg>-1;mg--){var mh=l6[mg];if(lR.children[mg]){var ml=lR.children[mg].style;mc=mh.preDx+(mh.dx-mh.preDx)*mm-lT.width*mm;lX=mh.preDy+(mh.dy-mh.preDy)*mm-lT.height*mm+mj;ml.left=mh.left+mc+"px";ml.top=mh.top+lX+"px";ml.height=ml.width=256*lY+"px"}}var me=lT.width*mm;var mi=lT.height*mm;if(l9.isRestrict){ma._enableCanvas2dMap&&ma._canvas2dMapMgr.clearLabel()}else{ma._enableCanvas2dMap&&ma._canvas2dMapMgr.drawLabel(lY,lV,T,l8,l7,mm,me,mi,mn,mj)}ma._preZoomTimes=lY;ma._preRenderTick=mm;lQ.onAnimationLooping&&lQ.onAnimationLooping(mm,mf,mk)},finish:function(){ma._preZoomTimes=1;ma._zoomAni=null;ma._animationDiv=null;lQ.onAnimationFinish&&lQ.onAnimationFinish();ma.showNonAnimationLayers()}});return this._zoomAni},stopAnimation:function(){if(this._zoomAni){this._zoomAni.stop();this._zoomAni=null}}});function lL(e){this._initVars(e);this._initColorCanvas();this._bindEvent(e)}fK.extend(lL.prototype,{_initVars:function(e){this._map=e._map;this._canvas2dMapMgr=e;this._labelCtx=e._labelCtx;this.ratio=this._map.config.ratio;this.sizeRatio=this.ratio>1?2:1;this.RANK1=1000000;this.RANK2=2000000;this.RANK3=3000000;this.RANK4=4000000;this.RANK5=5000000},_initColorCanvas:function(){var i=256,C=cm("canvas"),e=C.style;e.width=i+"px";e.height=i+"px";C.width=i;C.height=i;this._colorCvsSize=i;this._colorCvs=C;this._colorCtx=C.getContext("2d")},getLabelImageData:function(l0){var lZ=l0.textImg;var C=l0.textPos;var lX=this.ratio;var lV=this.sizeRatio/lX;var lO=this._colorCtx;var lS=this._colorCvsSize;lO.clearRect(0,0,lS,lS);var lU=0;var e=0;var lR=0;for(var lT=0;lTlU){lU=C[lT].width;e=lT;lR=C[lT].drawX}}lU/=lV;var lW=0;for(var lT=0,lQ=C.length;lTlU){lU=lY.width/lV}lW+=lY.height/lV+2*lX}var T=lO.getImageData(0,0,lU,lW);var lP=lO.getImageData(0,0,lU,lW);return[T,lP]},_bindEvent:function(i){var e=this,C=i._map;C.addEventListener("onspotmouseover",function(lQ){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(lQ.spots.length>0){var lP=lQ.spots[0].userdata.uid;var lO=lQ.spots[0].userdata.name;var T=e.findLabelByUid(lP,lO);T&&e._toHighLightColor(T)}});C.addEventListener("onspotmouseout",function(lQ){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(lQ.spots.length>0){var lP=lQ.spots[0].userdata.uid;var lO=lQ.spots[0].userdata.name;var T=e.findLabelByUid(lP,lO);T&&e._toDefaultColor(T)}});C.addEventListener("onspotclick",function(lQ){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(lQ.spots&&lQ.spots.length>0){var lP=lQ.spots[0].userdata.uid;var lO=lQ.spots[0].userdata.name;var T=e.findLabelByUid(lP,lO);T&&e._changeBaseMapState(T)}else{e._recoverNormalState()}});C.on("spot_status_reset",function(){e._recoverNormalState()});C.on("spot_highlight",function(lO){var T=e.findLabelByUid(lO.uid);T&&e._changeBaseMapState(T)})},_getTextBound:function(lY){if(!lY.textPos){return null}var lW=this.ratio;var lU=this.sizeRatio/lW;var C=lY.textPos;var lX=lY.baseDrawX;var lV=lY.baseDrawY;var lS=lX*lW+(C[0].drawX-lX)/lU;var lQ=lV*lW+(C[0].drawY-lV)/lU;var lO=lS+C[0].width/lU;var e=lQ+C[0].height/lU;for(var lT=0,lR=C.length;lTlO){lO=lP+lZ.width}if(T+lZ.height>e){e=T+lZ.height}}return[lS,lQ,lO,e]},_toHighLightColor:function(C){if(C._tempRank&&C._tempRank==this.RANK5){return}var lR=this._getTextBound(C);if(!lR){return}var T=Math.round(lR[0]);var i=Math.round(lR[1]);var e=this.getLabelImageData(C);var lP=e[0];var lO=e[1];var lQ=this._canvas2dMapMgr.getFilterImageData(lP,this.RANK5);C._oldImgData=lO;this._labelCtx.putImageData(lQ,T,i)},_toDefaultColor:function(e){if(e._tempRank&&e._tempRank==this.RANK5){return}if(e._oldImgData){var i=this.sizeRatio;var C=this._getTextBound(e);if(!C){return}this._labelCtx.putImageData(e._oldImgData,Math.round(C[0]),Math.round(C[1]));e._oldImgData=null}},_changeBaseMapState:function(T){var C=this._canvas2dMapMgr;var i=T.guid;var e=T.guidExt;var lO={guid:i,name:T.name,guidExt:e};C._labelStrategy.setStrategyInfo(lO);C._loadData()},_recoverNormalState:function(){var e=this._canvas2dMapMgr;e._labelStrategy.setStrategyInfo(null);e._loadData()},findLabelByUid:function(lP,T){var lR=this._canvas2dMapMgr,e=lR._computedLabel;for(var lO=0,C=e.length;lOmR){mR=mU.drawX+mU.width}if(mU.drawY+mU.height>mQ){mQ=mU.drawY+mU.height}}}}}else{lV.tileX=T;lV.tileY=C;l2=T+lV.minXOriginal;l0=C+lV.minYOriginal;mR=T+lV.maxXOriginal;mQ=C+lV.maxYOriginal}if(l2!=undefined){var mJ=mG+(l2-mG)/mz;var mI=mF+(l0-mF)/mz;var ml=mG+(mR-mG)/mz;var mj=mF+(mQ-mF)/mz;lV.minX=mJ;lV.minY=mI;lV.maxX=ml;lV.maxY=mj;var mN=(mJ+ml)/2,mM=(mI+mj)/2,mu=l1+(mN-mK/2)*l5,ms=lZ+(mt/2-mM)*l5;lV.geoX=mu;lV.geoY=ms;mn.push(lV)}}}if(mY){for(var mk=0,mg=mY.length;mkmR){mR=ma+mL.width}if(lY+mL.height>mQ){mQ=lY+mL.height}if(l4.length===2){var l9=l4[1];var l7=mG+l9.destX;var lX=mF+l9.destY;if(lXmR){mR=l7+l9.width}if(lX+l9.height>mQ){mQ=lX+l9.height}}mC._tempBounds=[l2,l0,mR,mQ];var mr=lW.iconPos;var lQ=mr.geoX;var lO=mr.geoY;var mG=(lQ-l1)/l5+mK/2;var mF=(lZ-lO)/l5+mt/2;var l2=mG+mr.destX;var l0=mF+mr.destY;var mR=l2+mr.width;var mQ=l0+mr.height;lW.textPos=lW.textPos||lW._textPos;var l4=lW.textPos;var mL=l4[0];var ma=mG+mL.destX;var lY=mF+mL.destY;if(mamQ){mQ=lY+mL.height}if(l4.length===2){var l9=l4[1];var l7=mG+l9.destX;var lX=mF+l9.destY;if(l7mQ){mQ=lX+l9.height}}lW._tempBounds=[l2,l0,mR,mQ]}for(var mk=0,mg=mY.length;mkmW[2]||mS[3]mW[3])){l3++;if(mo.textPos){mo._textPos=mo.textPos;delete mo.textPos}}var mW=mX._tempBounds;if(!(mS[2]mW[2]||mS[3]mW[3])){l3++;if(mX.textPos){mX._textPos=mX.textPos;delete mX.textPos}}if(l3>=2){if(mO.textPos){mO._textPos=mO.textPos;delete mO.textPos}}}}for(var mk=0,mg=mY.length;mkmR){mR=mL.drawX+mL.width}if(mL.drawY+mL.height>mQ){mQ=mL.drawY+mL.height}if(l4.length===2){var l9=l4[1];l9.drawX=mG+l9.destX;l9.drawY=mF+l9.destY;if(l9.drawXmR){mR=l9.drawX+l9.width}if(l9.drawY+l9.height>mQ){mQ=l9.drawY+l9.height}}}var mJ=mG+(l2-mG)/mz;var mI=mF+(l0-mF)/mz;var ml=mG+(mR-mG)/mz;var mj=mF+(mQ-mF)/mz;mp.minX=mJ;mp.minY=mI;mp.maxX=ml;mp.maxY=mj;var mB=(mJ+ml)/2;var mA=(mI+mj)/2;var lR=l1+(mB-mK/2)*l5;var lP=lZ+(mt/2-mA)*l5;mp.geoX=lR;mp.geoY=lP;mn.push(mp)}}var mD=this._strategyInfo;if(mD){var mm=mD.guid;var mv=mD.name;var mc=mD.guidExt;for(var mk=0,mg=mn.length;mkmq.maxX-mi||mO.maxY-mimq.maxY-mi)){mO.arrIntersectIndex.push(mh)}}}for(var mk=0,mg=mn.length;mklS){var C=lQ.splice(0,lP);for(var lT=0,lR=C.length;lT0){this.isDrawText=true}},_loadLabelData:function(lW,lV,lU,C,lX,e){var lP=lW.toString();var T=lV.toString();var lR="cbk_"+lP.replace("-","_")+"_"+T.replace("-","__")+"_"+Math.floor(lU);var l1=gi+"."+lR;var l0=this._labelDataUrls;var lT=Math.abs(lW+lV)%l0.length;var l6=l0[lT];if(window.offLineIPAddress){l6=window.offLineIPAddress+"pvd/"}var i=this.labelStyleParam;var lZ="?qt=vtile";var l2="";if(this._map.config.style!=="default"){l2="&styleId=1"}var lY="x={x}&y={y}&z={z}&udt={udt}&v={v}&styles={styles}"+l2+"&textonly=1&textimg=1&scaler={scaler}&fn="+encodeURIComponent(l1);var l3=fO.calcLoopParam(lW,lU).col;var lS=this.ratio>1?2:1;var lQ=lY.replace(/{x}/,l3).replace(/{y}/,lV).replace(/{z}/,Math.floor(lU)).replace(/{styles}/,i).replace(/{udt}/,this._udt).replace(/{v}/,this._version).replace(/{scaler}/,lS);var lO=l6+lZ+"¶m="+window.encodeURIComponent(fF(lQ));var l5=this;var l4=l5._map;bS[lR]=function(l7){l5._vectorDrawLib.parseLabelData(l7,lW,lV,lU,C,lX,function(mc){var l9=l4.getCenterIn();var md=l4.getZoom();var mf="viewKey_"+Math.floor(l9.lng)+"_"+Math.floor(l9.lat)+"_"+md;l5._labelCount--;var mg=l5._getCache(lW,lV,lU,C).updateLabelCounter;l5._labelCount-=mg;var ma=l5._curViewLabels;if(mf===e||(l5._labelCount<0&&md===lU)){ma.push(mc)}if(mf===e){l5.statResponseCount++}if(l5._labelCount<=0){var l8=(new Date()).getTime();l5.updateLabel();var mb=(new Date()).getTime();var me=new gC("oncanvasmaploaded");me.drawTime=mb-l8;if(l5.statResponseCount===l5.statRequestCount){me.isAllLoadedDrawing=true}l4.dispatchEvent(me)}l5._setCacheValue(lW,lV,lU,C,mc);delete bS[lR]})};hL.load(lO)},drawLabel:function(C,T,lU,i,lS,lO,e,lP,lT,lQ){var lR=this;if(!lR._computedLabel){return}if(lR._computedLabel._zoom!==lU){lR.clearLabel();return}lR._map.temp.isPermitSpotOver=false;lR.clearLabel();lR._vectorDrawLib.zoomingIconAndText(this._labelCtx,lR._computedLabel,C,T,i,lS,lO,e,lP,lT,lQ)},_addSpotData:function(){this._spotData=[];var lU=this._map.getZoom();for(var lP=0,lO=this._computedLabel.length;lPlU)){continue}var lQ=[];lQ[0]=(lR.minX-lR.maxX)/2;lQ[1]=(lR.minY-lR.maxY)/2;lQ[2]=(lR.maxX-lR.minX)/2;lQ[3]=(lR.maxY-lR.minY)/2;var T=null;if(lR.iconPos){T=new c4(lR.iconPos.geoX,lR.iconPos.geoY)}var C=lR.name?lR.name.replace("\\\\","
"):"";if(lR.iconPos&&lR.iconPos.iconType.indexOf("ditie")>-1&&this._map.getZoom()>14){C=""}var lT={n:C,pt:new c4(lR.geoX,lR.geoY),userdata:{iconPoint:T,uid:lR.guid,name:C,type:lR.iconPos?lR.iconPos.iconType:"",iconImg:lR.iconImg,mapPoi:true,adver_log:lR.adver_log||""},bd:lQ,tag:"MAP_SPOT_INFO"};this._spotData.push(lT)}var lS=new gC("onspotsdataready");lS.spots=this._spotData;this._map._spotDataOnCanvas=this._spotData;this._map.dispatchEvent(lS)},isClickableLabel:function(e){if(e.isDel||(!e.guid&&!e.name)){return false}return true},getFilterImageData:function(C,lQ){var lR=C.data,lP=this._labelStrategy,lQ=parseInt(lQ);for(var lS=0,lO=lR.length;lS0&&!lV){continue}var lZ=Math.round(l8[0]/100);var lY=Math.round(l8[1]/100);var mb={lng:l5+lZ,lat:l4-(l2*lS-lY)};var lQ=lZ/lS;var lP=l2-lY/lS;var l3=l8[7]||"";var mg=l8[5];var l6={type:"fixed",name:l3,textImg:l1,rank:l8[4],baseX:lQ,baseY:lP,iconPos:null,textPos:null,guid:l8[3]||"",tracer:mc,direction:mg,startScale:3};if((mg!==kv&&lV||!lV)&&mf!==null){l6.iconPos=this._getIconPosition(mf,lU,lQ,lP,mb);if(l6.iconPos){C=l6.iconPos.width;l0=l6.iconPos.height}}if(C===0){l6.direction=kv}if(lV){l6.textPos=this._getTextDrawData(l8,lQ,lP,C,l0)}if(l6.textPos||l6.iconPos){l7.push(l6)}}}},_isVisible:function(e,i){var T;if(!this._binaryCache[e]){T=e.toString(2);if(T.length<8){T=new Array(8-T.length+1).join("0")+T}this._binaryCache[e]=T}T=this._binaryCache[e];var C=f7[i].start;return T[i-C]==="1"},_getIconPosition:function(lR,lP,C,i,e){var T=this._map.config.style;var lS=bS["iconSetInfo"+T][lR];if(!lS){if(lR.charCodeAt(0)>=48&&lR.charCodeAt(0)<=57){lS=bS["iconSetInfo"+T]["_"+lR]}}if(!lS){return null}var lO=lS[0];var lQ=lS[1];lO=lO*lP;lQ=lQ*lP;return{srcX:0,srcY:0,destX:C-lO/2,destY:i-lQ/2,width:lO,height:lQ,geoX:e.lng,geoY:e.lat,mcPt:e,iconType:lR}},_getTextDrawData:function(lY,lX,lW,T,lU){var l3=lY[5];if(typeof l3!=="number"){l3=0}var lS=this.ratio;var lR=lS/2;T*=lR;lU*=lR;var lT=lY[12];var lO=lT.length;var l6=0;var l5=0;var l2=[];var l1=0;var l4=0;for(var l0=0;l00&&e>0){l2.push({srcX:lP,srcY:i,destX:l6,destY:l5,width:C,height:e})}}if(l2.length>0){return l2}return null},_getLineLabelInfo:function(lV,T,lO,ma,mn,l2,l8,l7,l9,l1){if(lV.length!==10){return}var mc=this.ratio;var C=this.ratio;var mj=lV[7].length;var l3=lV[1];var ml=lV[3];var mr=lV[8];var lR=lV[4];var e=2;var lP=lR.slice(0,e);for(var mo=e;molZ){lZ=mv+lQ}if(mu+lT>lY){lY=mu+lT}}l4.push({angle:lX,srcX:lS,srcY:lU,destX:mv,destY:mu,width:lQ,height:lT})}var mk={type:"line",textImg:T,rank:l3,baseX:mh,baseY:mf,arrWordPos:l4,minXOriginal:md,minYOriginal:mb,maxXOriginal:lZ,maxYOriginal:lY,text:""};l1.push(mk)}},alterColor:function(lQ,e,lP){var C=this._colorCtx,i=this._canvas2dMapMgr;C.clearRect(0,0,lQ.width,lQ.height);C.drawImage(e,lQ.srcX,lQ.srcY,lQ.width,lQ.height,0,0,lQ.width,lQ.height);var lO=C.getImageData(0,0,lQ.width,lQ.height),T=i.getFilterImageData(lO,lP);C.putImageData(T,0,0)},drawIconAndText:function(l2,l1,e){var lT=this.ratio;var lR=this.sizeRatio/lT;var lV=2/lT;var md=this;for(var l5=0,l3=l1.length;l510&&l8<350){l2.save();var mb=Math.round(mf+l7.width/2);var ma=Math.round(mc+l7.height/2);l2.translate(mb,ma);l2.rotate(-l8/180*Math.PI);l2.drawImage(lZ,l7.srcX,l7.srcY,l7.width,l7.height,-Math.round(l7.width/2),-Math.round(l7.height/2),l7.width/lR,l7.height/lR);l2.restore()}else{l2.drawImage(lZ,l7.srcX,l7.srcY,l7.width,l7.height,mf,mc,l7.width/lR,l7.height/lR)}}}}}},isCollide:function(lP,lY,lX,e,lR,C,lT){for(var lO=0,T=C.length;lOlS[1]+lS[3]+lW||lX+lRlS[2]+lS[4]+lV)){return true}}}return false},zoomingIconAndText:function(md,l7,T,mb,mc,mE,mk,lV,mq,mj,l4){var mF=this.ratio;var lW=this.sizeRatio/mF;var mG=2/mF;var mQ=mF/2;var mA=mb.x;var mz=mb.y;var me=2*mF;if(l4!==0){mz+=mj}var lZ=undefined,lS=undefined,lP=undefined,lU=undefined,l3=undefined;var mp=mE>0?true:false;if(!mp){lZ=[];var mt=1-mk}for(var mM=0,mK=l7.length;mM10&&ma<350){var mC=mv+mD.width/2;var mB=mu+mD.height/2;var lO=ma/180*Math.PI;var mh=Math.cos(lO);var l0=Math.sin(lO);var ms=mh;var l1=mh;var mr=l0;var l2=-l0;var l9=mC-mC*mh-mB*l0;var e=mB+mC*l0-mB*mh;md.save();md.transform(ms,l2,mr,l1,l9,e);md.drawImage(lQ,mD.srcX,mD.srcY,lU,l3,lS,lP,lU/lW,l3/lW);md.restore()}else{md.drawImage(lQ,mD.srcX,mD.srcY,lU,l3,lS,lP,lU/lW,l3/lW)}!mp&&lZ.push([mM,lS,lP,lU,l3])}}md.restore()}}}});function fb(e){this.initVars(e)}fK.extend(fb.prototype,{initVars:function(e){this._map=e._map;this._canvas2dMapMgr=e;this.base64Prefix="data:image/png;base64,";this.bizData=null;this.objTextsPng=null;this.arrIconsPng=null;this.bizLabels=null},proecessBizData:function(lP,lT){var lR=this;this.bizData=lP;this.objTextsPng=null;this.arrIconsPng=null;var C=lP.textsPng;var lV=lP.iconsPng;if(!C||!lV){return}var lS=new Image();lS.onload=function(){lR.objTextsPng=this;lR.calcIconAndTextInfo(lT);this.onload=null};lS.src=this.base64Prefix+C;var lU=lV.length;var e=[];for(var lO=0;lOlR.width||i>lR.height)&&(e>lR.width||lV>lR.height)){return false}return true},_setPlatformPosition:function(lU,lT,lW){lW=lW||{};if(lU===0&&lT===0&&!lW.point){return}if(isNaN(lW.initMapOffsetX)){lW.initMapOffsetX=this.offsetX}if(isNaN(lW.initMapOffsetY)){lW.initMapOffsetY=this.offsetY}var lQ=jU(this._heading);if(this._tilt>0){lT=lT/Math.cos(jU(this._tilt))}var lV=lU*Math.cos(lQ)+lT*Math.sin(lQ);var lS=-lU*Math.sin(lQ)+lT*Math.cos(lQ);lV=lV+lW.initMapOffsetX;lS=lS+lW.initMapOffsetY;if(lW.point){var i=this.restrictCenter(lW.point);if(!i.equals(this.centerPoint)){this.centerPoint=i.clone();this.fire(new gC("oncenter_changed"))}}else{var T=this.offsetX-lV;var e=this.offsetY-lS;var lR=this.centerPoint.lng;var lP=this.centerPoint.lat;var lO=new c4(lR,lP);var C=this.getZoomUnits();this.centerPoint=this.restrictCenter(new c4(lO.lng+T*C,lO.lat-e*C),C);this.fire(new gC("oncenter_changed"))}this.offsetX=lV;this.offsetY=lS;this.dispatchEvent(new gC("onmoving"))},restrictCenter:function(lV,e){if(this.config.restrictCenter===false){return lV}e=e||this.getZoomUnits();var lT=this.pixelToPointIn(new f8(this.width,0),{center:lV});var lQ=this.pixelToPointIn(new f8(0,this.height),{center:lV});var lW=lV.lng;var l1=lV.lat;if(!!this.config.restrictBounds&&!this.config.restrictBounds.isEmpty()){var l0=this.config.restrictBounds;var C=l0.getSouthWest();var lY=l0.getNorthEast();var lU=kz.convertLL2MC(C);var lO=kz.convertLL2MC(lY);var lR=this.calcNewZoomByRestriction(lW,l1,lQ,lT,lU.lng,lO.lng,lU.lat,lO.lat);if(lR>this.zoomLevel){this.zoomLevel=lR;return lV}lV.lng=this.calcNewLngByBounds(lW,lQ,lT,lU.lng,lO.lng,e);lV.lat=this.calcNewLatByBounds(l1,lQ,lT,lU.lat,lO.lat,e);return lV}var lS=this.pixelToPointIn(new f8(0,0),{center:lV});var T=this.pixelToPointIn(new f8(0,this.height),{center:lV});if(this.zoomLevel<5){if(lS.lat>iX.MAX_LAT&&T.latiX.MAX_LAT){lV.lat=iX.MAX_LAT-this.height/2*e}else{if(T.latlP&&e.latlQ&&e.lnglP){lO=lP-this.height/2*e}else{if(T.latC){i=C-this.width/2*e}else{if(lP.lnglU){this._tilt=lU}if(lY){if(this._heading%360!==0||this._tilt>0){var lV=this._webglMapCamera.fromScreenPixelToMC(lR.x,lR.y,{center:T,zoom:this.zoomLevel});if(lV){var l1=lV.sub(lW);var e=T.sub(l1);this.centerPoint=this.restrictCenter(e)}}else{var i=this.getZoomUnits();var e=new c4(lY.lng-i*(lR.x-this.width/2),lY.lat+i*(lR.y-this.height/2));this.centerPoint=this.restrictCenter(e,i)}this.fire(new gC("oncenter_changed"))}this._checkFireZoomend();lP.callback&&lP.callback();return}this._animationInfo.zoom={current:this.zoomLevel,diff:C-this.zoomLevel,target:C};var l0=this;var lO=this._tilt;if(this.fixPoint||lO>iX.MAX_DRAG_TILT_L2){lP.renderCallback=function(){var l5=l0.getCurrentMaxTilt();if(l0._tilt>l5){l0._tilt=l5}var l6=l0.fixPixel;if(!l0.fixPixel||!l0.fixPoint){return}var l2=l0.fixPixel;var mc=l0.fixPoint;var l9=l0.fixCenter;var l7=l0.mousePosMCPoint;if(l0._heading%360!==0||l0._tilt>0){var l3=l0._webglMapCamera.fromScreenPixelToMC(l2.x,l2.y,{center:l9,zoom:l0.zoomLevel,tilt:l0._tilt});if(l3){var mb=l3.sub(l7);var l4=l9.sub(mb);l0.centerPoint=l0.restrictCenter(l4)}}else{var l8=l2;var ma=l0.getZoomUnits();var l4=new c4(mc.lng-ma*(l8.x-l0.width/2),mc.lat+ma*(l8.y-l0.height/2));l0.centerPoint=l0.restrictCenter(l4,ma)}l0.fire(new gC("oncenter_changed"))}}if(lP.fromMouseWheel===true){this._startInfiniteZoomAnimation(lP);lP.callback&&lP.callback();l0._checkFireZoomend();return}if(!lP.callback){lP.callback=function(){l0._checkFireZoomend()}}else{var lT=lP.callback;lP.callback=function(l2,l3){lT(l2,l3);l0._checkFireZoomend()}}this._startAnimation(lP)},_checkFireZoomend:function(){var e=this;if(e.fireZoomendTimer){clearTimeout(e.fireZoomendTimer)}e.fireZoomendTimer=setTimeout(function(){if(e.zoomEventStatus==="zooming"){e.fire(new gC("onzoomend"));e.zoomEventStatus="idle"}e.fireZoomendTimer=null},150)},deepZoomMedia:function(e){var i=this;if(!i.temp.isStdCtrlBusy){i.temp.isStdCtrlBusy=true;i.deepZoomTo(i.zoomLevel+e);setTimeout(function(){i.temp.isStdCtrlBusy=false},400)}},deepZoomTo:function(e){this.zoomTo(e)},flyToIn:function(C,mi,l2){l2=l2||{};var lO=this._getProperZoom(mi);mi=lO.zoom;if(this.centerPoint.equals(C)&&this.zoomLevel===mi&&typeof l2.heading!=="number"&&typeof l2.tilt!=="number"){return}var e=this.getHeading()%360;var lU=this.getTilt();var l0=0;var l4=0;var lX=this.getBounds().containsPoint(C);if(typeof l2.heading==="number"){l0=l2.heading}else{if(lX){l0=e}}if(typeof l2.tilt==="number"){l4=l2.tilt}else{if(lX){l4=lU}}this._heading=e;var mf=l0-e;var ma=l4-lU;var lY=this;var lQ=this.zoomLevel;var lR=1.42;var l6=this.zoomScale(mi-lQ);var mk=this.getZoomUnits();var lW=this.centerPoint.div(mk);var ml=C.div(mk);var md=this.worldSize();var l9=lR;var l8=Math.max(this.width,this.height);var l7=l8/l6;var lV=ml.sub(lW).mag();var i=l9*l9;function mh(mm){var me=(l7*l7-l8*l8+(mm?-1:1)*i*i*lV*lV)/(2*(mm?l7:l8)*i*lV);return Math.log(Math.sqrt(me*me+1)-me)}function T(me){return(Math.exp(me)-Math.exp(-me))/2}function lS(me){return(Math.exp(me)+Math.exp(-me))/2}function l1(me){return T(me)/lS(me)}var lT=mh(0);var mb=function(me){return(lS(lT)/lS(lT+l9*me))};var mc=function(me){return l8*((lS(lT)*l1(lT+l9*me)-T(lT))/i)/lV};var lP=(mh(1)-lT)/l9;if(Math.abs(lV)<0.000001||lP===Infinity||isNaN(lP)){if(Math.abs(l8-l7)<0.000001){this._animationInfo.zoom={current:this.zoomLevel,diff:mi-this.zoomLevel};this._animationInfo.center={current:this.centerPoint,diff:C.sub(this.centerPoint)};this._animationInfo.heading={current:e,diff:l0-e};this._animationInfo.tilt={current:lU,diff:l4-lU};this.setLock(true);this._startAnimation({callback:function(me){lY.setLock(false);if(l2.callback){l2.callback(me)}},duration:l2.duration});return}var mj=l75){mg=(lP-5)/2+mg}}var l3=l2.duration||1000*lP/mg;if(isNaN(l3)){var l5={};for(var lZ in l2){l5[lZ]=l2[lZ];l5.noAnimation=true}this.centerAndZoomIn(C,mi,l5);return}this.fire(new gC("onmovestart"));this.fire(new gC("onzoomstart"));this.setLock(true);this._startAnimation({duration:l3,renderCallback:function(me,mm){var mn=me*lP;var mq=mc(mn);var mp=lQ+lY.scaleZoom(1/mb(mn));if(mplY.getMaxZoom()){mp=lY.getMaxZoom()}if(mp!==lY.zoomLevel){lY.zoomLevel=mp;lY.fire(new gC("onzoom_changed"))}lY.centerPoint=lW.add(ml.sub(lW).mult(mq)).mult(mk);lY.fire(new gC("oncenter_changed"));if(typeof l0==="number"){var mo=me/0.7;if(mo>1){mo=1}lY.setHeading(e+mf*me,{noAnimation:true})}if(typeof l4==="number"){lY.setTilt(lU+ma*me,{noAnimation:true})}},callback:function(me,mm){lY.setLock(false);if(mm&&mm.stop===true){lY.fire(new gC("onmoveend"));lY.fire(new gC("onzoomend"));l2.callback&&l2.callback(me);return}if(mi!==lY.zoomLevel){lY.zoomLevel=mi;lY.fire(new gC("onzoom_changed"))}lY.fire(new gC("onmoveend"));lY.fire(new gC("onzoomend"));l2.callback&&l2.callback(me)}})},zoomScale:function(e){return Math.pow(2,e)},scaleZoom:function(e){return Math.log(e)/Math.LN2},panToIn:function(i,C){C=C||{};if(!i||i.equals(this.centerPoint)){C.callback&&C.callback();return}var T=this.pointToPixelIn(i);var e=Math.round(this.width/2);var lP=Math.round(this.height/2);var lO=this._ifUseAnimation(i,this.zoomLevel);if(C.noAnimation===true||lO===false){this._stopAllAnimations();this._panToIn(e-T.x,lP-T.y,i);C.callback&&C.callback();return}this.flyToIn(i,this.zoomLevel,C)},_panToIn:function(i,e,T){var C=this.temp;if(C.operating===true){return}if(C.dragAni){C.dragAni.stop(false,{readyToMove:true});C.dragAni=null}this.dispatchEvent(new gC("onmovestart"));this._setPlatformPosition(i,e,{point:T});this.dispatchEvent(new gC("onmoveend"))},_stopAllAnimations:function(e){e=e||{};if(this._ani){this._ani.stop(!!e.goToEnd,{stopCurrentAnimation:e.stopCurrentAnimation});this._ani=null}if(this._infiniteAni){this._infiniteAni.stop();this._infiniteAni=null}},panBy:function(i,e,C){i=Math.round(i)||0;e=Math.round(e)||0;C=C||{};if(Math.abs(i)<=this.width&&Math.abs(e)<=this.height&&C.noAnimation!==true){this._panBy(i,e,C)}else{this._panToIn(i,e,C.point);C.callback&&C.callback()}},_panBy:function(i,e,lO){if(this.temp.operating===true){return}lO=lO||{};this.dispatchEvent(new gC("onmovestart"));var T=this;var C=T.temp;C.pl=T.offsetX;C.pt=T.offsetY;if(C.tlPan){C.tlPan._options.onStop=null;C.tlPan.cancel()}if(C.dragAni){C.dragAni.stop(false,{readyToMove:true});C.dragAni=null}C.tlPan=new gr({fps:lO.fps||T.config.fps,duration:lO.duration||T.config.actionDuration,transition:lO.transition||hz.easeInOutQuad,render:function(lP){this.terminative=T.temp.operating;if(T.temp.operating){return}T._setPlatformPosition(i*lP,e*lP,{initMapOffsetX:C.pl,initMapOffsetY:C.pt})},finish:function(lP){T.dispatchEvent(new gC("onmoveend"));T.temp.tlPan=false;if(T.temp.stopArrow===true){T.temp.stopArrow=false;if(T.temp.arrow!==0){T._arrow()}}},onStop:function(){T.dispatchEvent(new gC("onmoveend"));T.temp.tlPan=false}})},_startAnimation:function(i){var lO=this._animationInfo;var C=this;i=i||{};if(C._ani){C._ani.stop(!!i.goToEnd,{stopCurrentAnimation:i.stopCurrentAnimation})}if(C._infiniteAni){C._infiniteAni.stop();C._infiniteAni=null}var lP=i.duration||500;var lQ=i.transition||hz.ease;var e=new gC("onanimation_start");this.fire(e);if(i.unstopable){lO=this._animationInfoUnstopable}var T=new gr({duration:lP,transition:lQ,render:function(lT,lS){for(var lR in lO){if(!lO.hasOwnProperty(lR)){continue}var lV=lO[lR].current;var lU=lO[lR].diff;C._setValueTick(lR,lV,lU,lT)}if(i.renderCallback){i.renderCallback(lT,lS)}},finish:function(lR){C.fire(new gC("onanimation_end"));if(i.unstopable){C._animationInfoUnstopable={};C._unstopableAni=null}else{C._ani=null;C._animationInfo={}}if(i.mapNeedCbk){i.mapNeedCbk()}if(i.callback){i.callback(lR)}},onStop:function(lR){lR=lR||{};C.fire(new gC("onanimation_end"));if(lR.stopCurrentAnimation){C._animationInfo={}}C._ani=null;if(i.mapNeedCbk){i.mapNeedCbk()}if(i.callback){i.callback(null,{stop:true})}}});if(i.unstopable){C._unstopableAni=T}else{C._ani=T}},_startInfiniteZoomAnimation:function(e){var i=this;if(i._ani){i._ani.stop(!!e.goToEnd,{stopCurrentAnimation:e.stopCurrentAnimation})}if(i._infiniteAni){return}this.fire(new gC("onanimation_start"));i._infiniteAni=new gr({duration:10000,transition:hz.linear,render:function(){var C=i._animationInfo.zoom;if(Math.abs(C.current-C.target)<0.001){i._setValue("zoom",C.target);i._infiniteAni&&i._infiniteAni.stop();return}C.current+=(C.target-C.current)*0.35;i._setValue("zoom",C.current);if(e.renderCallback){e.renderCallback()}},finish:function(){i._infiniteAni=null;i._animationInfo={};i.fire(new gC("onanimation_end"));if(e.callback){e.callback()}},onStop:function(){i._infiniteAni=null;i._animationInfo={};i.fire(new gC("onanimation_end"));if(e.callback){e.callback()}}})},_setValue:function(e,C){if(e==="zoom"){this._preZoomLevel=this.zoomLevel;var i=this._getProperZoom(C);C=i.zoom;if(C!==this.zoomLevel){this.zoomLevel=C;if(C<5){this.restrictCenter(this.centerPoint)}this.fire(new gC("on"+e+"_changed"))}return}else{if(e==="center"){this.centerPoint=C}}this["_"+e]=C;this.fire(new gC("on"+e+"_changed"))},_setValueTick:function(e,lO,T,i){if(e==="center"){var C=new c4(lO.lng+T.lng*i,lO.lat+T.lat*i);this._setValue(e,C);return}if(e==="zoom"){this._setValue(e,Math.pow(lO,1-i)*Math.pow(lO+T,i));return}this._setValue(e,lO+T*i)},setHeading:function(T,i){i=i||{};if(T===this._heading){i.callback&&i.callback();return}var C=eV(this._heading,360);var e=eV(T,360);if(e===C){this._heading=e;i.callback&&i.callback();return}if(e===0&&C>180){e=360}if(i.noAnimation){this._setValue("heading",e);i.callback&&i.callback();return}if(i.unstopable){this._animationInfoUnstopable.heading={current:C,diff:e-C}}else{var lO=e-C;if(Math.abs(e-C)>180){if(lO>0){lO=lO-360}else{lO=lO+360}}this._animationInfo.heading={current:C,diff:lO}}this._startAnimation(i)},resetHeading:function(e){var C=this._heading;while(C<0){C+=360}C=C%360;if(C>180){C-=360}this._heading=C;var T={};if(e){for(var i in e){if(e.hasOwnProperty(i)){T[i]=e[i]}}}T.unstopable=true;this.setHeading(0,T)},getHeading:function(){while(this._heading>360){this._heading-=360}if(this._heading>180){this._heading-=360}return this._heading},setTilt:function(e,i){i=i||{};if(e===this._tilt){i.callback&&i.callback();return}if(e>iX.MAX_TILT){e=iX.MAX_TILT}if(e0){lV=1/Math.sqrt(lV);lY[0]=lX[0]*lV;lY[1]=lX[1]*lV}return lY};lT.dot=function(lW,lV){return lW[0]*lV[0]+lW[1]*lV[1]};lT.cross=function(lX,lW,lV){var lY=lW[0]*lV[1]-lW[1]*lV[0];lX[0]=lX[1]=0;lX[2]=lY;return lX};lT.lerp=function(lX,lW,lV,lY){var l0=lW[0],lZ=lW[1];lX[0]=l0+lY*(lV[0]-l0);lX[1]=lZ+lY*(lV[1]-lZ);return lX};lT.random=function(lV,lX){lX=lX||1;var lW=lO()*2*Math.PI;lV[0]=Math.cos(lW)*lX;lV[1]=Math.sin(lW)*lX;return lV};lT.transformMat2=function(lY,lX,lW){var lV=lX[0],lZ=lX[1];lY[0]=lW[0]*lV+lW[2]*lZ;lY[1]=lW[1]*lV+lW[3]*lZ;return lY};lT.transformMat2d=function(lY,lX,lW){var lV=lX[0],lZ=lX[1];lY[0]=lW[0]*lV+lW[2]*lZ+lW[4];lY[1]=lW[1]*lV+lW[3]*lZ+lW[5];return lY};lT.transformMat3=function(lY,lX,lW){var lV=lX[0],lZ=lX[1];lY[0]=lW[0]*lV+lW[3]*lZ+lW[6];lY[1]=lW[1]*lV+lW[4]*lZ+lW[7];return lY};lT.transformMat4=function(lY,lX,lW){var lV=lX[0],lZ=lX[1];lY[0]=lW[0]*lV+lW[4]*lZ+lW[12];lY[1]=lW[1]*lV+lW[5]*lZ+lW[13];return lY};lT.rotate=function(lY,lW,lV,l2){var l1=lW[0]-lV[0];var l0=lW[1]-lV[1];var lX=Math.sin(l2);var lZ=Math.cos(l2);lY[0]=l1*lZ-l0*lX+lV[0];lY[1]=l1*lX+l0*lZ+lV[1];return lY};lT.forEach=(function(){var lV=lT.create();return function(lY,l2,l3,l1,l0,lW){var lZ,lX;if(!l2){l2=2}if(!l3){l3=0}if(l1){lX=Math.min((l1*l2)+l3,lY.length)}else{lX=lY.length}for(lZ=l3;lZ0){lV=1/Math.sqrt(lV);lY[0]=lX[0]*lV;lY[1]=lX[1]*lV;lY[2]=lX[2]*lV}return lY};lS.dot=function(lW,lV){return lW[0]*lV[0]+lW[1]*lV[1]+lW[2]*lV[2]};lS.cross=function(lW,l1,l0){var lV=l1[0],l3=l1[1],l2=l1[2],lZ=l0[0],lY=l0[1],lX=l0[2];lW[0]=l3*lX-l2*lY;lW[1]=l2*lZ-lV*lX;lW[2]=lV*lY-l3*lZ;return lW};lS.lerp=function(lX,lW,lV,lY){var l1=lW[0],l0=lW[1],lZ=lW[2];lX[0]=l1+lY*(lV[0]-l1);lX[1]=l0+lY*(lV[1]-l0);lX[2]=lZ+lY*(lV[2]-lZ);return lX};lS.random=function(lV,lZ){lZ=lZ||1;var lX=lO()*2*Math.PI;var lY=(lO()*2)-1;var lW=Math.sqrt(1-lY*lY)*lZ;lV[0]=Math.cos(lX)*lW;lV[1]=Math.sin(lX)*lW;lV[2]=lY*lZ;return lV};lS.transformMat4=function(lY,lX,lW){var lV=lX[0],l0=lX[1],lZ=lX[2];lY[0]=lW[0]*lV+lW[4]*l0+lW[8]*lZ+lW[12];lY[1]=lW[1]*lV+lW[5]*l0+lW[9]*lZ+lW[13];lY[2]=lW[2]*lV+lW[6]*l0+lW[10]*lZ+lW[14];return lY};lS.transformMat3=function(lY,lX,lW){var lV=lX[0],l0=lX[1],lZ=lX[2];lY[0]=lV*lW[0]+l0*lW[3]+lZ*lW[6];lY[1]=lV*lW[1]+l0*lW[4]+lZ*lW[7];lY[2]=lV*lW[2]+l0*lW[5]+lZ*lW[8];return lY};lS.transformQuat=function(l1,l7,lV){var l8=l7[0],l6=l7[1],l5=l7[2],l3=lV[0],l2=lV[1],l0=lV[2],l4=lV[3],lY=l4*l8+l2*l5-l0*l6,lX=l4*l6+l0*l8-l3*l5,lW=l4*l5+l3*l6-l2*l8,lZ=-l3*l8-l2*l6-l0*l5;l1[0]=lY*l4+lZ*-l3+lX*-l0-lW*-l2;l1[1]=lX*l4+lZ*-l2+lW*-l3-lY*-l0;l1[2]=lW*l4+lZ*-l0+lY*-l2-lX*-l3;return l1};lS.rotateX=function(lX,lW,lV,l0){var lZ=[],lY=[];lZ[0]=lW[0]-lV[0];lZ[1]=lW[1]-lV[1];lZ[2]=lW[2]-lV[2];lY[0]=lZ[0];lY[1]=lZ[1]*Math.cos(l0)-lZ[2]*Math.sin(l0);lY[2]=lZ[1]*Math.sin(l0)+lZ[2]*Math.cos(l0);lX[0]=lY[0]+lV[0];lX[1]=lY[1]+lV[1];lX[2]=lY[2]+lV[2];return lX};lS.rotateY=function(lX,lW,lV,l0){var lZ=[],lY=[];lZ[0]=lW[0]-lV[0];lZ[1]=lW[1]-lV[1];lZ[2]=lW[2]-lV[2];lY[0]=lZ[2]*Math.sin(l0)+lZ[0]*Math.cos(l0);lY[1]=lZ[1];lY[2]=lZ[2]*Math.cos(l0)-lZ[0]*Math.sin(l0);lX[0]=lY[0]+lV[0];lX[1]=lY[1]+lV[1];lX[2]=lY[2]+lV[2];return lX};lS.rotateZ=function(lX,lW,lV,l0){var lZ=[],lY=[];lZ[0]=lW[0]-lV[0];lZ[1]=lW[1]-lV[1];lZ[2]=lW[2]-lV[2];lY[0]=lZ[0]*Math.cos(l0)-lZ[1]*Math.sin(l0);lY[1]=lZ[0]*Math.sin(l0)+lZ[1]*Math.cos(l0);lY[2]=lZ[2];lX[0]=lY[0]+lV[0];lX[1]=lY[1]+lV[1];lX[2]=lY[2]+lV[2];return lX};lS.forEach=(function(){var lV=lS.create();return function(lY,l2,l3,l1,l0,lW){var lZ,lX;if(!l2){l2=3}if(!l3){l3=0}if(l1){lX=Math.min((l1*l2)+l3,lY.length)}else{lX=lY.length}for(lZ=l3;lZ0){lV=1/Math.sqrt(lV);lZ[0]=lY[0]*lV;lZ[1]=lY[1]*lV;lZ[2]=lY[2]*lV;lZ[3]=lY[3]*lV}return lZ};lR.dot=function(lW,lV){return lW[0]*lV[0]+lW[1]*lV[1]+lW[2]*lV[2]+lW[3]*lV[3]};lR.lerp=function(lX,lW,lV,lY){var l1=lW[0],l0=lW[1],lZ=lW[2],l2=lW[3];lX[0]=l1+lY*(lV[0]-l1);lX[1]=l0+lY*(lV[1]-l0);lX[2]=lZ+lY*(lV[2]-lZ);lX[3]=l2+lY*(lV[3]-l2);return lX};lR.random=function(lV,lW){lW=lW||1;lV[0]=lO();lV[1]=lO();lV[2]=lO();lV[3]=lO();lR.normalize(lV,lV);lR.scale(lV,lV,lW);return lV};lR.transformMat4=function(lZ,lY,lW){var lV=lY[0],l1=lY[1],l0=lY[2],lX=lY[3];lZ[0]=lW[0]*lV+lW[4]*l1+lW[8]*l0+lW[12]*lX;lZ[1]=lW[1]*lV+lW[5]*l1+lW[9]*l0+lW[13]*lX;lZ[2]=lW[2]*lV+lW[6]*l1+lW[10]*l0+lW[14]*lX;lZ[3]=lW[3]*lV+lW[7]*l1+lW[11]*l0+lW[15]*lX;return lZ};lR.transformQuat=function(l1,l7,lV){var l8=l7[0],l6=l7[1],l5=l7[2],l3=lV[0],l2=lV[1],l0=lV[2],l4=lV[3],lY=l4*l8+l2*l5-l0*l6,lX=l4*l6+l0*l8-l3*l5,lW=l4*l5+l3*l6-l2*l8,lZ=-l3*l8-l2*l6-l0*l5;l1[0]=lY*l4+lZ*-l3+lX*-l0-lW*-l2;l1[1]=lX*l4+lZ*-l2+lW*-l3-lY*-l0;l1[2]=lW*l4+lZ*-l0+lY*-l2-lX*-l3;return l1};lR.forEach=(function(){var lV=lR.create();return function(lY,l2,l3,l1,l0,lW){var lZ,lX;if(!l2){l2=4}if(!l3){l3=0}if(l1){lX=Math.min((l1*l2)+l3,lY.length)}else{lX=lY.length}for(lZ=l3;lZ=2&&e<=4){this.result.eleData[e][i||0]=C;return}else{if(e===0||e===5||e===6){C.sort(function(lO,T){return lO.overlay.zIndex-T.overlay.zIndex})}}this.result.eleData[e]=C},clearLabelOverlayData:function(e){if(e===undefined){this.result.eleData[2]=[];this.result.eleData[3]=[];this.result.eleData[4]=[]}this.result.eleData[2][e]=[];this.result.eleData[3][e]=[];this.result.eleData[4][e]=[]},clearData:function(T){var e=this.result.bkData;if(typeof T==="number"){if(e[T]){e[T][0]=[];e[T][1]=[];e[T][2]=[]}return}for(var C=0;C0){C[0].sort(function(lO,T){return lO.tileInfo.useZoom-T.tileInfo.useZoom})}}});var hk=(function(){var lX=new Int8Array(4);var C=new Int32Array(lX.buffer,0,1);var lS=new Float32Array(lX.buffer,0,1);function lZ(l6){C[0]=l6;return lS[0]}function i(l6){lS[0]=l6;return C[0]}function lT(l6){var l8=(l6[3]<<24|l6[2]<<16|l6[1]<<8|l6[0]);var l7=lZ(l8&4278190079);return l7}var lO=0;var lR=1;var lV=2;var l3=0;var l0=1;var lY=2;var lP=9;function lW(l6,l7){var l8;if(l7%2===0){l8=[-l6[1],l6[0]]}else{l8=[l6[1],-l6[0]]}return l8}function e(l6,l7,l8){var l9=lW(l6,l7);var ma;if(l8===lR){return l9}else{if(l7===4||l7===5){ma=[l9[0]-l6[0],l9[1]-l6[1]]}else{ma=[l9[0]+l6[0],l9[1]+l6[1]]}if(l8===lO){vec2.normalize(ma,ma)}return ma}}function l2(l7,l6){return Math.sqrt(Math.pow(l7[0]-l6[0],2)+Math.pow(l7[1]-l6[1],2))}function T(ma,l9,l8,l6){var l7=vec2.dot(ma,l9);if(l8===lY||l8===l0){if((l6===0||l6===1)&&l7>0){return true}else{if((l6===2||l6===3)&&l7<0){return true}}}if((l6===0||l6===1)&&l7<0){return true}else{if((l6===2||l6===3)&&l7>0){return true}}return false}function lU(l7,mc,me){var md=lW(l7,mc);var l9;var mb=l7;var ma=me;var mg=[];vec2.normalize(mg,[mb[0]+ma[0],mb[1]+ma[1]]);var mf=vec2.dot(md,[-mg[1],mg[0]]);if(Math.abs(mf)<0.1){mf=1}var l8=1/mf;l9=[-mg[1]*l8,mg[0]*l8];var l6=vec2.dot(l7,l9);if(l6<0){vec2.negate(l9,l9)}return{cos2:l6,offset:l9}}function l5(l7,mc,me,l6){var md=lW(l7,mc);var mb;var ma;var l9;if(mc===0||mc===1){mb=me;ma=l7}else{mb=l7;ma=me}if(!mb||!ma){return md}var mg=[mb[0]+ma[0],mb[1]+ma[1]];if(mg[0]===0&&mg[1]===0){vec2.normalize(mg,ma)}else{vec2.normalize(mg,mg)}var mh=T(mg,md,l6,mc);if(mh){return md}var mf=vec2.dot(md,[-mg[1],mg[0]]);if(Math.abs(mf)<0.1){mf=1}var l8=1/mf;l9=[-mg[1]*l8,mg[0]*l8];return l9}function l4(mh,mi,mb,ma,mk,mg,l9,mc,l8,mf){var me;var l7=0;var l6=false;me=mg.length/lP-1;function mj(ml){if(mc instanceof Array){ml=Math.max(0,Math.min(ml,mc.length-1));return mc[ml]}else{return mc}}lQ(mi[0],mh[0],mb[0],mk,ma,4,mj(0),l8,undefined,mg,mf);me++;l7++;lQ(mi[0],mh[0],mb[0],mk,ma,5,mj(0),l8,undefined,mg,mf);me++;l7++;for(var md=0;md0){md+=l2(mj[mc],mj[mc-1]);ma.push(md*10)}if(mc!==mj.length-1){var l9=[mj[mc+1][0]-mj[mc][0],mj[mc+1][1]-mj[mc][1]];var mm=[];if(l9[0]===0&&l9[1]===0){mm=[0,0]}else{vec2.normalize(mm,l9)}mg[mg.length]=[mm[0],mm[1]]}}var ml;if(mb[0] instanceof Array){for(var mc=0;mc0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState},releaseOutViewTileData:function(e){var lQ=this.map._workerMgr.releasePendingData(e);if(this.map._blankDiag&&lQ.length>0&&this.tileType&&this.tileType.getName()==="xyz"){var lO=[];for(var T=0;T=0.5){mc=true}else{if(lW<0.5&&e>=0.5){mc=true}else{if(lW>=0.5&&e<0.5){mc=true}}}if(mc){this.cacheDataCollideLabels(0)}this.LAST_CALC_ZOOM=lU}else{if(this.tileLabels.length>0){this.cacheDataCollideLabels(fK.Browser.ie?50:30)}}},loadVectorLayerData:function(lT){this.map.temp.isPermitSpotOver=false;var lS=this;function lR(i,lW){var lZ=lS.tileCache.getData(lW);if(!lZ){return}if(!i||i.error){if(i.event){var lV=JSON.parse(i.event.msg||"{}");if(lV.status===403){if(cd.business===0&&cd.unauth===1){lS.watermarkTileKeys.push(lW);lS._checkTilesLoaded()}}bS.fetchDebug&&bS.fetchDebug.sendError({title:i.event.title,msg:i.event.msg,category:bS.fetchDebug.category.AJAX,level:bS.fetchDebug.levels.ERROR,url:i.event.title})}aZ=true;if(lS.map.stickySpamCtrl&&cd.business===0&&cd.unauth===1){cW(hw,{from:"vtile"});lS.map.stickySpamCtrl.update(hw)}var lY=new gC("ontileloaderror");i=i||{};lY.error=i.error||"";lY.message=i.message||"";lS.map.fire(lY);if(cd.business!==0||cd.unauth!==1){lZ.status="init";lZ.reloadTimer=setTimeout(function(){if(lZ.retry<3){lZ.retry++;lZ.status="loading";lS.loadVectorTileData(i.tileInfo,lR)}else{lS.tileCache.removeData(lW);lS._checkTilesLoaded()}},4000)}if(lS.map._featureMgr){lS.map._featureMgr.clearData(lS.drawIndex)}lS.getVectorLayerDataFromCache(lS.curViewTilesInfo,lS.getZoomState());return}if(lZ.reloadTimer){clearTimeout(lZ.reloadTimer);lZ.reloadTimer=null}var lU=lS.map._displayOptions.language||"zh";var lX=i.tileInfo.language||"zh";if(lX!==lU){lS.tileCache.removeData(lW);lS._checkTilesLoaded();return}lS.callbackDataQueue.push([i,lW]);if(lS.processDataTimer){return}lS.processDataTimer=setTimeout(function(){while(lS.callbackDataQueue.length>0){var l1=lS.callbackDataQueue.shift();var l2=lS.map._displayOptions.language||"zh";var l3=l1[0].tileInfo.language||"zh";if(l3!==l2){lS.tileCache.removeData(lW)}else{lS.vectorTileDataCbk(l1[0],l1[1])}lS._checkTilesLoaded()}if(lS.map._featureMgr){lS.map._featureMgr.clearData(lS.drawIndex)}lS.getVectorLayerDataFromCache(lS.curViewTilesInfo,lS.getZoomState());var l0=new gC("onrefresh");l0.source="webgllayer";lS.map.dispatchEvent(l0);lS.processDataTimer=null},200)}for(var lQ=0,lO=lT.length;lQ0){this.map._blankDiag.push({time:Date.now(),event:"child_search",layer:this.drawIndex,parentTile:lP+"_"+lZ+"_"+lX,hits:e,misses:lV,allFull:lQ,missDetails:lO})}return lQ},loadVectorTileData:function(l0,l1){var lO=l0.col;var lP=l0.row;var e=l0.zoom;var lY=l0.baseTileSize;var T=this.getTilesUrl(new f8(lO,lP),e,lY);var lQ=this.map.getPrivateRegions();if(!this.processData&&this.map.getPrivateStatus()&&lQ){var lW=l0.useZoom;var lV=this.tileType.getMercatorSize(lW);var lU=lO*lV;var lT=lP*lV;var lX=new c4(lU+lV/2,lT+lV/2);var lS=new je(new c4(lU,lT),new c4(lU+lV,lT+lV));var lR=g9()>=1.5?2:1;for(var lZ=0;lZ65536){l9.renderData.base.push({type:"line",data:[hk.toTileSolidLineVertices(mf,4000),new Uint16Array(mi)]});mf=[];mi=[]}for(var l8=0;l80){lP=lO.labelProcessor.collisionTest(lP,-1)}}else{if(lQ||lS){if(this._collisionTimer){if(!lQ){clearTimeout(this._collisionTimer)}else{if(Date.now()-lO.lastCollisionTestTime>500){lO.lastCollisionTestTime=Date.now()}else{clearTimeout(this._collisionTimer)}}}this._collisionTimer=setTimeout(function(){if(lO&&!lO.map.tileMgr&&!lO.map.tileMgr.isExitTileLayer(lO)){lO._collisionTimer=null;return}lP=lO.labelProcessor.collisionTest(lO.tileLabels);if(lP){if(lO._isInnerLayer&&lO.map.stencil&&lO.map.stencil.isPoiMask){var lT=lO.isPoiInPolygon(lP);i.setLabelData(lT,lO.drawIndex)}else{i.setLabelData(lP,lO.drawIndex)}}lO.updateLabels();lO.map.dispatchEvent(new gC("onrefresh"));lO._collisionTimer=null},60);return}else{lP=lO.labelProcessor.getCachedLabels(lO.tileLabels)}}if(lP){if(lO._isInnerLayer&&lO.map.stencil&&lO.map.stencil.isPoiMask){var lR=lO.isPoiInPolygon(lP);i.setLabelData(lR,lO.drawIndex)}else{i.setLabelData(lP,lO.drawIndex)}}lO.updateLabels();lO.map.dispatchEvent(new gC("onrefresh"))}if(!C){clearTimeout(lO.cacheLabelTimer);T()}else{if(lO.cacheLabelTimer){return}lO.cacheLabelTimer=setTimeout(function e(){T()},C)}},isPoiInPolygon:function(C){var l9=this;var lX=l9.map.stencil;var lP=l9.map._featureMgr.result.eleData[9];var lO=[];var T=false;for(var l3=0;l31){T=true;for(var l0=0;l00){var T=lP.getZoom();if(C.labelZoom-T<3){this.labelProcessor.updateLabels(C);var e=this.labelProcessor.fixDataFormat(C);i.setOverlayData(e[0],2,this.drawIndex);i.setOverlayData(e[1],3,this.drawIndex);i.setOverlayData(e[2],4,this.drawIndex)}else{i.clearLabelOverlayData(this.drawIndex)}lP.temp.isPermitSpotOver=false;this.labelProcessor.curSpotAdded=false}},loadRasterLayerData:function(lY,T){this.thumbCache={};var l1=this.getZoomState();if(T){var l0=0;var lO=0;var lQ=0;var lV=[];for(var lT=0,lP=lY.length;lTlU){lO++}else{lQ++;lV.push({col:C.col,row:C.row,z:C.zoom,cache:e?e.status:"null"})}}}}if(this.tileType&&this.tileType.getName()==="xyz"&&this.map._blankDiag){this.map._blankDiag.push({time:Date.now(),event:"rebuild",drawIndex:this.drawIndex,total:lP,ready:l0,thumb:lO,noThumb:lQ,zoomState:l1,zoom:this.map.getZoom(),noThumbTiles:lV})}return}for(var lT=0,lP=lY.length;lT-1){C+="&ak="+fy+"&is_has_bmap_proxy="+iM+"&from=gl"}var lP=this.getTileKey(i);this.loadTileImage(C,lP,e,i)},loadTileImage:function(lR,C,lP,e){var T=new Image();T.crossOrigin="anonymous";T.tileInfo=e;var lO;var lQ=this;function lS(){if(lQ.retry){lO&&clearInterval(lO);lO=null}}if(this.retry){var i=1;lO=setInterval(function(){if(i>3){lS();return}T.src=lR;i++},this.retryTime)}T.onload=function(){lS();lP&&lP(this,C)};T.onerror=function(){lS();bS.fetchDebug&&bS.fetchDebug.sendError({title:lR,msg:lR,category:bS.fetchDebug.category.RESOURCE,level:bS.fetchDebug.levels.ERROR,url:lR});lP&&lP(null,C)};T.src=lR;return T},_calcXYZTileVertex:function(lS,mb,C){var mg=lS.transform;var mx=lS.zoom;var lR=lS.col;var lZ=lS.row;if(!mg||mg.source!=="EPSG3857"||typeof ey==="undefined"){return[0,0,C,0,0,mb,0,C,1,0,mb,mb,C,1,1,0,0,C,0,0,mb,mb,C,1,1,0,mb,C,0,1]}var mp=ef.resolutions[Math.floor(mx)];var mc=ef.gridSize;var mu=ef.origin;var l5=Math.pow(2,(18-mx));var mo=mu[0]+lR*mc[0]*mp;var l6=mu[1]-lZ*mc[1]*mp;var l7=mo+mc[0]*mp;var mn=l6-mc[1]*mp;if(this.reproject){var ms=ef.toEPSG4326([mo,mn]);var mk=ef.toEPSG4326([l7,l6]);var mq=Math.max(Math.abs(mk[0]-ms[0]),Math.abs(mk[1]-ms[1]));var lQ=Math.max(1,Math.min(16,Math.ceil(mq/0.5)));var mh=lQ+1;var mD=(l7-mo)/lQ,mC=(l6-mn)/lQ;var lX=ef.wgs84ToBd09mc(ms[0],ms[1]);var l9=lX[0]/l5;var l8=lX[1]/l5;lS._tileLBBdPixel=[l9,l8];var lW=this.reprojectSourceCRS==="EPSG4326";var lP=lW?(mk[0]-ms[0]):0;var mw=lW?(mk[1]-ms[1]):0;var lT=mh*mh;var lV=new Float64Array(lT);var lU=new Float64Array(lT);var l1=new Float64Array(lT);var lY=new Float64Array(lT);for(var T=0;T<=lQ;T++){for(var lO=0;lO<=lQ;lO++){var mj=ef.toEPSG4326([mo+mD*lO,mn+mC*T]);var mr=ef.wgs84ToBd09mc(mj[0],mj[1]);var mB=T*mh+lO;lV[mB]=mr[0]/l5-l9;lU[mB]=mr[1]/l5-l8;if(lW){l1[mB]=(mj[0]-ms[0])/lP;lY[mB]=(mj[1]-ms[1])/mw}else{l1[mB]=lO/lQ;lY[mB]=T/lQ}}}var mA=lQ*lQ*30;var mz=new Float32Array(mA);var l4=0;for(var md=0;md0){var lU=T.dataIndex/256;i.renderData={vertexAll:[0,0,this.height,0,0,T.dataIndex,0,this.height,lU-lP,0,T.dataIndex,256,this.height,lU-lP,1,0,0,this.height,0,0,T.dataIndex,256,this.height,lU-lP,1,0,256,this.height,0,1]}}else{var e=-T.dataIndex;var lU=e/256;i.renderData={vertexAll:[e,0,this.height,lU+lP,0,256,0,this.height,1,0,256,256,this.height,1,1,e,0,this.height,lU+lP,0,256,256,this.height,1,1,e,256,this.height,lU+lP,1]}}}else{i.renderData={vertexAll:[0,0,this.height,0,0,256,0,this.height,1,0,256,256,this.height,1,1,0,0,this.height,0,0,256,256,this.height,1,1,0,256,this.height,0,1]}}this.setRasterTileData(lQ,i,lT)}},setRasterTileData:function(lO,e,T){e.status="ready";this.tileCache.setData(lO,e);var C=false;if(this.curViewTilesInfo[T]){e.dataType=hE;e.png8=this.png8||false;this.map._featureMgr.setData(e,this.drawIndex,2);C=true;if(this.tileType.getName()==="xyz"&&this.useThumbData){this._clearThumbDataIfReady()}}else{if(this.tileType.getName()==="xyz"&&this.map._blankDiag){this.map._blankDiag.push({time:Date.now(),event:"tile_miss_view",drawIndex:this.drawIndex,tileId:T,tileKey:lO,viewLen:this.curViewTilesInfo?this.curViewTilesInfo.length:-1})}}if(C){var i=new gC("onrefresh");i.source="webgllayer";this.map.dispatchEvent(i)}},_clearThumbDataIfReady:function(){var e=this.map._featureMgr.result.bkData[this.drawIndex];if(!e){return}if(e[2].length>=this.curViewTilesInfo.length){if(this.map._blankDiag&&(e[0].length||e[1].length)){this.map._blankDiag.push({time:Date.now(),event:"clearThumb_ready",drawIndex:this.drawIndex,hd:e[2].length,viewLen:this.curViewTilesInfo.length,parentThumb:e[0].length,childThumb:e[1].length})}e[0]=[];e[1]=[]}},_checkLayerTilesLoaded:function(){this.numTileLoading--;if(this.firstTileLoad===false){this.dispatchEvent(new gC("ontilesloadstart"));this.firstTileLoad=true}var e=this;if(this.numTileLoading===0){if(this._checkTileLoadedTimer){clearTimeout(this._checkTileLoadedTimer);this._checkTileLoadedTimer=null}this._checkTileLoadedTimer=setTimeout(function(){if(e.numTileLoading===0){e.dispatchEvent(new gC("ontilesloadend"));e.firstTileLoad=false;if(e.tileType.getName()==="xyz"&&e.useThumbData&&e.map&&e.map._featureMgr){var i=e.map._featureMgr.result.bkData[e.drawIndex];var C=i&&(i[0].length||i[1].length);var T=e.curViewTilesInfo?e.curViewTilesInfo.length:0;if(C&&i[2].length>=T){if(e.map._blankDiag){e.map._blankDiag.push({time:Date.now(),event:"clearThumb_allLoaded",drawIndex:e.drawIndex,hd:i[2].length,viewLen:T,parentThumb:i[0].length,childThumb:i[1].length})}i[0]=[];i[1]=[]}e.map.dispatchEvent(new gC("onrefresh"))}}e._checkTileLoadedTimer=null},60)}},_checkTilesLoaded:function(){this._checkLayerTilesLoaded();this.numLoading--;if(this.map.firstTileLoad===false){this.map.dispatchEvent(new gC("onfirsttilesloaded"));this.map.firstTileLoad=true}var e=this;if(this.numLoading===0){if(this._checkLoadedTimer){clearTimeout(this._checkLoadedTimer);this._checkLoadedTimer=null}this._checkLoadedTimer=setTimeout(function(){if(e.numLoading===0){e.map.dispatchEvent(new gC("ontilesloaded"));e.map.firstTileLoad=false}e._checkLoadedTimer=null},60);if(cd.business===0&&cd.unauth===1){e.shuffleTiles()}}},shuffleTiles:function(){var lQ=this.watermarkTileKeys;for(var lP=lQ.length-1;lP>0;lP--){var lO=Math.floor(Math.random()*(lP+1));var T=lQ[lP];lQ[lP]=lQ[lO];lQ[lO]=T}var C=Math.floor(lQ.length*cd.watermark_ratio);var lR=[];for(var e=0;e9&&!e.guid){return false}if(e.zoom<=9&&!e.name&&!e.guid){return false}return true}};var a7=5;var kv=4;var hx=3;var R=2;var fa=1;var iC=0;function aH(i){this._ratio=g9();this._iconCache={};this._map=i;this._drawingCanvasPool=[];this._drawingCanvasHeight=4096;this._drawingCanvasWidth=512;this._bufferSpan=[5,5];this._debugContainer=null;var e=this;i.addEventListener("onlanguage_change",function(){e._clearLabelTextCanvas()})}fK.extend(aH.prototype,{_loadIcons:function(C,lT,lP){var T=0;var lQ=this;var lO=this._map.config.style;for(var lR in C){T++;var lS=new Image();lS.id=lR;lS.crossOrigin="anonymous";lS.onload=function(){lQ._iconCache[this.id].loaded=true;T--;if(T===0){lT()}this.onload=null};lS.onerror=function(){lQ._iconCache[this.id]=null;T--;if(T===0){lT()}this.onerror=null};if(!lP){var e=G.getIconSetPath(lO)+lR+".png";var i=bT();if(i&&i.udt){e+="?udt="+i.udt}}else{var e=lR}lS.src=e;this._iconCache[lR]={loaded:false,image:lS}}},_getEmptyDrawingCanvas:function(){for(var C=0;C0){while(lP0){lP=0;while(lP0){lP=0;while(lP0){l7=this._drawEachTypeOfLabels(l0,C,l9,lS,lR,lW,l4);l9=l7.curStyleId;lS=l7.curX;lR=l7.curY;lW=l7.curLineHeight;l5=l7.overHeight||l5}if(!l5&&l1.length>0){l7=this._drawEachTypeOfLabels(l0,l1,l9,lS,lR,lW,l4);l9=l7.curStyleId;lS=l7.curX;lR=l7.curY;lW=l7.curLineHeight;l5=l7.overHeight||l5}if(!l5&&ma>0){var l8=this;this._loadIcons(lY,function(){l7=l8._drawEachTypeOfLabels(l0,lZ,l9,lS,lR,lW,l4);l9=l7.curStyleId;lS=l7.curX;lR=l7.curY;lR+=l8._bufferSpan[1];lW=l7.curLineHeight;l5=l5||l7.overHeight;var i=l8._generateEachLabelCanvas(e,lR,lV,l1,C,l6);T(i[0],i[1])});return}lR+=this._bufferSpan[1];var lT=this._generateEachLabelCanvas(e,lR,lV,l1,C,l6);T(lT[0],lT[1])},drawCustomLabelsOnCanvas:function(lS,lR,C){if(lS.length===0){lR();return}var lP={};var lO=false;for(var T=0;T0){lR[lO].textPos=null;lR[lO].iconPos=null}continue}this._updateFixedLabelCoords(lR[lO],lP);this._addFixedLabelBounds(lR[lO])}for(var lO=0;lO0){lT[lO].textPos=null;lT[lO].iconPos=null}continue}this._updateFixedLabelCoords(lT[lO],lP);this._addFixedLabelBounds(lT[lO])}for(var lO=0;lO4){my=4}var mi=[];var l4=[];var me=0;if(lO&&!lO[mA]){lO[mA]={}}var lY=lZ+my*2+mD[0]*2;var mj=lY;if(lR.containDescendings){mj+=4}if(my===0){mj+=2}if(lR.textOnIcon){mj=Math.max(mj,lR.iconSize[1])}if(mA!==C||mj>mh){C=mA;if(ml>=10&&ml%10===0){l6.font=ml*10+" "+lZ+"px "+this._map.config.fontFamily}else{l6.font=lZ+"px "+this._map.config.fontFamily}if(mj>mh){var mf=mj-mh;mh+=mf;l7+=mf}if(my>0){l6.lineWidth=my*2;l6.strokeStyle=lQ}l6.fillStyle=ms}if(lR.type==="line"){var lT=mg.split("");var ma=[];for(var mC=0;mCthis._drawingCanvasHeight){for(var mB=0;mBthis._drawingCanvasWidth){l8=0+this._bufferSpan[0];l7+=mj;l7+=this._bufferSpan[1];mh=mj;if(l7+mj+this._bufferSpan[1]>this._drawingCanvasHeight){for(var mB=0;mB0){T+=my;mu-=Math.round(my/2);l6.strokeText(mv,l8,l7)}l6.fillText(mv,l8,l7);var mr=[T,mj];mb=[Math.round(mr[0]/2),Math.round(mr[1]/2)];if(lR.containDescendings){mm=[mu,l7-mj+4]}else{mm=[mu,l7-mj]}lO[mA][mv]={displaySize:mb,curWordPosition:mm,totalHeight:me};ma.push(mv);l8+=T}mi.push(mb);l4.push(mm)}me=Math.round(mi[0][1])}else{if(lO[mA][mg]){var l1=lO[mA][mg];mi=l1.textSize;l4=l1.labelImagePosition;me=l1.totalHeight}else{var l0=mg.split("\\");if(l0.length>1&&lR.textOnIcon){var mE=0;var mz=0;var mH=[];var mc=8;for(var mC=0;mCmE){mE=lX}mH.push(Math.round(lX/2));mz+=mj}var lU=mE+2*mc;var mx=mz+2*mc;if(l8+lU>this._drawingCanvasWidth){l8=0+this._bufferSpan[0];l7+=mh;l7+=this._bufferSpan[1]}var mf=mx-mh;if(mf>0){l7+=mf;mh+=mf}if(l7+this._bufferSpan[1]>this._drawingCanvasHeight){return{overHeight:true,curX:l8,curY:l7-(mf>0?mf:0),curLineHeight:mh-(mf>0?mf:0),styleId:mA}}var mq=l8;var md=l7-mx;var e=Math.round(lU/2);var l3=this._iconCache[lR.icon].image;this.drawStretchedIcon(l6,l3,[mq,md],mc,mE,mz);for(var mC=0;mCthis._drawingCanvasWidth&&l0.length==1){l0[mC]=mg.substring(0,Math.floor(mg.length/2));l0[mC+1]=mg.substring(Math.floor(mg.length/2));mC--;continue}var lU=lX;var lP=0;if(lR.textOnIcon){lP=10;lU+=lP*2;if(lR.styleId===519){lU=lR.iconSize[0];lP=Math.round((lU-lX)/2)}}if(l8+lU>this._drawingCanvasWidth){var l9=l7+mj+this._bufferSpan[1];if(l9+this._bufferSpan[1]>this._drawingCanvasHeight){return{overHeight:true,curX:l8,curY:l7,curLineHeight:mh,styleId:mA}}l7=l9;l8=0+this._bufferSpan[0];mh=mj}else{if(l7+this._bufferSpan[1]>this._drawingCanvasHeight){return{overHeight:true,curX:l8,curY:l7,curLineHeight:mh,styleId:mA}}}var mq=l8;var md=l7-mj;var mp=l8;var mo=l7;if(lR.containDescendings){mo-=4}if(lR.textOnIcon){var mk=false;var l3=this._iconCache[lR.icon].image;var mn=lR.iconSize.concat([]);if(lY>=mn[1]){mn[1]=lY;mk=true;mj+=lP*2;var mf=mj-mh;if(mf>0){if(l7+mf+this._bufferSpan[1]>this._drawingCanvasHeight){return{overHeight:true,curX:l8,curY:l7,curLineHeight:mh,styleId:mA}}l7+=mf;mh=mj;mo+=(mf-lP);md+=(mf-lP*2)}else{mo-=lP;md-=lP*2}}if(lX>=mn[0]){mn[0]=lX}if(lR.styleId===519){l6.drawImage(l3,0,0,mn[0],mn[1],mq,md,mn[0],mn[1])}else{if(lR.noStretch){mo-=lY/2;var l5=lX+lP*2;l6.drawImage(l3,0,0,l3.width,l3.height,mq,md,l5,lY)}else{if(mk){this.drawStretchedIcon(l6,l3,[mq,md],lP,lX,mn[1])}else{this.draw3StretchedIcon(l6,l3,[mq,md],lP,lX,mn[1])}}}mp+=lP;if(lR.iconSize[1]>lY){mo-=(lR.iconSize[1]-lY)/2-1;if(lR.containDescendings){mo+=4}}}if(my>0){if(mA===71028){mj-=2}if(mA===32){mj-=2}l6.strokeText(mg,mp,mo)}l6.fillText(mg,mp,mo);var lS=[lU,mj];var mb=[Math.round(lS[0]/2),Math.round(lS[1]/2)];mi.push(mb);l4.push([mq,md]);me+=Math.round(mb[1]);l8+=lU}}lO[mA][mg]={textSize:mi,labelImagePosition:l4,totalHeight:me}}}lR.textSize=mi;lR.labelImagePosition=l4;lR.totalHeight=me;return{curX:l8,curY:l7,curLineHeight:mh,styleId:mA}},drawStretchedIcon:function(e,C,T,lQ,lR,i){var lP=T[0];var lO=T[1];e.drawImage(C,0,0,lQ,lQ,lP,lO,lQ,lQ);e.drawImage(C,lQ,0,1,lQ,lP+lQ,lO,lR,lQ);e.drawImage(C,C.width-lQ,0,lQ,lQ,lP+lR+lQ,lO,lQ,lQ);e.drawImage(C,0,lQ,lQ,1,lP,lO+lQ,lQ,i);e.drawImage(C,lQ,lQ,1,1,lP+lQ,lO+lQ,lR,i);e.drawImage(C,C.width-lQ,lQ,lQ,1,lP+lR+lQ,lO+lQ,lQ,i);e.drawImage(C,0,C.height-lQ,lQ,lQ,lP,lO+i+lQ,lQ,lQ);e.drawImage(C,lQ,C.height-lQ,1,lQ,lP+lQ,lO+i+lQ,lR,lQ);e.drawImage(C,C.width-lQ,C.height-lQ,lQ,lQ,lP+lR+lQ,lO+i+lQ,lQ,lQ)},draw3StretchedIcon:function(e,i,C,lP,lR,lQ){var lO=C[0];var T=C[1];e.drawImage(i,0,0,lP,i.height,lO,T,lP,i.height);e.drawImage(i,lP,0,1,i.height,lO+lP,T,lR,i.height);e.drawImage(i,i.width-lP,0,lP,i.height,lO+lP+lR,T,lP,i.height)},_updateFixedLabelCoords:function(lO,l3){if(l3===0){return}var lY=[];var ma=[];var mb=0;var l1=lO.totalHeight;var mj=lO.textSize.length;var lP=lO.direction;if(typeof lP!=="number"){lP=0}for(var mc=0;mcC){C=lX}if(lVe){e=lV}}}if(lT.custom&&lT.style.iconSize&&!lT.name){var lU=lT.style.iconSize;var lW=lT.direction;switch(lW){case kv:lP=-Math.round(lU[0]/2);T=-Math.round(lU[1]/2);C=Math.round(lU[0]/2);e=Math.round(lU[1]/2);break;case R:lP=-Math.round(lU[0]/2);T=0;C=Math.round(lU[0]/2);e=lU[1];break}}if(lT.textPos){var lQ=lT.textPos["vertex"];for(var lS=0,lO=lQ.length;lSC){C=lX}if(lVe){e=lV}}}lT.bds=[lP,T,C,e]},_updateLineLabelCoords:function(l5,lU){if(lU===0){return}var T=l5.wordsInfo;var l2=l5.wordCount;if(!l5.labelImagePosition){return}var lW=this._map._displayOptions.isEn;var lX=l5.labelImagePosition.slice(0);var l6=l5.textSize.slice(0);if(l5.reverse&&!lW){lX.reverse();l6.reverse()}var mf=1000;var mc=1000;var md=-1000;var mb=-1000;for(var l7=0;l7md){md=l4}if(lPmb){mb=lR}}if(!lW){l5.bds=[mf,mc,md,mb]}}});var gY={0:"00000000",16:"00010000",32:"00100000",48:"00110000",64:"01000000",96:"01100000"};function eZ(lP,lR,T){var lO=lP.bds;if(!lO){return false}var lQ=lP.tracer;var C;if(lQ){if(!gY[lQ]){C=lQ.toString(2);if(C.length<8){C=new Array(8-C.length+1).join("0")+C}gY[lQ]=C}C=gY[lQ];var e=lJ.mapZoomStartZoomMapping[lR];var lS=lR>20?21:lR;return C[lS-e]==="1"}var i=lP.displayRange;if(T>=i[0]&&T<=i[1]){return true}return false}function kB(i,e){this.map=i.map;this.layer=i;e=e||[];this.allLabels=[];this._spotData=[];this._strategyInfo=null;this.RANK1=1000000;this.RANK2=2000000;this.RANK3=3000000;this.RANK4=4000000;this.RANK5=5000000;this._ratio=g9();this._useRound=true;this._sharpenRender=false;if(this._ratio>iX.HIGH_RES_MIN_RATIO){this._useRound=false;this._sharpenRender=true}this._mapIsMoving=false;this._onMapIdleCallback=e.onMapIdleCallback;this.map.temp.isPermitSpotOver=true;this.currentSelectedLabel=null;this.map._labelProcessor=this;this.iconCache=new aK((cl()||fK.Browser.ie)?64:128,{clearCallback:function(C){if(C&&C.image){var T=C.image;if(T.onload){T.onload=null}if(T.onerror){T.onerror=null}T.src="";T.remove();C.image=null}}});this.fixedLabelData=[];this.lineLabelData=[];this.highlightLabelData=[];this._iconLoadTimer=null;this._labelTextCanvas=null;if(this.map.config.textRenderType==="canvas"){this._labelTextCanvas=this.map.tileMgr.getLabelTextCanvas()}this.bind()}fK.extend(kB.prototype,{bind:function(){var C=this.map;var i=this;C.addEventListener("mapstatusbusy_inner",function(T){i._mapIsMoving=true;if(i._ratio>iX.HIGH_RES_MIN_RATIO){i._sharpenRender=false}else{i._useRound=false}});C.addEventListener("mapstatusidle_inner",function(T){if(i._ratio>iX.HIGH_RES_MIN_RATIO){i._sharpenRender=true}else{i._useRound=true}i._mapIsMoving=false});C.addEventListener("onspotmouseover",function(lP){if(!this.temp.isPermitSpotOver){return}if(lP.spots.length>0){var lO=lP.spots[0].userdata.uid;var lQ=lP.spots[0].userdata.tilePosStr;var T=i.getLabelByUid(lO,lQ);T&&T.formatedData&&i._toHighlightColor(T.formatedData)}});C.addEventListener("onspotmouseout",function(lP){if(!this.temp.isPermitSpotOver){return}if(lP.spots.length>0){var lO=lP.spots[0].userdata.uid;var lQ=lP.spots[0].userdata.tilePosStr;var T=i.getLabelByUid(lO,lQ);T&&T.formatedData&&i._toDefaultColor(T.formatedData)}});C.addEventListener("spotclick",function(lP){if(lP.spots&&lP.spots.length>0){if(lP.spots[0].userdata.zoom<10){return}var lO=lP.spots[0].userdata.uid;var lQ=lP.spots[0].userdata.tilePosStr;if(i.currentSelectedLabel&&(i.currentSelectedLabel.uid!==lO||i.currentSelectedLabel.tilePosStr!==lQ)){i._recoverNormalState()}var T=i.getLabelByUid(lO,lQ);T&&i._changeBaseMapState(T)}else{i._recoverNormalState()}});C.on("spot_status_reset",function(){i._recoverNormalState()});C.on("spot_highlight",function(lO){var T=i.getLabelByUid(lO.uid,lO.tilePosStr);T&&T.formatedData&&i._toHighlightColor(T.formatedData)});C.addEventListener("mousemove",function(T){if(i.curSpotAdded){return}if(this.currentOperation!==eU.idle||i._mapIsMoving===true){return}i._refreshSpotData();this.temp.isPermitSpotOver=true;i.curSpotAdded=true});if(cl()){function e(){i._refreshSpotData()}C.addEventListener("mapstatusidle_inner",e)}C.on("style_loaded",function(){if(i.map.config.textRenderType==="canvas"&&!i._labelTextCanvas){i._labelTextCanvas=i.map.tileMgr.getLabelTextCanvas()}});C.on("destroy",function(){i.iconCache.clear();for(var T=0;T=0&&mX<45)||(mX>=315&&mX<360)){l3=mP;l2=mO;m3=mf;m2=md}else{if(mX>=45&&mX<135){l3=mO;l2=-mf;m3=md;m2=-mP}else{if(mX>=135&&mX<225){l3=-mf;l2=-md;m3=-mP;m2=-mO}else{if(mX>=225&&mX<315){l3=-md;l2=mP;m3=-mO;m2=mf}}}}mN._tempBds=[m7+l3,m6+l2,m7+m3,m6+m2];var mV=l4.pixelToPointIn(new f8(mN._tempBds[0],mM.y+l2),{zoom:mk});var mK=l4.pixelToPointIn(new f8(mN._tempBds[2],mM.y+m2),{zoom:mk});mN._mcBds=[mV,mK];ms.push(mN)}}else{for(var mr=0,ma=m4.length;mr0){m1=6}mY=l4.getZoom();if(mY>=8&&mY<9){mY<8.5?(m1=6):(m1=3)}if(l4._displayOptions.labelMargin>0){m1=l4._displayOptions.labelMargin}var mF=2;if(mY<6&&mY>=5){mF=-1}for(var mI=0,lX=ms.length;mIm9[2]+m1+mF||mQ[3]+m1+mFm9[3]+m1+mF)){m0._intersectIdx.push(my)}}}for(var mG=0,lW=ms.length;mG=0.5?e+0.5:e;return i},clearCollisionCache:function(e){if(!e){return}e.cacheState=null;e.unnecessaryCollisionTest=null},getCachedLabels:function(e){e=e||[];var C=this.getZoomStep();var lP=false;for(var T=0;Te){lV.isDel=true}if(lV.isDel){continue}var l3=lV.pt;var C=(lV.hue||0)?hn(lV.hue):0;var T=lV.iconPos;if(T&&T.texcoord){if(!T.rtVertex){T.rtVertex=[];l4=T.vertex;var lS=j5(l3.lng);var l2=j5(l3.lat);T.rtVertex=[lS[0],l2[0],lS[1],l2[1],0,l4[0],l4[1],0,0,T.texcoord[0],T.texcoord[1],C,lS[0],l2[0],lS[1],l2[1],0,l4[2],l4[3],0,0,T.texcoord[2],T.texcoord[3],C,lS[0],l2[0],lS[1],l2[1],0,l4[4],l4[5],0,0,T.texcoord[4],T.texcoord[5],C,lS[0],l2[0],lS[1],l2[1],0,l4[6],l4[7],0,0,T.texcoord[6],T.texcoord[7],C,lS[0],l2[0],lS[1],l2[1],0,l4[8],l4[9],0,0,T.texcoord[8],T.texcoord[9],C,lS[0],l2[0],lS[1],l2[1],0,l4[10],l4[11],0,0,T.texcoord[10],T.texcoord[11],C]}}if(!lV.textOnIcon){C=0}var l1=lV.textPos;if(l1){if(!l1.rtVertex){l1.rtVertex=[];l4=l1.vertex;var lQ=l1.rtVertex;var lY=j5(l3.lng);var l7=j5(l3.lat);var l6=j5(lO);for(var lX=0,l5=l4.length;lX0&&l8[0]){l3=l8[0].angle||0}var mk=this.calcLoopHeading(l3-me);if(lQ&&mk>90&&mk<270){mg=180;l2=true}if(!lQ&&mk>45&&mk<315){if(mk>45&&mk<=135){mg=270}else{if(mk>135&&mk<=225){mg=180}else{if(mk>225&&mk<315){mg=90}}}if(l6>225&&l6<=315&&mg<=180){l2=true}else{if((l6>=0&&l6<=45||l6>=315&&l6<360)&&mg>=180){l2=true}}}}if(lQ){if(lY===l2){continue}else{lY=l2}if(l2){l8=lT.reverse_wordsInfo}}for(var mm=0,lZ=l8.length;mm-1&&C<14)||C<=13){lW=lX[lP][3];lU=lX[lP][4]}var lV=this.calcLineLabelOffsetAndAngle(e,lW,lR,lU,C);var lT=lX[lP][5];for(var lQ=0;lQ=(l3.length/2-1)){return false}if(lU===-1&&mc<=0){return false}l0=[l3[mc*2],l3[mc*2+1]];lY=[l3[(mc+lU)*2],l3[(mc+lU)*2+1]];mb=l0;return true}var l7=1;for(var ma=lS;lU===1?ma<=lQ:ma>=0;lU===1?ma++:ma--){var md=e[ma];var l5=md.size[0]*T;var l1=md.size[1]*T;while(l7===1){var me=l9[mc+(lU===1?0:lU)];var mf=l0;if(C.length){var lO=C[C.length-1];mf=lO.mc;var lP=this.calculateAngleDifference(mf,mb,lY);if(lP>0&&lP<90){l7=0;break}}var lR=this.linearEquationAndNextPoint(l0,lY,mb,mf,lX,l5/2,lW);if(!lR){lW+=l5/2}else{if(lR.length===1){lX=lR[0];if(!l8()){l7=0;break}}else{lW=0;var lT=[(lR[0]-l4)*i,(lR[1]-l2)*i];mb=[lR[2],lR[3]];C.push(Object.assign({offset:lT,angle:me,z:0,mc:[lR[0],lR[1]],},md));lX=0;break}}}if(l7===0){break}lZ++}if(lZC){C=lR}if(Te){e=lO}}return[lQ,lP,C,e]},calcWordsInfoMCBds:function(l4,lV,lW,lT){var i=l4.getHeading();i=this.calcLoopHeading(i);var lU=l4.height;var lX=lT.pt;var lS=l4.pointToPixelIn(lX,{zoom:lV,useRound:this._useRound});var lZ=lS.x+lW;var lY=lU-lS.y;var T=lT.bds;var lQ=T[0];var lO=T[1];var lP=T[2];var C=T[3];var l3=lQ;var l2=lO;var l1=lP;var l0=C;if((i>=0&&i<45)||(i>=315&&i<360)){l3=lQ;l2=lO;l1=lP;l0=C}else{if(i>=45&&i<135){l3=lO;l2=-lP;l1=C;l0=-lQ}else{if(i>=135&&i<225){l3=-lP;l2=-C;l1=-lQ;l0=-lO}else{if(i>=225&&i<315){l3=-C;l2=lQ;l1=-lO;l0=lP}}}}lT._tempBds=[lZ+l3,lY+l2,lZ+l1,lY+l0];var lR=l4.pixelToPointIn(new f8(lT._tempBds[0],lS.y+l2),{zoom:lV});var e=l4.pixelToPointIn(new f8(lT._tempBds[2],lS.y+l0),{zoom:lV});lT._mcBds=[lR,e]},calcLoopHeading:function(e){while(e>=360){e-=360}while(e<0){e+=360}return e},fixDataFormat:function(lW){var T=this.fixedLabelData;var e=this.lineLabelData;var C=this.highlightLabelData;var l5=0;var lR=0;var l1=0;var l2;if(this.currentSelectedLabel){var lQ=this.getLabelByUid(this.currentSelectedLabel.guid,this.currentSelectedLabel.tilePosStr);if(!lQ||lQ.isDel){T[l5]=this.currentSelectedLabel.formatedData;l5++;C[l1]=this.currentSelectedLabel.formatedData;l1++}}for(var l0=0;l0T)){continue}var i=lO[e].spot||this._getSpotDataFromLabel(lO[e]);if(i){this._spotData.push(i)}}},_getSpotDataFromLabel:function(C){var lP=this.map;if(!C.bds){return null}var e=C.bds.slice(0);var T=null;if(C.iconPos){T=new c4(C.pt.lng,C.pt.lat)}var i=C.name?C.name.replace("\\\\","
"):"";if(C.iconPos&&C.iconPos.iconType.indexOf("ditie")>-1&&lP.getZoom()>14){i=""}var lO={n:i,pt:new c4(C.pt.lng,C.pt.lat),userdata:{iconPoint:T,uid:C.guid,name:i,mapPoi:true,type:C.iconPos?C.iconPos.iconType:"",rank:C.rank,zoom:C.zoom,tilePosStr:C.tilePosStr},bd:e,tag:"MAP_SPOT_INFO"};C.spot=lO;return lO},drawLabelsOnCanvas:function(i,e){if(this._labelTextCanvas){this._labelTextCanvas.drawLabelsOnCanvas(i,e)}}});function ku(e){this._map=e;this.virtualTiles={};this.virtualTile={custom:true,label:{fixedLabel:[],indoorLabel:[],lineLabel:[],textureHeights:[],status:"ready"},tileInfo:{col:0,row:0,zoom:0,useZoom:0,loopOffsetX:0},status:"ready"};this._task={};this.init()}ku.prototype.init=function(){var C=this._map;var i=this;function e(T){i.updateLabels(T)}C.addEventListener("add_tile_labels",e);C.addEventListener("onremove_tile_labels",e);C.addEventListener("onclear_labels",e);C.addEventListener("onlayer_clear",e)};ku.prototype.updateLabels=function(lQ){var lU=this._map.tileMgr.getLabelTextCanvas();var C=this._map;var lS=this;var lR=dC();if(lQ&&lQ.model==="mvt"){var lW=lQ.data;var lV="mvt_"+lQ.index;if(!this._task[lV]){this._task[lV]=[lR]}else{this._task[lV].push(lR)}}else{var lW=C._customTileLabels;var lV="custom";if(!this._task[lV]){this._task[lV]=[lR]}else{this._task[lV].push(lR)}}var lP=JSON.parse(JSON.stringify(lW));for(var lO=0;lO=lP},"\x61\x61\x65\x65\x6d":function(lP,lQ){return lP>lQ},"\x68\x6d\x61\x6d\x64":gF("0x32"),"\x65\x6c\x61\x64\x63":gF("0x33"),"\x64\x6c\x64\x78\x65":gF("0x34"),"\x6c\x68\x63\x69\x6d":"\x65\x65\x65\x68","\x65\x63\x69\x63\x64":function(lQ,lP){return lQlP},"\x78\x6c\x65\x61\x68":function(lQ,lP){return lQ!==lP},"\x64\x61\x6d\x61\x78":"\x61\x61\x61","\x6d\x61\x78\x61\x64":gF("0x44"),"\x68\x64\x61\x63\x65":gF("0x45"),"\x65\x64\x61\x61\x63":"\x69\x69\x64","\x63\x61\x65\x68\x61":gF("0x46"),"\x65\x65\x65\x69\x64":gF("0x47"),"\x65\x6d\x61\x63\x69":"\x6f\x6e\x73\x74\x79\x6c\x65\x5f\x6c\x6f\x61\x64\x65\x64","\x61\x69\x64\x6d\x65":gF("0x48"),"\x78\x63\x6c\x69\x61":gF("0x49"),"\x6d\x6d\x64\x69\x65":gF("0x4a"),"\x69\x69\x78\x61\x64":gF("0x4b"),"\x65\x61\x63\x63\x6d":function(lP){return lP()},"\x63\x6c\x6d\x68\x64":gF("0x4c"),"\x6d\x64\x78\x78\x64":function(lP){return lP()}};var T="\x65\x64\x65";while(C[gF("0x4d")](T,gF("0x44"))){switch(T){case gF("0x49"):var e=Math[gF("0x4e")](navigator[gF("0x4f")]-2,0)||4;T=gF("0x50");break;case C[gF("0x51")]:lO["\x6f\x6e"](gF("0x52"),function(){for(var lQ=0;C["\x61\x61\x65\x61\x69"](lQ,i[gF("0x53")][gF("0x54")]);lQ++){if(i[gF("0x53")][lQ]){i["\x61\x72\x72\x57\x6f\x72\x6b\x65\x72"][lQ][gF("0x55")]()}}i[gF("0x53")][gF("0x54")]=0;var lP=i["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"];for(var lQ=C[gF("0x56")](lP[gF("0x54")],1);C[gF("0x57")](lQ,0);lQ--){lP[lQ]=null}i["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x49\x6e\x64\x6f\x6f\x72\x53\x74\x79\x6c\x65"]=null;i[gF("0x58")]=null;i[gF("0x59")]=[];i[gF("0x5a")]=null;var lR=Object[gF("0x5b")](i);for(var lQ=0;C[gF("0x5c")](lQ,lR[gF("0x54")]);lQ++){if(C[gF("0x5d")](lR[lQ][gF("0x5e")](C[gF("0x5f")]),-1)||C[gF("0x5d")](lR[lQ][gF("0x5e")](C[gF("0x60")]),-1)){delete i[lR[lQ]]}}});T=C[gF("0x61")];break;case gF("0x62"):this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x43\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f"]=null;T=C[gF("0x63")];break;case gF("0x64"):this[gF("0x53")]=[];T=C[gF("0x65")];break;case gF("0x66"):this[gF("0x67")]=this["\x72\x61\x74\x69\x6f"];T=C["\x61\x68\x64\x65\x65"];break;case gF("0x45"):this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x43\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f\x5a\x6f\x6f\x6d"]=[];T=C[gF("0x68")];break;case C["\x65\x65\x65\x69\x64"]:lO["\x6f\x6e"](gF("0x69"),function(){var lR=C["\x64\x6c\x64\x78\x65"];while(lR!==C[gF("0x6a")]){switch(lR){case gF("0x34"):for(var lQ=0,lP=i[gF("0x53")]["\x6c\x65\x6e\x67\x74\x68"];C[gF("0x6b")](lQ,lP);lQ++){i[gF("0x53")][lQ][gF("0x6c")]=![]}lR=gF("0x6d");break;case gF("0x6d"):if(C[gF("0x6e")](typeof this[gF("0x6f")][gF("0x70")],C[gF("0x71")])){lR=C[gF("0x72")];break}lR=gF("0x73");break;case C[gF("0x74")]:i["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x43\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f\x5a\x6f\x6f\x6d"]=[];lR=C[gF("0x75")];break;case C[gF("0x75")]:i[gF("0x5a")]=null;lR=gF("0x73");break;case gF("0x76"):i["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x43\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f"]=null;lR=C[gF("0x74")];break}}});T=gF("0x77");break;case gF("0x4c"):lO["\x6f\x6e"](C[gF("0x78")],function(){var lP=C[gF("0x79")];while(lP!==gF("0x3b")){switch(lP){case C["\x61\x65\x78\x65\x65"]:for(var lR=0,lQ=i[gF("0x53")][gF("0x54")];lR1?2:1;T=gF("0x89");break;case gF("0x89"):if(typeof this[gF("0x8a")][gF("0x6f")][gF("0x70")]===C[gF("0x71")]){T=gF("0x62");break}T="\x61\x65\x78";break;case gF("0x4a"):gj[gF("0x8b")](function(lX){var lW={"\x64\x61\x63\x64\x69":C[gF("0x8c")],"\x68\x65\x64\x64\x6c":C[gF("0x8d")],"\x6c\x65\x63\x61\x65":gF("0x8e"),"\x64\x6d\x61\x69\x78":gF("0x15"),"\x65\x68\x6d\x65\x6d":gF("0x8f"),"\x61\x65\x63\x61\x61":gF("0x90"),"\x63\x69\x68\x69\x78":gF("0x91"),"\x6c\x65\x6c\x65\x65":function(lZ,lY){return lZ>lY},"\x78\x63\x65\x69\x6c":gF("0x92"),"\x64\x65\x6d\x61\x65":C["\x63\x61\x61\x64\x78"],"\x6c\x78\x6d\x63\x65":gF("0x93"),"\x68\x61\x63\x68\x68":C[gF("0x94")],"\x6c\x64\x68\x65\x61":gF("0x95"),"\x61\x6d\x65\x61\x65":C[gF("0x96")]};var lV;if(lX){lV=C["\x65\x63\x65\x65\x78"]}else{lV=C[gF("0x97")]}for(var lU=0;C[gF("0x98")](lU,e);lU++){var lT="\x65\x6c\x64";while(lT!==C["\x68\x63\x63\x63\x61"]){switch(lT){case C["\x6d\x61\x6d\x65\x6c"]:var lS=ll(lV);lT=C[gF("0x99")];break;case"\x63\x69\x61":i[gF("0x53")][gF("0x9a")](lS);lT="\x65\x69\x63\x61";break;case gF("0x43"):lS[gF("0x9b")]=function lR(l2){var l1=lW[gF("0x9c")];while(l1!==lW[gF("0x9d")]){switch(l1){case gF("0x95"):var l0=new gC(lW["\x6c\x65\x63\x61\x65"]);l1=lW[gF("0x9e")];break;case"\x69\x61\x63":lO[gF("0x9f")](l0);l1=lW[gF("0x9d")];break;case gF("0x3f"):this[gF("0xa0")]=null;l1=lW["\x65\x68\x6d\x65\x6d"];break;case gF("0xa1"):var lZ=lY["\x63\x62\x6b"];l1=lW[gF("0xa2")];break;case gF("0x3c"):l1=l2["\x64\x61\x74\x61"]?lW[gF("0xa3")]:"\x65\x6c\x6c";break;case lW[gF("0xa4")]:if(lW[gF("0xa5")](i["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"][gF("0x54")],0)){l1=lW[gF("0xa6")];break}l1=gF("0x95");break;case gF("0x92"):var lY=i["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"][gF("0xa7")]();l1=gF("0xa1");break;case"\x61\x63\x6c":this[gF("0xa8")]=![];l1=lW[gF("0xa9")];break;case lW[gF("0xa9")]:this[gF("0xaa")]=null;l1=lW[gF("0xab")];break;case"\x6c\x61\x64":l0[gF("0xac")]="\x77\x6f\x72\x6b\x65\x72\x6d\x67\x72";l1=gF("0xad");break;case gF("0x93"):this[gF("0xae")]=null;l1=lW[gF("0xaf")];break;case gF("0x90"):i["\x6c\x6f\x61\x64\x54\x69\x6c\x65\x44\x61\x74\x61"](lY[gF("0xb0")],lY[gF("0xb1")],lY[gF("0xb2")],lZ);l1=lW[gF("0xb3")];break;case gF("0x64"):this[gF("0xaa")]&&this["\x5f\x63\x62\x6b"](null,this[gF("0xa0")]);l1=lW[gF("0xb4")];break;case lW[gF("0xa3")]:this[gF("0xaa")]&&this[gF("0xaa")](l2[gF("0xb5")],this[gF("0xa0")]);l1=gF("0x40");break}}};lT=gF("0xb6");break}}}if(C[gF("0xb7")](i["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"][gF("0x54")],0)){for(var lQ=0;C[gF("0x98")](lQ,Math[gF("0xb8")](i[gF("0x80")][gF("0x54")],e));lQ++){var lP=i[gF("0x80")][gF("0xa7")]();i[gF("0xb9")](lP[gF("0xb0")],lP["\x74\x69\x6c\x65\x49\x6e\x66\x6f"],lP[gF("0xb2")],lP[gF("0xba")])}}});T=C[gF("0xbb")];break;case gF("0x50"):if((C[gF("0xbc")](cl)||fK["\x42\x72\x6f\x77\x73\x65\x72"]["\x69\x65"])&&e>2){T="\x65\x65\x65";break}T=gF("0x64");break}}},"\x67\x65\x74\x49\x64\x6c\x65\x57\x6f\x72\x6b\x65\x72":function(){var e={"\x68\x64\x61\x64\x63":function(lO,lP){return lO=lS},"\x6d\x64\x65\x61\x65":function(lT,lS){return lT+lS},"\x68\x61\x69\x63\x6c":function(lT,lS){return lT+lS},"\x61\x6c\x68\x6d\x6c":function(lT,lS){return lT+lS},"\x61\x63\x68\x69\x63":function(lT,lS){return lT+lS},"\x65\x63\x65\x65\x6d":gF("0xbe")};var lR=[];var lQ=this["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"];for(var lO=lQ[gF("0x54")]-1;T[gF("0xbf")](lO,0);lO--){var C=lQ[lO];var i=C[gF("0xb1")];if(lP[gF("0xc0")]!==i[gF("0xc0")]){continue}var e=T[gF("0xc1")](T[gF("0xc2")](T["\x61\x6c\x68\x6d\x6c"](T[gF("0xc3")](T[gF("0xc3")](T[gF("0xc4")],i["\x63\x6f\x6c"]),"\x5f"),i["\x72\x6f\x77"]),"\x5f"),i[gF("0xc5")]);if(!lP[e]){lQ[gF("0xc6")](lO,1);lR[gF("0x9a")](i)}}return lR},"\x6c\x6f\x61\x64\x54\x69\x6c\x65\x44\x61\x74\x61":function(lY,lX,lW,lV){var lT={"\x61\x78\x78\x6d\x68":gF("0xc7"),"\x63\x64\x69\x65\x65":gF("0xc8"),"\x68\x6d\x65\x61\x6c":gF("0xc9"),"\x65\x65\x65\x6c\x65":gF("0x32"),"\x6d\x61\x69\x6c\x69":gF("0xca"),"\x64\x61\x6d\x61\x61":gF("0xcb"),"\x78\x6c\x61\x61\x6c":gF("0x46"),"\x78\x6d\x63\x63\x61":gF("0xcc"),"\x61\x65\x63\x78\x6d":gF("0xcd"),"\x63\x78\x65\x64\x63":gF("0xce"),"\x68\x61\x61\x65\x6c":function(l3,l2){return l3+l2},"\x63\x65\x61\x65\x63":function(l3,l2){return l3+l2},"\x78\x69\x63\x68\x61":gF("0xcf"),"\x64\x6c\x61\x78\x64":"\x62\x61\x73\x65\x46\x73","\x6c\x6c\x78\x65\x6c":gF("0xd0"),"\x61\x61\x63\x6c\x65":gF("0xd1"),"\x6d\x6d\x65\x68\x68":"\x61\x63\x78","\x64\x65\x63\x65\x65":gF("0x4b"),"\x69\x68\x65\x65\x63":gF("0x33"),"\x65\x65\x63\x61\x64":gF("0xd2"),"\x69\x64\x63\x78\x65":gF("0xd3"),"\x68\x6c\x64\x65\x6d":gF("0xd4"),"\x65\x65\x6d\x78\x6c":"\x69\x6c\x65","\x65\x78\x61\x61\x78":gF("0xd5"),"\x63\x61\x63\x6d\x65":gF("0xd6"),"\x64\x63\x78\x6c\x6c":function(l3,l2){return l3!==l2},"\x68\x61\x64\x65\x65":gF("0x4e"),"\x68\x68\x63\x61\x6c":function(l3,l2){return l3+l2},"\x65\x69\x64\x6d\x64":gF("0x43"),"\x65\x64\x65\x64\x63":gF("0xd7"),"\x6d\x78\x61\x61\x69":gF("0xd8"),"\x69\x6d\x78\x64\x61":gF("0xd9"),"\x68\x69\x6c\x64\x65":gF("0xda"),"\x65\x64\x6d\x64\x78":gF("0xdb"),"\x64\x64\x65\x65\x65":"\x63\x61\x6d","\x61\x78\x68\x6d\x78":"\x61\x61\x64","\x64\x64\x61\x64\x6d":gF("0xdc"),"\x6d\x61\x65\x68\x6d":gF("0xdd"),"\x69\x68\x78\x61\x64":function(l3,l2){return l3+l2},"\x69\x61\x63\x61\x64":function(l3,l2){return l3+l2},"\x69\x64\x6c\x61\x6d":gF("0xde"),"\x69\x65\x65\x61\x69":function(l3,l2){return l3+l2},"\x6c\x6d\x78\x69\x69":gF("0x84"),"\x65\x64\x68\x68\x63":gF("0xdf"),"\x64\x64\x65\x61\x69":"\x61\x64\x78","\x61\x69\x68\x61\x6d":gF("0xe0"),"\x65\x63\x61\x61\x69":gF("0xe1"),"\x6c\x6c\x64\x6d\x61":gF("0x0"),"\x68\x64\x64\x65\x65":gF("0xe2"),"\x65\x61\x61\x61\x6d":gF("0xe3"),"\x65\x78\x65\x78\x65":"\x61\x64\x61","\x63\x6c\x65\x6c\x63":function(l2){return l2()},"\x64\x63\x65\x65\x68":"\x6d\x6d\x69","\x6c\x65\x6c\x61\x64":function(l3,l2){return l3+l2},"\x78\x64\x65\x61\x63":gF("0xe4"),"\x6d\x63\x65\x64\x61":gF("0xe5"),"\x65\x65\x6d\x6d\x6d":"\x65\x69\x6d","\x61\x61\x68\x61\x6d":function(l3,l2){return l3+l2},"\x61\x69\x6c\x61\x61":gF("0xe6"),"\x6c\x65\x65\x65\x61":"\x64\x68\x61","\x6d\x6d\x78\x68\x61":"\x65\x68\x64","\x61\x6d\x6d\x61\x64":gF("0xe7")};var lU=lT[gF("0xe8")];while(lU!==lT[gF("0xe9")]){switch(lU){case lT[gF("0xea")]:if(!this[lT[gF("0xeb")]+l0]&&bS[lT[gF("0xec")]+l0]){lU=gF("0xce");break}lU=lT[gF("0xed")];break;case gF("0x43"):if(T&&this[gF("0x5a")]){lU=lT[gF("0xee")];break}lU=lT[gF("0xef")];break;case lT["\x61\x65\x63\x78\x6d"]:var lS=l1?this[gF("0x8a")][gF("0xf0")][gF("0xf1")]:![];lU="\x61\x61\x65";break;case"\x6c\x61\x61":lO[gF("0xa0")]=lW;lU="\x6d\x65\x78";break;case lT[gF("0xf2")]:this[lT["\x68\x61\x61\x65\x6c"](gF("0x32"),l0)]=JSON[gF("0xf3")](bS[lT[gF("0xf4")]("\x46\x65\x61\x74\x75\x72\x65\x53\x74\x79\x6c\x65",l0)]);lU="\x68\x65\x63";break;case gF("0xd2"):lU=T&&bS[lT["\x63\x65\x61\x65\x63"](gF("0xcf"),l0)]&&bS[lT[gF("0xf5")]+l0][lT[gF("0xf6")]]?gF("0xdd"):lT[gF("0xf7")];break;case lT[gF("0xf8")]:var lR=l0;lU=lT[gF("0xf9")];break;case gF("0xfa"):lO[gF("0x7a")](lZ);lU=lT[gF("0xe9")];break;case lT[gF("0xfb")]:this[lT[gF("0xfc")]+lR]=JSON[gF("0xf3")](bS[lT[gF("0xf4")](gF("0xfd"),lR)]);lU=lT["\x65\x65\x63\x61\x64"];break;case gF("0xfe"):if(T){lU=lT[gF("0xff")];break}lU=lT[gF("0x100")];break;case lT[gF("0x101")]:if(T&&bS[lT[gF("0xf4")](gF("0xe6"),e)]){lU=lT[gF("0x102")];break}lU=gF("0xe5");break;case lT[gF("0x103")]:var lQ=lT[gF("0x104")](this[gF("0x8a")][gF("0x105")],iV)&&this[gF("0x8a")][gF("0x6f")][gF("0x106")];lU=lT[gF("0x107")];break;case gF("0xcb"):if(!this[lT[gF("0x108")](gF("0x33"),lR)]){lU=lT[gF("0xfb")];break}lU=lT[gF("0x109")];break;case gF("0x10a"):lZ[gF("0x10b")]=this[gF("0x58")];lU=lT[gF("0x10c")];break;case"\x61\x65\x61":lO[gF("0xaa")]=lV;lU=lT[gF("0x10d")];break;case lT[gF("0x10e")]:var lP=this[gF("0x8a")][gF("0xf0")][gF("0x10f")];lU=gF("0xe1");break;case lT[gF("0x110")]:lO[gF("0x6c")]=!![];lU="\x69\x68\x61";break;case gF("0xd3"):lR="\x43\x75\x73\x74\x6f\x6d";lU=gF("0xd4");break;case gF("0xc7"):var lO=this[gF("0x111")]();lU=gF("0x112");break;case gF("0x4e"):if(this[gF("0x8a")][gF("0x113")]){lU="\x61\x64\x61";break}lU=lT[gF("0x114")];break;case"\x6d\x78\x64":lO[gF("0xae")]=lX;lU=gF("0x115");break;case lT["\x65\x64\x6d\x64\x78"]:lZ[gF("0x116")]=this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x49\x6e\x64\x6f\x6f\x72\x53\x74\x79\x6c\x65"];lU=lT["\x64\x64\x65\x65\x65"];break;case lT[gF("0x117")]:var T=!!(l0[gF("0x5e")](lT["\x64\x64\x61\x64\x6d"])===0);lU=gF("0xd1");break;case gF("0xdf"):if(!lO[gF("0x6c")]){lU=gF("0xc9");break}lU=gF("0xfa");break;case lT[gF("0x118")]:this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x49\x6e\x64\x6f\x6f\x72\x53\x74\x79\x6c\x65"]=JSON[gF("0xf3")](bS[lT[gF("0x119")](gF("0xcf"),l0)][lT["\x64\x6c\x61\x78\x64"]]);lU=gF("0x11a");break;case gF("0xe0"):this[gF("0x80")]["\x70\x75\x73\x68"](C);lU=gF("0xc8");break;case gF("0x39"):lZ[gF("0x11b")]=this[lT["\x69\x61\x63\x61\x64"]("\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x46\x65\x61\x74\x75\x72\x65\x53\x74\x79\x6c\x65",l0)];lU=gF("0xde");break;case gF("0xe5"):if(this[lT[gF("0xeb")]+l0]){lU=gF("0x39");break}lU=lT["\x69\x64\x6c\x61\x6d"];break;case lT[gF("0x100")]:if(T&&bS[gF("0xe6")+l0]&&!bS[lT[gF("0x11c")]("\x63\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f\x5f",l0)][lT[gF("0xf6")]]){lU=lT[gF("0x11d")];break}lU=lT[gF("0x11e")];break;case lT[gF("0x11f")]:if(!(T&&!this[gF("0x8a")][gF("0x6f")][gF("0x120")])){lU=gF("0xdb");break}lU=gF("0x121");break;case gF("0x46"):lZ[gF("0x122")]=this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x41\x72\x65\x61\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f"];lU=gF("0xcc");break;case"\x65\x68\x64":lZ[gF("0x123")]=e;lU=lT[gF("0x110")];break;case gF("0xe2"):var C={"\x75\x72\x6c":lY,"\x74\x69\x6c\x65\x49\x6e\x66\x6f":lX,"\x74\x69\x6c\x65\x4b\x65\x79":lW,"\x63\x62\x6b":lV};lU=lT[gF("0x124")];break;case gF("0x125"):if(!this[gF("0x58")]){lU=gF("0xe3");break}lU=lT[gF("0x101")];break;case gF("0xcc"):lZ[gF("0x126")]={"\x77\x6f\x72\x64\x53\x70\x61\x63\x65\x52\x61\x74\x69\x6f":this[gF("0x67")],"\x74\x65\x78\x74\x53\x69\x7a\x65\x52\x61\x74\x69\x6f":this[gF("0x87")]};lU=gF("0x127");break;case lT["\x65\x63\x61\x61\x69"]:lU=lO?lT[gF("0x128")]:lT["\x68\x64\x64\x65\x65"];break;case lT[gF("0x129")]:this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x43\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f"]=JSON[gF("0xf3")](bS[gF("0xe6")+l0]);lU=gF("0x12a");break;case gF("0xde"):lZ[gF("0xfd")]=this[lT[gF("0x11c")](gF("0x33"),lR)];lU=lT[gF("0x11f")];break;case lT[gF("0x12b")]:var i=this[gF("0x8a")][gF("0x113")][gF("0x12c")];lU=lT[gF("0x114")];break;case lT[gF("0xf7")]:if(!this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x49\x6e\x64\x6f\x6f\x72\x53\x74\x79\x6c\x65"]){lU=gF("0x12d");break}lU=gF("0x11a");break;case gF("0x84"):lT[gF("0x12e")](lV);lU="\x6d\x61\x65";break;case gF("0x121"):if(T&&this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x43\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f"]){lU=gF("0x10a");break}lU=lT[gF("0x10c")];break;case lT[gF("0x12f")]:var e=this[gF("0x8a")][gF("0x130")]();lU=lT[gF("0x117")];break;case"\x69\x6c\x68":this[gF("0x5a")]=JSON[gF("0xf3")](bS[lT[gF("0x131")](gF("0xe6"),e)]);lU=gF("0xe5");break;case"\x65\x78\x78":var l1=this[gF("0x8a")][gF("0xf0")][gF("0x132")];lU="\x68\x65\x69";break;case"\x61\x6d\x6d":if(!this[gF("0x5a")]){lU=lT[gF("0x133")];break}lU=lT[gF("0x134")];break;case lT[gF("0x135")]:if(T&&bS[lT[gF("0x136")](lT[gF("0x137")],l0)]&&bS[lT[gF("0x137")]+l0][gF("0x138")]){lU=lT[gF("0x139")];break}lU=lT[gF("0x101")];break;case"\x61\x64\x68":lZ[gF("0x13a")]=l0;lU=lT[gF("0x13b")];break;case lT[gF("0x13c")]:var l0=this[gF("0x8a")][gF("0x13d")]();lU=gF("0x13e");break;case"\x64\x69\x61":this["\x73\x74\x72\x69\x6e\x67\x69\x66\x69\x65\x64\x49\x6e\x64\x6f\x6f\x72\x53\x74\x79\x6c\x65"]=JSON[gF("0xf3")](bS[gF("0x13f")]);lU=lT["\x65\x65\x6d\x6d\x6d"];break;case gF("0xda"):var lZ={"\x61\x63\x74\x69\x6f\x6e":gF("0xb9"),"\x75\x72\x6c":lY,"\x74\x69\x6c\x65\x49\x6e\x66\x6f":lX,"\x74\x69\x6c\x65\x4b\x65\x79":lW,"\x69\x73\x54\x65\x78\x74":lS,"\x69\x73\x50\x6f\x69":l1,"\x62\x75\x69\x6c\x64\x69\x6e\x67\x53\x69\x64\x65\x47\x72\x61\x64\x61\x74\x69\x6f\x6e":lP,"\x68\x61\x73\x50\x6f\x6c\x79":lQ?![]:!![],"\x68\x61\x73\x4c\x69\x6e\x65":lQ?this["\x6d\x61\x70"][gF("0x6f")][gF("0x140")]:!![],"\x63\x61\x72\x70\x6f\x72\x74":i,"\x69\x73\x45\x6e":this[gF("0x8a")][gF("0xf0")]["\x69\x73\x45\x6e"],"\x6c\x61\x6e\x67\x75\x61\x67\x65":this[gF("0x8a")]["\x5f\x64\x69\x73\x70\x6c\x61\x79\x4f\x70\x74\x69\x6f\x6e\x73"][gF("0x141")]||"\x7a\x68","\x72\x65\x66\x65\x72\x72\x65\x72":window[gF("0x142")][gF("0x143")]};lU=lT[gF("0x13c")];break}}},"\x73\x65\x74\x57\x6f\x72\x6b\x65\x72\x43\x6f\x6e\x66\x69\x67":function(C){var i={"\x69\x63\x61\x65\x69":function(lQ,lP){return lQ1){for(var e=1;e0&&this.map.customLoaded&&this.map.areaCustomLoaded){this.loadLayersData()}else{if(C.baseLayer){var T=this;this.map.loadMapStyleFiles(function(){var i=new gC("onlayer_update");i.name="na";T.map.fire(i);T.loadLayersData()})}}},removeWebGLLayer:function(lP){var lQ=false;for(var lO=0,T=this.tileLayers.length;lO0){this.loadLayersData()}if(this.tileLayers.length===1){this.map.setDisplayOptions({isFlat:false})}else{var e=false;for(var lO=1;lO50);if(!e){if(!this.syncLoadTimer){this.syncLoadTimer=setTimeout(function(){lO._loadLayersFromCache(T);lO.syncLoadTimer=null},40)}}else{this._loadLayersFromCache(T)}if(!lO.map.viewAnimationTime){this.timer&&window.clearTimeout(this.timer)}if(!this.requestTime){this.requestTime=new Date().getTime()}else{if(new Date().getTime()-this.requestTime>=1000){C()}}function C(){if(!lO.map){return}if(lO.map.viewAnimationTime){if(new Date().getTime()-lO.map.viewAnimationTime<1000){return}lO.map.viewAnimationTime=new Date().getTime()}var lQ=lO.tileLayers.length;lO.tilesInfoCache={};for(var lS=0;lS0});var C=lS.length;this.tilesInfoCache={};for(var lO=0;lOfO._mc180X){var lY=fO.getSpaceDistanceInPixel(lQ);mh=Math.ceil(lY/lP)}if(ma.sw.lng19505879.362428114||ma.sw.lat<-15949096.637571886){ma.ne.lat=19505879.362428114;ma.sw.lat=-15949096.637571886}var lU=[Math.floor(ma.sw.lng/l4)-C,Math.floor(ma.sw.lat/l4)];var mt=[Math.floor(ma.ne.lng/l4)+mh,Math.floor(ma.ne.lat/l4)];l3=lU[0]-md.config.extendTiles;ml=mt[0]+1+md.config.extendTiles;mb=lU[1]-md.config.extendTiles;mo=mt[1]+1+md.config.extendTiles;var lZ=[];for(var lW=l3;lW=0?lW-lR:lW+lR;var l7="id_"+l5+"_"+l1+"_"+lQ;if(fO.isTileBlank(l5,lQ,lP)===true){continue}if(!lZ[l7]){var mq=false;var lV=256;if(mv==="web"){var l6=this._webTileRaste180(l5,l1,lQ);mq=l6.combine;lV=l6.dataIndex}var lX={col:l5,row:l1,zoom:lQ,useZoom:mm,loopOffsetX:0,tileSize:mc,baseTileSize:lP,mercatorSize:l4,combine:mq,dataIndex:lV};lZ.push(lX);lZ[l7]=true}}}if(this.map._tilt>0&&(mv!=="web"||l8>=8)){for(var ms=0;ms0&&l2.x0&&l2.ymf.lng&&mg.minYmf.lat){continue}if(!this.ifTileInMapBounds(mg,ma,mn,mu)){lZ.splice(ms,1);ms--}}}lZ.sort((function(i){return function(T,mw){return((0.4*Math.abs(T.col-i[0])+0.6*Math.abs(T.row-i[1]))-(0.4*Math.abs(mw.col-i[0])+0.6*Math.abs(mw.row-i[1])))}})([l9,lS]));lZ.zoom=lQ;lZ.tileTypeName=mv;return lZ},_webTileRaste180:function(C,lS,e){var i=this.map;var lP=false;var lQ=256;var lO=fO.calcLoopParam(C,e);var lR={col:lO.col,row:lS,baseTileSize:256,zoom:e};var T=kz.prototype.tileToBound(lR,i.getCenter());if(Math.ceil(T.LL.sw.lng)*Math.floor(T.LL.ne.lng)<0){lP=true;lQ=fO.pixelWidth(T.MC.sw.lng,e);if(lR.col<0){lQ=-lQ}}return{combine:lP,dataIndex:lQ}},calcXYZTilesInfo:function(lY,lR,lX,l2,lQ,l5){var lT=l5.width;var l3=l5.height;var lS=Math.floor(lX);var lU=null;if(lQ.transform.target==="EPSG3857"){var T=ef.transformBDmcPoint(lY,lQ.transform);var lO=ef.getRangeExtent(T,lT,l3,lS,lQ.transform);lU=[lO.minX,lO.minY,lO.maxX,lO.maxY]}else{if(lQ.transform.source==="BD09MC"){var T=[lY.lng,lY.lat];lU=[lR.sw.lng,lR.sw.lat,lR.ne.lng,lR.ne.lat]}else{var T=ef.transformBDmcPoint(lY,lQ.transform);var lP=ef.transformBDmcPoint(lR.ne,lQ.transform);var lW=ef.transformBDmcPoint(lR.sw,lQ.transform);lU=ef.getLoopBox(T,[lW[0],lW[1],lP[0],lP[1]])}}if(!T||!lU){return[]}lS=lS+lQ.spanLevel;var C=ef.getTileRangeForExtentFactory(lU,lS,lQ.transform);var e=[];var l6=ef.getResolutionScale(lS,lQ.transform);for(var l1=C.minX;l1<=C.maxX;l1++){for(var lZ=C.minY;lZ<=C.maxY;lZ++){var l0={col:l1,row:lZ,zoom:lS,useZoom:lS,tileTypeName:l2,loopOffsetX:0,tileSize:256*l6,transform:lQ.transform,combine:false,dataIndex:0};e.push(l0);var lV="id_"+l1+"_"+lZ+"_"+lS;e[lV]=true}}var l4=ef.getTileCoordForCoordAndZ(T,lS);e.sort((function(i){return function(l7,l8){return((0.4*Math.abs(l7.col-i[0])+0.6*Math.abs(l7.row-i[1]))-(0.4*Math.abs(l8.col-i[0])+0.6*Math.abs(l8.row-i[1])))}})([l4[1],l4[2]]));e.zoom=lS;e.tileTypeName=l2;return e},getCurrentViewTilesInfo:function(C,T){var i=this._getTilesInfoKey(C,T);var e=this.tilesInfoCache[i];if(!e){return this.calcTilesInfo(C,T)}return e},ifTileInMapBounds:function(e,lP,C,lO){var i=lP.normalizedBottomLeft;var l0=lP.normalizedTopRight;var lS=lP.normalizedTopLeft;var lQ=lP.normalizedBottomRight;var T=false;var lZ=new c4(e.minX,e.minY);var lW=new c4(e.maxX,e.maxY);var lR=new c4(lW.lng,lZ.lat);var lX=new c4(lZ.lng,lW.lat);var lU=[lX,lW,lR,lZ];for(var lY=0,lT=lU.length;lY0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState}});function jT(e){this.map=e;this.gl=null;this.layers=[];this.mouseEventThrottle=this.throttle(this.pick,100).bind(this);this.mousePointerThrottle=this.throttle(this.mouseStatus,300).bind(this);this.base=new c4(12069475.280738307,3929271.1724863998);this.iconCache=new aK((cl()||fK.Browser.ie)?64:128,{clearCallback:function(i){}});this._boundMouseEvent=this._layerMouseEvent.bind(this);this._boundClickEvent=this._layerClickEvent.bind(this);this._boundDBLClickEvent=this._layerDBLClickEvent.bind(this);this._boundRightClickEvent=this._layerRightClickEvent.bind(this)}bS.register(function(i){if(i._renderType!=="webgl"){return}var e=i._normalLayerMgr=new jT(i);i.toFormatCoords=function(lP,lS){var lR=[];var lQ=e.base;if(lS&&lS.center){lQ=kz.convertLL2MC(lS.center)}for(var lO=0;lO0})},_layerMouseEvent:function(i){this.mouseEventThrottle(i,"onmousemove")},_layerClickEvent:function(i){this.pick(i,"onclick")},_layerDBLClickEvent:function(i){this.pick(i,"ondblclick")},_layerRightClickEvent:function(i){this.pick(i,"onrightclick")},throttle:function(C,e){var T=null;var i=Date.now();return function(){var lR=Date.now();var lQ=e-(lR-i);var lP=this;var lO=arguments;if(T){clearTimeout(T)}if(lQ<=0){C.apply(lP,lO);i=Date.now()}else{T=setTimeout(function(){C.apply(lP,lO)},lQ)}}},pick:function(lS,lQ){if(!this.layers.length){return false}var T=false;var C=false;for(var lP=this.layers.length-1;lP>=0;lP--){var lO=this.layers[lP];if(lO.doRender()&&lO.testEvent(lQ)){C=true;if(lO.pick){if(lQ==="onmousemove"||lO.hasEvent(lQ)){var lR=lO.pick(lS.x,lS.y,lQ)}else{continue}if(lR&&lR.dataIndex!==-1){if(lQ==="onmousemove"){T=true}if(lO.hasEvent(lQ)){lO.dispatcher(lS,lR,lQ)}if(!lO.popEvent){break}}else{if(lO.hasEvent(lQ)){lO.dispatcher(lS,lR,lQ)}}}}}if(lQ==="onmousemove"&&C){this.mousePointerThrottle(T)}this.map.dispatchEvent(new gC("onupdate"))},mouseStatus:function(e){if(e){this.map.platform.style.cursor=this.map.config.overlayMoveCursor}else{this.map.platform.style.cursor=this.map.config.defaultCursor}},saveFramebuffer:function(){var e=this.gl;this.preFramebuffer=e.getParameter(e.FRAMEBUFFER_BINDING)},bindFramebuffer:function(e){var i=this.gl;if(e){i.bindFramebuffer(i.FRAMEBUFFER,e)}else{i.bindFramebuffer(i.FRAMEBUFFER,null)}},clear:function(e){var i=this.gl;i.clearColor(0,0,0,0);if(e instanceof Array){i.clearColor(e[0],e[1],e[2],e[3])}i.clear(i.COLOR_BUFFER_BIT|i.DEPTH_BUFFER_BIT)},restoreFramebuffer:function(){var i=this.gl;if(this.map&&this.map._webglPainter){var e=this.map._webglPainter.background||[1,1,1,1];i.clearColor(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}i.bindFramebuffer(i.FRAMEBUFFER,this.preFramebuffer)},clearFramebuffer:function(){if(this.pickFBO){var e=this.gl;e.deleteTexture(this.pickFBO.texture);e.deleteFramebuffer(this.pickFBO)}},createFramebuffer:function(T,i){var lR=this.gl;T=T||lR.canvas.width;i=i||lR.canvas.height;var lP=lR.createFramebuffer();var lO=lR.createTexture();lR.bindTexture(lR.TEXTURE_2D,lO);lR.texImage2D(lR.TEXTURE_2D,0,lR.RGBA,T,i,0,lR.RGBA,lR.UNSIGNED_BYTE,null);lR.texParameteri(lR.TEXTURE_2D,lR.TEXTURE_MAG_FILTER,lR.LINEAR);lR.texParameteri(lR.TEXTURE_2D,lR.TEXTURE_MIN_FILTER,lR.LINEAR);lR.texParameteri(lR.TEXTURE_2D,lR.TEXTURE_WRAP_S,lR.CLAMP_TO_EDGE);lR.texParameteri(lR.TEXTURE_2D,lR.TEXTURE_WRAP_T,lR.CLAMP_TO_EDGE);lP.texture=lO;var C=lR.createRenderbuffer();lR.bindRenderbuffer(lR.RENDERBUFFER,C);lR.renderbufferStorage(lR.RENDERBUFFER,lR.DEPTH_STENCIL,T,i);lP.depthBuffer=C;lR.bindFramebuffer(lR.FRAMEBUFFER,lP);lR.framebufferTexture2D(lR.FRAMEBUFFER,lR.COLOR_ATTACHMENT0,lR.TEXTURE_2D,lO,0);lR.framebufferRenderbuffer(lR.FRAMEBUFFER,lR.DEPTH_STENCIL_ATTACHMENT,lR.RENDERBUFFER,C);var lQ=lR.checkFramebufferStatus(lR.FRAMEBUFFER);if(lR.FRAMEBUFFER_COMPLETE!==lQ){console.log("Frame buffer object is incomplete: "+lQ.toString());this._clearBuffer(lR);return}this._clearBuffer(lR);return lP},_clearBuffer:function(e){e.bindFramebuffer(e.FRAMEBUFFER,null);e.bindTexture(e.TEXTURE_2D,null);e.bindRenderbuffer(e.RENDERBUFFER,null)},loadIconImages:function(T,lU){var lV=T;var lW=lV.length;var lQ=this;var C=0;var lT=200;for(var lO=0;lO80*ml){mg=me=mk[0];mf=md=mk[1];for(var mj=ml;mjme){me=ms}if(mq>md){md=mq}}mt=Math.max(me-mg,md-mf)}C(mo,mh,ml,mg,mf,mt,null,mm);return mh}function l8(mh,mj,md,mi,me){var mf;var mg;if(me===(mc(mh,mj,md,mi)>0)){for(mf=mj;mf=mj;mf-=mi){mg=lQ(mf,mh[mf],mh[mf+1],mg)}}if(mg&&lW(mg,mg.next)){l4(mg);mg=mg.next}return mg}function l0(mg,md){if(!mg){return mg}if(!md){md=mg}var mf=mg;var me;do{me=false;if(!mf.steiner&&(lW(mf,mf.next)||l6(mf.prev,mf,mf.next)===0)){l4(mf);mf=md=mf.prev;if(mf===mf.next){return null}me=true}else{mf=mf.next}}while(me||mf!==md);return md}function C(me,mg,mj,mh,md,mn,mm,mk){if(!me){return}if(!mm&&mn){lV(me,mh,md,mn)}var ml=me;var mf;var mi;while(me.prev!==me.next){mf=me.prev;mi=me.next;if(mn?mb(me,mh,md,mn):l3(me)){mg.push(mf.i/mj+mk);mg.push(me.i/mj+mk);mg.push(mi.i/mj+mk);l4(me);me=mi.next;ml=mi.next;continue}me=mi;if(me===ml){if(!mm){C(l0(me),mg,mj,mh,md,mn,1,mk)}else{if(mm===1){me=lZ(me,mg,mj,mk);C(me,mg,mj,mh,md,mn,2,mk)}else{if(mm===2){lY(me,mg,mj,mh,md,mn,mk)}}}break}}}function l3(mf){var me=mf.prev;var md=mf;var mh=mf.next;if(l6(me,md,mh)>=0){return false}var mg=mf.next.next;while(mg!==mf.prev){if(lX(me.x,me.y,md.x,md.y,mh.x,mh.y,mg.x,mg.y)&&l6(mg.prev,mg,mg.next)>=0){return false}mg=mg.next}return true}function mb(mi,mj,mh,mp){var mm=mi.prev;var ml=mi;var mk=mi.next;if(l6(mm,ml,mk)>=0){return false}var mq=mm.xml.x?(mm.x>mk.x?mm.x:mk.x):(ml.x>mk.x?ml.x:mk.x);var mf=mm.y>ml.y?(mm.y>mk.y?mm.y:mk.y):(ml.y>mk.y?ml.y:mk.y);var me=e(mq,mn,mj,mh,mp);var mo=e(mg,mf,mj,mh,mp);var md=mi.nextZ;while(md&&md.z<=mo){if(md!==mi.prev&&md!==mi.next&&lX(mm.x,mm.y,ml.x,ml.y,mk.x,mk.y,md.x,md.y)&&l6(md.prev,md,md.next)>=0){return false}md=md.nextZ}md=mi.prevZ;while(md&&md.z>=me){if(md!==mi.prev&&md!==mi.next&&lX(mm.x,mm.y,ml.x,ml.y,mk.x,mk.y,md.x,md.y)&&l6(md.prev,md,md.next)>=0){return false}md=md.prevZ}return true}function lZ(mj,mf,mi,mh){var mg=mj;do{var me=mg.prev;var md=mg.next.next;if(!lW(me,md)&&i(me,mg,mg.next,md)&&l7(me,md)&&l7(md,me)){mf.push(me.i/mi+mh);mf.push(mg.i/mi+mh);mf.push(md.i/mi+mh);l4(mg);l4(mg.next);mg=mj=md}mg=mg.next}while(mg!==mj);return mg}function lY(md,mf,mh,mg,me,mm,mi){var ml=md;do{var mk=ml.next.next;while(mk!==ml.prev){if(ml.i!==mk.i&&l5(ml,mk)){var mj=lU(ml,mk);ml=l0(ml,ml.next);mj=l0(mj,mj.next);C(ml,mf,mh,mg,me,mm,null,mi);C(mj,mf,mh,mg,me,mm,null,mi);return}mk=mk.next}ml=ml.next}while(ml!==md)}function l2(mf,mm,mi,mh){var mj=[];var mg;var mk;var md;var me;var ml;for(mg=0,mk=mm.length;mg=me.next.y){var mm=me.x+(mi-me.y)*(me.next.x-me.x)/(me.next.y-me.y);if(mm<=mj&&mm>mg){mg=mm;if(mm===mj){if(mi===me.y){return me}if(mi===me.next.y){return me.next}}mf=me.x=me.x&&me.x>=mp&&lX(mimf.x))&&l7(me,md)){mf=me;mo=mk}}me=me.next}return mf}function lV(mh,md,mg,me){var mf=mh;do{if(mf.z===null){mf.z=e(mf.x,mf.y,md,mg,me)}mf.prevZ=mf.prev;mf.nextZ=mf.next;mf=mf.next}while(mf!==mh);mf.prevZ.nextZ=null;mf.prevZ=null;lO(mf)}function lO(mj){var mg;var mf;var me;var mi;var mk;var md;var ml;var mh;var mm=1;do{mf=mj;mj=null;mk=null;md=0;while(mf){md++;me=mf;ml=0;for(mg=0;mg0||(mh>0&&me)){if(ml===0){mi=me;me=me.nextZ;mh--}else{if(mh===0||!me){mi=mf;mf=mf.nextZ;ml--}else{if(mf.z<=me.z){mi=mf;mf=mf.nextZ;ml--}else{mi=me;me=me.nextZ;mh--}}}if(mk){mk.nextZ=mi}else{mj=mi}mi.prevZ=mk;mk=mi}mf=me}mk.nextZ=null;mm*=2}while(md>1);return mj}function e(me,mh,md,mg,mf){me=32767*(me-md)/mf;mh=32767*(mh-mg)/mf;me=(me|(me<<8))&16711935;me=(me|(me<<4))&252645135;me=(me|(me<<2))&858993459;me=(me|(me<<1))&1431655765;mh=(mh|(mh<<8))&16711935;mh=(mh|(mh<<4))&252645135;mh=(mh|(mh<<2))&858993459;mh=(mh|(mh<<1))&1431655765;return me|(mh<<1)}function lR(mf){var me=mf;var md=mf;do{if(me.x=0&&(mh-mf)*(mi-me)-(mj-mf)*(mg-me)>=0&&(mj-mf)*(mk-me)-(md-mf)*(mi-me)>=0}function l5(me,md){return me.next.i!==md.i&&me.prev.i!==md.i&&!l1(me,md)&&l7(me,md)&&l7(md,me)&&T(me,md)}function l6(mf,me,md){return(me.y-mf.y)*(md.x-me.x)-(me.x-mf.x)*(md.y-me.y)}function lW(me,md){return me.x===md.x&&me.y===md.y}function i(mf,md,me,mg){if((lW(mf,md)&&lW(me,mg))||(lW(mf,mg)&&lW(me,md))){return true}return l6(mf,md,me)>0!==l6(mf,md,mg)>0&&l6(me,mg,mf)>0!==l6(me,mg,md)>0}function l1(me,md){var mf=me;do{if(mf.i!==me.i&&mf.next.i!==me.i&&mf.i!==md.i&&mf.next.i!==md.i&&i(mf,mf.next,me,md)){return true}mf=mf.next}while(mf!==me);return false}function l7(me,md){return l6(me.prev,me,me.next)<0?l6(me,md,me.next)>=0&&l6(me,me.prev,md)>=0:l6(me,md,me.prev)<0||l6(me,me.next,md)<0}function T(mf,me){var mi=mf;var md=false;var mh=(mf.x+me.x)/2;var mg=(mf.y+me.y)/2;do{if(((mi.y>mg)!==(mi.next.y>mg))&&(mh<(mi.next.x-mi.x)*(mg-mi.y)/(mi.next.y-mi.y)+mi.x)){md=!md}mi=mi.next}while(mi!==mf);return md}function lU(mf,me){var md=new ma(mf.i,mf.x,mf.y);var mg=new ma(me.i,me.x,me.y);var mi=mf.next;var mh=me.prev;mf.next=me;me.prev=mf;md.next=mi;mi.prev=md;mg.next=md;md.prev=mg;mh.next=mg;mg.prev=mh;return mg}function lQ(me,md,mh,mf){var mg=new ma(me,md,mh);if(!mf){mg.prev=mg;mg.next=mg}else{mg.next=mf.next;mg.prev=mf;mf.next.prev=mg;mf.next=mg}return mg}function l4(md){md.next.prev=md.prev;md.prev.next=md.next;if(md.prevZ){md.prevZ.nextZ=md.nextZ}if(md.nextZ){md.nextZ.prevZ=md.prevZ}}function ma(me,md,mf){this.i=me;this.x=md;this.y=mf;this.prev=null;this.next=null;this.z=null;this.prevZ=null;this.nextZ=null;this.steiner=false}lT.deviation=function(mi,mn,mk,mf){var ml=mn&&mn.length;var mh=ml?mn[0]*mk:mi.length;var me=Math.abs(mc(mi,0,mh,mk));if(ml){for(var mj=0,mm=mn.length;mj0){mf+=mh[mg-1].length;md.holes.push(mf)}}return md};return lT})();function da(i,e){this.id=gZ();this.workerPool=i;this.actors=[];this.currentActorIndex=0;this.ready=false;this.init(e)}da.prototype.init=function(lP){const e=this.workerPool.acquire(this.id);for(var T=0;T"){this.setBusy(false);const lQ=this.callbacks[lR];delete this.callbacks[lR];if(lQ){if(lO.error){lQ(jr(lO.error))}else{lQ(null,jr(lO.data))}}}else{var C=this;const i=[];const e=lO.hasCallback?function(lS,lT){C.target.postMessage({id:lR,action:"",sourceMapId:C.mapId,error:lS?kV(lS):null,data:kV(lT,i)},i)}:function(lS){};const lP=jr(lO.data);if(this.parent[lO.action]){this.parent[lO.action](lO.sourceMapId,lP,e)}}};kT.prototype.send=function(i,C,lQ,T,lO,lR){if(i==="release"){this.releasePendingData(C,lQ);return}if(this.busy){this.taskQueue.push({action:i,data:C,callback:lQ,targetMapId:T,mustQueue:lO,callbackMetadata:lR});return}this.setBusy(true);var lP=Math.round((Math.random()*1000000000000000000)).toString(36).substring(0,10);const e=this.mapId+"_"+i+"_"+lP;if(lQ){lQ.metadata=lR;this.callbacks[e]=lQ}const lS=[];this.target.postMessage({id:e,action:i,hasCallback:!!lQ,targetMapId:T,mustQueue:lO,sourceMapId:this.mapId,data:kV(C,lS)},lS);return{cancel:function(){if(lQ){delete this.callbacks[e]}this.target.postMessage({id:e,action:"",targetMapId:T,sourceMapId:this.mapId})}}};kT.prototype.stop=function(){this.taskQueue.length=0;this.busy=false;this.callbacks={}};kT.prototype.remove=function(){this.taskQueue.length=0;this.busy=false;this.target.removeEventListener("message",this.receive,false)};kT.prototype.releasePendingData=function(e,lQ){var C=[];var lO=this.taskQueue;for(var T=lO.length-1;T>=0;T--){var lP=lO[T]["data"];if(!lP||!lP.layerId){break}if(lP.layerId!==e.layerId){continue}if(!e["id_"+lP.x+"_"+lP.y+"_"+lP.z]){lO.splice(T,1);C.push(lP)}}lQ(null,C)};var lE;function it(){if(!lE){lE=new iz()}return lE}function iz(){this.active={}}iz.prototype.acquire=function(i){if(!this.workers){this.workers=[];var C=(window.location.protocol === "http:" ? "http:" : "https:") + "//mapopen.bj.bcebos.com/cms/bmapgltest/worker_mvt_tq1cg1.js";while(this.workers.length=e._autoEnterZoom){e._checkIndoorByMove()}});i.on("zoomend",function(){if(this.getZoom()>=e._autoEnterZoom){e._checkIndoorByMove()}else{if(e.enterMethod!=="byClick"&&e.currentUid!==null){this.showIndoor(null)}}})};dG.prototype._checkIndoorByMove=function(){var C=this._map;var lT=C.getSize();var lY={x:lT.width/2,y:lT.height/2};var lX=Math.max(lT.width,lT.height);var lZ=[];for(var lU in this._indoorData){var e=this._indoorData[lU].center;var T=C.pointToPixelIn(new bS.Point(e[0],e[1]));var lQ=cL(lY,T);lZ.push({uid:lU,distance:lQ})}if(lZ.length===0){return}lZ.sort(function(l0,i){return l0.distance-i.distance});var lP=lZ[0];var lV=C.getCenterIn();var lO=false;for(var lS=0;lSlR[0]&&lV.lat>lR[1]&&lV.lng=this._autoEnterZoom){this._checkIndoorByMove()}};dG.prototype.removeData=function(C,lO){if(!this._indoorData[C]){return}var T=this._indoorData[C];for(var e=0;e21){l8=21}if(l1){lZ=lV(l4,l5,l8,l1)}else{lZ=C(l4,l5,l8,l7)}var l3=lZ.drawId;var lY=lZ.style;var l6=lZ.styleUpdate;var l9=[];if(!l3){return l9}for(var l0=0;l0>>0}}function lR(lZ,lX){var lY=null;if(lZ[lZ.length-1]&&lZ[lZ.length-1] instanceof Array&&lZ[lZ.length-1][0]==="openmap"){lY=lZ[lZ.length-1][1]?lZ[lZ.length-1][1]:null}return{sid:lX,borderRgba:i(lZ[0]),fillRgba:i(lZ[1]),borderWidth:lZ[2],fillWidth:lZ[3],borderCap:lZ[4],fillCap:lZ[5],haveBorderLine:lZ[6],haveBorderTexture:lZ[7],haveFillTexture:lZ[8],isUseBorderRgba:lZ[9],isUseFillRgba:lZ[10],borderTexture:lZ[11],fillTexture:lZ[12],borderTextureType:lZ[13],fillTextureType:lZ[14],isRealWidth:lZ[15],haveArrow:lZ[16],needRound:lZ[17],realBorderWidth:lZ[18],hue:i(lY)}}function lO(lZ,lX){var lY=null;var l0=null;if(lZ[lZ.length-1]&&lZ[lZ.length-1] instanceof Array&&lZ[lZ.length-1][0]==="openmap"){lY=lZ[lZ.length-1][1]?lZ[lZ.length-1][1]:null;l0=lZ[lZ.length-1][2]?lZ[lZ.length-1][2]:null}return{sid:lX,fillRgba:i(lZ[0]),borderRgba:i(lZ[1]),borderWidth:lZ[2],borderTexture:lZ[3],borderTextureType:lZ[4],waterStyle:lZ[5],haloStyle:lZ[6],textureStyle:lZ[7],thickRgba:i(lZ[8]),fillTexture:l0,hue:i(lY)}}function lQ(lY,lX){return{sid:lX,filter:lY[0],ratio:lY[1],haveBorder:lY[2],borderWidth:lY[3],borderRgba:i(lY[4]),fillTop:i(lY[5]),fillSide:i(lY[6]),polyTexture:lY[7]}}function i(l2){var l1=l2;if(lS[l1]){return lS[l1]}l2=l2>>>0;var l0=(l2)&255;var lZ=(l2>>8)&255;var lX=(l2>>16)&255;var lY=(l2>>24)&255;lS[l1]=[l0,lZ,lX,lY];return lS[l1]}return{getStyleFromCache:function(l4,lZ,l2,l3,lY,l1,lX){l4=l4||"default";var l0=l4+"-"+lZ+"-"+l2+"-"+l3;if(l1){l0+="-indoor"}if(lY){if(!lW[l0]){lW[l0]=lT(lZ,l2,l3,lY)}return lW[l0]}if(!T[l0]){T[l0]=lT(lZ,l2,l3,lY,lX)}return T[l0]},clearStyleFromCache:function(){T={};lW={}}}})();bS.register(function(i){var e=new jq(i)});function jq(e){e.container.appendChild(this.render());this.bind(e)}jq.prototype.render=function(){var i=document.createElement("div");i.className="click-ripple-container";var e=document.createElement("div");e.className="click-ripple";i.appendChild(e);this._div=i;this._ripple=e;return i};jq.prototype.bind=function(i){var e=this;i.addEventListener("spotclick",function(C){if(!C.spots||C.spots.length===0){return}e._div.style.left=C.pixel.x+"px";e._div.style.top=C.pixel.y+"px";fK.ac(e._ripple,"ripple-playing")});i.addEventListener("hotclick",function(C){if(!C||!C.pixel||!(C.pixel instanceof f8)){return}e._div.style.left=C.pixel.x+"px";e._div.style.top=C.pixel.y+"px";fK.ac(e._ripple,"ripple-playing")});fK.on(e._ripple,"transitionend",function(){fK.rc(e._ripple,"ripple-playing")})};function cj(e){dH.call(this);if(!e){return}this._opts={};this._map=e;this._maxLat=84.6;this._minLat=-80.6;this._maxLatMC=kz.convertLL2MC(new cX(this._maxLat,0)).lat;this._minLatMC=kz.convertLL2MC(new cX(this._minLat,0)).lat}cj.inherits(dH,"ToolbarItem");fK.extend(cj.prototype,{open:function(){if(this._isOpen==true){return true}if(this._map._toolInUse){return false}this._map._toolInUse=true;this._isOpen=true;return true},close:function(){if(!this._isOpen){return}this._map._toolInUse=false;this._isOpen=false},_checkStr:function(e){if(!e){return""}return e.replace(//g,">")}});function cH(C,i){cj.call(this,C);i=i||{};this._opts=fK.extend(fK.extend(this._opts||{},{autoClear:false,tips:"测距",followText:"单击确定起点,双击结束绘制",unit:"metric",showResult:true,lineColor:"blue",lineStroke:2,opacity:1,lineStyle:"solid",cursor:G.distCursor,styleCodes:{lnCode:0,spCode:0,slCode:0,tlCode:0},enableMassClear:true}),i);if(this._opts.showResult===false){if(typeof i.tips==="undefined"){this._opts.tips="绘制折线"}if(!i.cursor){this._opts.cursor="crosshair"}}if(this._opts.lineStroke<=0){this._opts.lineStroke=2}if(this._opts.opacity>1){this._opts.opacity=1}else{if(this._opts.opacity<0){this._opts.opacity=0}}if(this._opts.lineStyle!=="solid"&&this._opts.lineStyle!=="dashed"){this._opts.lineStyle="solid"}this._checked=false;this._drawing=null;this.followTitle=null;this._totalDis={};this._points=[];this._paths=[];this._dots=[];this._segDistance=[];this._overlays=[];this._units={metric:{name:"metric",conv:1,incon:1000,u1:"米",u2:"公里"},us:{name:"us",conv:3.2808,incon:5279.856,u1:"英尺",u2:"英里"}};if(!this._units[this._opts.unit]){this._opts.unit="metric"}this._dLineColor="#ff6319";this._dLineStroke=3;this._dOpacity=0.8;this._dLineStyle="solid";this._dCursor=G.distCursor;if(this._opts.showResult){this._opts.followText="单击确定起点"}this._followTextM="单击确定地点,双击结束";this._sectionMarkerTip="单击可删除此点,拖拽可调整位置";this._movingTimerId=null;if(this._opts.showResult){this.text="测距"}else{this.text="绘线"}this._isOpen=false;var e=this;h6.load("tools",function(){e._draw()})}cH.inherits(cj,"PolylineTItem");fK.extend(cH.prototype,{setLineColor:function(e){this._opts.lineColor=e},setLineStroke:function(e){if(Math.round(e)>0){this._opts.lineStroke=Math.round(e)}},setOpacity:function(e){if(e>=0&&e<=1){this._opts.opacity=e}},setLineStyle:function(e){if(e==="solid"||e==="dashed"){this._opts.lineStyle=e}},clear:function(){for(var C=0,e=this._overlays.length;ClT){C-=lP;lR-=this._loopOffset}while(Cthis._mc180X){e-=this._mcTSpan}while(ethis._mc180X){i.lng-=this._mcTSpan;e-=this._mcTSpan;lO-=this._mcTSpan}while(i.lng=lU){var lT=T+lW;if(this.isTileBlank(lT,e,lZ)===true){continue}var C="id_"+lT+"_"+l0+"_"+e;if(!lV[C]){lV[C]=true;lX.push([lT,l0,e,0])}}else{if(T<=lQ){var lT=T-lW;if(this.isTileBlank(lT,e,lZ)===true){continue}var C="id_"+lT+"_"+l0+"_"+e;if(!lV[C]){lV[C]=true;lX.push([lT,l0,e,0])}}}}for(var lR=0,lP=lX.length;lR=0;lR--){var T=lV[lR][0];if(this.isTileBlank(T,e,lZ)){lV.splice(lR,1)}}return lV},isTileBlank:function(C,lO,e){var lP=Math.pow(2,lO-3);var i=Math.round(this._validPixels*lP);var T=6*lP*256/e;while(C>T/2-1){C-=T}while(C<-(T/2)){C+=T}if(C>0&&C*e>i){return true}if(C<0&&Math.abs((C+1)*e)>i){return true}return false},isAddWidth:function(e,i){return ethis._mc180X},pixelWidth:function(e,i){if(e<0){e=-e}return Math.abs(e-this._mc180X)/(Math.pow(2,18-i))},getSpaceDistanceInPixel:function(i){var e=Math.round((this._spaceDistance+this._mSpaceDistance)/Math.pow(2,18-i));return e}};var fO=new bZ();function e7(){this._id=undefined;this._type=undefined;this.grid=undefined;this.layerName=undefined;this.geojson=undefined;this._geometry=null;this._properties={};this._box=null;this._state={};this._style=null;this._visible=true;this.renderData={};return this}e7.prototype.serialize=function(){return{id:this.getId(),type:this.getType(),grid:this.grid,layerName:this.layerName,geojson:this.geojson,renderData:this.renderData,geometry:this.getGeometry(),box:this.getBox(),properties:this.getProperties(),state:this.getState(),visible:this._visible}};e7.prototype.deserialize=function(lO){this.setId(lO.id);this.setType(lO.type);this.grid=lO.grid;this.layerName=lO.layerName;this.geojson=lO.geojson;this.setProperties(lO.properties);this.setState(lO.state);this._visible=lO.visible||true;this.renderData=lO.renderData;this.setGeometry(lO.geometry);this.setBox(lO.box);if(this.geojson.geometry&&this.geojson.geometry["type"]==="MultiPolygon"){for(var C=0;C0){return this._state}else{return null}};e7.prototype.getStyle=function(){return this._style};e7.prototype.getStyleFunction=function(){return this._styleFunction};e7.prototype.setType=function(e){return this._type=e};e7.prototype.setGeometry=function(e){this._geometry=e};e7.prototype.setStyle=function(e){if(!e||Object.keys(e).length===0){return}for(var i in e){this.set(i,e[i],this._style)}};e7.prototype.setState=function(e){for(var i in e){this.set(i,e[i],this._state)}};e7.prototype.setId=function(e){this._id=e};e7.prototype.setProperties=function(e){for(var i in e){this.set(i,e[i],this._properties)}};e7.prototype.setBox=function(e){return this._box=e};e7.prototype.isPointInBox=function(e){return this._pointInBox(e,this._box)};e7.prototype.getPointGeoJSON=function(T){var lW=this.renderData;if(lW){var lQ=lW.active;if(!lW[lQ]||!lW[lQ]["poi"]){return null}var lV=[];var lS=lW[lQ]["poi"];for(var lT=0;lT0){lU="MultiPolygon"}return{type:"Feature",properties:{},geometry:{type:lU,coordinates:[lV]}}}}};e7.prototype._pointInBox=function(e,i){if(i[0]>e[0]||i[1]>e[1]||i[2]lP[lQ].bds[0])&&(C.y-lO.ylP[lQ].bds[1])){if(e.getTilt()>55){var lR=e.pointToOverlayPixelIn(lP[lQ].pt);if(lR.outOfFrustum){continue}}lT=true;break}}}}return lT};e7.prototype._pixelPnpoly=function(lO,lQ){var e=lQ.length;var C=0;var lP=false;for(var T=0;T=lQ[T].lat)&&(lO.lat=lQ[C].lat)&&(lO.lat1){for(var lY=1;lYlZ){lU=Math.sqrt(Math.min(lO,l2))}if((C==null)||(C>lU)){T=Math.sqrt(l2-lP)/Math.sqrt(lZ);lW=Math.sqrt(lO-lP)/Math.sqrt(lZ);C=lU;lV=lY}C=Math.min(C,lU)}}return{dist:C}};e7.prototype.isPointInGeometry=function(lS,e){var lT=false;switch(this._type){case gJ.POINT:lT=this._pixelPnpoint(lS,this.renderData,e);break;case gJ.LINE_STRING:var lR=this._getProximity({lng:lS[0],lat:lS[1]},this._geometry);var T=this.renderData[this.renderData.active];if(!T||!T.line||!T.line[0]||!T.line[0].width){var C=2}else{var C=this.renderData[this.renderData.active]["line"][0].width;if(this.grid===eP.GridModel.GOOGLEWEB){C=Math.max(C/2*ef.gridScaleFromBDMCTo3857,2)}else{C=Math.max(C/2,2)}}if(lR.dist1?[l5]:(l5[0]||[])}var l3=l4;if(l4.polygonStyle){l3=l4.polygonStyle;if(l4.polygonStyle instanceof Function){l3=l4.polygonStyle(l2)||{}}}var l0=new j3(l5,l3);return l0}function lT(l1,l7,l4){var l5=l1.coordinates;var lZ=[];for(var l3=0;l3l1[0]){l0[0]=l1[0]}if(l0[1]>l1[1]){l0[1]=l1[1]}if(l0[2]=0){continue}const lT=lS[lU];lP[lU]=kV(lT,lQ)}if(lS instanceof Error){lP.message=lS.message}}if(e!=="Object"){lP["_$name"]=e}return lP}else{if(lS instanceof Function){return null}}throw new Error("不能被序列化")}function jr(lP){if(lP===null||lP===undefined||typeof lP==="boolean"||typeof lP==="number"||typeof lP==="string"||lP instanceof Boolean||lP instanceof Number||lP instanceof String||lP instanceof Date||lP instanceof RegExp||gz(lP)||hf(lP)||ArrayBuffer.isView(lP)||lP instanceof ImageData){return lP}if(Array.isArray(lP)){var e=lP["_$name"];if(e){var T=ks[e]["_class"];if(!T){throw new Error("不能被反序列化")}if(T.deserialize){return T.deserialize(lP)}}const lO=[];for(var C=0;C=lO.minZoom&&lO.map.getZoom()<=lO.maxZoom){if(!lO._onMap){lO.addDataToMap();lO._onMap=true}}else{if(lO._onMap){lO.removeDataFromMap();lO._onMap=false}}};this.map.on("zoomend",this._onZoomEvent);var lO=this;var e=false;var T={x:0,y:0};this._layerMouseEvent=function(lT){if(!lO.map||!lO._listeners||!lO.visible||!lO._onMap){return}if(!lO._listeners.onmousemove||Object.keys(lO._listeners.onmousemove).length===0){return}var lS=lO.pickOverlays(lT);var i;if(lS&&lS.length>0){i=new gC("onmousemove");i.features=lS;lO.map.platform.style.cursor=lO.map.config.overlayMoveCursor;e=true}else{if(!e||!lO._listeners.onmouseout||Object.keys(lO._listeners.onmouseout).length===0){return}lO.map.platform.style.cursor=lO.map.config.defaultCursor;i=new gC("onmouseout");i.features=null;e=false}if(i){i.point=lT.point;i.pixel=lT.pixel;i.latLng=lT.latlng;lO.dispatchEvent(i)}};this._layerClickEvent=function(lU){if(!lO.map||!lO._listeners||!lO.visible){return}if((!lO._listeners.onclick&&!lO._listeners.dblclick)||(Object.keys(lO._listeners.onclick||{}).length===0&&Object.keys(lO._listeners.dblclick||{}).length===0)){return}var lS={x:lU.clientX,y:lU.clientY};if(Math.abs(lS.x-T.x)>lO.clickDistrict||Math.abs(lS.y-T.y)>lO.clickDistrict){return}var lT=lO.pickOverlays(lU);var i=new gC(lU.type);i.point=lU.point;i.pixel=lU.pixel;i.latLng=lU.latlng;i.features=lT;lO.dispatchEvent(i)};this._layerMouseDownEvent=function(i){T={x:i.clientX,y:i.clientY}};lQ.addEventListener("onmousemove",this._layerMouseEvent);lQ.addEventListener("onmouseout",this._layerMouseEvent);lQ.addEventListener("onmousedown",this._layerMouseDownEvent);var lP=["onclick"];for(var C=0;C0){this.clearData()}this.dataSource=e;this.overlayData=this.gParse.readFeaturesFromObject(e,{markerStyle:this.markerStyle,polylineStyle:this.polylineStyle,polygonStyle:this.polygonStyle},this._register.bind(this));this.addDataToMap()};a0.prototype._register=function(e){e.layerName=this.layerName;e.setZIndex(this.level)};a0.prototype.resetStyle=function(){for(var e=0;e=0){this.overlayData.splice(e,1);this.map.removeOverlay(i)}}};a0.prototype.findItemIndex=function(C){var i=-1;for(var e=0;e=this.minZoom&&this.map.getZoom()<=this.maxZoom){for(var e=0;e0){for(var e=0;e0){this.removeDataFromMap()}this.overlayData=[]};a0.prototype.pickOverlays=function(lR){var lQ=[];if(!this.visible||!this._onMap){return null}for(var lO=0;lO=0&&C0?lQ:null};a0.prototype.setLevel=function(e){if(e>-999&&e<9999){this.level=e;for(var C=0;C(lX+lP)){lW.tileCache.clear();return null}if(lS.source!=="BD09MC"){ma.x=ef.getTilesLoop(l4,ma.x)}if(lT.length===4){var l9=ef.getTileRangeExtent([l4,ma.x,ma.y]);var mb=lV([l9.minX,l9.minY,l9.maxX,l9.maxY]);if(!mb){return null}}var l5="";if(lZ){l5=lZ;var l7=/[^\{}]*\{(.*)\}[^\}]*/;l5.match(l7);var l6=[];if(RegExp.$1){l6=RegExp.$1.split(",")}var l3=C(ma.x,ma.y,l4);if(!l3){return null}l5=l5.replace(/\{(.*)\}/,l6[(ma.x+ma.y)%l6.length]);l5=l5.replace(/\[x\]/gi,T(ma.x,ma.y,l4));l5=l5.replace(/\[y\]/gi,l0(ma.x,ma.y,l4));l5=l5.replace(/\[z\]/gi,l3);l5=l5.replace(/\[b\]/gi,lY(ma.x,ma.y,l4));l5=l5.replace(/\[w\]/gi,l1(ma.x,ma.y,l4));l5=l5.replace(/\[h\]/gi,e(ma.x,ma.y,l4))}else{return null}return l5};function lV(l3){if(lT&&lT instanceof Array&&lT.length===4){if((lT[0]<=l3[2]&&lT[1]<=l3[3])&&(lT[2]>=l3[0]&&lT[3]>=l3[1])){return true}else{return false}}return true}return lW}function d4(i){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("PixelLayer")}this.src=dC();this.tileMaskUvCache=new aK(64,{clearCallback:function(lP){}});var lO=6;if(i.pixelMap){this.opacity=typeof i.pixelMap.opacity==="number"?i.pixelMap.opacity:1;cD(this.opacity,0,1);if(this.opacity<1){i.useThumbData=false}var T=i.pixelMap||{};this.colors=T.colors||["#F9F871","#FFC75F","#FF9671","#FF6F91","#D65DB1","#845EC2"];this.positions=T.positions||[0,0.2,0.4,0.6,0.8,1];this.domain=T.domain||[0,255];this.clamp=T.clamp||this.domain;this.noData=(T.noData!==undefined)?T.noData:-99999;this.fomularC=T.fomularC||"float generateValue(vec4 pixel){return pixel.r * 255.;}";this.fomularJS=T.fomularJS||function(lP){return lP.r};this.maskPng=T.maskPng||null;if(this.maskPng){this.loadMaskPng(this.maskPng)}this.maskData=T.maskData||-1;this.maskCoord=T.maskCoord||null;this.fHashcode=r({str:this.fomularC});var e=this.canPixelMap();if(e){this.isPixelMap=true;this.setPixelMap()}lO=i.pixelMap.cacheSize||lO}var C=new lB(i);C.ontology=this;this.layer=C;this.cacheSize=lO;this.tileCache=new aK(this.cacheSize,{clearCallback:function(lP){}});this.tileImageDataCache=new aK(this.cacheSize,{clearCallback:function(lP){}})}d4.inherits(fK.BaseClass,"PixelLayer");fK.extend(d4.prototype,{canPixelMap:function(){if(this.colors&&this.positions){return true}return false},setPixelMap:function(){if(!this.isPixelMap||!this.canPixelMap()){return}var i=this.colors;var e=this.positions;this.pHashcode=r({colors:i,positions:e});this.pixelColorMap=iL.generateColorRamp(i,e)},setDomain:function(e){if(e instanceof Array&&e.length===2){this.domain=e;this.doOnceDraw()}},setClamp:function(e){if(e instanceof Array&&e.length===2){this.clamp=e;this.doOnceDraw()}},setNoData:function(e){this.noData=e;this.doOnceDraw()},setPositions:function(e){this.positions=e;this.setPixelMap();this.doOnceDraw()},setColors:function(e){this.colors=e;this.setPixelMap();this.doOnceDraw()},setFomular:function(e,i){if(e&&i){this.fomularJS=e;this.fomularC=i;this.fHashcode=r({str:this.fomularC});this.doOnceDraw()}},setOpacity:function(e){this.opacity=e;this.doOnceDraw()},setIsPixelMap:function(e){this.isPixelMap=e;this.doOnceDraw()},setMaskPng:function(e){this.maskPng=e;this.loadMaskPng(this.maskPng);this.doOnceDraw()},setMaskData:function(e){this.maskData=e;this.doOnceDraw()},setMaskCoord:function(e){this.maskCoord=e||null;this.calMaskBox();this.doOnceDraw()},setZIndex:function(e){if(this.layer&&parseInt(e)>0){this.layer.setZIndex(e)}},getZIndex:function(){if(this.layer){return this.layer.zIndex}},setUpLevel:function(){if(this.layer){var e=this.layer._getAdjoinZIndex("up");if(this.layer.zIndex!==e){this.layer.setZIndex(e)}}},setDownLevel:function(){if(this.layer){var e=this.layer._getAdjoinZIndex("down");if(this.layer.zIndex!==e){this.layer.setZIndex(e)}}},setZIndexTop:function(){if(this.layer){this.layer.setZIndexTop()}},doOnceDraw:function(){if(this.layer.map){var e=new gC("onupdate");this.layer.map.dispatchEvent(e)}},_getInLayer:function(lV){if(!this.map){return null}var lU=Math.floor(this.map.getZoom());var T=ef.transformBDmcPoint(lV,this.layer.transform);var lR=ef.getTileCoordForXYAndZ_(T[0],T[1],lU,false);var C=lR.join("-");var e=this.tileCache.getData(C);if(e){return e}var lO=this.layer.zIndex;var lQ=this.map._featureMgr.result.bkData;var lS=lQ[lO][2];var lW=null;for(var lP=0;lP=this.clamp[0]&&e<=this.clamp[1]){return e}}return null},setMaskImageObject:function(C){var e=document.createElement("canvas");e.width=C.width;e.height=C.height;var i=e.getContext("2d");i.drawImage(C,0,0,C.width,C.height);this.imageMaskObject={width:C.width,height:C.height,data:i.getImageData(0,0,C.width,C.height)};i=null;e=null},getImageMaskPixel:function(e){if(!this.imageMaskObject||!this.maskBox){return true}var T=[e];var lS=this.maskBox||[];var lP=lS[1][0]-lS[0][0];var lO=lS[1][1]-lS[0][1];var C=Math.floor((T[0][0]-lS[0][0])/lP*this.imageMaskObject.width);var i=Math.floor((-T[0][1]+lS[1][1])/lO*this.imageMaskObject.height);var lR=Math.floor((i*this.imageMaskObject.width+C)*4);if(C>this.imageMaskObject.width||C<0){return null}if(i>this.imageMaskObject.height||i<0){return null}var lQ=this.imageMaskObject.data.data;if(lR+3>lQ.length){return false}if(lQ[lR+3]>0){if(this.maskData>-1&&this.maskData!==lQ[lR]){return false}return true}return false},calMaskBox:function(){var C=this.maskCoord||[];if(this.hasMaskPng&&C&&C.length===2){var e=[];for(var T=0;T0){e.zIndex=i.index}e.loadTileData=this._loadTile.bind(this);e.ontology=this;this.layer=e;var T=this;e.addEventListener("ontilesloadstart",function(){T.dispatchEvent(new gC("ontilesloadstart"))});e.addEventListener("ontilesloadend",function(){T.dispatchEvent(new gC("ontilesloadend"))})},createTileLayer:function(i){const T=i.tileUrlTemplate||"";const lS=i.xTemplate||function(lZ,l1,l0){return lZ};const lX=i.yTemplate||function(lZ,l1,l0){return l1};const lQ=i.zTemplate||function(lZ,l1,l0){return l0};const lW=i.bTemplate||function(lZ,l2,l1){const l0=kz.tileToBoundRange({col:lZ,row:l2,zoom:l1,baseTileSize:256});return l0.MC.sw.lng+","+l0.MC.sw.lat+","+l0.MC.ne.lng+","+l0.MC.ne.lat};var lY=i.extent||[];const lR=i.extentCRSIsWGS84||false;var C=i.minZoom||0;var lU=i.maxZoom||23;var lV=i.spanLevel||0;var lT=new iE({transparentPng:true,dataType:2,spanLevel:lV,tileTypeName:"web",cacheSize:i.cacheSize||256,customLayer:true,clipTile:false,boundary:false,useThumbData:i.useThumbData||false});if(lY.length===4){if(lR){lY=ef.fromEPSG4326(lY)}var lO=ef.transformPointArr([lY[0],lY[1]],"EPSG3857","BD09MC");var lP=ef.transformPointArr([lY[2],lY[3]],"EPSG3857","BD09MC");lY=[lO[0],lO[1],lP[0],lP[1]]}lT.getTilesUrl=function(l6,l0,l5){if(!l6||l0<0||l0<(C+lV)||l0>(lU+lV)){lT.tileCache.clear();return null}if(lY.length===4){const l4=kz.tileToBoundRange({col:x,row:y,zoom:z,baseTileSize:256});var l7=e([l4.MC.getMin().lng,l4.MC.getMin().lat,l4.MC.getMax().lng,l4.MC.getMax().lat]);if(!l7){return null}}var l1="";if(T){l1=T;var l3=/[^\{}]*\{(.*)\}[^\}]*/;l1.match(l3);var l2=[];if(RegExp.$1){l2=RegExp.$1.split(",")}var lZ=lQ(l6.x,l6.y,l0);if(!lZ){return null}l1=l1.replace(/\{(.*)\}/,l2[(l6.x+l6.y)%l2.length]);l1=l1.replace(/\[x\]/gi,lS(l6.x,l6.y,l0));l1=l1.replace(/\[y\]/gi,lX(l6.x,l6.y,l0));l1=l1.replace(/\[z\]/gi,lQ(l6.x,l6.y,l0));l1=l1.replace(/\[b\]/gi,lW(l6.x,l6.y,l0))}else{return null}return l1};function e(lZ){if(lY&&lY instanceof Array&&lY.length===4){if((lY[0]<=lZ[2]&&lY[1]<=lZ[3])&&(lY[2]>=lZ[0]&&lY[3]>=lZ[1])){return true}else{return false}}return true}return lT},compileExpress:function(i,e){var i=eP.ExpressParse.normalizePropertyExpression(i,e);return i},resolveStyle:function(lP){var T=lP||{};if(T.style){var lO={};if(!T.layers||T.layers.length===0){var lR=eP.LayerTypes.POINT;var i=eP.LayerTypes.LINE;var lQ=eP.LayerTypes.FILL;if(T.style[lR]){T.style[lR].type="point"}if(T.style[i]){T.style[i].type="polyline"}if(T.style[lQ]){T.style[lQ].type="polygon"}}for(var C in T.style){if(T.style.hasOwnProperty(C)){var e=T.style[C];this._styleFormat(e.type,e.painter,C,lO)}}this.styleExpress=lO}},_styleFormat:function(lO,e,i,T){var lQ={};var lR=dy[lO];if(!lR){return}for(var C in e){if(e.hasOwnProperty(C)){var lP=this.compileExpress(e[C],lR[C]);lQ[C]=lP}}T[i]={type:lO,painter:lQ}},evaluateContext:function(e,C,T){var i=e+"_"+C.getId();var lO=this._stateCube[i];if(lO){C.setState(lO)}else{C._state={}}return{properties:function(){return C&&C.getProperties()},featureState:T===true?{}:(C&&C.getState())}},evaluates:function(i,T,lO){if(!this.styleExpress||!this.styleExpress.hasOwnProperty(i)){return null}var lQ=this.styleExpress[i].painter;var e={};for(var C in lQ){if(lQ.hasOwnProperty(C)){var lP=lQ[C].evaluate(this.evaluateContext(i,T,lO));e[C]=lP}}return e},_updateState:function(C,T,e){if(C instanceof kA&&C.layerName&&C.id){var i=C.layerName+"_"+C.id;if(e){this._set(T,this._stateCube,i)}else{this._stateCube[i]=T}this._stateCube[i].rank=(this._stateCube[i].rank||0)+1}else{if(typeof C==="string"){if(e){this._set(T,this._stateCube,C)}else{this._stateCube[C]=T}this._stateCube[C].rank=(this._stateCube[C].rank||0)+1}}},updateState:function(lO,lP,e){var C=JSON.stringify(this._stateCube);if(!(lP&&typeof lP==="object"&&Object.keys(lP).length>0)){return}if(!e){this._stateCube={}}if(lO instanceof Array){for(var T=0;Tthis.maxZoom){l1._featureMgr.clearData(this.layer.drawIndex);l1._featureMgr.clearLabelOverlayData(this.layer.drawIndex);l1._featureMgr.clearLabelData(this.layer.drawIndex);return}var lS=this.layer.getZoomState();if(C){this.thumbCache={};var lZ=-1;this.layer.tileLabels=[];var lV=l1._customLabelMgr.virtualTiles["mvt_"+this.layer.drawIndex];if(lV&&lV.label){this.layer.tileLabels.push(lV.label)}for(var lX=0,lW=lQ.length;lX=0.5){l3=true}else{if(lU<0.5&&e>=0.5){l3=true}else{if(lU>=0.5&&e<0.5){l3=true}}}if(l3){this.layer.cacheDataCollideLabels(0)}this.layer.LAST_CALC_ZOOM=lR}else{if(this.layer.tileLabels.length>0){this.layer.cacheDataCollideLabels(fK.Browser.ie?50:30)}}}else{this.layer.cacheDataCollideLabels(0)}return}for(var lX=0,lW=lQ.length;lXe){return false}return true}}},_setThumbData:function(i,e,C){if(C===1){this._dataFitGrid(i,e,3)}else{if(C===-1){if(i&&i.status==="ready"){this.map._featureMgr.setData(i,this.layer.drawIndex,2);this._loadCacheLabel(e,i)}else{this._findChildZoomTile(e,3)}}}},_findParent:function(T,lQ){var C=this.minZoom;var e=T.col;var lT=T.row;var lS=T.zoom;for(var lR=1;lR<=lQ;lR++){var lO=this._getParentTiles(e,lT,lS,C);if(lO===null){continue}lO.tileSize=T.tileSize;lO.tileTypeName=T.tileTypeName;lO.transform=T.transform;var lU=this.layer.getTileKey(lO);var lP=this.layer.tileCache.getData(lU);if(lP&&lP.status==="ready"){lP.key=lU;return lP}e=lO.col;lT=lO.row;lS=lO.zoom}return false},_findChild:function(i,lQ){var lS=this.maxZoom;var e=i.col;var lT=i.row;var lR=i.zoom;var lO=this._getChildTiles(e,lT,lR,lS,lQ);if(!lO){return false}for(var T=0;TlU){return null}var lT=Math.pow(2,lQ);var e=T*lT;var lS=lW*lT;var lR=lV+lQ;var lX=[];for(var lO=0;lO0){lS.layer._checkLayerTilesLoaded();var l0=lS.layer.callbackDataQueue.shift();lS._setTileData(l0[0],l0[1],l0[2])}var lZ=new gC("onupdate");lS.map.dispatchEvent(lZ);lS.processDataTimer=null},0)}})},_loadTileData:function(i,e){var T=i.col;var lR=i.row;var lO=i.zoom;var C=this.layer.getTilesUrl(new f8(T,lR),lO,i);if(!C){return}var lQ=this.layer.getTileKey(i);var lP=new XMLHttpRequest();lP.open("GET",C,true);lP.responseType="arraybuffer";lP.timeout=3000;lP.ontimeout=function(){e&&e(null,lQ,i)};lP.onreadystatechange=function(lS){if(this.readyState===4){if(this.status===200){e&&e(lP.response,lQ,i);return}if(this.status>=400||this.status===0){e&&e(null,lQ,i)}else{e&&e(null,lQ,i)}}};lP.send()},_tileDataCbk:function(lO,lQ,i){var e=this.layer.tileCache.getData(lQ);if(!e){return}var lP=this.layer.map;var C=this;if(!lO||typeof lO==="string"){e.status="init";e.reloadTimer=setTimeout(function(){if(e.retry<3){e.retry++;e.status="loading";C._loadTileData(i,function(lS,lT,lR){C._tileDataCbk(lS,lT,lR)})}else{e.status="ignore"}},3000);return}if(e.reloadTimer){clearTimeout(e.reloadTimer);e.reloadTimer=null}var T=(function(lR){return function(){var lS=i.col;var lV=i.row;var lT=i.zoom;var lU="id_"+lS+"_"+lV+"_"+lT;e.tileInfo=i;e.tileData=C.mvt.readFeatures(lR,C,lP,{x:lS,y:lV,z:lT,g:C.gridModel,mc:C._opt.transform&&C._opt.transform.source==="BD09MC"?true:false});C._processLabelData(e);C.layer.callbackDataQueue.push([lQ,e,lU]);if(C.processDataTimer){return}C.processDataTimer=setTimeout(function(){while(C.layer.callbackDataQueue.length>0){var lW=C.layer.callbackDataQueue.shift();C._setTileData(lW[0],lW[1],lW[2])}C.doOnceDraw();C.processDataTimer=null},200)}})(lO);lP.jobScheduler.addJob(T)},_setTileData:function(C,e,i){e.status="ready";this.layer.tileCache.setData(C,e);if(this.layer.curViewTilesInfo[i]){e.dataType=iU}},_processLabelData:function(C){if(!C.tileData){return}C.label=C.tileData.getTileLabels();if(!C.label){return}if(C.label.status==="processing"){return}var i=C.tileInfo;var e=this._getTileTexImgKey(i);C.label.imgKey=e;C.label.status="processing";var T=this;T.layer.updateAllIconsTextureCoords(C);this.layer.labelProcessor.loadIconImages(C,function(lP){T.layer.updateAllIconsTextureCoords(lP)},true);var lO=this.layer.map.tileMgr.getLabelTextCanvas();lO.drawCustomLabelsOnCanvas(C.label.fixedLabel,function(lP){if(lP){if(!C.label.textureHeights){C.label.textureHeights=[]}C.label.textureHeights[i.useZoom]=lP.height}T.layer._doWorkAfterLabelImageLoad(C,lP,null,e)})},_getTileTexImgKey:function(i){var e="mvt_"+this.layer.drawIndex+"_"+i.col+"_"+i.row+"_"+i.zoom+"_";e=bS.getGUID(e);return e},_updateBRushCube:function(lQ){var lS=lQ.tileData;for(var C in lS){if(lS.hasOwnProperty(C)){var e=lS[C];for(var lO=0;lO0){lS=new gC("onmousemove");lS.value=lT;T.map.platform.style.cursor=T.map.config.overlayMoveCursor;e=true}else{T.map.platform.style.cursor=T.map.config.defaultCursor;if(!e||!T._listeners.onmouseout||Object.keys(T._listeners.onmouseout).length===0){return}lS=new gC("onmouseout");e=false}if(lS){lS.point=lU.point;lS.pixel=lU.pixel;lS.latLng=lU.latlng;T.dispatchEvent(lS)}};this._layerClickEvent=function(lU){if(!T.map||!T._listeners){return}if((!T._listeners.onclick&&!T._listeners.dblclick)||(Object.keys(T._listeners.onclick).length===0&&Object.keys(T._listeners.dblclick).length===0)){return}var lS;var i=lU.point;var lT=T.pickFeatures(i,lU.pixel);lS=new gC(lU.type);lS.point=i;lS.pixel=lU.pixel;lS.latLng=lU.latlng;lS.value=lT;T.dispatchEvent(lS)};lQ.addEventListener("onmousemove",this._layerMouseEvent);var lP=["onclick","dblclick"];for(var C=0;C0){this.layer.setZIndex(e)}},getZIndex:function(){if(this.layer){return this.layer.zIndex}},setZIndexTop:function(){if(this.layer){this.layer.setZIndexTop()}},setUpLevel:function(){if(this.layer){var e=this.layer._getAdjoinZIndex("up");if(this.layer.zIndex!==e){this.layer.setZIndex(e)}}},setDownLevel:function(){if(this.layer){var e=this.layer._getAdjoinZIndex("down");if(this.layer.zIndex!==e){this.layer.setZIndex(e)}}},toString:function(){return"MVTLayer"}});eP._generateTexture=function(lQ,lP,C){var lO=document.createElement("canvas");var e;var T;if(lP.strokeStyle==="dashed"){e=16;T=e*8}else{if(lP.strokeStyle==="dotted"){e=32;T=e*2}}lO.width=e;lO.height=T;var i=lO.getContext("2d");i.fillStyle=lP.strokeColor;i.globalAlpha=lP.strokeOpacity;var lR=lP.strokeWeight*2;if(lP.strokeStyle==="dashed"){lR=eP._drawDashArrayTexture(i,e,T,lP)}else{if(lP.strokeStyle==="dotted"){lR=eP._drawDottedTexture(i,e,T,lP.strokeWeight)}}if(window.createImageBitmap&&!lP.sync){createImageBitmap(lO,{imageOrientation:"flipY"}).then(function(lS){C(null,{totalDashLen:lR,texture:lS,textureSize:[e,T]})})}else{C(null,{totalDashLen:lR,texture:lO.toDataURL(),textureSize:[e,T]})}};eP._drawDashArrayTexture=function(lT,T,lP,C){var lR=C.dashArray;if(!lR){lT.fillRect(0,0,T,lP/2);return C.strokeWeight*4}else{var lS=0;if(lR.length%2!==0){lR=lR.concat(lR)}for(var lO=0;lO19){lO(null);return}var e=this.getZoomState(T);var C=this.calCoord(i,T,e);this.curViewTilesInfo=this.calTilesOrders(C.sw,C.ne,T);this.clearData();this.clearRefs();this.loadLayerData(this.curViewTilesInfo,e,true,lO)},calCoord:function(C,T,i){if(C.length!==4){return}var e=ey.transform([C[0],C[1]],ey[this.inputCRS],ey.BD09MC);var lO=ey.transform([C[2],C[3]],ey[this.inputCRS],ey.BD09MC);if(lO[1]>19505879.362428114||e[1]<-15949096.637571886){lO[1]=19505879.362428114;e[1]=-15949096.637571886}this._mapCenter[T]=new c4((e[0]+lO[0])/2,(e[1]+lO[1])/2);return{sw:e,ne:lO}},calTilesOrders:function(lS,lY,lU){var lV=this.tileType.getMercatorSize(lU,lU);var lQ=[Math.floor(lS[0]/lV),Math.floor(lS[1]/lV)];var i=[Math.floor(lY[0]/lV),Math.floor(lY[1]/lV)];var lR=lQ[0]-1;var lP=i[0]+2;var lO=lQ[1]-1;var lX=i[1]+2;var lT=[];for(var T=lR;T0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState||0},loadLayerData:function(lU,T,lO,lT){this.thumbCache={};if(lO){for(var lR=0,lP=lU.length;lR3){lS();return}var lT=lQ.getTilesUrl(new f8(e.col,e.row),e.zoom,i);T.src=lT;i++},this.retryTime)}T.onload=function(){lS();lP&&lP(this,C)};T.onerror=function(){lS();lP&&lP(null,C)};T.src=lR;return T},rasterTileDataCbk:function(lO,T,lR){if(!lO||typeof lO==="string"){this.tileCache.removeData(T);return}var i=lO.tileInfo;var C=i.col;var lT=i.row;var lS=i.zoom;var e=this.tileCache.getData(T);if(!e){return}e.textureSource=lO;e.dataType=hE;e.tileInfo=i;e.status="ready";this.tileCache.setData(T,e);var lP="id_"+C+"_"+lT+"_"+lS;var lQ=false;if(this.curViewTilesInfo[lP]){e.png8=this.png8||false;e.key=T;this.setData(e,2);lQ=true}if(lQ){this.calOutData(lR,e)}},getTilesUrl:function(lO,lV,i){var lQ=i||0;var C=lO.x;var lW=lO.y;var lS=lo("ditu","normal");var lR=lS.udt;var lU=e1.B_NORMAL_MAP.tileUrls;var lP=Math.abs(C+lW+lQ)%lU.length;var lT=lU[lP];if(C<0){C="M"+(-C)}if(lW<0){lW="M"+(-lW)}var T="x="+C+"&y="+lW+"&z="+Math.floor(lV);T+="&styles=pl&scaler=2&udt="+lR+"&from=jsapi3_0";var e=lT+"?qt=vtile&"+T;return e},calOutData:function(lT,C){if(!C){for(var lQ=0;lQ0){e[0].sort(function(C,i){return C.tileInfo.useZoom-i.tileInfo.useZoom})}}});function eb(C,i){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("CustomHtmlLayer")}a5.call(this,i);if(!cf(C)){throw new Error("createDOM参数类型错误,请检查是否为Function")}var e=i||{};this.config={};this.config.enableMassClear=false;this.config.minZoom=e.minZoom||3;this.config.maxZoom=e.maxZoom||21;this.config.zIndex=e.zIndex||0;this.config.nextTick=e.nextTick||false;this.config.offsetX=e.offsetX||0;this.config.offsetY=e.offsetY||0;this.config.fixBottom=e.fixBottom||false;this.config.anchors=e.anchors||[0.5,1];this.config.coordinate=e.coordinate||"BD09";this.config.enableDraggingMap=e.enableDraggingMap||false;this.config.visible=e.visible===undefined?true:!!e.visible;this.config.useTranslate=e.useTranslate||false;this.sliceRepeat=e.sliceRepeat||false;this.displayType=e.displayType||"normal";this.clusterAnimation=e.clusterAnimation||{};this.clusterWait=null;this.clusterStatus=0;this.createDOM=C;this.data=e.data||null;this.overlaysList=[];this.retainOverlays=[];this._eventList={}}eb.inherits(dH,"CustomHtmlLayer");fK.extend(eb.prototype,{initialize:function(i){this.map=i;this.addToMap();this.initEvent(i);var e=this;this.map.on("destory",function(){e._distory()})},initEvent:function(){if(!this.overlaysList||!this.map){return}this._overlayEvent()},setStyleOptions:function(e){e=e||{};Object.assign(this.config,e);this.updateData(this.data)},addEventListener:function(e,i){if(!this._eventList[e]){this._eventList[e]=[i]}else{this._eventList[e].push(i)}this._overlayEvent()},_overlayEvent:function(){if(!this.overlaysList||!this.map){return}var lS=this.overlaysList;var e=this.overlaysList.length;var lR=Object.keys(this._eventList);for(var lQ=0;lQ0){this.overlaysList=this.overlaysList.concat(this.retainOverlays);this.retainOverlays=[]}},show:function(){this.config.visible=true;this.updateData(this.data)},hide:function(){this.config.visible=false;this.updateData(this.data)},addToMap:function(){if(!this.overlaysList||!this.map){return}var e=this.overlaysList.length;var T=this.overlaysList;if(e>0){for(var C=0;C-1){this.map.removeOverlay(T)}else{if(lV.indexOf(C)>-1){this.retainOverlays.push(T)}}}if(lS.length>0){this.overlaysList=[];return{type:"FeatureCollection",features:lS}}else{if(this.retainOverlays.length>0){this.overlaysList=this.retainOverlays;this.retainOverlays=[]}return null}},setData:function(e){if(!e){this.data=null;return}if(!e.features||e.features.length===0){this.removeAllOverlays();return}if(this.displayType==="cluster"){this._clusterDataReplace(e);return}var T=[];if(this.sliceRepeat&&this.data!==null){T=this.dataCompare(e);this.data=e;if(!T){return}}else{this.data=e;T=e;this.removeAllOverlays()}var lO=this;var C=hu.getType(T);if(C.toLowerCase()==="point"){var i=new hu({reference:this.config.coordinate});i.readFeaturesFromObject(T,{isPoints:true},function(lQ){var lP=lO.render(lQ);if(lO.sliceRepeat){lP._id=(typeof lO.sliceRepeat!=="boolean")?lQ.properties[lO.sliceRepeat]:lQ.properties.clusterId}lP.id="cus_"+parseInt(Math.random()*1000000,10);lO.overlaysList.push(lP)});i=null}this.addToMap();this.initEvent()},_clusterDataReplace:function(l9){if(this.clusterStatus){this.clusterWait=l9;return}else{this.clusterWait=null}this.clusterStatus=1;var T=this.data?(this.data.features||[]):[];var lX=JSON.parse(JSON.stringify(l9));var lQ=JSON.parse(JSON.stringify(l9.features));var lZ=[];var e=[];var lS=[];var lU={};var C=[];var l1=[];for(var l5=0;l5-1){lP.push(l6)}else{if(lS.indexOf(l2)>-1){l6.properties._movefrom=[l6.getPoint().lng,l6.getPoint().lat];l6.properties._moveto=lU[l2];lR.push(l6)}else{if(C.indexOf(l2)>-1){this.retainOverlays.push(l6)}else{this.map.removeOverlay(l6)}}}}this.overlaysList=[];this.data=lX;if(l1.length>0){this.overlaysList=[];l1={type:"FeatureCollection",features:l1}}else{if(this.retainOverlays.length>0){this.overlaysList=this.retainOverlays;this.retainOverlays=[];this._nextCompare();return}}var lO=[];var l3=[];var lT=[];var lY=new hu({reference:this.config.coordinate});var l8=this;lY.readFeaturesFromObject(l1,{isPoints:true},function(ma){var i=l8.render(ma);i._id=(typeof l8.sliceRepeat!=="boolean")?ma.properties[l8.sliceRepeat]:ma.properties.clusterId;switch(i.properties._status){case"new_discrete":lO.push(i);break;case"new_cluster":l3.push(i);break;default:lT.push(i);break}l8.overlaysList.push(i)});lY=null;if(this.clusterAnimation.delayRemove){for(var l5=0;l50){C._addBubbles(lS.bubble_data)}if(C.cusInLabelUids){C.map.removeLabelsFromMapTile(C.cusInLabelUids)}C._addLabels(lS.carport_data,"indoor")};if(this.spotFillCache[T]&&this.spotFillCache[T][this.currentFloor]&&i){var lO=this.spotFillCache[T][this.currentFloor];var e=C._parseParkingData(lO);C.spotFillLayer.setData(e);lQ(lO)}if(window._BMapSecurityConfig&&window._BMapSecurityConfig["serviceHost"]){var lR={qt:F,building_uid:T,floor:lP}}else{var lR={qt:F,ak:fy,building_uid:T,floor:lP}}lx.request(function(lS){if(lS&&lS.result&&!lS.result["error"]&&lS.content){var lT=C._unzip(lS.content[lP]);if(!lT||!lT.carport_data){return}C.spotFillData=C._parseParkingData(lT);if(lT&&lT.carport_data.length>0){C.floorsCache[C.currentFloor]=lT;C.spotFillCache[T]=C.floorsCache}if(!C.spotFillLayer){C._addLabels(lT.carport_data,"indoor");C._addBubbles(lT.bubble_data);C._initGraph("indoor");C._initEvent("indoor",C.options.callback);C.addToMap("indoor")}else{if(lT&&lT.carport_data.length>0){C.spotFillLayer.setData(C.spotFillData)}}lQ(lT)}else{console.log("获取室内车位数据失败,请检查是否已开通智能停车服务!")}},lR)},addToMap:function(e){if(!this.map){return}if(e==="indoor"&&this.spotFillLayer){this.map.addNormalLayer(this.spotFillLayer);this.spotFillLayer.setData(this.spotFillData)}else{if(this.spotOutFillLayer){this.map.addNormalLayer(this.spotOutFillLayer);this.spotOutFillLayer.setData(this.spotOutFillData)}}},_parseParkingData:function(C){if(!C){return}var i=C.carport_data;var e={type:"FeatureCollection",features:[]};if(!i){return e}i.forEach(function(T){if(T.geo&&typeof T.geo==="string"){T.geo=JSON.parse(T.geo)}var lO={type:"Feature",properties:{center:[T.x,T.y],state:T.carport_state,type:T.carport_type,name:T.carport_name,uid:T.carport_uid,floor:T.floor,angle:T.angle,label:T.label},geometry:{type:"Polygon",coordinates:[T.geo]}};e.features.push(lO)});return e},_initEvent:function(i,C){if(!this.map){return}var e=this;if(i==="indoor"){this.spotFillLayer.addEventListener("click",function(lS){if(lS.value.dataIndex!==-1&&lS.value.dataItem){var lQ=lS.value.dataItem;var T=lQ.properties.center;var lO=lQ.properties.bubble_data;var lR="";switch(lQ.properties.state){case 1:lR="占用";break;case 2:lR="空闲";break;case 0:lR="未知";break;default:lR="未知";break}var lP={center:T,state:lR,properties:lQ.properties};C&&C(lP)}})}else{this.spotOutFillLayer.addEventListener("click",function(lS){if(lS.value.dataIndex!==-1&&lS.value.dataItem){var lQ=lS.value.dataItem;var T=lQ.properties.center;var lO=lQ.properties.bubble_data;var lR="";switch(lQ.properties.state){case 1:lR="占用";break;case 2:lR="空闲";break;case 0:lR="未知";break;default:lR="未知";break}var lP={center:T,state:lR,properties:lQ.properties};C&&C(lP)}})}this.map.on("destory",function(){e._distory()})},_addBubbles:function(lQ){if(!lQ){return}this.bubbleDatas=[];this.cusInBubbleUids=[];for(var lP=0;lP0){this.adjustZIndex(T);T._normalLayerMgr.sortLayer()}else{var e=T._featureMgr.result.bkData;this.zIndex=e.length||1}var C={tileTypeName:this.getType?this.getType():"custom",dataType:this.toString(),ontology:this};T._featureMgr.createLayer(this.zIndex,C);this.map=T;this.gl=lO;this.onAdd(T,lO);var i=this;T.on("destroy",function(){i.onDestroy()})},adjustZIndex:function(i){if(i&&i._featureMgr){var e=i._featureMgr.result.bkData;while(e[this.zIndex]){this.zIndex+=1}}},_getAdjoinZIndex:function(lO){var C=this.zIndex;if(this.map&&this.map._featureMgr){var e=this.map._featureMgr.result.bkData;if(lO==="up"){for(var T=this.zIndex+1;T0;T--){if(e[T]){C=T;break}}}}return C},setTargetZIndex:function(e){this.zIndex=e;if(this.map){this.map._normalLayerMgr.sortLayer()}},setZIndex:function(lR){lR=Math.abs(Math.floor(lR))||1;if(!lR||lR===this.zIndex){return}var lO=this.map._featureMgr.result.bkData;var T=this.map.tileMgr.tileLayers;var lT=this.map._normalLayerMgr.layers;function lU(lZ){var lX=null;var lY=[T,lT];for(var lV=0;lV-1){return e}continue}if(lP-1){return e}}if(lS>=0){var e=C(lS*4);if(e>-1){return e}}if(lP>=lR&&lS<0){break}}return -1},testEvent:function(e){if(this.autoSelect){return true}if(this.enablePicked&&(this.supportMouseStyleChange||(e!=="onmousemove"&&!this.supportMouseStyleChange))){return true}return false},pick:function(lR,lQ,T){var C=this.gl;var lS=this.map.config.ratio;this.map._normalLayerMgr.saveFramebuffer();this.map._normalLayerMgr.bindFramebuffer(this.map._normalLayerMgr.pickFBO);this.map._normalLayerMgr.clear();this.map._webglPainter._camera._updatePolyLayerMatrix(this.center);var i=this.map._webglPainter._camera._modelViewMatrixLayer;var lP=mat4.create(Float64Array);mat4.multiply(lP,this.map._webglPainter.projMatrix,i);this.render(C,lP,{isPickRender:true});var e=new Uint8Array(4*this.pickWidth*this.pickHeight);C.readPixels(lR*lS-Math.floor(this.pickWidth/2),C.canvas.height-lQ*lS-Math.floor(this.pickHeight/2),this.pickWidth,this.pickHeight,C.RGBA,C.UNSIGNED_BYTE,e);var lO=this.rgbToIndex(e);if(this.getPickedItem){var lT=this.getPickedItem(lO,T)}this.map._normalLayerMgr.restoreFramebuffer();return lT},render:function(C,e,i){throw new Error("用户未实现render方法")},afterRender:function(i,e){},onDestroy:function(e,i){},onHide:function(e,i){},onShow:function(e,i){},doOnceDraw:function(){if(this.map){var e=new gC("onupdate");this.map.dispatchEvent(e)}},doRender:function(){if(!this.map){return false}var e=this.map.getZoom();if(this.visible){if(e>=this.minZoom&&e<=this.maxZoom){if(!this._status){this.onShow(this.map,this.gl);this._status=1}return true}}if(this._status){this.onHide(this.map,this.gl);this._status=0}return false},getZIndex:function(){if(this.zIndex===undefined){throw new Error("图层未添加到地图")}return this.zIndex},getVisible:function(){return this.visible},setVisible:function(e){this.visible=e;this.doOnceDraw()},getMinZoom:function(){return this.minZoom},setMinZoom:function(e){if(e<=this.maxZoom){this.minZoom=e}},getMaxZoom:function(){return this.maxZoom},setMaxZoom:function(e){if(e>=this.minZoom){this.maxZoom=e}},dispatcher:function(lO,T,C){var i=new gC(C);i.pixel=lO.pixel;i.latLng=lO.latlng;i.value=T;this.dispatchEvent(i)},hasEvent:function(e){if(this.enablePicked){if(e.substr(0,2)!=="on"){e+="on"}if(this._listeners&&this._listeners[e]&&Object.keys(this._listeners[e]).length>0){return true}return false}return false},toString:function(){return"normal"}});function hO(i){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("ThreeLayer")}i=i||{};const e={alpha:false,antialias:false};this.options=Object.assign({},e,i);if(!window.THREE){throw new Error("ThreeLayer requires THREE")}this._unsetlist=[];cP.call(this,this.options)}hO.inherits(cP,"ThreeLayer");fK.extend(hO.prototype,{onAdd:function(T,C){if(!this.options){throw new Error("ThreeLayer requires reCreate")}const e=this.map=T;const lT=this;e.addEventListener("update",function(i){if(i.changedStatus&&i.changedStatus.onsize_changed){lT._updateProjectionMatrix(lT.renderer)}});this._state=ez.WebGLState.get(C,e._webGLStateId);this.customCoords=e.toFormatCoords;const lR=new THREE.WebGLRenderer({context:C,alpha:this.options.alpha,antialias:this.options.antialias});this._updateProjectionMatrix(lR);lR.autoClear=false;var lU=e._webglMapScene._painter.background||[245,245,245,255];var lS="rgb("+lU.slice(0,3).join(",")+")";lR.setClearColor(lS,lU[3]/255);const lQ=new THREE.Scene();this.scene=lQ;this.renderer=lR;const lO=new THREE.AmbientLight(16777215,1);lQ.add(lO);if(this._unsetlist.length){for(var lP=0;lP0)){return}if(!e){this._stateCube={}}if(lO instanceof Array){for(var T=0;T=this.DEL_COUNT){new Error("超出"+this.DEL_COUNT+"个限制")}var e=false;for(var T=0;T0){var l8=mg[mg.length-1];var lT=l8.geometry.coordinates;var ma=bv(l6.lat-lT[1],l6.lng-lT[0]);mg[mg.length-1].properties.endPoint=l6.lng+","+l6.lat;mg[mg.length-1].properties.rotation=ma;if(me>1){var l2=mg[mg.length-2];var l3=l2.geometry.coordinates;ma=hM(l3,lT,[l6.lng,l6.lat]);mg[mg.length-1].properties.rotationPlus=Math.abs(ma)}}var l7=JSON.parse(JSON.stringify(lY));l7.index=mh;l7.line_node_type=me===0?1:3;l7.startPoint=me===0?"":l1.lng+","+l1.lat;l7.endPoint="";l7.rotationPlus=0;mg.push({type:"Feature",properties:l7,geometry:{coordinates:[l6.lng,l6.lat],type:"Point"}});l1=l6;l5++}if(l5===1){mg.splice(mg.length-1,1)}if(l5>=2&&mg[mg.length-1].properties.endPoint===""){var lR=mg[mg.length-2];var C=lR.geometry.coordinates;var lQ=mg[mg.length-1];var e=lQ.geometry.coordinates;var ma=bv(e[1]-C[1],e[0]-C[0]);l7.rotation=ma;l7.line_node_type=2}}else{var lR=lP[0];var mf=kz.convertLL2MC(new c4(lR[0],lR[1]));var lX=lP[1];var md=kz.convertLL2MC(new c4(lX[0],lX[1]));var lQ=lP[lP.length-1];var mj=kz.convertLL2MC(new c4(lQ[0],lQ[1]));var l4=lP[lP.length-2];var lU=kz.convertLL2MC(new c4(l4[0],l4[1]));var l9=[[md,mf],[mj,lU]];for(var me=0;me<2;me++){var mi=[l9[me][0].lng,l9[me][0].lat];var lZ=[l9[me][1].lng,l9[me][1].lat];var l7=JSON.parse(JSON.stringify(lY));l7.index=mh;var ma=bv(mi[1]-lZ[1],mi[0]-lZ[0]);l7.rotation=ma;l7.line_node_type=me===0?1:2;l7.startPoint=me===0?"":mi.join(",");l7.endPoint=me===0?lZ.join(","):"";l7.rotationPlus=0;mg.push({type:"Feature",properties:l7,geometry:{coordinates:me===0?lZ:mi,type:"Point"}})}}if(this.base_opt.nodeMiddleShow&&lS+1<=mg.length){var lO=mg.length;for(var mc=lS+1;mc25)?6:e.nodeMinZoom;this.arrow_color=this.getColorStyleForGL(this.style_opt.arrowColor,null,false);eJ.call(this,e);if(e.nodeShow){var i=JSON.parse(JSON.stringify(e));i=Object.assign(i,{enablePicked:false,autoSelect:false,coorSysMc:true});this.attachNode=new bb(i)}}cg.Segment={START_POINT:1,END_POINT:2,BREAK_POINT:3,MIDDLE_POINT:4,1:1,2:2,3:3,4:4};cg.inherits(eJ,"LineLayer");fK.extend(cg.prototype,{onAdd:function(C,T){if(this.attachNode){this.attachNode.onAdd(C,T)}if(!this.map){this.map=C;this.gl=T}if(this.base_opt.isLinear&&this.base_opt.linearTexture){var i=this.drawLinearTexture(this.base_opt.linearTexture);if(i instanceof HTMLCanvasElement||(window.ImageBitmap&&textureName instanceof window.ImageBitmap)){if(!this.linearTexture){var e=ez.utils.createTexture(T,i,{flipY:false,wrap:T.CLAMP_TO_EDGE,mipmap:true,unpackAlpha:true});this.linearTexture=e}}}if(!this.buffer){this.parseData()}},parseData:function(e){if(!this.loadModule||!this.styleExpress||!this.map||!this.map._normalLayerMgr){return}var C=this.getData();if(!C){return}var T=this.dataset=this.formatData(C);this.dispatchEvent(new gC("ondataparsed"));var i=this.linesParse(T.inner);this.lines=this.combineLine(i);if(!this.base_opt.nodeStrict){this.buffer=this.createBufferData(this.lines)}else{this.buffer=this.createBufferArrData(this.lines[0])}this.doOnceDraw()},linesParse:function(l2){var lS=[[],[]];var lP=0;var lY=-1;for(var l9=0;l90){var l8=this.buildLineVertex(ma,l2[l9],lQ,lX,e,lP);lS[0][lS[0].length]={border:true,index:lT,styleData:l8,textureKey:-1,texture:null,textureSize:null,zoomWithMap:true,start:bb.hasMask(lR),end:bb.hasMask(lO),overlay:{_height:ma.height,_config:{textureRepeat:true},_totalDashLen:null,}}}}var l5=ma.strokeWeight/2;var l6=this.getColorStyleForGL(ma.strokeColor,ma.strokeOpacity,false);if(!this.base_opt.isLinear&&l0>-1&&this.style_opt.linksLine&&this.style_opt.strokeColorControl instanceof Function){var lZ=this.style_opt.strokeColorControl.bind(this)(lT,l0);l6=this.getColorStyleForGL(lZ,undefined,false)}if(this.base_opt.isLinear&&this.style_opt.linksLine&&this.style_opt.verticesValueControl instanceof Function){var l4=this.style_opt.verticesValueControl.bind(this)(lT,l0)||[];var lU=[];for(var l7=0;l70?lU:l6}var l8=this.buildLineVertex(ma,l2[l9],lQ,l5,l6,lP);var lZ=this._generateTexture(ma)||{};var l1=lZ.value||null;var C={index:lT,styleData:l8,textureKey:lZ.key||-1,texture:l1?l1.texture:null,textureSize:l1?l1.textureSize:null,zoomWithMap:true,start:this.base_opt.nodeMask&&bb.hasMask(lR),end:this.base_opt.nodeMask&&bb.hasMask(lO),overlay:{_height:ma.height,_config:{textureRepeat:true},_totalDashLen:l1?l1.totalDashLen:null,}};if(this.style_opt.borderCovered&&!this.base_opt.nodeStrict){lS[1][lS[1].length]=C}else{lS[0][lS[0].length]=C}if(l8[0]&&l8[0][0] instanceof Array){lP=l8[0][0][l8[0][0].length-1]/10||0}if(lP===0){var lW=l8.length-1;if(l8[lW]&&l8[lW][0] instanceof Array){lP=l8[lW][0][l8[lW][0].length-1]/10||0}}this._length[lY]=lP}return lS},combineLine:function(lP){var lV=[];var T=[];var l1=[];for(var lR=0;lR0){var lX={};for(var lS=0;lS=0){var lZ=lP[0][lU];if(!lX[lS+1][lZ.textureKey]){lX[lS+1][lZ.textureKey]=[{style:[],styleData:[[],[]],index:[]}]}this._mergeOnePolylineData(lX[lS+1][lZ.textureKey],lZ);var e=lP[0][lU+1];if(e&&e.index===lT){if(!lX[lS+1][e.textureKey]){lX[lS+1][e.textureKey]=[{style:[],styleData:[[],[]],index:[]}]}this._mergeOnePolylineData(lX[lS+1][e.textureKey],e)}}}l1.push(lO)}lV[0]=lX}if(this.attachNode){var lY=this._pointGeoFilter(this.getData());var lW=JSON.parse(JSON.stringify(this.params||{}));lW.nodeStrictIndex=l1;this.attachNode.setData(lY,lW)}return lV},_findLineIndex:function(e,T){for(var C=0;C0){for(var lO=0;lO0){for(var T=0;TT){i++;l2=l4[i]={style:[],styleData:[[],[]],index:[],texture:null,textureSize:null,zoomWithMap:null,overlay:null};lP=l2.styleData[0];lO=l2.styleData[1];lQ=0}if(l2.styleData[0].length===0){l2.texture=lR.texture;l2.textureSize=lR.textureSize;l2.zoomWithMap=lR.zoomWithMap;l2.overlay=lR.overlay}l2.index[l2.index.length]=lR.index;var l0=lX>0?-2:0;for(;l00?((T*(lX+1)-2)*3):(l1-2)*3;var lW=lX>0?(T*lX-2)*3:0;var e=lX>0?T*lX-2:0;for(var lZ=lW;lZ65536){lZ.push([lT,lX]);lT=[];lX=[]}hk.buildData(lV[lS],lP,lW,lT,lX,lR,lO,undefined,lQ)}lZ.push([lT,lX]);return lZ},createBuffer:function(i){var C=13;var e=[{name:"a_pos",components:2,offset:0,type:"Float32"},{name:"a_normal",components:2,offset:8,type:"Float32"},{name:"a_color",components:4,offset:16,type:"Uint8",normalize:true},{name:"a_data",components:4,offset:20,type:"Float32"},{name:"a_id",components:1,offset:36,type:"Float32"}];return new D(i,{components:C,members:e},D.BufferType.VERTEX)},createBufferArrData:function(lX){var lU=[];var lV=0;for(var l0 in lX){if(!lX.hasOwnProperty(l0)){continue}var lP=lX[l0];var lZ=[];for(var T in lP){if(!lP.hasOwnProperty(T)){continue}var lT=lP[T];var lW=[];for(var lS=0;lSthis.base_opt.nodeMinZoom&&this.base_opt.nodeMask){lR.clear(lR.STENCIL_BUFFER_BIT);lR.stencilFunc(lR.ALWAYS,1,255);e.stencilOp(lR.KEEP,lR.KEEP,lR.REPLACE);lR.stencilMask(255);e.colorMask(false,false,false,false);lQ.isMask=true;this.attachNode.render(lR,T,lQ);lR.stencilFunc(lR.NOTEQUAL,1,255);lR.stencilMask(0);e.stencilOp(lR.KEEP,lR.KEEP,lR.KEEP);e.colorMask(true,true,true,true)}for(var lP=0;lPthis.base_opt.nodeMinZoom){lR.clear(lR.STENCIL_BUFFER_BIT);lR.stencilMask(255);lR.stencilFunc(lR.ALWAYS,1,255);lQ.isMask=false;this.attachNode.render(lR,T,lQ)}}return}if(this.buffer[0].length>0){if(this.style_opt.borderMask&&this.style_opt.borderCovered){lR.clear(lR.STENCIL_BUFFER_BIT);lR.stencilFunc(lR.ALWAYS,1,255);e.stencilOp(lR.KEEP,lR.KEEP,lR.REPLACE);lR.stencilMask(255);e.colorMask(false,false,false,false);for(var lP=0;lPthis.base_opt.nodeMinZoom&&this.base_opt.nodeMask){lQ.clear(lQ.STENCIL_BUFFER_BIT);lQ.stencilFunc(lQ.ALWAYS,1,255);e.stencilOp(lQ.KEEP,lQ.KEEP,lQ.REPLACE);lQ.stencilMask(255);e.colorMask(false,false,false,false);lO.isMask=true;this.attachNode.render(lQ,C,lO);lQ.stencilFunc(lQ.NOTEQUAL,1,255);lQ.stencilMask(0);e.stencilOp(lQ.KEEP,lQ.KEEP,lQ.KEEP);e.colorMask(true,true,true,true)}for(var T=0;Tthis.base_opt.nodeMinZoom){lQ.clear(lQ.STENCIL_BUFFER_BIT);lQ.stencilMask(255);lQ.stencilFunc(lQ.ALWAYS,1,255);lO.isMask=false;this.attachNode.render(lQ,C,lO)}},traceControl:function(i){if(this.style_opt.traceControl instanceof Function){var e=this.style_opt.traceControl.bind(this)(i);if(e instanceof Array&&e.length===i.length){return e}}return[]},drawLine:function(l5,lZ,l2,l7){if(!lZ.element1||(lZ.element1&&lZ.element1.length===0)){return}var l3=l5.gl;var lO=l5.programMgr.useProgram("linelayer",{def:this.def});var lT=this._texture[lZ.textureKey];var lU=null;var l6=0;var lW=this.map.getZoom();var lV=this;if(lT){var lX=lT.texture;if(lX instanceof HTMLCanvasElement||(window.ImageBitmap&&lX instanceof window.ImageBitmap)){if(!lT.glTexture){lT.glTexture=ez.utils.createTexture(l3,lX,{flipY:false,wrap:this.style_opt.sequence?l3.CLAMP_TO_EDGE:l3.REPEAT,unpackAlpha:true})}lU=lT.glTexture}else{if(!lT.glTexture){lT.glTexture={status:"init"};var l9=new Image();l9.crossOrigin="anonymous";l9.onload=function(){lT.glTexture.texture=ez.utils.createTexture(l3,this,{flipY:false,wrap:lV.style_opt.sequence?l3.CLAMP_TO_EDGE:l3.REPEAT,unpackAlpha:true});lT.glTexture.status="done";lV.doOnceDraw()};l9.src=lX}if(lT.glTexture.status!=="done"){return}lU=lT.glTexture.texture}l5._state.activeTexture(l3.TEXTURE4);l3.bindTexture(l3.TEXTURE_2D,lU);if(lO.uniforms.lastSampler!==4){l3.uniform1i(lO.uniforms.u_image,4);lO.uniforms.lastSampler=4}l6=lT.totalDashLen}if(this.base_opt.isLinear&&this.linearTexture){l5._state.activeTexture(l3.TEXTURE5);l3.bindTexture(l3.TEXTURE_2D,this.linearTexture);if(lO.uniforms.lastSampler!==5){l3.uniform1i(lO.uniforms.u_linear_image,5);lO.uniforms.lastSampler=5}}var C=this.opacity;if(lO.lastState.opacity!==C){l3.uniform1f(lO.uniforms.u_opacity,C);lO.lastState.opacity=C}var lP=this.style_opt.sequence;if(lO.lastState.sequence!==lP){l3.uniform1i(lO.uniforms.u_sequence,lP);lO.lastState.sequence=lP}var i=this.style_opt.marginLength;if(lO.lastState.marginLength!==i){l3.uniform1f(lO.uniforms.u_margin_length,i);lO.lastState.marginLength=i}if(lO.lastState.dash!==l6){l3.uniform1f(lO.uniforms.u_dash_length,l6);lO.lastState.dash=l6}if(lO.lastState.mapZoom!==lW){l3.uniform1f(lO.uniforms.u_map_zoom,lW);lO.lastState.mapZoom=lW}var l0=l5._camera._modelViewMatrixLayer;if(!lO.lastState.projMatrix){l3.uniformMatrix4fv(lO.uniforms.u_proj_matrix,false,l5.projMatrix);lO.lastState.projMatrix=true}l3.uniformMatrix4fv(lO.uniforms.u_mv_matrix,false,l0);var l8=Math.pow(2,18-this.map.getZoom());if(lO.lastState.scale!==l8){l3.uniform1f(lO.uniforms.u_scale,l8);lO.lastState.scale=l8}var lS=this.base_opt.isFlat;if(lO.lastState.isFlat!==lS){l3.uniform1i(lO.uniforms.u_flat,lS);lO.lastState.isFlat=lS}var l1=this.base_opt.drawPart||1;if(lO.lastState.drawPart!==l1){l3.uniform1i(lO.uniforms.u_draw_part,l1);lO.lastState.drawPart=l1}var lQ=l5._camera._far||4000;if(lO.lastState.cameraFar!==lQ){l3.uniform1f(lO.uniforms.u_camera_far,lQ);lO.lastState.cameraFar=lQ}l3.uniform1i(lO.uniforms.u_no_gradual,l7||false);var lY;if(!(this.style_opt.traceColor instanceof Array)||this.style_opt.traceColor.length<3){lY=[153,153,153]}else{lY=this.style_opt.traceColor.slice(0,3)}l3.uniform3fv(lO.uniforms.u_trace_color,lY);l3.uniform1i(lO.uniforms.u_trace_disappear,this.style_opt.traceDisappear||false);l3.uniform1i(lO.uniforms.u_stroke_disappear,this.style_opt.strokeDisappear||false);l3.uniform1i(lO.uniforms.u_trace_start,!!this.style_opt.traceStart);l3.uniform1i(lO.uniforms.u_pick_model,l2||this.pickModel);l3.uniform1i(lO.uniforms.u_is_linear,!!this.base_opt.isLinear);l3.uniform4fv(lO.uniforms.u_arrow_color,this.arrow_color);if(lO.lastState.selectColor!==this.select_color){l3.uniform4fv(lO.uniforms.u_pick_color,this.select_color);lO.lastState.selectColor=this.select_color}if(lO.lastState.pickTag!==this.selectedIndex){l3.uniform1i(lO.uniforms.u_pick_tag,this.selectedIndex+1);lO.lastState.pickTag=this.selectedIndex}var l4=this._formatArrayBuffer(this.delIndexs);l3.uniform1iv(lO.uniforms["u_del_tags[0]"],l4);var T=this._formatArrayBuffer(lZ.index);l3.uniform1iv(lO.uniforms["u_trace_index[0]"],T);var e=this.traceControl(lZ.index);var lR=this._formatArrayBuffer(e,true);l3.uniform1fv(lO.uniforms["u_trace_len[0]"],lR);lZ.vao1.bind(l3,lO,lZ.vertex,lZ.element1);l3.drawElements(l3.TRIANGLES,lZ.element1.length,l3.UNSIGNED_SHORT,0);tags=null},onDestroy:function(e,i){this.lines=null;this.buffer=null;this._bufferArray=[];this._texture={};eJ.prototype.onDestroy.call(this);if(this.attachNode){this.attachNode.onDestroy()}},toString:function(){return"LineLayer"}});function eI(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("FillLayer")}e=e||{};this.type="polygon";this.style_opt={fillColor:"#142655",fillOpacity:1,pattern:false,patternMask:true,patternUrl:"",patternMapping:"0, 0, 32, 32",patternScale:1,patternOffset:"0, 0",height:0};this._appendStyle={height:{format:"number",defaultValue:0},};this.setStyleOptions(e.style||{});this._bufferArray=[];this._texture=null;eJ.call(this,e);e.border=e.border===undefined?true:e.border;if(e.border){var i=JSON.parse(JSON.stringify(e));i=Object.assign(i,{enablePicked:false,autoSelect:false});this.attach=new cg(i)}}eI.inherits(eJ,"FillLayer");fK.extend(eI.prototype,{onAdd:function(e,i){if(this.attach){this.attach.onAdd(e,i)}if(!this.map){this.map=e;this.gl=i}if(!this.buffer){this.parseData()}},parseData:function(e){if(!this.loadModule||!this.styleExpress||!this.map||!this.map._normalLayerMgr){return}var C=this.getData();if(!C){return}if(this.attach){if(e&&e instanceof c4){this.attach.center=e}this.attach.setData(C,this.params)}var T=this.dataset=this.formatData(C);this.dispatchEvent(new gC("ondataparsed"));var i=this.fillsParse(T.inner);this.fills=this.combineFill(i);this.buffer=this.createBufferData(this.fills);this.doOnceDraw()},fillsParse:function(lS){var l1=[];for(var lX=0;lX0){lP+=lT[lO-1].length}lQ=iN(lT[lO].pointsArray,null,null,lP);for(var C=0,lS=lQ.length;C=3?lZ[0]:[0,0,0,0];if(lO.lastState.bound!==e){lY.uniform4fv(lO.uniforms.u_bound,e);lO.lastState.bound=e}var l2=lZ.length>=3?lZ[1]:0;if(lO.lastState.scale!==l2){lY.uniform1f(lO.uniforms.u_scale,l2);lO.lastState.scale=l2}var T=lZ.length>=3?lZ[2]:[0,0];if(lO.lastState.offset!==T){lY.uniform2fv(lO.uniforms.u_offset,T);lO.lastState.offset=T}var lR=this.base_opt.isFlat;if(lO.lastState.isFlat!==lR){lY.uniform1i(lO.uniforms.u_flat,lR);lO.lastState.isFlat=lR}var lX=this.base_opt.drawPart||1;if(lO.lastState.drawPart!==lX){lY.uniform1i(lO.uniforms.u_draw_part,lX);lO.lastState.drawPart=lX}var lQ=l1._camera._far||4000;if(lO.lastState.cameraFar!==lQ){lY.uniform1f(lO.uniforms.u_camera_far,lQ);lO.lastState.cameraFar=lQ}lY.uniform1i(lO.uniforms.u_pick_model,this.pickModel);if(lO.lastState.selectColor!==this.select_color){lY.uniform4fv(lO.uniforms.u_pick_color,this.select_color);lO.lastState.selectColor=this.select_color}if(lO.lastState.pickTag!==this.selectedIndex){lY.uniform1i(lO.uniforms.u_pick_tag,this.selectedIndex+1);lO.lastState.pickTag=this.selectedIndex}var l0=this._formatArrayBuffer(this.delIndexs);lY.uniform1iv(lO.uniforms["u_del_tags[0]"],l0);lU.vao1.bind(lY,lO,lU.vertex,lU.element1);lY.drawElements(lY.TRIANGLES,lU.element1.length,lY.UNSIGNED_SHORT,0);tags=null},onDestroy:function(e,i){this.fills=null;this.buffer=null;this._bufferArray=[];this._texture=null;eJ.prototype.onDestroy.call(this);if(this.attach){this.attach.onDestroy()}},toString:function(){return"FillLayer"}});function bb(e){e=e||{};this.type="point";this.style_opt={visibility:true,nodeType:bb.NodeType.SHAPE,shapeType:bb.ShapeType.TRIANGLE,anchor:bb.Anchor.CENTER,size:32,scale:1,rotation:0,offset:[0,0],color:"green",opacity:1,strokeColor:"red",strokeWeight:0};this.setStyleOptions(e.style||{});this._bufferArray=[];e.isFlat=e.isFlat===undefined?true:e.isFlat;eJ.call(this,e);iF.sendMessage("PointShapeLayer")}bb.Anchor={CENTER:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,RIGHT_CENTER:4,BOTTOM_RIGHT:5,BOTTOM_CENTER:6,BOTTOM_LEFT:7,LEFT_CENTER:8,0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8};bb.NodeType={ICON:1,SHAPE:2};bb.ShapeType={CIRCLE:0,SQUARE:1,TRIANGLE:2,DIAMOND:3,CROSS:4,ARROW:5,ARROW_TAIL:6,STAR:7,WATERDROP:9,0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,9:9};bb.inherits(eJ,"PointShapeLayer");bb.hasMask=function(e){if(e===bb.ShapeType.TRIANGLE||e===bb.ShapeType.ARROW){return true}else{return false}};fK.extend(bb.prototype,{onAdd:function(e,i){if(!this.map){this.map=e;this.gl=i}if(!this.buffer){this.parseData()}},parseData:function(){if(!this.loadModule||!this.styleExpress||!this.map||!this.map._normalLayerMgr){return}var lO=this.getData();if(!lO){return}var lP=this.dataset=this.formatData(lO);this.dispatchEvent(new gC("ondataparsed"));var lQ=this.pointsParse(lP);this.buffer=[];var e=0;for(var C=0;C=0){if(!lT[C]){lT[C]=[]}lT[C].push(lO)}}}return lT},_findTargetGroup:function(C,lO){for(var T=0;T65536){lW.push({vertex:[],indices:[]});lR=lW[lW.length-1].vertex;lU=lW[lW.length-1].indices}for(var lP=0;lP<4;lP++){lR.push(C.position[0],C.position[1]);var T=this.int8ArrayToFloat([C.anchor,lP,C.shapeType,C.lineNodeType]);lR.push(T);lR.push(C.size,C.scale,C.rotation*Math.PI/180);lR.push(C.offset[0],C.offset[1]);var e=this.getColorStyleForGL(C.color,undefined,true);var lV=this.getColorStyleForGL(C.strokeColor,undefined,true);lR.push(this.rgb2value(e),C.opacity,this.rgb2value(lV),C.strokeWeight);if(C.startPoint){lR.push(C.startPoint[0],C.startPoint[1])}else{lR.push(0.1,0.1)}if(C.endPoint){lR.push(C.endPoint[0],C.endPoint[1])}else{lR.push(0.1,0.1)}lR.push(C.id)}var lO=(lU.length/6)*4;lU.push(lO,lO+2,lO+1,lO,lO+3,lO+2)}return lW},createBuffer:function(i){var C=17;var e=[{name:"a_pos",components:2,offset:0,type:"Float32"},{name:"a_shape",components:4,offset:8,type:"Uint8"},{name:"a_transform",components:3,offset:12,type:"Float32"},{name:"a_offset",components:2,offset:24,type:"Float32"},{name:"a_data",components:4,offset:32,type:"Float32"},{name:"a_start",components:2,offset:48,type:"Float32"},{name:"a_end",components:2,offset:56,type:"Float32"},{name:"a_id",components:1,offset:64,type:"Float32"}];return new D(i,{components:C,members:e},D.BufferType.VERTEX)},createBufferData:function(lQ,e){var lR=[];e=e||0;for(var T=0;TlQ.renderIndex){for(var lO=0;lO65536){e.push({vertex:[],indices:[]});T=e[e.length-1].vertex;lP=e[e.length-1].indices}for(var C=3;C>=0;C--){T.push(lO.position[0],lO.position[1]);if(this.style_opt.userSizes){T.push(lO.sizes[0],lO.sizes[1],lO.anchors[0],lO.anchors[1])}else{T.push(lO.width,lO.height,lO.anchors[0],lO.anchors[1])}T.push(lO.scale,lO.rotation*Math.PI/180,4-C,lO.opacity);T.push(lO.offset[0],lO.offset[1],lO.texcoord[C*2],lO.texcoord[C*2+1]);T.push(lO.id)}var i=(lP.length/6)*4;lP.push(i,i+2,i+1,i,i+3,i+2)},createBuffer:function(i){var C=13;var e=[{name:"a_pos",components:2,offset:0,type:"Float32"},{name:"a_shape",components:4,offset:8,type:"Float32"},{name:"a_style",components:4,offset:24,type:"Float32"},{name:"a_data",components:4,offset:40,type:"Float32"},{name:"a_id",components:1,offset:56,type:"Float32"}];return new D(i,{components:C,members:e},D.BufferType.VERTEX)},createBufferData:function(lP){var lQ=[];for(var C=0;ClQ.renderIndex){for(var lO=0;lO=0&&C0){this._layer.setData(e)}else{this._layer.clearData()}},_toGeoJSON:function(T){var C=[];for(var e=0;e=9000&&lT.current_city["code"]<=9378){lT.current_city["name"]="台湾省"}if(lT.current_city["code"]>=20000&&lT.current_city["code"]<=20499){lT.current_city["name"]="新加坡"}if(lT.current_city["code"]>=20500&&lT.current_city["code"]<=25999){lT.current_city["name"]="泰国"}if(lT.current_city["code"]>=26000&&lT.current_city["code"]<=29999){lT.current_city["name"]="日本"}if(lT.current_city["code"]>=30000&&lT.current_city["code"]<=30999){lT.current_city["name"]="韩国"}if(lT.current_city["code"]>=31000&&lT.current_city["code"]<=37000){lT.current_city["name"]="亚太"}if(lT.current_city["code"]>=46609&&lT.current_city["code"]<=52505){lT.current_city["name"]="欧洲"}if(lT.current_city["code"]>=39509&&lT.current_city["code"]<=53500){lT.current_city["name"]="南美洲"}if(lT.current_city["code"]>=54000&&lT.current_city["code"]<=70000){lT.current_city["name"]="北美洲"}if(lT.current_city["code"]===54003&&lT.current_city["code"]>=60731&&lT.current_city["code"]<=61123){lT.current_city["name"]="美国"}if(lT.current_city["code"]===54015||lT.current_city["code"]>=57970&&lT.current_city["code"]<=60223){lT.current_city["name"]="加拿大"}if(lT.current_city["code"]===54025||lT.current_city["code"]>=54338&&lT.current_city["code"]<=57374){lT.current_city["name"]="墨西哥"}e.enableRequest=true;if(lT&&lT.current_city){var lS=lT.current_city["name"];var lR=lT.current_city["code"];if(lR!==i.cCode){var lQ=new gC("oncitychange");lQ.name=lS;lQ.code=lR;i.dispatchEvent(lQ)}i.cityName=lS;i.cCode=lR;if(!cl()){dA(i)}}},{qt:"cen",b:C.lng+","+C.lat+";"+lO.lng+","+lO.lat,l:lP},"","",true)};i.addEventListener("load",function(C){e.request()});i.addEventListener("moveend",function(C){e.request()});i.addEventListener("zoomend",function(C){e.request()});e.request()});function kJ(C){var e={};var i=new lv(e);C.addControl(i);return i}function bW(C){var i={};var e=new kL(i);C.stickySpamCtrl=e;C.addControl(e);return e}function O(i){if(i.temp.copyadded){return}i.temp.copyadded=true;if(!i.cpyCtrl){var T=new kp(2,2);i.config.cpyCtrlOffset=T;if(cl()){T.width=72;T.height=0}var C=new g3({offset:T,printable:true});i.cpyCtrl=C}if(!cl()||i.config.showCopyrightOnMobile){dA(i);i.addEventListener("maptypechange",function(){dA(i)});i.addEventListener("onlanguage_change",function(){dA(i)})}i.addControl(C);var e=new bX();e._opts={printable:true};i.logoCtrl=e;i.addControl(e);i.addEventListener("resize",function(){if(this.getSize().width>=300&&i.getSize().height>=100){e.show();C&&C.setOffset(i.config.cpyCtrlOffset)}else{e.hide();C&&C.setOffset(new kp(4,2))}});if(i.getSize().width>=300&&i.getSize().height>=100){e.show()}else{e.hide();C.setOffset(new kp(4,2))}i.addEventListener("oncopyrightoffsetchange",function(lO){i.logoCtrl.setOffset(lO.target.logo);i.cpyCtrl.setOffset(lO.target.cpy);if(lO.target.cpy){i.config.cpyCtrlOffset=lO.target.cpy}});i.dispatchEvent(new gC("oncopyrightaddend"))}function dA(l3){if(!l3.cpyCtrl){var mb=new kp(2,2);if(cl()){mb.width=72;mb.height=0}var l6=new g3({offset:mb,printable:true});l3.cpyCtrl=l6}var mk=l3.cityName||"中国";var l4=l3.getMapTypeId();var l5=["常州市","南昌市","乌鲁木齐市","无锡市","福州市","泉州市","珠海市","贵阳市"];var lX=["北京市","上海市","广州市","深圳市","宁波市","石家庄市","沈阳市","长春市","青岛市","温州市","台州市","金华市","佛山市","中山市","昆明市","南宁市","苏州市","西安市","济南市","郑州市","合肥市","呼和浩特市","杭州市","成都市","武汉市","长沙市","天津市","南京市","重庆市","大连市","东莞市","厦门市"];var lZ=["香港特别行政区"];var lS=["台湾省"];var mc=["日本"];var mi=["韩国"];var l7=["泰国"];var ma=["亚太"];var lT=["新加坡"];var mj=["欧洲"];var T=["南美洲"];var mf=["北美洲"];var C=["美国"];var l9=["墨西哥"];var lQ=["加拿大"];for(var mg in l5){if(l5[mg]===mk){var l0=true;break}}for(var mg in lX){if(lX[mg]===mk){var lO=true;break}}for(var mg in lZ){if(lZ[mg]===mk){var mm=true;break}}if(lS[0]===mk){var me=true}if(lT[0]===mk){var i=true}if(mc[0]===mk){var lW=true}if(mi[0]===mk){var l2=true}if(l7[0]===mk){var l1=true}if(ma[0]===mk){var lR=true}if(mj[0]===mk){var lY=true}if(T[0]===mk){var lV=true}if(mf[0]===mk){var e=true}if(C[0]===mk){var mh=true}if(lQ[0]===mk){var md=true}if(l9[0]===mk){var lP=true}var lU=G.getGS(l3.getLanguage());var ml=["© 2026 Baidu - "+lU+"号 - 甲测资字11111342 - 京ICP证030173号 - Data © "];var l8="rgba(255, 255, 255, 0.701961)";if(l3.getZoom()<=9){ml.push("百度智图");ml.push(' & OpenStreetMap');ml.push(' & HERE');if(l4===hY||l4===d7){ml.push(' & ESO');l8="rgba(0,0,0,.7)"}}else{if(lW||l2){ml.push('OpenStreetMap')}else{if(i||l1){ml.push('HERE')}else{if(lR){ml.push('HERE');ml.push(' & Mapbox')}else{if(lY){ml.push('OpenStreetMap');ml.push(' & Mapbox')}else{if(lV){ml.push('OpenStreetMap');ml.push(' & Mapbox')}else{if(mh||lP||md){ml.push('HERE');ml.push(' & Mapbox')}else{if(e){ml.push('OpenStreetMap');ml.push(' & Mapbox')}else{ml.push("百度智图");if(l0){ml.push(' & PalmCity')}if(mm){ml.push(' & MapKing')}if(me){ml.push(' & HERE');ml.push(' & 樂客LocalKing')}if(l4===hY||l4===d7){l8="rgba(0,0,0,.7)"}}}}}}}}}ml.unshift('');ml.push("");ml=ml.join("");l3.cpyCtrl.addCopyright({id:1,content:ml})}function lv(e){this["defaultAnchor"]=BMAP_ANCHOR_TOP_RIGHT;this["defaultOffset"]=e.defaultOffset||new kp(90,6);this._cZIndex=9999;this._visible=false}lv.prototype=new hG();lv.prototype.initialize=function(lO){this._map=lO;var T=this;var e=cm("div");var i=e.style;i.left=i.top="50%";i.display="none";i.padding="24px";i.overflow="visible";i.position="absolute";i.width="50%";i.maxWidth="360px";i.transform="translate(-50% , -50%)";i.zIndex="9999";i.background="#fff";i.userSelect="none";var lP=cm("span",{style:"margin-top: 12px;\n margin-bottom: -12px;\n margin-left: calc(100% - 48px);\n width: 56px;\n height: 32px;\n font-size: 14px;\n text-align: center;\n line-height: 32px;\n display: block;\n cursor: pointer;\n background: #3894FF;\n border: solid 1px #3f51b53b;\n color: #fff;\n border-radius: 3px;"});lP.innerText="确定";lP.addEventListener("click",function(){T.hide()});var C=cm("div");var lQ=C.style;lQ.position="relative";lQ.width="100%";lQ.height="100%";lQ.color="#000";lQ.fontSize="14px";lQ.wordBreak="break-all";e.appendChild(C);e.appendChild(lP);lO.getContainer().appendChild(e);return e};lv.prototype._setPosition=function(){};lv.prototype.update=function(e){if(!this.isVisible()){this._container.firstChild.innerText=e;this.show()}};function kL(C){hG.call(this);C=C||{};this._opts={};this._opts=fK.extend(this._opts,C);var i=jo();var lO=cd.popup_code;var e="系统于"+i.year+"年"+i.month+"月"+i.day+"日";this._prefixMsg="【"+lO+"】"+e;this["defaultAnchor"]=eY.TOP_RIGHT;var T=cl()?new kp(40,40):new kp(200,40);this["defaultOffset"]=C.defaultOffset||T;this._cZIndex=9999;this._visible=false}kL.inherits(hG,"StickySpam");kL.prototype.initialize=function(lO){this._map=lO;var T=this;var e=this._container=cm("div");var i=e.style;i.display="none";i.padding="10px 15px";i.overflow="visible";i.maxWidth=cl()?"250px":"360px";i.background="#fff8ee";i.borderWidth="3px";i.borderStyle="solid";i.borderColor="#e29e32";i.position="relative";var C=cm("div");var lP=C.style;lP.position="relative";lP.width="100%";lP.height="100%";lP.color="#e29e32";lP.fontSize="14px";lP.fontWeight="500";lP.wordBreak="break-all";lP.lineHeight="1.5";C.style.cssText+="; a { color: #1565c0; text-decoration: none; border-bottom: 1px solid rgba(21, 101, 192, 0.3); }";C.style.cssText+='; a[href^="tel:"] { color: #2e7d32; border-bottom-color: rgba(46, 125, 50, 0.3); }';e.appendChild(C);lO.getContainer().appendChild(e);return e};kL.prototype.update=function(i){if(!this.isVisible()){var e=this._convertUrlsToLinks(this._prefixMsg+i);this._container.firstChild.innerHTML=e;this.show()}};kL.prototype._convertUrlsToLinks=function(C){C=C.replace(/\n/g,"
");var i=/(https?:\/\/[^\s]+)/g;C=C.replace(i,function(T){if(T.length>200){return T}if(!T.match(/^https?:\/\//)){return T}return''+T+""});var e=/(\d{3,4}[-\s]?\d{3,4}[-\s]?\d{4}|\d{11})/g;C=C.replace(e,function(T){var lO=T.replace(/[-\s]/g,"");return''+T+""});return C};window.BMAP_STATUS_SUCCESS=0;window.BMAP_STATUS_CITY_LIST=1;window.BMAP_STATUS_UNKNOWN_LOCATION=2;window.BMAP_STATUS_UNKNOWN_ROUTE=3;window.BMAP_STATUS_INVALID_KEY=4;window.BMAP_STATUS_INVALID_REQUEST=5;window.BMAP_STATUS_PERMISSION_DENIED=6;window.BMAP_STATUS_SERVICE_UNAVAILABLE=7;window.BMAP_STATUS_TIMEOUT=8;window.BMAP_ROUTE_TYPE_WALKING=2;window.BMAP_ROUTE_TYPE_DRIVING=3;window.BMAP_ROUTE_TYPE_RIDING=6;window.BMAP_ROUTE_STATUS_NORMAL=0;window.BMAP_ROUTE_STATUS_EMPTY=1;window.BMAP_ROUTE_STATUS_ADDRESS=2;var F="carport_list";var ex="carport_auth";var dP="cur";var ae="cen";var N="s";var ea="con";var d0="bd";var dq="nb";var h1="bt";var a1="nav";var jp="walk";var gL="gc";var eB="rgc";var P="dec";var jI="iploc";var hH="bse";var ha="nse";var dL="s";var e6="bsl";var gI="bda";var e2="sa";var bq="nba";var jw="drag";var kq="ext";var ld="exts";var lh="hip";var iJ="ride";var lu="drct";var cq="ldt";var aD="place";var ge=2;var by=4;var gT=7;var jx=11;var cA=12;var fE=14;var dn=15;var eS=18;var aL=20;var bp=21;var M=19;var a=23;var jW=26;var aN=28;var hb=31;var fT=35;var jJ=44;var bw=45;var aI=46;var la=47;var hh=-1;var bt=0;var bR=1;var kw=2;var eq=3;window.BMAP_POI_TYPE_NORMAL=0;var c8=1;var jA=2;BMapGL.I=fK.I;var b3={};b3.removeHtml=function(e){e=e.replace(/<\/?[^>]*>/g,"");e=e.replace(/[ | ]* /g," ");return e};b3.parseGeoExtReg1=function(e){return e.replace(/([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0|[1-9]\d*),([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0|[1-9]\d*)(,)/g,"$1,$2;")};b3.parseGeoExtReg2=function(i,e){var C=new RegExp("(((-?\\d+)(\\.\\d+)?),((-?\\d+)(\\.\\d+)?);)(((-?\\d+)(\\.\\d+)?),((-?\\d+)(\\.\\d+)?);){"+e+"}","ig");return i.replace(C,"$1")};var ei=0;var dN=1;var Y=2;b3.unique=function(C){var lP=false;var lO=[];var lQ={};for(var T=0,e=C.length;T21){C=21}return C};b3.parseGeo=function(lQ,lT){if(typeof lQ!="string"||!lQ){return}var lV=lQ.split("|");var e;var lO;var C;if(lV.length==1){e=cr(lQ)}else{e=cr(lV[2]);lO=cr(lV[0]);C=cr(lV[1]);if(!lT){return e}}var lR={type:e.geoType};if(lT){switch(lR.type){case Y:var lS=new c4(e.geo[0][0],e.geo[0][1]);var lU=kz.convertMC2LL(lS);lR.point=lU;lR.points=[lU];break;case dN:lR.points=[];var lW=e.geo[0];for(var lP=0,T=lW.length-1;lP0.25&&lX<1){lX=1}else{if(lX>32){lX=32}}}}var lS=l6.split("|");if(lS.length==1){var T=cr(lS[0]);return{type:T.type,bound:"",points:T.geo.join(",")}}else{if(lS.length>1){var lY=l6.split(";.=");var lU=[];var lO=[];var lZ=0;var l3=lY.length;for(var l0=0;l01){if(l0==0){l5=l5+";"}if(l0>0&&l00){l4=b3.parseGeoExtReg2(l4,lX)}lO.push(l4)}if(l3<=1){lO=lO.join(";")}if(l3==2){var C=lO[0]+";"+lO[1];var lQ=C.split(";");var e=[];for(var l0=0;l0dJ){e=dJ-e}if(lR>dJ){lR=dJ-lR}T.push(T[C-2]+e);T.push(T[C-1]+lR);return 0}function d9(i){var e=i.charCodeAt(0);if(i>="A"&&i<="Z"){return e-"A".charCodeAt(0)}else{if(i>="a"&&i<="z"){return(26+e-"a".charCodeAt(0))}else{if(i>="0"&&i<="9"){return(52+e-"0".charCodeAt(0))}else{if(i=="+"){return 62}else{if(i=="/"){return 63}}}}}return -1}b3.pathToPoints=function(lP){var T=[];if(typeof lP!=="string"){return T}else{var lO=lP.split(";");for(var C=0;Cc7.MAX_PAGE_CAPACITY?c7.DEFAULT_PAGE_CAPACITY:e)}else{this._opts.pageCapacity=c7.DEFAULT_PAGE_CAPACITY}},getPageCapacity:function(){return this._opts.pageCapacity},setPageNum:function(e){if(typeof e=="number"&&!isNaN(e)&&e>=0){this._opts.pageNum=e}else{this._opts.pageNum=c7.DEFAULT_PAGE_NUM}},getPageNum:function(){return this._opts.pageNum},toString:function(){return"LocalSearch"}});function bz(i){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("Geocoder")}this._opts={};this.setOptions(i||{});this._queryList=[];var e=this;h6.load("otherSearch",function(){e._asyncSearch()})}bz.inherits(dH,"Geocoder");fK.extend(bz.prototype,{getPoint:function(e,C,i){iF.sendMessage("Geocoder","getPoint");this._queryList.push({method:"getPoint",arguments:[e,C,i]})},getLocation:function(e,C,i){iF.sendMessage("Geocoder","getLocation");this._queryList.push({method:"getLocation",arguments:[e,C,i]})},setOptions:function(e){fK.extend(this._opts,e||{});if(this._opts.language&&(this._opts.language===BMAP_LANGUAGE_ZH||this._opts.language===BMAP_LANGUAGE_EN)){this._language=this._opts.language}else{this._language=BMAP_LANGUAGE_ZH}},toString:function(){return"Geocoder"}});function dv(e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("Geolocation")}e=e||{};this.config={timeout:e.timeout||1000*10,maximumAge:e.maximumAge||0,enableHighAccuracy:e.enableHighAccuracy===undefined?true:e.enableHighAccuracy,SDKLocation:e.SDKLocation||false};this._pendingCalls=[];var i=this;h6.load("otherSearch",function(){var C=i._pendingCalls.length;for(var T=0;T=BMAP_TRANSIT_POLICY_RECOMMEND&&e<=BMAP_TRANSIT_POLICY_FIRST_SUBWAYS){this._opts.policy=e}else{this._opts.policy=BMAP_TRANSIT_POLICY_RECOMMEND}},setIntercityPolicy:function(e){if(e>=BMAP_INTERCITY_POLICY_LEAST_TIME&&e<=BMAP_INTERCITY_POLICY_CHEAP_PRICE){this._opts.intercityPolicy=e}else{this._opts.intercityPolicy=BMAP_INTERCITY_POLICY_LEAST_TIME}},setTransitTypePolicy:function(e){if(e>=BMAP_TRANSIT_TYPE_POLICY_TRAIN&&e<=BMAP_TRANSIT_TYPE_POLICY_COACH){this._opts.transitTypePolicy=e}else{this._opts.transitTypePolicy=BMAP_TRANSIT_TYPE_POLICY_TRAIN}},_internalSearch:function(i,e){this._queryList.push({method:"_internalSearch",arguments:[i,e]})},search:function(i,e){iF.sendMessage("TransitRoute","search");this._queryList.push({method:"search",arguments:[i,e]})},setPageCapacity:function(e){if(typeof e==="string"){e=parseInt(e,10);if(isNaN(e)){this._opts.pageCapacity=fx.MAX_PAGE_CAPACITY;return}}if(typeof e!=="number"){this._opts.pageCapacity=fx.MAX_PAGE_CAPACITY;return}if(e>=1&&e<=fx.MAX_PAGE_CAPACITY){this._opts.pageCapacity=Math.round(e)}else{this._opts.pageCapacity=fx.MAX_PAGE_CAPACITY}},toString:function(){return"TransitRoute"},_shortTitle:function(e){return e.replace(/\(.*\)/,"")}});window.BMAP_HIGHLIGHT_STEP=1;window.BMAP_HIGHLIGHT_ROUTE=2;var dd=function(e,T){lk.call(this,e,T);this._overlays=[];this._curIndex=-1;this._queryList=[];var C=this;var i=this._opts.renderOptions;if(i.highlightMode!==BMAP_HIGHLIGHT_STEP&&i.highlightMode!==BMAP_HIGHLIGHT_ROUTE){i.highlightMode=BMAP_HIGHLIGHT_STEP}this._enableDragging=this._opts.renderOptions.enableDragging?true:false;h6.load("route",function(){C._asyncSearch()},true);if(this.init_d){this.init_d()}};dd.ROAD_TYPE=["","roundabout","unknownRoad","mainRoad","highwayConnector","roadSegWithinInter","connectingRoad","parkInnerRoad","serviceInnerRoad","bridge","pedeStreet","serviceRoad","ramp","fullyEnclosedRoad","undefinedTrafficArea","poiConnectorRoad","tunnel","footpath","busOnlyLane","advancedLeftLane",];fK.inherit(dd,lk,"DWRoute");fK.extend(dd.prototype,{search:function(C,e,i){iF.sendMessage(this._className,"search");this._queryList.push({method:"search",arguments:[C,e,i]})}});var j7=function(e,lO){lk.call(this,e,lO);this._overlays=[];this._queryList=[];var T=this;this.map=lO.renderOptions.map;this._enableDragging=this._opts.renderOptions.enableDragging?true:false;this._lineLayerStyle={lineLayerColor:this._opts.renderOptions.lineLayerStyle.lineLayerColor||{color:"#0089ff",opacity:1},isTop:this._opts.renderOptions.isTop||false,showTraffic:this._opts.renderOptions.lineLayerStyle.showTraffic||false,sequence:this._opts.renderOptions.sequence||true,marginLength:this._opts.renderOptions.marginLength||32,borderColor:this._opts.renderOptions.lineLayerStyle.borderColor||"#0089ff",borderMask:this._opts.renderOptions.lineLayerStyle.borderMask||false,borderWeight:this._opts.renderOptions.lineLayerStyle.borderWeight||2,strokeWeight:this._opts.renderOptions.lineLayerStyle.strokeWeight||6,strokeLineJoin:this._opts.renderOptions.lineLayerStyle.strokeLineJoin||"round",strokeLineCap:this._opts.renderOptions.lineLayerStyle.strokeLineCap||"round",strokeTextureUrl:G.bosPath+"up-to.png",strokeTextureWidth:this._opts.renderOptions.lineLayerStyle.strokeTextureWidth||32,strokeTextureHeight:this._opts.renderOptions.lineLayerStyle.strokeTextureHeight||64,};if(this._opts.renderOptions.lineLayerStyle.strokeTextureUrl){this._lineLayerStyle.strokeTextureUrl=this._opts.renderOptions.lineLayerStyle.strokeTextureUrl}else{if(this._opts.renderOptions.lineLayerStyle.strokeTextureUrl===null){delete this._lineLayerStyle.strokeTextureUrl}}if(this.map){this._menu=new BMapGL.ContextMenu();var i=dT.translate("delPoint",this._language);var C=new jc(i,function(lR,lQ,lP){T._deleteVia(lP.curNo-1)},60);this._menu.addItem(C);this.map.addContextMenu(this._menu,true);this.map.addEventListener("onlanguage_change",function(lP){C.setText(dT.translate("delPoint",T.map.getLanguage()))})}h6.load("route",function(){T._asyncSearch()},true);if(this.init_d){this.init_d()}};fK.inherit(j7,lk,"LineLayerRoute");fK.extend(j7.prototype,{search:function(C,e,i){iF.sendMessage(this._className,"search");this._queryList.push({method:"search",arguments:[C,e,i]})}});window.BMAP_DRIVING_POLICY_DEFAULT=0;window.BMAP_DRIVING_POLICY_DESTANCE=2;window.BMAP_DRIVING_POLICY_AVOID_HIGHWAYS=3;window.BMAP_DRIVING_POLICY_FIRST_HIGHWAYS=4;window.BMAP_DRIVING_POLICY_AVOID_CONGESTION=5;window.BMAP_DRIVING_POLICY_AVOID_PAY=6;window.BMAP_DRIVING_POLICY_HIGHWAYS_AVOID_CONGESTION=7;window.BMAP_DRIVING_POLICY_AVOID_HIGHWAYS_CONGESTION=8;window.BMAP_DRIVING_POLICY_AVOID_CONGESTION_PAY=9;window.BMAP_DRIVING_POLICY_AVOID_HIGHWAYS_CONGESTION_PAY=10;window.BMAP_DRIVING_POLICY_AVOID_HIGHWAYS_PAY=11;window.BMAP_DRIVING_POLICY_DISTANCE_PRIORITY=12;window.BMAP_DRIVING_POLICY_TIME_PRIORITY=13;window.BMAP_TRAFFICE_STATUS_NONE=0;window.BMAP_TRAFFICE_STATUS_NORMAL=1;window.BMAP_TRAFFICE_STATUS_SLOW=2;window.BMAP_TRAFFICE_STATUS_JAM=3;function cV(e,i){dd.call(this,e,i);i=i||{};this._opts._enableTraffic=i.enableTraffic||false;this.setPolicy(i.policy);this.alternatives=i.alternatives||0;this.QUERY_TYPE=a1;this.RETURN_TYPE=aL;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_DRIVING;iF.sendMessage("DrivingRoute","search")}function gV(e,i){j7.call(this,e,i);i=i||{};this.setPolicy(i.policy);this.alternatives=i.alternatives||0;this.QUERY_TYPE=a1;iF.sendMessage("DrivingRoute","searchLine")}fK.inherit(gV,j7,"DrivingRouteLine");fK.inherit(cV,dd,"DrivingRoute");cV.prototype.setPolicy=function(e){if(e>=BMAP_DRIVING_POLICY_DEFAULT&&e<=BMAP_DRIVING_POLICY_TIME_PRIORITY){this._opts.policy=e}else{this._opts.policy=BMAP_DRIVING_POLICY_DEFAULT}};gV.prototype.setPolicy=function(e){if(e>=BMAP_DRIVING_POLICY_DEFAULT&&e<=BMAP_DRIVING_POLICY_TIME_PRIORITY){this._opts.policy=e}else{this._opts.policy=BMAP_DRIVING_POLICY_DEFAULT}};function gf(e,i){dd.call(this,e,i);this.QUERY_TYPE=jp;this.RETURN_TYPE=hb;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_WALKING;this._enableDragging=false}fK.inherit(gf,dd,"WalkingRoute");function dD(e,i){dd.call(this,e,i);this.QUERY_TYPE=iJ;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_RIDING;this._enableDragging=false}fK.inherit(dD,dd,"RidingRoute");function ab(e,i){j7.call(this,e,i);i=i||{};if(i.renderOptions&&i.renderOptions["lineType"]!==undefined){this._lineType=i.renderOptions["lineType"]}else{this._lineType=0}this.QUERY_TYPE=cq;this.setPolicy(i.policy)}fK.inherit(ab,j7,"TruckRoute");ab.prototype.setPolicy=function(e){if(e>=BMAP_DRIVING_POLICY_DEFAULT&&e<=BMAP_DRIVING_POLICY_AVOID_CONGESTION){this._opts.policy=e}else{this._opts.policy=BMAP_DRIVING_POLICY_DEFAULT}};window.BMAP_MODE_DRIVING="driving";window.BMAP_MODE_TRANSIT="transit";window.BMAP_MODE_WALKING="walking";window.BMAP_MODE_NAVIGATION="navigation";var bk={web:G.urlProtocol+"//api.map.baidu.com/direction?",android:"bdapp://map/direction?",ios:"baidumap://map/direction?"};function j4(e){this.opts=e||{}}fK.extend(j4.prototype,{routeCall:function(T,e,C){var i=this;h6.load("route",function(){i._asyncSearch(T,e,C)})}});function eO(){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("PanoramaCoverageLayer")}return Pano.getStreetViewCoverageLayer(bS)}function fz(){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("PanoramaService")}Pano.PanoramaService.call(this)}fK.inherit(fz,Pano.PanoramaService,"PanoramaService");fK.extend(fz.prototype,{getPanoramaById:function(C,i){var e=this;this.getPanoById(C,function(T){i&&i(e._makeData(T))})},getPanoramaByLocation:function(e,C){e=kz.convertLL2MC(e);var i=this;this.getPanoByLocation(e,50,function(T){C&&C(i._makeData(T))})},_makeData:function(C){if(!C){return null}var i={};var e=C.content[0];i.description=e.Rname||e.Info||"";i.id=e.ID;i.pointX=e.X/100;i.pointY=e.Y/100;i.position=kz.convertMC2LL(new c4(i.pointX,i.pointY));return i}});function f5(){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("PanoramaControl")}if(window.PANORAMA_URL){return Pano.getPanoControl(bS,{imgPath:G.imgPath,tileBaseUrl:G.panoTilePath,})}return Pano.getPanoControl(bS)}function U(C,e){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("PanoramaLabel")}if(!e){return}this.content=C;if(e.position&&!Array.isArray(e.position)){e.position=kz.convertLL2MC(e.position);this.position=e.position;this.hideDistance=!!e.hideDistance}else{this.hideDistance=true}var i=this._createDom();Pano.PanoOverlay.call(this,e.position,{dom:i,altitude:e.altitude,})}fK.inherit(U,Pano.PanoOverlay,"PanoramaLabel");fK.extend(U.prototype,{init:function(e){var i=this;this._pano=e;this.updatedDistance();Pano.PanoOverlay.prototype.init.call(this,e);this._pano.on("dataload",function(C){i.updatedDistance()})},_createDom:function(){var T=this.content;var lQ=document.createElement("div");var i=lQ.style;i.position="absolute";i.backgroundColor="rgba(29, 29, 29, 0.8)";i.padding="7px 0";i.height="19px";i.font="16px arial";i.color="white";i.whiteSpace="nowrap";i.borderRadius="4px";var e=document.createElement("div");e.style["float"]="left";e.style["lineHeight"]="19px";lQ.appendChild(e);var C=document.createElement("span");C.style.margin="0 14px";C.innerText=T;e.appendChild(C);if(!this.hideDistance){var lP=document.createElement("span");lP.style.color="color:rgba(255,255,255,0.3)";lP.innerText="|";e.appendChild(lP);var lO=document.createElement("span");lO.style.margin="0 8px";lO.style.color="#60c7fa";lO.style.fontSize="12px";lO.innerText="0米";e.appendChild(lO);this._distanceDom=lO}this._dom=lQ;this._titleDom=C;return lQ},updatedDistance:function(){if(this.hideDistance){return}var C=0;if(this._pano){var i=this._pano.position;var e=this.position;if(i&&!i.equals(e)){C=kz.getDistanceByMC(i,e)}}if(C>100){C=C/1000;C=C<100?C.toFixed(2):C.toFixed(0);C+="公里"}else{C=C<100?C.toFixed(2):C.toFixed(0);C+="米"}this._distanceDom.innerText=C},});function f(i,lP){if(typeof iF!=="undefined"&&iF.sendMessage){iF.sendMessage("Panorama")}if(typeof i==="string"&&/^(?!#)(\w)*/.test(i)){i="#"+i}var T={};if(window.PANORAMA_URL){T.imgPath=G.imgPath;T.tileBaseUrls=[G.panoTilePath]}var e=Pano.init(i,T);var C=e.setPosition;e.setPosition=function(lQ){var lR=kz.convertLL2MC(lQ);C.call(e,lR)};var lO=e.addEventListener;e.addEventListener=function(lQ,lR){if(lQ==="position_changed"){lO.call(e,lQ,function(lS){var lT=kz.convertMC2LL(lS);lR(lT)})}else{lO.call(e,lQ,lR)}};if(lP){lP.on("destroy",function(){e.destroy()})}return e}bS.MapConfig=G;bS.Map=iX;function dZ(e){if(e===3||e===3||e==="3"||e==="3.0"){return"3.0"}return"gl"}function fD(e){e=dZ(e);if(G){G.apiVersion=e}if(e==="3.0"){bS.MapType=ai;bS.Projection=bS.Project=hc;bS.BMAP_NORMAL_MAP=BMAP_NORMAL_MAP;bS.BMAP_SATELLITE_MAP=BMAP_SATELLITE_MAP;bS.BMAP_HYBRID_MAP=BMAP_HYBRID_MAP;bS.BMAP_EARTH_MAP=BMAP_EARTH_MAP;bS.BMAP_NONE_MAP=BMAP_NONE_MAP}else{bS.MapType=e1;bS.Projection=bS.Project=kz;bS.BMAP_NORMAL_MAP="B_NORMAL_MAP";bS.BMAP_SATELLITE_MAP="B_SATELLITE_MAP";bS.BMAP_HYBRID_MAP="B_STREET_MAP";bS.BMAP_EARTH_MAP="B_EARTH_MAP";bS.BMAP_NONE_MAP="B_NONE_MAP"}}Object.defineProperty(bS,"apiVersion",{enumerable:true,configurable:true,get:function(){return G.apiVersion},set:function(e){fD(e)}});bS.MapType=e1;bS.Point=c4;bS.Pixel=f8;bS.Size=kp;bS.Bounds=je;bS.PrivateRegionDataModel=dk;bS.TileLayer=iE;bS.Copyright=p;bS.Projection=bS.Project=kz;bS.XYZProjection=bS.XYZProject=ef;bS.MercatorProjection=kz;bS.Convertor=gN;bS.RenderTypeUtils=dF;bS.Overlay=a5;bS.Label=i7;bS.Marker=v;var jy=f6;var bF=function(e,i){if(typeof e==="string"||typeof e==="number"){return new eo(e,i)}jy.call(this,e,i)};bF.prototype=jy.prototype;bS.Symbol=bF;bS.SVGSymbol=eo;bS.Icon=kW;bS.Polyline=bG;bS.BezierCurve=df;bS.PolylineMultipart=e4;bS.Polygon=j3;bS.MapMask=lA;bS.Prism=bM;bS.Marker3D=eT;bS.GroundOverlay=gU;bS.GroundPoint=et;bS.CustomOverlay=b7;bS.CanvasLayer=gs;bS.CustomHtmlLayer=eb;bS.ParkingSpot=jC;bS.PointCollection=gp;bS.Hotspot=cU;bS.InfoWindow=eK;bS.SimpleInfoWindow=jh;bS.Circle=a8;bS.Control=hG;bS.NavigationControl=lg;bS.IndoorManager=dG;bS.NavigationControl3D=fN;bS.CopyrightControl=g3;bS.ScaleControl=lN;bS.CityListControl=bN;bS.MapTypeControl=B;bS.ZoomControl=kC;bS.LocationControl=hl;bS.GeolocationControl=hl;bS.LogoControl=bX;bS.OverviewMapControl=lj;bS.DistanceTool=cH;bS.ContextMenu=iu;bS.MenuItem=jc;bS.OperationMask=aq;bS.Animation=gr;bS.ViewAnimation=t;bS.Transitions=hz;bS.Event=gC;bS.trafficLayer=lb;bS.TrafficLayer=kG;bS.GeoJSONLayer=a0;bS.XYZLayer=lB;bS.PixelLayer=d4;bS.GeoJSONParse=hu;bS.NormalLayer=cP;bS.ThreeLayer=hO;bS.LineLayer=cg;bS.FillLayer=eI;bS.PointShapeLayer=bb;bS.PointIconLayer=g5;bS.Entity=kA;bS.MVTLayer=eP;bS.BaiduLayer=Z;bS.Geolocation=dv;bS.Geocoder=bz;bS.Boundary=ga;bS.DistrictLayer=eE;bS.LocalCity=f3;bS.LocalSearch=c7;bS.Autocomplete=kr;bS.BusLineSearch=fh;bS.WalkingRoute=gf;bS.RidingRoute=dD;bS.DrivingRoute=cV;bS.DrivingRouteLine=gV;bS.TransitRoute=fx;bS.RouteSearch=j4;bS.TruckRoute=ab;bS.IconSequence=id;bS.PanoramaCoverageLayer=eO;bS.PanoramaControl=f5;bS.PanoramaService=fz;bS.PanoramaLabel=U;bS.Panorama=f;fD(G.apiVersion);function ij(e,i){for(var C in i){e[C]=i[C]}}bS.fetchDebug&&bS.fetchDebug.init();bS.verify();bS.apiLoad();bS.frequency();bS.getSeckeyCid();window._layer=1;fK.extend(eE.prototype,{_asyncSearch:function(){for(var C=0,e=this._queryList.length;C0){for(var C=0;C