ggfwjsc/public/baiduMap.js

5 lines
961 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

window.TILE_VERSION={"ditu":{"normal":{"version":"088","updateDate":"20230830"},"satellite":{"version":"009","updateDate":"20230830"},"normalTraffic":{"version":"081","updateDate":"20230830"},"satelliteTraffic":{"version":"083","updateDate":"20230830"},"mapJS":{"version":"104","updateDate":"20230830"},"satelliteStreet":{"version":"083","updateDate":"20230830"},"earthVector":{"version":"001","updateDate":"20230830"}},"webapp":{"high_normal":{"version":"001","updateDate":"20230830"},"lower_normal":{"version":"002","updateDate":"20230830"}},"api_for_mobile":{"vector":{"version":"002","updateDate":"20230830"},"vectorIcon":{"version":"002","updateDate":"20230830"}}};window.MSV={"mapstyle":{"version":"001","updateDate":"20230817"}};window.BMAP_AUTHENTIC_KEY="2KLQUajGSpNL2DInxT6BwdPklMNpG3hw";
(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<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports}))),a=e(n((function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),s=n((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}));e(s);var u,h,c=e(n((function(t){t.exports=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,s(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports}))),l=function(t,e){var n=this;this.width=void 0,this.height=void 0,this.equals=function(t){return t&&n.width===t.width&&n.height===t.height},this.width=t||0,this.height=e||0},f=function(){function t(t,e){this.lng=void 0,this.lat=void 0,this.lng=+t,this.lat=+e}return t.prototype.equals=function(t){return t&&this.lat===t.lat&&this.lng===t.lng},t}(),d={REFRESH:"refresh",DATA_LOADED:"dataload",THUMB_LOADED:"thumb_loaded",SET_POV:"set_pov",POV_CHANGED:"pov_changed",POV_CHANGED_END:"pov_changed_end",ZOOM_CHANGED:"zoom_changed",SIZE_CHANGED:"size_changed",SET_ID:"set_id",SET_POSITION:"set_position",ID_CHANGED:"id_changed",POSITION_CHANGED:"position_changed",TOUCH_START:"touchstart",TOUCH_END:"touchend",CLICK:"click",DOUBLE_CLICK:"dblclick",LINK_CLICK:"link_click",OVERLAY_ADD:"overlay_add",OVERLAY_REMOVE:"overlay_remove",OVERLAYS_CLEAR:"overlays_clear",PANO_ERROR:"pano_error",LINK_VISIBLE_CHANGE:"links_visible_changed",DESTROY:"destroy",SCENE_CHANGE_END:"scene_change_end"},p={TYPE_INNER:"inter",TYPE_STREET:"street",RADIUS:3e3,COLS:16,ROWS:8,TILE_MAX_ZOOM:4,TILE_MIN_ZOOM:1,MIN_PITCH:-90,MAX_PITCH:90,MAX_ZOOM:4,MIN_ZOOM:1,TILE_BASE_URLS:["//apisv0.bdimg.com/","//apisv1.bdimg.com/"],TOPO_ARROW_TEXTURE:"//webmap0.bdimg.com/wolfman/static/pano/images/webgl/topo_arrow_06f0f2e.png",FISHEYE_DURATION:1500,FISHEYE_DELAY:2e3},v=(u={},h=(navigator.userAgent||"").toLowerCase(),u.isAndroid=h.includes("android"),u.isFirefox=h.includes("firefox"),u.isIos=/ip(hone|ad|od)/i.test(h),u.isWeixin=h.includes("micromessenger"),u.isWeibo=h.includes("weibo"),u.isWeChatOrWeiBo=u.isWeixin&&u.isWeibo,u.isBaiduMap=h.includes("baidumap_"),u.isMobile=/android|webos|ip(hone|ad|od)|opera (mini|mobi|tablet)|iemobile|windows.+(phone|touch)|mobile|fennec|kindle (Fire)|Silk|maemo|blackberry|playbook; (touch|kbd)|Symbian(OS)|Ubuntu Touch/i.test(h),u.isPc=!u.isMobile,u),m=function(t){for(var e=arguments.length<=1?0:arguments.length-1,n=0;n<e;n++){var r=n+1<1||arguments.length<=n+1?void 0:arguments[n+1];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},g=function(t){return t*Math.PI/180},y=function(t){return 180*t/Math.PI},_=function(t){return t-360*Math.floor(t/360)},x=function(){return Date.now()};var b=function t(){var e=t;if("boolean"==typeof e._supportWebGL)return e._supportWebGL;if(!window.WebGLRenderingContext)return e._supportWebGL=!1,!1;var n=null,r=document.createElement("canvas");try{(n=r.getContext("webgl")||r.getContext("experimental-webgl"))&&n instanceof WebGLRenderingContext&&(e._supportWebGL=!0)}catch(t){e._supportWebGL=!1}return null===n&&(e._supportWebGL=!1),e._supportWebGL},M=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),r<e&&(r=e);return{min:n,max:r}},w={g:function(t){return"string"==typeof t||t instanceof String?document.getElementById(t):t&&t.nodeName&&(1===t.nodeType||9===t.nodeType)?t:null},show:function(t){var e=w.g(t);return e&&(e.style.display=""),e},hide:function(t){var e=w.g(t);return e&&(e.style.display="none"),t},create:function(t){var e=arguments.length>1&&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)}};function E(){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;u<r;u++){var h=e(t[u]);c.push(h)}n=s;break;case"dac":var c=[];n=a}}var d=decodeURIComponent;b="de",r=l("fr","o")+"m",n=l("Co",b);var p=function(t){return u(t,"")[h][u(r,"Char")+n](t)},v=function(t){return f(t,(function(t){return c(p,t)}))},m=v.call(p,[39,34,37,96,60,120,97,65,98,66,99,67,100,68,101,69,102,70,103,110,109,111,112,48,49,50,51,52,53,54,55,56,57]),g=f([28782,27702,26416,25167,24183],(function(t){return c(d,t)})),y=v.call(g,[22354,22749,24415,23346,22257,22688,24306,25174,23595,25547,22984,25690,22212,27547,21594,27210,23090,29193,22394,29368,29532,29459,29530,24146,24500,26352,27441,28788,29370,27673,26925,25249,24430]),_={};g=c(v,g);for(var x=new RegExp(g.join("|")),b=0;b<m.length;b++)_[y[b]]=m[b];return e=f(e.split(""),(function(t){return _[t]||t})).join(""),f(e.split(x),(function(t){return d(t)}))}(0,"su尫stri犸坺幷囄獜呚囄獜扏su尫str氶h廲廲呚l灮i犸囄呚墠O娲氶呚呚廲廲廲朰墠h姈i囄朰彟曰氙si坺犸彟欱殛");t=n,e=265,function(e){for(;--e;)t.push(t.shift())}(++e);var r=function(t,e){return n[t-=0]};return function(t){var e={dmedm:"F5L2O6R6AD8990O",haael:function(t,e){return t+e},eeaaa:function(t,e){return t(e)},xhcid:function(t,e){return t+e},deiic:function(t,e){return t-e}},n=e[r("0x0")],i=t[r("0x1")](e[r("0x2")](t[r("0x3")]("?"),1)),o=e[r("0x4")](md5,e[r("0x5")](md5(i+n),"H0A9P8P7Y6ABQO0"));return r("0x6")+o[r("0x7")](e.deiic(o.length,12))}}var T=function(t,e,n){var r,o,a="",s=[],u="jsonp"+Math.ceil(1e5*Math.random()),h=t.indexOf("?")>0?"&":"?";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:{}})}}))},A=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<t;e++){var n=this.keyList[e];this._options.clearCallback&&this._options.clearCallback(this.getData(n)),this._cache.delete(n)}this.keyList.splice(0,t)},e.clear=function(){this._cache.clear(),this.keyList=[]},o(t,[{key:"cacheCount",get:function(){return this._cache.size}}]),t}(),C=function(){function t(){var t=this;this.rid="",this.roadName="",this.roadWidth=5,this.isCurrentRoad=0,this.pointList=[],this.getTopoInRoad=function(e){var n=[],r=t.pointList,i=r.length,o=t.getPointByPanoId(e);if(!o||i<=1)return n;var a=o.order;return 0===a?n.push(t.generateTopoData(o.dir,r[1])):a===i-1?n.push(t.generateTopoData(r[a-1].dir+180,r[a-1])):(n.push(t.generateTopoData((r[a-1].dir+180)%360,r[a-1])),n.push(t.generateTopoData(r[a].dir,r[a+1]))),n},this.getPointByPanoId=function(e){for(var n,r=t.pointList,i=0,o=r.length;i<o;i++)if(r[i].panoId===e){n=r[i];break}return n}}return t.prototype.generateTopoData=function(t,e){return void 0!==e&&(e.topoDir=t,e.roadName=this.roadName),e},t}(),R=function(){var t=this;this.image=void 0,this.panoId="",this.iid="",this.panoType="",this.panoX=0,this.panoY=0,this.panoZ=0,this.heading=0,this.pitch=0,this.defaultHeading=void 0,this.defaultPitch=void 0,this.northDir=0,this.fixHeading=0,this.fixPitch=0,this.fixRoll=0,this.deviceHeight=0,this.date="20130822",this.time="",this.provider=1,this.admission="GS(2013)6021",this.photos=[],this.roadName="",this.roads=[],this.vpoints=[],this.topoArray=void 0,this.currentRoad=void 0,this.roadWidth=void 0,this.getCurrentRoad=function(){if(t.currentRoad)return t.currentRoad;for(var e=t.roads,n=0,r=e.length;n<r;n++)if(e[n].isCurrentRoad){t.currentRoad=e[n];break}return t.currentRoad},this.getTopos=function(){if(t.topoArray)return t.topoArray;if(t.currentRoad||(t.currentRoad=t.getCurrentRoad()),!t.currentRoad)return[];if(t.topoArray=t.currentRoad.getTopoInRoad(t.panoId),t.vpoints.length<1)return t.topoArray;for(var e,n=t.vpoints.length-1;n>=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=90<o||-90>o?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<i;r++)e.pointList.push(S(n[r]));return e}(t)}))}if(r.Links)for(var h=r.Links,c=h.length,l=0;l<c;l++){var f=h[l];f.RoadName=a[f.RID],i.vpoints.push(S(f))}return i.photos=r.Photos||[],i}function D(t,e){var n=(65535&t)+(65535&e);return(t>>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<<e%32,t[14+(e+64>>>9<<4)]=e;var s=1732584193,u=-271733879,h=-1732584194,c=271733878;for(n=0;n<t.length;n+=16)r=s,i=u,o=h,a=c,s=I(s,u,h,c,t[n],7,-680876936),c=I(c,s,u,h,t[n+1],12,-389564586),h=I(h,c,s,u,t[n+2],17,606105819),u=I(u,h,c,s,t[n+3],22,-1044525330),s=I(s,u,h,c,t[n+4],7,-176418897),c=I(c,s,u,h,t[n+5],12,1200080426),h=I(h,c,s,u,t[n+6],17,-1473231341),u=I(u,h,c,s,t[n+7],22,-45705983),s=I(s,u,h,c,t[n+8],7,1770035416),c=I(c,s,u,h,t[n+9],12,-1958414417),h=I(h,c,s,u,t[n+10],17,-42063),u=I(u,h,c,s,t[n+11],22,-1990404162),s=I(s,u,h,c,t[n+12],7,1804603682),c=I(c,s,u,h,t[n+13],12,-40341101),h=I(h,c,s,u,t[n+14],17,-1502002290),s=L(s,u=I(u,h,c,s,t[n+15],22,1236535329),h,c,t[n+1],5,-165796510),c=L(c,s,u,h,t[n+6],9,-1069501632),h=L(h,c,s,u,t[n+11],14,643717713),u=L(u,h,c,s,t[n],20,-373897302),s=L(s,u,h,c,t[n+5],5,-701558691),c=L(c,s,u,h,t[n+10],9,38016083),h=L(h,c,s,u,t[n+15],14,-660478335),u=L(u,h,c,s,t[n+4],20,-405537848),s=L(s,u,h,c,t[n+9],5,568446438),c=L(c,s,u,h,t[n+14],9,-1019803690),h=L(h,c,s,u,t[n+3],14,-187363961),u=L(u,h,c,s,t[n+8],20,1163531501),s=L(s,u,h,c,t[n+13],5,-1444681467),c=L(c,s,u,h,t[n+2],9,-51403784),h=L(h,c,s,u,t[n+7],14,1735328473),s=B(s,u=L(u,h,c,s,t[n+12],20,-1926607734),h,c,t[n+5],4,-378558),c=B(c,s,u,h,t[n+8],11,-2022574463),h=B(h,c,s,u,t[n+11],16,1839030562),u=B(u,h,c,s,t[n+14],23,-35309556),s=B(s,u,h,c,t[n+1],4,-1530992060),c=B(c,s,u,h,t[n+4],11,1272893353),h=B(h,c,s,u,t[n+7],16,-155497632),u=B(u,h,c,s,t[n+10],23,-1094730640),s=B(s,u,h,c,t[n+13],4,681279174),c=B(c,s,u,h,t[n],11,-358537222),h=B(h,c,s,u,t[n+3],16,-722521979),u=B(u,h,c,s,t[n+6],23,76029189),s=B(s,u,h,c,t[n+9],4,-640364487),c=B(c,s,u,h,t[n+12],11,-421815835),h=B(h,c,s,u,t[n+15],16,530742520),s=k(s,u=B(u,h,c,s,t[n+2],23,-995338651),h,c,t[n],6,-198630844),c=k(c,s,u,h,t[n+7],10,1126891415),h=k(h,c,s,u,t[n+14],15,-1416354905),u=k(u,h,c,s,t[n+5],21,-57434055),s=k(s,u,h,c,t[n+12],6,1700485571),c=k(c,s,u,h,t[n+3],10,-1894986606),h=k(h,c,s,u,t[n+10],15,-1051523),u=k(u,h,c,s,t[n+1],21,-2054922799),s=k(s,u,h,c,t[n+8],6,1873313359),c=k(c,s,u,h,t[n+15],10,-30611744),h=k(h,c,s,u,t[n+6],15,-1560198380),u=k(u,h,c,s,t[n+13],21,1309151649),s=k(s,u,h,c,t[n+4],6,-145523070),c=k(c,s,u,h,t[n+11],10,-1120210379),h=k(h,c,s,u,t[n+2],15,718787259),u=k(u,h,c,s,t[n+9],21,-343485551),s=D(s,r),u=D(u,i),h=D(h,o),c=D(c,a);return[s,u,h,c]}function N(t){var e,n="",r=32*t.length;for(e=0;e<r;e+=8)n+=String.fromCharCode(t[e>>5]>>>e%32&255);return n}function F(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function j(t){var e,n,r="0123456789abcdef",i="";for(n=0;n<t.length;n+=1)e=t.charCodeAt(n),i+=r.charAt(e>>>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 W,H,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 T(t,{},{jsonp:"fn"})},K=function(t,e){if("PANORAMA"===t){var n="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=(H=null,Z=0,q=W||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,H||(H=setTimeout((function(){var t="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,H=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 A(10)}return t.prototype.getDataByUrl=function(t){var e=this._cache.getData(t);return e?Promise.resolve(e):T(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 A(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(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<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:R}}function R(){return{value:void 0,done:!0}}return v.prototype=m,c(x,"constructor",m),c(m,"constructor",v),v.displayName=c(m,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,h,"GeneratorFunction")),t.prototype=Object.create(x),t},r.awrap=function(t){return{__await:t}},b(M.prototype),c(M.prototype,u,(function(){return this})),r.AsyncIterator=M,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new M(l(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(x),c(x,h,"Generator"),c(x,s,(function(){return this})),c(x,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},r.values=C,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=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<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(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;T(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;n<t.length;++n)if(!ct(t[n],e[n]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=st.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{st.EPSILON=r}}class lt extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}toArray(t=[],e=0){for(let n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:ht(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(st)}formatString(t){let e="";for(let n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+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<this.ELEMENTS;++e)if(!ct(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(let r=0;r<this.ELEMENTS;++r){const i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(st.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}get elements(){return this}}function ft(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function dt(t,e,n=""){if(st.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}class pt extends lt{get x(){return this[0]}set x(t){this[0]=ft(t)}get y(){return this[1]}set y(t){this[1]=ft(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let n=0;n<this.ELEMENTS;++n){const r=this[n]-t[n];e+=r*r}return ft(e)}dot(t){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return ft(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return at(t>=0&&t<this.ELEMENTS,"index is out of range"),ft(this[t])}setComponent(t,e){return at(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}var vt=1e-6,mt="undefined"!=typeof Float32Array?Float32Array:Array,gt=Math.random;function yt(){var t=new mt(2);return mt!=Float32Array&&(t[0]=0,t[1]=0),t}function _t(t,e){var n=new mt(2);return n[0]=t,n[1]=e,n}function xt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function bt(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function Mt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function wt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function Et(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Tt(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function At(t){var e=t[0],n=t[1];return e*e+n*n}function Ct(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Rt,St=Tt,Pt=xt,Dt=bt,Ot=Mt,It=wt,Lt=Et,Bt=At,kt=(Rt=yt(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)Rt[0]=t[a],Rt[1]=t[a+1],i(Rt,Rt,o),t[a]=Rt[0],t[a+1]=Rt[1];return t}),Ut=Object.freeze({__proto__:null,create:yt,clone:function(t){var e=new mt(2);return e[0]=t[0],e[1]=t[1],e},fromValues:_t,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:function(t,e,n){return t[0]=e,t[1]=n,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},subtract:xt,multiply:bt,divide:Mt,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},distance:wt,squaredDistance:Et,length:Tt,squaredLength:At,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},normalize:function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(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 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 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 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=Ht,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;s<u;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),ge=Object.freeze({__proto__:null,create:Ft,clone:jt,length:zt,fromValues:Vt,copy:Gt,set:function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},add:Wt,subtract:Ht,multiply:Zt,divide:qt,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:Yt,scaleAndAdd: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},distance:Xt,squaredDistance:Kt,squaredLength:Qt,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},normalize:Jt,dot:$t,cross:te,lerp:function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},hermite:function(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,h=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*h+i[0]*c,t[1]=e[1]*s+n[1]*u+r[1]*h+i[1]*c,t[2]=e[2]*s+n[2]*u+r[2]*h+i[2]*c,t},bezier:function(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,h=s*a,c=3*o*s,l=3*u*a,f=u*o;return t[0]=e[0]*h+n[0]*c+r[0]*l+i[0]*f,t[1]=e[1]*h+n[1]*c+r[1]*l+i[1]*f,t[2]=e[2]*h+n[2]*c+r[2]*l+i[2]*f,t},random:function(t,e){e=e||1;var n=2*gt()*Math.PI,r=2*gt()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t},transformMat4:ee,transformMat3:ne,transformQuat:re,rotateX:ie,rotateY:oe,rotateZ:ae,angle:se,zero:function(t){return t[0]=0,t[1]=0,t[2]=0,t},str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},equals:ue,sub:he,mul:ce,div:le,dist:fe,sqrDist:de,len:pe,sqrLen:ve,forEach:me});const ye=[0,0,0];let _e,xe;class be extends pt{static get ZERO(){return _e||(_e=new be(0,0,0),Object.freeze(_e)),_e}constructor(t=0,e=0,n=0){super(-0,-0,-0),1===arguments.length&&ht(t)?this.copy(t):(st.debug&&(ft(t),ft(e),ft(n)),this[0]=t,this[1]=e,this[2]=n)}set(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return st.debug&&(ft(t.x),ft(t.y),ft(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=ft(t)}angle(t){return se(this,t)}cross(t){return te(this,this,t),this.check()}rotateX({radians:t,origin:e=ye}){return ie(this,this,e,t),this.check()}rotateY({radians:t,origin:e=ye}){return oe(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=ye}){return ae(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return ee(this,this,t),this.check()}transformAsVector(t){return Nt(this,this,t),this.check()}transformByMatrix3(t){return ne(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,n){const r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2]}(this,this,t),this.check()}transformByQuaternion(t){return re(this,this,t),this.check()}}class Me extends pt{static get ZERO(){return xe||(xe=new Me(0,0,0,0),Object.freeze(xe)),xe}constructor(t=0,e=0,n=0,r=0){super(-0,-0,-0,-0),ht(t)&&1===arguments.length?this.copy(t):(st.debug&&(ft(t),ft(e),ft(n),ft(r)),this[0]=t,this[1]=e,this[2]=n,this[3]=r)}set(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return st.debug&&(ft(t.x),ft(t.y),ft(t.z),ft(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=ft(t)}get w(){return this[3]}set w(t){this[3]=ft(t)}transform(t){return ee(this,this,t),this.check()}transformByMatrix3(t){return function(t,e,n){const r=e[0],i=e[1],o=e[2];t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3]}(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,n){const r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t[3]=e[3]}(this,this,t),this.check()}transformByQuaternion(t){return re(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}class we extends lt{toString(){let t="[";if(st.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,n){return this[e*this.RANK+t]=ft(n),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[n+t];return e}setColumn(t,e){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)this[n+t]=e[t];return this}}function Ee(){var t=new mt(9);return mt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Te(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=n[0],d=n[1],p=n[2],v=n[3],m=n[4],g=n[5],y=n[6],_=n[7],x=n[8];return t[0]=f*r+d*a+p*h,t[1]=f*i+d*s+p*c,t[2]=f*o+d*u+p*l,t[3]=v*r+m*a+g*h,t[4]=v*i+m*s+g*c,t[5]=v*o+m*u+g*l,t[6]=y*r+_*a+x*h,t[7]=y*i+_*s+x*c,t[8]=y*o+_*u+x*l,t}function Ae(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}var Ce=Te,Re=Ae,Se=Object.freeze({__proto__:null,create:Ee,fromMat4:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},clone:function(t){var e=new mt(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},copy: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},fromValues:function(t,e,n,r,i,o,a,s,u){var h=new mt(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=i,h[5]=o,h[6]=a,h[7]=s,h[8]=u,h},set:function(t,e,n,r,i,o,a,s,u,h){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},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},invert: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=c*a-s*h,f=-c*o+s*u,d=h*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-c*r+i*h)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(c*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-h*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null},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];return t[0]=a*c-s*h,t[1]=i*h-r*c,t[2]=r*s-i*a,t[3]=s*u-o*c,t[4]=n*c-i*u,t[5]=i*o-n*s,t[6]=o*h-a*u,t[7]=r*u-n*h,t[8]=n*a-r*o,t},determinant:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8];return e*(h*o-a*u)+n*(-h*i+a*s)+r*(u*i-o*s)},multiply:Te,translate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+h,t[7]=f*i+d*s+c,t[8]=f*o+d*u+l,t},rotate:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=h,t[7]=c,t[8]=l,t},scale:function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},fromRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromQuat:function(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[3]=c-g,t[6]=f+m,t[1]=c+g,t[4]=1-h-p,t[7]=d-v,t[2]=f-m,t[5]=d+v,t[8]=1-h-l,t},normalFromMat4: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],y=n*s-r*a,_=n*u-i*a,x=n*h-o*a,b=r*u-i*s,M=r*h-o*s,w=i*h-o*u,E=c*v-l*p,T=c*m-f*p,A=c*g-d*p,C=l*m-f*v,R=l*g-d*v,S=f*g-d*m,P=y*S-_*R+x*C+b*A-M*T+w*E;return P?(P=1/P,t[0]=(s*S-u*R+h*C)*P,t[1]=(u*A-a*S-h*T)*P,t[2]=(a*R-s*A+h*E)*P,t[3]=(i*R-r*S-o*C)*P,t[4]=(n*S-i*A+o*T)*P,t[5]=(r*A-n*R-o*E)*P,t[6]=(v*w-m*M+g*b)*P,t[7]=(m*x-p*w-g*_)*P,t[8]=(p*M-v*x+g*y)*P,t):null},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},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},subtract:Ae,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},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},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]},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=e[0],f=e[1],d=e[2],p=e[3],v=e[4],m=e[5],g=e[6],y=e[7],_=e[8];return Math.abs(n-l)<=vt*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-f)<=vt*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=vt*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=vt*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-v)<=vt*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-m)<=vt*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(u-g)<=vt*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(h-y)<=vt*Math.max(1,Math.abs(h),Math.abs(y))&&Math.abs(c-_)<=vt*Math.max(1,Math.abs(c),Math.abs(_))},mul:Ce,sub:Re});function Pe(){var t=new mt(16);return mt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function De(t){var e=new mt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Oe(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],t}function Ie(t){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]=0,t[13]=0,t[14]=0,t[15]=1,t}function Le(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Be(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],y=n*s-r*a,_=n*u-i*a,x=n*h-o*a,b=r*u-i*s,M=r*h-o*s,w=i*h-o*u,E=c*v-l*p,T=c*m-f*p,A=c*g-d*p,C=l*m-f*v,R=l*g-d*v,S=f*g-d*m,P=y*S-_*R+x*C+b*A-M*T+w*E;return P?(P=1/P,t[0]=(s*S-u*R+h*C)*P,t[1]=(i*R-r*S-o*C)*P,t[2]=(v*w-m*M+g*b)*P,t[3]=(f*M-l*w-d*b)*P,t[4]=(u*A-a*S-h*T)*P,t[5]=(n*S-i*A+o*T)*P,t[6]=(m*x-p*w-g*_)*P,t[7]=(c*w-f*x+d*_)*P,t[8]=(a*R-s*A+h*E)*P,t[9]=(r*A-n*R-o*E)*P,t[10]=(p*M-v*x+g*y)*P,t[11]=(l*x-c*M-d*y)*P,t[12]=(s*T-a*C-u*E)*P,t[13]=(n*C-r*T+i*E)*P,t[14]=(v*_-p*b-m*y)*P,t[15]=(c*b-l*_+f*y)*P,t):null}function ke(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],h=t[8],c=t[9],l=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return(e*a-n*o)*(l*m-f*v)-(e*s-r*o)*(c*m-f*p)+(e*u-i*o)*(c*v-l*p)+(n*s-r*a)*(h*m-f*d)-(n*u-i*a)*(h*v-l*d)+(r*u-i*s)*(h*p-c*d)}function Ue(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],y=e[15],_=n[0],x=n[1],b=n[2],M=n[3];return t[0]=_*r+x*s+b*l+M*v,t[1]=_*i+x*u+b*f+M*m,t[2]=_*o+x*h+b*d+M*g,t[3]=_*a+x*c+b*p+M*y,_=n[4],x=n[5],b=n[6],M=n[7],t[4]=_*r+x*s+b*l+M*v,t[5]=_*i+x*u+b*f+M*m,t[6]=_*o+x*h+b*d+M*g,t[7]=_*a+x*c+b*p+M*y,_=n[8],x=n[9],b=n[10],M=n[11],t[8]=_*r+x*s+b*l+M*v,t[9]=_*i+x*u+b*f+M*m,t[10]=_*o+x*h+b*d+M*g,t[11]=_*a+x*c+b*p+M*y,_=n[12],x=n[13],b=n[14],M=n[15],t[12]=_*r+x*s+b*l+M*v,t[13]=_*i+x*u+b*f+M*m,t[14]=_*o+x*h+b*d+M*g,t[15]=_*a+x*c+b*p+M*y,t}function Ne(t,e,n){var r,i,o,a,s,u,h,c,l,f,d,p,v=n[0],m=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*g+e[12],t[13]=e[1]*v+e[5]*m+e[9]*g+e[13],t[14]=e[2]*v+e[6]*m+e[10]*g+e[14],t[15]=e[3]*v+e[7]*m+e[11]*g+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],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]=r*v+s*m+l*g+e[12],t[13]=i*v+u*m+f*g+e[13],t[14]=o*v+h*m+d*g+e[14],t[15]=a*v+c*m+p*g+e[15]),t}function Fe(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function je(t,e,n,r){var i,o,a,s,u,h,c,l,f,d,p,v,m,g,y,_,x,b,M,w,E,T,A,C,R=r[0],S=r[1],P=r[2],D=Math.hypot(R,S,P);return D<vt?null:(R*=D=1/D,S*=D,P*=D,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],u=e[1],h=e[2],c=e[3],l=e[4],f=e[5],d=e[6],p=e[7],v=e[8],m=e[9],g=e[10],y=e[11],_=R*R*a+o,x=S*R*a+P*i,b=P*R*a-S*i,M=R*S*a-P*i,w=S*S*a+o,E=P*S*a+R*i,T=R*P*a+S*i,A=S*P*a-R*i,C=P*P*a+o,t[0]=s*_+l*x+v*b,t[1]=u*_+f*x+m*b,t[2]=h*_+d*x+g*b,t[3]=c*_+p*x+y*b,t[4]=s*M+l*w+v*E,t[5]=u*M+f*w+m*E,t[6]=h*M+d*w+g*E,t[7]=c*M+p*w+y*E,t[8]=s*T+l*A+v*C,t[9]=u*T+f*A+m*C,t[10]=h*T+d*A+g*C,t[11]=c*T+p*A+y*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function ze(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],h=e[8],c=e[9],l=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+h*r,t[5]=a*i+c*r,t[6]=s*i+l*r,t[7]=u*i+f*r,t[8]=h*i-o*r,t[9]=c*i-a*r,t[10]=l*i-s*r,t[11]=f*i-u*r,t}function Ve(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],h=e[8],c=e[9],l=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-h*r,t[1]=a*i-c*r,t[2]=s*i-l*r,t[3]=u*i-f*r,t[8]=o*r+h*i,t[9]=a*r+c*i,t[10]=s*r+l*i,t[11]=u*r+f*i,t}function Ge(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],h=e[4],c=e[5],l=e[6],f=e[7];return e!==t&&(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]),t[0]=o*i+h*r,t[1]=a*i+c*r,t[2]=s*i+l*r,t[3]=u*i+f*r,t[4]=h*i-o*r,t[5]=c*i-a*r,t[6]=l*i-s*r,t[7]=f*i-u*r,t}function We(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,h=o+o,c=r*s,l=r*u,f=r*h,d=i*u,p=i*h,v=o*h,m=a*s,g=a*u,y=a*h;return t[0]=1-(d+v),t[1]=l+y,t[2]=f-g,t[3]=0,t[4]=l-y,t[5]=1-(c+v),t[6]=p+m,t[7]=0,t[8]=f+g,t[9]=p-m,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function He(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],h=e[9],c=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,h,c),t}function Ze(t,e){var n=new mt(3);He(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,h=e[4]*r,c=e[5]*i,l=e[6]*o,f=e[8]*r,d=e[9]*i,p=e[10]*o,v=a+c+p,m=0;return v>0?(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)<vt&&Math.abs(v-b)<vt&&Math.abs(m-M)<vt?Ie(t):(c=p-x,l=v-b,f=m-M,i=y*(f*=d=1/Math.hypot(c,l,f))-_*(l*=d),o=_*(c*=d)-g*f,a=g*l-y*c,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=l*a-f*o,u=f*i-c*a,h=c*o-l*i,(d=Math.hypot(s,u,h))?(s*=d=1/d,u*=d,h*=d):(s=0,u=0,h=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=o,t[5]=u,t[6]=l,t[7]=0,t[8]=a,t[9]=h,t[10]=f,t[11]=0,t[12]=-(i*p+o*v+a*m),t[13]=-(s*p+u*v+h*m),t[14]=-(c*p+l*v+f*m),t[15]=1,t)}function en(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],h=r[2],c=i-n[0],l=o-n[1],f=a-n[2],d=c*c+l*l+f*f;d>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 h<vt?null:(a*=h=1/h,s*=h,u*=h,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:We,fromQuat2:function(t,e){var n=new mt(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],h=e[6],c=e[7],l=r*r+i*i+o*o+a*a;return l>0?(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)),We(t,e,n),t},getTranslation:function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},getScaling:He,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],T=i[1],A=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*T+I*A),t[13]=n[1]+T-(R*E+D*T+L*A),t[14]=n[2]+A-(S*E+O*T+B*A),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],T=e[7],A=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-T)<=vt*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(c-A)<=vt*Math.max(1,Math.abs(c),Math.abs(A))&&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 Tn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function An(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<u;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),kn=Object.freeze({__proto__:null,create:sn,clone:un,fromValues:hn,copy:cn,set:ln,add:fn,subtract:dn,multiply:pn,divide:vn,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},scale:mn,scaleAndAdd: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},distance:gn,squaredDistance:yn,length:_n,squaredLength:xn,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},normalize:bn,dot:Mn,cross:function(t,e,n,r){var i=n[0]*r[1]-n[1]*r[0],o=n[0]*r[2]-n[2]*r[0],a=n[0]*r[3]-n[3]*r[0],s=n[1]*r[2]-n[2]*r[1],u=n[1]*r[3]-n[3]*r[1],h=n[2]*r[3]-n[3]*r[2],c=e[0],l=e[1],f=e[2],d=e[3];return t[0]=l*h-f*u+d*s,t[1]=-c*h+f*a-d*o,t[2]=c*u-l*a+d*i,t[3]=-c*s+l*o-f*i,t},lerp:wn,random:function(t,e){var n,r,i,o,a,s;e=e||1;do{a=(n=2*gt()-1)*n+(r=2*gt()-1)*r}while(a>=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:Tn,equals:An,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(){Wn||(Wn=new Vn,Object.freeze(Wn));return Wn}()}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;Hn(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 Hn(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,Wn;function Hn(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=Tn,Mr=An,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}),Tr=(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))}),Ar=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:Tr});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;n<t;n++)e[n]=arguments[n];this.alias("addEventListener")(e)},e.off=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.alias("removeEventListener")(e)},e.emit=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.alias("dispatchEvent")(e)},e.addEventListener=function(t,e,n){if(Sr(e)){var r;!this.__listeners&&(this.__listeners={});var i=this.__listeners;if("string"==typeof n&&n){if(/[^\w-]/.test(n))throw"nonstandard key:"+n;e.hashCode=n,r=n}!t.startsWith("on")&&(t="on"+t),"object"!==Cr(i[t])&&(i[t]={}),r=r||(++Pr).toString(),e.hashCode=r,i[t][r]=e}},e.removeEventListener=function(t,e){if(Sr(e))e=e.hashCode;else if(!Rr(e))return;!this.__listeners&&(this.__listeners={}),!t.startsWith("on")&&(t="on"+t);var n=this.__listeners;n[t]&&n[t][e]&&delete n[t][e]},e.dispatchEvent=function(t,e){Rr(t)&&(t=new Dr(t)),!this.__listeners&&(this.__listeners={});var n=this.__listeners,r=t.type,i=e||t;if(t.target=t.target||this,t.currentTarget=this,0!==r.indexOf("on")&&(r="on".concat(r)),Sr(n[r])&&n[r].call(this,i),"object"===Cr(n[r]))for(var o in n[r])Object.prototype.hasOwnProperty.call(n[r],o)&&n[r][o].call(this,i);return t.returnValue},e.alias=function(t){var e=this;return function(n){return e[t].apply(e,n)}},t}();function Ir(t,e){var n=e[2],r=e[0],i=e[1],o=e[3],a=o*o,s=n*n,u=r*r,h=i*i,c=i*n-r*o,l=.4999999;return c<-l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(i,o),t[2]=0):c>l?(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=Wt(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;n<r;n++)this.children[n].setVisible(t,e)},n.setScale=function(t,e,n){var r=Vt(t,e,n);return ue(this.scale,r)||(this.scale=r,this.modelMatrixNeedUpdate=!0),this},n.updateMatrix=function(){Ie(this.modelMatrix),qn(this.quaternion),tr(this.quaternion,this.rotation.x,this.rotation.y,this.rotation.z),qe(this.modelMatrix,this.quaternion,this.position,this.scale),this.modelMatrixNeedUpdate=!1,this.worldMatrixNeedsUpdate=!0},n.updateWorldMatrix=function(){var t=arguments.length>0&&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<n;e++)this.children[e].updateWorldMatrix(t)},n.add=function(t){if(t===this)return console.error("object3D.add: object can't be added as a child of itself. ==> ".concat(t)),this;if(t instanceof Array){for(var e=0,n=t.length;e<n;e++)this.add(t[e]);return this}return t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t)):console.error("Object3D.add: object not an instance of Object3D.",t),this},n.remove=function(t){if(t instanceof Array){for(var e=0,n=t.length;e<n;e++)this.remove(t[e]);return this}var r=this.children.indexOf(t);return-1!==r&&(t.parent=null,this.children.splice(r,1)),this},n.traverse=function(t){t(this),this.children&&this.children.length>0&&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;r<i;r++)n.add(this.children[r].clone());return n},n.raycast=function(t){return null},e}(Or);Ur.DefaultUp=Vt(0,1,0);var Nr=function(){function t(t,e){this.isBox=!0,this.min=void 0,this.max=void 0,this.min=void 0!==t?t:Vt(1/0,1/0,1/0),this.max=void 0!==e?e:Vt(-1/0,-1/0,-1/0)}var e=t.prototype;return e.set=function(t,e){return Gt(this.min,t),Gt(this.max,e),this},e.setFromBufferAttribute=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=t.array,u=t.count,h=t.itemSize,c=0;c<u;c++){var l=s[c*h],f=s[c*h+1],d=s[c*h+2];l<e&&(e=l),f<n&&(n=f),d<r&&(r=d),l>i&&(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]<this.min[0]||this.max[1]<this.min[1]||this.max[2]<this.min[2]},t}(),Fr=function(){function t(e,n,r){var i=arguments.length>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),Wr=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),r<e&&(r=e);return{min:n,max:r}}(e);o=new(a.max>65535?Uint32Array:Uint16Array)(e)}else o=e;return t.call(this,o,n,r,i)||this}return c(e,t),e}(Fr),Hr=0,Zr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).id=Hr++,e.uuid=Br(),e.name="",e.type="BufferGeometry",e.indexes=null,e.attributes={},e.__webglInit=!1,e.groupsNeedUpdate=!1,e.boundingBox=null,e}c(e,t);var n=e.prototype;return n.getIndexes=function(){return this.indexes},n.getCenter=function(){return this.computeBoundingBox(),this.boundingBox?this.boundingBox.getCenter():void 0},n.setIndexes=function(t){return Array.isArray(t)||ArrayBuffer.isView(t)?this.indexes=new Wr(t,1):Wr.isBufferAttribute(t)&&(this.indexes=t),this},n.getAttribute=function(t){return t?this.attributes[t]:this.attributes},n.setAttribute=function(t,e){return t&&Fr.isBufferAttribute(e)&&(this.attributes[t]=e),this},n.deleteAttribute=function(t){return this.attributes[t]&&delete this.attributes[t],this},n.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new Nr);var t=this.attributes.position;t&&t.isBufferAttribute&&this.boundingBox.setFromBufferAttribute(t)},e}(Or),qr=new be,Yr=new be,Xr=new be,Kr=function(t){function e(e,n){var r;return(r=t.call(this)||this).type="Mesh",r.geometry=void 0,r.material=void 0,r.materialChanged=void 0,r.__webglInit=!1,r.geometry=void 0!==e?e:new Zr,r.material=void 0!==n?n:null,r.materialChanged=!1,r}c(e,t);var n=e.prototype;return n.updateMaterial=function(t){this.material&&t.isMaterial&&t.uuid!==this.material.uuid&&(this.material=t,this.materialChanged=!0)},n.raycast=function(t){var e=this.geometry,n=e.indexes&&e.indexes.array,r=e.attributes.position.array;if(!n)return null;for(var i=0;i<n.length;i+=3){var o=3*n[i],a=3*n[i+1],s=3*n[i+2],u=qr.set(r[o],r[o+1],r[o+2]).transform(this.worldMatrix),h=Yr.set(r[a],r[a+1],r[a+2]).transform(this.worldMatrix),c=Xr.set(r[s],r[s+1],r[s+2]).transform(this.worldMatrix),l=t.intersectTriangle(u,h,c);if(l)return{distance:l.distance,point:l.point,object:this}}return null},e}(Ur),Qr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).type="Scene",e.isScene=!0,e.autoUpdate=!0,e}c(e,t);var n=e.prototype;return n.updateWorldMatrix=function(){var e=arguments.length>0&&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(0<c){if(i)return null;r=1}else{if(!(0>c))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&&u<i)return null;var h=1/u,c=ni.subVectors(this.origin,t),l=h*c.dot(s);if(l<0||l>1)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<e;n++)r[n]=t[n];return r}var si=function(){function t(t,e,n,r){this.ray=void 0,this.near=void 0,this.far=void 0,this.ray=new ii(t,e),this.near=n||0,this.far=r||1/0}var e=t.prototype;return e.set=function(t,e){this.ray.set(t,e)},e.setFromCamera=function(t,e){var n=new be(e.position[0],e.position[1],e.position[2]),r=(new Vn).fromArray(e.projectionMatrix).invert(),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.pick=function(t){var e,n=this.ray,r=[],i=oi([].concat(t));try{for(i.s();!(e=i.n()).done;){var o=e.value.raycast(n);o&&r.push(o)}}catch(t){i.e(t)}finally{i.f()}return r.sort((function(t,e){return t.distance-e.distance})),r},t}(),ui=function(t){function e(n){var r;return(r=t.call(this)||this).image=void 0,r.flipY=!0,r.premultiplyAlpha=!1,r.needsUpdate=!0,r.glTexture=null,r.isTexture=!0,r.gl=null,r.__textureInit=!1,r.clone=function(t){return void 0===t&&(t=new e),t.image=r.image,t.flipY=r.flipY,t},r.destory=function(){r.emit("destory",r.glTexture)},r.destoryTexture=function(){r.glTexture&&r.gl&&(r.off("destory",r.destoryTexture),r.gl.deleteTexture(r.glTexture))},void 0!==n&&(r.image=n),r}return c(e,t),e.prototype.init=function(t){!0!==this.__textureInit&&(this.gl=t,this.glTexture=t.createTexture(),this.on("destory",this.destoryTexture),this.__textureInit=!0)},e}(Or),hi=function(t){function e(e){var n;return(n=t.call(this)||this).isCube=!0,n.image=e||[],n.flipY=!1,n}return c(e,t),e}(ui),ci=function(){function t(t,e,n){var r=this;this.gl=void 0,this.maxTextureSize=void 0,this.maxTextures=void 0,this.usedTextureUnits=0,this.getTextureUnit=function(){var t=r.usedTextureUnits;return r.usedTextureUnits>=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);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports}));e(li);var fi=n((function(t){t.exports=function(t){if(Array.isArray(t))return li(t)},t.exports.__esModule=!0,t.exports.default=t.exports}));e(fi);var di=n((function(t){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports}));e(di);var pi=n((function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return li(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?li(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}));e(pi);var vi=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports}));e(vi);var mi=e(n((function(t){t.exports=function(t){return fi(t)||di(t)||pi(t)||vi()},t.exports.__esModule=!0,t.exports.default=t.exports}))),gi=n((function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports}));e(gi);var yi=n((function(t){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.__esModule=!0,t.exports.default=t.exports}));e(yi);var _i=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports}));e(_i);var xi=e(n((function(t){t.exports=function(t,e){return gi(t)||yi(t,e)||pi(t,e)||_i()},t.exports.__esModule=!0,t.exports.default=t.exports}))),bi=function(t,e,n){if(t&&e&&e.length)for(var r=e.length,i=0;i<r;i++){var o=void 0,a=void 0,s=void 0,u=e[i],h=xi(u,2),c=h[0],l=h[1],f=c.type,d=c.value;switch(c.type){case"1i":case"1f":t["uniform".concat(f)](l,c.value);break;case"2f":case"3f":case"4f":t["uniform".concat(f)].apply(t,[l].concat(mi(d)));break;case"t":if(!(o=c.value)||!o.image&&!o.glTexture)break;a=n.getTextureUnit(),t.uniform1i(l,a),n.setTexture(o,a);break;case"tv":s=[];for(var p=c.value,v=0,m=p.length;v<m;v++)s[v]=n.getTextureUnit();t.uniform1iv(l,s);for(var g=0,y=p.length;g<y;g++)(o=p[g])&&(o.image||o.glTexture)&&(a=s[g],n.setTexture(o,a));break;case"mat4fv":t.uniformMatrix4fv(l,!1,c.value);break;default:console.warn("[UniformOperation] Unknown uniform type: ".concat(f))}}};var Mi="\nvoid main() {\n gl_Position = mvpMatrix * vec4(position, 1.0);\n}\n",wi="\nvoid main() {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n",Ei=0,Ti=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).isMaterial=!0,e.id=Ei++,e.type="Material",e.name="",e.uuid=Br(),e.uniforms={},e.vertexShader=Mi,e.fragmentShader=wi,e.program=null,e.depthTest=!0,e.visible=!0,e.opacity=1,e.needsUpdate=!0,e.uniformsList=[],e}c(e,t);var n=e.prototype;return n.setValues=function(t){if(void 0!==t)for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var n=t[e];if(void 0===n){console.warn("Material: '"+e+"' parameter is undefined.");continue}if(void 0===this[e]){console.warn("".concat(this.type,": ").concat(e," is not a property of this material."));continue}var r="set"+e.charAt(0).toUpperCase()+e.slice(1);"function"==typeof this[r]?this[r](n):this[e]=n}},n.clone=function(){return(new e).copy(this)},n.copy=function(t){return this.uniforms=function(t){var e,n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))for(var i in n[r]={},t[r])Object.prototype.hasOwnProperty.call(t[r],i)&&((e=t[r][i])&&e.isTexture?n[r][i]=e.clone():n[r][i]=e instanceof Array?e.slice(0):e);return n}(t.uniforms),this.depthTest=t.depthTest,this.visible=t.visible,this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this},o(e,[{key:"defines",get:function(){return""}}]),e}(Or),Ai={useColor:"USE_COLOR",useUV:"NEED_UV"},Ci=function(){function t(){this.useColor=!1,this.useUV=!1}return t.prototype.getDefines=function(){for(var t=[],e=0,n=Object.keys(this);e<n.length;e++){var r=n[e];Ai[r]&&!0===this[r]&&t.push("#define ".concat(Ai[r]))}return t.push(""),t.join("\n")},t}(),Ri="\n#ifdef NEED_UV\n varying vec2 vUV;\n#endif\nvoid main(void) {\n gl_Position = mvpMatrix * vec4(position, 1.0);\n #ifdef NEED_UV\n vUV = uv;\n #endif\n}\n",Si="\nprecision mediump float;\n#ifdef NEED_UV\n varying vec2 vUV;\n uniform sampler2D uSampler;\n#endif\n#ifdef USE_COLOR\n uniform vec4 uColor;\n#endif\nuniform float uOpacity;\nvoid main(void) {\n vec4 finalColor;\n vec4 defaultColor = vec4(1.0, 0.0, 0.0, 1.0);\n finalColor = defaultColor;\n #ifdef USE_COLOR\n finalColor = uColor;\n #endif\n #ifdef NEED_UV\n finalColor = texture2D(uSampler, vUV);\n #endif\n gl_FragColor = vec4(finalColor.rgb, finalColor.a * uOpacity);\n}\n",Pi=function(t){function e(){var e,n=arguments.length>0&&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}(Ti),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;t<n;t++)e.newAttributes[t]=0},this.enableAttribute=function(t){var n=e.gl,r=e.newAttributes,i=e.enabledAttributes;r[t]=1,0===i[t]&&(n.enableVertexAttribArray(t),i[t]=1)},this.disableAttribute=function(t){var n=e.gl,r=e.newAttributes,i=e.enabledAttributes;r[t]=0,1===i[t]&&(n.disableVertexAttribArray(t),i[t]=0)},this.disableUnusedAttributes=function(){for(var t=e.gl,n=e.newAttributes,r=e.enabledAttributes,i=0,o=r.length;i<o;i++)r[i]!==n[i]&&(t.disableVertexAttribArray(i),r[i]=0)},this.setDepthTest=function(t){var n=e.gl;e.currentDepthTest!==t&&(t?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),e.currentDepthTest=t)},this.setDepthWrite=function(t){var n=e.gl;e.currentDepthWrite!==t&&(n.depthMask(t),e.currentDepthWrite=t)},this.setColorWrite=function(t){var n=e.gl;e.currentColorWrite!==t&&(n.colorMask(t,t,t,t),e.currentColorWrite=t)},this.setDefaultGLState=function(t,n,r,i){var o=e.gl;o.clearColor(229/255,227/255,223/255,1),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.clearDepth(1),o.clearStencil(0),o.disable(o.DEPTH_TEST),o.depthFunc(o.LEQUAL),o.frontFace(o.CCW),o.disable(o.CULL_FACE),o.depthMask(!0),o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),o.viewport(t,n,r,i)},this.setDoubleSided=function(t){var n=e.gl;e.currentDoubleSided!==t&&(t?n.disable(n.CULL_FACE):n.enable(n.CULL_FACE),e.currentDoubleSided=t)},this.setFlipSided=function(t){var n=e.gl;e.currentFlipSided!==t&&(t?n.frontFace(n.CW):n.frontFace(n.CCW),e.currentFlipSided=t)},this.reset=function(){for(var t=e.enabledAttributes,n=0;n<t.length;n++)t[n]=0;e.currentDepthTest=!1,e.currentDepthWrite=!0,e.currentColorWrite=!0,e.currentDoubleSided=!1,e.currentFlipSided=!1},this.gl=t},Oi=function(t){var e=this;this.maxTextures=void 0,this.maxTextureSize=void 0,this.maxVerticesOneDraw=void 0,this.maxVertexShaderTextureUnits=void 0,this.maxFragmentShaderTextureUnits=void 0,this.gl=void 0,this.getMaxTextures=function(){var t=e.gl;return t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS)},this.getLineWidthRange=function(){var t=e.gl;return t.getParameter(t.ALIASED_LINE_WIDTH_RANGE)},this.getMaxVertexShaderTextureUnits=function(){var t=e.gl;return t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS)},this.getMaxFragmentShaderTextureUnits=function(){var t=e.gl;return t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)},this.getMaxTextureSize=function(){var t=e.gl;return t.getParameter(t.MAX_TEXTURE_SIZE)},this.getMaxVerticesOneDraw=function(){return e.gl.getExtension("OES_element_index_uint")?4294967296:65535},this.getLegalPrecision=function(t){var n=e.gl,r=n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.HIGH_FLOAT),i=n.getShaderPrecisionFormat(n.VERTEX_SHADER,n.MEDIUM_FLOAT),o=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT),a=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.MEDIUM_FLOAT),s=r&&o&&r.precision>0&&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;a<o;a++)i[n=r[a]]=t.getUniformLocation(e,n);return i}(t,this.program,this.getFullUniforms(e.uniforms))}var e=t.prototype;return e.getAttributes=function(){return this.attributes},e.getUniforms=function(){return this.uniforms},e.createProgram=function(t,e){var n=arguments.length>2&&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;i<r;i++){var o=t.getActiveAttrib(e,i);if(!o)throw new Error("Something went wrong while getActiveAttrib.");var a=o.name;n[a]=t.getAttribLocation(e,a)}return n},e.getFullUniforms=function(t){var e=["mvpMatrix","modelMatrix","projectionMatrix","viewMatrix"];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e},t}(),ki={canvas:document.createElement("canvas"),context:void 0,width:0,height:0,pixelRatio:1,precision:"highp",alpha:!1,premultipliedAlpha:!0,antialias:!0,stencil:!0,depth:!0,preserveDrawingBuffer:!1},Ui=function(){function t(){var t=this,e=arguments.length>0&&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;0<r.length&&(e.glVerticesBuffer=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,e.glVerticesBuffer),s.bufferData(s.ARRAY_BUFFER,r,n)),0<i.length&&(e.glUvtsBuffer=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,e.glUvtsBuffer),s.bufferData(s.ARRAY_BUFFER,i,n)),0<o.length&&(e.glIndicesBuffer=s.createBuffer(),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.glIndicesBuffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o,n)),!0===e.showBorder&&void 0!==a&&0<a.length&&(e.glBorderVerticesBuffer=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,e.glBorderVerticesBuffer),s.bufferData(s.ARRAY_BUFFER,e.borderVerticesBufferData,n))},this.renderScene=function(e,n){!0===e.visible&&e.traverse((function(e){e instanceof Kr&&(t.renderObject(e,n),e.children.length&&e.children.forEach((function(e){t.renderObject(e,n)})))}))},this.renderObject=function(e,n){var r=e.material,i=e.geometry;if(!0===e.visible&&r&&i&&!0===r.visible){t.state.setDepthTest(r.depthTest);var o=!1,a=t.setProgram(n,r,e);o="BufferGeometry"===i.type?t.updateVerticesAttribute2(a,i,!1):t.updateVerticesAttribute(a,i,!1),t.renderGeometryWithProgram(a,i,r,o)}},this.setProgram=function(e,n,r){var i=!(arguments.length>3&&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<e[n]&&delete e[n]}))},this.removeMaterial=function(e){var n=e.program.program;if(n){e.program=null;for(var r=t.programs,i=r.length-1;i>=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,T,A=0,C=0;C<p;C++)for(var R=0;R<d;R++)M=R+(d+1)*C,w=R+(d+1)*(C+1),E=R+1+(d+1)*(C+1),T=R+1+(d+1)*C,s.addIntoBuffer(s.indicesBufferData,[M,w,E],A),s.addIntoBuffer(s.indicesBufferData,[M,E,T],A+3),A+=6;s.borderIndicesBufferData=new Uint16Array(4),s.borderIndicesBufferData[0]=0,s.borderIndicesBufferData[1]=d,s.borderIndicesBufferData[2]=(d+1)*p,s.borderIndicesBufferData[3]=(d+1)*(p+1)-1;var S=0;s.borderVerticesBufferData=new Float32Array(6*(d+p));for(var P=0;P<g;P+=d+1)s.addIntoBuffer(s.borderVerticesBufferData,s.vertices[P],S),S+=3;for(var D=(d+1)*p+1;D<g;D++)s.addIntoBuffer(s.borderVerticesBufferData,s.vertices[D],S),S+=3;for(var O=(d+1)*p-1;O>0;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,T=0;T<=p;T++){var A=T*m-f,C=e.get3DVertex([A,E],s,l);b.push.apply(b,mi(C)),_.push(T/p,1-w/v),M.push.apply(M,mi(y))}for(var R=0;R<v;R++)for(var S=0;S<p;S++){var P=S+(p+1)*R,D=S+(p+1)*(R+1),O=S+1+(p+1)*(R+1),I=S+1+(p+1)*R;x.push(P,D,O),x.push(P,O,I)}return{uvs:_,indices:x,vertices:b,normals:M}},e.getNormal=function(t){var e,n=arguments.length>1&&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 Wi(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 Wi(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 Wi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Hi=function(){function t(){this.faceCount=0,this.verticesCoords=[],this.textureCoords=[],this.uvs=[],this.vertices=[],this.normals=[],this.indexes=[]}var e=t.prototype;return e.load=function(t){var e=this;return new Promise((function(n){(function(t){var e=new XMLHttpRequest;return e.open("GET",t,!0),e.send(null),new Promise((function(t){e.addEventListener("load",(function(){t(e.responseText)}),!1)}),(function(t){e.addEventListener("error",(function(e){console.error("request error"),t(e)}),!1)}))})(t).then((function(t){e.parse(t);var r=e.genObject3D();n(r)}))}))},e.genObject3D=function(){var t=new Zr;t.setAttribute("position",new Gr(this.vertices,3)),this.uvs.length&&t.setAttribute("uv",new Gr(this.uvs,2)),t.setIndexes(this.indexes);var e=new Pi;return new Kr(t,e)},e.parse=function(t){var e,n=Gi(t.split("\n"));try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.indexOf("#");-1!==i&&(r=r.substring(0,i));var o=(r=r.trim()).split(/\s+/);switch(o[0]){case"v":this.verticesCoords.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));break;case"vn":this.normals.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));break;case"vt":this.textureCoords.push(parseFloat(o[1]),parseFloat(o[2]));break;case"p":case"l":case"usemtl":break;case"f":o.shift(),this.parseFaceLine(o)}}}catch(t){n.e(t)}finally{n.f()}},e.parseFaceLine=function(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r];if(i.length>0){var o=i.split("/");e.push(o)}}for(var a=e[0],s=1,u=e.length-1;s<u;s++){var h=e[s],c=e[s+1];this.addFace(a,h,c)}},e.addFace=function(t,e,n){var r=this.verticesCoords,i=r.length/3,o=this.parseVertexIndex(t[0],i),a=this.parseVertexIndex(e[0],i),s=this.parseVertexIndex(n[0],i);this.vertices.push(r[o],r[o+1],r[o+2],r[a],r[a+1],r[a+2],r[s],r[s+1],r[s+2]);var u=3*this.faceCount;if(this.indexes.push(u,u+1,u+2),this.faceCount++,""!==t[1]){var h=this.textureCoords,c=h.length,l=this.parseUVIndex(t[1],c),f=this.parseUVIndex(e[1],c),d=this.parseUVIndex(n[1],c);this.uvs.push(h[l],h[l+1],h[f],h[f+1],h[d],h[d+1])}t[2]},e.parseVertexIndex=function(t,e){var n=parseInt(t,10);return 3*(n>=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:Ti,BasicMaterial:Pi,BufferGeometry:Zr,WebGLRenderer:Ui,PlaneGeometry:Ni,BoxGeometry:zi,WebGLRenderTarget:Vi,PlaneBufferGeometry:ji,Box3:Nr,OBJLoader:Hi,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:Ar,quatToEuler:Ir,BufferAttribute:Fr,Uint8BufferAttribute:jr,Uint16BufferAttribute:zr,Uint32BufferAttribute:Vr,Float32ArrayAttribute:Gr,UintBufferAttribute:Wr,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 Ti;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<o[2]&&!0!==i)return null;En(o,o,t.projectionMatrix),o[0]=o[0]/o[3],o[1]=o[1]/o[3],o[2]=o[2]/o[3],o[3]=1;var a=_t(o[0],o[1]);return lo(a,n,r)},vo=function(t,e,n,r){var i=po(e,t,n,r)||[-1,-1],o=xi(i,2),a=o[0],s=o[1],u=!1;return a>=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;d<o.length/3;d++){var p=d%(c+1)*l,v=Math.floor(d/(c+1))*f;p=p/s+1*u/s,v=v/s+1*h/s,1===i&&(v*=2),a.push(p,v)}return a}},this.getFaceIndex=function(n){var r=0,i=xi(n,3),o=i[0],a=i[1],s=i[2],u=Math.round(180*Math.atan(Math.abs(s)/Math.abs(o))/Math.PI);o>0?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;p<a;p++){var v=Math.sin(g(p*u-90))*i,m=Math.cos(g(p*u-90))*i;v=Math.round(100*v)/100,m=Math.round(100*m)/100,l=Math.floor(p/h);for(var y=0;y<o;y++){var _=Math.cos(g(y*s))*m,x=Math.sin(g(y*s))*m;if(_=Math.round(100*_)/100,x=Math.round(100*x)/100,n.push(_,v,x),e=(f=Math.floor(y/h))+l*c,l<this.rows&&(r[e]||(r[e]=[]),r[e].push(_,v,x)),l>0&&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),l<this.rows&&y===o-1&&r[e].push(d[0],d[1],d[2])}}return{vertexs:n,facesVertex:r}},e.getSphereFacesIndices=function(){for(var e=[],n=t.H_SEGS/this.cols,r=n+1,i=0;i<n;i++)for(var o=0;o<n;o++){var a=i*r,s=a+o+1,u=a+o+1+r;e.push(a+o,s,u),s=a+o+1+r,e.push(a+o,s,a+r+o)}return e},e.getSphereFacesIndicesByimageZoom=function(e){for(var n=this,r=[],i=t.H_SEGS,o=Math.pow(2,5-e),a=i/this.cols+1,s=a*a,u=function(t){for(var e=function(e){n.facesVertexIndice.forEach((function(n){r.push(n+s*e+s*t*2)}))},i=0;i<o;i++)e(i)},h=0;h<o;h++)u(h);return r},t}();go.DEFAULT_COLS=Math.pow(2,4),go.H_SEGS=64,go.V_SEGS=33;var yo=function(){function t(){this._counter=0,this._imageCollection={}}var e=t.prototype;return e.getImageInstance=function(){var t;for(var e in this._imageCollection)if(this._imageCollection[e]&&!0===this._imageCollection[e]._free)return this._imageCollection[e]._free=!1,this._imageCollection[e];t=new Image;var n=this.getGUID();return this._imageCollection[n]=t,t},e.freeImage=function(t){t&&(t._free=!0,t.src="",t.onload=t.onerror=null)},e.getGUID=function(){return this._counter++,"img_".concat(this._counter)},t}(),_o=function(){function t(e,n){var r=this,i=arguments.length>2&&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 A(t.MAX_TILE_CACHED,{clearCallback:function(t){r.imageInstancePool.freeImage(t)}}),this.textureInfo=new A(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"),To=["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"),Ao=["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),e<n&&(this.nodes[0]=new t(e+1,n,2*r,2*i),this.nodes[1]=new t(e+1,n,2*r,2*i+1),this.nodes[2]=new t(e+1,n,2*r+1,2*i),this.nodes[3]=new t(e+1,n,2*r+1,2*i+1))}var e=t.prototype;return e.hasNodes=function(){return this.nodes.length>0},e.getNodeKeysByLevel=function(t){if(t<this.level)return console.warn("指定节点".concat(t," 不在当前节点").concat(this.level,"范围内!")),[];if(this.level===t)return[this.key];for(var e=[],n=0;n<this.nodes.length;n++)if(Object.prototype.hasOwnProperty.call(this.nodes,n)){var r=this.nodes[n];if(this.level===t-1)e.push(r.key);else if(r.hasNodes()){var i=r.getNodeKeysByLevel(t);e.push.apply(e,mi(i))}}return e},t}();var So=function(t){function e(e){var n;return(n=t.call(this,e)||this).name="SphereRender",n.sphere=void 0,n.textureManager=void 0,n.imgColsRows=void 0,n.curThumbTexture=void 0,n.meshCache={},n.tileInfoCache={},n.imgRange=void 0,n.faceRange=void 0,n.hitTile=void 0,n.setData=function(t){n.panoData=t,n.curThumbTexture=null,n.loadThumbTextures(t.panoId)},n.update=function(){n.updateRangeInfo(),n.checkAndLoadTiles()},n.checkAndLoadTiles=function(){if(n.curThumbTexture&&n.panoData){var t=n.panoData.panoId,e=n.camera,r=n.imgColsRows[n._imgZoom],i=r.cols,o=i-1,a=r.rows-1,s=n.pano.getContainerSize(),u=s.width,h=s.height,c=!1,l=[],f=xi(n.imgRange,4),d=f[0],p=f[1],v=f[2],m=f[3];if(vo(Vt(0,100,0),e,u,h)){for(var g=0;g<=v;g++)for(var y=0;y<=o;y++)n.checkAndLoadTile(t,y,g,n._imgZoom),l.push([g,y]);v<m&&(v+=1,c=!0)}else if(vo(Vt(0,-100,0),e,u,h)){for(var _=m;_<=a;_++)for(var x=0;x<=o;x++)n.checkAndLoadTile(t,x,_,n._imgZoom),l.push([_,x]);v<m&&(m-=1,c=!0)}else c=!0;if(!0===c){p>o&&(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;r<n.hitTile.length;r++){var i=xi(n.hitTile[r],2),o=i[0];e(i[1],o)}return!0},n.pano=e,n.sphere=new go(e.opts.radius),n.textureManager=new _o(e),n.imgColsRows=function(){for(var t=[],e=0;e<=5;e++)t[e]=e<2?{cols:1,rows:1}:{cols:Math.pow(2,e-1),rows:Math.pow(2,e-1)/2};return t}(),n.curThumbTexture=null,n.meshs=new Kr,n}c(e,t);var n=e.prototype;return n.checkAndLoadTile=function(t,e,n,r){var i=this,o=this.textureManager,a=o.calcTileKey(t,e,n,r);!0!==(void 0!==o.textureInfo.getData(a))&&this.textureManager.loadTexture(t,e,n,r).then((function(t){t&&!t.done&&(t.aniInfo=i.createTextureAnimation(t),t.done=!0,i.pano.dispatchEvent({type:d.REFRESH,log:"[Refresh Log] 瓦片加载完成, 渲染一帧"}))}))},n.loadThumbTextures=function(t){var e=this;this.textureManager.loadTexture(t,0,0,1).then((function(t){e.curThumbTexture=t,e.pano.dispatchEvent({type:d.THUMB_LOADED}),e.pano.dispatchEvent({debug:!0,type:d.REFRESH,log:"[Refresh Log] 缩略图加载完毕,渲染一帧"})}))},n.createTextureAnimation=function(t){var e=this;return t.alpha=0,new ho(0,1,300).onUpdate((function(n){t.alpha=n,e.pano.dispatchEvent({debug:!0,type:d.REFRESH,log:"[Refresh Log] 纹理清晰度渐变动画,渲染一帧"})})).onEnd((function(){t.finished=!0})).start()},n.createTileMesh=function(t,e){var n=new Ti,r=new Zr;if(n.depthTest=!1,n.vertexShader=xo,n.fragmentShader=bo,n.uniforms={uSampler:{type:"t",value:null},uSamplerBack:{type:"t",value:null},uDrawThumb:{type:"1i",value:1},uDrawBack:{type:"1i",value:1},uAlpha:{type:"1f",value:1}},!this.setGeometryAttrib(r,t,e))return null;var i=new Kr(r,n);return i.name="tile-mesh",i},n.setGeometryAttrib=function(t,e,n){var r="".concat(e,"_").concat(n,"_").concat(this._imgZoom),i=this.tileInfoCache[r];if(!i)return!1;for(var o=[],a=[],s=[],u=0;u<i.length;u++){var h=i[u].split("_"),c=this.sphere.rows,l=Number(h[1]),f=c-1-Number(h[0]);o.push.apply(o,mi(this.sphere.getFaceVertex(f,l))),a.push.apply(a,mi(this.sphere.generateTextureCoord(f,l,this._imgZoom))),s.push.apply(s,mi(this.sphere.generateTextureCoord(f,l,1)))}var d=this.sphere.getSphereFacesIndicesByimageZoom(this._imgZoom);return t.setAttribute("uv",new Gr(a,2)),t.setAttribute("uvBack",new Gr(s,2)),t.setAttribute("position",new Gr(o,3)),t.setIndexes(d),!0},n.getTileBoundary=function(){var t=this.pano.getContainerSize(),e=t.width,n=t.height,r=_t(0,0),i=_t(e,0),o=_t(0,n),a=_t(e,n),s=_t(.5*e,0),u=_t(.5*e,n),h=_t(0,.5*n),c=_t(e,.5*n),l=this.getSpherePosition(r),f=this.getSpherePosition(i),d=this.getSpherePosition(o),p=this.getSpherePosition(a),v=this.getSpherePosition(s),m=this.getSpherePosition(u),g=this.getSpherePosition(h),y=this.getSpherePosition(c),_=Math.max(l[1],v[1],f[1]),x=Math.min(d[1],m[1],p[1]),b=[l[0],g[0],d[0],v[0]],w=[f[0],y[0],p[0],m[0]],E=Math.min.apply(Math,b),T=Math.max.apply(Math,w),A=M(b),C=M(w),R=this.sphere.cols,S=R/2;A.max-A.min>S&&(E=Math.min.apply(Math,mi(b.filter((function(t){return t>S}))))),C.max-C.min>S&&(T=Math.max.apply(Math,mi(w.filter((function(t){return t<S}))))),E>T&&(E-=R);var P=this.getImgIndexByFaceColRow(E,_),D=xi(P,2),O=D[0],I=D[1],L=this.getImgIndexByFaceColRow(T,x),B=xi(L,2);return[[E,T,_,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<n;)r+=e;return r%=e},n.getSpherePosition=function(t){var e=this.camera,n=this.pano.getContainerSize(),r=n.width,i=n.height,o=this.sphere.viewportToSphereCoord(t,r,i,e),a=this.sphere.getFaceIndex(o),s=xi(a,2);return _t(s[0],s[1])},n.generateBackThumb=function(t){if(t){var e=this.pano,n=e.getContainerSize(),r=n.width,i=n.height,o="//apisv0.bdimg.com/?udt=20140616&qt=pdata&pos=0_0&z=2&sid=".concat(t,"&from=H5&").concat($("/",{isCounter:!0})),a=e.getPanes().tileLayer;a.style.backgroundImage='url("'+o+'")',a.style.backgroundPosition="50% 50%",a.style.backgroundSize="150% 150%",a.style.width="".concat(r,"px"),a.style.height="".concat(i,"px")}},o(e,[{key:"_imgZoom",get:function(){return this.pano.imageZoom}}]),e}(Ji),Po=[10,-20,30,10,-20,10,-10,-20,10,-10,-20,30].map((function(t){return-20===t?-20:1.8*t})),Do=[10,-22,30,10,-22,10,-10,-22,10,-10,-22,30].map((function(t){return-22===t?-22:1.8*t})),Oo=[1.8,-20,24.9,1.8,-20,16.3,-1.8,-20,16.3,-1.8,-20,24.9].map((function(t){return-20===t?-20:1.8*t})),Io=[0,0,0,.5,.25,.5,.25,0],Lo=function(){function t(t,e,n){var r=this;this.mesh=void 0,this.material=void 0,this.linkData=void 0,this._pano=void 0,this.northDir=void 0,this.yAxisDis=void 0,this.isPosInArrow=function(t,e,n,i,o){var a=_t(t,e),s=fo(a,n,i,o,-1),u=200*s[0],h=200*s[1],c=200*s[2],l=r.yAxisDis/h;if(l<0)return!1;var f=[u*l,h*l,c*l];return r.isHitLink(f)},this._pano=t,this.linkData=e,this.northDir=n,this.yAxisDis=0,this.linkData.refinedDir=_((e.topoDir||0)+this.northDir),this.material=this.createArrowMaterial(),this.mesh=this.initMesh(),this.changePose()}var e=t.prototype;return e.initMesh=function(){var t=this.createGeometry(),e=new Kr(t,this.material);return e.visible=!1,e.name="link-mesh",e},e.createArrowMaterial=function(){var t=new Ti;return t.depthTest=!1,t.vertexShader=Mo,t.fragmentShader=wo,t.uniforms={uSampler:{type:"t",value:null}},t},e.setTopoTexture=function(t){t.isTexture&&(this.material.uniforms.uSampler.value=t)},e.setVisible=function(t){this.mesh.setVisible(t,!0)},e.createGeometry=function(){var t=new Zr,e=this.getTextCoord(this.linkData.topoDir),n=[].concat(Do,Po,Oo),r=[].concat([.5,0,.5,.5,1,.5,1,0],[0,0,0,.5,.5,.5,.5,0],e),i=[].concat([0,1,2,0,2,3],[4,5,6,4,6,7],[8,9,11,10,11,9]);return t.setAttribute("position",new Gr(n,3)),t.setAttribute("uv",new Gr(r,2)),t.setIndexes(i),t},e.changePose=function(t){t=t||this.mesh;var e=50,n=-30,r=this._pano.getPov().pitch,i=this.linkData.refinedDir;(e+=20*this._pano.getZoom(),r<0)&&(e*=(90-(r=Math.abs(r)))/90,n-=20*r/90);var o=Math.cos(g(i))*e,a=Math.sin(g(i))*e;this.yAxisDis=n+-20,t.setPosition(o,n,a),t.rotateY(-_(i-90)),t.rotateX(-5),t.updateWorldMatrix(!0)},e.getTextCoord=function(t){t=(t+360)%360;var e=Math.ceil(Math.floor(t/22.5)/2);8===e&&(e=0);for(var n=Io.slice(0),r=Math.floor(e/2),i=e%2,o=0;o<n.length;o++)o%2==0?(n[o]+=.25*r,n[o]=.5*n[o]):(n[o]+=.5*i,n[o]=.5*n[o]+.5);return n},e.isHitLink=function(t){var e=t[0],n=t[2],r=this.mesh.worldMatrix,i=Vt(Po[0],Po[1],Po[2]),o=Vt(Po[6],Po[7],Po[8]),a=Vt((i[0]+o[0])/2,(i[1]+o[1])/2,(i[2]+o[2])/2);return ee(a,a,r),Math.abs(e-a[0])<18&&Math.abs(n-a[2])<18},t}(),Bo=function(t){function e(e){var n;return(n=t.call(this,e)||this).name="PanoLinkRender",n.linkVisible=!0,n.textureManager=void 0,n.linkInfos=[],n.setData=function(t){if(t&&(o=t.getTopos,a="[object Function]"===Object.prototype.toString.call(o),s="[object AsyncFunction]"===Object.prototype.toString.call(o),a||s)){n.reset();var e=t.getTopos(),r=t.northDir,i=t.panoType===p.TYPE_STREET;e.length&&i&&(n.linkInfos=e.map((function(t){return new Lo(n.pano,t,r)})),n.meshs=n.linkInfos.map((function(t){return t.mesh})),n.loadTextures(),n.setVisible(!0))}var o,a,s},n.clickChecker=function(t,e){if(n.linkVisible){var r=n.getIdByTouchPos(t,e);return r&&(n.setVisible(!1),n.pano.dispatchEvent({type:d.LINK_CLICK,id:r}),n.pano.setId(r,{animation:!0})),!r}},n.pano=e,n.meshs=[],n.textureManager=new _o(e),n}c(e,t);var n=e.prototype;return n.reset=function(){this.meshs=[],this.linkInfos=[]},n.update=function(){this.linkInfos.forEach((function(t){t.changePose()}))},n.setVisible=function(t){var e=this.linkInfos;if(!(e.length<1)){var n=this.pano.opts.linksControl,r=!1;!0===n&&(r=t),this.linkVisible=r,e.forEach((function(t){return t.setVisible(r)}))}},n.draw=function(){},n.loadTextures=function(){var t=this,e=this.pano.opts.imgPath?"".concat(this.pano.opts.imgPath,"topo_arrow.png"):p.TOPO_ARROW_TEXTURE;this.textureManager.loadTopoTexture(e).then((function(e){e&&t.linkInfos.forEach((function(t){t.setTopoTexture(e)}))}))},n.getIdByTouchPos=function(t,e){var n=this,r=null;if(!this.linkInfos.length)return r;var i=this.pano.getContainerSize(),o=i.width,a=i.height,s=this.linkInfos.filter((function(r){return r.isPosInArrow(t,e,n.camera,o,a)}));return s.length&&(r=s[0].linkData.panoId),r},e}(Ji),ko=function(){function t(t,e,n){var r=this;this.start=function(){r.fadeAni.start(),r._pano.dispatchEvent({debug:!0,log:"淡出动画,渲染一帧",type:d.REFRESH})},this.update=function(){r.fadeAni.update()},this._pano=t,this.gl=this._pano.gl,this.snapshot=e,this.scene=this.initScene(),this.camera=this.initCamera();this.fadeAni=new ho(1,0,600).onUpdate((function(t){r.material.uniforms.uOpacity.value=t,r._pano.dispatchEvent({type:d.REFRESH})})).onEnd((function(){n&&n(),r._pano.dispatchEvent({type:d.REFRESH,debug:!0,log:"淡出动画结束,渲染一帧"})}))}var e=t.prototype;return e.initScene=function(){var t=new Qr,e=this._pano.getContainerSize(),n=e.width,r=e.height,i=new ji(n,r),o=this.initMaterial(),a=new Kr(i,o);return t.add(a),t},e.initMaterial=function(){var t=new Ti;return t.depthTest=!1,t.vertexShader=Eo,t.fragmentShader=To,t.uniforms={uSampler:{type:"t",value:this.snapshot},uOpacity:{type:"1f",value:1}},this.material=t,t},e.initCamera=function(){var t=this._pano.getContainerSize(),e=t.width/2,n=t.height/2;return new Xi(-e,e,n,-n,0,11e3)},t}(),Uo=function(){function t(t,e,n){var r=this;this.start=function(){r.waveAni.start(),r._pano.dispatchEvent({debug:!0,log:"淡出动画,渲染一帧",type:d.REFRESH})},this.update=function(){r.waveAni.update()},this._pano=t,this.gl=this._pano.gl,this.snapshot=e,this.scene=this.initScene(),this.camera=this.initCamera();this.waveAni=new ho(0,1,800).onUpdate((function(t){r.material.uniforms.progress.value=t,r.material.uniforms.uOpacity.value=1-t,r._pano.dispatchEvent({type:d.REFRESH})})).onEnd((function(){n&&n(),r._pano.dispatchEvent({type:d.REFRESH,debug:!0,log:"淡出动画结束,渲染一帧"})}))}var e=t.prototype;return e.initCamera=function(){var t=this._pano.getContainerSize(),e=t.width/2,n=t.height/2;return new Xi(-e,e,n,-n,0,11e3)},e.initScene=function(){var t=new Qr,e=this._pano.getContainerSize(),n=e.width,r=e.height,i=new ji(n,r),o=this.initMaterial(),a=new Kr(i,o);return t.add(a),t},e.initMaterial=function(){var t=new Ti,e=this._pano.getContainerSize(),n=e.width,r=e.height;return t.depthTest=!1,t.vertexShader=Eo,t.fragmentShader="\n uniform float aspect;\n uniform float radius;\n uniform float amp;\n uniform float band;\n uniform float waves;\n uniform float speed;\n uniform float progress;\n uniform vec2 uCenter;\n uniform sampler2D uSampler;\n uniform float uOpacity;\n\n varying vec2 vTextureCoord;\n\n void main() {\n vec2 tc = vTextureCoord;\n vec2 uv = vec2(0.0, 0.0);\n vec2 p;\n float len;\n vec2 uv_offset;\n float wave_width = band * radius;\n\n p = (tc - uCenter);\n p.x = p.x * aspect;\n len = length(p);\n\n float current_radius = radius * progress;\n float damp_factor = 1.0;\n if (progress > .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<u;h++)ee(o=s[h],o,n),a[h]={x:o[0]*r*.5,y:-o[1]*i*.5};return a},this.getIntersection=function(t,e,n,r){if(t.x===e.x||n.x===r.x)return null;var i=(e.y-t.y)/(e.x-t.x),o=(r.y-n.y)/(r.x-n.x);if(i===o)return null;var a=(o*n.x-i*t.x+t.y-n.y)/(o-i);return{x:a,y:i*(a-t.x)+t.y}},this.calculateVanishPoint=function(t,e,r,i){var o=n.getIntersection(t[0],t[1],t[2],t[3]);return null===o?null:(o.x+=r*e*.5,o.y+=i*e*.5,o)},this.getOuterRect=function(t,e,n){return new Fo(t*(n-1)*.5,e*(n-1)*.5,t,e)},this.transformPoint=function(t,e,n){return t&&void 0!==t.x&&void 0!==t.y?{x:t.x+e,y:t.y+n}:t},this.getInnerRect=function(t,e,r,i,o){var a=n.transformPoint(t,.5*-r*o,.5*-i*o),s=n.transformPoint(a,0,20),u=n.transformPoint(a,10,20),h=n.getIntersection(e[0],e[1],s,u),c=n.getIntersection(e[2],e[3],s,u),l=n.transformPoint(h,0,-70),f=new Fo(l.x+r*o*.5,l.y+i*o*.5,c.x-h.x,70);return f=n.fixInnerRectPosition(f,t),f=n.fixInnerRectSize(f,t,r)},this.fixInnerRectPosition=function(t,e){var n=t,r=(e.x-t.x)/t.width,i=0;return r>.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),Wo=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;l<o;l++)for(var f=0;f<a;f++)u=(s=e+(a+1)*l+f)+1,c=(h=s+a+1)+1,n.push(s,h,c),n.push(s,c,u);return n},r.linerInterpolate=function(t,e,n){var r=[];if(n<=0)r.push(t);else for(var i=(e-t)/n,o=0;o<=n;o++)r[o]=t+i*o;return r},r.calculateUVCoordinate=function(t,e,n){for(var i,o=t.camera,a=t.panoWidth,s=t.panoHeight,u=t.vanishPointDeltaX,h=t.vanishPointDeltaY,c=[],l=e.width,f=e.height,d=0,p=0,v=n.length/3,m=0;m<v;m++)En(i=hn(n[3*m],n[3*m+1],n[3*m+2],1),i,o.viewMatrix),En(i,i,o.projectionMatrix),i[0]=i[0]/i[3],i[1]=i[1]/i[3],i[2]=i[2]/i[3],i[3]=1,d=(i[0]*a*.5+u+.5*l)/l,p=(i[1]*s*.5+h+.5*f)/f,c.push(r.getValidateUV(d),r.getValidateUV(p));return new Float32Array(c)},r.getValidateUV=function(t){return Math.max(-.1,Math.min(1.1,t))},r.rotationMatrix=Pe(),r.camera=e.camera,e.isMovingForward)Ve(r.rotationMatrix,r.rotationMatrix,g(_(-e.traverseDir+e.panoData.heading)));else{var i=_(180-e.traverseDir+e.panoData.heading);Ve(r.rotationMatrix,r.rotationMatrix,g(i))}r.cuboidVertexes=r.createSkeleton(e);var o=r.modelSkeleton(r.cuboidVertexes,r.rotationMatrix),a=xi(o,2),s=a[0],u=a[1];return r.verticesBufferData=new Float32Array(s),r.indicesBufferData=new Uint16Array(u),r.uvtsBufferData=r.calculateUVCoordinate(e,n,s,r.rotationMatrix),r.setAttribute("position",new Gr(r.verticesBufferData,3)),r.setAttribute("uv",new Gr(r.uvtsBufferData,2)),r.setIndexes(r.indicesBufferData),r}return c(e,t),e}(Zr),Ho=[0,1,0,.5],Zo=function(){function t(t,e,n,r,i){var o=this;this.start=function(){o.animation.start(),o._pano.dispatchEvent({debug:!0,log:"淡出动画,渲染一帧",type:d.REFRESH})},this.update=function(){o.animation.update()},this._pano=t,this.distance=e,this.handleEnd=i,this.traverseDir=r,this.snapshot=n,this.camera=t.camera,this.scene=this.initScene(),this.rotationMatrix=this.traverseGeometry.rotationMatrix,this.initAni()}var e=t.prototype;return e.initAni=function(){var t=this,e=Vt(0,0,this.distance);ee(e,e,this.rotationMatrix),this.animation=new ho(0,1,700,so.linear).onUpdate((function(n){var r=Ft();Yt(r,e,n),t.scene.traverse((function(t){t.position=r,t.updateWorldMatrix(!0)})),t._pano.dispatchEvent({debug:!0,type:d.REFRESH,log:"[Refresh Log] 前进动画, 渲染一帧"})})).onEnd((function(){t.handleEnd&&t.handleEnd(),t._pano.dispatchEvent({debug:!0,type:d.REFRESH,log:"[Refresh Log] 前进动画, 渲染一帧"})}))},e.initScene=function(){var t=new Qr,e=this._pano.getContainerSize(),n=e.width,r=e.height,i=new jo(this._pano,this.traverseDir),o=new Fo(0,0,n,r),a=new Wo(i,o),s=this.initMaterial(),u=new Kr(a,s);return this.traverseGeometry=a,t.add(u),t},e.initMaterial=function(){var t=new Ti;return t.depthTest=!1,t.vertexShader=Ao,t.fragmentShader=Co,t.uniforms={uSampler:{type:"t",value:this.snapshot},uOpacity:{type:"1f",value:1},vColor:{type:"4f",value:Ho},showDebugLine:{type:"1i",value:true}},this.material=t,t},t}(),qo=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]: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<e;n++)r[n]=t[n];return r}var Jo=function(){function t(t){var e=this;this.name="PanoOverlayManager",this.overlays=[],this.pano=void 0,this.isReady=!1,this.clickChecker=function(t,n){var r,i=!0,o=Ko(e.overlays);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=a.dom.getBoundingClientRect(),u=s.left,h=s.right,c=s.top,l=s.bottom;if(t>=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<this.overlays.length;e++)if(this.overlays[e].id===t.id)return this.overlays[e].remove(),void this.overlays.splice(e,1)},e.init=function(){this.isReady=!0;var t,e=Ko(this.overlays);try{for(e.s();!(t=e.n()).done;){t.value.init(this.pano)}}catch(t){e.e(t)}finally{e.f()}},e.draw=function(){if(this.isReady){var t,e=Ko(this.overlays);try{for(e.s();!(t=e.n()).done;){t.value.draw()}}catch(t){e.e(t)}finally{e.f()}}},e.destroy=function(){var t,e=Ko(this.overlays);try{for(e.s();!(t=e.n()).done;){t.value.remove()}}catch(t){e.e(t)}finally{e.f()}this.overlays=[]},t}();function $o(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 ta(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 ta(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 ta(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var ea=function(){function t(t){var e=this;this.renderer=void 0,this.gl=void 0,this.camera=void 0,this.cameraNoFix=null,this.panoData=null,this.scene=void 0,this.sceneChange=void 0,this.openingAni=void 0,this.sphereRender=void 0,this.linkGLRender=void 0,this.overlayManager=void 0,this.skyboxRender=void 0,this.pano=void 0,this.renderThreadId=null,this.requestId=null,this.isRAFRuning=!1,this.setData=function(){var t=nt(ot.mark((function t(n){var r,o;return ot.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:if(!e.panoData||!e.pano.useAnimation){t.next=8;break}return e.sceneChange.setData(e.panoData,n),t.next=6,e.sceneChange.sceneChangeHandler();case 6:void 0!==e.pano.backupUseAnimation&&(e.pano.useAnimation=e.pano.backupUseAnimation),e.pano.animationType="";case 8:e.reset(),e.panoData=n,e.pano.panoData=n,void 0===i(n.defaultHeading)&&void 0===i(n.defaultPitch)||e.pano.handlePovChange({heading:n.defaultHeading,pitch:n.defaultPitch}),r=n.image&&6===n.image.length,(o=r?e.skyboxRender:e.sphereRender).setData(n),e.linkGLRender.setData(n),e.overlayManager.init(),e.scene.add(o.meshs),e.updateProjectionMatrix(e.camera),e.updateCameraHeadingAndPitch(e.camera);case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.getSnapshot=function(t,n){t=t||e.scene,n=n||e.camera;var r=e.pano.getContainerSize(),i=r.width,o=r.height,a=new Vi(i,o);return a.premultiplyAlpha=!0,e.renderer.render(t,n,a),a},this.update=function(){e.panoData&&(e.sphereRender.update(),e.linkGLRender.update(),e.startRenderThread())},this.onThumbLoaded=function(){e.sceneChange.changeAni&&e.sceneChange.changeAni.start();var t=e.linkGLRender.meshs;t&&e.scene.add(t),e.startFishEyeAni()},this.startRenderThread=function(){var t=arguments.length>0&&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;i<this._pano.renders.length;i++){var o=this._pano.renders[i];if(o.clickChecker&&!(n=o.clickChecker(r.x,r.y))){t.stopPropagation();break}}if(!1!==n)if(this.state.isTouchMove)this.state.isTouchMove=!1,this.processMotion(t);else if(t.stopPropagation(),this.clickTimer)clearTimeout(this.clickTimer),this.clickTimer=null,this._pano.dispatchEvent(d.DOUBLE_CLICK,t);else{this.clickTimer=setTimeout((function(){e.clickTimer=null,e._pano.dispatchEvent(d.CLICK,t)}),300)}}},e.setPov=function(t){var e=t.x,n=t.y,r=-e*this._anglePerPixel,i=n*this._anglePerPixel,o=this.state.initHeading+r,a=this.state.initPitch+i;this._pano.setPov({heading:o,pitch:a})},e.processMotion=function(t){var e=this,n=this.state,r=x(),i=r-n.lastMoveTime,o=n.moveDiffPos,a=o.x,s=o.y;if(i<300&&(Math.abs(a)>10||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);n<e;n++)r[n]=t[n];return r}var oa=function(){function t(t){this.pano=t,this.preZoom=t.getZoom(),this.zoomChangeAni=null,this.debug=!1,this.panoServiceLock=!1,this.bindEvent(),this.initModule(),this.initResize(),this.handleContextStatus()}var e=t.prototype;return e.initModule=function(){var t=this.pano;this.panoService=new tt(t),this.panoGLRender=new ea(t),this.op=new na(t)},e.initResize=function(){var t=this,e=this.pano.getContainerSize(),n=this.pano.getContainer(),r=function(n,r){if(n&&r){var i=new l(n,r);i.equals(e)||(t.pano.dispatchEvent({type:d.SIZE_CHANGED}),e=i)}};if(void 0!==window.ResizeObserver){var i=new window.ResizeObserver((function(t){var e,n=ra(t);try{for(n.s();!(e=n.n()).done;){var i=e.value.target;r(i.clientWidth,i.clientHeight)}}catch(t){n.e(t)}finally{n.f()}}));i.observe(n),this.resizeOb=i}else this.checkSizeTimer=setInterval((function(){r(n.clientWidth,n.clientHeight)}),80)},e.bindEvent=function(){var t=this,e=this.pano;e.on(d.PANO_ERROR,(function(){t.panoServiceLock=!1})),e.on(d.DATA_LOADED,(function(n){t.pano.opts.visible?t.pano.show():t.pano.hide(),t.panoServiceLock=!1,n.options&&n.options.animation&&(e.backupUseAnimation=e.useAnimation,e.useAnimation=n.options.animation,""!==n.options.animationType&&(e.animationType=n.options.animationType)),t.panoGLRender.setData(n.data),t.op.init()})),e.on(d.SET_POV,(function(n){var r=n.pov,i=n.options,o=(void 0===i?{animation:!0}:i).animation;if(t.panoGLRender.isCanUpdate){var a=function(n){e.handlePovChange(n)&&(t.panoGLRender.updateCameraHeadingAndPitch(e.camera),t.panoGLRender.update(),e.dispatchEvent(d.POV_CHANGED,n))};if(o){var s=e.getPov(),u=s.heading,h=s.pitch,c=r.heading-u,l=r.pitch-h;c>180?(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),t<p.MIN_ZOOM&&(t=p.MIN_ZOOM),t!==r._zoom&&(r._zoom=t,r.dispatchEvent(d.ZOOM_CHANGED,{noAnimation:e.noAnimation||!1})))},r.getPov=function(){return r._pov},r.setPov=function(t,e){r.dispatchEvent(d.SET_POV,{pov:t,options:e||{animation:!1}})},r.handlePovChange=function(t){if("object"===i(t)){var e=!1,n=t.heading,o=t.pitch;if("number"!=typeof n||isNaN(n)||(e=!0,n=_(n),r._pov.heading=n),"number"==typeof o&&!isNaN(n)){e=!0;var a=r.opts.minPitch,s=r.opts.maxPitch;o>s&&(o=s),o<a&&(o=a),r._pov.pitch=o}return e}},r.calcDisplayZoom=function(t,e){t=t||r.getContainerSize(),e=e||r.getZoom();var n=t,i=n.width,o=n.height,a=r.opts.maxImageZoom,s=r.opts.minImageZoom,u="".concat(i,"_").concat(o,"_").concat(e);if(r._displayZoomResultsCache[u])return r._displayZoomResultsCache[u];for(var h=r.calcAnglePerPixel(),c=Math.floor(e)+2,l=360/(2*Math.pow(2,c-2)*h);l>512;)c++,l=360/(2*Math.pow(2,c-2)*h);if(c>a){var f=c-a;l*=Math.pow(2,f),c=a}c<s&&(c=s);var d={imgZoom:c,displayTileSize:l=Math.round(l)};return r._displayZoomResultsCache[u]=d,d},r.calcAnglePerPixel=function(){return r.getFov()/r.getContainerSize().height},r.getFov=function(t){return t=t||r.getZoom(),(v.isMobile?r.calcMobileFovy:r.calcPCFovy).call(a(r),t)},r.getVisible=function(){return r.opts.visible},r.setId=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_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'<svg version="1.1" overflow="hidden" width="82px" height="82px" viewBox="0 0 82 82"style="position: absolute; top: 0px; left: 0px;"><g transform="rotate(0, 41, 41)"><rect x="33"y="1" width="14" height="12" rx="4" ry="4" stroke="#868685" stroke-width="1" fill="#f8f8f8"></rect><polyline points="37.5,9.5 37.5,3.5 42.5,9.5 42.5,3.5" stroke-linejoin="bevel" stroke-width="1.5" fill="#f2f4f6" stroke="#868685"></polyline></g></svg>'},_generatePanHtml:function(){return'<div style="position:absolute;top:4px;left:4px;width:74px;height:74px;background:url('+this.imgPath+'st-navictrl.png) no-repeat;-webkit-user-select:none;overflow:hidden"><div></div></div>'},_generatePanBtnHtml:function(){return'<div style="position:absolute;top:0px;left:0;width:82px;height:82px;user-select:none;"><div style="position:absolute;left:32px;top:13px;cursor:pointer;width:17px;height:17px;" title="向上平移"></div><div style="position:absolute;left:14px;top:32px;cursor:pointer;width:17px;height:17px;" title="向左平移"></div><div style="position:absolute;left:51px;top:32px;cursor:pointer;width:17px;height:17px;" title="向右平移"></div><div style="position:absolute;left:33px;top:51px;cursor:pointer;width:17px;height:17px;" title="向下平移"></div></div>'},_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;"),'<div style="position:absolute;top:84px;left:30px;width:24px;height:52px;'+t+'-webkit-user-select:none;overflow:hidden"><div style="position:absolute;cursor:pointer;width:22px;height:24px;top:0;left:0;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)" title="放大一级"></div><div style="position:absolute;cursor:pointer;width:22px;height:24px;top:25px;left:0;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)" title="缩小一级"></div><div></div></div>'},_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<this._panBtns.length;n++)aa(this._panBtns[n],"mousedown",(function(t){t.stopPropagation()}));e._mousedown=!1,aa(this._panBtnContainer,"mousedown",(function(n){e._mousedown=!0,e._panBtnContainer.style.cursor="grabbing",e._startHeading=e._calcAngle(n),e._curHeading=t.getPov().heading,n.preventDefault()})),aa(document,"mousemove",(function(n){e._mousedown&&t.setPov({heading:e._curHeading+360-(e._calcAngle(n)-e._startHeading),pitch:t.getPov().pitch})})),aa(document,"mouseup",(function(){e._mousedown&&(e._mousedown=!1,e._panBtnContainer.style.cursor="grab",e._startHeading=null)})),t.addEventListener("position_changed",(function(){var t=360-this.getPov().heading;e._svgDirGroup.setAttribute("transform","rotate("+t+", 41, 41)")})),t.addEventListener("pov_changed",(function(){var t=360-this.getPov().heading;e._svgDirGroup.setAttribute("transform","rotate("+t+", 41, 41)")}))}aa(this._btnZoomIn,"click",(function(){t.setZoom(t.getZoom()+1)})),aa(this._btnZoomOut,"click",(function(){t.setZoom(t.getZoom()-1)})),v.isPc?(aa(this._btnZoomIn,"mousedown",(function(){e._redrawZoomBtn(e._zoomInEnabled,-98)})),aa(this._btnZoomOut,"mousedown",(function(){e._redrawZoomBtn(e._zoomOutEnabled,-122)})),aa(this._btnZoomIn,"mouseup",(function(){e._redrawZoomBtn(e._zoomInEnabled,-74)})),aa(this._btnZoomOut,"mouseup",(function(){e._redrawZoomBtn(e._zoomOutEnabled,-74)}))):v.isMobile&&(aa(this._btnZoomIn,"touchstart",(function(){e._redrawZoomBtn(e._zoomInEnabled,-98)})),aa(this._btnZoomOut,"touchstart",(function(){e._redrawZoomBtn(e._zoomOutEnabled,-122)})),aa(this._btnZoomIn,"touchend",(function(){e._redrawZoomBtn(e._zoomInEnabled,-74)})),aa(this._btnZoomOut,"touchend",(function(){e._redrawZoomBtn(e._zoomOutEnabled,-74)}))),t.addEventListener("zoom_changed",(function(n){t.getZoom()>=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 T(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='<span style="position:relative;top:33px;">全景</span>',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=(e=window.event||e).pageX||e.clientX,i=e.pageY||e.clientY,a=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),s=new qo(n-a.left,i-a.top),u=r._map.pixelToPoint(s);if(""!==r._scout.style.display&&v.isPc&&(r._scout.style.display="",r._infoWindow.style.display=""),r._scout.style.left=s.x-12+"px",r._scout.style.top=s.y-41-2+"px",r._prePixel=r._curPixel,r._curPixel=s,r._prePixel){var h=s.x-r._prePixel.x;h>0?r._scout.style.backgroundPosition="-48px 0":h<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 c=1===r._infoStatus||2===r._infoStatus?112:126,l=1===r._infoStatus||2===r._infoStatus?119:105;1!==r._infoStatus&&2!==r._infoStatus||(r._infoWindow.style.left=r._curPixel.x-Math.round(c/2)+"px",1===r._infoStatus?(r._infoWindow.style.top=r._curPixel.y-l-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(l/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-c+"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=u,r._scout.style.backgroundPosition="-24px 0";var e=r._map.lnglatToMercator(u.lng,u.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})})(Pano={});
window.BMapGL=window.BMapGL||{};(function(bD,fB){var e6=e6||{version:"20150702",emptyFn:function(){}};(function(){e6._log=[];var i=0;var T={};e6.BaseClass=function(kq){T[(this.hashCode=(kq||e6.BaseClass.guid()))]=this};e6.BaseClass.guid=function(){return"mz_"+(i++).toString(36)};e6.BaseClass.create=function(){var kq=new e6.BaseClass();kq.decontrol();return kq};var e=e6.instance=e6.I=function(kq){return T[kq]};e6.BaseClass.prototype.dispose=function(){if(this.hashCode){delete T[this.hashCode]}for(var kq in this){if(typeof this[kq]!="function"){delete this[kq]}}};e6.BaseClass.prototype.getHashCode=function(){if(!this.hashCode){T[(this.hashCode=e6.BaseClass.guid())]=this}return this.hashCode};e6.BaseClass.prototype.decontrol=function(){delete T[this.hashCode]};e6.BaseClass.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};e6.BaseClass.prototype._wlog=function(kr,ks){var kq=e6._log;if(kq.length>100){kq.reverse().length=50;kq.reverse()}kq[kq.length]="["+kr+"]["+(this._className||"Object")+" "+this.hashCode+"] "+ks}})();Function.prototype.inherits=function(kq,T){var e,kr,kt=this.prototype,ks=function(){};ks.prototype=kq.prototype;kr=this.prototype=new ks();if(typeof(T)=="string"){kr._className=T}for(e in kt){kr[e]=kt[e]}this.prototype.constructor=kt.constructor;kt=ks=null;return kr};e6.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};e6.BaseClass.prototype.on=e6.BaseClass.prototype.addEventListener=function(T,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(T.indexOf("on")!==0){T="on"+T}if(typeof e[T]!=="object"){e[T]={}}var kq=i.hashCode||e6.BaseClass.guid();i.hashCode=kq;if(e[T][kq]){this._wlog("warning","repeat key:"+kq)}e[T][kq]=i};e6.BaseClass.prototype.off=e6.BaseClass.prototype.removeEventListener=function(T,i){if(typeof i=="function"){i=i.hashCode}else{if(typeof i!=="string"&&typeof i!=="undefined"){return}}if(!this._listeners){this._listeners={}}if(T.indexOf("on")!=0){T="on"+T}var e=this._listeners;if(!e[T]){return}if(i===undefined){e[T]={};return}if(e[T][i]){delete e[T][i]}};e6.BaseClass.prototype.fire=e6.BaseClass.prototype.dispatchEvent=function(kq){if(!this._listeners){this._listeners={}}var T,e=this._listeners,kr=kq.type;kq.target=kq.srcElement=kq.target||kq.srcElement||this;kq.currentTarget=this;if(typeof this[kr]=="function"){this[kr](kq)}if(typeof e[kr]=="object"){for(T in e[kr]){if(typeof e[kr][T]=="function"){e[kr][T].call(this,kq)}}}return kq.returnValue};e6.BaseEvent.prototype.inherit=function(T){var i=this;this.domEvent=T=window.event||T;i.clientX=T.clientX||T.pageX;i.clientY=T.clientY||T.pageY;i.offsetX=T.offsetX||T.layerX;i.offsetY=T.offsetY||T.layerY;i.screenX=T.screenX;i.screenY=T.screenY;i.ctrlKey=T.ctrlKey||T.metaKey;i.shiftKey=T.shiftKey;i.altKey=T.altKey;return i};e6.Browser=(function(){var T=navigator.userAgent;var kr=0;var e=0;var ks=0;var i=0;var kw=0;var ku=0;var kv=0;var kt=0;var kq=0;var kx=0;if(typeof window.opera==="object"&&/Opera(\s|\/)(\d+(\.\d+)?)/.test(T)){ks=parseFloat(RegExp.$2)}else{if(/OPR(\/(\d+)(\..?)?)/.test(T)){ks=parseInt(RegExp.$2,10)}else{if(/Edge\/((\d+)\.\d+)/.test(T)){kr=parseInt(RegExp.$2,10)}else{if(/MSIE (\d+(\.\d+)?)/.test(T)){e=parseFloat(RegExp.$1)}else{if(T.indexOf("Trident")>-1&&/rv:(\d+(\.\d+)?)/.test(T)){e=parseInt(RegExp.$1,10)}else{if(/Firefox(\s|\/)(\d+(\.\d+)?)/.test(T)){kw=parseFloat(RegExp.$2)}else{if(navigator.vendor==="Netscape"&&/Netscape(\s|\/)(\d+(\.\d+)?)/.test(T)){kv=parseFloat(RegExp.$2)}else{if(T.indexOf("Safari")>-1&&/Version\/(\d+(\.\d+)?)/.test(T)){i=parseFloat(RegExp.$1)}}}}}}}}if(T.indexOf("Trident")>-1&&/Trident\/(\d+(\.\d+)?)/.test(T)){kt=parseInt(RegExp.$1,10)}else{if(!e&&!kr&&T.indexOf("Gecko")>-1&&T.indexOf("KHTML")===-1&&/rv\:(\d+(\.\d+)?)/.test(T)){kq=parseFloat(RegExp.$1)}else{if(!kr&&/chrome\/(\d+(\.\d+)?)/i.test(T)){ku=parseFloat(RegExp.$1)}else{if(!kr&&/AppleWebKit\/(\d+(\.\d+)?)/.test(T)){kx=parseInt(RegExp.$1,10)}}}}var ky={edge:kr,ie:e,firefox:kw,netscape:kv,opera:ks,safari:i,chrome:ku,gecko:kq,trident:kt,webkit:kx};return ky})();window.FeBrowser=e6.Browser;e6.Dom={};e6.Dom.createDom=function(i,e){if(e6.isIE&&e&&e.name){i="<"+i+' name="'+e6.String.escapeHTML(e.name)+'">'}var T=document.createElement(i);if(e){e6.Dom.setProperties(T,e)}return T};e6.Dom.getOffset=function(kq){var kt=e6.Dom.getOwnerDocument(kq);var ks=e6.isGecko>0&&kt.getBoxObjectFor&&e6.Dom.getStyle(kq,"position")=="absolute"&&(kq.style.top===""||kq.style.left==="");var ku={left:0,top:0};var i=(e6.isIE&&!e6.isStrict)?kt.body:kt.documentElement;if(kq==i){return ku}var T=null;var kr;if(kq.getBoundingClientRect){kr=kq.getBoundingClientRect();ku.left=kr.left+Math.max(kt.documentElement.scrollLeft,kt.body.scrollLeft);ku.top=kr.top+Math.max(kt.documentElement.scrollTop,kt.body.scrollTop);ku.left-=kt.documentElement.clientLeft;ku.top-=kt.documentElement.clientTop;if(e6.isIE&&!e6.isStrict){ku.left-=2;ku.top-=2}}else{if(kt.getBoxObjectFor&&!ks){kr=kt.getBoxObjectFor(kq);var e=kt.getBoxObjectFor(i);ku.left=kr.screenX-e.screenX;ku.top=kr.screenY-e.screenY}else{T=kq;do{ku.left+=T.offsetLeft;ku.top+=T.offsetTop;if(e6.isWebkit>0&&e6.Dom.getStyle(T,"position")=="fixed"){ku.left+=kt.body.scrollLeft;ku.top+=kt.body.scrollTop;break}T=T.offsetParent}while(T&&T!=kq);if(e6.isOpera>0||(e6.isWebkit>0&&e6.Dom.getStyle(kq,"position")=="absolute")){ku.top-=kt.body.offsetTop}T=kq.offsetParent;while(T&&T!=kt.body){ku.left-=T.scrollLeft;if(!e6.isOpera||T.tagName!="TR"){ku.top-=T.scrollTop}T=T.offsetParent}}}return ku};e6.Dom.getOwnerDocument=function(e){return e.nodeType==9?e:e.ownerDocument||e.document};e6.Dom.setProperties=function(i,e){e6.each(e,function(kq,T){e6.Dom._setProperty(i,T,kq)})};e6.Dom._setProperty=function(i,e,T){if(e=="style"){i.style.cssText=T}else{if(e=="class"){i.className=T}else{if(e=="for"){i.htmlFor=T}else{if(e in e6.Dom._DIRECT_ATTRIBUTE_MAP){i.setAttribute(e6.Dom._DIRECT_ATTRIBUTE_MAP[e],T)}else{i[e]=T}}}}};e6.Dom._DIRECT_ATTRIBUTE_MAP={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",height:"height",width:"width",usemap:"useMap",frameborder:"frameBorder"};e6.G=function(){for(var T=[],kq=arguments.length-1;kq>-1;kq--){var kr=arguments[kq];T[kq]=null;if(typeof kr=="object"&&kr&&kr.dom){T[kq]=kr.dom}else{if((typeof kr=="object"&&kr&&kr.tagName)||kr==window||kr==document){T[kq]=kr}else{if(typeof kr=="string"&&(kr=document.getElementById(kr))){T[kq]=kr}}}}return T.length<2?T[0]:T};e6.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(" ")}};e6.addClassName=e6.ac;e6.each=function(ks,e){if(typeof e!="function"){return ks}if(ks){if(ks.length===undefined){for(var T in ks){e.call(ks[T],ks[T],T)}}else{for(var kq=0,kr=ks.length;kq<kr;kq++){e.call(ks[kq],ks[kq],kq)}}}return ks};e6.extend=function(ks,kq){if(ks&&kq&&typeof(kq)=="object"){for(var kr in kq){ks[kr]=kq[kr]}var T=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];for(var e=0,i;e<T.length;e++){i=T[e];if(Object.prototype.hasOwnProperty.call(kq,i)){ks[i]=kq[i]}}}return ks};e6.hide=function(){e6.each(arguments,function(e){if(e=e6.G(e)){e.style.display="none"}})};e6.inherit=function(ku,kq,T){var kt=ku.prototype;var ks=function(){};ks.prototype=kq.prototype;var kr=ku.prototype=new ks();if(typeof T=="string"){kr._className=T}for(var e in kt){kr[e]=kt[e]}ku.prototype.constructor=kt.constructor;kt=null;return kr};e6.isIE=0;(function(){if(navigator.userAgent.indexOf("MSIE")>0&&!window.opera){/MSIE (\d+(\.\d+)?)/.test(navigator.userAgent);e6.isIE=parseFloat(RegExp.$1)}})();e6.rc=function(e,i){if(!(e=this.G(e))){return}i=this.trim(i);var T=e.className.replace(new RegExp("(^| +)"+i.replace(/(\W)/g,"\\$1")+"( +|$)","g"),"$2");if(e.className!=T){e.className=T}};e6.removeClassName=e6.rc;e6.show=function(){this.each(arguments,function(e){if(e=e6.G(e)){e.style.display=""}})};e6.trim=function(e){return e.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};e6.getElementsByClassName=function(e,i){if(e.getElementsByClassName){return e.getElementsByClassName(i)}else{return(function T(kx,kv){if(kv==null){kv=document}var ku=[],kt=kv.getElementsByTagName("*"),kq=kt.length,kw=new RegExp("(^|\\s)"+kx+"(\\s|$)"),ks,kr;for(ks=0,kr=0;ks<kq;ks++){if(kw.test(kt[ks].className)){ku[kr]=kt[ks];kr++}}return ku})(i,e)}};e6.toggleClass=function(e,i){if(e6.hasClass(e,i)){e6.removeClassName(e,i)}else{e6.addClassName(e,i)}};e6.hasClass=function(kq,T){if(!kq||!kq.className||typeof kq.className!="string"){return false}var i=-1;try{i=kq.className==T||kq.className.search(new RegExp("(\\s|^)"+T+"(\\s|$)"))}catch(kr){return false}return i>-1};e6.insertHTML=function(kq,e,T){kq=e6.G(kq);if(kq===null){return kq}var i,kr;if(kq.insertAdjacentHTML){kq.insertAdjacentHTML(e,T)}else{i=kq.ownerDocument.createRange();e=e.toUpperCase();if(e=="AFTERBEGIN"||e=="BEFOREEND"){i.selectNodeContents(kq);i.collapse(e=="AFTERBEGIN")}else{kr=e=="BEFOREBEGIN";i[kr?"setStartBefore":"setEndAfter"](kq);i.collapse(kr)}i.insertNode(i.createContextualFragment(T))}return kq};if(typeof HTMLElement!="undefined"&&HTMLElement.prototype.__lookupGetter__&&!HTMLElement.prototype.__lookupGetter__("children")&&!window.opera){try{HTMLElement.prototype.__defineGetter__("children",function(){for(var T=[],kq=0,ks,kr=0,e=this.childNodes.length;kr<e;kr++){ks=this.childNodes[kr];if(ks.nodeType==1){T[kq++]=ks;if(ks.name){if(!T[ks.name]){T[ks.name]=[]}T[ks.name][T[ks.name].length]=ks}if(ks.id){T[ks.id]=ks}}}return T})}catch(jE){}}if(typeof(HTMLElement)!="undefined"&&!window.opera&&HTMLElement.prototype&&!HTMLElement.prototype.insertAdjacentHTML){HTMLElement.prototype.insertAdjacentHTML=function(i,T){var kq=this.ownerDocument.createRange();kq.setStartBefore(this);kq=kq.createContextualFragment(T);switch(i){case"beforeBegin":this.parentNode.insertBefore(kq,this);break;case"afterBegin":this.insertBefore(kq,this.firstChild);break;case"beforeEnd":this.appendChild(kq);break;case"afterEnd":if(!this.nextSibling){this.parentNode.appendChild(kq)}else{this.parentNode.insertBefore(kq,this.nextSibling)}break}}}if(typeof HTMLElement!="undefined"&&!window.opera){HTMLElement.prototype.contains=function(e){if(!e){return false}if(e==this){return true}while(e=e.parentNode){if(e==this){return true}}return false}}if(!e6.Browser.ie&&typeof Event!="undefined"&&!window.opera){Event.prototype.__defineSetter__("returnValue",function(e){if(!e){this.preventDefault()}return e});Event.prototype.__defineSetter__("cancelBubble",function(e){if(e){this.stopPropagation()}return e})}e6.each=function(kr,kq){if(bX(kq)){for(var T=0,e=kr.length;T<e;T++){if(kq.call(kr,kr[T],T)===false){break}}}return kr};e6.Platform={x11:0,macintosh:0,windows:0,android:0,iphone:0,ipad:0};for(var jC in e6.Platform){if(e6.Platform.hasOwnProperty(jC)){e6.Platform[jC]=new RegExp(jC,"i").test(window.navigator.userAgent)?1:0}}if(typeof(e6.Dom)==="undefined"){e6.Dom={}}e6.Dom.getComputedStyle=function(i,e){var kq=i.nodeType==9?i:i.ownerDocument||i.document,T;if(kq.defaultView&&kq.defaultView.getComputedStyle){T=kq.defaultView.getComputedStyle(i,null);if(T){return T[e]||T.getPropertyValue(e)}}else{if(i.currentStyle){return i.currentStyle[e]||""}}return""};var fS=e6.BaseEvent;var de=e6.BaseClass;de.prototype.toString=function(){return this._className||""};e6.on=function(T,i,e){if(!(T=e6.G(T))){return T}i=i.replace(/^on/,"");if(T.addEventListener){T.addEventListener(i,e,false)}else{if(T.attachEvent){T.attachEvent("on"+i,e)}}return T};e6.un=function(T,i,e){if(!(T=e6.G(T))){return T}i=i.replace(/^on/,"");if(T.removeEventListener){T.removeEventListener(i,e,false)}else{if(T.detachEvent){T.detachEvent("on"+i,e)}}return T};e6.hc=function(kq,T){if(!kq||!kq.className||typeof kq.className!="string"){return false}var i=-1;try{i=kq.className==T||kq.className.search(new RegExp("(\\s|^)"+T+"(\\s|$)"))}catch(kr){return false}return i>-1};e6.isEmptyObject=function(T){if(Object.prototype.toString.call(T)==="[object Object]"){for(var e in T){return false}return true}else{return false}};var bW=window.location.protocol==="http:"?"http:":"https:";var eD={fontFamily:'Arial,Helvetica,"PingFang SC","Hiragino Sans GB",STHeiti,sans-serif',mapStyleNameIdPair:{"default":0,"grayed-out":1},mapHost:bW+"//map.baidu.com",apiHost:bW+"//api.map.baidu.com",apiIMG:bW+"//api.map.baidu.com/images",staticHost:bW+"//webmap0.bdimg.com",imgPath:bW+"//webmap0.bdimg.com/image/api/",tileDomain:[bW+"//maponline0.bdimg.com",bW+"//maponline1.bdimg.com",bW+"//maponline2.bdimg.com",bW+"//maponline3.bdimg.com"],panoTilePath:"//apisv1.bdimg.com/",optDomain:"http://10.120.25.45:8017",rasterTilePath:"/tile/",vectorTilePath:"/pvd/",originTilePath:[bW+"//pcor.baidu.com"],stylePath:"//maponline0.bdimg.com/sty/",bosPath:bW+"//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 bW+this.stylePath+i},getMapStyleFiles:function(T){var kr=true;if(typeof T==="string"&&T!=="default"){kr=false}var ks=kr?"":"_"+(this.mapStyleNameIdPair[T]-1);var i=bE();var kq="udt="+i.udt+"&v="+i.ver;var e=bW+this.stylePath;return[e+"icons_2x"+ks+".js?"+kq,e+"fs"+ks+".js?"+kq,e+"indoor_fs.js?"+kq]},tvc:{ditu:{normal:{version:"088",updateDate:"20230707"},satellite:{version:"009",updateDate:"20230707"},normalTraffic:{version:"081",updateDate:"20230707"},satelliteTraffic:{version:"083",updateDate:"20230707"},mapJS:{version:"104",updateDate:"20230707"},satelliteStreet:{version:"083",updateDate:"20230707"},earthVector:{version:"001",updateDate:"20230707"}},webapp:{high_normal:{version:"001",updateDate:"20230707"},lower_normal:{version:"002",updateDate:"20230707"}},api_for_mobile:{vector:{version:"002",updateDate:"20230707"},vectorIcon:{version:"002",updateDate:"20230707"}}},msv:{mapstyle:{version:"001",updateDate:"20230705"}}};eD.imgResources={blankGIF:eD.staticHost+"/res/litemapapi/v1d1/images/blank.gif?20170501",markerPng:eD.staticHost+"/res/litemapapi/v1d1/images/marker.png?20170501",locPng:eD.staticHost+"/res/litemapapi/v1d1/images/loc.png?20180918",locNewPng:eD.staticHost+"/res/litemapapi/v1d1/images/loc_new.png?20190314",zoomPng:eD.staticHost+"/res/litemapapi/v1d1/images/zoombtn.png?20180918",mapLogoPng:eD.staticHost+"/res/litemapapi/v1d1/images/logo-2x.png?20190226"};var C=eD;var jt="ruler.cur";if(e6.Browser.ie||e6.Browser.edge){e6.extend(C,{distCursor:"url("+C.imgPath+jt+"),crosshair",defaultCursor:"url("+C.imgPath+"openhand.cur),default",draggingCursor:"url("+C.imgPath+"closedhand.cur),move"})}else{if(e6.Browser.firefox){e6.extend(C,{distCursor:"url("+C.imgPath+jt+"),crosshair",defaultCursor:"-moz-grab",draggingCursor:"-moz-grabbing"})}else{if(e6.Browser.chrome||e6.Browser.safari){e6.extend(C,{distCursor:"url("+C.imgPath+jt+") 2 6,crosshair",defaultCursor:"url("+C.imgPath+"openhand.cur) 8 8,default",draggingCursor:"url("+C.imgPath+"closedhand.cur) 8 8,move"});if(e6.Platform.macintosh){C.defaultCursor="-webkit-grab";C.draggingCursor="-webkit-grabbing"}}else{e6.extend(C,{distCursor:"url("+C.imgPath+jt+"),crosshair",defaultCursor:"url("+C.imgPath+"openhand.cur),default",draggingCursor:"url("+C.imgPath+"closedhand.cur),move"})}}}bD=bD||{};bD.version="gl";bD._register=[];bD.register=function(e){this._register[this._register.length]=e};bD.guid=1;bD.getGUID=function(e){return(e||"")+bD.guid++};var eW=window.BMAP_AUTHENTIC_KEY||"";function S(e,i,kq){var T=new Date();T.setTime(T.getTime()+kq*24*60*60*1000);document.cookie=e+"="+escape(i)+";expires="+T.toGMTString()}function a7(e,i){if(navigator.cookieEnabled){return S(e,i,30)}if(localStorage){return localStorage.setItem(e,i)}if(sessionStorage){return sessionStorage.setItem(e,i)}}bD.getSeckeyCid=function(){var i=+new Date();var e=bW+"//dlswbr.baidu.com/heicha/mw/abclite-2063-s.js?_t="+i;gX.load(e,i0)};function i0(){if(window.___abvk){a7("SECKEY_ABVK",window.___abvk)}}window.__abbaidu_2063_cb=function(i){var e=JSON.parse(i);a7("BMAP_SECKEY",e.data)};bD.bmapVerifyCbk=function(kr){if(kr&&kr.error!==0){bD=null;BMapGL=null;var ks="百度未授权使用地图API可能是因为您提供的密钥不是有效的百度地图开放平台密钥或此密钥未对本应用的百度地图JavaScriptAPI授权。您可以访问如下网址了解如何获取有效的密钥https://lbs.baidu.com/apiconsole/key#。";switch(kr.error){case 101:ks="您所使用的密钥ak有问题不支持jsapi服务可以访问该网址了解如何获取有效密钥http://lbsyun.baidu.com/apiconsole/key#。";break;case 102:ks="MCODE参数不存在mobile类型MCODE参数必需详情查看http://lbsyun.baidu.com/apiconsole/key#。";break;case 200:ks="APP不存在AK有误请检查再重试详情查看http://lbsyun.baidu.com/apiconsole/key#。";break;case 201:ks="APP被您禁用啦可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 202:ks="APP被管理员删除啦可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 203:ks="APP类型错误可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 210:ks="APP IP校验失败可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 220:ks="APP Referer校验失败。请检查该ak设置的白名单与访问所有的域名是否一致。详情查看http://lbsyun.baidu.com/apiconsole/key#";break;case 230:ks="APP Mcode码校验失败可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 240:ks="APP服务被禁用了可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情,或联系我们了解详情。";break;case 250:ks="该用户不存在... 请登录 https://lbs.baidu.com 的控制台注册成为开发者申请ak吧。";break;case 251:ks="该用户被自己删除啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看自己的应用具体详情。";break;case 252:ks="该用户被管理员删除啦,可以访问 http://lbsyun.baidu.com/apiconsole/key# 了解如何获取有效密钥,或请联系我们了解详情。";break;case 260:ks="您所使用的密钥AK不包含该服务呢可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看服务选择情况,或请联系我们了解详情。";break;case 261:ks="您所使用的密钥AK的该服务被禁用啦可以访问 http://lbsyun.baidu.com/apiconsole/key# 查看服务选择情况,或请联系我们了解详情。";break;case 401:ks="您所使用的AK并发超限了请登录 http://lbsyun.baidu.com/cashier/quota#/home 了解详情。";break;case 302:ks="您所使用的AK天配额超限了请登录 http://lbsyun.baidu.com/cashier/quota#/home 了解详情。";break}alert(ks);var T=document.getElementsByClassName("bmap-container");if(T){for(var kq=0;kq<T.length;kq++){var e=T[kq];if(e&&e.firstChild&&e.firstChild.id==="platform"){e.innerText=""}}}}};bD.frequencyCbk=function(e){if(e){window.QTFrequency=e}};bD.verify=function(){var e=C.apiHost+"/?qt=verify&v=gl&type=webgl&ak="+eW+"&callback="+fB+".bmapVerifyCbk";gX.load(e)};bD.frequency=function(){};bD.apiLoad=bD.apiLoad||function(){};function ik(i,e){this._size=i;this._cache=[];this._totalGetTimes=0;this._totalHitTimes=0;this._options={clearCallback:null,removeOldCallback:null};e=e||{};for(var T in e){if(e.hasOwnProperty(T)){this._options[T]=e[T]}}}ik.prototype.setData=function(T,kq){var e=this._cache;var i=this._size;if(i===0){return}if(e.length>i){this._removeOld()}if(!e[T]){e.push(kq)}e[T]=kq;kq._key_=T};ik.prototype.getHitRate=function(){return Math.round(this._totalHitTimes/this._totalGetTimes*1000)/1000};ik.prototype.getData=function(i){var e=this._cache[i];if(e){this._totalHitTimes++}this._totalGetTimes++;return e};ik.prototype.removeData=function(kr){if(this._options.clearCallback){this._options.clearCallback(this._cache[kr])}var T=this._cache;var ks=T[kr];for(var kq=0,e=T.length;kq<e;kq++){if(T[kq]===ks){T.splice(kq,1);break}}delete T[kr]};ik.prototype._removeOld=function(){var e=this._cache;var kr=Math.round(this._size*0.6);for(var kq=0;kq<kr;kq++){var T=e[kq]._key_;if(this._options.clearCallback){this._options.clearCallback(e[T])}delete e[T]}e.splice(0,kr);if(this._options.removeOldCallback){this._options.removeOldCallback()}};ik.prototype.clear=function(){var T=this._cache;for(var kr=0,e=T.length;kr<e;kr++){var kq=T[kr]._key_;if(this._options.clearCallback){this._options.clearCallback(T[kq])}delete T[kq]}this._cache=T=[]};ik.prototype.forEach=function(kq){var T=this._cache;for(var ks=0,e=T.length;ks<e;ks++){var kr=T[ks]._key_;kq(T[kr])}};ik.prototype.getBatch=function(kr){var e=[];for(var kq=0,T=kr.length;kq<T;kq++){if(this.getData(kr[kq])){e[e.length]=this.getData(kr[kq])}}return e};ik.prototype.clearExcept=function(ks){var T=this._cache;for(var e=T.length,kr=e-1;kr>=0;kr--){var kq=this._cache[kr]._key_;if(!ks[kq]){T.splice(kr,1);if(this._options.clearCallback){this._options.clearCallback(T[kq])}delete T[kq]}}};ik.prototype.getDataCount=function(){return this._cache.length};function i5(){}e6.extend(i5.prototype,{centerAndZoomIn:function(kv,T,kw){var kt=this;if(!kv&&!T){return}kv=kv||this.centerPoint;T=T||this.zoomLevel;T=this._getProperZoom(T).zoom;if(this.mapType===BMAP_EARTH_MAP){if(!this._earth){this.mapType=BMAPGL_NORMAL_MAP;this.temp.originMapType=BMAP_EARTH_MAP;function ku(){kt._earth=new bD.Earth(kt,{showRealSunlight:kt.config.showRealSunlight,showMilkyway:kt.config.showMilkyway,earthBackground:kt.config.earthBackground});kt._proxyEarthEvents();kt._changeEarthMapType(BMAP_EARTH_MAP);e6.extend(kt,bD.EarthView.prototype);if(!kt._navigationCtrl&&kt.config.showControls){kt._navigationCtrl=new bD.NavigationControl3D(kt)}delete kt.temp.originMapType}he.load("earth",function(){if(bD["FeatureStyle"+kt.config.style]){ku()}else{kt.loadMapStyleFiles(function(){ku()})}})}}this.lastLevel=this.zoomLevel||T;this.zoomLevel=T;var kr=new fS("onload");kr.point=kv;kr.zoom=T;this.centerPoint=this.restrictCenter(new cD(kv.lng,kv.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===BMAP_EARTH_MAP)){var i=this.config.defaultMaxBounds;var ks=new m(i,"baidu",this.mapType);var kq=new hH({mapType:this.mapType,copyright:ks,customLayer:false,baseLayer:true,tileTypeName:"web"});kq._isInnerLayer=true;this.addTileLayer(kq);if(this.mapType===BMAP_SATELLITE_MAP&&this._isHybridShow===true){this._addHybirdMap()}}this.dispatchEvent(kr);this.loaded=true;kw=kw||{};kw.callback&&kw.callback()},_setPlatformPosition:function(kw,kv,kz){kz=kz||{};if(kw===0&&kv===0&&!kz.point){return}if(isNaN(kz.initMapOffsetX)){kz.initMapOffsetX=this.offsetX}if(isNaN(kz.initMapOffsetY)){kz.initMapOffsetY=this.offsetY}var kx=kw+kz.initMapOffsetX;var ku=kv+kz.initMapOffsetY;if(kz.point){var i=this.restrictCenter(kz.point);if(!i.equals(this.centerPoint)){this.centerPoint=i.clone();this.fire(new fS("oncenter_changed"))}}else{var kq=this.offsetX-kx;var e=this.offsetY-ku;var T=this.getZoomUnits();var kt=this.centerPoint.lng;var ks=this.centerPoint.lat;var kr=new cD(kt,ks);this.centerPoint=this.restrictCenter(new cD(kr.lng+kq*T,kr.lat-e*T),T);this.fire(new fS("oncenter_changed"));if(this.zoomLevel<10){kx=this.offsetX-(this.centerPoint.lng-kr.lng)/T;ku=this.offsetY+(this.centerPoint.lat-kr.lat)/T}}this.offsetX=kx;this.offsetY=ku;var ky=this.platform.style;ky.left=kx+"px";ky.top=ku+"px";this.maskLayer.style.left=-kx+"px";this.maskLayer.style.top=-ku+"px";if(kz.dispatchEvent!==false){this.dispatchEvent(new fS("onmoving"))}},zoomTo:function(e,kt,kx){kx=kx||{};kx.zoomCenter=kt;if(kx.noAnimation!==true){this.deepZoomTo(e,kx);return}if(typeof e!=="number"){return}var kr=es[this.mapType];if(!kr){return}var T=e;e=this._getProperZoom(e).zoom;if(e===this.zoomLevel){var ku=new fS("onzoomexceeded");ku.targetZoom=T;this.dispatchEvent(ku);kx.callback&&kx.callback();return}this.lastLevel=this.zoomLevel;if(kt){this.temp._cPoint=kt;this.temp._cPixel=this.pointToPixelIn(kt)}else{if(this.getInfoWindow()){var kw=this.getInfoWindow().getPoint();this.temp._cPixel=this.pointToPixelIn(kw);this.temp._cPoint=kw}}if(this.config.zoomCenter){kt=this.config.zoomCenter;this.temp._cPoint=kt;this.temp._cPixel=this.pointToPixelIn(kt)}if(kt||this.temp.infoWin&&this.temp.infoWin.isOpen()){var i=this.temp._cPoint;var kv=this.temp._cPixel;var kq=this.getZoomUnits(e);var ks=new cD(i.lng+kq*(this.width/2-kv.x),i.lat-kq*(this.height/2-kv.y));this.centerPoint=this.restrictCenter(ks,kq,e);if(this.centerPoint.zoom){e=this.centerPoint.zoom}}if(kx.fireEvent!==false){this.dispatchEvent(new fS("onzoomstart"))}if(e!==this.zoomLevel){this.zoomLevel=e;this.dispatchEvent(new fS("onzooming"));this.dispatchEvent(new fS("onzoomstartcode"))}if(kx.fireEvent!==false){this.dispatchEvent(new fS("onzoomend"))}if(kx.callback){kx.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(ku,kq){kq=kq||{};var ks=ku-this.zoomLevel;var kr=this._getProperZoom(ku);if(kr.exceeded){var e=new fS("onzoomexceeded");e.targetZoom=ku;this.dispatchEvent(e);return}var i;if(kq.zoomCenter){i=this.pointToPixelIn(kq.zoomCenter)}else{if(this.getInfoWindow()){i=this.pointToPixelIn(this.getInfoWindow().getPoint(),{zoom:this.lastLevel})}else{var i=new fr(this.width/2,this.height/2)}}this.lastLevel=this.zoomLevel;var kt=this.deepZoom||new aF(this);var T=ks>0?1:-1;kt.zoomMap(i,ks,T,null,kq)},flyToIn:function(kv,e){if(e===this.zoomLevel){this.panToIn(kv);return}var ks=this._getProperZoom(e);if(ks.exceeded){var kw=new fS("onzoomexceeded");kw.targetZoom=e;this.dispatchEvent(kw);return}var ku=e-this.zoomLevel;var T=new fr(this.width/2,this.height/2);var i=this.pointToPixelIn(kv);var kt=new je(i.x-T.x,i.y-T.y);this.lastLevel=this.zoomLevel;if(Math.abs(ku)>=4||Math.abs(kt.width)>this.width||Math.abs(kt.height)>this.height){this.centerAndZoomIn(kv,e);return}var kr=this.deepZoom||new aF(this);var kq=ku>0?1:-1;kr.zoomMap(i,ku,kq,kt)},panToIn:function(i,T){T=T||{};if(!i||i.equals(this.centerPoint)){T.callback&&T.callback();return}var kq=this.pointToPixelIn(i);var e=Math.round(this.width/2);var kr=Math.round(this.height/2);if(Math.abs(e-kq.x)>this.width||Math.abs(kr-kq.y)>this.height||T.noAnimation===true){this._panToIn(e-kq.x,kr-kq.y,i);T.callback&&T.callback()}else{this._panBy(e-kq.x,kr-kq.y,T)}},_panToIn:function(i,e,kq){var T=this.temp;if(T.operating===true){return}if(T.dragAni){T.dragAni.stop();T.dragAni=null;this.dispatchEvent(new fS("onmoveend"))}this.dispatchEvent(new fS("onmovestart"));this._setPlatformPosition(i,e,{point:kq});this.dispatchEvent(new fS("onmoveend"))},panBy:function(i,e,T){T=T||{};i=Math.round(i)||0;e=Math.round(e)||0;if(Math.abs(i)<=this.width&&Math.abs(e)<=this.height&&T.noAnimation!==true){this._panBy(i,e,T)}else{this._panToIn(i,e);T.callback&&T.callback()}},_panBy:function(i,e,kr){if(this.temp.operating===true){return}kr=kr||{};this.dispatchEvent(new fS("onmovestart"));var kq=this;var T=kq.temp;T.pl=kq.offsetX;T.pt=kq.offsetY;if(T.tlPan){T.tlPan.cancel()}if(T.dragAni){T.dragAni.stop();T.dragAni=null;this.dispatchEvent(new fS("onmoveend"))}T.tlPan=new fH({fps:kr.fps||kq.config.fps,duration:kr.duration||kq.config.actionDuration,transition:kr.transition||gL.easeInOutQuad,render:function(ks){this.terminative=kq.temp.operating;if(kq.temp.operating){return}kq._setPlatformPosition(Math.ceil(i*ks),Math.ceil(e*ks),{initMapOffsetX:T.pl,initMapOffsetY:T.pt})},finish:function(ks){kq.dispatchEvent(new fS("onmoveend"));kq.temp.tlPan=false;if(kq.temp.stopArrow===true){kq.temp.stopArrow=false;if(kq.temp.arrow!==0){kq._arrow()}}kr.callback&&kr.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(ky,i,e){this.isRestrict=false;i=i||this.getZoomUnits();e=e||this.zoomLevel;var kw=this.pixelToPointIn(new fr(this.width,0),{center:ky,zoom:e});var ku=this.pixelToPointIn(new fr(0,this.height),{center:ky,zoom:e});var kz=ky.lng;var kE=ky.lat;if(this.config.restrictBounds!==null&&!this.config.restrictBounds.isEmpty()){var kD=this.config.restrictBounds;var kq=kD.getSouthWest();var kB=kD.getNorthEast();var kx=jn.convertLL2MC(kq);var ks=jn.convertLL2MC(kB);ky.lng=this.calcNewLngByBounds(kz,ku,kw,kx.lng,ks.lng,i);ky.lat=this.calcNewLatByBounds(kE,ku,kw,kx.lat,ks.lat,i);return ky}var kv=this.pixelToPointIn(new fr(0,0),{center:ky,zoom:e});var kr=this.pixelToPointIn(new fr(0,this.height),{center:ky,zoom:e});if(this.zoomLevel<5){if(kv.lat>hX.MAX_LAT&&kr.lat<hX.MIN_LAT){this.isRestrict=true;var T=hX.MAX_LAT-ky.lat;var kt=ky.lat-hX.MIN_LAT;var kC;if(T<kt){kC=T/(this.height/2)}else{kC=kt/(this.height/2)}var kA=18-p(kC);this.zoomLevel=Math.ceil(kA);ky.zoom=Math.ceil(kA);return ky}}if(kv.lat>hX.MAX_LAT){this.isRestrict=true;ky.lat=hX.MAX_LAT-this.height/2*i}else{if(kr.lat<hX.MIN_LAT){this.isRestrict=true;ky.lat=hX.MIN_LAT+this.height/2*i}}return ky}});function hX(e,T){if(typeof e==="string"){e=document.getElementById(e)}de.call(this);this.container=e;this.width=e.clientWidth;this.height=e.clientHeight;this.offsetX=0;this.offsetY=0;this._setStyle(e);e.unselectable="on";e.innerHTML="";e6.ac(e,"bmap-container");e.appendChild(this.render());this._initDate=new Date();this.platform=e.children[0];this.maskLayer=this.platform.children[0];this._panes={};this.centerPoint=new cD(0,0);this.zoomLevel=0;this._heading=0;this._tilt=0;this._bounds=new ib();this.lastLevel=0;this._lock=false;this._enableTiltZoom=7;this._enableHeadingZoom=7;this.defaultZoomLevel=null;this.defaultCenter=null;this.zoomEventStatus="idle";this.currentOperation=em.idle;this._setConfig(T);this._initMapRenderType();this._animationInfo={};this._animationInfoUnstopable={};this.suspendLoad=false;this.earthBoundary=true;this._customTileLabels=[];this.areaCustomLoaded=true;if(this._renderType==="webgl"){this._workerMgr=new jK(this);this._featureMgr=new cj();e6.extend(this,D.prototype);this.jobScheduler=new bp(this);this.benchmark=new c4();this._setupWebGLMap();this.deviceInfo={hardwareInfo:{renderer:"",vendor:""}};if(dc.ifSupportWebGL._renderer){this.deviceInfo.hardwareInfo.renderer=dc.ifSupportWebGL._renderer;this.deviceInfo.hardwareInfo.vendor=dc.ifSupportWebGL._vendor}}else{e6.extend(this,i5.prototype)}if(!es[this.config.mapType]){this.config.mapType=BMAPGL_NORMAL_MAP}if(this.config.mapType===BMAP_EARTH_MAP&&!this.config.enableEarth){if(this.forceEnableEarth()===false){this.config.mapType=BMAPGL_NORMAL_MAP}}this.mapType=this.config.mapType;this.preMapType=null;if(this.config.enableEarth){var ks=this.maskLayer.style;ks.opacity=0;ks.background="#000";if(this.config.mapType===BMAP_EARTH_MAP){ks.opacity=1}setTimeout(function(){ks.WebkitTransition=ks.transition="opacity .4s"},100)}this._isHybridShow=this.config.showStreetLayer;this.temp={operating:false,arrow:0,lastDomMoveTime:0,lastLoadTileTime:0,lastMovingTime:0,canKeyboard:false,I:function(i){return e6.I(i)},curSpots:[],curSpotsArray:[],curAreaSpot:null,spotsGuid:1,registerIndex:-1,hoverOnSpot:null,isStdCtrlBusy:false};window.InstanceCore=this.temp.I;this.platform.style.cursor=this.config.defaultCursor;this._bind();if(!bD.BMAP_INSTANCES){bD.BMAP_INSTANCES=1}else{bD.BMAP_INSTANCES+=1}for(var kq=0;kq<bD._register.length;kq++){bD._register[kq](this)}this.temp.registerIndex=kq;var kr=this;if(this._renderType==="webgl"){he.load("oppcgl",function(){kr._asyncRegister()})}else{he.load("oppc",function(){kr._asyncRegister()})}if(this.config.mapType==="B_EARTH_MAP"){if(!bD.Earth){he.load("earth",function(){})}else{kr._syncAndChangeMapType("B_EARTH_MAP")}}}hX.MAX_TILT=87;hX.MAX_DRAG_TILT=73;hX.MAX_DRAG_TILT_L2=50;hX.MIN_TILT=0;hX.MAX_LAT=19431424;hX.MIN_LAT=-16023552;hX.WORLD_SIZE_MC_HALF=20037726.372307256;hX.WORLD_SIZE_MC=hX.WORLD_SIZE_MC_HALF*2;hX.RIGHT_EDGE_POINT=new cD(hX.WORLD_SIZE_MC_HALF,0);hX.LEFT_EDGE_POINT=new cD(-hX.WORLD_SIZE_MC_HALF,0);hX.HIGH_RES_MIN_RATIO=1.2;hX.inherits(de,"Map");var fz={NORMAL:"B_NORMAL_MAP",EARTH:"B_EARTH_MAP",SATELLITE:"B_STREET_MAP"};bD.MapTypeId=fz;e6.extend(hX.prototype,{render:function(){var e=b3("div",{id:"platform"});var kq=e.style;kq.overflow="visible";kq.position="absolute";kq.zIndex=5;kq.top=kq.left="0px";var i=b3("div",{id:"mask","class":"BMap_mask"});var T=i.style;T.position="absolute";T.top=T.left="0px";T.zIndex="9";T.overflow="hidden";T.WebkitUserSelect="none";T.width=this.width+"px";T.height=this.height+"px";e.appendChild(i);return e},_initMapRenderType:function(){var e=this.config.forceRenderType;if(e==="dom"){this._renderType="dom";return}else{if(e==="canvas"){if(dc.isModernBrowser&&!dc.ifCanvas2dInBlackList()){this._renderType="canvas";return}else{this._renderType="dom";return}}else{if(e==="webgl"){if(dc.ifSupportWebGL()){this._renderType="webgl";return}}}}if(dc.ifSupportWebGL()&&dc.ifEnableWebGLMap()){this._renderType="webgl";return}if(dc.isModernBrowser&&dc.ifEnableCanvas2dMap()){this._renderType="canvas";return}this._renderType="dom"},_setConfig:function(i){i=i||{};this.config={bottomOffset:0,clickInterval:200,enableDragging:true,enableRotate:true,enableTilt:true,enableKeyboard:false,enableDblclickZoom:true,enableContinuousZoom:true,enableWheelZoom:false,enableRotateGestures:true,enableTiltGestures:true,enablePinchZoom:true,fixCenterWhenPinch:false,enableAutoResize:true,zoomCenter:null,fps:e6.Browser.ie?30:60,zoomerDuration:240,actionDuration:450,defaultCursor:C.defaultCursor,draggingCursor:C.draggingCursor,overlayMoveCursor:"pointer",coordType:BMAP_COORD_MERCATOR,mapType:BMAPGL_NORMAL_MAP,drawer:BMAP_SYS_DRAWER,enableInertialDragging:true,drawMargin:500,drawMarginGL:500,enableFulltimeSpotClick:false,enableResizeOnCenter:false,isModernBrowser:dc.isModernBrowser,forceRenderType:"",textRenderType:null,ratio:go()>=hX.HIGH_RES_MIN_RATIO?2:1,enableEarth:dc.ifEnableEarth(),defaultMaxBounds:new ib(new cD(-21364736,-10616832),new cD(23855104,15859712)),showControls:false,indoorControl:false,showRealSunlight:true,showMilkyway:true,earthBackground:null,showStreetLayer:true,showVectorStreetLayer:false,showVectorLine:false,minZoom:null,maxZoom:null,earthMinZoom:null,earthMaxZoom:null,earthSun:true,earthClouds:true,earthMarkerShowAllTime:true,style:"default",showCustomIndoor:true,backgroundColor:null,enableIconClick:false,autoSafeArea:false,ak:null,webgl2:false,restrictCenter:true,restrictBounds:null,smaa:true,preserveDrawingBuffer:false,privateOn:false,privateRegions:null,popRightClick:false,videoMuted:true,overlayTop:false};for(var T in i){if(i.hasOwnProperty(T)){this.config[T]=i[T];if(T==="fixCenterWhenResize"){this.config.enableResizeOnCenter=i[T]}}}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={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};if(i.displayOptions){for(var e in i.displayOptions){if(i.displayOptions.hasOwnProperty(e)){this._displayOptions[e]=i.displayOptions[e]}}}if(this.config.restrictCenter===false){this._enableTiltZoom=0;this._enableHeadingZoom=0}},getMinZoom:function(){var T;if(es[this.mapType][this._renderType]){T=es[this.mapType][this._renderType].minZoom}else{T=es[this.mapType].minZoom}if(this.config.minZoom!==null&&this.config.minZoom>=T){T=this.config.minZoom}if(this.mapType==="B_EARTH_MAP"){return T}var i=this.getSize();var e=this.worldSize(T);while(e<i.width){T++;e=this.worldSize(T)}return T},getMaxZoom:function(){var e;if(es[this.mapType][this._renderType]){e=es[this.mapType][this._renderType].maxZoom}else{e=es[this.mapType].maxZoom}if(this.config.maxZoom!==null&&this.config.maxZoom<=e){e=this.config.maxZoom}else{if(this._renderType==="webgl"){e=21}}return e},_drawFrame:function(){this._webglMapScene._painter.draw()},_setupWebGLMap:function(){var e=this;he.load("mapgl",function(){e._asyncRegister()})},_setStyle:function(i){var e=i.style;e.overflow="hidden";if(cn(i).position!=="absolute"){e.position="relative"}e.backgroundImage="url("+C.imgPath+"bg.png)";e.textAlign="left";e.touchAction=e.MSTouchAction="none"},_bind:function(){var e=this;if(e._renderType!=="webgl"){e._watchSize=function(){var T=e.getContainerSize();if(e.width!==T.width||e.height!==T.height){var kt=(T.width-e.width)/2;var kv=(T.height-e.height)/2;var kq=e.getZoomUnits();var ks=e.centerPoint;if(ks&&!e.config.enableResizeOnCenter){e.centerPoint=new cD(ks.lng+kt*kq,ks.lat-kv*kq)}e.maskLayer.style.width=(e.width=T.width)+"px";e.maskLayer.style.height=(e.height=T.height)+"px";var kr=new fS("onresize");kr.size=T;e.dispatchEvent(kr);e.fire(new fS("onsize_changed"));var i=parseInt(e.platform.style.left,10)||0;var ku=parseInt(e.platform.style.top,10)||0;if(e.currentOperation!=="undefined"&&e.currentOperation!==em.idle&&(e.offsetX!==i||e.offsetY!==ku)){e._setPlatformPosition(i,ku)}}}}else{e._watchSize=function(){var i=e.getContainerSize();if(e.width!==i.width||e.height!==i.height){var kq=e.getSize();e.maskLayer.style.width=(e.width=i.width)+"px";e.maskLayer.style.height=(e.height=i.height)+"px";if(go()!==e.config.ratio){e.config.ratio=go()}var kr=new fS("onresize");kr.size=i;e.dispatchEvent(kr);var T=new fS("onsize_changed");T.size=i;T.oldSize=kq;e.fire(T)}}}if(e.config.enableAutoResize){e.temp.autoResizeTimer=setInterval(e._watchSize,16)}this.on("size_changed",function(){var i=e.getMinZoom();if(e.zoomLevel<i){e.setZoomIn(i,{noAnimation:true})}});this.on("zoom_changed",function(){this.dispatchEvent(new fS("onzooming"))})},addControl:function(e){if(e&&bX(e._i)){e._i(this);this.dispatchEvent(new fS("onaddcontrol",e))}},removeControl:function(e){if(e&&bX(e.remove)){e.remove();this.dispatchEvent(new fS("onremovecontrol",e))}},hideEarthBoundary:function(){this.earthBoundary=false},showEarthBoundary:function(){this.earthBoundary=true},addContextMenu:function(i,e){if(i){i.initialize(this,e);this.dispatchEvent(new fS("onaddcontextmenu",i))}},removeContextMenu:function(e){if(e){this.dispatchEvent(new fS("onremovecontextmenu",e));e.remove()}},addDistrictLayer:function(e){if(e){e.initialize(this)}},removeDistrictLayer:function(e){if(e){e.removeDistrict(this,e)}},addCustomHtmlLayer:function(e){if(e){e.initialize(this)}},removeCustomHtmlLayer:function(e){if(e){e.removeLayer(e)}},addParkingSpot:function(e){if(e){e.initialize(this)}},removeParkingSpot:function(e){if(e){e.removeParkingSpot()}},addOverlay:function(i){if(i&&bX(i._i)){var T=new fS("onbeforeaddoverlay",i);T.overlay=i;this.dispatchEvent(T);i._i(this);T=new fS("onaddoverlay",i);T.overlay=i;this.dispatchEvent(T)}},removeOverlay:function(i){if(i&&bX(i.remove)){if(i instanceof cp){if(this.stencil){this.stencil=null}}var T=new fS("onremoveoverlay",i);T.overlay=i;i.remove();this.dispatchEvent(T)}},clearOverlays:function(){this.dispatchEvent(new fS("onclearoverlays"))},addTileLayer:function(kr){if(!kr){return}if(kr instanceof dy||kr instanceof eh){if(kr.layer){kr=kr.layer}else{return}}for(var kq=0,e=this.tileMgr.tileLayers.length;kq<e;kq++){var T=this.tileMgr.tileLayers[kq];if(T===kr||T.getMapType()===kr.getMapType()){return}}kr.initialize(this);this.dispatchEvent(new fS("onaddtilelayer",kr))},removeTileLayer:function(e){if(e){if(e instanceof dy||e instanceof eh){if(e.layer){e=e.layer}else{return}}e.remove();this.dispatchEvent(new fS("onremovetilelayer",e))}},addNormalLayer:function(e){if(!e||!(e instanceof cs)){return}this.dispatchEvent(new fS("onaddnormallayer",e))},removeNormalLayer:function(e){if(e&&e instanceof cs){this.dispatchEvent(new fS("onremovenormallayer",e))}},addGeoJSONLayer:function(e){if(e&&e instanceof aO){e.init(this)}},removeGeoJSONLayer:function(e){if(e&&e instanceof aO){e.remove()}},getTileLayer:function(e){if(this.tileMgr){return this.tileMgr.getTileLayer(e)}return null},setMapType:function(e){var i=this;if(this.mapType===e||this._mapTypeChanging){return}if(e===BMAP_EARTH_MAP&&!this.config.enableEarth){return}if(this._earth&&this._earth.getLock()){return}this._mapTypeChanging=true;this.preMapType=this.mapType;this._boundsInPreMapType=this.getBoundsIn();if(this.preMapType===BMAP_SATELLITE_MAP){this._preStreetLayerShow=this._isHybridShow}if(e===BMAP_EARTH_MAP){if(!bD.Earth){he.load("earth",function(){i._syncAndChangeMapType(e)});return}i._syncAndChangeMapType(e)}else{if(this.preMapType!==BMAP_EARTH_MAP){this._changeFlatMapType(e);this._mapTypeChanging=false}else{this._setMapTypeStatus(e,function(T,kq){var kr=i._earth.getEarthCanvas();i._changeFlatMapType(e,this.preMapType);if(i._mapTypeChangAni){i._mapTypeChangAni.stop()}i._mapTypeChangAni=du.start({el:kr,style:"opacity",startValue:1,endValue:0,duration:200,callback:function(){i._mapTypeChangAni=null;i._mapTypeChanging=false}});T=jn.convertLL2MC(T);if(i._renderType==="webgl"){e6.extend(i,D.prototype);i.setCenterIn(T,{noAnimation:true});i.setZoomIn(kq,{noAnimation:true})}else{e6.extend(i,i5.prototype);i.centerAndZoomIn(T,kq)}})}}},_changeFlatMapType:function(kt){if(!kt||!es[kt]){return}var kB=this.preMapType;this.mapType=kt;var kq=this.getTileLayer(kB);if(kq){this.removeTileLayer(kq)}else{if(this.tileMgr.tileLayers.length){var kA=this.getTileLayer("B_NORMAL_MAP");if(kA){this.removeTileLayer(kA)}else{kA=this.getTileLayer("B_SATELLITE_MAP");kA&&this.removeTileLayer(kA)}}}this._preStreetLayerShow=this.config.showStreetLayer;if(kB===BMAP_SATELLITE_MAP&&this.config.showVectorStreetLayer){this._removeHybirdVectorMap()}else{if(kB===BMAP_SATELLITE_MAP&&this._preStreetLayerShow){this._removeHybirdMap()}}if(this.mapType!==BMAP_EARTH_MAP||this._renderType!=="webgl"||this.baseLayerAdded!==true){if(kt!==BMAP_NONE_MAP){var T=new ib(new cD(-21364736,-10616832),new cD(23855104,15859712));var ky=new m(T,"baidu",kt);var kr=new hH({mapType:this.mapType,copyright:ky,dataType:this.mapType===BMAP_SATELLITE_MAP?gQ:hV,customLayer:this.mapType===BMAP_SATELLITE_MAP,baseLayer:true,transparentPng:false,tileTypeName:this.mapType===BMAP_SATELLITE_MAP?"web":"na"});kr._isInnerLayer=true;kr.setZIndex(0);this.addTileLayer(kr);if(this._renderType==="webgl"&&!this.baseLayerAdded){this.baseLayerAdded=true}}if(this.mapType===BMAP_NONE_MAP){hI.sendMessage(aZ(4,3,15),["layer","blank"])}else{if(this.mapType===BMAP_SATELLITE_MAP){hI.sendMessage(aZ(4,3,2),["layer","raster"])}else{hI.sendMessage(aZ(4,3,1,1),["layer","vector","normal"])}}}if(kt===BMAP_SATELLITE_MAP){this._featureMgr.clearLabelOverlayData();this._featureMgr.setLabelData([]);if(this.config.showVectorStreetLayer){this._addHybirdVectorMap()}else{if(this._preStreetLayerShow===true||typeof this._preStreetLayerShow==="undefined"){this._addHybirdMap()}}}var kv=this.tileMgr.tileLayers;for(var ku=0,ks=kv.length;ku<ks;ku++){var kw=kv[ku];var kz=kw.tilesDiv;if(!kz){continue}if(!kw._isInnerLayer&&kz.style.visibility==="hidden"){kz.style.visibility=""}}var kx=new fS("onmaptypechange");kx.zoomLevel=this.zoomLevel;kx.mapType=kt;kx.exMapType=kB;this.dispatchEvent(kx)},showStreetLayer:function(e){if(e){this.hideVectorStreetLayer()}e?this._addHybirdMap():this._removeHybirdMap()},showVectorStreetLayer:function(){this.hideStreetLayer();this.hideVectorStreetLayer();this.config.showVectorStreetLayer=true;if(this.mapType===BMAP_SATELLITE_MAP||this.mapType===BMAP_NONE_MAP){this._addHybirdVectorMap()}},hideStreetLayer:function(e){this._hideStreetLayerOptions=e;this._removeHybirdMap(e)},hideVectorStreetLayer:function(){this.config.showVectorStreetLayer=false;if(this.mapType===BMAP_SATELLITE_MAP||this.mapType===BMAP_NONE_MAP){this._removeHybirdVectorMap()}},_addHybirdVectorMap:function(){var e=new hH({mapType:"B_NORMAL_MAP",dataType:hV,customLayer:false,baseLayer:false,transparentPng:true,tileTypeName:"na"});e._isInnerLayer=true;e.setZIndex(1);this.addTileLayer(e)},_removeHybirdVectorMap:function(){var kr=this.tileMgr.tileLayers;for(var kq=0,e=kr.length;kq<e;kq++){var T=kr[kq];if(T._isInnerLayer&&T.mapType==="B_NORMAL_MAP"){this.removeTileLayer(T)}}},_addHybirdMap:function(){this._isHybridShow=true;if(this.mapType==="B_EARTH_MAP"){if(this._earth){this._earth.showStreetLayer()}return}if(this._hybridTileLayer){this.addTileLayer(this._hybridTileLayer);var kt=new fS("onstreetlayer_show");this.dispatchEvent(kt);return}var kr=new ib(new cD(-21364736,-10616832),new cD(23855104,15859712));var T=new m(kr,"",BMAP_HYBRID_MAP);var i=new hH({copyright:T,transparentPng:true,pack:true,tileTypeName:"web"});i._isInnerLayer=true;var kq=this.isCanvasMap();i.getTilesUrl=function(ku,kz){return ''};this._isHybridShow=true;this.addTileLayer(i);this._hybridTileLayer=i;var ks=new fS("onstreetlayer_show");this.dispatchEvent(ks)},_removeHybirdMap:function(i){this._isHybridShow=false;if(this.mapType==="B_EARTH_MAP"){if(this._earth){this._earth.hideStreetLayer(i)}return}if(this._hybridTileLayer){this.removeTileLayer(this._hybridTileLayer);var T=new fS("onstreetlayer_hide");this.dispatchEvent(T)}},isStreetLayerShow:function(){return this._isHybridShow},getTileId:function(e,ks){var kq=es[this.mapType];if(typeof kq!=="object"){return null}var T=kq.baseUnits*Math.pow(2,(kq.zoomLevelBase-ks));var kr=parseInt(e.lng/T,10);var i=parseInt(e.lat/T,10);return{row:kr,column:i,level:ks}},reset:function(){this.centerAndZoomIn(this.defaultCenter,this.defaultZoomLevel,true)},setOptions:function(i){i=i||{};var kr=this;for(var kq in i){if(i.hasOwnProperty(kq)){var T=true;if(typeof i[kq]!=="object"){T=i[kq]!==this.config[kq]}this.config[kq]=i[kq];if(kq==="fixCenterWhenResize"){this.config.enableResizeOnCenter=i[kq]}if(!T){continue}switch(kq){case"style":case"styleUrl":var e={os:i.style.os,sv:i.style.sv};if(kq==="style"&&i.styleUrl){break}this.fire(new fS("onstyle_willchange"));this.loadMapStyleFiles(function(){var ks=new fS("onlayer_update");ks.name="na";kr.fire(ks)},e);break;case"enableAutoResize":if(i[kq]===true){this.enableAutoResize()}else{this.disableAutoResize()}break;case"displayOptions":this.setDisplayOptions(i[kq]);break}}}},setPrivateStatus:function(i){if(typeof i==="boolean"){if(this.config.privateOn!==i){this.config.privateOn=i;var e=new fS("onlayer_update");e.name="na";this.fire(e)}}},getPrivateStatus:function(){return this.config.privateOn},setPrivateRegions:function(kr){if(kr&&kr instanceof Array){var kq=true;for(var T=0;T<kr.length;T++){if(kr[T] instanceof cS){continue}else{kq=false;break}}if(kq){this.config.privateRegions=kr;var e=new fS("onlayer_update");e.name="na";this.fire(e)}}},getPrivateRegions:function(){if(!this.config.privateRegions){return null}else{return this.config.privateRegions}},enableDragging:function(){this.config.enableDragging=true},disableDragging:function(){this.config.enableDragging=false},enableInertialDragging:function(){this.config.enableInertialDragging=true},disableInertialDragging:function(){this.config.enableInertialDragging=false},enableScrollWheelZoom:function(){this.config.enableWheelZoom=true},disableScrollWheelZoom:function(){this.config.enableWheelZoom=false},enableContinuousZoom:function(){this.config.enableContinuousZoom=true},disableContinuousZoom:function(){this.config.enableContinuousZoom=false},enableResizeOnCenter:function(){this.config.enableResizeOnCenter=true},disableResizeOnCenter:function(){this.config.enableResizeOnCenter=false},enableDoubleClickZoom:function(){this.config.enableDblclickZoom=true},disableDoubleClickZoom:function(){this.config.enableDblclickZoom=false},enableKeyboard:function(){this.config.enableKeyboard=true},disableKeyboard:function(){this.config.enableKeyboard=false},getSize:function(){return new je(this.width,this.height)},enablePinchToZoom:function(){this.config.enablePinchZoom=true},disablePinchToZoom:function(){this.config.enablePinchZoom=false},enableRotateGestures:function(){this.config.enableRotateGestures=true},disableRotateGestures:function(){this.config.enableRotateGestures=false},enableTilt:function(){this.config.enableTilt=true},disableTilt:function(){this.config.enableTilt=false},enableRotate:function(){this.config.enableRotate=true},disableRotate:function(){this.config.enableRotate=false},enableAutoResize:function(){this.config.enableAutoResize=true;this._watchSize();if(!this.temp.autoResizeTimer){this.temp.autoResizeTimer=setInterval(this._watchSize,16)}},disableAutoResize:function(){this.config.enableAutoResize=false;if(this.temp.autoResizeTimer){clearInterval(this.temp.autoResizeTimer);this.temp.autoResizeTimer=null}},checkResize:function(){this._watchSize()},resize:function(){this._watchSize()},getContainerSize:function(){return new je(this.container.clientWidth,this.container.clientHeight)},_getProperZoom:function(T){if(!T){T=this.zoomLevel}var i=this.getMinZoom();var e=this.getMaxZoom();var kq=false;if(T<i){kq=true;T=i}if(T>e){kq=true;T=e}if(this._renderType!=="webgl"){T=Math.round(T)}return{zoom:T,exceeded:kq}},getContainer:function(){return this.container},getZoomUnits:function(T){if(this.mapType===BMAP_EARTH_MAP){return Math.pow(2,18-this._earth.getImageZoom())}var e=es[this.mapType];if(typeof e!=="object"){return null}var i=T||this.zoomLevel;return Math.pow(2,(e.zoomLevelBase-i))},pointToPixelIn:function(kB,kD){if(!kB){return}kD=kD||{};if(this.mapType===BMAP_EARTH_MAP){var ks;if(!kB._llPt){ks=jn.convertMC2LL(kB);kB._llPt=ks}ks=kB._llPt;var kx=null;var kr=null;if(typeof kD.zoom==="number"){var kA=this._earth;var kC=kA._getEarthZoomByImgZoom(kD.zoom);if(kC<=3){kx=kA._generateTmpPMatrix(kC)}kr=kA._generateTmpMVMatrix(kA.getCenter(),kC)}var kt=this._earth.fromLatLngToPixel(ks,{useRound:false,isCalcOnBack:true,matrixInfo:{modelViewMatrix:kr,projectionMatrix:kx}});return kt}if((this._heading%360===0&&this._tilt===0)||!this._webglMapCamera){var kz=this.getZoomUnits(kD.zoom);var kv=kD.center||this.centerPoint;var kq=this.width/2;var ku=this.height/2;var ky;if(kB.lng*kv.lng<0){var i=Math.abs(kB.lng-kv.lng);var e=(e9._mc180X*2-i)/kz;if(kv.lng<0){ky=kq-e}else{ky=kq+e}}else{ky=(kB.lng-kv.lng)/kz+kq}var kw=(kv.lat-kB.lat)/kz+ku;if(kD.useRound!==false){ky=Math.round(ky);kw=Math.round(kw)}return new fr(ky,kw)}var T=this._webglMapCamera.fromMCToScreenPixel(kB.lng,kB.lat,kD);if(kD.useRound===false){return T}T.x=Math.round(T.x);T.y=Math.round(T.y);return T},pixelToPointIn:function(e,kx){if(!e){return}kx=kx||{};if(this.mapType===BMAP_EARTH_MAP){if(typeof kx.zoom==="number"){var kv=this._earth;var ks=null;var T=null;var kw=kv._getEarthZoomByImgZoom(kx.zoom);if(kw<=3){ks=kv._generateTmpPMatrix(kw)}T=kv._generateTmpMVMatrix(kv.getCenter(),kw)}var i=this._earth.fromPixelToLatLng(e,{matrixInfo:{modelViewMatrix:T,projectionMatrix:ks}});if(i===null){return null}return jn.convertLL2MC(i)}if((this._heading%360!==0||this._tilt>0)&&this._webglMapCamera){return this._webglMapCamera.fromScreenPixelToMC(e.x,e.y,kx)}var kt=kx.center||this.centerPoint;var ku=this.getZoomUnits(kx.zoom);var kr=kt.lng+ku*(e.x-this.width/2);var kq=kt.lat-ku*(e.y-this.height/2);return new cD(kr,kq)},pointToOverlayPixelIn:function(e,kq){kq=kq||{};var T=this.pointToPixelIn(e,{zoom:kq.zoom,center:kq.center,forLabel:true,frustumTest:true,useRound:kq.useRound});if(!T){return}if(kq.fixPosition&&this.mapType!=="B_EARTH_MAP"){var kr=this.getSize();var i=this.worldSize(kq.zoom);if(T.x>kr.width){while(T.x>kr.width){T.x-=i}}else{if(T.x<0){while(T.x<0){T.x+=i}}}}if(this._renderType==="webgl"){return T}T.x-=this.offsetX;T.y-=this.offsetY;return T},overlayPixelToPointIn:function(i,e){if(!i){return}var T=i.clone();if(this._renderType!=="webgl"){T.x+=this.offsetX;T.y+=this.offsetY}return this.pixelToPointIn(T,e)},getProjection:function(){return new jn()},lnglatToMercator:function(e,kq){var i=new cD(e,kq);var T=jn.convertLL2MC(i);return[T.lng,T.lat]},mercatorToLnglat:function(i,e){if(isNaN(i)||isNaN(e)){return[]}i=parseFloat(i);e=parseFloat(e);var kq=new cD(i,e);var T=jn.convertMC2LL(kq);return[T.lng,T.lat]},getBoundsIn:function(){if(!this._bounds){return}var kD=arguments[0];if(this.mapType===BMAP_EARTH_MAP&&this._earth){var kx=this._earth.getCustomBounds();if(!kx){return this.config.defaultMaxBounds}var kw=kx.getSouthWest();var e=kx.getNorthEast();if(kw.lng>e.lng){e.lng=180}var kU=jn.convertLL2MC(kw);var kK=jn.convertLL2MC(e);var kA=this.config.defaultMaxBounds;var kJ=Math.max(kU.lng,kA.sw.lng);var kI=Math.max(kU.lat,kA.sw.lat);var kC=Math.min(kK.lng,kA.ne.lng);var kB=Math.min(kK.lat,kA.ne.lat);var kF=new ib(new cD(kJ,kI),new cD(kC,kB));kF.pointBottomLeft=new cD(kJ,kI);kF.pointBottomRight=new cD(kC,kI);kF.pointTopLeft=new cD(kJ,kB);kF.pointTopRight=new cD(kC,kB);kF.setMinMax();kF.makeNormalizedPoint(this._earth.getHeading());return kF}kD=kD||{};var kr=kD.margins||[0,0,0,0];var kP=this.pixelToPointIn({x:kr[3],y:this.height-kr[2]},kD);var kT=this.pixelToPointIn({x:this.width-kr[1],y:kr[0]},kD);var kH=typeof kD.heading==="number"?kD.heading:(this._heading%360);var T=typeof kD.tilt==="number"?kD.tilt:this._tilt;var kz=this._webglMapCamera;if((kH===0&&T===0)||!kz){this._bounds.setSouthWest(kP);this._bounds.setNorthEast(kT);this._bounds.pointBottomLeft=kP;this._bounds.pointBottomRight=new cD(kT.lng,kP.lat);this._bounds.pointTopRight=kT;this._bounds.pointTopLeft=new cD(kP.lng,kT.lat);this._bounds.setMinMax();this._bounds.makeNormalizedPoint(kH);return this._bounds}var kG=this.pixelToPointIn({x:kr[3],y:kr[0]},kD);var kq=kz.getPosition();var kV=Math.sqrt(Math.pow(kG.lng-kq[0],2)+Math.pow(kG.lat-kq[1],2));var kQ=this.getZoomUnits();var kX=kV/kQ;var kN=kz._frustumSideLen;var kv=kz._fovy;if(kX>kN||(90-T)<kv/2){var kW=[kG.lng-kq[0],kG.lat-kq[1]];if((90-T)<kv/2){kW[0]=-kW[0];kW[1]=-kW[1]}var kO=kN*kQ;var ku=[kW[0]/kV*kO+kq[0],kW[1]/kV*kO+kq[1]];var kL=[kT.lng-kq[0],kT.lat-kq[1]];if((90-T)<kv/2){kL[0]=-kL[0];kL[1]=-kL[1]}var ks=[kL[0]/kV*kO+kq[0],kL[1]/kV*kO+kq[1]];kG.lng=ku[0];kG.lat=ku[1];kT.lng=ks[0];kT.lat=ks[1]}var kE=this.pixelToPointIn({x:this.width-kr[1],y:this.height-kr[2]},kD);var kM=[kP,kT,kG,kE];var kS=kM[0].lng;var kY=kM[0].lat;var kt=kM[0].lng;var ky=kM[0].lat;for(var kR=1;kR<4;kR++){if(kM[kR].lng<kS){kS=kM[kR].lng}if(kM[kR].lng>kt){kt=kM[kR].lng}if(kM[kR].lat<kY){kY=kM[kR].lat}if(kM[kR].lat>ky){ky=kM[kR].lat}}this._bounds.setSouthWest(new cD(kS,kY));this._bounds.setNorthEast(new cD(kt,ky));this._bounds.pointTopLeft=kG;this._bounds.pointTopRight=kT;this._bounds.pointBottomRight=kE;this._bounds.pointBottomLeft=kP;this._bounds.makeNormalizedPoint(kH);this._bounds.setMinMax();return this._bounds},isLoaded:function(){return !!this.loaded},_getBestLevel:function(i,kz){var ks=0;if(this._renderType==="webgl"&&!b2()){ks=100}var kt=kz.margins||[10,10,10,10];var kq=kz.zoomFactor||0;var ku=kt[1]+kt[3];var kr=kt[0]+kt[2];var e=this.getMinZoom();var ky=this.getMaxZoom();var kx=i.toSpan();var kw=kx.width/(this.width-ku-ks);var kv=kx.height/(this.height-kr-ks);var T=18-p(Math.max(kw,kv));if(T<e){T=e}if(T>ky){T=ky}T+=kq;if(this._renderType!=="webgl"){T=Math.floor(T)}return T},getViewportIn:function(kz,kr){if(this.mapType===BMAP_EARTH_MAP){kz=kz||[];var kt=[];for(var kA=0;kA<kz.length;kA++){if(!kz[kA]){continue}kt.push(jn.convertMC2LL(kz[kA]))}var kB=this._earth.getViewportIn(kt,kr);var kq=kB.center;var kx=kB.zoom;var kF=jn.convertLL2MC(kq);return{center:kF,zoom:kx}}var kv={center:this.getCenterIn(),zoom:this.getZoom()};if(!kz||kz.length===0){return kv}kr=kr||{};var ku;if(kz instanceof ib){ku=kz}else{var ks=kz;ku=new ib();for(var ky=ks.length-1;ky>=0;ky--){ku.extend(ks[ky])}if(ku.isEmpty()){return kv}}var kE=ku.getCenter();var e=this._getBestLevel(ku,kr);if(kr.margins){var T=kr.margins;var kD=(T[1]-T[3])/2;var kw=(T[0]-T[2])/2;var kC=this.getZoomUnits(e);kE.lng=kE.lng+kC*kD;kE.lat=kE.lat+kC*kw}return{center:kE,zoom:e}},setViewportIn:function(kq,kr){if(this.mapType===BMAP_EARTH_MAP){var kv;if(kq&&kq.center){var T=jn.convertMC2LL(kq.center);var kt=this._earth._getEarthZoomByImgZoom(kq.zoom,T);kv={center:T,zoom:kt}}else{kv=[];for(var ks=0;ks<kq.length;ks++){var ku=jn.convertMC2LL(kq[ks]);kv[ks]=new cx(ku.lat,ku.lng)}}this._earth.setViewportIn(kv,kr);return}var e;if(kq&&kq.center){e=kq}else{e=this.getViewportIn(kq,kr)}kr=kr||{};if(this._renderType==="webgl"){this.centerAndZoomIn(e.center,e.zoom,kr);return}if(e.zoom===this.zoomLevel&&kr.enableAnimation!==false){this.panToIn(e.center,{duration:200,callback:kr.callback})}else{this.centerAndZoomIn(e.center,e.zoom,kr)}},addSpots:function(T,i){if(!T||T.length===0){return}i=i||{};var ks=i.zIndex||0;var kr=typeof i.enableMultiResponse==="undefined"?true:!!i.enableMultiResponse;this.spotsPool=this.spotsPool||{};var e="sp"+(this.temp.spotsGuid++);this.spotsPool[e]={spots:T.slice(0),zIndex:ks,enableMultiResponse:kr};var kq=this;he.load("hotspot",function(){kq._asyncRegister()});return e},getSpots:function(e){return this.spotsPool[e]&&this.spotsPool[e].spots||[]},removeSpots:function(e){if(!e||!this.spotsPool[e]){return}delete this.spotsPool[e]},clearSpots:function(){delete this.spotsPool},getIconByClickPosition:function(i){if(!this.config.enableIconClick||!this._spotsMgr){return null}var e=this._spotsMgr.getSpotsByScreenPosition(i);if(e[0]&&e[0].userdata){var T=e[0].userdata;return{name:T.name,uid:T.uid,position:T.iconPoint||e[0].pt}}return null},setBounds:function(e){es[this.mapType].bounds=e.clone()},getCoordType:function(){return this.config.coordType},getPanes:function(){return this._panes},getInfoWindow:function(){if(this.temp.infoWin&&this.temp.infoWin.isOpen()){return this.temp.infoWin}return null},getDistanceIn:function(kr,e){if(!kr||!e){return}if(kr.equals(e)){return 0}if(this.mapType===BMAP_EARTH_MAP){var kq=jn.convertMC2LL(kr);var T=jn.convertMC2LL(e);return this._earth.getDistance(kq,T)}var i=jn.getDistanceByMC(kr,e);return i},getOverlays:function(){var ks=[];var kt=this._overlays;var kr=this._customOverlays;if(kt){for(var kq in kt){if(kt[kq] instanceof eJ){ks.push(kt[kq])}}}if(kr){for(var T=0,e=kr.length;T<e;T++){ks.push(kr[T])}}return ks},getMapType:function(){return this.mapType},getMapCoordType:function(){return this.coordType},_asyncRegister:function(){for(var e=this.temp.registerIndex;e<bD._register.length;e++){if(bD._register[e] instanceof Function){bD._register[e](this)}}this.temp.registerIndex=e},setDefaultCursor:function(e){this.config.defaultCursor=e;if(this.platform){this.platform.style.cursor=this.config.defaultCursor}},getDefaultCursor:function(){return this.config.defaultCursor},setOverlayMoveCursor:function(e){this.config.overlayMoveCursor=e},getOverlayMoveCursor:function(){return this.config.overlayMoveCursor},setDraggingCursor:function(e){this.config.draggingCursor=e},getDraggingCursor:function(){return this.config.draggingCursor},_syncAndChangeMapType:function(e){hI.sendMessage(aZ(4,250),["earth",""]);var i=this;if(i._renderType==="webgl"&&i.getTilt()>hX.MAX_DRAG_TILT_L2){i.setTilt(hX.MAX_DRAG_TILT_L2,{callback:function(){i._changeEarthMapType(e)}})}else{i._changeEarthMapType(e)}},_changeEarthMapType:function(T){var kq=this;var kt=kq.tileMgr.tileLayers;if(this._mapTypeChangAni){this._mapTypeChangAni.stop()}var ks;if(this._earth){ks=this._earth.getEarthCanvas()}if(!this._earth){this.maskLayer.style.opacity=1;this.maskLayer.style.zIndex=999;this.maskLayer.style.background="#000"}this._mapTypeChangAni=new fH({duration:400,render:function(e){if(!kq._earth){return}ks.style.opacity=e},finish:function(){for(var e=kt.length-1,ku=e;ku>=0;ku--){var kw=kt[ku].tilesDiv;if(kw){kw.style.visibility="hidden"}if(kt[ku]._isInnerLayer&&kq._renderType!=="webgl"){kq.removeTileLayer(kt[ku])}}kq._mapTypeChangAni=null;kq._mapTypeChanging=false;function kv(){var kA=kq.getZoom()-2;var kB=kq.getCenterIn();var ky=jn.convertMC2LL(kB);kq._earth=new bD.Earth(kq,{center:ky,zoom:kA,showRealSunlight:kq.config.showRealSunlight,showMilkyway:kq.config.showMilkyway,earthBackground:kq.config.earthBackground});if(kq.config&&kq.config.earthMaxZoom&&kq._earth){kq._earth.setMaxZoom(kq.config.earthMaxZoom)}if(kq.config&&kq.config.earthMinZoom&&kq._earth){kq._earth.setMinZoom(kq.config.earthMinZoom)}kq._proxyEarthEvents();var kx=kq.mapType;kq.mapType=T;var kz=new fS("onmaptypechange");kz.zoomLevel=this.zoomLevel;kz.mapType=T;kz.exMapType=kx;kq.dispatchEvent(kz);kq._setMapTypeStatus(T);e6.extend(kq,bD.EarthView.prototype);if(!kq._navigationCtrl&&kq.config.showControls){kq._navigationCtrl=new e8(kq)}}if(!kq._earth){if(bD["FeatureStyle"+kq.config.style]){kv()}else{kq.loadMapStyleFiles(function(){kv()})}}if(parseInt(kq.maskLayer.style.opacity,10)===1){setTimeout(function(){kq.maskLayer.style.zIndex=9;kq.maskLayer.style.opacity=0},1000)}}});if(!this._earth){return}var i=this.mapType;this.mapType=T;var kr=new fS("onmaptypechange");kr.zoomLevel=this.zoomLevel;kr.mapType=T;kr.exMapType=i;this.dispatchEvent(kr);kq._setMapTypeStatus(T);e6.extend(kq,bD.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){hI.sendMessage(aZ(4,i),[e])}},_setMapTypeStatus:function(T){var ku=arguments[1];if(T===BMAP_EARTH_MAP){var ks=this._earth.getEarthCanvas();if(ks){ks.style.display=""}var kv={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(jn.convertMC2LL(this.centerPoint),kv);this._earth.setImageZoom(this.zoomLevel,kv);this._earth.setTilt(this.getTilt(),kv);this._earth.setHeading(this.getHeading(),kv)}else{if(this.preMapType===BMAP_EARTH_MAP&&this._earth){var kt=this._earth;var kq=kt.getMapZoom();var kr=kt._imageRawZoom||kq;var i=kr-kq;var e=kt.getCenter();if(this._renderType==="webgl"){this._tilt=kt.getTilt();if(this.zoomLevel>7){this._heading=kt.getHeading();ku&&ku(e,kq);return}if(kt.getHeading()!==0){kt.setTilt(this.getTilt());kt.setHeading(this.getHeading(),{callback:function(){ku&&ku(e,kq)}})}else{ku&&ku(e,kq)}return}if(i<0.1&&kt.getTilt()===0&&kt.getHeading()===0){ku&&ku(e,kq);return}kt.setTilt(0);kt.setHeading(0);kt.setZoom(kt.getZoom()-i,{callback:function(){ku&&ku(e,kq)}})}}},_proxyEarthEvents:function(){var kr=this;var ks=this._earth;ks.on("tilesload",function(i){kr.fire(i)});ks.on("centerandzoom",function(i){kr.dispatchEvent(new fS("onmoveend"));kr.dispatchEvent(new fS("onzoomend"))});function kq(i){kr.fire(i)}var e=["zoomstart","zoomend","tilesload","sunlighttime_change","sunlighttime_clear","centerandzoom","animation_start","animation_stop","movestart","moveend","moving","dragstart","dragend","dragging"];for(var T=0;T<e.length;T++){ks.on(e[T],kq)}},forceEnableEarth:function(){this.config.forceEnableEarth=true;this.config.enableEarth=dc.ifEnableEarth(true);this.dispatchEvent(new fS("forceenableearth"));return this.config.enableEarth},setLock:function(e){if(this.mapType===BMAP_EARTH_MAP){this._earth.setLock(e)}this._lock=e},getLock:function(){if(this.mapType===BMAP_EARTH_MAP){return this._earth.getLock()}return this._lock},getEarth:function(){return this._earth},isSupportEarth:function(){return this.config.enableEarth},isCanvasMap:function(){return !!(this._renderType==="canvas"&&this.getMapType()!=="B_EARTH_MAP")},getCanvasMapCoordByUid:function(kr){if(this._renderType==="webgl"){var ks=this.tileMgr.tileLayers;for(var kq=0;kq<ks.length;kq++){if(ks[kq].labelProcessor){return ks[kq].labelProcessor.getLabelByUid(kr,"")}}return null}var e=this.canvas2dMapMgr._labelClick;var T=e.findLabelByUid(kr);return T?new cD(T.iconPos.geoX,T.iconPos.geoY):null},loadBizData:function(i){var e=new fS("onloadbizdata");e.data=i;this.dispatchEvent(e)},unloadBizData:function(){var e=new fS("onunloadbizdata");this.dispatchEvent(e)},zoomIn:function(e){this.setZoomIn(this.zoomLevel+1,{zoomCenter:e})},zoomOut:function(e){this.setZoomIn(this.zoomLevel-1,{zoomCenter:e})},setMaxZoom:function(e){if(this._renderType==="webgl"){this.config.maxZoom=e<=25?e:25}else{this.config.maxZoom=e<=19?e:19}},setEarthMaxZoom:function(i){var e=i<=this.getMaxZoom()-2?i:this.getMaxZoom()-2;if(this.mapType==="B_EARTH_MAP"){this._earth.setMaxZoom(e);this.earthMaxZoom=undefined;return}this.earthMaxZoom=e},setMinZoom:function(e){this.config.minZoom=e>=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(kq){kq=kq||this._initDate;var T=fE(kq);var e=jn.convertLL2MC(new cD(T[0],T[1]));var ky=e.latLng;var kt=bD.Projection.convertMC2LL(this.centerPoint);var kv=kq.getUTCHours();var kx=kv+24*kt.lng/360;var kw=kx-12;var ku=kw*60*0.25;var ks=Math.asin(Math.sin(iP(kt.lat))*Math.sin(iP(ky.lat))+Math.cos(iP(kt.lat))*Math.cos(iP(ky.lat))*Math.cos(iP(ku)));var kr=Math.asin(Math.sin(iP(ku))*Math.cos(iP(ky.lat))/Math.cos(ks));var i="north";if(kt.lat<ky.lat){i="south"}return{zenith:e,solarAltitude:ks,solarAzimuth:kr,centerPosition:i,position:e}},setDisplayOptions:function(T){if(!T){return}for(var e in this._displayOptions){if(this._displayOptions.hasOwnProperty(e)){if(typeof T[e]==="boolean"||(e==="skyColors"&&typeof T.skyColors==="object")||(e==="labelMargin"&&typeof T.labelMargin==="number")){this._displayOptions[e]=T[e]}}}var i=this.getMapType();if(i===fz.NORMAL){this.fire(new fS("ondisplayoptions_changed"))}else{if(i===fz.EARTH&&this._earth){this._earth.fire(new fS("ondisplayoptions_changed"))}}},getHorizonPosY:function(e){if(!e||!this._webglMapCamera){return null}var i=this._webglMapCamera.fromMCToScreenPixel(e.lng,e.lat,{heading:0});return i.y},getIndoorInfo:function(){if(!this._indoorMgr){return}return this._indoorMgr.getData()},showIndoor:function(e,T){if(this.map&&this.map.parking){this.map.parking.currentUid=e;this.map.parking.currentFloor=T}var i=new fS("onindoor_status_changed");i.uid=e;i.floor=T;this.fire(i)},addAreaSpot:function(e,T){if(!e||e.length===0){return}T=T||{};this.areaSpots=this.areaSpots||{};var i=T.id||("sp"+(this.temp.spotsGuid++));this.areaSpots[i]={spot:e,userData:T.userData};var kq=this;he.load("hotspot",function(){kq._asyncRegister()});return i},getAreaSpot:function(e){if(this.areaSpots&&this.areaSpots[e]){return this.areaSpots[e]}return null},removeAreaSpot:function(e){if(!e||!this.areaSpots[e]){return}delete this.areaSpots[e]},clearAreaSpots:function(){this.areaSpots={}},resetSpotStatus:function(){this.fire(new fS("onspot_status_reset"))},hightlightSpotByUid:function(e,T){var i=new fS("onspot_highlight");i.uid=e;i.tilePosStr=T;this.fire(i)},setZoomIn:function(i,e){e=e||{};this.zoomTo(i,e.zoomCenter||null,e)},restrictBounds:function(e){if(e instanceof ib){this.config.restrictBounds=e;this.restrictCenter(this.getCenterIn());this.fire(new fS("oncenter_changed"))}},getCurrentMaxTilt:function(){var e=this.zoomLevel;if(this.mapType==="B_EARTH_MAP"){return hX.MAX_DRAG_TILT_L2}if(this.config.restrictCenter===false){return hX.MAX_DRAG_TILT}if(e>=19){return hX.MAX_DRAG_TILT}else{if(e<=18){if(e<this._enableTiltZoom){if(e>=this._enableTiltZoom-2){return(1-(this._enableTiltZoom-e)/2)*hX.MAX_DRAG_TILT_L2}return 0}return hX.MAX_DRAG_TILT_L2}else{return(hX.MAX_DRAG_TILT-hX.MAX_DRAG_TILT_L2)*(e-18)+hX.MAX_DRAG_TILT_L2}}},worldSize:function(i){var e=i||this.zoomLevel;return hX.WORLD_SIZE_MC/this.getZoomUnits(e)},setTrafficOn:function(e){if(e&&Number(e)>1){jS.setZIndex(Number(e))}hI.sendMessage(aZ(4,3,3),["layer","traffic"]);this.addTileLayer(jS)},setTrafficOff:function(){this.removeTileLayer(jS)},showOverlayContainer:function(){this.setDisplayOptions({overlay:true})},hideOverlayContainer:function(){this.setDisplayOptions({overlay:false})},addLabelsToMapTile:function(kt,ks){hI.sendMessage(aZ(4,1,4),["instance","custom_label"]);for(var kq=0;kq<kt.length;kq++){if(typeof kt[kq].type==="undefined"){kt[kq].type="fixed"}if(typeof kt[kq].rank!=="number"){kt[kq].rank=50000}kt[kq].pt=kt[kq].position;kt[kq].custom=true;kt[kq].processedInZoom=0;var T=false;for(var e=0;e<this._customTileLabels.length;e++){if(this._customTileLabels[e].uid===kt[kq].uid){T=true;break}}if(!T){this._customTileLabels.push(kt[kq])}}var kr=new fS("onadd_tile_labels");if(ks&&ks instanceof eh){kr.data=kt;kr.index=ks.layer.drawIndex;kr.model="mvt"}this.dispatchEvent(kr)},removeLabelsFromMapTile:function(kr,kq,T){var kt=new fS("onremove_tile_labels");if(kq&&T){kt.data=kr;kt.index=kq;kt.model=T}else{for(var ks=0;ks<kr.length;ks++){for(var e=0;e<this._customTileLabels.length;e++){if(this._customTileLabels[e].uid===kr[ks]){this._customTileLabels.splice(e,1);break}}}}this.dispatchEvent(kt)},clearLabels:function(T,i){var e=new fS("onclear_labels");if(T&&i){e.data=[];e.index=T;e.model=i}else{this._customTileLabels.length=0}this.dispatchEvent(e)},loadMapStyleFiles:function(ks,e){this.customLoaded=false;var T=this.config.style;var kr=this.config.styleUrl;var kq=this;this._setTextRenderType();if(typeof T==="string"&&!kr){if(bD["FeatureStyle"+T]){this.customLoaded=true;kq.fire(new fS("onstyle_loaded"));ks();return}bD["FeatureStyle"+T]=window.FeatureStyle;bD["iconSetInfo"+T]=window.iconSetInfo_high;bD.indoorStyle=window.indoorStyle;gX.load(C.getMapStyleFiles(T),function(){if(kq.config.style===T){bD["FeatureStyle"+T]=window.FeatureStyle;bD["iconSetInfo"+T]=window.iconSetInfo_high;bD.indoorStyle=window.indoorStyle;kq.customLoaded=true;kq.fire(new fS("onstyle_loaded"));ks()}})}else{hI.sendMessage(aZ(4,1,2),["instance","custom_style"]);var i=T;u.init(kq);u.getStyleJson(i,function(ku){var kz=eW;var kB=bD.getGUID("custom");kq.config.mapStyleId=kB;var kx={};e6.extend(kx,ku);var kv=Math.floor(kq.getZoom());var ky;window["styleCbk_"+kB]=function(kC,kD){if(kD!==ky||!bD["customStyleInfo_"+kB]){return}if(typeof kC==="string"){kC=JSON.parse(kC)}u.onStyleDataBack(kC,kv,kB,kx,kz,bD["customStyleInfo_"+kB]);kq.customLoaded=true;kq.fire(new fS("onstyle_loaded"));ks()};bD["customStyleInfo_"+kB]={zoomRegion:{},zoomStyleBody:[],zoomFrontStyle:{}};var kA=u.getStyleUrl(ku,kz,"styleCbk_"+kB,kv,e,bD["customStyleInfo_"+kB]);var kt=kA.split("?")[0];ky=kA.split("?")[1];if(kr){kt=kr;ky=kt.split("?")[1]}if(!bD.iconSetInfoCustom){var kw=C.getMapStyleFiles("default");if(kq.config.showCustomIndoor){kw.splice(1,1)}else{kw.splice(1,2)}gX.load(kw,function(){bD.iconSetInfoCustom=window.iconSetInfo_high;bD.indoorStyle=window.indoorStyle;if(kt.indexOf("jsonp")>"-1"){gX.load(kt)}else{bD["customStyleInfo_"+kB].xhr=ij.post(kt,ky,window["styleCbk_"+kB])}})}else{if(kt.indexOf("jsonp")>"-1"){gX.load(kt)}else{bD["customStyleInfo_"+kB].xhr=ij.post(kt,ky,window["styleCbk_"+kB])}}})}},getFeatureStyleTags:function(){var e=[];var kr=Object.keys(bD);for(var kq=0;kq<kr.length;kq++){var T=kr[kq];if(T.indexOf("FeatureStyle")>-1&&bD[T]){e.push(T)}}return e},setCopyrightOffset:function(kq,i){var T=new fS("oncopyrightoffsetchange",{logo:kq,cpy:i});this.dispatchEvent(T)},_setTextRenderType:function(e){if(e){this.config.textRenderType=e;return}if(this.config.textRenderType!==null){return}if(b2()){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.fire(new fS("ondestroy"));var e=this.config.mapStyleId||0;delete bD["customStyleInfo_"+e];bD.BMAP_INSTANCES&&(bD.BMAP_INSTANCES-=1);if(!bD.BMAP_INSTANCES){this.destroyStyle()}this.config={};this.clearSpots();this._webGLStateId&&d1.WebGLState.remove(this._webGLStateId);this.container.onselectstart=null;this.container.style.backgroundImage="";this.maskLayer=null;this.platform=null;hI.kill();var i=this;setTimeout(function(){i._listeners=null;i._bounds=null;i.tileLabels=[];i._overlayMgrGL=null;i._overlayMgr=null;i._mapIcon=null;if(i._mouse){i._mouse._drag=null;i._mouse=null}i.deepZoom=null;i.tileMgr=null;i.indexToRgb=null;i.toFormatCoords=null;i._webglMapCamera=null;i._normalLayerMgr=null;i._webglPainter=null;i._webglMapScene=null;i._indoorMgr=null;if(i._renderType==="webgl"){i._spotsMgr=null;i._workerMgr=null;i.jobScheduler=null;i.benchmark=null;i._featureMgr=null;i._labelProcessor=null;i._customLabelMgr=null}if(i.cpyCtrl){i.cpyCtrl._map=null;i.cpyCtrl=null}i.logoCtrl=null;i._spotDataOnCanvas=null;i._navigationCtrl=null;i.container.innerHTML="";window.FeatureStyle=null;window.iconSetInfo_high=null;window.indoorStyle=null;window._indoorMgr=null},600)},destroyStyle:function(){var e=[];var kr=Object.keys(bD);for(var kq=0;kq<kr.length;kq++){var T=kr[kq];if(T.indexOf("FeatureStyle")>-1||T.indexOf("iconSetInfo")>-1||T.indexOf("indoorStyle")>-1){e.push(T)}}for(var kq=0;kq<e.length;kq++){delete bD[e[kq]]}},centerAndZoom:function(e,kt,T){if(Object.prototype.toString.call(kt)!=="[object Undefined]"){kt=parseInt(kt,10)}if(typeof e==="string"){var kq=this;var ks=new bl();ks.getPoint(e,function(ku){e=ku;var kv=jn.convertLL2MC(e);kq.centerAndZoomIn(kv,kt,T)},e)}else{if(this.config.coordType===BMAP_COORD_GCJ02){var kr=iI(e,3);var i=jn.convertLL2MC(kr)}else{var i=jn.convertLL2MC(e)}this.centerAndZoomIn(i,kt,T)}},pointToPixel:function(e,T){var i=jn.convertLL2MC(e);var kq={};e6.extend(kq,T);if(kq&&kq.center){kq.center=jn.convertLL2MC(kq.center)}return this.pointToPixelIn(i,kq)},pixelToPoint:function(T,i){var kq={};e6.extend(kq,i);if(kq&&kq.center){kq.center=jn.convertLL2MC(kq.center)}var e=this.pixelToPointIn(T,kq);return jn.convertMC2LL(e)},pointToOverlayPixel:function(e,T){var i=jn.convertLL2MC(e);var kq={};e6.extend(kq,T);if(kq&&kq.center){kq.center=jn.convertLL2MC(kq.center)}return this.pointToOverlayPixelIn(i,kq)},overlayPixelToPoint:function(T,i){var kq={};e6.extend(kq,i);if(kq&&kq.center){kq.center=jn.convertLL2MC(kq.center)}var e=this.overlayPixelToPointIn(T,kq);return jn.convertMC2LL(e)},setViewport:function(T,kq){var e;if(T&&T.center){e={};e6.extend(e,T);e.center=jn.convertLL2MC(e.center)}else{e=[];for(var kr=0;kr<T.length;kr++){e[kr]=jn.convertLL2MC(T[kr])}}this.setViewportIn(e,kq)},getViewport:function(ks,kq){var T;if(ks&&ks.length){T=[];for(var kr=0;kr<ks.length;kr++){T[kr]=jn.convertLL2MC(ks[kr])}}else{if(ks instanceof ib){T=new ib(jn.convertLL2MC(ks.getSouthWest()),jn.convertLL2MC(ks.getNorthEast()));T.setMinMax()}}var e=this.getViewportIn(T,kq);e.center=jn.convertMC2LL(e.center);return e},getDistance:function(kr,T){var i=jn.convertLL2MC(kr);var kq=jn.convertLL2MC(T);var e=this.getDistanceIn(i,kq);return e},setCenter:function(e,T){if(typeof e==="string"){var kq=this;var ks=new bl();ks.getPoint(e,function(kt){e=kt;var ku=jn.convertLL2MC(e);kq.setCenterIn(ku,T)},e)}else{if(this.config.coordType===BMAP_COORD_GCJ02){var kr=iI(e,3);var i=jn.convertLL2MC(kr)}else{var i=jn.convertLL2MC(e)}this.setCenterIn(i,T)}},setZoom:function(T,e){var i={};e6.extend(i,e);if(i&&i.zoomCenter){i.zoomCenter=jn.convertLL2MC(i.zoomCenter)}this.setZoomIn(T,i)},flyTo:function(e,kr,T){if(this.config.coordType===BMAP_COORD_GCJ02){var kq=iI(e,3);var i=jn.convertLL2MC(kq)}else{var i=jn.convertLL2MC(e)}this.flyToIn(i,kr,T)},panTo:function(e,T){var i=jn.convertLL2MC(e);this.panToIn(i,T)},getCenter:function(){var e=this.getCenterIn();if(this.config.coordType===BMAP_COORD_GCJ02){var i=jn.convertMC2LL(e);return eP(i)}return jn.convertMC2LL(e)},getBounds:function(){var e=this.getBoundsIn();var i=new ib(jn.convertMC2LL(e.getSouthWest()),jn.convertMC2LL(e.getNorthEast()));return i},setMapStyleV2:function(e){if(typeof e==="string"){this._setTextRenderType("image")}else{this._setTextRenderType("canvas")}this.setOptions({style:e})},startViewAnimation:function(T){var e=T._options.delay;var i=this;setTimeout(function(){T._start(i)},e)},pauseViewAnimation:function(e){e._pause(this)},continueViewAnimation:function(e){e._continue(this)},cancelViewAnimation:function(e){e._cancel(this)},getMapScreenshot:function(){return this._webglMapScene._painter._canvas.toDataURL()},setCustomArea:function(i){console.log("setCustomArea map");this.fire(new fS("onstyle_willchange"));this.areaCustomLoaded=false;var T=i.style;var kq=this;u.getStyleJson(T,function(ks){var kx=eW;var kz=bD.getGUID("customArea");kq.config.areaStyleId=kz;var kv={};e6.extend(kv,ks);var kt=Math.floor(kq.getZoom());var kw;window["styleCbk_"+kz]=function(kB,kC){if(kC!==kw||!bD["customStyleInfo_"+kz]){return}if(typeof kB==="string"){kB=JSON.parse(kB)}u.onStyleDataBack(kB,kt,kz,kv,kx,bD["customStyleInfo_"+kz]);kq.areaCustomLoaded=true;kq.fire(new fS("onstyle_loaded"));var kA=new fS("onlayer_update");kA.name="na";kq.fire(kA)};bD["customStyleInfo_"+kz]={zoomRegion:{},zoomStyleBody:[],zoomFrontStyle:{}};var ky=u.getStyleUrl(ks,kx,"styleCbk_"+kz,kt,"",bD["customStyleInfo_"+kz]);var kr=ky.split("?")[0];kw=ky.split("?")[1];var ku=C.getMapStyleFiles("default");if(kr.indexOf("jsonp")>"-1"){gX.load(kr)}else{bD["customStyleInfo_"+kz].xhr=ij.post(kr,kw,window["styleCbk_"+kz])}});var e={};if(i.area){e.area=i.area.map(function(kr){return jn.convertLL2MC(kr)})}e.customArea=true;this._workerMgr.setWorkerConfig(e)}});window.BMAP_NORMAL_MAP="B_NORMAL_MAP";window.BMAPGL_NORMAL_MAP="B_NORMAL_MAP";window.BMAP_SATELLITE_MAP="B_SATELLITE_MAP";window.BMAP_HYBRID_MAP="B_STREET_MAP";window.BMAP_EARTH_MAP="B_EARTH_MAP";window.BMAP_NONE_MAP="B_NONE_MAP";window.BMAP_COORD_MERCATOR=1;window.BMAP_COORD_GCJ02=2;window.BMAP_SYS_DRAWER=0;window.BMAP_SVG_DRAWER=1;window.BMAP_VML_DRAWER=2;window.BMAP_CANVAS_DRAWER=3;var u={environment:"jsapi",map:null,ontilesloaded:false,onstyle_loaded:false,init:function(i){var e=this;e.map=i;this.changeCopyright();this.setEnvironment(e.map.config.style);this.resetEventListener()},resetEventListener:function(){var e=this;this.ontilesloaded=false;this.onstyle_loaded=false;e.map.addEventListener("ontilesloaded",e.checkLoadedStatus);e.map.addEventListener("onstyle_loaded",e.checkLoadedStatus)},checkLoadedStatus:function(i){u[i.type]=true;if(u.ontilesloaded&&u.onstyle_loaded){this.dispatchEvent(new fS("onstylechangetilesloaded"));this.removeEventListener("ontilesloaded",u.checkLoadedStatus);this.removeEventListener("onstyle_loaded",u.checkLoadedStatus)}},changeCopyright:function(){var e=this;if(e.map.cpyCtrl){e.map.cpyCtrl.hide();if(e.environment!=="customEditor"){e.map.setCopyrightOffset(new je(1,1))}}else{e.map.addEventListener("oncopyrightaddend",function(){e.map.cpyCtrl.hide();if(e.environment!=="customEditor"){e.map.setCopyrightOffset(new je(1,1))}})}},setEnvironment:function(e){if(e.customEditor){this.environment="customEditor";a0.map=this.map}else{if(e.sharing){this.environment="sharing"}else{if(e.preview){this.environment="preview"}else{this.environment="jsapi"}}}},getStyleJson:function(kq,ks){var kr=this;if(kq.styleJson){ks&&ks(kq.styleJson)}else{if(kq.styleId){var i=kq.styleId;var e=(Math.random()*100000).toFixed(0);bD["_cbk_si_phpui"+e]=function(ku){var kt=[];if(ku.result&&ku.result["error"]===0&&ku.content&&ku.content["status"]===0){kt=kr.parseJson(ku.content["data"]["json"]);ks&&ks(kt)}else{ks&&ks("default")}};bD["_cbk_si_api"+e]=function(ku){var kt=[];if(ku.status===0){if(ku.info){kt=kr.parseJson(ku.info["json"])}else{kt=kr.parseJson(ku.data["json"])}ks&&ks(kt)}else{ks&&ks("default")}};var T="";switch(this.environment){case"jsapi":T=eD.apiHost+"/?qt=custom_map&v=3.0&style_id="+i+"&type=publish&ak="+eW;T+="&callback="+fB+"._cbk_si_phpui"+e;break;case"sharing":T+="/apiconsole/custommap/getSharingJson";T+="?styleid="+i+"&type=edit";T+="&ck="+fB+"._cbk_si_api"+e;break;case"preview":T+="/apiconsole/custommap/getJson";T+="?styleid="+i+"&type=edit";T+="&ck="+fB+"._cbk_si_api"+e;break}gX.load(T)}else{ks&&ks("default")}}},parseJson:function(T){if(T===null||T===""){return[]}var i={t:"featureType",e:"elementType",v:"visibility",c:"color",o:"opacity",l:"lightness",s:"saturation",w:"weight",z:"level",h:"hue",f:"fontsize",zri:"curZoomRegionId",zr:"curZoomRegion"};var kr={all:"all",g:"geometry","g.f":"geometry.fill","g.s":"geometry.stroke",l:"labels","l.t.f":"labels.text.fill","l.t.s":"labels.text.stroke","l.t":"labels.text","l.i":"labels.icon","g.tf":"geometry.topfill","g.sf":"geometry.sidefill"};var kq=T.split(",");var e=kq.map(function(kv){var ku=kv.split("|").map(function(kB){var kz=i[kB.split(":")[0]];var ky=(kr[kB.split(":")[1]]?kr[kB.split(":")[1]]:kB.split(":")[1]);switch(ky){case"poi":ky="poilabel";break;case"districtlabel":ky="districtlabel";break}var kA={};kA[kz]=ky;return kA});var ks=ku[0];var kx=1;if(ku[1]["elementType"]){kx=2;e6.extend(ks,ku[1])}var kw={};for(var kt=kx;kt<ku.length;kt++){e6.extend(kw,ku[kt])}return e6.extend(ks,{stylers:kw})});return e},getStyleUrl:function(i,kt,kr,T,kq,kv){this.styleJson=i;var e=C.apiHost+"/custom/v2/mapstyle?version="+4+"&ak="+kt+"&qt=custom_v2&is_all=true&is_new=1&";var ku=this.styleJson2styleStringV2(i,T,kv);e+="styles="+encodeURIComponent(ku);if(kq&&kq.os&&kq.sv){e+="&os="+kq.os+"&sv="+kq.sv}var ks=new Date()["getTime"]();e+="&timeStamp="+ks;e+=jA()(e);return e},styleJson2styleStringV2:function(e,ky,ku){var kz={featureType:"t",elementType:"e",visibility:"v",color:"c",opacity:"o",lightness:"l",saturation:"s",weight:"w",level:"z",hue:"h",fontsize:"f"};var kA={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"};var kB=[];for(var kq=this.map.getMinZoom();kq<=this.map.getMaxZoom();kq++){ku.zoomFrontStyle[kq]={}}ku.zoomFrontStyle.main={};var T=false;for(var kq=0;!!e[kq];kq++){var kx=e[kq];if(this.isOnlyZoomStyler(kx)){continue}ky=this.getFrontZoom(kx,ky);if((kx.featureType==="land"||kx.featureType==="all"||kx.featureType==="background")&&typeof kx.elementType==="string"&&(kx.elementType==="geometry"||kx.elementType==="geometry.fill"||kx.elementType==="all")&&kx.stylers&&!T){if(kx.stylers["color"]){ku.bmapLandColor=kx.stylers["color"]}if(kx.stylers["opacity"]){ku.bmapLandColor=kx.stylers["opacity"]}if(kx.stylers["visibility"]&&kx.stylers["visibility"]==="off"){ku.bmapLandColor="#00000000"}if(kx.featureType==="land"){T=true}}if(kx.featureType==="building"&&typeof kx.elementType==="string"&&kx.elementType==="geometry.fill"){ku.buildingFill=true}if(kx.featureType==="roadarrow"&&kx.elementType==="labels.icon"&&kx.stylers){var kv=kx.stylers["visibility"];ku.zoomFrontStyle[ky]["bmapRoadarrowVisibility"]=kv}var kr={};e6.extend(kr,kx);var kt=kr.stylers;delete kr.stylers;e6.extend(kr,kt);var ks=[];for(var kw in kz){if(kr[kw]){if(this.isEditorZoomKeys(kw)){continue}if(kw==="elementType"){ks.push(kz[kw]+":"+kA[kr[kw]])}else{switch(kr[kw]){case"poilabel":kr[kw]="poi";break;case"districtlabel":kr[kw]="label";break}ks.push(kz[kw]+":"+kr[kw])}}}if(ks.length>2){kB.push(ks.join("|"))}}return kB.join(",")},getFrontZoom:function(i,e){var T=i.stylers["level"];if(T===undefined){return"main"}else{return parseInt(T,10)}},isZoomConfig:function(e){var i=e.stylers["level"];if(i===undefined){return false}else{return true}},isOnlyZoomStyler:function(e){var i={};e6.extend(i,e.stylers);delete i.curZoomRegionId;delete i.curZoomRegion;delete i.level;if(e6.isEmptyObject(i)){return true}else{return false}},isSelectZoom:function(i,e){var T=i.stylers["level"];if(T===undefined){return true}else{if(T===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 kq=e.stylers["level"];var T={};e6.extend(T,i);if(kq===undefined){return T}else{T[parseInt(kq,10)]=true;return T}},onStyleDataBack:function(kr,e,i,kq,kt,T){if(kr.status!==0){return}if(kr.data.style.length===3){if(!T.baseFs){T.baseFs=kr.data.style}bD.StyleBody=kr.data.style[2]}else{bD.StyleBody=kr.data.style}var ks=T.baseFs;bD["FeatureStyle"+i]=ks;this.updateFrontFeatureStyle(T)},updateFrontFeatureStyle:function(T){if(T.zoomFrontStyle.main["bmapRoadarrowVisibility"]){for(var e=this.map.getMinZoom();e<=this.map.getMaxZoom();e++){if(!T.zoomFrontStyle[e]["bmapRoadarrowVisibility"]){T.zoomFrontStyle[e]["bmapRoadarrowVisibility"]=T.zoomFrontStyle.main["bmapRoadarrowVisibility"]}}}}};var a0={map:null,labelCache:{},calcDrawMc:function(T,i,e){var kq=[];switch(i){case"fill":kq=this.calcFill(T,e);break;case"line":break;case"building3d":kq=this.calcBuilding3d(T,e);break}return kq},calcFill:function(kr,T){var ks=[];for(var kq=0;kq<kr.length;kq=kq+5){var e=this.coordToMc({x:kr[kq],y:kr[kq+1]},T.row,T.col,T.mercatorSize,T.baseTileSize);ks.push(e[0],e[1])}return ks},calcLine:function(kr,T){var ks=[];var kt=new Int16Array(kr.buffer);for(var kq=0;kq<kt.length;kq=kq+10){var e=this.coordToMc({x:kt[kq]/10,y:kt[kq+1]/10},T.row,T.col,T.mercatorSize,T.baseTileSize);ks.push(e[0],e[1])}return ks},calcBuilding3d:function(ks,T){var kt=[];var kq={};for(var kr=0;kr<ks.length/2;kr=kr+7){if(ks[kr]===ks[kr-7]&&ks[kr+1]===ks[kr-6]){continue}if(kq[ks[kr].toString()+ks[kr+1].toString()]){continue}kq[ks[kr].toString()+ks[kr+1].toString()]=true;var e=this.coordToMc({x:ks[kr],y:ks[kr+1]},T.row,T.col,T.mercatorSize,T.baseTileSize);kt.push(e[0],e[1])}return kt},coordToMc:function(kr,kq,e,i,T){return[kr.x*(i/T)+e*i,kr.y*(i/T)+kq*i]},addDrawIntoAreaSpots:function(e,kr){if(u.environment!=="customEditor"){return}if(!kr.styleIds){return}for(var T=0;T<kr.styleIds.length;T++){var ku=0;if(T>0){ku=kr.verticesLength[T-1]}end=kr.verticesLength[T];var ks=[];var kq="";if(kr.vertex){ks=kr.vertex;kq="building3d"}else{if(kr.data[0]){ks=kr.data[0];kq=kr.type}else{continue}}var kt=this.calcDrawMc(ks.slice(ku,end),kq,e);this.map.addAreaSpot(kt,{userData:{styleId:kr.styleIds[T],type:"mapstyle"}})}},addLabelIntoAreaSpots:function(e){if(u.environment!=="customEditor"){return}for(var kr=0;kr<e.length;kr++){var ks=e[kr];for(var kq=0;kq<ks.fixedLabel.length;kq++){var T=ks.fixedLabel[kq];if(!T._mcBds){continue}var kt=[T._mcBds[0].lng,T._mcBds[0].lat,T._mcBds[0].lng,T._mcBds[1].lat,T._mcBds[1].lng,T._mcBds[1].lat,T._mcBds[1].lng,T._mcBds[0].lat];if(!this.labelCache[kt.join()]){this.labelCache[kt.join()]=true;this.map.addAreaSpot(kt,{userData:{styleId:T.styleId,type:"mapstyle",name:T.name}})}}}}};function cr(i,e,kq,T){this.cx=3*i;this.bx=3*(kq-i)-this.cx;this.ax=1-this.cx-this.bx;this.cy=3*e;this.by=3*(T-e)-this.cy;this.ay=1-this.cy-this.by;this.p1x=i;this.p1y=T;this.p2x=kq;this.p2y=T}cr.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e};cr.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e};cr.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx};cr.prototype.solveCurveX=function(e,kv){if(typeof kv==="undefined"){kv=0.000001}var ku;var kt;var kr;var T;var kq;for(kr=e,kq=0;kq<8;kq++){T=this.sampleCurveX(kr)-e;if(Math.abs(T)<kv){return kr}var ks=this.sampleCurveDerivativeX(kr);if(Math.abs(ks)<0.000001){break}kr=kr-T/ks}ku=0;kt=1;kr=e;if(kr<ku){return ku}if(kr>kt){return kt}while(ku<kt){T=this.sampleCurveX(kr);if(Math.abs(T-e)<kv){return kr}if(e>T){ku=kr}else{kt=kr}kr=(kt-ku)*0.5+ku}return kr};cr.prototype.solve=function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))};var gL={};function fH(T){var e={duration:1000,fps:30,delay:0,transition:gL.linear,dropLastAnimation:false};if(T){for(var kq in T){e[kq]=T[kq]}}if(T.beginTime){this._beginTime=T.beginTime}this._callbacks=[];this._options=e;if(e.delay){var kr=this;setTimeout(function(){kr._doStart()},e.delay)}else{this._doStart()}this._pauseTime=0}fH.INFINITE="INFINITE";fH.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(T){i._loop(T)})}else{this._beginTime=new Date().getTime();if(this._options.duration===fH.INFINITE){this._endTime=null}else{this._endTime=this._beginTime+this._options.duration}this._loop()}};fH.prototype._loop=function(kq){var kt=this;kq=kq||new Date().getTime();kq=kq-this._pauseTime;if(!this._beginTime){this._beginTime=kq}if(!this._endTime&&typeof this._options.duration==="number"){this._endTime=this._beginTime+this._options.duration}if(kt._endTime!==null&&kq>=kt._endTime){if(kt._options.dropLastAnimation===false){kt._options.render(kt._options.transition(1),1,kq)}if(typeof kt._options.finish==="function"){kt._options.finish(kq,this)}for(var ks=0,e=kt._callbacks.length;ks<e;ks++){kt._callbacks[ks]()}return}var kr;if(typeof kt._options.duration==="number"){kr=(kq-kt._beginTime)/kt._options.duration;kt.schedule=kt._options.transition(kr)}else{kr=kq-kt._beginTime;kt.schedule=0}kt._options.render(kt.schedule,kr,kq);if(!kt.terminative){if(window.requestAnimationFrame){kt._timer=requestAnimationFrame(function T(i){kt._loop(i)})}else{kt._timer=setTimeout(function(){kt._loop()},1000/kt._options.fps)}}};fH.prototype.stop=function(i,e){this.terminative=true;if(this._timer){if(window.cancelAnimationFrame){cancelAnimationFrame(this._timer)}else{clearTimeout(this._timer)}this._timer=null;if(typeof this._options.onStop==="function"){this._options.onStop(e)}}if(i){this._endTime=this._beginTime;this._loop()}};fH.prototype.pause=function(){if(!this._isPausing){this.stop();this.terminative=undefined;this._isPausing=performance.now()||new Date().getTime()}};fH.prototype.cancel=function(){this.stop()};fH.prototype.append=function(e){this._callbacks.push(e);return this};gL={_p1:1,_p2:1*1.525,linear:function(e){return e},reverse:function(e){return 1-e},easeInQuad:function(e){return e*e},easeInCubic:function(e){return Math.pow(e,3)},easeInBiquad:function(e){return Math.pow(e,4)},easeInBack:function(e){return e*e*((gL._p1+1)*e-gL._p1)},easeOutQuad:function(e){return -(e*(e-2))},easeOutCubic:function(e){return Math.pow((e-1),3)+1},easeOutBiquad:function(e){return 1-Math.pow((e-1),4)},easeOutBack:function(e){return((e=e-1)*e*((gL._p1+1)*e+gL._p1)+1)},easeInOutQuad:function(e){if(e<0.5){return e*e*2}else{return -2*(e-2)*e-1}},easeInOutCubic:function(e){if(e<0.5){return Math.pow(e,3)*4}else{return Math.pow(e-1,3)*4+1}},easeInOutBiquad:function(e){if(e<0.5){return Math.pow(e,4)*8}else{return 1-(Math.pow(e-1,4)*8)}},easeInOutSine:function(e){return(1-Math.cos(Math.PI*e))/2}};gL.ease=(function(){var e=new cr(0.4,0,0.6,1);return function(i){return e.solve(i)}})();gL["ease-in"]=gL.easeInQuad;gL["ease-out"]=gL.easeOutQuad;var du={start:function(kw){var kq=kw.el;var e=kw.style;var i=kw.startValue;var kt=kw.endValue;var kr=kw.duration||1400;var ks=kw.transition||gL.linear;var kv=kw.callback;var ku=kt-i;var T=kw.unit||"";return new fH({fps:60,duration:kr,transition:ks,render:function(kx){kq.style[e]=i+ku*kx+T},finish:function(){kv&&kv()}})}};function q(kr,T){de.call(this);this.keyframes=kr;var e={duration:1000,delay:0,transition:gL.linear,interation:1};if(T){for(var kq in T){e[kq]=T[kq]}}this._options=e}q.inherits(de,"ViewAnimation");q.prototype._start=function(ks){var T=this;T.map=ks;var kr=new fS("onanimationstart");T.dispatchEvent(kr);this._initStatus(T.map);var kq=this._options.duration;var i=this._options.interation;var kt=this._options.transition;var ku=0;T.poiStatus=T.map._displayOptions.poi;if(T.poiStatus){T.map.setDisplayOptions({poi:false})}T.map.viewAnimationTime=new Date().getTime();this.animation=new fH({duration:kq,transition:kt,start:function(e){},render:function(kv,e){if(kv===0){T._initStatus(T.map)}else{T._setViewByRate(kv)}},finish:function(kw,kv){if(++ku<i||i==="INFINITE"){var kx=new fS("onanimationiterations");T.dispatchEvent(kx);delete kv._beginTime;delete kv._endTime;kv._doStart()}else{var kx=new fS("onanimationend");T.dispatchEvent(kx);delete T.map.viewAnimationTime;T.map.setDisplayOptions({poi:T.poiStatus})}}})};q.prototype._getTotalDuration=function(e,i){if(e===fH.INFINITE){return fH.INFINITE}else{return e*i}};q.prototype._initStatus=function(e){if(this.keyframes[0]){e.setCenter(this.keyframes[0].center,{noAnimation:true});e.setZoom(this.keyframes[0].zoom,{noAnimation:true});e.setTilt(this.keyframes[0].tilt,{noAnimation:true});e.setHeading(this.keyframes[0].heading,{noAnimation:true})}};q.prototype._setViewByRate=function(kq){for(var e=0;e<this.keyframes.length-1;e++){var kr=this.keyframes[e];var T=this.keyframes[e+1];if(kq>=kr.percentage&&kq<T.percentage){this.map.setHeading(this._getHeadingDelta(kr,T,kq),{noAnimation:true});this.map.setTilt(this._getTiltDelta(kr,T,kq),{noAnimation:true});this.map.setCenter(this._getCenterDelta(kr,T,kq),{noAnimation:true});this.map.setZoom(this._getZoomDelta(kr,T,kq),{noAnimation:true})}}};q.prototype._getHeadingDelta=function(T,i,e){var kr=(e-T.percentage)/(i.percentage-T.percentage);var kq=T.heading+(i.heading-T.heading)*kr;return kq};q.prototype._getTiltDelta=function(T,i,e){var kr=(e-T.percentage)/(i.percentage-T.percentage);var kq=T.tilt+(i.tilt-T.tilt)*kr;return kq};q.prototype._getCenterDelta=function(T,i,e){var kr=(e-T.percentage)/(i.percentage-T.percentage);var kq=T.center.add(i.center.sub(T.center).mult(kr));return kq};q.prototype._getZoomDelta=function(kq,T,i){var kr=(i-kq.percentage)/(T.percentage-kq.percentage);var e=kq.zoom+(T.zoom-kq.zoom)*kr;return e};q.prototype._pause=function(e){this.animation.pause()};q.prototype._continue=function(e){this.animation._doStart()};q.prototype._cancel=function(T){T.setDisplayOptions({poi:this.poiStatus});this.animation.cancel();delete T.viewAnimationTime;var i=new fS("onanimationcancel");this.dispatchEvent(i)};var cO=undefined;var fC={is64Bit:function(){if(/Windows/.test(navigator.userAgent)){if(/Win64; x64/.test(navigator.userAgent)){return true}else{if(/WOW64/.test(navigator.userAgent)){return true}else{return false}}}return true},isIOS112:function a8(e){return/11_2/.test(navigator.userAgent)},canUseWebAssembly:function(i){if(cO!==undefined){i&&i(cO);return}if(window.WebAssembly&&this.is64Bit()){if(window.disableWebAssembly===true){cO=false;i&&i(cO)}else{if(!cz()){cO=true;i&&i(cO)}else{if(this.isIOS112()){cO=false;i&&i(cO)}else{var e=new Uint8Array([0,97,115,109,1,0,0,0,1,133,128,128,128,0,1,96,0,1,127,3,130,128,128,128,0,1,0,4,132,128,128,128,0,1,112,0,0,5,131,128,128,128,0,1,0,1,6,129,128,128,128,0,0,7,145,128,128,128,0,2,6,109,101,109,111,114,121,2,0,4,109,97,105,110,0,0,10,138,128,128,128,0,1,132,128,128,128,0,0,65,42,11]);WebAssembly.instantiate(e).then(function(T){cO=true;i&&i(cO)},function(T){cO=false;i&&i(cO)})}}}}else{cO=false;i&&i(cO)}}};var aJ={};bD.Utils=aJ;function kh(e){return e.style}function id(i){if(e6.Browser.ie>0){i.unselectable="on";i.selectstart=function(){return false};i.onmousedown=function(T){T.preventDefault();return false}}else{var e=kh(i);e.MozUserSelect="none";e.WebkitUserSelect="none";i.addEventListener("mousedown",function(T){T.preventDefault()},false)}}function aT(e){return e&&e.parentNode&&e.parentNode.nodeType!==11}function bP(i,e){i.insertAdjacentHTML("beforeEnd",e);return i.lastChild}function fX(T,i){var kq=document.createElement("div");kq.innerHTML=i;var e=kq.childNodes[0];return T.parentNode.insertBefore(e,T)}function aj(i){i=i||window.event;i.stopPropagation?i.stopPropagation():i.cancelBubble=true}function c(i){i=i||window.event;i.preventDefault?i.preventDefault():i.returnValue=false;return false}function hA(i){aj(i);return c(i)}function g3(){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 iC(kr){if(!kr){return}kr.onload=kr.onerror=null;var T=kr.attributes,kq,e,ks;if(T){e=T.length;for(kq=0;kq<e;kq+=1){ks=T[kq].name;if(typeof kr[ks]==="function"){kr[ks]=null}}}T=kr.children;if(T){e=T.length;for(kq=0;kq<e;kq+=1){iC(kr.children[kq])}}}function f0(i,kt,ks){var kr=kt.lng-ks.lng;var kq=kt.lat-ks.lat;if(kr===0){return Math.abs(i.lng-kt.lng)}if(kq===0){return Math.abs(i.lat-kt.lat)}var T=kq/kr;var e=kt.lat-T*kt.lng;return Math.abs(T*i.lng-i.lat+e)/Math.sqrt(T*T+1)}function co(i,e){if(!i||!e){return}return Math.round(Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2)))}function eC(i,e){if(!i||!e){return 0}return Math.round(Math.sqrt(Math.pow(i.lng-e.lng,2)+Math.pow(i.lat-e.lat,2)))}function fR(kv,T,kr){var ks=(kr.lng-T.lng)*(kv.lng-T.lng)+(kr.lat-T.lat)*(kv.lat-T.lat);if(ks<=0){return eC(kv,T)}var e=(kr.lng-T.lng)*(kr.lng-T.lng)+(kr.lat-T.lat)*(kr.lat-T.lat);if(ks>=e){return eC(kv,kr)}var i=ks/e;var ku=T.lng+(kr.lng-T.lng)*i;var kt=T.lat+(kr.lat-T.lat)*i;const kq={lng:ku,lat:kt};return eC(kv,kq)}function fj(T,i){var e=Math.round((T.x+i.x)/2);var kq=Math.round((T.y+i.y)/2);return new fr(e,kq)}function jy(e,T){var i=[];T=T||function(kr){return kr};for(var kq in e){i.push(kq+"="+T(e[kq]))}return i.join("&")}function b3(T,i,ks){var kt=document.createElement(T);if(ks){kt=document.createElementNS(ks,T)}i=i||{};for(var kq in i){var kr={"for":"htmlFor","class":"cssClass"}[kq]||kq;if(kq==="style"){kt.style.cssText=i[kq];continue}if(kq==="class"){e6.ac(kt,i[kq]);continue}if(kt.setAttribute){kt.setAttribute(kr,i[kq])}else{try{kt[kr]=i[kq]}catch(kt){}}}return kt}function cn(e){if(e.currentStyle){return e.currentStyle}else{if(e.ownerDocument&&e.ownerDocument.defaultView){return e.ownerDocument.defaultView.getComputedStyle(e,null)}}}function bX(e){return typeof e==="function"}function gn(e){return e===void 0}function jP(e,i){return Object.prototype.hasOwnProperty.call(e,i)}function g(kr,ks){if(gn(kr.length)){for(var kq in kr){if(jP(kr,kq)){ks.call(null,kq,kr[kq])}}}else{var T=kr.length;if(T){for(var e=0;e<T;e++){ks.call(null,e,kr[e])}}}}function ar(i,e){if(!e){return i}g(e,function(T,kq){i[T]=kq});return i}var hi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function dr(kr){var T="";var ky;var kw;var ku="";var kx;var kv;var kt;var ks="";var kq=0;var e=/[^A-Za-z0-9+/=]/g;if(!kr||e.exec(kr)){return kr}kr=kr.replace(/[^A-Za-z0-9+/=]/g,"");do{kx=hi.indexOf(kr.charAt(kq++));kv=hi.indexOf(kr.charAt(kq++));kt=hi.indexOf(kr.charAt(kq++));ks=hi.indexOf(kr.charAt(kq++));ky=(kx<<2)|(kv>>4);kw=((kv&15)<<4)|(kt>>2);ku=((kt&3)<<6)|ks;T=T+String.fromCharCode(ky);if(kt!==64){T=T+String.fromCharCode(kw)}if(ks!==64){T=T+String.fromCharCode(ku)}ky=kw=ku="";kx=kv=kt=ks=""}while(kq<kr.length);return T}function jw(e){return btoa(encodeURIComponent(e))}function f7(e){return decodeURIComponent(atob(e))}(function(e){if(!e.Utils){e.Utils={}}var i=e.Utils;i.format=(function(){function T(kt,ks,ku){var kr=ku[+ks];return typeof(kr)==="function"?kr(ks):kr}function kq(kt,ks,ku){var kw=ks;var kx=[];var kr=ks.split(":");if(kr.length===2){kw=kr[0];kx.push(kr[1])}var kv=typeof(ku[kw]);if(kv==="function"){return ku[kw].apply(undefined,kx)}else{if(kv==="undefined"){return kt}else{return String(ku[kw])}}}return function(kr,ks){var ku=ks.splice?T:kq;var kt=kr.splice?kr.join(""):kr;return kt.replace(/{([a-zA-Z0-9_$:.]+)}/g,function(kw,kv){return ku(kw,kv,ks)})}})();i.ErrorMonitor=function(kq,T,kr){};fC.canUseWebAssembly(function(T){i.canUseWebAssembly=T})})(bD);function b2(){return(cz()||h5())}function cz(){var e=navigator.userAgent;if(e.indexOf("iPhone")>-1||e.indexOf("iPad")>-1){return true}return false}function h5(){var e=navigator.userAgent;if(e.indexOf("Android")>-1){return true}return false}function iP(e){return e*Math.PI/180}function fi(e){return e/Math.PI*180}function bH(e,kr){var kq=Math.pow(10,kr);if(typeof e==="number"){return Math.round(e*kq)/kq}for(var T=0;T<e.length;T++){e[T]=bH(e[T],kr)}return e}function ch(T,i,e){if(T<i){T=i}else{if(T>e){T=e}}return T}function en(e,i){while(e<0){e+=i}return e%i}function h2(i,e){return(i>=0&&e>=0)||(i<0&&e<0)}function M(i){if(i._gl){return i._gl}var e={alpha:true,antialias:false,failIfMajorPerformanceCaveat:false,preserveDrawingBuffer:false,stencil:false};var T=i.getContext("webgl",e)||i.getContext("experimental-webgl",e);i._gl=T;return T}function iM(kq,T){for(var e=0;e<T.length;e++){e6.on(kq,T[e],aj)}}function e0(i,T,e){T[e]=i.getUniformLocation(T,e)}function b5(kr,ks,e,T,i){var kq="";switch(i){case"mat4":kr.uniformMatrix4fv(ks[e],false,T);return;case"v3":kq="uniform3fv";break;case"f":kq="uniform1f";break;case"i":kq="uniform1i";break}if(kq===""){throw"error"}kr[kq](ks[e],T)}function hN(ky,e){while(ky<0){ky+=360}ky=ky%360;var kq=e.width;var kx=e.height;var kt=kq;var T=kx;if(ky<90){var i=Math.sin(iP(ky))*kq;var kv=Math.sin(iP(ky))*kx;var kw=Math.cos(iP(ky))*kq;var ks=Math.cos(iP(ky))*kx;var kt=Math.ceil(kw+kv);var T=Math.ceil(i+ks)}else{if(ky<180){var ky=ky-90;var i=Math.sin(iP(ky))*kq;var kv=Math.sin(iP(ky))*kx;var kw=Math.cos(iP(ky))*kq;var ks=Math.cos(iP(ky))*kx;var kt=Math.ceil(i+ks);var T=Math.ceil(kw+kv)}else{if(ky<270){var ky=ky-180;var i=Math.sin(iP(ky))*kq;var kv=Math.sin(iP(ky))*kx;var kw=Math.cos(iP(ky))*kq;var ks=Math.cos(iP(ky))*kx;var kt=Math.ceil(kw+kv);var T=Math.ceil(i+ks)}else{var ky=ky-270;var i=Math.sin(iP(ky))*kq;var kv=Math.sin(iP(ky))*kx;var kw=Math.cos(iP(ky))*kq;var ks=Math.cos(iP(ky))*kx;var kt=Math.ceil(i+ks);var T=Math.ceil(kw+kv)}}}var ku=kt-kq;var kr=T-kx;return[0-ku/2,0-kr/2,kq+ku/2,kx+kr/2]}function cg(e){if(e.toDataURL()===cg._blankData){return true}return false}function W(kr,kq,T){var i=[T.lng-kr.lng,T.lat-kr.lat];var e=[kq.lng-kr.lng,kq.lat-kr.lat];return i[0]*e[1]-i[1]*e[0]}function jb(ks,kr,T){var e;var kt;var kq;var i;if(ks.lng<kr.lng){e=ks.lng;kq=kr.lng}else{e=kr.lng;kq=ks.lng}if(ks.lat<kr.lat){kt=ks.lat;i=kr.lat}else{kt=kr.lat;i=ks.lat}if(T.lng<e||T.lng>kq||T.lat<kt||T.lat>i){return false}return true}function jm(ku,kt,ks,kq){var kr=W(ks,kq,ku);var T=W(ks,kq,kt);var i=W(ku,kt,ks);var e=W(ku,kt,kq);if(kr*T<0&&i*e<0){return true}else{if(kr===0&&jb(ks,kq,ku)){return true}else{if(T===0&&jb(ks,kq,kt)){return true}else{if(i===0&&jb(ku,kt,ks)){return true}else{if(e===0&&jb(ku,kt,kq)){return true}else{return false}}}}}}function hQ(T,i){var e=i.parentNode;if(e.lastChild===i){e.appendChild(T)}else{e.insertBefore(T,i.nextSibling)}}function dZ(kw,kx){if(kx===0){return kw}var kv=0;var kt=0;if(!kw){throw"异常"}if(kw.length===0){return[]}for(var kr=1,T=kw.length-1;kr<T;kr++){var ku=f0(kw[kr],kw[0],kw[kw.length-1]);if(ku>kv){kt=kr;kv=ku}}var e=[];if(kv>=kx){var kz=kw.slice(0,kt);var ky=kw.slice(kt,kw.length);var ks=dZ(kz,kx);var kq=dZ(ky,kx);for(var kr=0,T=ks.length;kr<T;kr++){e.push(ks[kr])}for(var kr=0,T=kq.length;kr<T;kr++){e.push(kq[kr])}}else{e.push(kw[0]);e.push(kw[kw.length-1])}return e}function p(e){if(Math.log2){return Math.log2(e)}return Math.log(e)/Math.LN2}function di(T,i,e){return Math.min(e,Math.max(i,T))}function aq(e,i){if(!i){return e}var ks=i[0];var kr=i[1];var kq=i[2];var T=i[3];var ku=[];var kt=[];ku[0]=T*e[0]+kq*e[2];ku[1]=e[1];ku[2]=-kq*e[0]+T*e[2];kt[0]=ku[0];kt[1]=kr*ku[1]-ks*ku[2];kt[2]=ks*ku[1]+kr*ku[2];return kt}var n=Math.PI/180;var gW=180/Math.PI;function fE(T){var i=(T-Date.UTC(2000,0,1,12))/86400000/36525;var e=(d3.utcDay.floor(T)-T)/86400000*360-180;return[e-fu(i)*gW,d6(i)*gW]}function fu(kq){var kr=bu(kq);var i=ee(kq);var T=iK(kq);var ks=Math.tan(iJ(kq)/2);ks*=ks;return ks*Math.sin(2*T)-2*kr*Math.sin(i)+4*kr*ks*Math.sin(i)*Math.cos(2*T)-0.5*ks*ks*Math.sin(4*T)-1.25*kr*kr*Math.sin(2*i)}function d6(e){return Math.asin(Math.sin(iJ(e))*Math.sin(bz(e)))}function bz(e){return kb(e)-(0.00569+0.00478*Math.sin((125.04-1934.136*e)*n))*n}function kb(e){return iK(e)+jr(e)}function ee(e){return(357.52911+e*(35999.05029-0.0001537*e))*n}function iK(i){var e=(280.46646+i*(36000.76983+i*0.0003032))%360;return(e<0?e+360:e)/180*Math.PI}function jr(i){var e=ee(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)*n}function iJ(e){return dA(e)+0.00256*Math.cos((125.04-1934.136*e)*n)*n}function dA(e){return(23+(26+(21.448-e*(46.815+e*(0.00059-e*0.001813)))/60)/60)*n}function bu(e){return 0.016708634-e*(0.000042037+1.267e-7*e)}function go(){return window.devicePixelRatio||1}function iW(T){var i;var e;var kq;if(T>=0){kq=Math.floor(T/65536)*65536;i=kq;e=T-kq}else{kq=Math.floor(-T/65536)*65536;i=-kq;e=T+kq}return[i,e]}function cK(e){if(e.lng>=0&&e.lat>=0){return new cD(e.lng-10000000,e.lat-6000000)}if(e.lng>=0&&e.lat<0){return new cD(e.lng-10000000,e.lat+6000000)}if(e.lng<0&&e.lat>=0){return new cD(e.lng+10000000,e.lat-6000000)}if(e.lng<0&&e.lat<0){return new cD(e.lng+10000000,e.lat+6000000)}}var ip=null;if(window.performance&&window.performance.now){ip=function(){return performance.now()}}else{if(Date.now){ip=function(){return Date.now()}}else{ip=function(){return(new Date).getTime()}}}function h1(kq,e,i){var T="mouseWheel";if(e6.Platform.macintosh){if(!isNaN(kq)&&(kq<10||kq!==120)&&(e%1===0&&e<5)){T="padScroll"}if(e6.Browser.firefox&&(e%1===0&&e<5&&i===0)){T="padScroll"}}if(e6.Browser.safari&&kq===12){T="mouseWheel"}return T}function bQ(kz,ku){var ky=kz[0];var kx=kz[1];var kq=false;for(var kt=0,ks=ku.length-2;kt<ku.length;kt+=2){var kw=ku[kt];var kr=ku[kt+1];var kv=ku[ks];var T=ku[ks+1];var e=((kr>kx)!==(T>kx))&&(ky<(kv-kw)*(kx-kr)/(T-kr)+kw);if(e){kq=!kq}ks=kt}return kq}function au(kr,kt){kt=kt||[];var e=kt.length;var T=0;var ks=false;for(var kq=0;kq<e;kq++){T=(kq===e-1)?0:T+1;if((kt[kq].lat!==kt[T].lat)&&(((kr.lat>=kt[kq].lat)&&(kr.lat<kt[T].lat))||((kr.lat>=kt[T].lat)&&(kr.lat<kt[kq].lat)))&&(kr.lng<(kt[T].lng-kt[kq].lng)*(kr.lat-kt[kq].lat)/(kt[T].lat-kt[kq].lat)+kt[kq].lng)){ks=!ks}}return ks}function dX(T,e,i,kq){kq=kq||0.4;if(T>i){T=Math.pow(T-i+1,kq)+i-1}else{if(T<e){T=e-Math.pow(e-T+1,kq)+1}}return T}function e2(ku){var ks="";for(var T=0;T<ku.length;T++){var kv=ku.charCodeAt(T)<<1;var e=kv.toString(2);var kr=e.length;var ky=e;if(kr<8){ky="00000000"+e;ky=ky.substr(e.length,8)}ks+=ky}var kw=5-ks.length%5;var kq=[];for(var T=0;T<kw;T++){kq[T]="0"}ks=kq.join("")+ks;var kx=[];for(var T=0;T<ks.length/5;T++){var kv=ks.substr(T*5,5);var kt=parseInt(kv,2)+50;kx.push(String.fromCharCode(kt))}return kx.join("")+kw.toString()}function j2(T,i){var e=bD.TILE_VERSION||window.TILE_VERSION;if(!e||!e[T]||!e[T][i]||!e[T][i].version||!e[T][i].updateDate){e=C.tvc}return{ver:e[T][i].version,udt:e[T][i].updateDate}}function bE(){var e=bD.MSV||window.MSV;if(!e||!e.mapstyle||!e.mapstyle.updateDate||!e.mapstyle.version){e=C.msv}return{ver:e.mapstyle.version,udt:e.mapstyle.updateDate}}function dF(e,kr){var kq=e.slice(0);for(var T=0;T<kq.length;T++){kq[T]+=kr}return kq}var hc=null;function hs(e){if(hc){return}e.fire(new fS("onloadtile"));hc=setTimeout(function(){hc=null},1000)}function aM(){if(E("//map.baidu.com")||E("//maps.baidu.com")||E("//ditu.baidu.com")){return true}return false}aJ.inMapHost=aM();if(typeof window._inMapHost==="boolean"){aJ.inMapHost=window._inMapHost}function E(i){var T=window.location;var e=document.createElement("a");e.href=i;return e.hostname===T.hostname&&e.port===T.port&&e.protocol===T.protocol}var d5=[72.685732,0.193351,136.10888,54.392257];var e5=[72.6892532,0.1939743381,136.1168614,54.392257];var t=[72.69566833,0.1999420909,136.1232863,54.39791217];var iL=158;var dt=[98.789081,122.948721,107.857301,118.082148,119.126627,128.021934,79.939914,99.021873,119.912937,122.084572,127.906381,130.933385,106.496057,108.066113,119.818772,126.367919,111.789929,119.311401,100.742164,102.220151,99.853589,100.781289,97.522631,98.834615,99.092638,99.892947,122.905967,123.761867,123.716213,125.494726,123.723977,124.755034,125.475833,126.398284,125.471687,126.065118,130.817003,133.605851,127.900156,128.656536,128.646633,129.625389,132.88057,134.104549,117.365548,119.230813,116.073074,117.416898,114.406274,116.123791,116.479038,119.591534,110.566812,111.851324,74.465162,79.993155,82.858046,91.345214,85.71485,98.969834,127.651377,129.532029,129.462275,130.209769,133.716214,134.731053,134.366834,135.103133,130.854579,131.32966,115.499125,117.530421,115.765224,116.734157,108.524336,110.601747,121.351282,124.612037,126.151954,127.332751,91.273562,95.604179,79.87318,82.935667,76.413314,78.336484,78.275229,79.993668,83.956612,85.725267,85.500637,89.346601,97.990127,98.94176,106.641956,108.599215,111.386259,111.810312,111.578597,111.803167,115.99273,117.010413,116.24461,116.675246,119.422198,119.909078,120.646056,121.38098,120.335038,120.662183,124.579855,125.773243,126.207803,126.774849,95.565331,102.037736,95.576121,96.158028,95.556699,97.799055,91.296205,93.348146,93.321994,94.690522,89.339313,90.540241,82.263039,82.882528,78.335615,80.023512,76.623947,78.352608,73.495149,74.48155,74.846872,76.479412,91.560058,94.871116,88.759515,89.235995,83.237883,83.965264,82.292123,83.246813,81.876477,83.253307,80.75212,81.463265,86.463409,88.267232,102.199623,104.225963,112.153727,116.823265,108.965663,113.021145,111.166575,117.972799];var ds=[22.548416,42.276971,17.227969,22.7346,41.292761,50.741667,30.365133,42.324913,21.701924,22.69335,42.4176,48.936335,21.429059,22.648399,50.650499,52.914825,42.20449,45.199078,21.13391,22.568612,21.441033,22.583349,23.73862,25.298628,22.00409,22.563095,38.97849,41.338631,40.287973,41.330108,39.732801,40.343252,40.966852,41.323446,40.719312,41.05937,44.869472,48.009884,41.336325,42.443362,42.008104,42.434713,45.873151,48.205746,45.132322,46.784582,45.133383,46.392803,45.148771,45.740273,47.478161,50.064393,42.216229,43.461282,37.014302,40.662281,42.219985,47.31417,27.726965,30.466651,48.911271,49.642488,48.831706,49.434487,46.941762,48.37425,47.651781,48.463782,42.851964,44.905396,47.598273,48.438467,48.409141,48.901651,42.22756,42.906402,52.821047,53.578094,50.701837,51.654278,42.292419,44.392214,42.295918,45.385017,34.680866,37.027803,30.743515,37.066586,28.245649,30.406053,47.270872,48.497371,25.238932,27.778469,42.215754,42.540416,43.427677,44.689208,44.685587,44.994131,48.878657,49.318659,49.281099,49.624515,50.710468,51.306809,52.90717,53.331981,52.903016,53.107959,52.900867,53.250033,51.638073,52.400678,42.229657,42.691928,43.061242,43.891083,42.663095,43.074222,44.37174,45.180155,44.375135,44.974219,47.3035,48.053221,45.352401,46.807875,40.563053,42.040289,40.581871,41.405172,38.516328,40.178756,35.790476,37.02337,26.825605,27.761303,27.197399,27.74932,29.147561,30.37813,29.570893,30.062042,30.045026,30.380952,29.998038,30.385203,48.487385,49.16832,22.395733,22.598229,7.441114,11.501436,3.767491,9.000793,12.642067,17.406563];var cd=[98.795985,122.960792,107.867379,118.093451,119.139658,128.035888,79.948212,99.029524,119.923388,122.094977,127.918527,130.94789,106.50606,108.076783,119.8329,126.382207,111.803567,119.324928,100.749858,102.227985,99.860885,100.788921,97.529435,98.841564,99.100017,99.90035,122.917416,123.774367,123.728314,125.507211,123.736065,124.767299,125.488463,126.410675,125.484326,126.07764,130.830784,133.620042,127.912178,128.668957,128.658937,129.638599,132.894179,134.119086,117.379378,119.244569,116.086736,117.431212,114.420233,116.137458,116.492775,119.605527,110.579401,111.86488,74.468228,80.001908,82.867432,91.353788,85.721075,98.976964,127.664757,129.546833,129.476893,130.22449,133.730358,134.745235,134.381034,135.1178,130.868117,131.34409,115.513245,117.544751,115.779271,116.748045,108.536254,110.614326,121.365534,124.626434,126.165992,127.347013,91.281869,95.611754,79.879648,82.945041,76.413314,78.345207,78.275229,80.002329,83.956612,85.734098,85.510186,89.356499,97.997001,98.948845,106.653208,108.610811,111.400183,111.824179,111.592224,111.817136,116.00682,117.024631,116.258574,116.689291,119.436876,119.922961,120.659806,121.395479,120.349116,120.676014,124.59389,125.787788,126.221756,126.788962,95.572955,102.046581,95.583772,96.165551,95.564318,97.806095,91.30446,93.356438,93.330319,94.698145,89.349129,90.548677,82.268802,82.892025,78.335615,80.032266,76.625755,78.361413,73.498248,74.490992,74.846872,76.488771,91.563521,94.878444,88.768214,89.244787,83.247076,83.974127,82.29595,83.256003,81.885315,83.26249,80.760619,81.472404,86.470983,88.276988,102.207537,104.234614,112.164795,116.833667,108.965663,113.032246,111.166575,117.983363];var cb=[22.551183,42.284787,17.227969,22.738314,41.300981,50.749638,30.368087,42.332701,21.705055,22.696452,42.426047,48.944674,21.432184,22.651387,50.657409,52.92296,42.212192,45.206905,21.137031,22.57186,21.444502,22.586566,23.741571,25.301472,22.006806,22.56637,38.985114,41.346531,40.295617,41.338581,39.740021,40.351012,40.974644,41.331562,40.726852,41.067192,44.877158,48.018285,41.344597,42.451798,42.016305,42.443235,45.880906,48.214001,45.140027,46.792775,45.141083,46.400433,45.156418,45.748281,47.485889,50.071879,42.223667,43.469487,37.019867,40.668675,42.226823,47.321605,27.72944,30.469853,48.919002,49.650614,48.840188,49.443166,46.949801,48.382798,47.660603,48.472692,42.859946,44.913298,47.605896,48.445914,48.41698,48.909667,42.23507,42.914193,52.8281,53.585952,50.709311,51.662219,42.29968,44.399225,42.302746,45.391958,34.680866,37.03377,30.743515,37.07228,28.245649,30.408935,47.277693,48.504255,25.241528,27.780726,42.223363,42.548418,43.435888,44.696952,44.693193,45.00187,48.886267,49.326755,49.288642,49.632304,50.717486,51.314369,52.914204,53.33964,52.910094,53.115926,52.908382,53.258095,51.64533,52.408305,42.236825,42.699126,43.068466,43.898632,42.670403,43.082219,44.379045,45.187742,44.382336,44.981379,47.310362,48.06019,45.359099,46.814439,40.569751,42.047741,40.587956,41.41263,38.519192,40.185033,35.790476,37.029005,26.825605,27.763896,27.199658,27.751649,29.150192,30.381073,29.573886,30.065162,30.047775,30.384089,30.001277,30.388525,48.494118,49.173841,22.398528,22.601198,7.441114,11.505968,3.767491,9.005209,12.642067,17.410886];var ae=95;var c8=[110.3961374,105.0743788,96.8991824,95.61810411,93.82412598,91.3892353,91.38931858,89.08325955,87.22469808,86.26278402,85.17353,85.23741211,82.86627441,81.90481038,79.59687147,80.39829237,79.93319363,77.80279948,75.2557704,73.49357829,73.1892532,73.87758816,74.4064738,74.10215224,75.46409695,76.77739692,78.28299615,78.15499485,78.37920654,78.89145345,79.69282199,81.19938178,81.80830295,83.89093424,85.94149523,87.86447266,89.03414958,90.05918132,91.10026937,92.15733832,93.74361735,95.82597331,97.95655545,97.12363037,98.2129739,99.2068571,101.6587874,102.5239084,102.2356106,105.0249238,106.0992342,107.8617093,111.6439372,109.591869,112.284586,117.7961157,118.9495128,114.2076584,118.693565,123.1475225,122.730705,120.9361393,123.4207441,122.3787782,122.1385425,121.5904281,121.1773763,120.6805404,120.2483355,122.795807,122.8759077,121.3060262,122.1392177,123.7418799,126.4177599,128.5647409,129.7194884,131.2259136,131.9950494,133.6289931,135.6168614,131.3875545,130.8743365,128.6303223,126.0997773,124.4015375,122.22161,119.6586483,119.7866827,118.5685878,116.5177976,114.819101,119.0812964,116.453265,111.7431171];var c6=[43.2190351,42.38053385,43.17417589,44.42226915,45.09863634,45.56708116,47.33599718,48.68832709,49.62448486,48.9482175,48.4800472,47.33564399,47.43948676,46.03452067,45.20221788,43.34563043,42.32965739,41.39690972,40.82972331,39.95567654,39.25892877,38.36098768,38.05441569,37.16878445,36.38899414,35.36126817,34.30953451,32.58503879,31.56975694,30.77800266,30.43559814,29.7744892,30.0931977,28.71103299,27.70739665,27.5775472,27.01096137,27.77857883,27.50707954,26.50328315,26.70387804,27.95548557,27.29428901,23.64685493,23.62310601,21.67493381,20.77751465,21.32070991,22.1824113,22.31232964,22.51316054,16.80037679,13.19749864,0.6939743381,1.541660428,10.50208252,15.58926975,17.89090007,19.94928467,22.18490153,25.37285292,25.61456434,30.62532552,31.08099284,31.89238173,32.50092692,32.80325765,34.25546956,35.15486138,36.90170139,37.8348272,37.941604,38.6480797,38.96797201,40.98146918,41.25573296,42.07218153,42.49132813,44.65259766,44.69330702,48.62286865,48.09383952,49.19628499,50.03402317,53.27678901,53.62976345,53.89420546,52.98933322,52.01872884,50.23210259,50.18807048,47.49769857,47.34362712,46.50502143,45.24770128];var eN=[98.7895,122.954182,107.860913,118.087007,119.133165,128.029533,79.941749,99.023087,119.916883,122.08841,127.912143,130.941471,106.499502,108.070244,119.826245,126.375818,111.797006,119.318387,100.743285,102.221517,99.854448,100.782445,97.522928,98.835028,99.093518,99.893783,122.910927,123.767769,123.721954,125.50077,123.729657,124.760724,125.481902,126.404079,125.477737,126.071019,130.824331,133.613395,127.905767,128.662524,128.652527,129.6321,132.887552,134.11249,117.37297,119.237999,116.080154,117.424589,114.413586,116.130948,116.486264,119.598927,110.5728,111.858437,74.465162,79.995337,82.860821,91.347291,85.716024,98.970481,127.658331,129.540202,129.470528,130.21808,133.723748,134.738785,134.374555,135.111443,130.861475,131.337438,115.506627,117.538123,115.772783,116.741632,108.529656,110.60782,121.358945,124.619773,126.159424,127.340582,91.275275,95.605228,79.874427,82.938601,76.413314,78.338763,78.275229,79.995765,83.956612,85.727511,85.503554,89.349858,97.990418,98.942257,106.646704,108.604437,111.393667,111.817723,111.585811,111.810645,116.000232,117.018216,116.252108,116.682705,119.430384,119.916417,120.653168,121.38883,120.342727,120.669383,124.587426,125.781376,126.215282,126.782323,95.566367,102.040026,95.577158,96.159009,95.557772,97.799728,91.298032,93.350057,93.323794,94.691771,89.342471,90.542019,82.264229,82.885485,78.335615,80.025844,76.623947,78.355027,73.495149,74.484473,74.846872,76.482208,91.560117,94.871859,88.761692,89.23822,83.240549,83.967602,82.292367,83.2495,81.878825,83.256003,80.75421,81.465955,86.465421,88.270356,102.201019,104.228033,112.158282,116.827153,108.965663,113.025767,111.166575,117.97687];var eM=[22.545421,42.279053,17.226272,22.731982,41.294917,50.743316,30.361986,42.326603,21.699185,22.690751,42.419757,48.938435,21.426505,22.64567,50.651745,52.916705,42.20641,45.201064,21.131326,22.565685,21.438288,22.580379,23.735785,25.295582,22.001087,22.560315,38.979333,41.340757,40.28938,41.332289,39.734164,40.344718,40.968803,41.325813,40.721073,41.061503,44.871533,48.012179,41.338366,42.445601,42.010343,42.436934,45.875217,48.208327,45.134237,46.786509,45.135376,46.394665,45.150734,45.742257,47.480099,50.065931,42.217982,43.46329,37.014057,40.662848,42.221079,47.315558,27.723432,30.46385,48.913298,49.644555,48.83396,49.436824,46.944059,48.376613,47.654503,48.466331,42.854333,44.907682,47.600253,48.440245,48.410926,48.903468,42.229292,42.908294,52.822466,53.58012,50.703491,51.656037,42.29378,44.393379,42.296912,45.385809,34.679282,37.027699,30.740622,37.066377,28.241967,30.403134,47.271949,48.49848,25.235818,27.774976,42.217425,42.542102,43.429763,44.691016,44.687044,44.995758,48.880431,49.320551,49.282865,49.626267,50.711607,51.308382,52.908547,53.333963,52.904419,53.109706,52.902338,53.251938,51.639701,52.402205,42.231045,42.693581,43.062756,43.892771,42.664519,43.075927,44.372942,45.1815,44.376327,44.975476,47.304623,48.054453,45.353174,46.808493,40.563653,42.041556,40.582164,41.4064,38.51618,40.179105,35.789745,37.023144,26.825402,27.757641,27.193806,27.745766,29.144229,30.375186,29.567889,30.059102,30.041938,30.378006,29.995047,30.382338,48.48834,49.169021,22.392816,22.595333,7.439914,11.500161,3.766676,9.000793,12.640512,17.406563];var fQ=3000;var g2=0.00002;var g1=0.000003;var i8=0.0174532925194;var hT=0.0065;var hS=0.006;var dO=40000;var fD=0;var js=1;var az=2;var ig=3;var fw=4;var hw=1e-10;var iR=6370996.81;var fW=100000000;function hF(T,kr,i,kq){var e=arguments.length;this.ll={};this.ru={};if(e===0){}else{if(e===4){this.normalize(T,kr,i,kq)}}}hF.prototype.contains=function(e){if(e.lng>this.ll.lng&&e.lng<this.ru.lng&&e.lat>this.ll.lat&&e.lat<this.ru.lat){return ig}if(Math.abs(e.lng-this.ll.lng)<hw||Math.abs(e.lng-this.ru.lng)<hw||Math.abs(e.lat-this.ll.lat)<hw||Math.abs(e.y-this.ru.lat)>hw){return az}return fD};hF.prototype.normalize=function(i,kq,e,T){if(i>e){this.ll.lng=e;this.ru.lng=i}else{this.ll.lng=i;this.ru.lng=e}if(kq>T){this.ll.lat=T;this.ru.lat=kq}else{this.ll.lat=kq;this.ru.lat=T}};function eE(i,kq,e,T){this.sp={lng:i,lat:kq};this.ep={lng:e,lat:T};this.mbr=new hF(i,kq,e,T)}function ir(kq,e,ks,kr){for(var T=0;T<kr;T=T+2){if(kq.lng>=e[T]&&kq.lng<=e[T+1]&&kq.lat>=ks[T]&&kq.lat<=ks[T+1]){return true}}return false}function gu(kv){var i=kv.lng;var ku=kv.lat;var kq=Math.sqrt(i*i+ku*ku);var ks=Math.atan2(ku,i);var T=kq+gF(ku);var kr=ks+gE(i);var e=T*Math.cos(kr);var kt=T*Math.sin(kr);return{lng:e+hT,lat:kt+hS}}function a3(kv){var i=kv.lng-hT;var ku=kv.lat-hS;var kq=Math.sqrt(i*i+ku*ku);var ks=Math.atan2(ku,i);var T=kq-gF(ku);var kr=ks-gE(i);var e=T*Math.cos(kr);var kt=T*Math.sin(kr);return{lng:e,lat:kt}}function gF(e){return Math.sin(e*fQ*i8)*g2}function gE(e){return Math.cos(e*fQ*i8)*g1}function at(T,i,e){return((i.lng-T.lng)*(e.lat-T.lat)-(e.lng-T.lng)*(i.lat-T.lat))}function hY(i,e){return Math.abs(i-e)<=hw}function gM(kq,T){var i=kq.lat*i8;var kv=kq.lng*i8;var e=T.lat*i8;var ku=T.lng*i8;var ks=Math.cos(i)*Math.cos(e);var kr=Math.cos(kv)*Math.cos(ku);var kx=Math.sin(i)*Math.sin(e);var kw=Math.sin(kv)*Math.sin(ku);var ky=ks*kr+ks*kw+kx;if(ky<-1){ky=-1}else{if(ky>1){ky=1}}var kt=Math.acos(ky)*iR;return kt}function h(ku,kt){var i=ku.lat*i8;var e=kt.lat*i8;var kq=ku.lng*i8;var T=kt.lng*i8;var ks=i-e;var kr=kq-T;var kv=Math.sin(ks/2)*Math.sin(ks/2)+Math.cos(i)*Math.cos(e)*Math.sin(kr/2)*Math.sin(kr/2);return 2*Math.asin(Math.sqrt(kv))*iR}function gK(kv,T){var kx=bF(kv,T);var kw=180;var ku=90;var kt=-180;var kr=-90;var ks=T.sp;var kq=T.ep;kw=ks.lng<kq.lng?ks.lng:kq.lng;ku=ks.lat<kq.lat?ks.lat:kq.lat;kt=ks.lng<kq.lng?ks.lng:kq.lng;kr=ks.lat<kq.lat?ks.lat:kq.lat;if(kx.lng<=kt&&kx.lng>=kw&&kx.lng<=kr&&kx.lat>=ku){return gM(kv,kx)}else{var i=h(kv,T.sp);var e=h(kv,T.ep);return i<e?i:e}}function a4(i,e){}function bJ(i,kq,e,T){return Math.sqrt((i-e)*(i-e)+(kq-T)*(kq-T))}function bF(kB,kt){var ks=kB.lng;var kA=kB.lat;var kr=kt.sp.lng;var kz=kt.sp.lat;var T=kt.ep.lng;var kx=kt.ep.lat;var ky=kx-kz;var kw=kr-T;if(hY(ky,0)&&hY(kw,0)){return kt.sp}var kv=T*kz-kr*kx;var ku=kw*ks-ky*kA;var e=ky*ky-kw*kw;var kq=kw*ku-ky*kv;var i=ky*ku+kw*kv;return{lng:kq/e,lat:-i/e}}function bN(kq){var T=0;for(var e=0;e<ae;++e){if(c6[e]<=kq.lat){if(c6[(e+1)%ae]>kq.lat){if(at({lng:c8[e],lat:c6[e]},{lng:c8[(e+1)%ae],lat:c6[(e+1)%ae]},kq)>0){++T}}}else{if(c6[(e+1)%ae]<=kq.lat){if(at({lng:c8[e],lat:c6[e]},{lng:c8[(e+1)%ae],lat:c6[(e+1)%ae]},kq)<0){--T}}}}return T===0?fD:ig}function j5(kq){var kt={};if(kq.lng<e5[0]-0.4||kq.lat<e5[1]-0.4||kq.lng>e5[2]+0.4||kq.lat>e5[3]+0.4){kt.lng=kq.lng;kt.lat=kq.lat;return kt}else{if(ir(kq,eN,eM,iL)){kt=gu(kq);return kt}}var e=0;var kw=dO;var T=0;var ku=new hF();var kv=1;if(bN(kq)===fD){for(var ks=0;ks<ae;++ks){var kr=new eE(c8[ks],c6[ks],c8[(ks+1)%ae],c6[(ks+1)%ae]);ku.ll.lng=kr.mbr.ll.lng-0.5;ku.ll.lat=kr.mbr.ll.lat-0.5;ku.ru.lng=kr.mbr.ru.lng+0.5;ku.ru.lat=kr.mbr.ru.lat+0.5;if(ku.contains(kq)===fD){continue}T=gK(kq,kr);if(T<kw){kw=T}}if(kw<dO){e=(dO-kw)/dO;kv=2}}else{kv=3;e=1}var kx=gu(kq);kt={lng:kq.lng+(kx.lng-kq.lng)*e,lat:kq.lat+(kx.lat-kq.lat)*e};return kt}function e7(i){var T={};if(i.lng<t[0]-0.4||i.lat<t[1]-0.4||i.lng>t[2]+0.4||i.lat>t[3]+0.4){T.lng=i.lng;T.lat=i.lat;return T}else{if(ir(i,cd,cb,iL)){T=a3(i);return T}}var e=j5(i);if(i.lng===e.lng&&i.lat===e.lng){T.lng=i.lng;T.lat=i.lat;return T}return decryptPt1(i,j5)}function iI(i,e){if(e===3&&i instanceof cD){var T=j5(i);return new cD(T.lng,T.lat)}else{return i}}function eP(i,e){if(e===3&&i instanceof cD){var T=e7(i);return new cD(T.lng,T.lat)}else{if(e===5&&i instanceof cD){return new cD(i.lng,i.lat)}else{return i}}}function o(ks){if(!ks){ks={}}var kt=JSON.stringify(ks);var kr=0,T,kq,e;if(kt.length===0){return kr}for(T=0,e=kt.length;T<e;T++){kq=kt.charCodeAt(T);kr=((kr<<5)-kr)+kq;kr|=0}return kr}function c9(){var i=new Date().getTime();var e="xxxyxxxy".replace(/[xy]/g,function(kq){var T=(i+Math.random()*16)%16|0;i=Math.floor(i/16);return(kq=="x"?T:(T&3|8)).toString(16)});return e}function bf(e,i){return Math.atan2(i,e)*180/Math.PI}function dq(kt,T,i){var e=[],ks=[];e[0]=kt[0]-T[0];e[1]=kt[1]-T[1];ks[0]=i[0]-T[0];ks[1]=i[1]-T[1];var kr=e[0]*ks[0]+e[1]*ks[1];var kq=Math.sqrt((e[0]*e[0])+(e[1]*e[1]))*Math.sqrt(ks[0]*ks[0])+Math.sqrt(ks[1]*ks[1]);return Math.acos(kr/kq)/Math.PI*180}function gY(ku,T,i){var e=[],kt=[];e[0]=ku[0]-T[0];e[1]=ku[1]-T[1];kt[0]=i[0]-T[0];kt[1]=i[1]-T[1];var kr=e[0]*kt[1]-e[1]*kt[0];var ks=e[0]*kt[0]+e[1]*kt[1];var kq=Math.atan2(kr,ks);return kq*180/Math.PI}var b6=0;function gd(){return b6++}function bm(i,ks){var T=i.toLowerCase();var kq=T.lastIndexOf("?");var e=T.lastIndexOf("#");var kr=Math.max(kq,e);if(kr===-1){return i+"?"+ks}return i+"&"+ks}function aZ(i,e,T,kq){return(i||0)<<24|(e||0)<<16|(T||0)<<8|(kq||0)}function jA(){var T=function(kE,kD){var kC={"\x6c\x78\x61\x78\x78":"\x78\x65\x61","\x61\x65\x65\x6d\x78":"\x61\x65\x61\x69","\x64\x64\x61\x78\x6d":function(kM,kL){return kM(kL)},"\x68\x6d\x61\x65\x61":"\x64\x61\x65","\x78\x65\x64\x65\x63":"\x6d\x64\x61","\x63\x61\x61\x78\x61":function(kM,kL){return kM+kL},"\x63\x61\x61\x68\x69":function(kM,kL){return kM(kL)},"\x6c\x61\x65\x78\x6d":function(kN,kM,kL){return kN(kM,kL)},"\x78\x69\x61\x61\x63":function(kL,kM){return kL(kM)},"\x65\x6d\x6c\x69\x65":function(kM,kL){return kM(kL)},"\x68\x6c\x65\x61\x61":function(kM,kL){return kM+kL},"\x64\x63\x61\x61\x68":function(kM,kL){return kM(kL)},"\x69\x61\x6d\x6c\x6d":function(kM,kL){return kM<kL}};var kB="\x31\x2e\x31\x2e\x32";function kA(kN,kM){var kL=kC["\x6c\x78\x61\x78\x78"];while(kL!==kC["\x61\x65\x65\x6d\x78"]){switch(kL){case"\x61\x69\x6c":return kO;case"\x6d\x64\x61":for(var kR=0;kR<kP;kR++){var kQ=kC["\x64\x64\x61\x78\x6d"](kM,kN[kR]);kO["\x70\x75\x73\x68"](kQ)}kL="\x61\x69\x6c";break;case"\x78\x65\x61":var kP=kN["\x6c\x65\x6e\x67\x74\x68"];kL=kC["\x68\x6d\x61\x65\x61"];break;case kC["\x68\x6d\x61\x65\x61"]:var kO=[];kL=kC["\x78\x65\x64\x65\x63"];break}}}var kz,ky,kx,kw,kv,ku=decodeURIComponent,kt="\x43\x68\x61\x72",ks="";var kr=[T];kz="\x64\x65";ky="\x66\x72";kx="\x6f";kv=kC["\x63\x61\x61\x78\x61"](ky+kx,"\x6d");kw=kC["\x68\x6c\x65\x61\x61"]("\x43\x6f",kz);var kq=function(kL){return kC["\x63\x61\x61\x78\x61"](kL,ks)["\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72"][kv+kt+kw](kL)};var kK=function(kL){var kM={"\x65\x61\x6c\x68\x69":function(kO,kN){return kC["\x63\x61\x61\x68\x69"](kO,kN)}};return kC["\x6c\x61\x65\x78\x6d"](kA,kL,function(kN){return kM["\x65\x61\x6c\x68\x69"](kq,kN)})};var kG=kK["\x63\x61\x6c\x6c"](kq,[39,34,37,96,60,120,97,65,98,66,99,67,100,68,101,69,102,70,103,110,109,111,112,48,49,50,51,52,53,54,55,56,57]);var kF=kA([28782,27702,26416,25167,24183],function(kL){return kC["\x78\x69\x61\x61\x63"](ku,kL)});var kJ=kK["\x63\x61\x6c\x6c"](kF,[22354,22749,24415,23346,22257,22688,24306,25174,23595,25547,22984,25690,22212,27547,21594,27210,23090,29193,22394,29368,29532,29459,29530,24146,24500,26352,27441,28788,29370,27673,26925,25249,24430]),kI={};kF=kC["\x64\x63\x61\x61\x68"](kK,kF);var kH=new RegExp(kF["\x6a\x6f\x69\x6e"]("\x7c"));for(var kz=0;kC["\x69\x61\x6d\x6c\x6d"](kz,kG["\x6c\x65\x6e\x67\x74\x68"]);kz++){kI[kJ[kz]]=kG[kz]}kD=kC["\x6c\x61\x65\x78\x6d"](kA,kD["\x73\x70\x6c\x69\x74"](ks),function(kL){return kI[kL]||kL})["\x6a\x6f\x69\x6e"](ks);return kA(kD["\x73\x70\x6c\x69\x74"](kH),function(kL){return kC["\x65\x6d\x6c\x69\x65"](ku,kL)})}(this,"\x6c\u545a\u72b8\u577a\x74\x68\u624f\u545a\u735c\u5ef2\u735c\u545a\u6c36\x69\u5ef2\u545a\u545a\u58a0\u5e77\u56c4\u58a0\u59c8\x6c\x69\u6c36\u545a\u56c4\u58a0\u59c8\u545a\u6c36\u56c4\u56c4\u545a\u545a\u59c8\u5e77\x73\x75\u5c2b\x73\x74\x72\u624f\u59c8\u58a0\u56c4\u5ef2\u735c\u624f\x69\u72b8\u56c4\u545a\u58a0\x4f\u5a32\u6c36\x68\u58a0\u545a\u545a\u735c\u5e77\u58a0\x6c\u545a\x6c\x6c\u5e77\x68\u5ef2\u5ef2\u6c36\u735c\u545a\u735c\u6730\x48\u5e52\u6256\u5f6e\x50\u62a1\x50\u692d\x59\u6c19\u6256\u63cb\x51\x4f\u5e52\u706e\u59c8\x69\x6c\u6c36\x6c\u58a0\u59c8\u706e\u545a\u5ef2\u5ef2\u624f\u7209\u72ba\x4c\u66f0\x4f\u6c19\x52\u6c19\u6256\u6b9b\u62a1\u5f6e\u5f6e\u5e52\x4f\u5e77\u56c4\x6c\u545a\u56c4\x69\u6730\u59c8\u545a\u545a\u545a\u706e\u545a\u58a0\x6c\u5ef2\u735c\u6730\u5f5f\u66f0\u6c19\x73\x69\u577a\u72b8\u5f5f\u6b31\u6b9b\u6730\x73\x75\u5c2b\x73\x74\x72\x69\u72b8\u577a\u706e\u5ef2\u58a0\u545a\x6c\u56c4");(function(ks,kr){var kq=function(kt){while(--kt){ks.push(ks.shift())}};kq(++kr)}(T,491));var i=function(ks,kr){ks=ks-0;var kq=T[ks];return kq};function e(kv){var ku={"\x64\x6c\x65\x64\x69":function(ky,kx){return ky!==kx},"\x65\x78\x6c\x61\x6d":i("0x0"),"\x61\x78\x65\x6c\x64":function(kx,ky){return kx-ky},"\x65\x6d\x61\x6d\x65":i("0x1"),"\x69\x61\x65\x65\x78":i("0x2"),"\x64\x78\x63\x6c\x69":i("0x3"),"\x65\x64\x78\x63\x65":i("0x4"),"\x64\x68\x63\x6d\x68":function(ky,kx){return ky(kx)},"\x64\x64\x65\x65\x63":function(ky,kx){return ky(kx)},"\x63\x78\x64\x61\x6d":function(ky,kx){return ky+kx},"\x68\x78\x65\x65\x6d":i("0x5"),"\x78\x6c\x65\x6c\x6c":i("0x6")};var kt=i("0x5");while(ku[i("0x7")](kt,i("0x8"))){switch(kt){case ku[i("0x9")]:return i("0xa")+kr[i("0xb")](ku[i("0xc")](kr[i("0xd")],12));case ku[i("0xe")]:var ks=ku[i("0xf")];kt=ku[i("0x10")];break;case ku[i("0x11")]:var kr=ku["\x64\x68\x63\x6d\x68"](md5,ku[i("0x12")](md5,kq+kw)+ks);kt=ku[i("0x9")];break;case ku[i("0x10")]:var kq=kv[i("0x13")](ku[i("0x14")](kv[i("0x15")]("\x3f"),1));kt=i("0x4");break;case ku[i("0x16")]:var kw=ku[i("0x17")];kt=ku["\x65\x6d\x61\x6d\x65"];break}}}return e}function he(){}e6.extend(he,{Request:{INITIAL:-1,WAITING:0,LOADED:1,COMPLETED:2},Dependency:{poly:["marker"],layer:["poly"],hotspot:["poly"],infowindow:["marker","hotspot"],simpleInfowindow:["marker"],tools:["marker","poly"],mapgl:["glcommon","poly"],earth:["glcommon"],control:["scommon"],scommon:[],localSearch:["scommon"],otherSearch:["scommon"],route:["scommon"],buslineSearch:["route"],autocomplete:["scommon"],mvtParse:["marker","poly","style"]},MD5Mapping:{control:"t2yo50",marker:"kucw0s",poly:"y4gtut",layer:"$layer$",infowindow:"i51mhv",simpleInfowindow:"o30w3k",hotspot:"zdmhw2",menu:"ihfjfy",tools:"ueqhki",oppc:"r5ubk5",oppcgl:"jjacjs",mapgl:"ix3ndl",markeranimation:"owb1qj",earth:"cbxxg4",glcommon:"zmc4l0",localSearch:"tewdul",scommon:"djzudb",otherSearch:"02evri",route:"gpvd40",buslineSearch:"loosfp",autocomplete:"v4tde5",style:"41gcah",mvtParse:"z45osg"},Config:{baseUrl:C.apiHost+"/getmodules?v=1.0&type=webgl",jsModPath:(aJ.inMapHost?"":C.mapHost)+"/res/newui/",timeout:5000},delayFlag:false,Module:{modules:{},modulesNeedToLoad:[]},_getMd5ModsStr:function(ks){var kr=[];for(var ku=0,T=ks.length;ku<T;ku++){var kt=ks[ku];var e=this.MD5Mapping[kt];var kq="$"+kt+"$";if(e!==kq){kr.push(kt+"_"+e)}}return kr.join(",")},load:function(i,ks,kq){var e=this.getModuleInfo(i);if(e.status===this.Request.COMPLETED){if(kq===true){ks()}}else{if(e.status===this.Request.INITIAL){this.combine(i);this.addToLoadQueue(i);var T=this;if(T.delayFlag===false){T.delayFlag=true;setTimeout(function(){var kt=T.Config.baseUrl+"&mod="+T._getMd5ModsStr(T.Module.modulesNeedToLoad);gX.load(kt);T.Module.modulesNeedToLoad.length=0;T.delayFlag=false},1)}e.status=this.Request.WAITING;function kr(kv){var ku=T.getModuleInfo(i);if(ku.status!==T.Request.COMPLETED){if(window.map){var kt=new fS("onmod_timeout");kt.timeout=kv/1000;kt.moduleName=i;window.map.fire(kt)}}}setTimeout(kr,this.Config.timeout,this.Config.timeout);setTimeout(kr,this.Config.timeout*2,this.Config.timeout*2)}if(ks){e.callbacks.push(ks)}}},combine:function(e){if(e&&this.Dependency[e]){var kq=this.Dependency[e];for(var T=0;T<kq.length;T++){this.combine(kq[T]);if(!this.Module.modules[kq[T]]){this.addToLoadQueue(kq[T])}}}},addToLoadQueue:function(e){var i=this.getModuleInfo(e);if(i.status===this.Request.INITIAL){i.status=this.Request.WAITING;this.Module.modulesNeedToLoad.push(e)}},run:function(T,kq){var ku=this.getModuleInfo(T);var kx=this.Dependency[T];if(kx){for(var ks=0;ks<kx.length;ks++){var kt=this.getModuleInfo(kx[ks]);if(kt.status!==this.Request.COMPLETED){kt.modsNeedToRun.push({name:T,code:kq});return}}}try{eval(kq)}catch(kv){return}ku.status=this.Request.COMPLETED;for(var ks=0,kr=ku.callbacks.length;ks<kr;ks++){ku.callbacks[ks]()}ku.callbacks.length=0;for(ks=0;ks<ku.modsNeedToRun.length;ks++){var kw=ku.modsNeedToRun[ks];this.run(kw.name,kw.code)}ku.modsNeedToRun.length=0},getModuleInfo:function(i){var e;if(!this.Module.modules[i]){this.Module.modules[i]={status:this.Request.INITIAL,callbacks:[],modsNeedToRun:[]}}e=this.Module.modules[i];return e}});window._jsload=function(kr,ks){var i=he.getModuleInfo(kr);i.status=he.Request.LOADED;if(ks!==""){he.run(kr,ks)}else{if(window.map){var e=new fS("ongetmodules_fail");e.moduleName=kr;window.map.fire(e)}var T=document.createElement("script");var kq=he.MD5Mapping[kr];T.src=he.Config.jsModPath+kr+"_"+kq+".js";document.getElementsByTagName("head")[0].appendChild(T)}};function c4(){this._timeData={}}var bB;if(typeof window!=="undefined"){bB=window}else{bB=self}c4.prototype.mark=function(e){this._timeData[e]=this._getTime()};c4.prototype.getMark=function(e){return this._timeData[e]};c4.prototype.getTime=function(i,e){return parseFloat((this._timeData[e]-this._timeData[i]).toFixed(2))};c4.prototype.print=function(){};c4.prototype.clear=function(){this._timeData={}};if(bB.performance&&bB.performance.now){c4.prototype._getTime=function(){return performance.now()}}else{c4.prototype._getTime=function(){return Date.now()}}!function(i,T){T(i.d3=i.d3||{})}(window,function(k3){function ll(ls,lt,T,lr){function e(i){return ls(i=new Date(+i)),i}return e.floor=e,e.ceil=function(i){return ls(i=new Date(i-1)),lt(i,1),ls(i),i},e.round=function(i){var lu=e(i),lv=e.ceil(i);return lv-i>i-lu?lu:lv},e.offset=function(i,lu){return lt(i=new Date(+i),null==lu?1:Math.floor(lu)),i},e.range=function(lv,i,lu){var lw=[];if(lv=e.ceil(lv),lu=null==lu?1:Math.floor(lu),!(i>lv&&lu>0)){return lw}do{lw.push(new Date(+lv))}while(lt(lv,lu),ls(lv),i>lv);return lw},e.filter=function(i){return ll(function(lu){for(;ls(lu),!i(lu);){lu.setTime(lu-1)}},function(lu,lv){for(;--lv>=0;){for(;lt(lu,1),!i(lu);){}}})},T&&(e.count=function(i,lu){return k5.setTime(+i),k9.setTime(+lu),ls(k5),ls(k9),Math.floor(T(k5,k9))},e.every=function(i){return i=Math.floor(i),isFinite(i)&&i>0?i>1?e.filter(lr?function(lu){return lr(lu)%i===0}:function(lu){return e.count(0,lu)%i===0}):e:null}),e}function la(e){return ll(function(i){i.setDate(i.getDate()-(i.getDay()+7-e)%7),i.setHours(0,0,0,0)},function(i,T){i.setDate(i.getDate()+7*T)},function(i,T){return(T-i-(T.getTimezoneOffset()-i.getTimezoneOffset())*k4)/li})}function k2(e){return ll(function(i){i.setUTCDate(i.getUTCDate()-(i.getUTCDay()+7-e)%7),i.setUTCHours(0,0,0,0)},function(i,T){i.setUTCDate(i.getUTCDate()+7*T)},function(i,T){return(T-i)/li})}var k5=new Date,k9=new Date,lg=ll(function(){},function(i,T){i.setTime(+i+T)},function(i,T){return T-i});lg.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?ll(function(i){i.setTime(Math.floor(i/e)*e)},function(i,T){i.setTime(+i+T*e)},function(i,T){return(T-i)/e}):lg:null};var lp=lg.range,ln=1000,k4=60000,lk=3600000,lc=86400000,li=604800000,kw=ll(function(e){e.setTime(Math.floor(e/ln)*ln)},function(i,T){i.setTime(+i+T*ln)},function(i,T){return(T-i)/ln},function(e){return e.getUTCSeconds()}),lm=kw.range,lb=ll(function(e){e.setTime(Math.floor(e/k4)*k4)},function(i,T){i.setTime(+i+T*k4)},function(i,T){return(T-i)/k4},function(e){return e.getMinutes()}),kE=lb.range,kY=ll(function(i){var T=i.getTimezoneOffset()*k4%lk;0>T&&(T+=lk),i.setTime(Math.floor((+i-T)/lk)*lk+T)},function(i,T){i.setTime(+i+T*lk)},function(i,T){return(T-i)/lk},function(e){return e.getHours()}),lh=kY.range,kO=ll(function(e){e.setHours(0,0,0,0)},function(i,T){i.setDate(i.getDate()+T)},function(i,T){return(T-i-(T.getTimezoneOffset()-i.getTimezoneOffset())*k4)/lc},function(e){return e.getDate()-1}),kv=kO.range,kL=la(0),kN=la(1),kr=la(2),kJ=la(3),ky=la(4),k1=la(5),k8=la(6),kt=kL.range,k0=kN.range,kC=kr.range,kX=kJ.range,ld=ky.range,kZ=k1.range,lo=k8.range,lf=ll(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(i,T){i.setMonth(i.getMonth()+T)},function(i,T){return T.getMonth()-i.getMonth()+12*(T.getFullYear()-i.getFullYear())},function(e){return e.getMonth()}),lq=lf.range,kI=ll(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(i,T){i.setFullYear(i.getFullYear()+T)},function(i,T){return T.getFullYear()-i.getFullYear()},function(e){return e.getFullYear()});kI.every=function(e){return isFinite(e=Math.floor(e))&&e>0?ll(function(i){i.setFullYear(Math.floor(i.getFullYear()/e)*e),i.setMonth(0,1),i.setHours(0,0,0,0)},function(i,T){i.setFullYear(i.getFullYear()+T*e)}):null};var kB=kI.range,k6=ll(function(e){e.setUTCSeconds(0,0)},function(i,T){i.setTime(+i+T*k4)},function(i,T){return(T-i)/k4},function(e){return e.getUTCMinutes()}),kQ=k6.range,kP=ll(function(e){e.setUTCMinutes(0,0,0)},function(i,T){i.setTime(+i+T*lk)},function(i,T){return(T-i)/lk},function(e){return e.getUTCHours()}),kM=kP.range,kK=ll(function(e){e.setUTCHours(0,0,0,0)},function(i,T){i.setUTCDate(i.getUTCDate()+T)},function(i,T){return(T-i)/lc},function(e){return e.getUTCDate()-1}),kH=kK.range,kG=k2(0),kF=k2(1),kD=k2(2),kA=k2(3),kz=k2(4),ku=k2(5),ks=k2(6),kq=kG.range,kW=kF.range,lj=kD.range,k7=kA.range,le=kz.range,kV=ku.range,kU=ks.range,kT=ll(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(i,T){i.setUTCMonth(i.getUTCMonth()+T)},function(i,T){return T.getUTCMonth()-i.getUTCMonth()+12*(T.getUTCFullYear()-i.getUTCFullYear())},function(e){return e.getUTCMonth()}),kS=kT.range,kx=ll(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(i,T){i.setUTCFullYear(i.getUTCFullYear()+T)},function(i,T){return T.getUTCFullYear()-i.getUTCFullYear()},function(e){return e.getUTCFullYear()});kx.every=function(e){return isFinite(e=Math.floor(e))&&e>0?ll(function(i){i.setUTCFullYear(Math.floor(i.getUTCFullYear()/e)*e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)},function(i,T){i.setUTCFullYear(i.getUTCFullYear()+T*e)}):null};var kR=kx.range;k3.timeInterval=ll,k3.timeMillisecond=lg,k3.timeMilliseconds=lp,k3.utcMillisecond=lg,k3.utcMilliseconds=lp,k3.timeSecond=kw,k3.timeSeconds=lm,k3.utcSecond=kw,k3.utcSeconds=lm,k3.timeMinute=lb,k3.timeMinutes=kE,k3.timeHour=kY,k3.timeHours=lh,k3.timeDay=kO,k3.timeDays=kv,k3.timeWeek=kL,k3.timeWeeks=kt,k3.timeSunday=kL,k3.timeSundays=kt,k3.timeMonday=kN,k3.timeMondays=k0,k3.timeTuesday=kr,k3.timeTuesdays=kC,k3.timeWednesday=kJ,k3.timeWednesdays=kX,k3.timeThursday=ky,k3.timeThursdays=ld,k3.timeFriday=k1,k3.timeFridays=kZ,k3.timeSaturday=k8,k3.timeSaturdays=lo,k3.timeMonth=lf,k3.timeMonths=lq,k3.timeYear=kI,k3.timeYears=kB,k3.utcMinute=k6,k3.utcMinutes=kQ,k3.utcHour=kP,k3.utcHours=kM,k3.utcDay=kK,k3.utcDays=kH,k3.utcWeek=kG,k3.utcWeeks=kq,k3.utcSunday=kG,k3.utcSundays=kq,k3.utcMonday=kF,k3.utcMondays=kW,k3.utcTuesday=kD,k3.utcTuesdays=lj,k3.utcWednesday=kA,k3.utcWednesdays=k7,k3.utcThursday=kz,k3.utcThursdays=le,k3.utcFriday=ku,k3.utcFridays=kV,k3.utcSaturday=ks,k3.utcSaturdays=kU,k3.utcMonth=kT,k3.utcMonths=kS,k3.utcYear=kx,k3.utcYears=kR,Object.defineProperty(k3,"__esModule",{value:!0})});function fg(e){this._elemType=e;this._objCollection={}}fg.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=b3(this._elemType);e=bD.getGUID("obj_pool_");this._objCollection[e]=i;return i};fg.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}};fg.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 ij={get:function(i,kr,e,T){var kq=new XMLHttpRequest();kq.open("GET",i,true);kq.timeout=10000;kq.ontimeout=function(){T&&T()};kq.onreadystatechange=function(ks){if(this.readyState===4){if(this.status===200){kr&&kr(kq.responseText)}else{e&&e()}}};kq.send()},post:function(i,ks,kr,e,T){var kq=new XMLHttpRequest();kq.open("POST",i,true);kq.setRequestHeader("Content-type","application/x-www-form-urlencoded");kq.timeout=10000;kq.ontimeout=function(){T&&T()};kq.onreadystatechange=function(kt){if(this.readyState===4){if(this.status===200){kr&&kr(kq.responseText,ks)}else{e&&e()}}};kq.send(ks);return kq}};var gX=(function(e){function i(ks,T,kr){if(ks.indexOf("v=")===-1){ks+="&v=gl"}var kq=b3("script",{src:ks,type:"text/javascript",charset:"utf-8"});if(kq.addEventListener){kq.addEventListener("load",function(ku){var kt=ku.target;kt.parentNode.removeChild(kt);T&&T()},false);kq.addEventListener("error",function(ku){if(ku){var kt=ku.target;kt&&kt.parentNode&&kt.parentNode.removeChild(kt)}kr&&kr(null)},false)}else{if(kq.attachEvent){kq.attachEvent("onreadystatechange",function(ku){var kt=window.event.srcElement;if(kt&&(kt.readyState==="loaded"||kt.readyState==="complete")){kt.parentNode.removeChild(kt)}T&&T()})}}e.getElementsByTagName("head")[0].appendChild(kq)}return{load:function(kt,T,kq){if(typeof kt==="string"){i(kt,T,kq)}else{if(kt.length>0){var ks=kt.length;for(var kr=0;kr<ks;kr++){i(kt[kr],function(){ks--;if(ks===0&&T){T()}})}}}}}})(window.document);function ic(){}ic.instances={};ic.getInstance=function(i,T){if(ic.instances[i]){return ic.instances[i]}var e=new kl(i,T);ic.instances[i]=e;return e};function kl(e,i){this._name=e;this._baseZoom=18;this._opts={tileSize:256};e6.extend(this._opts,i||{})}kl.mapZoomBaseIndex=[8,8,8,8,7,7,6,6,5,5,4,3,3,3,2,2,1,1,0,0,0,0,0,0,0,0];kl.baseScaleZoom=[19,17,15,12,10,9,7,5,3];kl.baseScaleZoomMercatorSize=[512,2048,4096,32768,65536,262144,1048576,4194304,8388608];kl.mapZoomBaseZoomMapping=[3,3,3,3,5,5,7,7,9,9,10,12,12,12,15,15,17,17,19,19,19,19,19,19,19,19];kl.mapZoomStartZoomMapping=[3,3,3,3,4,4,6,6,8,8,10,11,11,11,14,14,16,16,18,18,18,18,18,18,18,18];kl.baseScaleTileSize=[1024,1024,512,512,256,512,512,512,256];kl.mapZoomTileSize=[256,256,256,256,256,512,256,512,256,512,256,256,512,1024,256,512,512,1024,512,1024,2048,4096,4096*2,4096*2*2,4096*2*2*2,4096*2*2*2*2];kl.baseZoomInfo={"3":[3],"5":[4,5],"7":[6,7],"9":[8,9],"10":[10],"12":[11,12,13],"15":[14,15],"17":[16,17],"19":[18,19,20,21,22,23,24,25]};kl.prototype={getName:function(){return this._name},getTileSize:function(e){e=Math.floor(e);if(e<3){e=3}if(this._name==="na"){return kl.mapZoomTileSize[e]}return this._opts.tileSize},getBaseTileSize:function(i){i=Math.floor(i);if(this._name==="na"){var e=kl.mapZoomBaseZoomMapping[i];return kl.mapZoomTileSize[e]}return this._opts.tileSize},getDataZoom:function(e){e=Math.floor(e);if(this._name==="na"){return kl.mapZoomBaseZoomMapping[e]}return e},getZoomUnits:function(e){return Math.pow(2,(this._baseZoom-e))},getMercatorSize:function(T,i){if(this._name==="na"){T=Math.floor(T);var e=kl.mapZoomBaseIndex[T];return kl.baseScaleZoomMercatorSize[e]}return this._opts.tileSize*this.getZoomUnits(i)},getBaseZoom:function(){return this._baseZoom},getParentTile:function(kq,kw,kv,T,i){if(this._name==="na"){var kr=kl.baseZoomInfo[kv];T--;if(kr.indexOf(T)>-1){return{col:kq,row:kw,zoom:kv,useZoom:T}}else{var kt=kl.mapZoomBaseIndex[kv];var ks=kl.baseScaleZoom[kt+1];if(!ks){return null}var ku=this.getFactorByZooms(ks,kv);var e=kl.baseZoomInfo[ks];return{col:Math.floor(kq/ku),row:Math.floor(kw/ku),zoom:ks,useZoom:e[e.length-1]}}return null}if(kv-1<i){return null}return{col:Math.floor(kq/2),row:Math.floor(kw/2),zoom:kv-1,useZoom:kv-1}},getChildTiles:function(kr,kt,e,T,kA,kG){if(this._name==="na"){var kq=kl.baseZoomInfo[e];T+=kG;if(kq.indexOf(T)>-1){return[{col:kr,row:kt,zoom:e,useZoom:T}]}else{var kE=0;var kB=e;while(kE<kG){var kF=kl.mapZoomBaseIndex[kB];var kv=kl.baseScaleZoom[kF-1];if(!kv){return null}var kw=kl.baseZoomInfo[kv];if(kw[kG-1]){var kx=[];var kz=this.getFactorByZooms(e,kv);var i=kr*kz;var ky=kt*kz;for(var kD=0;kD<kz;kD++){var ks=i+kD;for(var kC=0;kC<kz;kC++){var ku=ky+kC;kx.push({col:ks,row:ku,zoom:kv,useZoom:kw[kG-1]})}}return kx}kE+=kw.length;if(kG===kw.length){kB=kv}}}return null}var kx=[];if(e+kG>kA){return null}var kz=Math.pow(2,kG);var i=kr*kz;var ky=kt*kz;var kv=e+kG;var kx=[];for(var kD=0;kD<2;kD++){var ks=i+kD;for(var kC=0;kC<2;kC++){var ku=ky+kC;kx.push({col:ks,row:ku,zoom:kv,useZoom:kv})}}return kx},getFactorByZooms:function(i,kq){var T=kl.mapZoomBaseIndex[i];var kr=kl.mapZoomBaseIndex[kq];var e=kl.baseScaleZoomMercatorSize[T];var ks=kl.baseScaleZoomMercatorSize[kr];return e/ks}};var dc={};var ab=["swiftshader","microsoft basic render driver"];var hz=["intel","nvidia","amd","apple","geforce"];function gO(e){e=e.toLowerCase();if(ab.indexOf(e)>=0){return true}if(e.indexOf("mobile")>=0){return true}return false}function cF(T){T=T.toLowerCase();for(var e=0;e<hz.length;e++){if(T.indexOf(hz[e])>=0){return true}}return false}function kj(e){if(!e){return false}if(gO(e)){return false}if(cF(e)){return true}return false}dc.ifEnableEarth=function(i){var e=dc.ifEnableEarth;if(!i&&typeof e._enable==="boolean"){return e._enable}if(dc.ifSupportWebGL()){e._enable=true;return true}e._enable=false;return false};dc.ifEnableWebGLMap=function(i){var e=dc.ifEnableWebGLMap;if(!i&&typeof e._enable==="boolean"){return e._enable}if(dc.ifSupportWebGL()){if(aJ.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};dc.params={};dc.ifSupportWebGL=function(){var i=dc.ifSupportWebGL;if(typeof i._supportWebGL==="boolean"){return i._supportWebGL}if(!window.WebGLRenderingContext){i._supportWebGL=false;return false}var T=document.createElement("canvas");T.width=300;T.height=150;var kr=null;var kx={alpha:true,antialias:false,failIfMajorPerformanceCaveat:false,preserveDrawingBuffer:false,stencil:false};try{kr=T.getContext("webgl",kx)||T.getContext("experimental-webgl",kx)}catch(kt){i._supportWebGL=false}if(kr===null){i._supportWebGL=false}else{i._supportWebGL=true;var kv=kr.getExtension("WEBGL_debug_renderer_info");var ku="";if(kv){ku=kr.getParameter(kv.UNMASKED_RENDERER_WEBGL);if(kj(ku)===true){i._supportWebGL=true}var kw=kr.getParameter(kv.UNMASKED_VENDOR_WEBGL);i._renderer=ku;i._vendor=kw}if(!kv&&e6.Browser.firefox){i._supportWebGL=true}if(!kv&&e6.Platform.macintosh){i._supportWebGL=true}if(kr.drawingBufferWidth!==T.width||kr.drawingBufferHeight!==T.height){i._supportWebGL=false}if(kr.getParameter(kr.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<4){i._supportWebGL=false}var kq=kr.getParameter(kr.MAX_TEXTURE_SIZE);dc.params.maxTextureSize=kq;if(kq<4096){i._supportWebGL=false}var ks=kr.getParameter(kr.MAX_TEXTURE_IMAGE_UNITS);if(ks<8){i._supportWebGL=false}if(!kr.getShaderPrecisionFormat||kr.getShaderPrecisionFormat(kr.FRAGMENT_SHADER,kr.HIGH_FLOAT).precision<23){i._supportWebGL=false}}return i._supportWebGL};dc.ifSupportCanvas2d=function(){var kr=dc.ifSupportCanvas2d;if(typeof kr.supportCanvas2d==="boolean"){return kr.supportCanvas2d}var T=document.createElement("canvas");var i=null;try{i=T.getContext("2d")}catch(kq){kr.supportCanvas2d=false}if(i===null){kr.supportCanvas2d=false}else{kr.supportCanvas2d=true}return kr.supportCanvas2d};dc.ifCanvas2dInBlackList=function(){return true};dc.ifEnableCanvas2dMap=function(){return false;var i=navigator.userAgent;var e=0;var kq=0;var kr=0;if(/macintosh/ig.test(i)){var T=0;if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(i)&&!/chrome/i.test(i)){T=parseInt((RegExp["\x241"]||RegExp["\x242"]),10)}if(T>0){return false}return true}if(/windows nt (\d+\.\d)/ig.test(i)){kq=parseFloat(RegExp.$1);if(kq>=6.1){if(/chrome\/(\d+\.\d)/i.test(i)){e=parseFloat(RegExp.$1);if(e>=31){return true}}if(/MSIE (\d+(\.\d+)?)/.test(i)){kr=parseFloat(RegExp.$1);if(kr>=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};dc.ifSupportCSS3=function(ku,i){var kt=document.createElement("div");var ks="Webkit Moz O ms".split(" ");var e=ks.length;var T="";var kq=kt.style;if(ku in kq){T=ku}ku=ku.replace(/^[a-z]/,function(kv){return kv.toUpperCase()});while(e--){var kr=ks[e]+ku;if(kr in kq){T=kr;break}}if(i){return T}else{return T.length>0?true:false}};dc.isModernBrowser=dc.ifSupportCanvas2d()&&dc.ifSupportCSS3("transform");function aA(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 T in e){this._options[T]=e[T]}this._getDataTimes=0;this._hitTimes=0}aA.prototype.setData=function(kq,ks){var i=this._cache;var T=this._size;if(T===0){return}var e=this._curSize;if(e===T){this._removeOld()}var kr;if(!i[kq]){kr={key:kq,data:ks,older:null,newwer:null};i[kq]=kr;if(this._least===null){this._least=kr}if(this._most===null){this._most=kr}this._curSize++}else{kr=i[kq];kr.data=ks;if(this._most===kr){return}kr.older&&(kr.older.newer=kr.newer);kr.newer&&(kr.newer.older=kr.older);if(this._least===kr){this._least=kr.newer}}if(this._most&&this._most!==kr){this._most.newer=kr;kr.older=this._most;this._most=kr;kr.newer=null}};aA.prototype.getData=function(e){var i=this._cache[e];this._getDataTimes++;if(i){this._hitTimes++;var T=i.data;if(this._most===i){return T}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 T}return null};aA.prototype.getAllData=function(){return this._cache};aA.prototype.getHitRate=function(){return this._hitTimes/this._getDataTimes};aA.prototype.removeData=function(i){var e=this._cache;var T=e[i];if(!T){return}if(this._options.clearCallback){this._options.clearCallback(T.data,T.key)}T.older&&(T.older.newer=T.newer);T.newer&&(T.newer.older=T.older);if(this._least===T){this._least=T.newer}if(this._most===T){this._most=T.older}delete e[i];this._curSize--};aA.prototype._removeOld=function(){var e=this._cache;var kq=Math.round(this._size*0.6);var T=0;while(this._least&&T<kq){var i=this._least;this._least=i.newer;i.newer&&(i.newer.older=null);if(this._options.clearCallback){this._options.clearCallback(i.data,i.key)}delete e[i.key];T++}this._curSize-=T;if(this._options.removeOldCallback){this._options.removeOldCallback()}};aA.prototype.clear=function(){var e=this._cache;var i=this._least;if(this._options.clearCallback){while(i){this._options.clearCallback(i.data,i.key);i=i.newer}}this._least=this._most=null;this._cache={};this._curSize=0};aA.prototype.forEach=function(e){var i=this._least;while(i){e(i.data);i=i.newer}};aA.prototype.clearExcept=function(i){var e=this._cache;var T=this._least;while(T){if(!i[T.key]){if(this._options.clearCallback){this._options.clearCallback(T.data,T.key)}T.older&&(T.older.newer=T.newer);T.newer&&(T.newer.older=T.older);if(this._least===T){this._least=T.newer}if(this._most===T){this._most=T.older}delete e[T.key];this._curSize--}T=T.newer}};!function(T,i){"object"==typeof bD&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(T="undefined"!=typeof globalThis?globalThis:T||self).gcoord=i()}(this,(function(){var k4=function(){return(k4=Object.assign||function(k9){for(var i,T=1,lb=arguments.length;T<lb;T++){for(var la in i=arguments[T]){Object.prototype.hasOwnProperty.call(i,la)&&(k9[la]=i[la])}}return k9}).apply(this,arguments)},kP=Math.sin,kR=Math.cos,kV=Math.sqrt,kU=Math.abs,k8=Math.PI,k0=6378245,kO=0.006693421622965823;function k3(T,i){return T>=72.004&&T<=137.8347&&i>=0.8293&&i<=55.8271}function k6(lb,la){var le,i,lg,T=(lg=300+(le=lb-105)+2*(i=la-35)+0.1*le*le+0.1*le*i+0.1*kV(kU(le)),lg+=2*(20*kP(6*le*k8)+20*kP(2*le*k8))/3,(lg+=2*(20*kP(le*k8)+40*kP(le/3*k8))/3)+2*(150*kP(le/12*k8)+300*kP(le/30*k8))/3),k9=function(lj,li){var lh=2*lj-100+3*li+0.2*li*li+0.1*lj*li+0.2*kV(kU(lj));return lh+=2*(20*kP(6*lj*k8)+20*kP(2*lj*k8))/3,lh+=2*(20*kP(li*k8)+40*kP(li/3*k8))/3,lh+2*(160*kP(li/12*k8)+320*kP(li*k8/30))/3}(lb-105,la-35),ld=la/180*k8,lc=kP(ld),lf=kV(lc=1-kO*lc*lc);return[T=180*T/(k0/lf*kR(ld)*k8),k9=180*k9/(k0*(1-kO)/(lc*lf)*k8)]}function kX(k9){var i=k9[0],T=k9[1];if(!k3(i,T)){return[i,T]}var la=k6(i,T);return[i+la[0],T+la[1]]}function kQ(lb){var lf=lb[0],T=lb[1];if(!k3(lf,T)){return[lf,T]}for(var k9=[lf,T],ld=k9[0],la=k9[1],le=kX([ld,la]),lc=le[0]-lf,lg=le[1]-T;kU(lc)>0.000001||kU(lg)>0.000001;){lc=(le=kX([ld-=lc,la-=lg]))[0]-lf,lg=le[1]-T}return[ld,la]}var k1=Math.sin,k2=Math.cos,ky=Math.atan2,k5=Math.sqrt,kN=3000*Math.PI/180;function kT(k9){var i=k9[0]-0.0065,T=k9[1]-0.006,lb=k5(i*i+T*T)-0.00002*k1(T*kN),la=ky(T,i)-0.000003*k2(i*kN);return[lb*k2(la),lb*k1(la)]}function kC(k9){var i=k9[0],T=k9[1],lb=k5(i*i+T*T)+0.00002*k1(T*kN),la=ky(T,i)+0.000003*k2(i*kN);return[lb*k2(la)+0.0065,lb*k1(la)+0.006]}var kK=180/Math.PI,kt=Math.PI/180,kv=6378137,k7=20037508.342789244;function kH(i){return[i[0]*kK/kv,(0.5*Math.PI-2*Math.atan(Math.exp(-i[1]/kv)))*kK]}function kW(k9){var i=Math.abs(k9[0])<=180?k9[0]:k9[0]-360*(k9[0]<0?-1:1),T=[kv*i*kt,kv*Math.log(Math.tan(0.25*Math.PI+0.5*k9[1]*kt))];return T[0]>k7&&(T[0]=k7),T[0]<-k7&&(T[0]=-k7),T[1]>k7&&(T[1]=k7),T[1]<-k7&&(T[1]=-k7),T}var kG,kF,kE,kM,kB,kq,kL=Math.abs,kY=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],kA=[75,60,45,30,15,0],ks=[[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]],kZ=[[-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 kz(la,T,k9){var lc=kL(T)/k9[9],lb=k9[0]+k9[1]*kL(la),i=k9[2]+k9[3]*lc+k9[4]*Math.pow(lc,2)+k9[5]*Math.pow(lc,3)+k9[6]*Math.pow(lc,4)+k9[7]*Math.pow(lc,5)+k9[8]*Math.pow(lc,6);return[lb*=la<0?-1:1,i*=T<0?-1:1]}function kS(k9){for(var i=k9[0],T=k9[1],lb=[],la=0;la<kA.length;la++){if(kL(T)>kA[la]){lb=kZ[la];break}}return kz(i,T,lb)}function kx(k9){for(var i=k9[0],T=k9[1],lb=[],la=0;la<kY.length;la++){if(T>=kY[la]){lb=ks[la];break}}return kz(i,T,lb)}function kw(T,i){if(!T){throw new Error(i)}}function kI(i){return !!i&&"[object Array]"===Object.prototype.toString.call(i)}function kD(i){return !isNaN(Number(i))&&null!==i&&!kI(i)}function ku(){for(var k9=[],i=0;i<arguments.length;i++){k9[i]=arguments[i]}var T=k9.length-1;return function(){for(var la=[],lc=0;lc<arguments.length;lc++){la[lc]=arguments[lc]}for(var lb=T,e=k9[T].apply(null,la);lb--;){e=k9[lb].call(null,e)}return e}}function kr(lq,lf,lh){if(void 0===lh&&(lh=!1),null!==lq){for(var lk,lj,lt,lm,le,lp,ls,ll,lg=0,ln=0,lo=lq.type,la="FeatureCollection"===lo,lr="Feature"===lo,ld=la?lq.features.length:1,li=0;li<ld;li++){le=(ll=!!(ls=la?lq.features[li].geometry:lr?lq.geometry:lq)&&"GeometryCollection"===ls.type)?ls.geometries.length:1;for(var lc=0;lc<le;lc++){var lb=0,T=0;if(null!==(lm=ll?ls.geometries[lc]:ls)){var k9=lm.type;switch(lg=!lh||"Polygon"!==k9&&"MultiPolygon"!==k9?0:1,k9){case null:break;case"Point":if(!1===lf(lp=lm.coordinates,ln,li,lb,T)){return !1}ln++,lb++;break;case"LineString":case"MultiPoint":for(lp=lm.coordinates,lk=0;lk<lp.length;lk++){if(!1===lf(lp[lk],ln,li,lb,T)){return !1}ln++,"MultiPoint"===k9&&lb++}"LineString"===k9&&lb++;break;case"Polygon":case"MultiLineString":for(lp=lm.coordinates,lk=0;lk<lp.length;lk++){for(lj=0;lj<lp[lk].length-lg;lj++){if(!1===lf(lp[lk][lj],ln,li,lb,T)){return !1}ln++}"MultiLineString"===k9&&lb++,"Polygon"===k9&&T++}"Polygon"===k9&&lb++;break;case"MultiPolygon":for(lp=lm.coordinates,lk=0;lk<lp.length;lk++){for(T=0,lj=0;lj<lp[lk].length;lj++){for(lt=0;lt<lp[lk][lj].length-lg;lt++){if(!1===lf(lp[lk][lj][lt],ln,li,lb,T)){return !1}ln++}T++}lb++}break;case"GeometryCollection":for(lk=0;lk<lm.geometries.length;lk++){if(!1===kr(lm.geometries[lk],lf,lh)){return !1}}break;default:throw new Error("Unknown Geometry Type")}}}}}}!function(i){i.WGS84="WGS84",i.WGS1984="WGS84",i.EPSG4326="WGS84",i.GCJ02="GCJ02",i.AMap="GCJ02",i.BD09="BD09",i.BD09LL="BD09",i.Baidu="BD09",i.BMap="BD09",i.BD09MC="BD09MC",i.BD09Meter="BD09MC",i.EPSG3857="EPSG3857",i.EPSG900913="EPSG3857",i.EPSG102100="EPSG3857",i.WebMercator="EPSG3857",i.WM="EPSG3857"}(kq||(kq={}));var kJ={WGS84:{to:(kG={},kG[kq.GCJ02]=kX,kG[kq.BD09]=ku(kC,kX),kG[kq.BD09MC]=ku(kS,kC,kX),kG[kq.EPSG3857]=kW,kG)},GCJ02:{to:(kF={},kF[kq.WGS84]=kQ,kF[kq.BD09]=kC,kF[kq.BD09MC]=ku(kS,kC),kF[kq.EPSG3857]=ku(kW,kQ),kF)},BD09:{to:(kE={},kE[kq.WGS84]=ku(kQ,kT),kE[kq.GCJ02]=kT,kE[kq.EPSG3857]=ku(kW,kQ,kT),kE[kq.BD09MC]=kS,kE)},EPSG3857:{to:(kM={},kM[kq.WGS84]=kH,kM[kq.GCJ02]=ku(kX,kH),kM[kq.BD09]=ku(kC,kX,kH),kM[kq.BD09MC]=ku(kS,kC,kX,kH),kM)},BD09MC:{to:(kB={},kB[kq.WGS84]=ku(kQ,kT,kx),kB[kq.GCJ02]=ku(kT,kx),kB[kq.EPSG3857]=ku(kW,kQ,kT,kx),kB[kq.BD09]=kx,kB)}};return k4(k4({},kq),{CRSTypes:kq,transform:function(ld,lb,lc){if(kw(!!ld,"The args[0] input coordinate is required"),kw(!!lb,"The args[1] original coordinate system is required"),kw(!!lc,"The args[2] target coordinate system is required"),lb===lc){return ld}var lf=kJ[lb];kw(!!lf,"Invalid original coordinate system: "+lb);var le=lf.to[lc];kw(!!le,"Invalid target coordinate system: "+lc);var T=typeof ld;if(kw("string"===T||"object"===T,"Invalid input coordinate type: "+T),"string"===T){try{ld=JSON.parse(ld)}catch(lb){throw new Error("Invalid input coordinate: "+ld)}}var la=!1;kI(ld)&&(kw(ld.length>=2,"Invalid input coordinate: "+ld),kw(kD(ld[0])&&kD(ld[1]),"Invalid input coordinate: "+ld),ld=ld.map(Number),la=!0);var k9=le;return la?k9(ld):(kr(ld,(function(lg){var i;i=k9(lg),lg[0]=i[0],lg[1]=i[1]})),ld)}})}));var hO={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(ks){var kt=ks.replace("#","");if(kt.length===3){kt+="f"}else{if(kt.length===6){kt+="ff"}}var e=[];var kr=kt.length;var kq=kr===8?2:1;for(var T=0;T<kr;T=T+kq){if(kq===2){e.push(parseInt(kt.slice(T,T+2),16))}else{e.push(parseInt(kt.slice(T,T+1)+kt.slice(T,T+1),16))}}return e},parseRgbaStrToArray:function(i){var e=[0,0,0,255];if(i.indexOf("rgba(")===0){var kq=i.replace("rgba(","").replace(")","");var T=kq.split(",");e[0]=parseInt(T[0],10);e[1]=parseInt(T[1],10);e[2]=parseInt(T[2],10);e[3]=Math.round(parseFloat(T[3])*255)}else{if(i.indexOf("rgb(")===0){var kq=i.replace("rgb(","").replace(")","");var kr=kq.split(",");e[0]=parseInt(kr[0],10);e[1]=parseInt(kr[1],10);e[2]=parseInt(kr[2],10);e[3]=255}}return e},parseHexAndOpacityToRgbaArray:function(kr,ks){var T=[];var kv=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;var ku=kr.toLowerCase();if(kv.test(ku)){if(ku.length===4){var e="#";for(var kt=1;kt<4;kt++){e+=ku.slice(kt,kt+1).concat(ku.slice(kt,kt+1))}ku=e}for(var kq=1;kq<7;kq+=2){T.push(parseInt(ku.slice(kq,kq+2),16))}T.push(ks)}return T},parseCSSColor:function(e){if(e.indexOf("#")===0){return hO.parseHexToRgbaArray(e)}return hO.parseRgbaStrToArray(e)},rgbToHSV:function(kr){var e=kr[0]/255;var T=kr[1]/255;var ks=kr[2]/255;var kv=Math.max(e,T,ks);var kq=Math.min(e,T,ks);var ku=kv-kq;var i;if(ku===0){i=0}else{if(kv===e){i=60*(((T-ks)/ku)%6)}else{if(kv===T){i=60*((ks-e)/ku+2)}else{if(kv===ks){i=60*((e-T)/ku+4)}}}}var kw=kv===0?0:(ku/kv);var kt=kv;while(i<0){i+=360}return[i,kw,kt]},hsvToRGB:function(kq){var ku=kq[2]*kq[1];var T=ku*(1-Math.abs((kq[0]/60)%2-1));var i=kq[2]-ku;var kr=kq[0];var kt;var ks;var e;if(kr>=0&&kr<60){kt=ku;ks=T;e=0}else{if(kr>=60&&kr<120){kt=T;ks=ku;e=0}else{if(kr>=120&&kr<180){kt=0;ks=ku;e=T}else{if(kr>=180&&kr<240){kt=0;ks=T;e=ku}else{if(kr>=240&&kr<300){kt=T;ks=0;e=ku}else{if(kr>=300&&kr<360){kt=ku;ks=0;e=T}}}}}}kt=(kt+i)*255>255?255:(kt+i)*255;ks=(ks+i)*255>255?255:(ks+i)*255;e=(e+i)*255>255?255:(e+i)*255;return[Math.round(kt),Math.round(ks),Math.round(e)]},formatColorCssToRgbaArray:function(ks,T,kq){kq=(typeof kq!=="boolean")?true:kq;if(typeof ks!=="string"){return kq?[0,0,0,1]:[0,0,0,255]}var i=(ks||"Black").trim().toLowerCase();var e=[];var kr=hO.ColorRefTable[i];if(kr!==undefined){i=kr[0]}e=hO.parseCSSColor(i);if(T!==undefined&&!isNaN(Number(T))){T=Number(T);e[3]=hO.fitTo(T,0,1)}else{e[3]=Number((e[3]/255).toFixed(2))}if(!kq){e[3]=Math.floor(e[3]*255)}return e},fitTo:function(T,i,e){if(T<i){T=i}else{if(T>e){T=e}}return T},generateColorRamp:function(e,kw,kx,kq,kC){kx=kx||[];kq=kq||"#ccc";kC=kC||1;const T=document.createElement("canvas");const kD=T.getContext("2d");T.width=256;T.height=kC;const ks=kw[0];const kz=kw[kw.length-1];if(e.length===kw.length){const kA=kD.createLinearGradient(0,0,256,1);for(var kv=0;kv<e.length;++kv){var kB=(kw[kv]-ks)/(kz-ks);kA.addColorStop(kB,e[kv])}kD.fillStyle=kA;kD.fillRect(0,0,256,kC)}else{if(e.length-kw.length===-1){var ku=0;var kr=1;for(var kv=0;kv<e.length;++kv){var ky=(kw[kr]-ks)/(kz-ks);var kB=Math.floor(ky*256);kD.fillStyle=e[kv];kD.fillRect(ku,0,kB,kC);ku=kB;kr++}}else{kD.fillStyle=kq||"#ccc";kD.fillRect(0,0,256,kC)}}if(e.length-kw.length<=-1&&kx.length===2){kD.fillStyle=kq||"#ccc";var ky=(kx[0]-ks)/(kz-ks);var kB=Math.floor(ky*256);kD.fillRect(0,0,kB,kC);ky=(kx[1]-ks)/(kz-ks);kB=Math.floor(ky*256);kD.fillRect(kB,0,255,kC)}var kt=new Uint8Array(new Uint8ClampedArray(kD.getImageData(0,0,256,kC).data));return{canvas:T,data:kt,width:256,height:kC}},validateColor:function(e,i){return hO.regGroup[i].test(e)},convert2rgba:function(e,i){if(i===undefined){i=1}if(hO.validateColor(e,"rgba")){return e}if(hO.validateColor(e,"rgb")){e=e.replace(/rgb/g,"rgba");e=e.replace(/\)/,","+i+")");return e}var T=hO.formatColorCssToRgbaArray(e,i,true);return"rgba("+T.join(",")+")"}};(function(ks){function kC(kH,kK){var kJ=(kH&65535)+(kK&65535);var kI=(kH>>16)+(kK>>16)+(kJ>>16);return(kI<<16)|(kJ&65535)}function kB(kH,kI){return(kH<<kI)|(kH>>>(32-kI))}function kw(kM,kJ,kI,kH,kL,kK){return kC(kB(kC(kC(kJ,kM),kC(kH,kK)),kL),kI)}function e(kJ,kI,kN,kM,kH,kL,kK){return kw((kI&kN)|(~kI&kM),kJ,kI,kH,kL,kK)}function kt(kJ,kI,kN,kM,kH,kL,kK){return kw((kI&kM)|(kN&~kM),kJ,kI,kH,kL,kK)}function kz(kJ,kI,kN,kM,kH,kL,kK){return kw(kI^kN^kM,kJ,kI,kH,kL,kK)}function kF(kJ,kI,kN,kM,kH,kL,kK){return kw(kN^(kI|~kM),kJ,kI,kH,kL,kK)}function T(kR,kM){kR[kM>>5]|=128<<(kM%32);kR[((kM+64)>>>9<<4)+14]=kM;var kJ;var kL;var kK;var kI;var kH;var kQ=1732584193;var kP=-271733879;var kO=-1732584194;var kN=271733878;for(kJ=0;kJ<kR.length;kJ+=16){kL=kQ;kK=kP;kI=kO;kH=kN;kQ=e(kQ,kP,kO,kN,kR[kJ],7,-680876936);kN=e(kN,kQ,kP,kO,kR[kJ+1],12,-389564586);kO=e(kO,kN,kQ,kP,kR[kJ+2],17,606105819);kP=e(kP,kO,kN,kQ,kR[kJ+3],22,-1044525330);kQ=e(kQ,kP,kO,kN,kR[kJ+4],7,-176418897);kN=e(kN,kQ,kP,kO,kR[kJ+5],12,1200080426);kO=e(kO,kN,kQ,kP,kR[kJ+6],17,-1473231341);kP=e(kP,kO,kN,kQ,kR[kJ+7],22,-45705983);kQ=e(kQ,kP,kO,kN,kR[kJ+8],7,1770035416);kN=e(kN,kQ,kP,kO,kR[kJ+9],12,-1958414417);kO=e(kO,kN,kQ,kP,kR[kJ+10],17,-42063);kP=e(kP,kO,kN,kQ,kR[kJ+11],22,-1990404162);kQ=e(kQ,kP,kO,kN,kR[kJ+12],7,1804603682);kN=e(kN,kQ,kP,kO,kR[kJ+13],12,-40341101);kO=e(kO,kN,kQ,kP,kR[kJ+14],17,-1502002290);kP=e(kP,kO,kN,kQ,kR[kJ+15],22,1236535329);kQ=kt(kQ,kP,kO,kN,kR[kJ+1],5,-165796510);kN=kt(kN,kQ,kP,kO,kR[kJ+6],9,-1069501632);kO=kt(kO,kN,kQ,kP,kR[kJ+11],14,643717713);kP=kt(kP,kO,kN,kQ,kR[kJ],20,-373897302);kQ=kt(kQ,kP,kO,kN,kR[kJ+5],5,-701558691);kN=kt(kN,kQ,kP,kO,kR[kJ+10],9,38016083);kO=kt(kO,kN,kQ,kP,kR[kJ+15],14,-660478335);kP=kt(kP,kO,kN,kQ,kR[kJ+4],20,-405537848);kQ=kt(kQ,kP,kO,kN,kR[kJ+9],5,568446438);kN=kt(kN,kQ,kP,kO,kR[kJ+14],9,-1019803690);kO=kt(kO,kN,kQ,kP,kR[kJ+3],14,-187363961);kP=kt(kP,kO,kN,kQ,kR[kJ+8],20,1163531501);kQ=kt(kQ,kP,kO,kN,kR[kJ+13],5,-1444681467);kN=kt(kN,kQ,kP,kO,kR[kJ+2],9,-51403784);kO=kt(kO,kN,kQ,kP,kR[kJ+7],14,1735328473);kP=kt(kP,kO,kN,kQ,kR[kJ+12],20,-1926607734);kQ=kz(kQ,kP,kO,kN,kR[kJ+5],4,-378558);kN=kz(kN,kQ,kP,kO,kR[kJ+8],11,-2022574463);kO=kz(kO,kN,kQ,kP,kR[kJ+11],16,1839030562);kP=kz(kP,kO,kN,kQ,kR[kJ+14],23,-35309556);kQ=kz(kQ,kP,kO,kN,kR[kJ+1],4,-1530992060);kN=kz(kN,kQ,kP,kO,kR[kJ+4],11,1272893353);kO=kz(kO,kN,kQ,kP,kR[kJ+7],16,-155497632);kP=kz(kP,kO,kN,kQ,kR[kJ+10],23,-1094730640);kQ=kz(kQ,kP,kO,kN,kR[kJ+13],4,681279174);kN=kz(kN,kQ,kP,kO,kR[kJ],11,-358537222);kO=kz(kO,kN,kQ,kP,kR[kJ+3],16,-722521979);kP=kz(kP,kO,kN,kQ,kR[kJ+6],23,76029189);kQ=kz(kQ,kP,kO,kN,kR[kJ+9],4,-640364487);kN=kz(kN,kQ,kP,kO,kR[kJ+12],11,-421815835);kO=kz(kO,kN,kQ,kP,kR[kJ+15],16,530742520);kP=kz(kP,kO,kN,kQ,kR[kJ+2],23,-995338651);kQ=kF(kQ,kP,kO,kN,kR[kJ],6,-198630844);kN=kF(kN,kQ,kP,kO,kR[kJ+7],10,1126891415);kO=kF(kO,kN,kQ,kP,kR[kJ+14],15,-1416354905);kP=kF(kP,kO,kN,kQ,kR[kJ+5],21,-57434055);kQ=kF(kQ,kP,kO,kN,kR[kJ+12],6,1700485571);kN=kF(kN,kQ,kP,kO,kR[kJ+3],10,-1894986606);kO=kF(kO,kN,kQ,kP,kR[kJ+10],15,-1051523);kP=kF(kP,kO,kN,kQ,kR[kJ+1],21,-2054922799);kQ=kF(kQ,kP,kO,kN,kR[kJ+8],6,1873313359);kN=kF(kN,kQ,kP,kO,kR[kJ+15],10,-30611744);kO=kF(kO,kN,kQ,kP,kR[kJ+6],15,-1560198380);kP=kF(kP,kO,kN,kQ,kR[kJ+13],21,1309151649);kQ=kF(kQ,kP,kO,kN,kR[kJ+4],6,-145523070);kN=kF(kN,kQ,kP,kO,kR[kJ+11],10,-1120210379);kO=kF(kO,kN,kQ,kP,kR[kJ+2],15,718787259);kP=kF(kP,kO,kN,kQ,kR[kJ+9],21,-343485551);kQ=kC(kQ,kL);kP=kC(kP,kK);kO=kC(kO,kI);kN=kC(kN,kH)}return[kQ,kP,kO,kN]}function kA(kI){var kJ;var kH="";var kK=kI.length*32;for(kJ=0;kJ<kK;kJ+=8){kH+=String.fromCharCode((kI[kJ>>5]>>>(kJ%32))&255)}return kH}function kv(kI){var kK;var kH=[];kH[(kI.length>>2)-1]=undefined;for(kK=0;kK<kH.length;kK+=1){kH[kK]=0}var kJ=kI.length*8;for(kK=0;kK<kJ;kK+=8){kH[kK>>5]|=(kI.charCodeAt(kK/8)&255)<<(kK%32)}return kH}function ku(kH){return kA(T(kv(kH),kH.length*8))}function kG(kJ,kM){var kI;var kL=kv(kJ);var kH=[];var kK=[];var kN;kH[15]=kK[15]=undefined;if(kL.length>16){kL=T(kL,kJ.length*8)}for(kI=0;kI<16;kI+=1){kH[kI]=kL[kI]^909522486;kK[kI]=kL[kI]^1549556828}kN=T(kH.concat(kv(kM)),512+kM.length*8);return kA(T(kK.concat(kN),512+128))}function kE(kK){var kJ="0123456789abcdef";var kI="";var kH;var kL;for(kL=0;kL<kK.length;kL+=1){kH=kK.charCodeAt(kL);kI+=kJ.charAt((kH>>>4)&15)+kJ.charAt(kH&15)}return kI}function kx(kH){return unescape(encodeURIComponent(kH))}function kq(kH){return ku(kx(kH))}function ky(kH){return kE(kq(kH))}function i(kH,kI){return kG(kx(kH),kx(kI))}function kD(kH,kI){return kE(i(kH,kI))}function kr(kI,kJ,kH){if(!kJ){if(!kH){return ky(kI)}return kq(kI)}if(!kH){return kD(kJ,kI)}return i(kJ,kI)}if(typeof define==="function"&&define.amd){define(function(){return kr})}else{if(typeof module==="object"&&module.exports){module.exports=kr}else{ks.md5=kr}}})(this);var cQ={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,T){this.hosts+=i?i:"";ar&&ar(this.config,e);this.sender=true;if(T){this.sender=false}this.hosts=this.urlScope(this.hosts);this.sendError=this.notifyError();var kq=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};this.config.jsError&&this.handleJavaScriptError(kq);this.config.resourceError&&this.handleResourceError(kq);this.config.ajaxError&&this.handleAjaxError(kq)},handleJavaScriptError:function(T){var e=this;var i=T.onerror;T.onerror=function(ku,kt,kq,ks,kr){if(e.isFetch(e.category.JS)&&e.hostExit(kt)){if(kr&&kr.stack){e.sendError({title:ku,msg:kr.stack,category:e.category.JS,level:e.levels.ERROR})}else{if(typeof ku==="string"){e.sendError({title:ku,msg:JSON.stringify({resourceUrl:kt,rowNum:kq,colNum:ks}),category:"js",level:e.levels.ERROR})}}}if(i&&bX(i)){i&&i.apply(T,arguments)}}},handleResourceError:function(i){var e=this;i.addEventListener("error",function(ks){if(ks){var kt=ks.target||ks.srcElement;var kr=kt instanceof HTMLScriptElement||kt instanceof HTMLLinkElement||kt instanceof HTMLImageElement;if(!kr){if(!i.onerror){var T=ks.filename||null;if(!e.isFetch(e.category.JS)||!e.hostExit(T)){return}if(ks.error&&ks.error.stack){e.sendError({title:ks.message,msg:ks.error.stack,category:e.category.JS,level:e.levels.ERROR})}else{if(typeof ks.message==="string"){e.sendError({title:ks.message,msg:JSON.stringify({resourceUrl:T,rowNum:ks.lineno,colNum:ks.cowno}),category:e.category.JS,level:e.levels.ERROR})}}}return}var kq=kt.src||kt.href;if(e.isFetch(e.category.RESOURCE)&&e.hostExit(kq)){e.sendError({title:kt.nodeName,msg:kq,category:e.category.RESOURCE,level:e.levels.ERROR})}}},true)},handleAjaxError:function(ks){var e=this;var kr=ks.location.protocol;if(kr==="file:"){return}if(!ks.XMLHttpRequest){return}var i=ks.XMLHttpRequest;var T=i.prototype.send;var kq=function(ku){if(ku&&ku.currentTarget&&ku.currentTarget.status!==200){var kt=ku.target.responseURL;if(e.isFetch(e.category.AJAX)&&e.hostExit(kt)){e.sendError({title:kt,msg:JSON.stringify({response:ku.target.response,responseURL:kt,status:ku.target.status,statusText:ku.target.statusText}),category:e.category.AJAX,level:e.levels.ERROR})}}};i.prototype.send=function(){if(this["addEventListener"]){this["addEventListener"]("error",kq);this["addEventListener"]("load",kq);this["addEventListener"]("abort",kq)}else{var kt=this["onreadystatechange"];this["onreadystatechange"]=function(ku){if(this.readyState===4){kq(ku)}kt&&kt.apply(this,arguments)}}return T.apply(this,arguments)}},notifyError:function(T){var i=T||1000;this._idleWorkerTicker=(function(kq){return function(){kq.runJob()}})(this);var e=this;return function(kr){if(kr.url){if(!e.isFetch(kr.category)){return}var kq=kr.url||"";if(!e.hostExit(kq)){return}delete kr.url}if(!navigator.onLine){return}e.collections.push(kr);e.checkJob(i)}},runJob:function(){if(this.collections.length===0){clearInterval(this.idleWork);this.idleWork=null;return}var kr=this.collections.slice(0,2);var T=jw(JSON.stringify({dataset:kr}));var kq=new Date().getTime();var i=eD.apiIMG+"/blank.gif?product=jsapi&v=gl&l="+T+"&ak="+eW+"&t="+kq;if(this.sender){try{var kt=document.createElement("div");kt.style="width:0;height:0;visibility: hidden;opacity: 0;z-index:-999;background-image: url("+i+");";document.querySelector("BODY").appendChild(kt);setTimeout(function(){document.querySelector("BODY").removeChild(kt)})}catch(ks){}}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(kq){var T={};var ks=Object.keys(C);if(C&&ks.length>0){for(var kr in C){if(C[kr]&&(typeof C[kr]!=="function")){T[kr]=C[kr]}}}try{var ku=JSON.stringify(T);if(ku.length>2){return kq+"|"+ku}else{return kq}}catch(kt){return kq}},hostExit:function(i){try{if(i&&i.indexOf("//")===0){i=window.location.protocol+i}var T=new URL(i);if(!T||!T.host){return false}var kr=T.host+T.pathname;if(this.ignoreUrl.indexOf(kr)===-1&&this.hosts.indexOf(T.host)>-1){return true}return false}catch(kq){return false}},isFetch:function(e){return this.config[e+"Error"]||false}};bD.fetchDebug=cQ;var hI={device:{PC:0,NA:1},config:{mask:["FFFFFFFF"],open:true,reset:60*60*1000},url:"//api.map.baidu.com?qt=jsapi_log",startTime:Date.now(),mark:{},records:{},sendMessage:function(e,i){},init:function(i,T){this.kill();var e=this;this.config.open=!!i;T=T||{};if(T.reset){this.config.reset=T.reset}this.sendMessage=(function(kr){var kq=kr||1000;e._idleWorkerTicker=(function(ks){return function(){ks.runJob()}})(e);return function(ks,kt){if(window.navigator&&!navigator.onLine){return}if(Date.now()-e.startTime>e.config.reset){e.startTime=Date.now();e.mark={};e.records={}}if(!e.mark[ks]){e.mark[ks]=true;e.records[ks]=kt}e.checkJob(kq)}})(T.timers)},runJob:function(){if(Object.keys(this.records).length===0){clearInterval(this.idleWork);this.idleWork=null;return}var ks=Object.keys(this.records);var kq=ks[0];var T=new Date().getTime();var kr="logCbk"+Math.floor(Math.random()*10000000000);bD[kr]=function(e){delete bD[kr]};var i=this.url+"&uid="+eW+"&bmapgl2=1&device="+(b2()?this.device.NA:this.device.PC)+"&module="+(this.records[kq][0]||"")+"&func="+(this.records[kq][1]||"")+"&subfunc="+(this.records[kq][2]||"")+"&t="+T+"&callback="+fB+"."+kr;i+=jA()(i);if(this.config.open){try{gX.load(i);delete this.records[kq]}catch(kt){}}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}this._idleWorkerTicker=null;this.mark={};this.records={}}};hI.init(true,{reset:20*60*1000});var j9={request:function(ky,ku,kq,kB,ks){var kv=new Date()["getTime"]();var kx=(Math.random()*100000)["toFixed"](0);bD._rd["_cbk"+kx]=function(kC){if(kC.result&&kC.result["error"]&&kC.result["error"]===202){alert("该AK因为恶意行为已经被管理员封禁");return}if(kC.result&&kC.result["error"]&&kC.result["error"]===403){if(hb!==null){hb.update("未获得百度地图商用授权,可能导致部分地图请求失败,请刷新后重试。")}return}kq=kq||{};ky&&ky(kC,kq);delete bD._rd["_cbk"+kx]};kB=kB||"";var kA;var kr;if(kq&&kq.useEncodeURI){kA=jy(ku,encodeURI);kr=jy(ku)}else{kA=jy(ku,encodeURIComponent);kr=jy(ku)}var i=C.apiHost+"/"+kB+"?"+kA+"&ie=utf-8&oue=1&fromproduct=jsapi";var kw=C.apiHost+"/"+kB+"?"+kr+"&ie=utf-8&oue=1&fromproduct=jsapi";if(!ks){i+="&res=api";kw+="&res=api"}i+="&callback="+fB+"._rd._cbk"+kx;kw+="&callback="+fB+"._rd._cbk"+kx;var kt=window.___abvk?window.___abvk:j9.getSeckeyCidItem("SECKEY_ABVK");var e=j9.getSeckeyCidItem("BMAP_SECKEY");var kz=encodeURIComponent(kt+","+e);var T=kt+","+e;i+="&ak="+eW+"&v=gl&seckey="+kz+"&timeStamp="+kv;kw+="&ak="+eW+"&v=gl&seckey="+T+"&timeStamp="+kv;i+=jA()(kw);gX.load(i)},getSeckeyCidItem:function(i){if(navigator.cookieEnabled){var T=new RegExp("(^| )"+i+"=([^;]*)(;|$)");var e=document.cookie.match(T);if(e){return unescape(e[2])}return -1}if(localStorage){return localStorage.getItem(i)?localStorage.getItem(i):-1}if(sessionStorage){return sessionStorage.getItem(i)?localStorage.getItem(i):-1}}};window.srqtimer=null;window.firstTime=true;window.srqcount=0;bD._rd={};var dm={request:function(i,kv){var kr=new Date()["getTime"]();var ku=(Math.random()*100000).toFixed(0);if(kv){BMapGL._rd["_cbk"+ku]=function(kx){kv&&kv(kx);delete BMapGL._rd["_cbk"+ku]};i+="&callback=BMapGL._rd._cbk"+ku}function ks(ky){var kx;var kz=new RegExp("(^| )"+ky+"=([^;]*)(;|$)");if(kx=document.cookie.match(kz)){return unescape(kx[2])}else{return -1}}if(i.indexOf("v=")===-1){i+="&v=gl"}var kq=window.___abvk?window.___abvk:this.getSeckeyCidItem("SECKEY_ABVK");var e=this.getSeckeyCidItem("BMAP_SECKEY");var kw=encodeURIComponent(kq+","+e);var T=kq+","+e;signUrl=i+"&seckey="+T+"&timeStamp="+kr;i+="&seckey="+kw+"&timeStamp="+kr;i+=jA()(signUrl);var kt=b3("script",{src:i,type:"text/javascript",charset:"utf-8"});if(kt.addEventListener){kt.addEventListener("load",function(ky){var kx=ky.target;kx.parentNode.removeChild(kx)},false);kt.addEventListener("error",function(kx){kv&&kv([,,,,,])},false)}else{if(kt.attachEvent){kt.attachEvent("onreadystatechange",function(ky){var kx=window.event.srcElement;if(kx&&(kx.readyState=="loaded"||kx.readyState=="complete")){kx.parentNode.removeChild(kx)}})}}document.getElementsByTagName("head")[0].appendChild(kt);kt=null},getSeckeyCidItem:function(i){if(navigator.cookieEnabled){var T=new RegExp("(^| )"+i+"=([^;]*)(;|$)");var e=document.cookie.match(T);if(e){return unescape(e[2])}return -1}if(localStorage){return localStorage.getItem(i)?localStorage.getItem(i):-1}if(sessionStorage){return sessionStorage.getItem(i)?localStorage.getItem(i):-1}}};function gS(){this._map=null;this._container;this._type="control";this.blockInfoWindow=true;this._visible=true}gS.inherits(de,"Control");e6.extend(gS.prototype,{initialize:function(e){this._map=e;if(this._container){if(this._opts&&this._opts.container){this._opts.container.appendChild(this._container)}else{e.container.appendChild(this._container)}return this._container}return},_i:function(e){if(!this._container&&this.initialize&&bX(this.initialize)){this._container=this.initialize(e)}this._opts=this._opts||{printable:false};this._setStyle();this._setPosition();if(this._container){this._container._jsobj=this}},_setStyle:function(){var i=this._container;if(i){var e=i.style;e.position="absolute";e.zIndex=this._cZIndex||"10";e.MozUserSelect="none";if(!this._opts.printable){e6.ac(i,"BMap_noprint")}e6.on(i,"contextmenu",hA)}},remove:function(){this._map=null;if(!this._container){return}this._container.parentNode&&this._container.parentNode.removeChild(this._container);this._container._jsobj=null;this._container=null},_render:function(e){if(this._opts&&this._opts.container){this._container=bP(this._opts.container,'<div unselectable="on"></div>')}else{var i='<div unselectable="on"></div>';if(e&&e.config.autoSafeArea&&cz()){this._safeAreaContainer=bP(this._map.container,i);this._safeAreaContainer.style.position="absolute";this._safeAreaContainer.style.bottom="env(safe-area-inset-bottom)";this._container=bP(this._safeAreaContainer,i)}else{this._container=bP(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(kq){if(this.anchorFixed||typeof kq!=="number"||isNaN(kq)||kq<BMAP_ANCHOR_TOP_LEFT||kq>BMAP_ANCHOR_BOTTOM_RIGHT){kq=this.defaultAnchor}this._opts.offset=this._opts.offset||this.defaultOffset;var T=this._opts.anchor;this._opts.anchor=kq;if(!this._container){return}var ks=this._container;var e=this._opts.offset.width;var kr=this._opts.offset.height;ks.style.left=ks.style.top=ks.style.right=ks.style.bottom="auto";switch(kq){case BMAP_ANCHOR_TOP_LEFT:ks.style.top=kr+"px";ks.style.left=e+"px";break;case BMAP_ANCHOR_TOP_RIGHT:ks.style.top=kr+"px";ks.style.right=e+"px";break;case BMAP_ANCHOR_BOTTOM_LEFT:ks.style.bottom=kr+"px";ks.style.left=e+"px";break;case BMAP_ANCHOR_BOTTOM_RIGHT:ks.style.bottom=kr+"px";ks.style.right=e+"px";break;default:break}var i=["TL","TR","BL","BR"];e6.rc(this._container,"anchor"+i[T]);e6.ac(this._container,"anchor"+i[kq])},getAnchor:function(){return this._opts.anchor},setOffset:function(e){if(!e){return}this._opts=this._opts||{};this._opts.offset=new je(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 fS("onshow"))},hide:function(){if(this._visible===false){return}this._visible=false;if(this._container){this._container.style.display="none"}this.dispatchEvent(new fS("onhide"))},isPrintable:function(){return !!this._opts.printable},isVisible:function(){if(!this._container&&!this._map){return false}return !!this._visible},_asyncLoadCode:function(){var e=this;he.load("control",function(){if(e._asyncDraw){e._asyncDraw()}})}});var ep={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_LEFT:2,BOTTOM_RIGHT:3};bD.ControlAnchor=ep;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 gg(e){gS.call(this);e=e||{};this._opts={printable:false};e6.extend(this._opts,e);this._copyrightCollection=[];this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new je(5,2);this.setAnchor(e.anchor);this._canShow=true;this.sateMapStyle=false;this.blockInfoWindow=false;this._asyncLoadCode()}gg.inherits(gS,"CopyrightControl");e6.extend(gg.prototype,{initialize:function(e){this._map=e;return this._container},addCopyright:function(kq){var e={minZoom:0,bounds:null,content:"",mapType:""};for(var T in kq){e[T]=kq[T]}if(this._map){var kt=e.minZoom;if(kt===-1||kt<this._map.getMinZoom()||kt>this._map.getMaxZoom()){e.minZoom=this._map.getMinZoom()}if(e.mapType!==""&&!es[e.mapType]){e.mapType=BMAPGL_NORMAL_MAP}}var kr=this.getCopyright(kq.id);if(kr){for(var ks in e){kr[ks]=e[ks]}}else{this._copyrightCollection.push(e)}},getCopyright:function(kq){for(var T=0,e=this._copyrightCollection.length;T<e;T++){if(this._copyrightCollection[T].id===kq){return this._copyrightCollection[T]}}},addSateMapStyle:function(){this.sateMapStyle=true;if(this._container){e6.ac(this._container,"BMap_cpyCtrl_w")}},removeSateMapStyle:function(){this.sateMapStyle=false;if(this._container){e6.rc(this._container,"BMap_cpyCtrl_w")}}});function by(e){gS.call(this);e=e||{};this.canCheckSize=e.canCheckSize===false?false:true;this.curCityName="";this.curCityCode="";this.defaultOffset=new je(10,10);this.defaultAnchor=ep.TOP_LEFT;this.onChangeBefore=[];this.onChangeAfter=[];this.onChangeSuccess=[];this._opts={printable:false,offset:e.offset||this.defaultOffset,anchor:e.anchor||this.defaultAnchor,expand:!!(e.expand)};if(e.onChangeBefore&&bX(e.onChangeBefore)){this.onChangeBefore.push(e.onChangeBefore)}if(e.onChangeAfter&&bX(e.onChangeAfter)){this.onChangeAfter.push(e.onChangeAfter)}if(e.onChangeSuccess&&bX(e.onChangeSuccess)){this.onChangeSuccess.push(e.onChangeSuccess)}this.setAnchor(e.anchor);this._asyncLoadCode();hI.sendMessage(aZ(4,5,3),["control","city"])}by.inherits(gS,"CityListControl");e6.extend(by.prototype,{initialize:function(e){this._map=e;return this._container}});function kp(e){gS.call(this);e=e||{};this._opts={printable:false};this._opts=e6.extend(e6.extend(this._opts,{unit:"metric"}),e);this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT;this.defaultOffset=new je(81,18);if(b2()){this.defaultOffset=new je(75,10)}this.setAnchor(e.anchor);this._units={metric:{name:"metric",conv:1,incon:1000,u1:"米",u2:"公里"},us:{name:"us",conv:3.2808,incon:5280,u1:"英尺",u2:"英里"}};this.sateMapStyle=false;if(!this._units[this._opts.unit]){this._opts.unit="metric"}this._scaleText=null;this._numberArray={};this._asyncLoadCode()}window.BMAP_UNIT_METRIC="metric";window.BMAP_UNIT_IMPERIAL="us";kp.inherits(gS,"ScaleControl");e6.extend(kp.prototype,{initialize:function(e){this._map=e;return this._container},setUnit:function(e){this._opts.unit=this._units[e]&&this._units[e].name||this._opts.unit},getUnit:function(){return this._opts.unit},addSateMapStyle:function(){this.sateMapStyle=true;var e=this._container;if(e){e6.ac(e.children[0],"dark")}},removeSateMapStyle:function(){this.sateMapStyle=false;var e=this._container;if(e){e6.rc(e.children[0],"dark")}}});window.BMAP_NAVIGATION_CONTROL_LARGE=0;window.BMAP_NAVIGATION_CONTROL_SMALL=1;window.BMAP_NAVIGATION_CONTROL_PAN=2;window.BMAP_NAVIGATION_CONTROL_ZOOM=3;window.BMAP_NAVIGATION_CONTROL_ANIM=4;function jV(e){gS.call(this);e=e||{};this._opts={printable:false};e6.extend(this._opts,e);this.controlHeight=[{width:65,height:227,zoomHeight:227,zoomWidth:37,sliderHeight:180},{width:65,height:47,zoomHeight:(this._opts.forceNew===true)?56:47,zoomWidth:37,sliderHeight:0},{width:37,height:57,zoomHeight:0,zoomWidth:0,sliderHeight:0},{width:26,height:56,zoomHeight:56,zoomWidth:6,sliderHeight:0},{width:56,height:47,zoomHeight:47,zoomWidth:37,sliderHeight:180}];this.defaultAnchor=BMAP_ANCHOR_TOP_LEFT;this.defaultOffset=new je(10,10);this.setAnchor(e.anchor);this.setType(e.type);this._maxTotalZoomLv=19;this._minZoomLevel=-1;this._maxZoomLevel=-1;this._totalZoomLv=-1;this._sliderInterval=10;this._sliderHeight=180;this._minBarY=1;this._maxBarY=-1;this._curBarY=-1;this._zoomDom=null;this._zoomBtnDom=null;this._sliderDom=null;this._sliderBaseDom=null;this._cZIndex="1100";this._asyncLoadCode()}jV.inherits(gS,"NavigationControl");e6.extend(jV.prototype,{initialize:function(e){this._map=e;return this._container},setType:function(e){if(typeof e=="number"&&e>=BMAP_NAVIGATION_CONTROL_LARGE&&e<=BMAP_NAVIGATION_CONTROL_ANIM){this._opts.type=e}else{this._opts.type=BMAP_NAVIGATION_CONTROL_LARGE}},getType:function(){return this._opts.type}});function v(i){gS.call(this);i=i||{};this._opts={printable:false};this.defaultAnchor=BMAP_ANCHOR_TOP_RIGHT;this.defaultOffset=new je(10,10);this.setAnchor(i.anchor);this._opts=e6.extend(e6.extend(this._opts,{offset:this.defaultOffset,enableSwitch:true}),i);var e=this;he.load("control",function(){e._asyncDraw()})}v.inherits(gS,"MapTypeControl");e6.extend(v.prototype,{initialize:function(e){this._map=e;return this._container},showStreetLayer:function(e){this._map.showStreetLayer(e)}});function jq(e){gS.call(this);e=e||{};this._opts={};this._opts=e6.extend(this._opts,e);this._zoomInDisabled=false;this._zoomOutDisabled=false;this._zoomInTapped=false;this._zoomOutTapped=false;this.defaultAnchor=ep.BOTTOM_RIGHT;this.defaultOffset=new je(15,20);this.setAnchor(e.anchor);this._asyncLoadCode()}jq.inherits(gS,"ZoomControl");e6.extend(jq.prototype,{initialize:function(e){this._map=e;return this._container}});function gz(e){gS.call(this);e=e||{};this._opts={autoZoom:true,autoViewport:true};this._opts=e6.extend(this._opts,e);this.defaultAnchor=ep.BOTTOM_LEFT;this.defaultOffset=new je(10,50);this.watchPosition=this._opts.watchPosition||false;this.useCompass=this._opts.useCompass||false;this.locMarker=null;this.locLevel=16;this.setAnchor(this._opts.anchor);this.onLocationStart=e.onLocationStart||null;this._asyncLoadCode()}gz.inherits(gS,"LocationControl");e6.extend(gz.prototype,{initialize:function(e){this._map=e;return this._container},startLocation:function(){this._startLocationCalled=true},stopLocationTrace:function(){},setOptions:function(e){e=e||{};e6.extend(this._opts,e)}});function bG(e){gS.call(this);e=e||{};this._opts={};this._opts=e6.extend(this._opts,e);this.defaultAnchor=ep.BOTTOM_LEFT;this.defaultOffset=new je(5,15);if(b2()){this.defaultOffset=new je(10,10)}this.setAnchor(e.anchor)}bG.inherits(gS,"LogoControl");e6.extend(bG.prototype,{initialize:function(i){this._map=i;var e=this._container=document.createElement("div");e.innerHTML='<img src="'+C.apiHost+'/images/logo_hd.png" style="height:21px;width:62px;"/>';i.getContainer().appendChild(e);return e}});function av(e,i){this._map=e;this._indoorInfo=i;this._visible=true;this._adjustVisible=true;this._isMobile=b2();this._sizeConfig={FLOOR_BTN_HEIGHT:this._isMobile?35:26,SWITCH_ARROW_HEIGHT:this._isMobile?20:15};this._init()}av.prototype._init=function(){this._render();this._bindDom();this._bind();this._adjustDisplayHeight();var e=new fS("onindoor_bar_show");e.uid=this._indoorInfo.uid;e.floors=this._indoorInfo.floors;this._map.dispatchEvent(e)};av.prototype._render=function(){if(!this._indoorInfo){return}var ku=this._isMobile;var e=this._div=b3("div");e6.ac(e,"floor-select-container");ku&&e6.ac(e,"mobile");ku&&e6.ac(e,"all-border-radius");var i=this._btnTop=b3("button");e6.ac(i,"floor-switch-top");e6.ac(i,"top-border-radius");var ks=b3("div");e6.ac(ks,"floor-switch-top-icon");i.appendChild(ks);var kr=this._btnBottom=b3("button");var T=b3("div");e6.ac(T,"floor-switch-bottom-icon");kr.appendChild(T);e6.ac(kr,"floor-switch-bottom");e6.ac(kr,"bottom-border-radius");var kq=this._floorsContainer=b3("div");e6.ac(kq,"floors-container");kq.appendChild(this._createFloorsDom());this._div.appendChild(i);this._div.appendChild(kq);this._div.appendChild(kr);var kv=0;if(this._btnTop.style.display===""){kv=2*this._sizeConfig.SWITCH_ARROW_HEIGHT}this._div.style.height=parseInt(this._floorsContainer.style.height,10)+kv+"px";this._map.getContainer().appendChild(this._div);if(!ku){var kt=this;setTimeout(function(){kt._div.style.right="20px"},20)}};av.prototype._createFloorsDom=function(){if(!this._indoorInfo){return}var T=this._ol=b3("ol");var ks=this._indoorInfo.currentFloor;for(var kr=this._indoorInfo.floors.length-1;kr>=0;kr--){var kt=this._indoorInfo.floors[kr].floorName;var e=b3("li");var kq=b3("button");e6.ac(kq,"btn-select-floor");if(kr===ks){e6.ac(kq,"selected")}kq.setAttribute("data-floor",kr);kq.innerHTML=kt;e.appendChild(kq);T.appendChild(e)}return T};av.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()};av.prototype._bindDom=function(){var e=this;e6.on(this._floorsContainer,"click",function(kq){var T=kq.target||kq.srcElement;if(T.tagName.toLowerCase()==="button"){e._map.showIndoor(e._indoorInfo.uid,parseInt(T.getAttribute("data-floor"),10));var i=new fS("onindoor_bar_click");i.uid=e._indoorInfo.uid;e._map.dispatchEvent(i)}});e6.on(this._floorsContainer,"mouseover",function(T){var i=T.target;if(i.tagName.toLowerCase()==="button"){e6.ac(i,"hover")}});e6.on(this._floorsContainer,"mouseout",function(T){var i=T.target;if(i.tagName.toLowerCase()==="button"){e6.rc(i,"hover")}});e6.on(this._floorsContainer,"touchstart",function(T){var i=T.target;if(i.tagName.toLowerCase()==="button"){e6.ac(i,"onmousedown")}});e6.on(this._floorsContainer,"touchend",function(T){var i=T.target;if(i.tagName.toLowerCase()==="button"){e6.rc(i,"onmousedown")}});e6.on(this._btnTop,"mouseover",function(i){if(this._disable){return}e6.ac(this,"hover")});e6.on(this._btnTop,"mouseout",function(i){e6.rc(this,"hover")});e6.on(this._btnBottom,"mouseover",function(i){if(this._disable){return}e6.ac(this,"hover")});e6.on(this._btnBottom,"mouseout",function(i){e6.rc(this,"hover")});e6.on(this._btnTop,"touchstart",function(i){if(this.className.indexOf("disable")>-1){return}e6.ac(this,"onmousedown")});e6.on(this._btnTop,"touchend",function(i){e6.rc(this,"onmousedown")});e6.on(this._btnBottom,"touchstart",function(i){if(this.className.indexOf("disable")>-1){return}e6.ac(this,"onmousedown")});e6.on(this._btnBottom,"touchend",function(i){e6.rc(this,"onmousedown")});e6.on(this._btnTop,"click",function(i){e._setBarSliderTop(parseInt(e._ol.style.top,10)+26)});e6.on(this._btnBottom,"click",function(i){e._setBarSliderTop(parseInt(e._ol.style.top,10)-26)});e6.on(this._div,"mousemove",aj);e6.on(this._div,"wheel",hA);e6.on(this._div,"mousewheel",hA);this._map.addEventListener("resize",function(){e._adjustDisplayHeight()})};av.prototype._adjustDisplayHeight=function(){if(!this._indoorInfo){return}var ks=this._map.getSize().height;var kt=this._sizeConfig.FLOOR_BTN_HEIGHT;var ku=ks-291-100;if(this._isMobile){ku=ks-12-108-this._map.config.bottomOffset}var e=this._indoorInfo.floors.length;var T=e*kt;var kq=e;var kw=0;var kx=this._floorsContainer.children[0];if(T>ku){this._showArrow=true;e6.rc(kx.children[0].children[0],"top-border-radius");e6.rc(kx.children[e-1].children[0],"bottom-border-radius")}else{this._showArrow=false;e6.ac(kx.children[0].children[0],"top-border-radius");e6.ac(kx.children[e-1].children[0],"bottom-border-radius")}while(T>ku){if(kq===0){break}kq--;kw=2*this._sizeConfig.SWITCH_ARROW_HEIGHT;T=kq*kt+kw}this._currentDisplayHeight=T;if(kq<3){this._setAdjustVisbile(false)}else{this._setAdjustVisbile(true)}this._floorsContainer.style.height=kq*kt+"px";var kr=this._indoorInfo.currentFloor;var i=e-kr;var kv=kr-1;this._div.style.height=parseInt(this._floorsContainer.style.height,10)+kw+"px";var ky=-(e-(kr+Math.round(kq/2)))*kt;this._setBarSliderTop(ky);if(kq<e){e6.show(this._btnTop);e6.show(this._btnBottom)}else{e6.hide(this._btnTop);e6.hide(this._btnBottom);this._setBarSliderTop(0)}if(this._isMobile){this._div.style.bottom=108+this._map.config.bottomOffset+"px"}};av.prototype._setBarSliderTop=function(kq){var T=26;var i=this._indoorInfo.floors.length;var e=i*T;if(this._currentDisplayHeight){if(this._showArrow){e=this._currentDisplayHeight-30}else{e=this._currentDisplayHeight}}if(e-kq>=i*T){kq=e-i*T;e6.ac(this._btnBottom,"disable");e6.rc(this._btnBottom,"hover");this._btnBottom._disable=true}else{e6.rc(this._btnBottom,"disable");this._btnBottom._disable=false}if(kq>=0){kq=0;e6.ac(this._btnTop,"disable");e6.rc(this._btnTop,"hover");this._btnTop._disable=true}else{e6.rc(this._btnTop,"disable");this._btnTop._disable=false}this._ol.style.top=kq+"px"};av.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"}};av.prototype._bind=function(){var i=this._map;var e=this;i.on("indoor_status_changed",function(ku){if(e._visible===false){return}var T=e._ol;var ks=ku.uid;if(!ks){return}var kt=ku.floor;for(var kr=0;kr<T.children.length;kr++){var kq=T.children[kr].children[0];if(parseInt(kq.getAttribute("data-floor"),10)===kt){e6.ac(kq,"selected")}else{e6.rc(kq,"selected")}}});i.on("zoomend",function(T){if(this.getZoom()<17){e._setAdjustVisbile(false)}else{e._setAdjustVisbile(true)}})};av.prototype.setInfo=function(e){if(this._indoorInfo&&this._indoorInfo.uid===e.uid){return}this._indoorInfo=e;this._updateUI()};av.prototype.show=function(){if(this._visible===true){return}this._visible=true;if(!this._isMobile){this._div.style.right="20px"}else{this._div.style.display=""}var e=new fS("onindoor_bar_show");e.uid=this._indoorInfo.uid;e.floors=this._indoorInfo.floors;this._map.dispatchEvent(e)};av.prototype.hide=function(){if(this._visible===false){return}this._visible=false;if(!this._isMobile){this._div.style.right="-30px"}else{this._div.style.display="none"}};function e8(e){this._opts=e||{};this.defaultOffset=new je(2,80);this.defaultAnchor=BMAP_ANCHOR_TOP_RIGHT;if(this._opts.anchor===undefined){this.setAnchor(this.defaultAnchor)}else{this.setAnchor(this._opts.anchor)}this._firstAnimation=true}e8.inherits(gS,"NavigationControl3D");e6.extend(e8.prototype,{initialize:function(T){this._map=T;this._createDom();this._bindDom();this._bind();if(!b2()){this._headingControl=new iT(this._map,this._div)}this._tiltControl=new cY(this._map,this._div);this._render();var i=this._map.getMapType();var e=this;if(i==="B_EARTH_MAP"||this._map._renderType==="webgl"){e._div.style.opacity="1";e._div.style.visibility="visible"}else{e._div.style.opacity="0";e._div.style.visibility="hidden"}return this._container},_createDom:function(){var i=this._div=document.createElement("div");this._container=i;var e=i.style;e.position="absolute";e.zIndex=5;e.width="52px";e.height="82px";e.right="-3px";e.bottom="79px";e.opacity="0";e.visibility="hidden";e.WebkitTransition=e.transition="opacity .3s ease-out,visibility .3s ease-out"},_render:function(){var e=document.getElementById("map-operate");if(e){e.appendChild(this._div)}else{this._map.getContainer().appendChild(this._div)}},_bindDom:function(){this._div.addEventListener("mousemove",aj)},_bind:function(){if(this._map._renderType==="webgl"){return}var e=this;this._map.on("maptypechange",function(){if(this.mapType==="B_EARTH_MAP"){if(e._firstAnimation){e._firstAnimation=false;setTimeout(function(){e._div.style.opacity="1";e._div.style.visibility="visible"},300)}else{e._div.style.opacity="1";e._div.style.visibility="visible"}}else{e._div.style.opacity="0";e._div.style.visibility="hidden"}})}});function iT(T,i){this._map=T;this._target=T;var kq=T.temp.originMapType||T.mapType;if(kq==="B_EARTH_MAP"&&T._earth){this._target=T._earth}this._outContainer=i||T.getContainer();this._imgRatio=go()>=hX.HIGH_RES_MIN_RATIO?2:1;this._imgPath=C.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()}e6.extend(iT.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=b3("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=b3("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(){iM(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 fS("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 fS("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 T=false;if(e._target.getTilt()!==0){T=true;e._target.setTilt(0,e._setHeadingOptions)}if(e._target.getHeading()%360!==0){T=true;e._target.resetHeading(e._setHeadingOptions)}if(!T){e._target.setLock(false)}i.fire(new fS("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(T){e._updateUI()});i.addEventListener("animation_start",function(T){e._isOperating=true});i.addEventListener("animation_end",function(T){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 cY(T,i){this._map=T;this._target=T;var kq=T.temp.originMapType||T.mapType;if(kq==="B_EARTH_MAP"&&T._earth){this._target=T._earth}this._outContainer=i||T.getContainer();this._imgRatio=go()>=hX.HIGH_RES_MIN_RATIO?2:1;this._imgPath=C.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()}e6.extend(cY.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=b3("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(kq){if(!e._enabled){return}if(e._target.getLock()){return}var i=e._target.getTilt();var T;if(i===e._map.getCurrentMaxTilt()){T="out"}else{if(i===0){T="in"}else{T=e._preTrend?e._preTrend:"in"}}e._curTrend=T;e._clickTimer=setTimeout(function(){e._map.fire(new fS("ontiltmsdown"));e._tiltAni=new fH({duration:9999999,render:function(kr){i=e._target.getTilt();if(T==="in"&&i<e._map.getCurrentMaxTilt()){e._target.setTilt(i+1,{noAnimation:true})}else{if(T==="out"&&i>0){e._target.setTilt(i-1,{noAnimation:true})}}},finish:function(){e._tiltAni=null}});e._clickTimer=null},200);kq.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(kq){if(!e._enabled){return}if(!e._clickTimer){return}if(e._target.getLock()){return}clearTimeout(e._clickTimer);e._map.fire(new fS("ontiltclick"));var i=e._target.getTilt();e._target.setLock(true);kq.stopPropagation();var T=e._map.getCurrentMaxTilt();if(e._curTrend==="in"){e._target.setTilt(T,e._setTiltOptions)}else{if(e._curTrend==="out"){e._target.setTilt(0,e._setTiltOptions)}else{if(i<T){e._target.setTilt(T,e._setTiltOptions)}else{e._target.setTilt(0,e._setTiltOptions)}}}},false);this._div.addEventListener("mouseover",function(i){if(!e._enabled){return}e._mouseOver=true;e._updateUI()},false);this._div.addEventListener("mouseout",function(i){if(!e._enabled){return}e._mouseOver=false;e._updateUI()},false);iM(this._div,["mousedown","click","dblclick"])},_bind:function(){var e=this;var i=this._map;this._bindTarget(this._target);if(this._map._renderType==="webgl"){this._map.addEventListener("maptypechange",function(T){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.on("load",function(){e._checkEnable()});i.on("zoom_changed",function(){e._checkEnable()});i.on("tilt_changed",function(){e._updateUI()});if(i===this._map){this._mapBinded=true}else{this._earthBinded=true}},_updateUI:function(){var T=this._target.getTilt();var i=0;var kq=0;var e=0;if(T>0){i=78}if(this._mouseOver){e=52}if(this._enabled===false){kq=26;e=0;i=0}var kr="-"+(110+i+kq+e)+"px 1px";this._div&&(this._div.style.backgroundPosition=kr);if(this._enabled){if(T>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 hy(i){de.call(this);this._opts={container:null,cursor:"default",marker:true};this._opts=e6.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;he.load("menu",function(){e._draw()});hI.sendMessage(aZ(4,5,2),["control","menu"])}hy.inherits(de,"ContextMenu");e6.extend(hy.prototype,{initialize:function(i,e){this._map=i;this._overlay=e||null},remove:function(){this._map=this._overlay=null},addItem:function(kr,e){if(!kr||kr._type!="menuitem"||kr._text==""||kr._width<=0){return}for(var kq=0,T=this._items.length;kq<T;kq++){if(this._items[kq]===kr){return}}if(e===undefined||e>this._items.length-1){e=-1}kr._insertIndex=e;if(e===-1){this._items.push(kr);this._rItems.push(kr)}else{this._items.splice(e,0,kr);this._rItems.splice(e,0,kr)}},removeItem:function(kq){if(!kq||kq._type!="menuitem"){return}for(var T=0,e=this._items.length;T<e;T++){if(this._items[T]===kq){this._items[T].remove();this._items.splice(T,1);delete kq._insertIndex;e--}}for(var T=0,e=this._rItems.length;T<e;T++){if(this._rItems[T]===kq){this._rItems[T].remove();this._rItems.splice(T,1);delete kq._insertIndex;e--}}},addSeparator:function(e){if(e===undefined||e>this._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(T){if(!this._dividers[T]){return}for(var kq=0,e=this._items.length;kq<e;kq++){if(this._items[kq]&&this._items[kq]._type=="divider"&&this._items[kq]._dIndex==T){this._items.splice(kq,1);e--}if(this._items[kq]&&this._items[kq]._type=="divider"&&this._items[kq]._dIndex>T){this._items[kq]._dIndex--}}this._dividers.splice(T,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 h9(T,kq,i){if(!T||!kq||typeof kq!="function"){return}de.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=T+"";this._callback=kq;this._map=null;this._type="menuitem";this._contextmenu=null;this._container=null;this._enabled=true;var e=this;he.load("menu",function(){e._draw()})}h9.inherits(de,"MenuItem");e6.extend(h9.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 ib(e,i){this.setSouthWest(e);this.setNorthEast(i)}e6.extend(ib.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.lng<this.ne.lng&&e.sw.lat>this.sw.lat&&e.ne.lat<this.ne.lat)},getCenter:function(){if(this.isEmpty()){return null}return new cD((this.sw.lng+this.ne.lng)/2,(this.sw.lat+this.ne.lat)/2)},intersects:function(T){if(!T||T.isEmpty()||this.isEmpty()){return null}if(Math.max(T.sw.lng,T.ne.lng)<Math.min(this.sw.lng,this.ne.lng)||Math.min(T.sw.lng,T.ne.lng)>Math.max(this.sw.lng,this.ne.lng)||Math.max(T.sw.lat,T.ne.lat)<Math.min(this.sw.lat,this.ne.lat)||Math.min(T.sw.lat,T.ne.lat)>Math.max(this.sw.lat,this.ne.lat)){return null}var kr=Math.max(this.sw.lng,T.sw.lng);var i=Math.min(this.ne.lng,T.ne.lng);var kq=Math.max(this.sw.lat,T.sw.lat);var e=Math.min(this.ne.lat,T.ne.lat);return new ib(new cD(kr,kq),new cD(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 T=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.lng<i){this.ne.lng=i}if(this.sw.lat>T){this.sw.lat=T}if(this.ne.lat<T){this.ne.lat=T}},getMin:function(){return this.sw},getMax:function(){return this.ne},getSouthWest:function(){return this.sw},getNorthEast:function(){return this.ne},setSouthWest:function(e){this.sw=e?e.clone():null},setNorthEast:function(e){this.ne=e?e.clone():null},clone:function(){return new ib(this.sw,this.ne)},toSpan:function(){if(this.isEmpty()){return new je(0,0)}return new je(Math.abs(this.ne.lng-this.sw.lng),Math.abs(this.ne.lat-this.sw.lat))},div:function(e){if(!e||e.isEmpty()||this.isEmpty()){return 0}return((this.ne.lng-this.sw.lng)*(this.ne.lat-this.sw.lat))/((e.ne.lng-e.sw.lng)*(e.ne.lat-e.sw.lat))},makeNormalizedPoint:function(e){this.normalizedTopLeft=this.pointTopLeft.clone();this.normalizedTopRight=this.pointTopRight.clone();this.normalizedBottomRight=this.pointBottomRight.clone();this.normalizedBottomLeft=this.pointBottomLeft.clone();while(e<0){e+=360}e=e%360;if(e>=0&&e<90||e>=270&&e<360){if(this.normalizedTopRight.lng<this.normalizedTopLeft.lng){this.normalizedTopRight.lng+=hX.WORLD_SIZE_MC}if(this.normalizedBottomRight.lng<this.normalizedBottomLeft.lng){this.normalizedBottomRight.lng+=hX.WORLD_SIZE_MC}}else{if(this.normalizedTopLeft.lng<this.normalizedTopRight.lng){this.normalizedTopLeft.lng+=hX.WORLD_SIZE_MC}if(this.normalizedBottomLeft.lng<this.normalizedBottomRight.lng){this.normalizedBottomLeft.lng+=hX.WORLD_SIZE_MC}}},toString:function(){return"Bounds"}});function cD(e,i){if(isNaN(e)){e=dr(e);e=isNaN(e)?0:e}if(typeof e==="string"){e=parseFloat(e)}if(isNaN(i)){i=dr(i);i=isNaN(i)?0:i}if(typeof i==="string"){i=parseFloat(i)}this.lng=e;this.lat=i}cD.prototype.equals=function(i){if(!i){return false}var kq=Math.abs(this.lat-i.lat);var T=Math.abs(this.lng-i.lng);var e=1e-8;if(kq<e&&T<e){return true}return false};cD.prototype.similar=function(i){if(!i){return false}var kq=Math.abs(this.lat-i.lat);var T=Math.abs(this.lng-i.lng);var e=0.00001;if(kq<e&&T<e){return true}return false};cD.prototype.clone=function(){return new cD(this.lng,this.lat)};cD.prototype.add=function(e){return new cD(this.lng+e.lng,this.lat+e.lat)};cD.prototype.sub=function(e){return new cD(this.lng-e.lng,this.lat-e.lat)};cD.prototype.mult=function(e){return new cD(this.lng*e,this.lat*e)};cD.prototype.div=function(e){return new cD(this.lng/e,this.lat/e)};cD.prototype.mag=function(){return Math.sqrt(this.lng*this.lng+this.lat*this.lat)};cD.prototype.toString=function(){return"Point"};cD.serialize=function(i,e){return[i.lng,i.lat]};cD.deserialize=function(e){return new cD(e[0],e[1])};cD.prototype.toGeoJSON=function(){var i="Point";var T=[this.lng,this.lat];var e={type:"Feature",geometry:{type:i,coordinates:T},properties:this.properties};return e};function jn(){}e6.extend(jn,{EARTHRADIUS:6370996.81,MCBAND:[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],LLBAND:[86,60,45,30,15,0],MC2LL:[[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]],LL2MC:[[-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]],getDistanceByMC:function(ks,kq){if(!ks||!kq){return 0}var i;var kr;var e;var T;ks=this.convertMC2LL(ks);if(!ks){return 0}i=iP(ks.lng);kr=iP(ks.lat);kq=this.convertMC2LL(kq);if(!kq){return 0}e=iP(kq.lng);T=iP(kq.lat);return this.getDistance(i,e,kr,T)},getDistanceByLL:function(ks,kq){if(!ks||!kq){return 0}ks.lng=this.getLoop(ks.lng,-180,180);ks.lat=this.getRange(ks.lat,-80,84);kq.lng=this.getLoop(kq.lng,-180,180);kq.lat=this.getRange(kq.lat,-80,84);var i;var e;var kr;var T;i=iP(ks.lng);kr=iP(ks.lat);e=iP(kq.lng);T=iP(kq.lat);return this.getDistance(i,e,kr,T)},proximityCovertMC2LL:function(e){if(e===null){return e}if(e.lng<180&&e.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 cD(0,0)}var T;var kr;T=new cD(Math.abs(e.lng),Math.abs(e.lat));for(var kq=0;kq<this.MCBAND.length;kq++){if(T.lat>=this.MCBAND[kq]){kr=this.MC2LL[kq];break}}var ks=this.convertor(e,kr);return new cx(ks.lat,ks.lng)},convertLL2MC:function(kt){if(!kt){return new cD(0,0)}var kv=kt.lat;var kq=kt.lng;kq=this.getLoop(kt.lng,-180,180);kv=ch(kv,-85,85);var ks;for(var kr=0;kr<this.LLBAND.length;kr++){if(kv>=this.LLBAND[kr]){ks=this.LL2MC[kr];break}}if(!ks){for(kr=0;kr<this.LLBAND.length;kr++){if(kv<=-this.LLBAND[kr]){ks=this.LL2MC[kr];break}}}var T=new cD(kq,kv);var ku=this.convertor(T,ks);var e=new cD(ku.lng,ku.lat);e.latLng=new cx(kt.lat,kt.lng);return e},convertor:function(T,kq){if(!T||!kq){return}var e=kq[0]+kq[1]*Math.abs(T.lng);var i=Math.abs(T.lat)/kq[9];var kr=kq[2]+kq[3]*i+kq[4]*i*i+kq[5]*i*i*i+kq[6]*i*i*i*i+kq[7]*i*i*i*i*i+kq[8]*i*i*i*i*i*i;e*=(T.lng<0?-1:1);kr*=(T.lat<0?-1:1);return new cD(e,kr)},getDistance:function(i,e,kq,T){return this.EARTHRADIUS*Math.acos((Math.sin(kq)*Math.sin(T)+Math.cos(kq)*Math.cos(T)*Math.cos(e-i)))},getRange:function(T,i,e){if(i!=null){T=Math.max(T,i)}if(e!=null){T=Math.min(T,e)}return T},getLoop:function(T,i,e){while(T>e){T-=e-i}while(T<i){T+=e-i}return T},tileToBoundRange:function(T){var i=T.col;var kx=T.row;var kw=T.baseTileSize;var ku=Math.pow(2,(18-T.zoom));var ks={lbx:i*kw,lby:kx*kw,rtx:(i+1)*kw,rty:(kx+1)*kw};var e={lbx:ks.lbx*ku,lby:ks.lby*ku,rtx:ks.rtx*ku,rty:ks.rty*ku};var kv=new cD(e.lbx,e.lby);var kr=new cD(e.rtx,e.rty);var kq=this.convertMC2LL(kv);var kt=this.convertMC2LL(kr);return{MC:new ib(kv,kr),LL:new ib(kq,kt)}}});e6.extend(jn.prototype,{lnglatToMercator:function(e){return jn.convertLL2MC(e)},lngLatToPoint:function(e){var i=jn.convertLL2MC(e);return new fr(i.lng,i.lat)},mercatorToLnglat:function(e){return jn.convertMC2LL(e)},pointToLngLat:function(i){var e=new cD(i.x,i.y);var T=jn.convertMC2LL(e);return new cx(T.lat,T.lng)},pointToPixel:function(i,ks,kr,kq){if(!i){return}i=this.lnglatToMercator(i);var T=this.getZoomUnits(ks);var e=Math.round((i.lng-kr.lng)/T+kq.width/2);var kt=Math.round((kr.lat-i.lat)/T+kq.height/2);return new fr(e,kt)},mercatorToPixel:function(ks,kr,kq,T){if(!ks){return}var i=this.getZoomUnits(kr);var e=Math.round((ks.lng-kq.lng)/i+T.width/2);var kt=Math.round((kq.lat-ks.lat)/i+T.height/2);return new fr(e,kt)},pixelToPoint:function(kq,kt,ks,kr){if(!kq){return}var i=this.getZoomUnits(kt);var T=ks.lng+i*(kq.x-kr.width/2);var ku=ks.lat-i*(kq.y-kr.height/2);var e=new cD(T,ku);return this.mercatorToLnglat(e)},tileToBound:function(kq,ku){var i=kq.col;var kx=kq.row;var kw=kq.baseTileSize;var kv=this.getZoomUnits(kq.zoom);var T={x:Math.round(ku.lng/kv),y:Math.round(ku.lat/kv)};var ks={lbx:i*kw,lby:kx*kw,rtx:(i+1)*kw,rty:(kx+1)*kw};var e={lbx:ku.lng+(ks.lbx-T.x)*kv,lby:ku.lat+(ks.lby-T.y)*kv,rtx:ku.lng+(ks.rtx-T.x)*kv,rty:ku.lat+(ks.rty-T.y)*kv};var kr=jn.convertMC2LL(new cD(e.lbx,e.lby));var kt=jn.convertMC2LL(new cD(e.rtx,e.rty));return{MC:new ib(new cD(e.lbx,e.lby),new cD(e.rtx,e.rty)),LL:new ib(kr,kt)}},getZoomUnits:function(e){return Math.pow(2,(18-e))},setCoordType:function(e){this.coordsType=e}});function dI(){}e6.extend(dI,{RADIUS:6378137,EXTENT4326:[-180,-90,180,90],WORLD_EXTENT:[-180,-85,180,85],HALF_SIZE:20037508.342789244,METERS_PER_UNIT:111319.49079327358,EXTENT3857:[-20037508.342789244,-20037508.342789244,20037508.342789244,20037508.342789244],MAX_SAFE_Y:238107693.26496765,origin:[-20037508.342789244,20037508.342789244],size:156543.03392804097,gridSize:[256,256],resolutions:[156543.03392804097,78271.51696402048,39135.75848201024,19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564,1222.99245256282,611.49622628141,305.748113140705,152.8740565703525,76.43702828517625,38.21851414258813,19.109257071294063,9.554628535647032,4.777314267823516,2.388657133911758,1.194328566955879,0.5971642834779395,0.29858214173896974,0.14929107086948487,0.07464553543474244,0.03732276771737122],gridScaleFrom3857ToBDMC:0.5971642834779395,gridScaleFromBDMCTo3857:1.674581061974954,calcResolutions:function(i){if(this.resolutions.length-1<i){this.resolutions=[];for(var e=0;e<i;++e){this.resolutions.push(this.size/Math.pow(2,e))}}return this.resolutions},forEachTileCoord:function(kw,kv,T,kt){var e=this.getTileRangeForExtentFactory(kw,kv,T);for(var kr=e.minX,ku=e.maxX;kr<=ku;++kr){for(var kq=e.minY,ks=e.maxY;kq<=ks;++kq){kt([kv,kr,kq])}}},getTileRangeForExtentFactory:function(T,kr,i,kq){var e;switch(i.source){case"BD09MC":if(i.target==="EPSG3857"){e=this.getBDTileRangeForExtentAndZ(T,kr,kq)}else{e=this.getTileRangeForExtentAndZ(T,kr,kq)}break;case"EPSG3857":e=this.getTileRangeForExtentAndZ(T,kr,kq);break;default:e=this.getTileRangeForExtentAndZ(T,kr,kq);break}return e},getBDTileRangeForExtentAndZ:function(T,kr,kq){var i=[0,0,0];this.getBDTileCoordForXYAndZ_(T[0],T[1],kr,false,i);var e=i[1];var ks=i[2];this.getBDTileCoordForXYAndZ_(T[2],T[3],kr,true,i);return this.createOrUpdateTileRange(e,i[1],ks,i[2],kq)},getTileRangeForExtentAndZ:function(T,kr,kq){var i=[0,0,0];this.getTileCoordForXYAndZ_(T[0],T[3],kr,false,i);var e=i[1];var ks=i[2];this.getTileCoordForXYAndZ_(T[2],T[1],kr,true,i);return this.createOrUpdateTileRange(e,i[1],ks,i[2],kq)},getBDTileCoordForXYAndZ_:function(e,ku,ks,kr,kq){var kt=256*Math.pow(2,(18-ks));var T=e/kt;var i=ku/kt;if(kr){T=Math.ceil(T)-1;i=Math.ceil(i)-1}else{T=Math.floor(T);i=Math.floor(i)}return this.createOrUpdateTileCoord(ks,T,i,kq)},getTileCoordForXYAndZ_:function(kx,kw,ku,kv,e){var ky=this.origin;var i=(this.resolutions.length===0?this.calcResolutions(21)[ku]:this.resolutions[ku]);var kA=this.gridSize;var kq=kv?0.5:0;var T=kv?0.5:0;var kz=Math.floor((kx-ky[0])/i+kq);var ks=Math.floor((ky[1]-kw)/i+T);var kt=kz/kA[0];var kr=ks/kA[1];if(kv){kt=Math.ceil(kt)-1;kr=Math.ceil(kr)-1}else{kt=Math.floor(kt);kr=Math.floor(kr)}return this.createOrUpdateTileCoord(ku,kt,kr,e)},getTileCoordForCoordAndZ:function(T,i,e){return this.getTileCoordForXYAndZ_(T[0],T[1],i,false,e)},getTileRangeExtent:function(T,kt){var ku=this.origin;if(this.resolutions.length===0){this.calcResolutions(23)}var kr=this.resolutions[T[0]];var kv=this.gridSize;var ks=ku[0]+T[1]*kv[0]*kr;var kq=ku[1]-(T[2]+1)*kv[1]*kr;var i=ks+kv[0]*kr;var e=kq+kv[1]*kr;return this.createOrUpdateTileRange(ks,i,kq,e,kt)},getTileLeftBottomMCPoint:function(kr,T){var i=this.origin;if(this.resolutions.length===0){this.calcResolutions(23)}var kq=this.resolutions[kr[0]];var kt=this.gridSize;var e=i[0]+kr[1]*kt[0]*kq;var ku=i[1]-(kr[2]+1)*kt[1]*kq;var ks=gcoord.transform([e,ku],gcoord.EPSG3857,gcoord.BD09MC);return ks},getRangeExtent:function(i,ky,ku,kA,kq){var kv=this.calPiexlResolution(kA,kq);var kt=ky/2*kv;var kw=ku/2*kv;var ks=i[0]-kt;var T=i[0]+kt;var kr=i[1]-kw;var e=i[1]+kw;var kx=gcoord.transform([ks,kr],gcoord[kq.target],gcoord[kq.source]);var kz=gcoord.transform([T,e],gcoord[kq.target],gcoord[kq.source]);return this.createOrUpdateTileRange(kx[0],kz[0],kx[1],kz[1])},getMousePoint:function(kt,ks,i,kr,T){var kq=km(kt,ks);return this.calLngLatByMapViewPixelInverse(kq.clientPos,i,ks.width,ks.height,kr,T)},calLngLatByMapViewPixelInverse:function(kq,e,i,kx,ky,T){var kt=this.calPiexlResolution(ky,T);var ks=kq.x-i/2;var kr=kq.y-kx/2;var kv=e[0]+ks*kt;var ku=e[1]-kr*kt;var kw=gcoord.transform([kv,ku],gcoord[T.target],gcoord[T.source]);return kw},calPiexlResolution:function(T,i){var e;switch(i.target){case"BD09MC":e=Math.pow(2,(18-T));break;case"EPSG3857":e=this.resolutions[Math.floor(T)];break;default:e=Math.pow(2,(18-T));break}return e},getXYZCellPixelCoor:function(kt,kr,kq,i){var kv=this.gridSize;var ku;var ks;switch(i.source){case"GCJ02":case"EPSG3857":var T=Math.pow(2,kq-1)-(kr+1);var e=kt-Math.pow(2,kq-1);ku=e*kv[0];ks=T*kv[1];break;case"BD09MC":if(i.target==="EPSG3857"){ku=kt*kv[0];ks=kr*kv[1]}else{var T=Math.pow(2,kq-1)-(kr+1);var e=kt-Math.pow(2,kq-1);ku=e*kv[0];ks=T*kv[1]}default:break}return{x:ku,y:ks}},mcToPixel:function(i){var T=this.resolutions[Math.floor(zoom)];var e=i.lng/T;var kq=i.lat/T;return[e,kq]},getBaiduCellPixelCoor:function(e,kq,T){var i=256;return{x:e*i,y:kq*i}},getRelativePixelCoor:function(ks,kq){var i=this.origin;var kr=ks[0];var T=this.resolutions[Math.floor(kr)];var kt=this.gridSize;var e=i[0]/T+ks[1]*kt[0];var ku=i[1]/T-(ks[2]+1)*kt[1];return[kq[0]-e,kq[1]-ku]},getPointPixelCoor:function(e,kv,i){var kt;var ks;var T=Math.pow(2,(18-kv));var kq=this.resolutions[Math.floor(kv)];var kr=jn.convertMC2LL(e);switch(i.source){case"GCJ02":var ku=gcoord.transform([kr.lng,kr.lat],gcoord.BD09LL,gcoord.GCJ02);ku=gcoord.transform(ku,gcoord.WGS84,gcoord.EPSG3857);kt=ku[0]/kq;ks=ku[1]/kq;break;case"BD09LL":case"EPSG3857":var ku=gcoord.transform([kr.lng,kr.lat],gcoord.BD09LL,gcoord.EPSG3857);kt=ku[0]/kq;ks=ku[1]/kq;break;case"BD09MC":kt=e.lng/T;ks=e.lat/T;if(i.target==="BD09MC"){kt*=dI.gridScaleFromBDMCTo3857;ks*=dI.gridScaleFromBDMCTo3857}default:break}return[kt,ks]},getResolutionScale:function(i,e){var T;switch(e.target){case"BD09MC":T=this.gridScaleFrom3857ToBDMC;break;case"EPSG3857":T=this.gridScaleFromBDMCTo3857;break;default:T=this.gridScaleFrom3857ToBDMC;break}return T},getBaiduResolutionScale:function(T){var i=this.resolutions[Math.floor(T)];var e=Math.pow(2,(18-T));var kq=e/i;return kq},getTileCoordCenter:function(T){var e=this.origin;if(this.resolutions.length===0){this.calcResolutions(23)}var i=this.resolutions[T[0]];var kq=this.gridSize;return[e[0]+(T[1]+0.5)*kq[0]*i,e[1]-(T[2]+0.5)*kq[1]*i,]},transformBDmcPoint:function(kr,i){i=i||{};var T=i.source||"EPSG3857";var kq=jn.convertMC2LL(new cD(kr.lng,kr.lat));var e;switch(T){case"GCJ02":e=gcoord.transform([kq.lng,kq.lat],gcoord.BD09LL,gcoord.GCJ02);e=gcoord.transform(e,gcoord.WGS84,gcoord.EPSG3857);break;case"EPSG3857":e=gcoord.transform([kq.lng,kq.lat],gcoord.BD09LL,gcoord.EPSG3857);break;case"BD09MC":if(i.target==="EPSG3857"){e=gcoord.transform([kq.lng,kq.lat],gcoord.BD09LL,gcoord.EPSG3857)}else{e=[kr.lng,kr.lat]}break;default:e=gcoord.transform([kq.lng,kq.lat],gcoord.BD09LL,gcoord[T]);break}return e},transformPointArr:function(e,i,T){return gcoord.transform(e,gcoord[i||"BD09LL"],gcoord[T||"BD09MC"])},getTilesLoop:function(T,e){var i=Math.pow(2,T);while(e>i-1){e=e-i}while(e<0){e=e+i}return e},getLoopBox:function(e,kq){var i=this.HALF_SIZE*2;if(e[0]>0&&kq[2]<0){kq[2]=kq[2]+i}else{if(e[0]<0&&kq[0]>0){kq[0]=kq[0]-i}}return kq},createOrUpdateTileCoord:function(T,e,kq,i){if(i!==undefined){i[0]=T;i[1]=e;i[2]=kq;return i}else{return[T,e,kq]}},createOrUpdateTileRange:function(e,kq,kr,T,i){if(i!==undefined){i.minX=e;i.maxX=kq;i.minY=kr;i.maxY=T;return i}else{return{minX:e,maxX:kq,minY:kr,maxY:T}}},fromEPSG4326:function(T,kv,kt){var kr=T.length;var ks=kt>1?kt:2;var e=kv;if(e===undefined){if(ks>2){e=T.slice()}else{e=new Array(kr)}}for(var kq=0;kq<kr;kq+=ks){e[kq]=(this.HALF_SIZE*T[kq])/180;var ku=this.RADIUS*Math.log(Math.tan((Math.PI*(+T[kq+1]+90))/360));if(ku>this.MAX_SAFE_Y){ku=this.MAX_SAFE_Y}else{if(ku<-this.MAX_SAFE_Y){ku=-this.MAX_SAFE_Y}}e[kq+1]=ku}return e},toEPSG4326:function(T,ku,kt){var kr=T.length;var ks=kt>1?kt:2;var e=ku;if(e===undefined){if(ks>2){e=T.slice()}else{e=new Array(kr)}}for(var kq=0;kq<kr;kq+=ks){e[kq]=(180*T[kq])/this.HALF_SIZE;e[kq+1]=(360*Math.atan(Math.exp(T[kq+1]/this.RADIUS)))/Math.PI-90}return e},findParentGridAndPosition:function(kq,kA,kz,ku,kv,kx,kt){if(kz-1<0){return false}var kB=kq;var kw=kA;var T=kz;for(var ks=1;ks<=kt;ks++){var e=this.findParent(kB,kw,T,ks);if(!e){return false}var ky=this.getTileKey(e);var kr=ku.getData(ky);if(kr&&kr.status==="ready"){if(kv[ky]){continue}kx.setData(kr,this.drawIndex,0);kv[ky]=true;return true}kB=e.col;kw=e.row;T=e.zoom}},findParent:function(i,kr,T,kq){if(T-1<0){return null}var e=i%2;var ks=kr%2;return{col:Math.floor(i/2),row:Math.floor(kr/2),sonX:e,sonY:ks,thumbLB:[e*0.5,1-ks*0.5-0.5],thumbRT:[e*0.5+0.5,1-ks*0.5],radio:Math.pow(2,kq),zoom:T-1,useZoom:T-1}},getTileKey:function(e,kq){kq=kq||{};var i=typeof kq.useZoom==="number"?kq.useZoom:e.useZoom;var T=e.style||this.mapStyleId||"default";return this.mapType+"_"+T+"_"+e.col+"_"+e.row+"_"+e.zoom+"_"+i},lon2tile:function(i,e){return(Math.floor((i+180)/360*Math.pow(2,e)))},lat2tile:function(T,i){var e=Math.tan(T*Math.PI/180)+1/Math.cos(T*Math.PI/180);return(Math.floor((1-Math.log(e)/Math.PI)/2*Math.pow(2,i)))},tile2long:function(e,i){return(e/Math.pow(2,i)*360-180)},tile2lat:function(T,e){var i=Math.PI-2*Math.PI*T/Math.pow(2,e);return(180/Math.PI*Math.atan(0.5*(Math.exp(i)-Math.exp(-i))))}});function cx(i,e){if(i<-90){i=-90}else{if(i>90){i=90}}while(e<-180){e+=360}while(e>180){e-=360}e=e||0;i=i||0;cD.call(this,e,i)}cx.inherits(cD,"LatLng");e6.extend(cx.prototype,{equals:function(e){return(this.lat===e.lat&&this.lng===e.lng)},clone:function(){return new cx(this.lat,this.lng)},add:function(e){return new cx(this.lng+e.lng,this.lat+e.lat)},sub:function(e){return new cx(this.lat-e.lat,this.lng-e.lng)},mult:function(e){return new cx(this.lng*e,this.lat*e)},div:function(e){return new cx(this.lng/e,this.lat/e)},mag:function(){return Math.sqrt(this.lng*this.lng+this.lat*this.lat)},getLngSpan:function(e){var i=this.lng;var T=Math.abs(e-i);if(T>180){T=360-T}return T},toString:function(){return"LatLng"},toGeoJSON:function(){var i="Point";var T=[this.lng,this.lat];var e={type:"Feature",geometry:{type:i,coordinates:T},properties:this.properties};return e}});function cM(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}}e6.extend(cM.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._neLng<this._neLng&&e._swLat>this._swLat&&e._neLat<this._neLat)},getCenter:function(){if(this.isEmpty()){return null}return new cx((this._swLat+this._neLat)/2,(this._swLng+this._neLng)/2)},intersects:function(T){if(Math.max(T._swLng,T._neLng)<Math.min(this._swLng,this._neLng)||Math.min(T._swLng,T._neLng)>Math.max(this._swLng,this._neLng)||Math.max(T._swLat,T._neLat)<Math.min(this._swLat,this._neLat)||Math.min(T._swLat,T._neLat)>Math.max(this._swLat,this._neLat)){return false}var kr=Math.max(this._swLng,T._swLng);var i=Math.min(this._neLng,T._neLng);var kq=Math.max(this._swLat,T._swLat);var e=Math.min(this._neLat,T._neLat);this._sw=new cx(kq,kr);this._ne=new cx(e,i);this._swLng=kr;this._swLat=kq;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 T=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._neLng<i){this._ne.lng=this._neLng=i}if(!this._swLat||this._swLat>T){this._sw.lat=this._swLat=T}if(!this._neLat||this._neLat<T){this._ne.lat=this._neLat=T}},toSpan:function(){if(this.isEmpty()){return new cx(0,0)}return new cx(Math.abs(this._neLat-this._swLat),Math.abs(this._neLng-this._swLng))},union:function(i){if(i.isEmpty()){return false}var e=i.getSouthWest();var T=i.getNorthEast();if(this._swLat>e.lat){this._swLat=e.lat}if(this._swLng>e.lng){this._swLng=e.lng}if(this._neLat<T.lat){this._neLat=T.lat}if(this._neLng<T.lng){this._neLng=T.lng}this._sw=new cx(this._swLat,this._swLng);this._ne=new cx(this._neLat,this._neLng);return true},toString:function(){return this._swLat+", "+this._swLng+", "+this._neLat+", "+this._neLng}});window.COORDINATES_WGS84=1;window.COORDINATES_WGS84_MC=2;window.COORDINATES_GCJ02=3;window.COORDINATES_GCJ02_MC=4;window.COORDINATES_BD09=5;window.COORDINATES_BD09_MC=6;window.COORDINATES_MAPBAR=7;window.COORDINATES_51=8;function f3(){}f3.inherits(de,"Convertor");e6.extend(f3.prototype,{translate:function(i,kr,kq,T){kr=kr||1;kq=kq||5;if(i.length>10){T&&T({status:25});return}var e=C.apiHost+"?qt=coords&coords=";e6.each(i,function(ks){e+=ks.lng+","+ks.lat+";"});e=e.replace(/;$/gi,"");e=e+"&from="+kr+"&to="+kq+"&v=gl&type=webgl&ak="+eW;dm.request(e,function(kt){data=kt.content;if(typeof data!=="undefined"&&data!==null&&data.status===0){var ks=[];e6.each(data.result,function(ku){ks.push(new cD(ku.x,ku.y))});delete data.result;data.points=ks}else{if(kt.result&&kt.result.error){data={status:kt.result.errror,message:"访问错误请参考错误状态码https://lbsyun.baidu.com/index.php?title=webapi/appendix"}}}T&&T(data)})}});var em={idle:0,freeze:1,zooming:2,dragging:3,moving:4,readyToDrag:5,readyToPinch:6,pinching:7,stdMapCtrlDrag:8,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,arrowOpCodes:{37:1,38:2,39:4,40:8}};var ak={_map:null,_html:"<div class='BMap_opMask' unselectable='on'></div>",_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=bP(this._map.container,this._html);e6.on(e,"mouseup",function(T){if(T.button==2){hA(T)}});e6.on(e,"contextmenu",hA);e.style.display="none"},getDrawPoint:function(kq,kt,kr){kq=window.event||kq;var i=kq.offsetX||kq.layerX||0;var ks=parseInt(kq.offsetY)||parseInt(kq.layerY)||0;var T=kq.target||kq.srcElement;if(T!=ak.getDom(this._map)&&kt==true){while(T&&T!=this._map.container){if(!(T.clientWidth==0&&T.clientHeight==0&&T.offsetParent&&T.offsetParent.nodeName.toLowerCase()=="td")){i+=T.offsetLeft;ks+=T.offsetTop}T=T.offsetParent}}if(T!=ak.getDom(this._map)&&T!=this._map.container){return}if(typeof i==="undefined"||typeof ks==="undefined"){return}if(isNaN(i)||isNaN(ks)){return}if(kr){i=i+kr.x;ks=ks+kr.y}return this._map.pixelToPointIn(new fr(i,ks))},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 aS(){this._type="overlay"}aS.inherits(e6.BaseClass,"Overlay");aS.getZIndex=function(i,e){i=i*1;if(!i){return 0}if(e){i=jn.convertMC2LL(new cD(0,i)).lat}return(i*-100000)<<1};e6.extend(aS.prototype,{_i:function(T){this._map=T;if(!this.domElement&&bX(this.initialize)){this.domElement=this.initialize(T);if(this.domElement){this.domElement.style.WebkitUserSelect="none";if(this.enableDraggingMap!==undefined&&!this.enableDraggingMap&&!(this instanceof s)){var i=["mousedown","mouseout","mouseover","click","keydown","selectstart"];var e=this;e6.each(i,function(kq){e6.on(e.domElement,kq,aj)})}}}this.draw()},initialize:function(e){throw"initialize方法未实现"},draw:function(){throw"draw方法未实现"},remove:function(){if(this.domElement&&this.domElement.parentNode){this.domElement.parentNode.removeChild(this.domElement)}this.domElement=null;this.dispatchEvent(new fS("onremove"))},hide:function(){this._visible=false;e6.hide(this.domElement)},show:function(){this._visible=true;e6.show(this.domElement)},getMap:function(){return this._map},dispose:function(){e6.BaseClass.prototype.decontrol.call(this)}});function eJ(){e6.BaseClass.call(this);aS.call(this);this._visible=true;this._visibleInternal=true;this.zIndex=0;this.infoWindow=null;this._dblclickTime=0}eJ.inherits(aS,"OverlayInternal");e6.extend(eJ.prototype,{initialize:function(e){this.map=e;e6.BaseClass.call(this,this.hashCode);return null},draw:function(){},remove:function(){this.decontrol();aS.prototype.remove.call(this)},destroy:function(){},hide:function(){this._visible=false},show:function(){this._visible=true},getDom:function(){return this.domElement},getContainer:function(){return this.domElement},setClassName:function(){},setConfig:function(i){if(!i){return}for(var e in i){if(i.hasOwnProperty(e)){this._config[e]=i[e]}}},getPoint:function(T,kq){if(!T){return this.point}else{var e=kq?kq.width:0;var kr=kq?kq.height:0;if(this.map){var i=this.map.pointToPixelIn(this.point);if(this._config&&this._config.offset){i.x=i.x+this._config.offset.width+e;i.y=i.y+this._config.offset.height+kr}else{i.x=i.x+e;i.y=i.y+kr}return this.map.pixelToPointIn(i)}}},setZIndex:function(e){this.zIndex=e},isVisible:function(){if(!this.domElement){return false}return !!this._visible},enableMassClear:function(){this._config.enableMassClear=true},disableMassClear:function(){this._config.enableMassClear=false},showInternal:function(){this._visibleInternal=true},hideInternal:function(e){this._visibleInternal=false;this._hideInternalReason=e},addContextMenu:function(e){this._menu=e},removeContextMenu:function(e){this._menu=null}});function aQ(e){this.map=e;this._overlays={};this._overlayArray=[];this._customOverlays=[];e._overlays=this._overlays;e._overlayArray=this._overlayArray;e._customOverlays=this._customOverlays;this._zoomingOrMoving=false;this._init()}aQ.prototype._init=function(){if(this.map._renderType!=="webgl"){this._createOverlayContainers()}else{this._createWebGLOverlayContainers()}this._bind()};aQ.prototype._createOverlayContainers=function(){var e=this.map;e.temp.overlayDiv=e.overlayDiv=this._createOverlayDiv(e.platform,200);e.temp.overlayDivEx=e.overlayDivEx=this._createOverlayDiv(e.platform,50);e._panes.floatPane=this._createOverlayDiv(e.temp.overlayDiv,800);e._panes.markerMouseTarget=this._createOverlayDiv(e.temp.overlayDiv,700);e._panes.floatShadow=this._createOverlayDiv(e.temp.overlayDiv,600);e._panes.labelPane=this._createOverlayDiv(e.temp.overlayDiv,500);e._panes.markerPane=this._createOverlayDiv(e.temp.overlayDiv,400);if(e.isCanvasMap()){e._panes.mapPane=this._createOverlayDiv(e.temp.overlayDivEx,50)}else{e._panes.mapPane=this._createOverlayDiv(e.temp.overlayDiv,200)}};aQ.prototype._createWebGLOverlayContainers=function(){var e=this.map;e.temp.overlayDiv=e.overlayDiv=this._createOverlayDiv(e.platform,200);e._panes.floatPane=this._createOverlayDiv(e.temp.overlayDiv,800);e._panes.markerMouseTarget=this._createOverlayDiv(e.temp.overlayDiv,700);e._panes.floatShadow=this._createOverlayDiv(e.temp.overlayDiv,600);e._panes.labelPane=this._createOverlayDiv(e.temp.overlayDiv,500);e._panes.markerPane=this._createOverlayDiv(e.temp.overlayDiv,400)};aQ.prototype._createOverlayDiv=function(e,kq){var T=b3("div");var i=T.style;i.position="absolute";i.top=i.left=i.width=i.height="0";i.zIndex=kq;e.appendChild(T);return T};aQ.prototype._bind=function(){var kr=this.map;var kq=this;function i(kt){kq.draw(kt)}if(kr._renderType!=="webgl"){kr.addEventListener("load",i);kr.addEventListener("moveend",i);kr.addEventListener("resize",i);kr.addEventListener("zoomend",i);kr.addEventListener("zooming_inner",i)}else{kr.on("update",i)}kr.on("destroy",function(){kr._overlays={};kr._overlayArray=[];kr._customOverlays=[];kr.overlayDiv=null;kr.overlayDivEx=null;var kt=Object.keys(kr._panes);for(var ku=0;ku<kt.length;ku++){kr._panes[kt[ku]]=null}var kv=Object.keys(kr.temp);for(var ku=0;ku<kv.length;ku++){kr.temp[kv[ku]]=null}});kr.addEventListener("zoomend",function(kt){if(this.mapType==="B_EARTH_MAP"){if(this._earth.getZoom()<this._earth.zoomForNight+1){this.temp.overlayDiv.style.display="none";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display="none"}}else{if(this.temp.overlayDiv.style.display==="none"){this.temp.overlayDiv.style.display="";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display=""}if(this.temp.infoWin&&this.temp.infoWin.isOpen()){this.temp.infoWin.redraw()}}}}});kr.addEventListener("oncenterandzoom",function(kt){kq.draw(kt);if(this.mapType==="B_EARTH_MAP"){if(this._earth.getZoom()<this._earth.zoomForNight+1){this.temp.overlayDiv.style.display="none";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display="none"}}else{if(this.temp.overlayDiv.style.display==="none"){this.temp.overlayDiv.style.display="";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display=""}if(this.temp.infoWin&&this.temp.infoWin.isOpen()){this.temp.infoWin.redraw()}}}}});kr.addEventListener("maptypechange",function(kt){if(this.mapType==="B_EARTH_MAP"){if(this._panes.mapPane){this._panes.mapPane.style.display="none"}if(this._earth.getZoom()<this._earth.zoomForNight+1){this.temp.overlayDiv.style.display="none";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display="none"}}else{if(this.temp.overlayDiv.style.display==="none"){this.temp.overlayDiv.style.display="";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display=""}if(this.temp.infoWin&&this.temp.infoWin.isOpen()){this.temp.infoWin.redraw()}}}if(this._panes.markerPane){this._panes.markerPane.style.display="none"}}else{if(this._panes.mapPane){this._panes.mapPane.style.display=""}if(this._panes.markerPane){this._panes.markerPane.style.display=""}if(this.temp.overlayDiv.style.display==="none"){this.temp.overlayDiv.style.display="";if(this.temp.overlayDivEx){this.temp.overlayDivEx.style.display=""}if(this.temp.infoWin&&this.temp.infoWin.isOpen()){this.temp.infoWin.redraw()}}}kq.draw(kt)});kr.on("earthstatuschange",function ks(kt){kq.draw(kt)});kr.addEventListener("addoverlay",function(kx){var ku=kx.target;if(ku instanceof eJ){if(!kq._overlays[ku.hashCode]){kq._overlays[ku.hashCode]=ku;kq._overlayArray.push(ku)}}else{var kw=false;for(var kv=0,kt=kq._customOverlays.length;kv<kt;kv++){if(kq._customOverlays[kv]===ku){kw=true;break}}if(!kw){kq._customOverlays.push(ku)}}});kr.addEventListener("removeoverlay",function(kw){var ku=kw.target;if(ku instanceof eJ){delete kq._overlays[ku.hashCode];for(var kv=0;kv<kq._overlayArray.length;kv++){if(kq._overlayArray[kv]===ku){kq._overlayArray.splice(kv,1);break}}}else{for(var kv=0,kt=kq._customOverlays.length;kv<kt;kv++){if(kq._customOverlays[kv]===ku){kq._customOverlays.splice(kv,1);break}}}});kr.addEventListener("clearoverlays",function(kv){this.closeInfoWindow();this.closeSimpleInfoWindow();for(var ku in kq._overlays){if(kq._overlays[ku]._config.enableMassClear){this.removeOverlay(kq._overlays[ku])}}for(var kt=kq._customOverlays.length-1;kt>=0;kt--){if(kq._customOverlays[kt].enableMassClear!==false){this.removeOverlay(kq._customOverlays[kt]);kq._customOverlays.splice(kt,1)}}});kr.addEventListener("infowindowopen",function(ku){var kt=this.infoWindow;if(kt){e6.hide(kt.popDom);e6.hide(kt.shadowDom)}});function T(){if(this.getMapType()==="B_EARTH_MAP"||this._renderType==="webgl"){if(kq._zoomingOrMoving===false){this._panes.markerMouseTarget.style.display="none";kq._zoomingOrMoving=true}}}function e(kv){if(this.getMapType()==="B_EARTH_MAP"||this._renderType==="webgl"){if(kq._zoomingOrMoving===true){if(this._panes.markerMouseTarget){this._panes.markerMouseTarget.style.display=""}kq._zoomingOrMoving=false;for(var ku=0;ku<kq._overlayArray.length;ku++){var kt=kq._overlayArray[ku];if(kt instanceof j3===true){kt.draw(kv)}}}}}kr.addEventListener("tilt_changed",e);kr.addEventListener("heading_changed",e);kr.addEventListener("movestart",T);kr.addEventListener("moveend",e);kr.addEventListener("zoomstart",T);kr.addEventListener("zoomend",e);kr.addEventListener("animation_start",T);kr.addEventListener("animation_end",e);kr.addEventListener("displayoptions_changed",function(kt){if(this._displayOptions.overlay===false){this.temp.overlayDiv.style.display="none"}else{this.temp.overlayDiv.style.display=""}})};aQ.prototype.draw=function(kt){kt=kt||{};if(this.map.getMapType()==="B_EARTH_MAP"){for(var kr=0;kr<this._overlayArray.length;kr++){var T=this._overlayArray[kr];if(T instanceof iN===true){continue}if(this._zoomingOrMoving){if(T instanceof j3===true){continue}}T.draw(kt)}}else{for(var kr=0,kq=this._overlayArray.length;kr<kq;kr++){var T=this._overlayArray[kr];if(this._zoomingOrMoving&&T instanceof j3===true){continue}T.draw(kt)}}e6.each(this._customOverlays,function(e){e.draw(kt);if(!(e instanceof bR)){hI.sendMessage(aZ(4,2,12),["overlay","user_custom"])}});if(this.map.temp.infoWin){this.map.temp.infoWin.setPosition(kt.center,kt.zoom)}if(this.map.getMapType()!=="B_EARTH_MAP"&&this.map._renderType!=="webgl"){if(bD.DrawerSelector){var ks=bD.DrawerSelector.getDrawer(this.map);ks.setPalette()}}};bD.register(function(e){e._overlayMgr=new aQ(e)});function iN(e){eJ.call(this);this._config={strokeColor:"#000",strokeWeight:2,strokeOpacity:1,strokeStyle:"solid",dashArray:null,strokeLineCap:"round",strokeLineJoin:"round",enableMassClear:true,getParseTolerance:null,getParseCacheIndex:null,enableParse:true,enableEditing:false,mouseOverTolerance:5,geodesic:false,linkRight:false,clip:true,texture:null,textureSize:null,textureZoomWithMap:false,textureRepeat:true};this.setConfig(e);if(this._config.strokeOpacity<0||this._config.strokeOpacity>1){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 ib();this.points=[];this.greatCirclePoints=[];this._parseCache=[];this._holesCache=[];this._parseCacheGL=[];this._parseCacheGLRaw=[];this._areaCacheGL=[];this._strokeStyleInfoForGL=[[]];this._fillStyleInfoForGL="";this.vertexMarkers=[];this._temp={}}iN.JOININDEX={miter:0,round:1,bevel:2};iN.CAPINDEX={round:0,butt:1,square:2};iN.inherits(eJ,"Graph");iN.getGraphPoints=function(i){var e=[];if(!i||i.length===0){return e}if(typeof i==="string"){var T=i.split(";");e6.each(T,function(kr){var kq=kr.split(",");e.push(new cD(kq[0],kq[1]))})}if(i.constructor===Array&&i.length>0){e=i}return e};iN.parseTolerance={0:[0.09,0.005,0.0001,0.00001],1:[9000,500,20,1]};e6.extend(iN.prototype,{initialize:function(e){this.map=e;return null},draw:function(){},setPoints:function(e){this._clearCache();this.points=iN.getGraphPoints(e).slice(0);this._calcBounds()},setPathIn:function(e){this.setPoints(e)},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds=new ib();if(!this.hasMultipleParts){e6.each(this.points,function(i){e._bounds.extend(i)})}else{e6.each(this.points,function(i){e6.each(i,function(T){e._bounds.extend(T)})})}},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 cD(e.lng,e.lat);this._calcBounds()},setPositionAt:function(i,e){if(!e||!this.points[i]){return}var T=jn.convertLL2MC(e);this.setPointAt(i,T)},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 ib(jn.convertMC2LL(e.getSouthWest()),jn.convertMC2LL(e.getNorthEast()));i.setMinMax();return i},remove:function(){if(this.map){this.map.removeEventListener("onmousemove",this._graphMouseEvent);this.map.removeEventListener("onclick",this._graphClickEvent)}eJ.prototype.remove.call(this);this._clearCache();var e=new fS("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;he.load("poly",function(){e.addVertexs()},true)},disableEditing:function(){this._config.enableEditing=false;var e=this;he.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 T=0;if(this.points.length<=1){this._length=0;return T}for(var e=0;e<this.points.length-1;e++){T+=eC(this.points[e],this.points[e+1])}this._length=T;return T},getParsedPoints:function(){var e=this._simplification(this.points);if(this.hasMultipleParts){return e}return[e]},_simplification:function(kv){var e=this.map;var ku=this.getParseCacheIndex(e.getZoom());var kx;if(this._parseCache[ku]){kx=this._parseCache[ku]}else{var ks=kv;if(this.greatCirclePoints.length>0){ks=this.greatCirclePoints}var kr=e.config.coordType===2?1:e.config.coordType;var kt=this.getParseTolerance(e.getZoom(),kr);if(!this.hasMultipleParts){var kw=dZ(ks,kt)}else{var kw=[];for(var T=0;T<ks.length;T++){var kq=dZ(ks[T],kt);kw.push(kq)}}kx=this._parseCache[ku]=kw}return kx},_clearCache:function(){this._length=null;this._parseCache.length=0;this._parseCacheGL.length=0;this._parseCacheGLRaw.length=0;this._areaCacheGL.length=0},canRenderDataBeMerged:function(){var e=this._config;if(e.texture){return false}return true}});if(e6.Browser.ie&&document.namespaces&&!document.namespaces.olv){document.namespaces.add("olv","urn:schemas-microsoft-com:vml")}function bw(ks,kq,kz){var kw=false,ku=false,kx=false,kB=new fr(ks.x,ks.y),kA=new fr(kq.x,kq.y),kr=fU(kB,kz),T=fU(kA,kz),ky;var kD,kC;var kv=kz.minX,kt=kz.minY,i=kz.maxX,e=kz.maxY;do{if(kr.all==0&&T.all==0){kw=true;kx=true}else{if((kr.all&T.all)!=0){kx=true}else{if(kr.all!=0){ky=kr}else{ky=T}if(ky.top){kD=kB.x+(kA.x-kB.x)*(kt-kB.y)/(kA.y-kB.y);kC=kt}else{if(ky.bottom){kD=kB.x+(kA.x-kB.x)*(e-kB.y)/(kA.y-kB.y);kC=e}else{if(ky.right){kC=kB.y+(kA.y-kB.y)*(i-kB.x)/(kA.x-kB.x);kD=i}else{if(ky.left){kC=kB.y+(kA.y-kB.y)*(kv-kB.x)/(kA.x-kB.x);kD=kv}}}}ku=true;if(ky.all==kr.all){kB.x=Math.round(kD);kB.y=Math.round(kC);kr=fU(kB,kz)}else{kA.x=Math.round(kD);kA.y=Math.round(kC);T=fU(kA,kz)}}}}while(!kx);if(kw){return{pixel0:new fr(kB.x,kB.y),pixel1:new fr(kA.x,kA.y),clip:ku?true:false}}}function fU(i,kr){var T={top:0,bottom:0,right:0,left:0,all:0};var e=i.x,kq=i.y;if(kq<kr.minY){T.top=8;T.all+=T.top}else{if(kq>kr.maxY){T.bottom=4;T.all+=T.bottom}}if(e>kr.maxX){T.right=2;T.all+=T.right}else{if(e<kr.minX){T.left=1;T.all+=T.left}}return T}function dP(e){e=e.replace(/,/gm," ");e=e.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");e=e.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");e=e.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");e=e.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");e=e.replace(/([0-9])([+\-])/gm,"$1 $2");e=e.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");e=e.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");e=dP.compressSpaces(e);e=dP.trim(e);this.PathParser=new (function(i){this.tokens=i.split(" ");this.reset=function(){this.i=-1;this.command="";this.previousCommand="";this.start=new dP.Point(0,0);this.control=new dP.Point(0,0);this.current=new dP.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=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 T=new dP.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(T)};this.getAsControlPoint=function(){var T=this.getPoint();this.control=T;return T};this.getAsCurrentPoint=function(){var T=this.getPoint();this.current=T;return T};this.getReflectedControlPoint=function(){if(this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"&&this.previousCommand.toLowerCase()!="q"&&this.previousCommand.toLowerCase()!="t"){return this.current}var T=new dP.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return T};this.makeAbsolute=function(T){if(this.isRelativeCommand()){T.x+=this.current.x;T.y+=this.current.y}return T};this.addMarker=function(kq,kr,T){if(T!=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(T)}this.addMarkerAngle(kq,kr==null?null:kr.angleTo(kq))};this.addMarkerAngle=function(kq,T){this.points.push(kq);this.angles.push(T)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var kq=0;kq<this.angles.length;kq++){if(this.angles[kq]==null){for(var T=kq+1;T<this.angles.length;T++){if(this.angles[T]!=null){this.angles[kq]=this.angles[T];break}}}}return this.angles}})(e);this.bounds=function(){return this.draw(null)};this.draw=function(kK){var kM=this.PathParser;kM.reset();var kx=new dP.BoundingBox();if(kK!=null){kK.beginPath()}while(!kM.isEnd()){kM.nextCommand();switch(kM.command){case"M":case"m":var kH=kM.getAsCurrentPoint();kM.addMarker(kH);kx.addPoint(kH.x,kH.y);if(kK!=null){kK.moveTo(kH.x,kH.y)}kM.start=kM.current;while(!kM.isCommandOrEnd()){var kH=kM.getAsCurrentPoint();kM.addMarker(kH,kM.start);kx.addPoint(kH.x,kH.y);if(kK!=null){kK.lineTo(kH.x,kH.y)}}break;case"L":case"l":while(!kM.isCommandOrEnd()){var kQ=kM.current;var kH=kM.getAsCurrentPoint();kM.addMarker(kH,kQ);kx.addPoint(kH.x,kH.y);if(kK!=null){kK.lineTo(kH.x,kH.y)}}break;case"H":case"h":while(!kM.isCommandOrEnd()){var kq=new dP.Point((kM.isRelativeCommand()?kM.current.x:0)+kM.getScalar(),kM.current.y);kM.addMarker(kq,kM.current);kM.current=kq;kx.addPoint(kM.current.x,kM.current.y);if(kK!=null){kK.lineTo(kM.current.x,kM.current.y)}}break;case"V":case"v":while(!kM.isCommandOrEnd()){var kq=new dP.Point(kM.current.x,(kM.isRelativeCommand()?kM.current.y:0)+kM.getScalar());kM.addMarker(kq,kM.current);kM.current=kq;kx.addPoint(kM.current.x,kM.current.y);if(kK!=null){kK.lineTo(kM.current.x,kM.current.y)}}break;case"C":case"c":while(!kM.isCommandOrEnd()){var kO=kM.current;var ks=kM.getPoint();var kt=kM.getAsControlPoint();var kz=kM.getAsCurrentPoint();kM.addMarker(kz,kt,ks);kx.addBezierCurve(kO.x,kO.y,ks.x,ks.y,kt.x,kt.y,kz.x,kz.y);if(kK!=null){kK.bezierCurveTo(ks.x,ks.y,kt.x,kt.y,kz.x,kz.y)}}break;case"S":case"s":while(!kM.isCommandOrEnd()){var kO=kM.current;var ks=kM.getReflectedControlPoint();var kt=kM.getAsControlPoint();var kz=kM.getAsCurrentPoint();kM.addMarker(kz,kt,ks);kx.addBezierCurve(kO.x,kO.y,ks.x,ks.y,kt.x,kt.y,kz.x,kz.y);if(kK!=null){kK.bezierCurveTo(ks.x,ks.y,kt.x,kt.y,kz.x,kz.y)}}break;case"Q":case"q":while(!kM.isCommandOrEnd()){var kO=kM.current;var kt=kM.getAsControlPoint();var kz=kM.getAsCurrentPoint();kM.addMarker(kz,kt,kt);kx.addQuadraticCurve(kO.x,kO.y,kt.x,kt.y,kz.x,kz.y);if(kK!=null){kK.quadraticCurveTo(kt.x,kt.y,kz.x,kz.y)}}break;case"T":case"t":while(!kM.isCommandOrEnd()){var kO=kM.current;var kt=kM.getReflectedControlPoint();kM.control=kt;var kz=kM.getAsCurrentPoint();kM.addMarker(kz,kt,kt);kx.addQuadraticCurve(kO.x,kO.y,kt.x,kt.y,kz.x,kz.y);if(kK!=null){kK.quadraticCurveTo(kt.x,kt.y,kz.x,kz.y)}}break;case"A":case"a":while(!kM.isCommandOrEnd()){var kO=kM.current;var kw=kM.getScalar();var kv=kM.getScalar();var T=kM.getScalar()*(Math.PI/180);var ky=kM.getScalar();var ku=kM.getScalar();var kz=kM.getAsCurrentPoint();var kT=new dP.Point(Math.cos(T)*(kO.x-kz.x)/2+Math.sin(T)*(kO.y-kz.y)/2,-Math.sin(T)*(kO.x-kz.x)/2+Math.cos(T)*(kO.y-kz.y)/2);var kL=Math.pow(kT.x,2)/Math.pow(kw,2)+Math.pow(kT.y,2)/Math.pow(kv,2);if(kL>1){kw*=Math.sqrt(kL);kv*=Math.sqrt(kL)}var kD=(ky==ku?-1:1)*Math.sqrt(((Math.pow(kw,2)*Math.pow(kv,2))-(Math.pow(kw,2)*Math.pow(kT.y,2))-(Math.pow(kv,2)*Math.pow(kT.x,2)))/(Math.pow(kw,2)*Math.pow(kT.y,2)+Math.pow(kv,2)*Math.pow(kT.x,2)));if(isNaN(kD)){kD=0}var kC=new dP.Point(kD*kw*kT.y/kv,kD*-kv*kT.x/kw);var kr=new dP.Point((kO.x+kz.x)/2+Math.cos(T)*kC.x-Math.sin(T)*kC.y,(kO.y+kz.y)/2+Math.sin(T)*kC.x+Math.cos(T)*kC.y);var kJ=function(kU){return Math.sqrt(Math.pow(kU[0],2)+Math.pow(kU[1],2))};var kF=function(kV,kU){return(kV[0]*kU[0]+kV[1]*kU[1])/(kJ(kV)*kJ(kU))};var kR=function(kV,kU){return(kV[0]*kU[1]<kV[1]*kU[0]?-1:1)*Math.acos(kF(kV,kU))};var kS=kR([1,0],[(kT.x-kC.x)/kw,(kT.y-kC.y)/kv]);var kB=[(kT.x-kC.x)/kw,(kT.y-kC.y)/kv];var kA=[(-kT.x-kC.x)/kw,(-kT.y-kC.y)/kv];var kP=kR(kB,kA);if(kF(kB,kA)<=-1){kP=Math.PI}if(kF(kB,kA)>=1){kP=0}var kI=1-ku?1:-1;var kN=kS+kI*(kP/2);var i=new dP.Point(kr.x+kw*Math.cos(kN),kr.y+kv*Math.sin(kN));kM.addMarkerAngle(i,kN-kI*Math.PI/2);kM.addMarkerAngle(kz,kN-kI*Math.PI);kx.addPoint(kz.x,kz.y);if(kK!=null){var kF=kw>kv?kw:kv;var kG=kw>kv?1:kw/kv;var kE=kw>kv?kv/kw:1;kK.translate(kr.x,kr.y);kK.rotate(T);kK.scale(kG,kE);kK.arc(0,0,kF,kS,kS+kP,1-ku);kK.scale(1/kG,1/kE);kK.rotate(-T);kK.translate(-kr.x,-kr.y)}}break;case"Z":case"z":if(kK!=null){kK.closePath()}kM.current=kM.start}}return kx};this.getMarkers=function(){var kq=this.PathParser.getMarkerPoints();var ks=this.PathParser.getMarkerAngles();var kr=[];for(var T=0;T<kq.length;T++){kr.push([kq[T],ks[T]])}return kr}}dP.trim=function(e){return e.replace(/^\s+|\s+$/g,"")};dP.compressSpaces=function(e){return e.replace(/[\s\r\t\n]+/gm," ")};dP.Point=function(e,i){this.x=e;this.y=i};dP.Point.prototype.angleTo=function(e){return Math.atan2(e.y-this.y,e.x-this.x)};dP.Point.prototype.applyTransform=function(e){var i=this.x*e[0]+this.y*e[2]+e[4];var T=this.x*e[1]+this.y*e[3]+e[5];this.x=i;this.y=T};dP.BoundingBox=function(i,kq,e,T){this.x1=Number.NaN;this.y1=Number.NaN;this.x2=Number.NaN;this.y2=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-this.y1};this.addPoint=function(kr,ks){if(kr!=null){if(isNaN(this.x1)||isNaN(this.x2)){this.x1=kr;this.x2=kr}if(kr<this.x1){this.x1=kr}if(kr>this.x2){this.x2=kr}}if(ks!=null){if(isNaN(this.y1)||isNaN(this.y2)){this.y1=ks;this.y2=ks}if(ks<this.y1){this.y1=ks}if(ks>this.y2){this.y2=ks}}};this.addX=function(kr){this.addPoint(kr,null)};this.addY=function(kr){this.addPoint(null,kr)};this.addBoundingBox=function(kr){this.addPoint(kr.x1,kr.y1);this.addPoint(kr.x2,kr.y2)};this.addQuadraticCurve=function(kw,kv,ks,kr,ky,kx){var ku=kw+2/3*(ks-kw);var kt=kv+2/3*(kr-kv);var kA=ku+1/3*(ky-kw);var kz=kt+1/3*(kx-kv);this.addBezierCurve(kw,kv,ku,kA,kt,kz,ky,kx)};this.addBezierCurve=function(kE,kD,kv,kt,kA,ky,kG,kF){var kw=[kE,kD],ku=[kv,kt],ks=[kA,ky],kr=[kG,kF];this.addPoint(kw[0],kw[1]);this.addPoint(kr[0],kr[1]);for(jC=0;jC<=1;jC++){var kH=function(kL){return Math.pow(1-kL,3)*kw[jC]+3*Math.pow(1-kL,2)*kL*ku[jC]+3*(1-kL)*Math.pow(kL,2)*ks[jC]+Math.pow(kL,3)*kr[jC]};var kJ=6*kw[jC]-12*ku[jC]+6*ks[jC];var kK=-3*kw[jC]+9*ku[jC]-9*ks[jC]+3*kr[jC];var kI=3*ku[jC]-3*kw[jC];if(kK==0){if(kJ==0){continue}var kC=-kI/kJ;if(0<kC&&kC<1){if(jC==0){this.addX(kH(kC))}if(jC==1){this.addY(kH(kC))}}continue}var kx=Math.pow(kJ,2)-4*kI*kK;if(kx<0){continue}var kB=(-kJ+Math.sqrt(kx))/(2*kK);if(0<kB&&kB<1){if(jC==0){this.addX(kH(kB))}if(jC==1){this.addY(kH(kB))}}var kz=(-kJ-Math.sqrt(kx))/(2*kK);if(0<kz&&kz<1){if(jC==0){this.addX(kH(kz))}if(jC==1){this.addY(kH(kz))}}}};this.isPointInBox=function(kr,ks){return(this.x1<=kr&&kr<=this.x2&&this.y1<=ks&&ks<=this.y2)};this.addPoint(i,kq);this.addPoint(e,T)};function fp(i,e){this.id=bD.getGUID("symbol_icon_");this.size=(i instanceof je)?i:new je(2,2);this.anchor=(e instanceof je)?e:new je(this.size.width/2,this.size.height/2);this.data=null;this.offset=this.anchor;this.imageSize=this.size;this.imageOffset=new je(0,0);this.style={scale:1,rotation:0};this.srcSetObject={};this._initOptions={size:this.size,scale:this.style.scale,rotation:this.style.rotation};this.overlay=null;this.isReDraw=false}fp.prototype.add=function(){const e=document.createElement("canvas");e.width=this.size.width;e.height=this.size.height;this.context=e.getContext("2d")};fp.prototype.remove=function(){if(this.context){this.context.clearRect(0,0,this.context.canvas.width,this.context.canvas.height);this.context.canvas.width=0;this.context.canvas.height=0}this.context=null;this.data=null};fp.prototype.render=function(e){return true};fp.prototype.resetInitOptions=function(){this._initOptions=new je(this.size.width,this.size.height);this._initOptions.scale=this.style.scale;this._initOptions.rotation=this.style.rotation};fp.prototype.update=function(){var e=this.overlay;if(e){if(e.domElement){var kq=(this.style.scale-this._initOptions.scale)/this._initOptions.scale;if(kq>=0){kq=kq+1}else{kq=1+kq}var i=this._initOptions.rotation===0?this.style.rotation:(this.style.rotation-this._initOptions.rotation);while(i<0){i+=360}var T=e.domElement.style;T.width=this._initOptions.width+"px";T.height=this._initOptions.height+"px";T.transform="rotate("+i+"deg) scale("+kq+")"}if(!this.isReDraw){this._refresh(e)}}};fp.prototype._refresh=function(e){e.textureCoord=e.textureCoordGLMap=null;var i=new fS("onstatus_change");i.overlay=e;i.action="setIcon";i.imageUrlChanged=true;setTimeout(function(){e.fire(i)},100)};fp.prototype.generateRenderData=function(){var i=this.offset=this.anchor;var e=this.size;var T=[];T.push(-i.width,i.height-e.height,0);T.push(e.width-i.width,i.height-e.height,0);T.push(e.width-i.width,i.height,0);T.push(-i.width,i.height-e.height,0);T.push(e.width-i.width,i.height,0);T.push(-i.width,i.height,0);return{vertex:T}};fp.prototype.getCurrentImageUrl=function(){return this.id};fp.prototype.getRenderData=function(){this._renderData=this.generateRenderData();return this._renderData};fp.prototype.toString=function(){return"Symbol"};var fF={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 cc={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 dR(i,e){fp.call(this);e=e||{};this.style={anchor:e.anchor||new je(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 je(0,0);this.anchor=new je(0,0);this._rawPath=i;this._buildPath(true)}dR.inherits(fp,"SVGSymbol");dR.generateKey=function(kq,i){if(!kq){return null}if(parseInt(kq)){kq=parseInt(kq)}if(typeof kq==="number"){if(!fF[kq]&&![0,1,2,0,4][kq]){return null}}var e={anchor:i.anchor||new je(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 T=o({path:kq,style:e});return"symbol_svg_icon_"+T};e6.extend(dR.prototype,{_buildPath:function(kB){var kv=this;var kx=kv._rawPath;if(parseInt(kx)){kx=parseInt(kx)}if(fF[kx]){kx=fF[kx]}kv.id=dR.generateKey(kx,kv.style);if(!kv.id){return}switch(kx){case cc.BMap_Symbol_SHAPE_CIRCLE:var ky=kv._calSize(2),kw=ky,kG=kv.style.scale,kr=kv._anchor;this.size=new je(ky,kw);this.anchor=new je(ky/2+kr.width*kG,kw/2+kr.height*kG);kv.path=cc.BMap_Symbol_SHAPE_CIRCLE;break;case cc.BMap_Symbol_SHAPE_RECTANGLE:var ky=kv._calSize(4),kw=kv._calSize(2),kr=kv._anchor,kD=kv.style.strokeWeight!==undefined?kv.style.strokeWeight:kv.style.scale,kG=kv.style.scale;this.size=new je(ky,kw);this._originOffset=new je(Math.floor(-kD/2),Math.floor(-kD/2));this.anchor=new je(ky/2+kr.width*kG,kw/2+kr.height*kG);kv.path=cc.BMap_Symbol_SHAPE_RECTANGLE;break;case cc.BMap_Symbol_SHAPE_STAR:var ky=kv._calSize(20),kw=ky,kr=kv._anchor,kG=kv.style.scale;this.size=new je(ky,kw);this.anchor=new je(ky/2+kr.width*kG,kw/2+kr.height*kG);kv.path=cc.BMap_Symbol_SHAPE_STAR;break;default:var kx=new dP(kx),kq=kx.bounds(),kA=kv.style.rotation*Math.PI/180,kD=kv.style.strokeWeight!==undefined?kv.style.strokeWeight:kv.style.scale,kG=kv.style.scale,kr=kv._anchor;var kF=new je(Math.floor(kq.x1*kG-kD/2),Math.floor(kq.y1*kG-kD/2)),e={topleft:new fr(Math.floor(kq.x1*kG-kD/2)-kG*kr.width,Math.floor(kq.y1*kG-kD/2)-kG*kr.height),bottomleft:new fr(Math.floor(kq.x1*kG-kD/2)-kG*kr.width,Math.ceil(kq.y2*kG-kD/2)-kG*kr.height),topright:new fr(Math.ceil(kq.x2*kG+kD/2)-kG*kr.width,Math.floor(kq.y1*kG-kD/2)-kG*kr.height),bottomright:new fr(Math.ceil(kq.x2*kG+kD/2)-kG*kr.width,Math.ceil(kq.y2*kG+kD/2)-kG*kr.height)},i={},kE=[],ku=[];var kC=e.topleft.x===0?0:Math.atan(e.topleft.y/e.topleft.x),T=kC+kA;for(var kz in e){var kt=Math.cos(kA)*e[kz].x-Math.sin(kA)*e[kz].y,ks=Math.sin(kA)*e[kz].x+Math.cos(kA)*e[kz].y;i[kz]=new fr(kt,ks);kE.push(kt);ku.push(ks)}xmax=Math.max.apply(Math,kE),ymax=Math.max.apply(Math,ku),xmin=Math.min.apply(Math,kE),ymin=Math.min.apply(Math,ku);this.size=new je(Math.ceil(xmax-xmin),Math.ceil(ymax-ymin));this.anchor=new je(-xmin,-ymin);this._originOffset=new je(xmin-i.topleft.x,ymin-i.topleft.y);this._innerOffset=new fr(kF.width,kF.height);this._rotationAngle=kA;kv.path=kx;break}this.imageSize=new je(this.size.width,this.size.height);this.offset=this.anchor;if(kB){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(T){var kw=this,kq=this.style.scale,kx,ky=this.size;if(this.context){kx=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}kx.clearRect(0,0,this.size.width*2,this.size.height*2);kx.fillStyle=hO.convert2rgba(kw.style.fillColor,kw.style.fillOpacity);kx.strokeStyle=hO.convert2rgba(kw.style.strokeColor,kw.style.strokeOpacity);kx.save()}else{return false}kx.scale(2,2);kx.lineCap="round";kx.lineJoin="round";kx.lineWidth=kw.style.strokeWeight||kq;if(kw._originOffset){kx.translate(-kw._originOffset.width,-kw._originOffset.height)}if(kw._rotationAngle){kx.rotate(kw._rotationAngle)}if(kw._innerOffset){kx.translate(-kw._innerOffset.x,-kw._innerOffset.y)}switch(kw.path){case cc.BMap_Symbol_SHAPE_CIRCLE:kx.arc(ky.width/2,ky.height/2,kq,0,2*Math.PI);break;case cc.BMap_Symbol_SHAPE_RECTANGLE:kx.rect(0,0,4*kq,2*kq);break;case cc.BMap_Symbol_SHAPE_STAR:kx.beginPath();var ks=ky.width/2,ku=kq*10;var kr=(2*Math.PI)/10;for(var kt=11;kt!=0;kt--){var e=ku*(kt%2+1)/2;var kv=kr*kt;kx.lineTo((e*Math.sin(kv))+ks,(e*Math.cos(kv))+ks)}kx.closePath();break;default:kx.lineWidth=kx.lineWidth/kq;kx.scale(kq,kq);kw.path.draw(kx)}kx.fill();kx.stroke();kx.restore();this.data=kx.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=hO.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()}});bD.SymbolShapeType=cc;function jH(ks,kq,T){if(!ks||!kq){return}this.imageUrl=null;this.imageDom=null;if(typeof ks==="string"){this.imageUrl=ks}else{this.imageDom=ks;if(!this.imageDom.id){this.imageDom.id=bD.getGUID("icon_dom_")}}this.size=kq;var kr=new je(Math.floor(kq.width/2),Math.floor(kq.height/2));var i={offset:kr,imageOffset:new je(0,0)};T=T||{};for(var e in T){i[e]=T[e]}if(T.anchor){i.offset=T.anchor}this.anchor=this.offset=i.offset;this.imageOffset=i.imageOffset;this.infoWindowOffset=T.infoWindowOffset||this.offset;this.printImageUrl=T.printImageUrl||"";this.imageSize=T.imageSize||this.size;this.srcSetObject={};this.setImageSrcset(T.srcset||T.srcSet)}jH.prototype.setImageUrl=function(e){if(!e){return}this.imageUrl=e;this._renderData=null};jH.prototype.getCurrentImageUrl=function(){if(window.devicePixelRatio>1&&this.srcSetObject["2x"]){return this.srcSetObject["2x"]}return this.imageUrl};jH.prototype.setPrintImageUrl=function(e){if(!e){return}this.printImageUrl=e};jH.prototype.setSize=function(e){if(!e){return}this.size=new je(e.width,e.height);this._renderData=null};jH.prototype.setOffset=function(e){if(!e){return}this.anchor=this.offset=new je(e.width,e.height);this._renderData=null};jH.prototype.setAnchor=function(e){this.setOffset(e)};jH.prototype.setImageOffset=function(e){if(!e){return}this.imageOffset=new je(e.width,e.height);this._renderData=null};jH.prototype.setInfoWindowOffset=function(e){if(!e){return}this.infoWindowOffset=new je(e.width,e.height)};jH.prototype.setImageSize=function(e){if(!e){return}this.imageSize=new je(e.width,e.height)};jH.prototype.setImageSrcset=function(T){var e="";if(!T){return}for(var i in T){if(T.hasOwnProperty(i)){this.srcSetObject[i]=T[i];e=T[i]+" "+i+","}}this.srcSet=e};jH.prototype.toString=function(){return"Icon"};jH.prototype.generateRenderData=function(ks){var T=this.offset;var e=this.size;var ku=this.imageOffset;var kt=[];kt.push(-T.width,T.height-e.height,0);kt.push(e.width-T.width,T.height-e.height,0);kt.push(e.width-T.width,T.height,0);kt.push(-T.width,T.height-e.height,0);kt.push(e.width-T.width,T.height,0);kt.push(-T.width,T.height,0);if(ks!==0){for(var kr=0;kr<kt.length;kr+=3){var kq=vec2.fromValues(kt[kr],kt[kr+1]);vec2.rotate(kq,kq,[0,0],iP(-ks));kt[kr]=kq[0];kt[kr+1]=kq[1]}}return{vertex:kt}};jH.prototype.getRenderData=function(e){this._renderData=this.generateRenderData(e);return this._renderData};function ec(T,i){e6.BaseClass.call(this);this.content=T;this.map=null;this._config={width:0,height:0,maxWidth:600,offset:new je(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,canScroll:false,onClosing:function(){return true}};this.setConfig(i);if(this._config.width!==0){if(this._config.width<220){this._config.width=220}if(this._config.width>730){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=C.imgPath;this.overlay=null;hI.sendMessage(aZ(4,2,10),["overlay","infowindow"]);var e=this;he.load("infowindow",function(){e._draw()})}ec.inherits(e6.BaseClass,"InfoWindow");e6.extend(ec.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(){e6.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(){return this.latLng},getPoint:function(){var e=this.getPointIn();if(this.map.config.coordType===BMAP_COORD_GCJ02){var i=jn.convertMC2LL(e);return eP(i)}return jn.convertMC2LL(e)},getOffset:function(){return this._config.offset},dispose:function(){e6.BaseClass.prototype.decontrol.call(this)},toString:function(){return"InfoWindow"}});hX.prototype.openInfoWindow=function(T,e){T.latLng=new cx(e.lat,e.lng);var i=jn.convertLL2MC(e);this.openInfoWindowIn(T,i)};hX.prototype.closeInfoWindow=function(){var e=this.temp.infoWin||this.temp._infoWin;if(e&&e.overlay){e.overlay.closeInfoWindow()}};hX.prototype.openInfoWindowIn=function(kq,e){if(!kq||kq.toString()!=="InfoWindow"||!e||e.toString()!=="Point"){return}var i=this.temp;if(!i.marker){var T=new jH(C.imgPath+"blank.gif",{width:1,height:1});i.marker=new j3(e,{icon:T,width:1,height:1,offset:new je(0,0),infoWindowOffset:new je(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openInfoWindow(kq)};eJ.prototype.openInfoWindow=function(e){if(this.map){this.map.closeInfoWindow();e._visible=true;this.map.temp._infoWin=e;e.overlay=this;e6.BaseClass.call(e,e.hashCode)}};eJ.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 bj(T,i){eJ.call(this);this.content=T;this.map=null;this.domElement=null;this._config={width:0,offset:new je(0,0),styles:{backgroundColor:"#fff",border:"1px solid #f00",padding:"1px",whiteSpace:"nowrap",fontSize:"12px",zIndex:"80",MozUserSelect:"none"},point:null,enableMassClear:true};i=i||{};this.setConfig(i);if(this._config.width<0){this._config.width=0}this.point=this._config.point;hI.sendMessage(aZ(4,2,6),["overlay","dom_label"]);var e=this;he.load("marker",function(){e._draw()})}bj.inherits(eJ,"Label");e6.extend(bj.prototype,{setPoint:function(e){if(e&&e.toString()==="Point"&&!this.getMarker()){if(this.coordType===BMAP_COORD_GCJ02){var i=iI(e,3);this.point=this._config.point=new cD(i.lng,i.lat)}else{this.point=this._config.point=new cD(e.lng,e.lat)}}},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 je(e.width,e.height)},getOffset:function(){return this._config.offset},setStyle:function(e){e=e||{};this._config.styles=e6.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 h4(T,i){var kq={};for(var e in i){if(i.hasOwnProperty(e)){if(e==="position"){kq.point=jn.convertLL2MC(i[e]);this.latLng=new cx(i[e]["lat"],i[e]["lng"])}else{kq[e]=i[e]}}}bj.call(this,T,kq)}h4.inherits(bj,"LabelOut");e6.extend(h4.prototype,{toString:function(){return"Label"},setPosition:function(e){this.latLng=new cx(e.lat,e.lng);var i=jn.convertLL2MC(e);this.setPoint(i)},getPosition:function(){return this.latLng}});window.BMAP_ANIMATION_DROP=1;window.BMAP_ANIMATION_BOUNCE=2;function j3(e,i){eJ.call(this);i=i||{};this.delFlag=i.delFlag;this.point=e;this._rotation=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 je(0,0),opacity:1,icon:null,title:"",infoWindow:null,label:null,baseZIndex:0,clickable:true,zIndexFixed:false,isTop:false,enableMassClear:true,enableDragging:false,raiseOnDrag:false,restrictDraggingArea:false,startAnimation:"",enableCollisionDetection:false,rank:0,enableDraggingMap:false};this.setOptions(i);this._addlog();this._isDragging=false;var T=this;he.load("marker",function(){T._draw()})}j3.TOP_ZINDEX=aS.getZIndex(-90)+1000000;j3.DRAG_ZINDEX=j3.TOP_ZINDEX+1000000;j3._injectMethond=function(e){e6.extend(j3.prototype,e)};j3.inherits(eJ,"Marker");e6.extend(j3.prototype,{toString:function(){return"Marker"},_addlog:function(){var e=1;var i="normal";if(this._config.icon instanceof dR){e=2;i="svg_symbol"}else{if(this._config.icon instanceof fp){e=3;i="custom_symbol"}}hI.sendMessage(aZ(4,2,1,e),["overlay","marker",i])},setOptions:function(e){this.setConfig(e);if(!e.icon){this._config.icon=new jH(C.imgPath+"marker_red.png",new je(23,25),{offset:new je(10,25),infoWindowOffset:new je(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 bj)){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){if(this.map.config.coordType===BMAP_COORD_GCJ02){var i=iI(e,3);this.point=this._config.point=new cD(i.lng,i.lat);this.latLng=jn.convertMC2LL(i)}else{this.point=this._config.point=new cD(e.lng,e.lat);this.latLng=jn.convertMC2LL(e)}}},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 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},getRotation:function(){return this._rotation}});function s(e,T){this.latLng=new cx(e.lat,e.lng);var i=jn.convertLL2MC(e);j3.call(this,i,T)}s.inherits(j3,"MarkerOut");e6.extend(s.prototype,{toString:function(){return"Marker"},toGeoJSON:function(){var i="Point";var T=[this.latLng.lng,this.latLng.lat];var e={type:"Feature",geometry:{type:i,coordinates:T},properties:this.properties};return e},updateByGeoJSON:function(T){var e=new gH();var ks=e.readFeaturesFromObject(T)||[];for(var kq=0,kr=ks.length;kq<kr;++kq){if(ks[kq] instanceof s){this.properties=ks[kq].properties;this.setPosition(ks[kq].getPosition());break}}},setPosition:function(e){this.latLng=new cx(e.lat,e.lng);var i=jn.convertLL2MC(e);this.setPositionIn(i)},getPosition:function(){return this.latLng},});window.BMAP_SHAPE_CIRCLE=1;window.BMAP_SHAPE_RECT=2;function eo(i,e,T){eJ.call(this,e,T);this.domElement=null;this.point=i;T=T||{};this._config={};this._config.height=e||0;this._config.size=typeof T.size==="number"?T.size:50;this._config.fillOpacity=typeof T.fillOpacity==="number"?T.fillOpacity:0.8;this._config.shape=typeof T.shape==="number"?T.shape:1;ch(this._config.fillOpacity,0,1);if(T.fillColor===""){this._config.fillColor=""}else{this._config.fillColor=T.fillColor?T.fillColor:"#f00"}this._config.icon=(T.icon instanceof jH||T.icon instanceof fp)?T.icon:"";this._config.enableMassClear=T.enableMassClear||true;hI.sendMessage(aZ(4,2,2),["overlay","marker3d"]);var kq=this;he.load("marker",function(){kq._draw()})}eo.inherits(eJ,"Marker3D");e6.extend(eo.prototype,{setPoint:function(e){if(this.map.config.coordType===BMAP_COORD_GCJ02){var T=iI(e,3);this.point=this._config.point=new cD(T.lng,T.lat);this.latLng=jn.convertMC2LL(T)}else{this.point=this._config.point=new cD(e.lng,e.lat);this.latLng=jn.convertMC2LL(e)}var i=new fS("onstatus_change");i.overlay=this;i.action="setPoint";this.fire(i)},setPositionIn:function(e){this.setPoint(e)},getPositionIn:function(){return this.getPoint()},setDomAttribute:function(i,T){var e=new fS("onlineupdate");e.overlay=this;this.dispatchEvent(e)}});function el(i,e,kq){this.latLng=new cx(i.lat,i.lng);var T=jn.convertLL2MC(i);eo.call(this,T,e,kq)}el.inherits(eo,"Marker3d");e6.extend(el.prototype,{toString:function(){return"Marker3D"},setHeight:function(e){this._config.height=Number(e);this.draw();var i=new fS("onlineupdate");i.overlay=this;this.dispatchEvent(i)},getHeight:function(){return this._config.height},setFillOpacity:function(e){if(e>1||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 kq=i.getCurrentImageUrl()!==e;this._config.icon=i;this.textureCoord=this.textureCoordGLMap=null;this.draw();var T=new fS("onstatus_change");T.overlay=this;T.action="setIcon";T.imageUrlChanged=kq;this.fire(T)}},getIcon:function(){return this._config.icon},setPosition:function(e){this.latLng=new cx(e.lat,e.lng);var i=jn.convertLL2MC(e);this.setPositionIn(i)},getPosition:function(){var e=this.getPositionIn();return jn.convertMC2LL(e)}});function f4(T,e){iN.call(this,e);this._normalizedBounds=new ib();this.setPoints(T);this._addlog(e);var i=this;he.load("poly",function(){i._draw()})}f4.inherits(iN,"Polyline");e6.extend(f4.prototype,{_addlog:function(e){var i=1;var T="normal";if(e&&e.strokeTexture){i=2;T="texture"}hI.sendMessage(aZ(4,2,3,i),["overlay","polyline",T])},getBoundsIn:function(e){if(!e){this._bounds.setMinMax();return this._bounds}this._normalizedBounds.setMinMax();return this._normalizedBounds},setPoints:function(kt){this._clearCache();this.points=iN.getGraphPoints(kt).slice(0);if(this._config.geodesic===true){this.greatCirclePoints.length=0;for(var kr=0;kr<this.points.length-1;kr++){this.calcGreatCirclePoints(this.points[kr],this.points[kr+1])}}else{if(this._config.linkRight){var ku=[];var ks=null;for(var kr=0;kr<this.points.length-1;kr++){if(!kr){ku.push(this.points[kr])}var T=ks||this.points[kr];ks=this.points[kr+1];var kq=eC(ks,T);if(kq>15437726){if(ks.lng<T.lng){ks.lng+=hX.WORLD_SIZE_MC}else{ks.lng-=hX.WORLD_SIZE_MC}}ku.push(ks)}this.points=ku}}this._calcBounds();this.draw();var e=new fS("onlineupdate");e.overlay=this;this.dispatchEvent(e);if(this._visible&&this._config.enableEditing===true&&!this._config.geodesic){this.clearVertexs&&this.clearVertexs();this.addVertexs&&this.addVertexs()}},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds.setNorthEast(null);e._bounds.setSouthWest(null);if(e.greatCirclePoints&&e.greatCirclePoints.length>0){e6.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{e6.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<-hX.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>hX.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-hX.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=hX.WORLD_SIZE_MC_HALF}},calcGreatCirclePoints:function(kq,T){var ks=kq.latLng;var kr=T.latLng;if(ks.equals(kr)){return}var e=jn.getDistance(iP(ks.lng),iP(ks.lat),iP(kr.lng),iP(kr.lat));if(e<250000){return}var kw=Math.round(e/150000);var kA=this.calcAngularDistance(ks,kr);this.greatCirclePoints.push(kq);var kz=ks.lng;var ky=kq;for(var kt=0;kt<kw;kt++){var kv=this.calcMiddlePoint(ks,kr,kt/kw,kA);var kx=jn.convertLL2MC(kv);var ku=kx.lng;var kB=eC(kx,ky);if(kB>30037726){if(kx.lng<ky.lng){kx.lng+=hX.WORLD_SIZE_MC}else{kx.lng-=hX.WORLD_SIZE_MC}}this.greatCirclePoints.push(kx);ky=kx}var kB=eC(T,ky);if(kB>30037726){if(T.lng<ky.lng){T.lng+=hX.WORLD_SIZE_MC}else{T.lng-=hX.WORLD_SIZE_MC}}this.greatCirclePoints.push(T)},calcMiddlePoint:function(kx,kw,ky,kC){var kr=kx.lat;var kq=kw.lat;var kB=kx.lng;var kz=kw.lng;var kD=iP(kr);var kA=iP(kq);var i=iP(kB);var e=iP(kz);var kF=Math.sin((1-ky)*kC)/Math.sin(kC);var kE=Math.sin(ky*kC)/Math.sin(kC);var ku=kF*Math.cos(kD)*Math.cos(i)+kE*Math.cos(kA)*Math.cos(e);var kt=kF*Math.cos(kD)*Math.sin(i)+kE*Math.cos(kA)*Math.sin(e);var ks=kF*Math.sin(kD)+kE*Math.sin(kA);var T=Math.atan2(ks,Math.sqrt(Math.pow(ku,2)+Math.pow(kt,2)));var kv=Math.atan2(kt,ku);return new cD(fi(kv),fi(T))},calcAngularDistance:function(kr,i){var ks=iP(kr.lat);var kq=iP(i.lat);var T=iP(kr.lng);var e=iP(i.lng);return Math.acos(Math.sin(ks)*Math.sin(kq)+Math.cos(ks)*Math.cos(kq)*Math.cos(Math.abs(e-T)))}});function br(kr,e){if(!kr||kr.length===0){return}var kq=[];for(var T=0;T<kr.length;T++){kq[T]=jn.convertLL2MC(kr[T])}f4.call(this,kq,e)}br.inherits(f4,"PolylineOut");e6.extend(br.prototype,{toString:function(){return"Polyline"},toGeoJSON:function(){var kq="LineString";var kr=[];var ks=this.getPath();for(var T=0;T<ks.length;T++){kr.push([ks[T].lng,ks[T].lat])}var e={type:"Feature",geometry:{type:kq,coordinates:kr},properties:this.properties};return e},updateByGeoJSON:function(T){var e=new gH();var ks=e.readFeaturesFromObject(T)||[];for(var kq=0,kr=ks.length;kq<kr;++kq){if(ks[kq] instanceof br){this.properties=ks[kq].properties;this.setPath(ks[kq].getPath());break}}},setPath:function(kq){if(!kq||kq.length===0){return}var T=[];for(var e=0;e<kq.length;e++){T[e]=jn.convertLL2MC(kq[e])}this.setPathIn(T);this._mouseEventPixels=null},getPath:function(){var e=this.getPathIn();if(!e||e.length===0){return[]}var kq=[];for(var T=0;T<e.length;T++){kq[T]=jn.convertMC2LL(e[T])}return kq},getBounds:function(i){var e=this.getBoundsIn(i);var T=new ib(jn.convertMC2LL(e.getSouthWest()),jn.convertMC2LL(e.getNorthEast()));return T}});function g0(T,kq,e){iN.call(this,e);this._normalizedBounds=new ib();this._cps=kq;this._path=T;this.setPoints(T);hI.sendMessage(aZ(4,2,7),["overlay","bezier"]);var i=this;he.load("poly",function(){i._draw()})}g0.inherits(f4,"BezierCurve");e6.extend(g0.prototype,{getBoundsIn:function(e){if(!e){this._bounds.setMinMax();return this._bounds}this._normalizedBounds.setMinMax();return this._normalizedBounds},setPoints:function(e){this._clearCache();this.points=iN.getGraphPoints(e).slice(0);this.points=this.calcBezierPoints(this.points,this._cps);this._calcBounds()},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds.setNorthEast(null);e._bounds.setSouthWest(null);if(e.greatCirclePoints&&e.greatCirclePoints.length>0){e6.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{e6.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<-hX.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>hX.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-hX.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=hX.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(kq,ks){var T=[];for(var e=0;e<kq.length-1;e++){var kr=[kq[e],ks[e][0],ks[e][1],kq[e+1]];T=T.concat((this.bezierbetweenTwoP(kr)))}return T},bezierbetweenTwoP:function(ks){var T=100;var kr=1/T;var e=[];for(var kq=0;kq<T;kq++){e.push(this.getPointOnCubicBezier(ks,kq*kr))}return e},getPointOnCubicBezier:function(kt,kx){var i;var ks;var kq;var ky;var kr;var T;var kw;var e;var kv;var ku;kq=3*(kt[1].lng-kt[0].lng);ks=3*(kt[2].lng-kt[1].lng)-kq;i=kt[3].lng-kt[0].lng-kq-ks;T=3*(kt[1].lat-kt[0].lat);kr=3*(kt[2].lat-kt[1].lat)-T;ky=kt[3].lat-kt[0].lat-T-kr;kw=kx*kx;e=kw*kx;kv=(i*e)+(ks*kw)+(kq*kx)+kt[0].lng;ku=(ky*e)+(kr*kw)+(T*kx)+kt[0].lat;return new cD(kv,ku)}});function cN(kr,kt,e){if(!kr||kr.length===0){return}this.userPath=kr;this.userCps=kt;var kq=[];for(var T=0;T<kr.length;T++){kq[T]=jn.convertLL2MC(kr[T])}if(!kt||kt.length===0){return}var ks=[];for(var T=0;T<kt.length;T++){ks[T]=[];ks[T][0]=jn.convertLL2MC(kt[T][0]);if(kt[T][1]){ks[T][1]=jn.convertLL2MC(kt[T][1])}else{ks[T][1]=jn.convertLL2MC(kt[T][0])}}g0.call(this,kq,ks,e)}cN.inherits(g0,"BezierCurveOut");e6.extend(cN.prototype,{toString:function(){return"BezierCurve"},setPath:function(kq){if(!kq||kq.length===0){return}this.userPath=kq;var T=[];for(var e=0;e<kq.length;e++){T[e]=jn.convertLL2MC(kq[e])}this.setPathIn(T);this._mouseEventPixels=null},getPath:function(){return this.userPath;var e=this.getPathIn();if(!e||e.length===0){return[]}var kq=[];for(var T=0;T<e.length;T++){kq[T]=jn.convertMC2LL(e[T])}return kq},getControlPoints:function(){return this.userCps;var e=this.getCpsIn();if(!e||e.length===0){return[]}var kq=[];for(var T=0;T<e.length;T++){kq[T]=[];kq[T][0]=jn.convertMC2LL(e[T][0]);kq[T][1]=jn.convertMC2LL(e[T][1])}return kq},setControlPoints:function(kq){if(!kq||kq.length===0){return}this.userCps=kq;var T=[];for(var e=0;e<kq.length;e++){T[e]=[];T[e][0]=jn.convertLL2MC(kq[e][0]);if(kq[e][1]){T[e][1]=jn.convertLL2MC(kq[e][1])}else{T[e][1]=jn.convertLL2MC(kq[e][0])}}this.setCpsIn(T)},getBounds:function(i){var e=this.getBoundsIn(i);var T=new ib(jn.convertMC2LL(e.getSouthWest()),jn.convertMC2LL(e.getNorthEast()));return T}});function eu(e,T){iN.call(this,T);this._normalizedBounds=new ib();this.setPoints(e);var i=this;he.load("poly",function(){i._draw()})}eu.inherits(f4,"PolylineMultipart");e6.extend(eu.prototype,{setPoints:function(e){if(!e){return}this._clearCache();this.points=this._unifyArgs(e);this._calcBounds()},_unifyArgs:function(T){var e=[];var i=[];if(T.constructor===Array){if(T[0].constructor===cD){i.push(T)}else{i=T}}else{if(typeof T==="string"){i.push(T)}}e6.each(i,function(kq){e.push(iN.getGraphPoints(kq))});return e},setPointAt:function(i,e,T){T=T||0;if(!e||!this.points[T]||!this.points[T][i]){return}this._clearCache();this.points[T][i]=new cD(e.lng,e.lat);this._calcBounds()},getBoundsIn:function(e){if(!e){this._bounds.setMinMax();return this._bounds}this._normalizedBounds.setMinMax();return this._normalizedBounds},_calcBounds:function(){if(!this.points){return}var e=this;e._bounds.setNorthEast(null);e._bounds.setSouthWest(null);if(e.greatCirclePoints&&e.greatCirclePoints.length>0){e6.each(e.greatCirclePoints,function(i){e._bounds.extend(i)})}else{e6.each(e.points,function(i){e6.each(i,function(T){e._bounds.extend(T)})})}e._normalizedBounds.setSouthWest(e._bounds.getSouthWest());e._normalizedBounds.setNorthEast(e._bounds.getNorthEast());if(e._normalizedBounds.sw.lng<-hX.WORLD_SIZE_MC_HALF||e._normalizedBounds.ne.lng>hX.WORLD_SIZE_MC_HALF){e._normalizedBounds.sw.lng=-hX.WORLD_SIZE_MC_HALF;e._normalizedBounds.ne.lng=hX.WORLD_SIZE_MC_HALF}}});function ht(T,e){iN.call(this,e);e=e||{};if(typeof e.fillOpacity==="number"){this._config.fillOpacity=e.fillOpacity}else{this._config.fillOpacity=0.6}ch(this._config.fillOpacity,0,1);if(e.fillColor===""){this._config.fillColor=""}else{this._config.fillColor=e.fillColor?e.fillColor:"#fff"}this._parseFillCacheWebGL=[];this.setPoints(T,e);hI.sendMessage(aZ(4,2,4),["overlay","polygon"]);var i=this;he.load("poly",function(){i._draw()})}ht.inherits(iN,"Polygon");e6.extend(ht.prototype,{setPoints:function(ks){var kq=[];if(typeof ks==="string"||ks.length===1||ks[0] instanceof cD||ks[0] instanceof cx||this instanceof g8||ks.length===0){if(ks.length===1){ks=ks[0]}var e=this._processSinglePointArray(ks);this._userPoints=e.userPoints;kq=e.innerPoints;this.hasMultipleParts=false}else{this._userPoints=[];for(var kr=0;kr<ks.length;kr++){var T=this._processSinglePointArray(ks[kr]);this._userPoints.push(T.userPoints);kq.push(T.innerPoints)}this.hasMultipleParts=true}iN.prototype.setPoints.call(this,kq)},setPathIn:function(e){this.setPoints(e)},_processSinglePointArray:function(e){var i=iN.getGraphPoints(e).slice(0);innerPoints=i.slice(0);if(innerPoints.length>1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new cD(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 cD(e.lng,e.lat);this.points[i]=new cD(e.lng,e.lat);if(i===0&&!this.points[0].equals(this.points[this.points.length-1])){this.points[this.points.length-1]=new cD(e.lng,e.lat)}this._calcBounds()},setPositionAt:function(i,e){if(!this._userPoints[i]){return}var T=jn.convertLL2MC(e);this.setPointAt(i,T)},getPoints:function(){var e=this._userPoints;if(e.length===0){e=this.points}return e},getPathIn:function(){return this.getPoints()}});function iU(T,e){if(!T||T.length===0){return}var i=this.setPath(T,true);ht.call(this,i,e)}iU.inherits(ht,"PolygonOut");e6.extend(iU.prototype,{toString:function(){return"Polygon"},toGeoJSON:function(){var kr="Polygon";var ks=[];var ku=this.getPath();if(this.hasMultipleParts){kr="Multi"+kr;for(var kq=0;kq<ku.length;kq++){var kt=[];for(var T=0;T<ku.length;T++){kt.push([ku[kq][T].lng,ku[kq][T].lat])}ks.push(kt)}}else{for(var kq=0;kq<ku.length;kq++){ks.push([ku[kq].lng,ku[kq].lat])}}var e={type:"Feature",geometry:{type:kr,coordinates:[ks]},properties:this.properties};return e},updateByGeoJSON:function(T){var e=new gH();var ks=e.readFeaturesFromObject(T)||[];for(var kq=0,kr=ks.length;kq<kr;++kq){if(ks[kq] instanceof iU){this.properties=ks[kq].properties;this.setPath(ks[kq].getPath());break}}},setPath:function(kv,T){if(!kv||kv.length===0){return}var ku=[];if(typeof kv==="string"||kv[0] instanceof cD||kv[0] instanceof cx){var e=this._processSinglePointArray(kv);for(var kt=0;kt<e.innerPoints.length;kt++){ku[kt]=jn.convertLL2MC(e.innerPoints[kt])}}else{for(var kt=0;kt<kv.length;kt++){var kq=this._processSinglePointArray(kv[kt]);var ks=[];for(var kr=0;kr<kq.innerPoints.length;kr++){ks[kr]=jn.convertLL2MC(kq.innerPoints[kr])}ku.push(ks)}}if(T){return ku}this.setPathIn(ku);this._mouseEventPixels=null},getPath:function(){var e=this.getPathIn();if(!e||e.length===0){return[]}var ks=[];if(this.hasMultipleParts){for(var kq=0;kq<e.length;kq++){var kr=[];for(var T=0;T<e[kq].length;T++){kr[T]=jn.convertMC2LL(e[kq][T])}ks.push(kr)}}else{for(var kq=0;kq<e.length;kq++){ks[kq]=jn.convertMC2LL(e[kq])}}return ks}});function g8(i,e,T){this.point=i;this.radius=Math.abs(e);ht.call(this,[],T)}g8.parseTolerance={0:[0.01,0.0001,0.00001,0.000004],1:[1000,10,1,0.4]};g8.inherits(ht,"Circle");e6.extend(g8.prototype,{initialize:function(e){this.map=e;this.points=this._getPerimeterPoints(this.point,this.radius);this._calcBounds();return null},getPoint:function(){return this.point},setPoint:function(e){if(!e){return}this.point=e;this.latLng=jn.convertMC2LL(e)},setCenterIn:function(e){var i=arguments[1];this.setPoint(e,i)},setRadius:function(e){this.radius=Math.abs(e)},getCenterIn:function(){return this.point},getRadius:function(){return this.radius},_getPerimeterPoints:function(e,kx){if(!e||!kx||!this.map){return[]}var T=this.map;var ku=e.lng;var ks=e.lat;var kD=jn.convertMC2LL(e);ku=kD.lng;ks=kD.lat;var kE=[];var kz=kx/jn.EARTHRADIUS;var kw=(Math.PI/180)*ks;var kC=(Math.PI/180)*ku;for(var kv=0;kv<360;kv+=9){var kt=(Math.PI/180)*kv;var kA=Math.asin(Math.sin(kw)*Math.cos(kz)+Math.cos(kw)*Math.sin(kz)*Math.cos(kt));var ky=Math.atan2(Math.sin(kt)*Math.sin(kz)*Math.cos(kw),Math.cos(kz)-Math.sin(kw)*Math.sin(kA));var kB=((kC-ky+Math.PI)%(2*Math.PI))-Math.PI;var kr=new cx(kA*(180/Math.PI),kB*(180/Math.PI));kE.push(jn.convertLL2MC(kr))}var kq=kE[0];kE.push(new cD(kq.lng,kq.lat));if(kq){this._radiusMercator=Math.sqrt(Math.pow(kq.lng-this.point.lng,2)+Math.pow(kq.lat-this.point.lat,2))}else{this._radiusMercator=this.radius}return kE}});function aV(i,e,kq){this.latLng=new cx(i.lat,i.lng);var T=jn.convertLL2MC(i);g8.call(this,T,e,kq)}aV.inherits(g8,"CircleOut");e6.extend(aV.prototype,{toString:function(){return"Circle"},setCenter:function(e){this.latLng=new cx(e.lat,e.lng);var i=jn.convertLL2MC(e);this.setCenterIn(i)},getCenter:function(){return this.latLng},getPath:function(){var e=this.getPathIn();if(!e||e.length===0){return[]}var kq=[];for(var T=0;T<e.length;T++){kq[T]=jn.convertMC2LL(e[T])}return kq},toGeoJSON:function(){var kq="Polygon";var kr=[];var ks=this.getPath();for(var T=0;T<ks.length;T++){kr.push([ks[T].lng,ks[T].lat])}var e={type:"Feature",geometry:{type:kq,coordinates:[kr]},properties:this.properties};return e},updateByGeoJSON:function(e){}});function kf(kq,e,i){iN.call(this,i);i=i||{};if(typeof i.topFillOpacity==="number"){this._config.topFillOpacity=i.topFillOpacity}else{this._config.topFillOpacity=0.6}if(typeof i.sideFillOpacity==="number"){this._config.sideFillOpacity=i.sideFillOpacity}else{this._config.sideFillOpacity=0.8}ch(this._config.sideFillOpacity,0,1);if(i.topFillColor===""){this._config.topFillColor=""}else{this._config.topFillColor=i.topFillColor?i.topFillColor:"#fff"}if(i.sideFillColor===""){this._config.sideFillColor=""}else{this._config.sideFillColor=i.sideFillColor?i.sideFillColor:"#fff"}this._parseFillCacheWebGL=[];this.setPoints(kq,i);this._config.altitude=e||0;hI.sendMessage(aZ(4,2,5),["overlay","prism"]);var T=this;he.load("poly",function(){T._draw()})}kf.inherits(iN,"Prism");e6.extend(kf.prototype,{setPoints:function(ks){var kq=[];if(typeof ks==="string"||ks[0] instanceof cD||ks[0] instanceof cx||this instanceof g8||ks.length===0){var e=this._processSinglePointArray(ks);this._userPoints=e.userPoints;kq=e.innerPoints;this.hasMultipleParts=false}else{this._userPoints=[];for(var kr=0;kr<ks.length;kr++){var T=this._processSinglePointArray(ks[kr]);this._userPoints.push(T.userPoints);kq.push(T.innerPoints)}this.hasMultipleParts=true}iN.prototype.setPoints.call(this,kq)},setPathIn:function(e){this.setPoints(e)},_processSinglePointArray:function(e){var i=iN.getGraphPoints(e).slice(0);innerPoints=i.slice(0);if(innerPoints.length>1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new cD(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 cD(e.lng,e.lat);this.points[i]=new cD(e.lng,e.lat);if(i===0&&!this.points[0].equals(this.points[this.points.length-1])){this.points[this.points.length-1]=new cD(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 fS("onlineupdate");i.overlay=this;this.dispatchEvent(i)},getAltitude:function(){return this._config.altitude}});function bx(ku,ks,kv){if(!ku||ku.length===0){return}this.userPath=ku;var e=[];if(typeof ku==="string"||ku[0] instanceof cD||ku[0] instanceof cx){var kw=this._processSinglePointArray(ku);for(var kr=0;kr<kw.innerPoints.length;kr++){e[kr]=jn.convertLL2MC(kw.innerPoints[kr])}}else{for(var kr=0;kr<ku.length;kr++){var kt=this._processSinglePointArray(ku[kr]);var T=[];for(var kq=0;kq<kt.innerPoints.length;kq++){T[kq]=jn.convertLL2MC(kt.innerPoints[kq])}e.push(T)}}kf.call(this,e,ks,kv)}bx.inherits(kf,"PrismOut");e6.extend(bx.prototype,{toString:function(){return"Prism"},setPath:function(kq){if(!kq||kq.length===0){return}this.userPath=kq;var T=[];for(var e=0;e<kq.length;e++){T[e]=jn.convertLL2MC(kq[e])}this.setPathIn(T);this._mouseEventPixels=null},getPath:function(){return this.userPath;var e=this.getPathIn();if(!e||e.length===0){return[]}var kq=[];for(var T=0;T<e.length;T++){kq[T]=jn.convertMC2LL(e[T])}return kq}});function b4(kr,i){iN.call(this,i);i=i||{};this._config.type=i.type||"image";this._config.url=i.url||"";this._config.opacity=typeof i.opacity==="number"?i.opacity:1;this._config.sysType=i.sysType!=="fixed"?"geo":"fixed";this._config.top=i.top||false;this.isReDraw=i.isReDraw||false;this.drawHook=(i.drawHook instanceof Function)?i.drawHook:null;ch(this._config.opacity,0,1);if(i.type==="image"&&i.isPixelMap){this._config.isPixelMap=i.isPixelMap||false;var T=i.pixelMap||{};this._config.colors=T.colors||["#F9F871","#FFC75F","#FF9671","#FF6F91","#D65DB1","#845EC2"];this._config.positions=T.positions||[0,0.2,0.4,0.6,0.8,1];this._config.domain=T.domain||[0,255];this._config.clamp=T.clamp||this._config.domain;this._config.noData=(T.noData!==undefined)?T.noData:-99999;this._config.fomularC=T.fomularC||"float generateValue(vec4 pixel){return pixel.r * 255.;}";this._config.fomularJS=T.fomularJS||function(ks){return ks.r};this._config.maskPng=T.maskPng||null;this._config.maskData=T.maskData||-1;this._config.maskCoord=T.maskCoord||null;this.fHashcode=o({str:this._config.fomularC});var e=this.canPixelMap();if(e){this.isPixelMap=true;this.setPixelMap()}}this._parseFillCacheWebGL=[];if(this._config.sysType==="fixed"){this.points=kr}else{this.setPoints(kr,i)}if(kr instanceof ib){this._addlog(i)}var kq=this;he.load("poly",function(){kq._draw()})}b4.inherits(iN,"GroundOverlay");e6.extend(b4.prototype,{_addlog:function(e){var i=1;var T="picture";if(e){if(e.type==="canvas"&&!e.isReDraw){i=2;T="static_canvas"}else{if(e.type==="canvas"&&e.isReDraw){i=3;T="dynamic_canvas"}else{if(e.type==="video"){i=4;T="video"}else{if(e.type==="image"&&e.isPixelMap){i=5;T="raster"}}}}}hI.sendMessage(aZ(4,2,8,i),["overlay","ground_box",T])},setPoints:function(i){var e=iN.getGraphPoints(i).slice(0);this.hasMultipleParts=false;iN.prototype.setPoints.call(this,e)},setPathIn:function(e){this.setPoints(e)},getPoints:function(){return this.points},getPathIn:function(){return this.getPoints()},canPixelMap:function(){if(this._config.colors&&this._config.positions){return true}return false},setPixelMap:function(){if(!this._config.isPixelMap||!this.canPixelMap()){return}var i=this._config.colors;var e=this._config.positions;this.pHashcode=o({colors:i,positions:e});this.pixelColorMap=hO.generateColorRamp(i,e)},setDomain:function(e){if(e instanceof Array&&e.length===2){this._config.domain=e;this.doOnceDraw()}},setClamp:function(e){if(e instanceof Array&&e.length===2){this._config.clamp=e;this.doOnceDraw()}},setMaskPng:function(i){this._config.maskPng=i;if(this.map){var e=new fS("hide");e.overlay=this;this.dispatchEvent(e);var e=new fS("show");e.overlay=this;this.dispatchEvent(e)}this.doOnceDraw()},setMaskData:function(e){this._config.maskData=e;this.doOnceDraw()},setMaskCoord:function(e){this._config.maskCoord=e;this.maskUV=null;this.doOnceDraw()},setNoData:function(e){this._config.noData=e;this.doOnceDraw()},setPositions:function(e){this._config.positions=e;this.setPixelMap();this.doOnceDraw()},setColors:function(e){this._config.colors=e;this.setPixelMap();this.doOnceDraw()},setBounds:function(T,kt){if(T instanceof ib){var kv=Math.min(T.sw.lng,T.ne.lng);var ks=Math.max(T.sw.lng,T.ne.lng);var ku=Math.min(T.sw.lat,T.ne.lat);var e=Math.max(T.sw.lat,T.ne.lat);var kx=[new cD(kv,ku),new cD(ks,ku),new cD(ks,e),new cD(kv,e)];var kq=iN.getGraphPoints(kx).slice(0);var kr=[];for(var kw=0;kw<kq.length;kw++){kr[kw]=jn.convertLL2MC(kq[kw])}}else{if(T.length===4){var kr=T}else{return false}}this.setPoints(kr);if(kt){return true}this.doOnceDraw()},setOpacity:function(e){if(e>1||e<0){return}this._config.opacity=e;this.doOnceDraw()},getOpacity:function(){return this._config.opacity},getImageURL:function(){return this._config.url},setImage:function(e,T){this._config.src=e;this._texture=null;var i=this;this.imageLoad&&this.imageLoad(this._config.src,function(kq,kr){if(kr){i._texture=kq;if(T){i.setBounds(T,true)}i.doOnceDraw()}})},setFomular:function(e,i){if(e&&i){this._config.fomularJS=e;this._config.fomularC=i;this.fHashcode=o({str:this._config.fomularC});this.doOnceDraw()}},setIsPixelMap:function(e){this.isPixelMap=e;this.doOnceDraw()},getImagePixel:function(kq){if(!this._config.isPixelMap||!this.canPixelMap()){return null}if(!this.getImageMaskPixel(kq)){return null}if(this.imageObject){var T=Math.floor((kq.lng-this.points[3].lng)/this.lngMC);var e=Math.floor((-kq.lat+this.points[3].lat)/this.latMC);var i=Math.floor((e*this.imageObject.width+T)*4);if(T>this.imageObject.width||T<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(T){var e=document.createElement("canvas");e.width=T.width;e.height=T.height;var i=e.getContext("2d");i.drawImage(T,0,0,T.width,T.height);this.imageObject={width:T.width,height:T.height,data:i.getImageData(0,0,T.width,T.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(T){var e=document.createElement("canvas");e.width=T.width;e.height=T.height;var i=e.getContext("2d");i.drawImage(T,0,0,T.width,T.height);this.imageMaskObject={width:T.width,height:T.height,data:i.getImageData(0,0,T.width,T.height)};i=null;e=null},getImageMaskPixel:function(e){if(!this.imageMaskObject){return true}var kq=this._toOverlayPixelsGL([e]);var kv=this.maskOverlayPixels;var ks=kv[1][0]-kv[0][0];var kr=kv[1][1]-kv[0][1];var T=Math.floor((kq[0][0]-kv[0][0])/ks*this.imageMaskObject.width);var i=Math.floor((-kq[0][1]+kv[1][1])/kr*this.imageMaskObject.height);var ku=Math.floor((i*this.imageMaskObject.width+T)*4);if(T>this.imageMaskObject.width||T<0){return null}if(i>this.imageMaskObject.height||i<0){return null}var kt=this.imageMaskObject.data.data;if(ku+3>kt.length){return false}if(kt[ku+3]>0){if(this._config.maskData>-1&&this._config.maskData!==kt[ku]){return false}return true}return false},doOnceDraw:function(){var e=new fS("onlineupdate");e.overlay=this;this.dispatchEvent(e)},destroy:function(){this.points=[];this.imageMaskObject=null}});function f9(kq,kx){if(!kq){return}kx=kx||{};var ks=[];if(kx.sysType==="fixed"){ks=kq}else{if(kq instanceof ib){var ku=Math.min(kq.sw.lng,kq.ne.lng);var kr=Math.max(kq.sw.lng,kq.ne.lng);var kt=Math.min(kq.sw.lat,kq.ne.lat);var T=Math.max(kq.sw.lat,kq.ne.lat);var kw=[new cD(ku,kt),new cD(kr,kt),new cD(kr,T),new cD(ku,T)];var e=iN.getGraphPoints(kw).slice(0);for(var kv=0;kv<e.length;kv++){ks[kv]=jn.convertLL2MC(e[kv])}}else{if(kq.length===4){ks=kq}else{return false}}}b4.call(this,ks,kx)}f9.inherits(b4,"GroundOverlayOut");e6.extend(f9.prototype,{toString:function(){return"GroundOverlay"}});function dW(e,i){if(!(e instanceof cD)){return}this.point=e;var e=jn.convertLL2MC(e);this.mc_point=[e.lng,e.lat];this.size=(i.size instanceof je)?i.size:new je(32,32);this.scale=i.scale||1;this.anchor=(i.anchor instanceof je)?i.anchor:new je(0,0);this.rotation=i.rotation||0;this.offset=(i.offset instanceof je)?i.offset:new je(0,0);this.level=i.level||18;hI.sendMessage(aZ(4,2,9),["overlay","ground_point"]);var T=this.calBounds(false);f9.call(this,T,i)}dW.inherits(f9,"GroundPoint");e6.extend(dW.prototype,{calBounds:function(ks){var e=Math.pow(2,18-this.level);var T=this.scale*e;var kw=this.size.width/2*T;var kD=this.size.height/2*T;var kv=this.anchor.width*T;var kC=this.anchor.height*T;var kq=this.offset.width*T;var kx=this.offset.height*T;var kE=[[-1,-1],[1,-1],[1,1],[-1,1]];var kr=[];var ky=this.rotation*Math.PI/180;var kF=mat2.create();mat2.rotate(kF,kF,ky);for(var kA=0;kA<kE.length;kA++){var kB=kE[kA][0]*kw-kv;var kz=kE[kA][1]*kD-kC;var ku=kF[0]*kB+kF[1]*kz;var kt=kF[2]*kB+kF[3]*kz;kr.push(new cD(this.mc_point[0]+ku+kq,this.mc_point[1]+kt+kx))}if(ks){this._mouseEventPixels=null;this.setBounds(kr)}else{return kr}},setPoint:function(T,i){if(!(T instanceof cD)){return}this.point=T;var e=jn.convertLL2MC(T);this.mc_point=[e.lng,e.lat];if(i||i===undefined){this.calBounds(true)}return this},setScale:function(e,i){this.scale=e;if(i||i===undefined){this.calBounds(true)}return this},setSize:function(e,i){if(options.size instanceof je){this.size=e;if(i||i===undefined){this.calBounds(true)}}return this},setRotation:function(e,i){this.rotation=e;if(i||i===undefined){this.calBounds(true)}return this},setAnchor:function(e,i){if(e instanceof je){this.anchor=e;if(i||i===undefined){this.calBounds(true)}}return this},setOffset:function(e,i){if(e instanceof je){this.offset=e;if(i||i===undefined){this.calBounds(true)}}return this}});function bR(i,e){aS.call(this,e);if(!i||!e.point||!bX(i)){throw new Error("参数类型错误")}e=e||{};this.point=e.point;this.createDom=i;this.offsetX=e.offsetX||0;this.offsetY=e.offsetY||0;this.minZoom=e.minZoom||3;this.maxZoom=e.maxZoom||21;this.properties=e.properties||{};this.enableMassClear=e.enableMassClear||false;this.enableDraggingMap=e.enableDraggingMap||false;this.customLayer=null;hI.sendMessage(aZ(4,2,11),["overlay","dom_custom"])}bR.inherits(aS,"CustomOverlay");e6.extend(bR.prototype,{initialize:function(e){this.map=e;this.div=document.createElement("div");this.div.id="cus_overlay";this.div.appendChild(this.createDom(this.properties));this.map.getPanes().labelPane.appendChild(this.div);return this.div},draw:function(){if(!this.div||!this.map){return}var T=this.div.children[0]?this.div.children[0].clientWidth/2:0;var i=this.div.children[0]?this.div.children[0].clientHeight-25:0;var e=this.map.pointToOverlayPixel(this.point,{useRound:false});this.div.style.position="absolute";this.div.style.left=e.x-T+this.offsetX+"px";this.div.style.top=e.y-i+this.offsetY+"px"},addEventListener:function(T,kr){if(!this.div||!this.map){return}var i=this;var kq=this.map;function e(kv){var kt=new fS("onclick").inherit(kv);var ku=kv.srcElement||kv.target;var ks=kv.clientX||kv.pageX;var kx=kv.clientY||kv.pageY;if(kv&&kt&&ku&&ks&&kx){var kw=e6.Dom.getOffset(kq.container);kt.pixel=new fr(ks-kw.left,kx-kw.top);kt.latLng=kq.pixelToPoint(kt.pixel)}return kt}switch(T){case"mouseover":e6.on(this.div,"mouseover",function(kt){var ks=e(kt);i.dispatchEvent(ks);kr(ks)});break;case"mouseout":e6.on(this.div,"mouseout",function(kt){var ks=e(kt);i.dispatchEvent(ks);kr(ks)});break;case"click":e6.on(this.div,"click",function(kt){var ks=e(kt);i.dispatchEvent(ks);kr(ks)});break;default:break}},setPoint:function(e){if(e instanceof cD){this.div.innerHTML="";this.div.appendChild(this.createDom(this.properties));this.point=e;var kq=this.div.clientWidth/2;var T=this.div.clientHeight-25;var i=this.map.pointToOverlayPixel(this.point,{useRound:false});this.div.style.position="absolute";this.div.style.left=i.x-kq+this.offsetX+"px";this.div.style.top=i.y-T+this.offsetY+"px"}},getPoint:function(){return this.point},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"}});var aw={};function ie(T,i){e6.BaseClass.call(this);this.content=T;this.map=null;this._config={width:0,height:0,maxWidth:600,offset:new je(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=C.imgPath;this.overlay=null;var e=this;he.load("simpleInfowindow",function(){e._draw()})}ie.inherits(e6.BaseClass,"SimpleInfoWindow");e6.extend(ie.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(){e6.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(){e6.BaseClass.prototype.decontrol.call(this)},toString:function(){return"SimpleInfoWindow"}});hX.prototype.openSimpleInfoWindow=function(kq,e){if(!kq||kq.toString()!="SimpleInfoWindow"||!e||e.toString()!="Point"){return}var i=this.temp;if(!i.marker){var T=new jH(C.imgPath+"blank.gif",{width:1,height:1});i.marker=new j3(e,{icon:T,width:1,height:1,offset:new je(0,0),infoWindowOffset:new je(0,0),clickable:false});i.marker._fromMap=1}else{i.marker.setPoint(e)}this.addOverlay(i.marker);i.marker.show();i.marker.openSimpleInfoWindow(kq)};hX.prototype.closeSimpleInfoWindow=function(){var e=this.temp.infoWin||this.temp._infoWin;if(e&&e.overlay){e.overlay.closeSimpleInfoWindow()}};eJ.prototype.openSimpleInfoWindow=function(e){if(this.map){this.map.closeSimpleInfoWindow();e._visible=true;this.map.temp._infoWin=e;e.overlay=this;e6.BaseClass.call(e,e.hashCode)}};eJ.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 cp(T,e){iN.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=T;this._parseFillCacheWebGL=[];this.setPoints(T,e);hI.sendMessage(aZ(4,1,3),["instance","custom_mask"]);var i=this;he.load("poly",function(){i._draw()})}cp.inherits(iN,"MapMask");e6.extend(cp.prototype,{setPoints:function(i){var e=iN.getGraphPoints(i).slice(0);this.hasMultipleParts=false;iN.prototype.setPoints.call(this,e)},setPathIn:function(e){this.setPoints(e)},_processSinglePointArray:function(e){var i=iN.getGraphPoints(e).slice(0);innerPoints=i.slice(0);if(innerPoints.length>1&&!innerPoints[0].equals(innerPoints[innerPoints.length-1])){innerPoints.push(new cD(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 kc(ks,T){if(!ks||ks.length===0){return}var kr=[];if(ks[0] instanceof cD){var e=this._processSinglePointArray(ks);for(var kq=0;kq<e.innerPoints.length;kq++){kr[kq]=jn.convertLL2MC(e.innerPoints[kq])}}cp.call(this,kr,T)}kc.inherits(cp,"MapMaskOut");e6.extend(kc.prototype,{toString:function(){return"MapMask"}});function fr(e,i){e=isNaN(e)?0:e;i=isNaN(i)?0:i;this.x=e;this.y=i}fr.prototype.equals=function(e){if(!e){return false}return e.x===this.x&&e.y===this.y};fr.prototype.clone=function(){return new fr(this.x,this.y)};fr.prototype.toString=function(){return"Pixel"};function je(i,e){if(typeof i!=="number"){this.width=parseFloat(i)}else{this.width=i}if(typeof e!=="number"){this.height=parseFloat(e)}else{this.height=e}}je.prototype.equals=function(e){return !!(e&&this.width===e.width&&this.height===e.height)};je.prototype.toString=function(){return"Size"};var ki={B_NORMAL_MAP:{tileUrls:dF(C.tileDomain,C.rasterTilePath),vectorTileUrls:dF(C.tileDomain,C.vectorTilePath),tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,webgl:{minZoom:3,maxZoom:25},zoomLevelBase:18,errorUrl:C.imgPath+"bg.png",bounds:new ib(new cD(-21364736,-11708041.66),new cD(23855104,12474104.17)),imgExtend:"png"},B_SATELLITE_MAP:{tileUrls:["//maponline0.bdimg.com/starpic/?qt=satepc&","//maponline1.bdimg.com/starpic/?qt=satepc&","//maponline2.bdimg.com/starpic/?qt=satepc&","//maponline3.bdimg.com/starpic/?qt=satepc&"],tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:C.imgPath+"bg.png",bounds:new ib(new cD(-21364736,-10616832),new cD(23855104,15859712)),imgExtend:"png"},B_STREET_MAP:{tileUrls:dF(C.tileDomain,C.rasterTilePath),tileSize:256,baseUnits:256,zoomLevelMin:3,zoomLevelMax:19,minDataZoom:3,maxDataZoom:19,minZoom:3,maxZoom:19,zoomLevelBase:18,errorUrl:C.imgPath+"bg.png",bounds:new ib(new cD(-21364736,-10616832),new cD(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:C.imgPath+"blank.gif",bounds:new ib(new cD(-21364736,-10616832),new cD(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:C.imgPath+"blank.gif",bounds:new ib(new cD(-21364736,-10616832),new cD(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:C.imgPath+"bg.png",bounds:new ib(new cD(-21364736,-11708041.66),new cD(23855104,12474104.17)),imgExtend:"png"}};var es=ki;function cS(kt,ku,T,e,ks){if(ks&&es[ks]){this.mapTypeName=ks}else{this.mapTypeName=BMAP_NORMAL_MAP}if(kt&&kt instanceof Array){var kr=true;for(var kq=0;kq<kt.length;kq++){if(kt[kq] instanceof ib){continue}else{kr=false;break}}kr&&(this.bounds=kt)}if(typeof ku==="number"&&ku>=es[this.mapTypeName].webgl.minZoom){if(es[this.mapTypeName].webgl){if(ku>=es[this.mapTypeName].webgl.minZoom){this.minZoom=ku}else{this.minZoom=es[this.mapTypeName].webgl.minZoom}}else{if(ku>=es[this.mapTypeName].minZoom){this.minZoom=ku}else{this.minZoom=es[this.mapTypeName].minZoom}}}if(typeof T==="number"){if(es[this.mapTypeName].webgl){if(T<=es[this.mapTypeName].webgl.maxZoom){this.maxZoom=T}else{this.maxZoom=es[this.mapTypeName].webgl.maxZoom}}else{if(T<=es[this.mapTypeName].maxZoom){this.maxZoom=T}else{this.maxZoom=es[this.mapTypeName].maxZoom}}}if(this.maxZoom<this.minZoom){this.maxZoom=null}if(e&&typeof e==="function"){this.tileUrlFunction=e}hI.sendMessage(aZ(4,3,1,2),["layer","vector","private"])}e6.extend(cS.prototype,{addBoundary:function(e){if(e instanceof ib){if(this.bounds){this.bounds.push(e)}else{this.bounds=[e]}}},setTileUrlFunction:function(e){if(e&&typeof e==="function"){this.tileUrlFunction=e}},crossPoint:function(e,kq,kr){if(kr<this.minZoom||kr>this.maxZoom){return false}var ks=this.containsPoint(e,kr);if(ks){return ks}for(var T=0;T<this.bounds.length;T++){if(this.bounds[T].intersects(kq)){ks=true;break}}return ks},containsPoint:function(e,kq){if(!e||!(e instanceof cD)||!this.isValid()){return false}var kr=false;if(kq<this.minZoom||kq>this.maxZoom){return kr}for(var T=0;T<this.bounds.length;T++){if(this.bounds[T].containsPoint(e)){kr=true;break}}return kr},isValid:function(){return this.bounds&&this.minZoom&&this.maxZoom&&this.tileUrlFunction},toString:function(){return"PrivateRegionDataModel"}});function hW(kv,i,kr,T,kq){this.mgr=kv;this.position=kr;this._cbks=[];this.name=kv.getTileName(T,kq,kv.map.config.style);this.info=T;this._transparentPng=kq.isTransparentPng();var kw=b3("img");id(kw);kw.galleryImg=false;var ku=kw.style;ku.position="absolute";ku.width=kv.tileSize+"px";ku.height=kv.tileSize+"px";ku.left=kr[0]+"px";ku.top=kr[1]+"px";this.img=kw;this.src=i;if(eK&&kr._offsetX===0){ku.opacity=0;ku.willChange="opacity"}var kt=this;this.img.onload=function(kE){if(!kt.mgr){return}var kz=kt.mgr;var kx=kz.bufferTiles;if(kz.bufferNumber>0){kx[kt.name]=kt;kx.push(kt.name)}var kB=kx.length-kz.bufferNumber;for(var kC=0;kB>0&&kC<kx.length;kC++){var kD=kx[kC];if(!kz.mapTiles[kD]){if(kx[kD]){kx[kD].mgr=null;var kA=kx[kD].img;if(kA.parentNode){iC(kA);kA.parentNode.removeChild(kA)}kA=null;kx[kD].img=null;kx[kD]=null;delete kx[kD]}kx.splice(kC,1);kC--;kB--}}kt.loaded=true;kz.imgNumber++;if(!aT(kt.img)){if(kq.tilesDiv){kq.tilesDiv.appendChild(kt.img)}}var kE=new fS("onimagechange");kE.action="show";kE.tile=kt.name;kz.map.dispatchEvent(kE);if(eK&&kr._offsetX===0){var ky=new fH({fps:10,duration:300,render:function(e){if(kt.img&&kt.img.style){kt.img.style.opacity=e*1}},finish:function(){if(kt.img&&kt.img.style){delete kt.img.style.opacity;kt.img.style.willChange="auto"}}})}kt._callCbks()};this.img.onerror=function(kz){kt.error=true;kt._callCbks();if(!kt.mgr){return}var kx=kt.mgr;var ky=es[kq.mapType];if(ky.errorUrl){kt.img.src=ky.errorUrl}if(!aT(kt.img)){if(kq.tilesDiv){kq.tilesDiv.appendChild(kt.img)}}};kw=null;var ks=new fS("onimagebefore");ks.tile=kt.name;kv.map.dispatchEvent(ks)}hW.prototype._addLoadCbk=function(e){this._cbks.push(e)};hW.prototype._load=function(){if(FeBrowser.ie<=6&&FeBrowser.ie>0&&this._transparentPng){this.img.src=C.imgPath+"blank.gif"}else{this.img.src=this.src}};hW.prototype._callCbks=function(){var T=this;for(var e=0;e<T._cbks.length;e++){T._cbks[e]()}T._cbks.length=0};var eK=(!e6.Browser.ie||e6.Browser.ie>8);function jv(e){this.tileLayers=[];this.map=e;this.bufferNumber=300;this.mapTiles=[];this.bufferTiles=[];this.config=es[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={}}bD.register(function(i){if(i._renderType==="webgl"){return}var e=i.tileMgr=new jv(i);i.addEventListener("mousewheel",function(T){e.mouseWheel(T)});i.addEventListener("dblclick",function(T){e.dblClick(T)});i.addEventListener("rightdblclick",function(T){e.dblClick(T)});i.addEventListener("minuspress",function(T){e.keypress(T)});i.addEventListener("pluspress",function(T){e.keypress(T)});i.addEventListener("load",function(T){if(this.mapType===BMAP_EARTH_MAP){return}e.loadTiles()});i.addEventListener("zoomstartcode",function(T){if(this.mapType===BMAP_EARTH_MAP){return}e._zoom(T)});i.addEventListener("moving",function(T){if(this.mapType===BMAP_EARTH_MAP){return}e.moveGridTiles()});i.addEventListener("resize",function(T){if(this.mapType===BMAP_EARTH_MAP){return}e.resizeMap(T)});i.addEventListener("addtilelayer",function(T){e.addTileLayer(T)});i.addEventListener("removetilelayer",function(T){e.removeTileLayer(T)})});e6.extend(jv.prototype,{addTileLayer:function(kq){var T=this;var i=kq.target;T.tileLayers.push(i);if(T.map.loaded){T.moveGridTiles()}},removeTileLayer:function(kx){var ky=this;var kv=kx.target;var kt=kv.mapType;var ks=ky.mapTiles;var kA=ky.bufferTiles;for(var T in kA){var kq=T.split("-")[1];if(kq==kt){delete kA[T]}}for(var T in ks){var kq=T.split("-")[1];if(kq==kt){delete ks[T]}}if(ky.zoomsDiv&&ky.zoomsDiv.parentNode){ky.zoomsDiv.parentNode.removeChild(ky.zoomsDiv);ky.zoomsDiv.innerHTML=""}var kr=ky.map;if(kr.deepZoom){var kz=kr.deepZoom.preDeepZoomDiv;if(kz&&kz.parentNode){kz.parentNode.removeChild(kz)}}for(var kw=0,ku=ky.tileLayers.length;kw<ku;kw++){if(kv==ky.tileLayers[kw]){ky.tileLayers.splice(kw,1)}}ky.moveGridTiles()},hideDeepZoomDiv:function(){var i=this,T=i.map;if(T.deepZoom){var e=T.deepZoom.preDeepZoomDiv;if(e&&e.style.display!="none"){e.style.display="none"}}},getTileLayer:function(kr){var kq=this;for(var T=0,e=kq.tileLayers.length;T<e;T++){tilelayer=kq.tileLayers[T];if(tilelayer.mapType==kr){return tilelayer}}return null},_zoom:function(T){var i=this;if(i.zoomsDiv&&i.zoomsDiv.style.display!="none"){i.zoomsDiv.style.display="none"}i.hideDeepZoomDiv();i.moveGridTiles()},resizeMap:function(i){this.loaded=false;this.moveGridTiles()},_checkTilesLoaded:function(){this.numLoading--;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 fS("ontilesloaded"))}e._checkLoadedTimer=null},80)}},getTileName:function(e,T,i){var kr=T.mapType;var kq="TILE-"+kr+"-"+i+"-"+e[0]+"-"+e[1]+"-"+e[2];return kq},hideTile:function(kq,T){var i=kq.img;if(aT(i)){if(kq.loaded){this.imgNumber--}if(i.parentNode){iC(i);i.parentNode.removeChild(i)}}var kr=new fS("onimagechange");kr.tile=this.getTileName(kq.info,T,this.map.config.style);kr.action="hide";delete this.mapTiles[kq.name];if(!kq.loaded){iC(i);kq._callCbks();i=null;kq.img=null;kq.mgr=null}this.map.dispatchEvent(kr)},loadTiles:function(){var i=this;if(e6.Browser.ie){try{document.execCommand("BackgroundImageCache",false,true)}catch(T){}}if(this.zoomsDiv&&this.zoomsDiv.style.display!="none"){this.zoomsDiv.style.display="none"}i.hideDeepZoomDiv();i.moveGridTiles()},getCell:function(kr,kq){var e=this.baseUnits*Math.pow(2,(this.baseZoomLevel-kq));var T=parseInt(kr.lng/e);var i=parseInt(kr.lat/e);return[T,i,e*(T+0.5),e*(i+0.5)]},moveGridTiles:function(){var kE=this.map,kN=kE.getMapType(),kL=this.tileLayers.length;var kJ=kE.centerPoint;if(kN!==BMAP_SATELLITE_MAP){kJ=e9.calcLoopCenterPoint(kJ)}var kv=kE.width;var kZ=kE.getZoomUnits();var kK=kZ*kv;var kP=kJ.lng-kK/2;var kA=kJ.lng+kK/2;var kD=e9.isAddWidth(kP,kA);for(var kR=0;kR<kL;kR++){var kr=this.tileLayers[kR];if(kr.baseLayer||kL==1){this.tilesDiv=kr.tilesDiv}var kF=es[kr.mapType];var kq=kE.zoomLevel;var kU=kE.getZoomUnits(kE.zoomLevel);var kz=kF.baseUnits*Math.pow(2,(kF.zoomLevelBase-kq));var kx=Math.floor(kJ.lng/kz);var kQ=Math.floor(kJ.lat/kz);var kC=kF.tileSize;var kG=[kx,kQ,(kJ.lng-kx*kz)/kz*kC,(kJ.lat-kQ*kz)/kz*kC];var ky=kD?kE.width/2*1.5:kE.width/2;var kB=kG[0]-Math.ceil((ky-kG[2])/kC);var kY=kG[1]-Math.ceil((kE.height/2-kG[3])/kC);var kS=kG[0]+Math.ceil((ky+kG[2])/kC);var kH=kG[1]+Math.ceil((kE.height/2+kG[3])/kC);var kw=[];for(var kW=kB;kW<kS;kW++){for(var kV=kY;kV<kH;kV++){kw.push([kW,kV]);var kM="id_"+kW+"_"+kV+"_"+kq;kw[kM]=true}}if(kr.mapType!==BMAP_SATELLITE_MAP){kw=e9.calcLoopTiles(kw,kq)}kw.sort((function(i){return function(k1,k2){return((0.4*Math.abs(k1[0]-i[0])+0.6*Math.abs(k1[1]-i[1]))-(0.4*Math.abs(k2[0]-i[0])+0.6*Math.abs(k2[1]-i[1])))}})([kG[0],kG[1]]));var T=this.mapTiles;var e=-kJ.lng/kU;var k0=kJ.lat/kU;var kO=[e,k0];for(var kI in T){var kt=T[kI];var kX=kt.info;if(!kX){continue}var kM="id_"+kX[0]+"_"+kX[1]+"_"+kX[2];if(!kw[kM]){this.hideTile(kt,kr)}}var ks=-kE.offsetX+kE.width/2;var ku=-kE.offsetY+kE.height/2;kr.tilesDiv.style.left=Math.round(e+ks)-kO[0]+"px";kr.tilesDiv.style.top=Math.round(k0+ku)-kO[1]+"px";this.numLoading+=kw.length;for(var kW=0,kT=kw.length;kW<kT;kW++){this.showTile([kw[kW][0],kw[kW][1],kE.zoomLevel],kO,kr,kW,kE.config.style)}}},showTile:function(kt,ks,kw,kB){this.centerPos=ks;var ku=es[kw.mapType];var kx=this.map.config.style;var kq=this.getTileName(kt,kw,kx);var kr=(kt[0]*ku.tileSize)+ks[0];var T=(-1-kt[1])*ku.tileSize+ks[1];var kA=[kr,T];var kv=null;if(kw.mapType!==BMAP_SATELLITE_MAP){kv=e9.calcLoopParam(kt[0],kt[2]);var kz=kv.offsetX;kA[0]+=kz;kA._offsetX=kz}var kE=this;var kD=this.mapTiles[kq];if(kD){kD.img.style.left=kA[0]+"px";kD.img.style.top=kA[1]+"px";if(kD.loaded){this._checkTilesLoaded()}else{kD._addLoadCbk(function(){kE._checkTilesLoaded()})}return}kD=this.bufferTiles[kq];if(kD){this.imgNumber++;kw.tilesDiv.insertBefore(kD.img,kw.tilesDiv.lastChild);this.mapTiles[kq]=kD;kD.img.style.left=kA[0]+"px";kD.img.style.top=kA[1]+"px";if(kD.loaded){this._checkTilesLoaded()}else{kD._addLoadCbk(function(){kE._checkTilesLoaded()})}var kC=new fS("onimagechange");kC.action="cache";kC.tile=this.getTileName(kt,kw,kx);this.map.dispatchEvent(kC)}else{var ky=new fr(kt[0],kt[1]);if(kv){ky.x=kv.col}var i=kw.getTilesUrl(ky,kt[2]);kD=new hW(this,i,kA,kt,kw);kD._addLoadCbk(function(){kE._checkTilesLoaded()});kD._load();this.mapTiles[kq]=kD;hs(this.map)}},mouseWheel:function(ku){var kt=this.map;if(!kt.config.enableWheelZoom){return}var kv=kt.zoomLevel+(ku.trend===true?1:-1);var kr=kt._getProperZoom(kv);if(kr.exceeded){var T=new fS("onzoomexceeded");T.targetZoom=kv;kt.dispatchEvent(T);return}kt.dispatchEvent(new fS("onzoomstart"));kt.lastLevel=kt.zoomLevel;kt.zoomLevel=kr.zoom;var i=ku.pixel;var kq=kt.pixelToPointIn(i,{zoom:kt.lastLevel});var ks=kt.getZoomUnits(kt.zoomLevel);kt.centerPoint=new cD(kq.lng+ks*(kt.width/2-i.x),kq.lat-ks*(kt.height/2-i.y));this.zoom(i)},dblClick:function(T){var i=this.map;if(!i.config.enableDblclickZoom){return}if(i.mapType==="B_EARTH_MAP"){return}if(i.currentOperation===em.dragging){return}if(T.type=="onrightdblclick"){i.zoomOut(T.point)}else{i.zoomIn(T.point)}},keypress:function(T){var i=this.map;if(i.getMapType()===BMAP_EARTH_MAP){return}T.type=="onpluspress"?i.zoomIn():i.zoomOut()}});function hH(kq){this.opts=kq||{};this.copyright=this.opts.copyright||{};this.transparentPng=this.opts.transparentPng||false;this.png8=this.opts.png8||false;this.pack=this.opts.pack||false;this.baseLayer=this.opts.baseLayer||false;this.dataType=this.opts.dataType||1;this.transform=this.opts.transform||0;this.spanLevel=this.opts.spanLevel||0;this.isFlat=!this.opts.isFlat?false:true;this.showLabel=this.opts.showLabel===false?false:true;var e=this.opts.tileTypeName||"web";this.tileType=ic.getInstance(e);this.clipTile=this.opts.clipTile||false;this._type="tilelayer";var i=b2()?128:256;this.cacheSize=this.opts.cacheSize||i;var T=this;this.tileCache=new aA(this.cacheSize,{clearCallback:function(kr){if(kr.label){if(kr.label.textImageBitmap){kr.label.textImageBitmap.close()}if(kr.label.indoorTextImageBitmap){kr.label.indoorTextImageBitmap.close()}}T._removeIndoorData(kr)}});this.scaler=go()>=1.5?2:1;this.normalUdt=j2("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}}hH.inherits(de,"TileLayer");e6.extend(hH.prototype,{isTransparentPng:function(){return this.transparentPng},getTilesUrl:function(kx,e){var T=es[this.mapType];if(typeof T!=="object"){return null}var kq=kx.x;var ky=kx.y;if(this.mapType!==BMAP_SATELLITE_MAP){var ky=e9.calcLoopParam(ky,e).col}var i="";if(this.opts.tileUrlTemplate){i=this.opts.tileUrlTemplate;i=i.replace(/\{X\}/,ky);i=i.replace(/\{Y\}/,kq);i=i.replace(/\{Z\}/,e)}else{if(this.mapType===BMAPGL_NORMAL_MAP){var kw=this.isCanvasMap?0:1;var ks=T.tileUrls[Math.abs(ky+kq)%T.tileUrls.length];if(window.offLineIPAddress){ks=window.offLineIPAddress+"tile5/"}var kr=this.map.config.style;i=ks+"?qt=vtile&x="+kq+"&y="+ky+"&z="+e+(kr==="default"?"":("&styleId=1"))+"&styles=pl&udt="+this.normalUdt+"&scaler="+this.scaler+"&showtext="+kw;i=i.replace(/-(\d+)/gi,"M$1")}if(this.mapType===BMAP_SATELLITE_MAP){var kt=j2("ditu","satellite");var kv=kt.ver;var ku=kt.udt;i=T.tileUrls[Math.abs(ky+kq)%T.tileUrls.length]+"u=x="+kq+";y="+ky+";z="+e+";v="+kv+";type=sate&fm=46&udt="+ku;i=i.replace(/-(\d+)/gi,"M$1")}}return i},initialize:function(kt){this.map=kt;if(kt._renderType==="webgl"){var ks=null;if(this.customLayer!==false){ks=this.getTilesUrl}e6.extend(this,fn);this.labelProcessor=new jp(this);this.callbackDataQueue=[];if(ks){this.getTilesUrl=ks}var T=this;kt.on("indoor_data_refresh",function(ku){if(!T.baseLayer){return}T._refreshIndoorData(ku.uid,ku.floor)});kt.on("custom_labels_ready",function(ku){if(!T.baseLayer&&ku.model==="custom"){return}if((ku.model==="custom"&&T.drawIndex===0)||ku.model==="mvt_"+T.drawIndex){T._doWorkAfterLabelImageLoad(ku.virtualTile,ku.labelCanvas,null,ku.imgKey)}});kt.on("glmoduleloaded",function(){if(!T.baseLayer){return}T.updateAllIconsTextureCoords()});kt.on("layer_update",function(kv){if(T.dataType===2&&kt.customLoaded&&kt.areaCustomLoaded){T.clearCache();var ku=new fS("onlayer_clear");kt.fire(ku)}});if(this.ontology&&this.ontology._initEvent){this.ontology._initEvent(kt)}}if(!kt.temp.layerZIndex){kt.temp.layerZIndex=0}this.zIndex=this.zIndex||1;if(kt.getRenderType()==="dom"){this.zIndex=kt.tileMgr.tileLayers.length}else{if(this.baseLayer){this.zIndex=0}else{if(this.zIndex>0){this.adjustZIndex()}else{var e=kt._featureMgr.result.bkData;this.zIndex=e.length||1}}}if(!kt.temp.layid){kt.temp.layid=0}if(!this.opts.mapType){this.mapType="BMAP_CUSTOM_LAYER_"+kt.temp.layid;kt.temp.layid++}else{this.mapType=this.opts.mapType}var kq=es[this.mapType];if(!kq){es[this.mapType]={tileUrls:[],tileSize:256,baseUnits:256,zoomLevelMin:1,zoomLevelMax:19,minZoom:3,maxZoom:19,minDataZoom:3,maxDataZoom:19,zoomLevelBase:18,errorUrl:C.imgPath+"/blank.gif",bounds:new ib(new cD(-21364736,-10616832),new cD(23855104,15859712)),imgExtend:"png"}}if(kt._renderType!=="webgl"){var kr=bP(kt.platform,'<div style="position:absolute;z-index:'+this.zIndex+'"></div>');kr.style.display="";kr.style.left=Math.ceil(-kt.offsetX+kt.width/2)+"px";kr.style.top=Math.ceil(-kt.offsetY+kt.height/2)+"px";this.tilesDiv=kr}this.isCanvasMap=kt.isCanvasMap();this.lastZoom=kt.getZoom();var i=this;this.addEventListener("initDrawData",function(ku){if(i.opts.boundary){i.addBoundary(i.opts.boundary)}});kt.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(kr){var T=this.zIndex;if(this.map&&this.map._featureMgr){var e=this.map._featureMgr.result.bkData;if(kr==="up"){for(var kq=this.zIndex+1;kq<e.length;kq++){if(e[kq]){T=kq+1;break}}}else{for(var kq=this.zIndex-1;kq>0;kq--){if(e[kq]){T=kq;break}}}}return T},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 e9.calcLoopParam(e,i)},addBoundary:function(ks){if(!ks||!this.map){return}if(typeof ks==="string"){ks=[ks]}for(var kq=0;kq<ks.length;kq++){var T=new BMapGL.Polygon(ks[kq]);if(T&&bX(T._i)){var kr=new fS("onbeforeaddoverlay",T);kr.overlay=T;kr.isLayerMask=true;this.map.dispatchEvent(kr);T._i(this.map);if(this.boundary){this.boundary.push(T)}else{this.boundary=[T]}}}this.updateBoundary()},clearBoundary:function(){this.boundary=false;this.updateBoundary()},updateBoundary:function(){if(this.boundary===undefined||!this.map){return}var i=this.map._featureMgr.result.bkData;if(i[this.zIndex]){i[this.zIndex].showRegion=this.opts.showRegion;i[this.zIndex].boundary=this.boundary;this.map.dispatchEvent(new fS("onrefresh"));if(this.boundary===false){var T=new fS("onremoveLayerMask");T.hasLayerBoundary=this.map._featureMgr.hasLayerBoundary();this.map.dispatchEvent(T)}}},destroy:function(){this.copyright=null;this.clearCache()}});function m(i,e,T){this.bounds=i;this.content=e;this.mapType=T}m.inherits(de,"Copyright");var ey={get:function(e){if(!ey.singleton){ey.singleton=new gf(e)}return ey.singleton}};function gf(i){this._map=i;this._tileMgr=i.tileMgr;this._animationDiv=null;this._preAnimationDiv=null;this._animation=null;this._baseLayerDiv=null;this._transformStyleName=dc.ifSupportCSS3("transform",true);this._transformOriginStyleName=dc.ifSupportCSS3("transformOrigin",true);this._preZoomTimes=1;this._preRenderTick=1;this._enableCanvas2dMap=!!(i.getRenderType()==="canvas");this._isIE9=!!(e6.Browser.ie===9);var e=this;i.addEventListener("maptypechange",function(){e.hide()});i.addEventListener("load",function(){e.hide()})}e6.extend(gf.prototype,{prepareLayer:function(){var kq=this._map;var e=this._tileMgr;this._canvas2dMapMgr=kq.canvas2dMapMgr;var T=this._baseLayerDiv=e.tilesDiv;if(!this._animationDiv){var i=this._preAnimationDiv;if(i){i.parentNode&&i.parentNode.removeChild(i);this._preAnimationDiv=null}this._preAnimationDiv=this._animationDiv=T.cloneNode(true);kq.platform.insertBefore(this._animationDiv,kq.platform.firstChild)}this.show()},prepareAniParam:function(){var kq=this._animationDiv;if(!kq){return}var e=kq.children.length;var T;this._zoomAniInfo=[];for(var kr=e-1;kr>-1;kr--){var ks={};T=kq.children[kr].style;ks.top=parseInt(T.top,10);ks.left=parseInt(T.left,10);this._zoomAniInfo[kr]=ks}},prepareLabelLayer:function(){var kr=this._map;if(this._enableCanvas2dMap&&kr.canvas2dMapMgr){if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.parentNode.removeChild(this.touchZoomLabelCanvas)}var i=kr.canvas2dMapMgr._labelCanvas;this.touchZoomLabelCanvas=i.cloneNode(false);var e=this.touchZoomLabelCanvas.getContext("2d");e.drawImage(i,0,0);kr.platform.insertBefore(this.touchZoomLabelCanvas,kr.platform.firstChild);var kq=parseInt(i.style.left,10);var T=parseInt(i.style.top,10);this.touchZoomLabelCanvas.style.zIndex=9;this.touchZoomLabelCanvas.style[this._transformOriginStyleName]=(this._fixPosition.x-(kr.offsetX+kq))+"px "+(this._fixPosition.y-(kr.offsetY+T))+"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 kq=this._map;if(kq.getRenderType()==="dom"){if(kq.overlayDiv){kq.overlayDiv.style.visibility="hidden"}if(kq.overlayDivEx){kq.overlayDivEx.style.visibility="hidden"}}var ks=kq.tileMgr.tileLayers;var kr;for(var T=0,e=ks.length;T<e;T++){kr=ks[T];kr.tilesDiv.style.visibility="hidden"}},showNonAnimationLayers:function(){var kq=this._map;if(kq.getRenderType()==="dom"){if(kq.overlayDiv){kq.overlayDiv.style.visibility=""}if(kq.overlayDivEx){kq.overlayDivEx.style.visibility=""}}var ks=kq.tileMgr.tileLayers;var kr;for(var T=0,e=ks.length;T<e;T++){kr=ks[T];kr.tilesDiv.style.visibility=""}},setFixPosition:function(e){this._fixPosition=e},setZoom:function(e,kw){var kt=this._fixPosition;var kC=this._map;var kD=this._baseLayerDiv;var ku={x:kt.x-parseInt(kD.style.left,10)-kC.offsetX,y:kt.y-parseInt(kD.style.top,10)-kC.offsetY};var kq=this._animationDiv;if(!kq){return}var kA=kq.children.length;var ky;var kB=this._transformStyleName;var ks=this._transformOriginStyleName;var kE=this;var kG;var kv;for(var kz=kA-1;kz>-1;kz--){var kx=this._zoomAniInfo[kz];ky=kq.children[kz].style;var kr=kx.left-ku.x;var T=kx.top-ku.y;kx.dx=kr*e-kr;kx.dy=T*e-T;kx.preDx=kr-kr;kx.preDy=T-T;kG=kx.preDx+(kx.dx-kx.preDx);kv=kx.preDy+(kx.dy-kx.preDy)+kw;ky.left=kx.left+kG+"px";ky.top=kx.top+kv+"px";ky.width=ky.height=256*e+"px"}if(this._enableCanvas2dMap){var kF=!kE._isIE9?"translate3d(0px, "+kw+"px, 0) scale("+e+")":"translate(0px, "+kw+"px) scale("+e+")";this.touchZoomLabelCanvas.style[kB]=kF}},setZoomFinish:function(){this._animationDiv=null},startAnimation:function(kt){this.prepareLayer();this.hideNonAnimationLayers();var kM=this._map;if(this.touchZoomLabelCanvas){this.touchZoomLabelCanvas.style.display="none"}kt=kt||{};var kK=kt.zoomCount||0;var ky=kt.fixPosition;var kI=kt.fixMCPosition;var kw=kt.pixOffset;this._zoomCount=kK;var kq=kM.getZoom();var kL=kq+kK;var e=kM.config.enableContinuousZoom;var kC=0.5;var kx=5;var T=Math.pow(2,kK);var kO=this._baseLayerDiv;var kz={x:ky.x-parseInt(kO.style.left,10)-kM.offsetX,y:ky.y-parseInt(kO.style.top,10)-kM.offsetY};var ku=this._animationDiv;var kG=ku.children.length;var kQ=this._preZoomTimes;var kJ=[];var kH=this._transformStyleName;var kv=this._transformOriginStyleName;for(var kF=kG-1;kF>-1;kF--){var kD={};var kE=ku.children[kF].style;kD.top=parseInt(kE.top,10);kD.left=parseInt(kE.left,10);var ks=kD.left-kz.x;var kr=kD.top-kz.y;kD.dx=ks*T-ks;kD.dy=kr*T-kr;kD.preDx=ks*kQ-ks;kD.preDy=kr*kQ-kr;kJ[kF]=kD}var kN=this;var kB;var kP;var kA;this._zoomAni=new fH({fps:60,duration:e?500:1,transition:function(i){i=i*kx/(2*kC);return kx*i-kC*i*i},render:function(kZ){kZ=kZ*(4*kC)/(kx*kx);kB=kQ+kZ*(T-kQ);var kS=kq+p(kB);var kX=null;var kW=0;var k0=0;if(kt.onAnimationBeforeLooping){var k1=kt.onAnimationBeforeLooping(kZ,kS);kX=k1.loopingCenter;kW=k1.yDiff;k0=k1.totalYDiff}for(var kT=kJ.length-1;kT>-1;kT--){var kU=kJ[kT];if(ku.children[kT]){var kY=ku.children[kT].style;kP=kU.preDx+(kU.dx-kU.preDx)*kZ-kw.width*kZ;kA=kU.preDy+(kU.dy-kU.preDy)*kZ-kw.height*kZ+kW;kY.left=kU.left+kP+"px";kY.top=kU.top+kA+"px";kY.height=kY.width=256*kB+"px"}}var kR=kw.width*kZ;var kV=kw.height*kZ;if(kM.isRestrict){kN._enableCanvas2dMap&&kN._canvas2dMapMgr.clearLabel()}else{kN._enableCanvas2dMap&&kN._canvas2dMapMgr.drawLabel(kB,ky,kq,kL,kK,kZ,kR,kV,k0,kW)}kN._preZoomTimes=kB;kN._preRenderTick=kZ;kt.onAnimationLooping&&kt.onAnimationLooping(kZ,kS,kX)},finish:function(){kN._preZoomTimes=1;kN._zoomAni=null;kN._animationDiv=null;kt.onAnimationFinish&&kt.onAnimationFinish();kN.showNonAnimationLayers()}});return this._zoomAni},stopAnimation:function(){if(this._zoomAni){this._zoomAni.stop();this._zoomAni=null}}});function kn(e){this._initVars(e);this._initColorCanvas();this._bindEvent(e)}e6.extend(kn.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,T=b3("canvas"),e=T.style;e.width=i+"px";e.height=i+"px";T.width=i;T.height=i;this._colorCvsSize=i;this._colorCvs=T;this._colorCtx=T.getContext("2d")},getLabelImageData:function(kD){var kC=kD.textImg;var T=kD.textPos;var kA=this.ratio;var ky=this.sizeRatio/kA;var kr=this._colorCtx;var kv=this._colorCvsSize;kr.clearRect(0,0,kv,kv);var kx=0;var e=0;var ku=0;for(var kw=0;kw<T.length;kw++){if(T[kw].width>kx){kx=T[kw].width;e=kw;ku=T[kw].drawX}}kx/=ky;var kz=0;for(var kw=0,kt=T.length;kw<kt;kw++){var kB=T[kw];var kE;if(kw===e){kE=0}else{kE=kB.drawX-ku}kr.drawImage(kC,kB.srcX,kB.srcY,kB.width,kB.height,kE,kz,kB.width/ky,kB.height/ky);if(kB.width/ky>kx){kx=kB.width/ky}kz+=kB.height/ky+2*kA}var kq=kr.getImageData(0,0,kx,kz);var ks=kr.getImageData(0,0,kx,kz);return[kq,ks]},_bindEvent:function(i){var e=this,T=i._map;T.addEventListener("onspotmouseover",function(kt){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(kt.spots.length>0){var ks=kt.spots[0].userdata.uid;var kr=kt.spots[0].userdata.name;var kq=e.findLabelByUid(ks,kr);kq&&e._toHighLightColor(kq)}});T.addEventListener("onspotmouseout",function(kt){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(kt.spots.length>0){var ks=kt.spots[0].userdata.uid;var kr=kt.spots[0].userdata.name;var kq=e.findLabelByUid(ks,kr);kq&&e._toDefaultColor(kq)}});T.addEventListener("onspotclick",function(kt){if(!this.isCanvasMap()||!this.temp.isPermitSpotOver){return}if(kt.spots&&kt.spots.length>0){var ks=kt.spots[0].userdata.uid;var kr=kt.spots[0].userdata.name;var kq=e.findLabelByUid(ks,kr);kq&&e._changeBaseMapState(kq)}else{e._recoverNormalState()}});T.on("spot_status_reset",function(){e._recoverNormalState()});T.on("spot_highlight",function(kr){var kq=e.findLabelByUid(kr.uid);kq&&e._changeBaseMapState(kq)})},_getTextBound:function(kB){if(!kB.textPos){return null}var kz=this.ratio;var kx=this.sizeRatio/kz;var T=kB.textPos;var kA=kB.baseDrawX;var ky=kB.baseDrawY;var kv=kA*kz+(T[0].drawX-kA)/kx;var kt=ky*kz+(T[0].drawY-ky)/kx;var kr=kv+T[0].width/kx;var e=kt+T[0].height/kx;for(var kw=0,ku=T.length;kw<ku;kw++){var kC=T[kw];var ks=kA*kz+(kC.drawX-kA)/kx;if(ks<kv){kv=ks}var kq=ky*kz+(kC.drawY-ky)/kx;if(kq<kt){kt=kq}if(ks+kC.width>kr){kr=ks+kC.width}if(kq+kC.height>e){e=kq+kC.height}}return[kv,kt,kr,e]},_toHighLightColor:function(T){if(T._tempRank&&T._tempRank==this.RANK5){return}var ku=this._getTextBound(T);if(!ku){return}var kq=Math.round(ku[0]);var i=Math.round(ku[1]);var e=this.getLabelImageData(T);var ks=e[0];var kr=e[1];var kt=this._canvas2dMapMgr.getFilterImageData(ks,this.RANK5);T._oldImgData=kr;this._labelCtx.putImageData(kt,kq,i)},_toDefaultColor:function(e){if(e._tempRank&&e._tempRank==this.RANK5){return}if(e._oldImgData){var i=this.sizeRatio;var T=this._getTextBound(e);if(!T){return}this._labelCtx.putImageData(e._oldImgData,Math.round(T[0]),Math.round(T[1]));e._oldImgData=null}},_changeBaseMapState:function(kq){var T=this._canvas2dMapMgr;var i=kq.guid;var e=kq.guidExt;var kr={guid:i,name:kq.name,guidExt:e};T._labelStrategy.setStrategyInfo(kr);T._loadData()},_recoverNormalState:function(){var e=this._canvas2dMapMgr;e._labelStrategy.setStrategyInfo(null);e._loadData()},findLabelByUid:function(ks,kq){var ku=this._canvas2dMapMgr,e=ku._computedLabel;for(var kr=0,T=e.length;kr<T;kr++){var kt=e[kr];if(!ku.isClickableLabel(kt)){continue}if(ks&&kt.guid===ks){return kt}if(kq&&kt.name===kq){return kt}}return null}});function F(e){this._initVars(e)}e6.extend(F.prototype,{_initVars:function(e){this._map=e._map;this._canvas2dMapMgr=e;this.ratio=this._map.config.ratio;this._strategyInfo=null;this.RANK1=1000000;this.RANK2=2000000;this.RANK3=3000000;this.RANK4=4000000;this.RANK5=5000000},setStrategyInfo:function(e){this._strategyInfo=e},preComputeLabel:function(kw,lo,k6,kI,lh,lC){var k0=[],kE=kw._centerX,kC=kw._centerY,lD=kI*lh;var lc=this.ratio;var kv=this._map.getZoom();var kV=0;if(kv===5){kV=4}if(kv===8){kV=-6}kw.sort(function(ll,i){if(ll.x*ll.y<i.x*i.y){return -1}else{return 1}});for(var kX=0,kT=kw.length;kX<kT;kX++){var lt=kw[kX],kO=lt.x,kL=lt.y,kJ=lt.z;var kQ=e9.calcLoopParam(kO,kJ).offsetX;var la=kO*lD,k9=(kL+1)*lD,kq=(la-kE)/kI+lo/2+kQ,T=(kC-k9)/kI+k6/2;for(var kU=0,lx=lt.length;kU<lx;kU++){var ky=lt[kU],kF=undefined,kD=undefined,lv=undefined,lu=undefined;var lj=ky.baseDrawX=kq+ky.baseX;var li=ky.baseDrawY=T+ky.baseY;if(ky.type=="fixed"){var k4=ky.iconPos,kH=ky.textPos,lz=ky.textImg;if(k4){k4.drawX=kq+k4.destX;k4.drawY=T+k4.destY;kF=k4.drawX;kD=k4.drawY;lv=k4.drawX+k4.width;lu=k4.drawY+k4.height}if(kH&&lz){for(var lk=0;lk<kH.length;lk++){var ly=kH[lk];ly.drawX=kq+ly.destX;ly.drawY=T+ly.destY;if(!kF){kF=ly.drawX;kD=ly.drawY;lv=ly.drawX+ly.width;lu=ly.drawY+ly.height}else{if(ly.drawX<kF){kF=ly.drawX}if(ly.drawY<kD){kD=ly.drawY}if(ly.drawX+ly.width>lv){lv=ly.drawX+ly.width}if(ly.drawY+ly.height>lu){lu=ly.drawY+ly.height}}}}}else{ky.tileX=kq;ky.tileY=T;kF=kq+ky.minXOriginal;kD=T+ky.minYOriginal;lv=kq+ky.maxXOriginal;lu=T+ky.maxYOriginal}if(kF!=undefined){var ln=lj+(kF-lj)/lc;var lm=li+(kD-li)/lc;var kY=lj+(lv-lj)/lc;var kW=li+(lu-li)/lc;ky.minX=ln;ky.minY=lm;ky.maxX=kY;ky.maxY=kW;var lr=(ln+kY)/2,lq=(lm+kW)/2,k7=kE+(lr-lo/2)*kI,k5=kC+(k6/2-lq)*kI;ky.geoX=k7;ky.geoY=k5;k0.push(ky)}}}if(lC){for(var kX=0,kT=lC.length;kX<kT;kX++){var kS=lC[kX];var lf=kS[0];var kz=kS[1];var k4=lf.iconPos;var kt=k4.geoX;var kr=k4.geoY;var lj=(kt-kE)/kI+lo/2;var li=(kC-kr)/kI+k6/2;var kF=lj+k4.destX;var kD=li+k4.destY;var lv=kF+k4.width;var lu=kD+k4.height;lf.textPos=lf.textPos||lf._textPos;var kH=lf.textPos;var lp=kH[0];var kN=lj+lp.destX;var kB=li+lp.destY;if(kB<kD){kD=kB}if(kN+lp.width>lv){lv=kN+lp.width}if(kB+lp.height>lu){lu=kB+lp.height}if(kH.length===2){var kM=kH[1];var kK=lj+kM.destX;var kA=li+kM.destY;if(kA<kD){kD=kA}if(kK+kM.width>lv){lv=kK+kM.width}if(kA+kM.height>lu){lu=kA+kM.height}}lf._tempBounds=[kF,kD,lv,lu];var k4=kz.iconPos;var kt=k4.geoX;var kr=k4.geoY;var lj=(kt-kE)/kI+lo/2;var li=(kC-kr)/kI+k6/2;var kF=lj+k4.destX;var kD=li+k4.destY;var lv=kF+k4.width;var lu=kD+k4.height;kz.textPos=kz.textPos||kz._textPos;var kH=kz.textPos;var lp=kH[0];var kN=lj+lp.destX;var kB=li+lp.destY;if(kN<kF){kF=kN}if(kB<kD){kD=kB}if(kB+lp.height>lu){lu=kB+lp.height}if(kH.length===2){var kM=kH[1];var kK=lj+kM.destX;var kA=li+kM.destY;if(kK<kF){kF=kK}if(kA<kD){kD=kA}if(kA+kM.height>lu){lu=kA+kM.height}}kz._tempBounds=[kF,kD,lv,lu]}for(var kX=0,kT=lC.length;kX<kT;kX++){var kS=lC[kX];var lf=kS[0];var kz=kS[1];if(kX===0&&kz.textPos){kz._textPos=kz.textPos;delete kz.textPos}var ls=lf;if(!lf.textPos&&kz.textPos){ls=kz}var lw=ls._tempBounds;for(kU=kX+1;kU<kT;kU++){var kR=lC[kU];var k1=kR[0];var lB=kR[1];var kG=0;var lA=k1._tempBounds;if(!(lw[2]<lA[0]||lw[0]>lA[2]||lw[3]<lA[1]||lw[1]>lA[3])){kG++;if(k1.textPos){k1._textPos=k1.textPos;delete k1.textPos}}var lA=lB._tempBounds;if(!(lw[2]<lA[0]||lw[0]>lA[2]||lw[3]<lA[1]||lw[1]>lA[3])){kG++;if(lB.textPos){lB._textPos=lB.textPos;delete lB.textPos}}if(kG>=2){if(ls.textPos){ls._textPos=ls.textPos;delete ls.textPos}}}}for(var kX=0,kT=lC.length;kX<kT;kX++){var kS=lC[kX];var lf=kS[0];var kz=kS[1];var k2=lf;if(!lf.textPos&&kz.textPos){k2=kz}var k4=k2.iconPos;var kt=k4.geoX;var kr=k4.geoY;var lj=k2.baseDrawX=(kt-kE)/kI+lo/2;var li=k2.baseDrawY=(kC-kr)/kI+k6/2;k4.drawX=lj+k4.destX;k4.drawY=li+k4.destY;var kF=k4.drawX;var kD=k4.drawY;var lv=k4.drawX+k4.width;var lu=k4.drawY+k4.height;var kH=k2.textPos;if(kH){var lp=kH[0];lp.drawX=lj+lp.destX;lp.drawY=li+lp.destY;if(lp.drawX<kF){kF=lp.drawX}if(lp.drawY<kD){kD=lp.drawY}if(lp.drawX+lp.width>lv){lv=lp.drawX+lp.width}if(lp.drawY+lp.height>lu){lu=lp.drawY+lp.height}if(kH.length===2){var kM=kH[1];kM.drawX=lj+kM.destX;kM.drawY=li+kM.destY;if(kM.drawX<kF){kF=kM.drawX}if(kM.drawY<kD){kD=kM.drawY}if(kM.drawX+kM.width>lv){lv=kM.drawX+kM.width}if(kM.drawY+kM.height>lu){lu=kM.drawY+kM.height}}}var ln=lj+(kF-lj)/lc;var lm=li+(kD-li)/lc;var kY=lj+(lv-lj)/lc;var kW=li+(lu-li)/lc;k2.minX=ln;k2.minY=lm;k2.maxX=kY;k2.maxY=kW;var le=(ln+kY)/2;var ld=(lm+kW)/2;var ku=kE+(le-lo/2)*kI;var ks=kC+(k6/2-ld)*kI;k2.geoX=ku;k2.geoY=ks;k0.push(k2)}}var lg=this._strategyInfo;if(lg){var kZ=lg.guid;var k8=lg.name;var kP=lg.guidExt;for(var kX=0,kT=k0.length;kX<kT;kX++){var kx=k0[kX];delete kx._tempRank;if(!this._canvas2dMapMgr.isClickableLabel(kx)||(kP===1&&!kx.guidExt)){continue}if((kZ&&kZ===kx.guid)||(k8&&k8===kx.name)){kx._tempRank=this.RANK5}}}else{for(var kX=0,kT=k0.length;kX<kT;kX++){var kx=k0[kX];if(kx.type=="line"||!kx.iconPos){continue}delete kx._tempRank}}k0.sort(function(lE,ll){var lF=lE._tempRank?lE._tempRank:lE.rank,i=ll._tempRank?ll._tempRank:ll.rank;if(lF===i){return lE.baseX-ll.baseX}return i-lF});for(var kX=0,kT=k0.length;kX<kT;kX++){var ls=k0[kX];ls.isDel=false;ls.isFadeout=false;ls._schedule=0;ls._isIgnore=false;ls.arrIntersectIndex=[];for(kU=kX+1;kU<kT;kU++){var k3=k0[kU];if(!(ls.maxX-kV<k3.minX||ls.minX>k3.maxX-kV||ls.maxY-kV<k3.minY||ls.minY>k3.maxY-kV)){ls.arrIntersectIndex.push(kU)}}}for(var kX=0,kT=k0.length;kX<kT;kX++){var kx=k0[kX];if(kx.isDel==false){var e=kx.arrIntersectIndex;for(var kU=0,lx=e.length;kU<lx;kU++){var lb=k0[e[kU]];lb.isDel=true;if(lb.guidExt===1){lb.isDel=false}}}}return k0}});function Z(e){this._map=e;this._initCanvas();this._initVars();this._bindEvent();this._tileType=ic.getInstance("na")}bD.register(function(i){if(i.getRenderType()==="canvas"){var e=i.config.style;if(bD["FeatureStyle"+e]){i.canvas2dMapMgr=new Z(i)}else{i.loadMapStyleFiles(function(){i.canvas2dMapMgr=new Z(i);i.canvas2dMapMgr._loadData()})}}});e6.extend(Z.prototype,{_initCanvas:function(){var kt=this._map,kr=kt.getSize(),kq=kr.width,i=kr.height,e=kt.platform,ku=b3("canvas"),ks=ku.style;var T=this.ratio=kt.config.ratio;this._width=kq;this._height=i;ks.cssText="position: absolute;left:0;top:0;width:"+kq+"px;height:"+i+"px;z-index:100;";ku.width=kq*T;ku.height=i*T;this._labelCanvas=ku;this._labelCtx=ku.getContext("2d");e.appendChild(ku)},_initVars:function(){var e=j2("ditu","normal");this._udt=e.udt;this._version=e.ver;this._labelDataUrls=es.B_NORMAL_MAP.vectorTileUrls;this._style=bD["FeatureStyle"+this._map.config.style];this._labelCount=0;this._vectorDrawLib=new hd(this);this._cache={maxNum:500,delNum:50,arrCache:[]};this._computedLabel=null;this._spotData=null;this._labelStrategy=new F(this);this._labelClick=new kn(this);this._biz=new eA(this);this._map.temp.isPermitSpotOver=true;this.labelStyleParam="pl";if(this._map.getMapType()===BMAP_SATELLITE_MAP){this.labelStyleParam="sl"}this.statRequestCount=0;this.statResponseCount=0},_resizeHandler:function(ks){var ku=this,i=ku._map,kr=i.getSize(),T=kr.width,kw=kr.height;var kt=this.ratio;var kx=this._labelCanvas,kq=kx.style;kq.width=T+"px";kq.height=kw+"px";kx.width=T*kt;kx.height=kw*kt;ku._width=T;ku._height=kw;var kv=true;ku._loadData(kv)},_bindEvent:function(){var e=this,i=e._map;i.addEventListener("load",function(T){e.clearLabel();e._loadData()});i.addEventListener("zoomend",function(T){if(!T.notClearLabel){e.clearLabel()}e._loadData()});i.addEventListener("moveend",function(T){e._loadData()});i.addEventListener("resize",function(T){e._resizeHandler(T)});i.addEventListener("maptypechange",function(T){if(T.mapType===BMAP_EARTH_MAP){e.hideLabelCanvas()}else{e.showLabelCanvas();if(T.mapType===BMAPGL_NORMAL_MAP){e.labelStyleParam="pl"}else{if(T.mapType===BMAP_SATELLITE_MAP){e.labelStyleParam="sl"}}e._loadData()}});i.addEventListener("streetlayer_show",function(T){if(this.isCanvasMap()){e.showLabelCanvas()}});i.addEventListener("streetlayer_hide",function(T){if(this.isCanvasMap()){e.hideLabelCanvas()}});i.addEventListener("loadbizdata",function(kq){var T=kq.data;e._biz.proecessBizData(T,function(){e.updateLabel()})});i.addEventListener("unloadbizdata",function(T){e._biz.clearBizData();e.updateLabel()});e.isDrawText=false;setTimeout(function(){if(!e.isDrawText){i.dispatchEvent(new fS("onmapwhitescreen"))}},10000)},getStyle:function(){return this._style},_getZoomUnits:function(e){return Math.pow(2,18-e)},_createCacheForm:function(T,ku,kt,i){var ks=this;var e=ks._cache;var kq=e.arrCache;var kv=this._getLabelId(T,ku,kt,i);var kr={id:kv,updateLabelCounter:0};kq.push(kr);kq[kv]=kr;return kr},_getLabelId:function(i,kq,T,e){return"_"+i+"_"+kq+"_"+T+"_"+e+"_"+this.labelStyleParam},_getCache:function(i,kq,T,e){return this._cache.arrCache[this._getLabelId(i,kq,T,e)]},_setCacheValue:function(kr,kE,kC,kq,kx){var kz=this;var e=kz._cache;var kt=e.arrCache;var kv=e.maxNum;var ks=e.delNum;var kD=this._getLabelId(kr,kE,kC,kq);var ky=kt[kD];if(kx){ky.lb=kx}if(kt.length>kv){var T=kt.splice(0,ks);for(var kw=0,ku=T.length;kw<ku;kw++){var kA=T[kw],kB=kA.id;if(kt[kB].lb){kt[kB].lb=null}kt[kB]=null;delete kt[kB]}T=null}},_loadData:function(kC){var kV=this._map;if(!kV.isCanvasMap()){return}var kv=kV.getCenterIn();var kU=e9.calcLoopCenterPoint(kv);var ku=this._tileType;var kx=this._width/2;var kJ=this._height;var kK=kV.getZoom();var kG=ku.getDataZoom(kK);var kz=kV.getZoomUnits(kK);var kF=kz*kx;var kT=kU.lng-kF;var kS=kU.lng+kF;var kD=e9.isAddWidth(kT,kS);kx=kD?kx*1.5:kx;var kE=ku.getTileSize(kK);var kr=ku.getMercatorSize(kK,kG);var ky=Math.floor(kU.lng/kr);var kA=Math.floor(kU.lat/kr);var ks=[ky,kA,(kU.lng-ky*kr)/kr*kE,(kU.lat-kA*kr)/kr*kE];var kM=ks[0]-Math.ceil((kx-ks[2])/kE);var kQ=ks[1]-Math.ceil((kJ/2-ks[3])/kE);var kI=ks[0]+Math.ceil((kx+ks[2])/kE);var kN=ks[1]+Math.ceil((kJ/2+ks[3])/kE);kV.temp.isPermitSpotOver=false;var e=[];for(var kP=kM;kP<kI;kP++){for(var kO=kQ;kO<kN;kO++){e.push([kP,kO,kG]);var kH="id_"+kP+"_"+kO+"_"+kK;e[kH]=true}}e._zoom=kG;e=e9.calcLoopTiles(e,kK);e.sort((function(i){return function(kX,kY){return((0.4*Math.abs(kX[0]-i[0])+0.6*Math.abs(kX[1]-i[1]))-(0.4*Math.abs(kY[0]-i[0])+0.6*Math.abs(kY[1]-i[1])))}})([ks[0],ks[1]]));var kB=this._cache.arrCache;this._curViewLabels=[];var kq="viewKey_"+Math.floor(kv.lng)+"_"+Math.floor(kv.lat)+"_"+kK;this.statRequestCount=0;this.statResponseCount=0;this._labelCount+=e.length;var kw=kK;for(var kP=0,kL=e.length;kP<kL;kP++){var ky=e[kP][0];var kA=e[kP][1];var T=e[kP][2];var kt=this._getLabelId(ky,kA,T,kw);var kR=kB[kt];if(!kR){kR=this._createCacheForm(ky,kA,T,kw)}if(typeof kR.lb==="undefined"){kR.lb=null;this._loadLabelData(ky,kA,T,kw,kE,kq);this.statRequestCount++}else{if(kR.lb){this._curViewLabels.push(kR.lb);this._labelCount--}else{if(kC){this._loadLabelData(ky,kA,T,kw,kE,kq)}kR.updateLabelCounter++}}}if(this._labelCount===0){this.updateLabel()}var kW=this;if(kW.errorTimer){clearTimeout(kW.errorTimer)}kW.errorTimer=setTimeout(function(){if(kW._labelCount!==0){kW._labelCount=0;kW.updateLabel()}var kY=new fS("onloaddatatimeout");var kZ=0;var kX=0;var k0=0;var i=0;if(kW.statRequestCount===kW.statResponseCount){kZ=1}else{kX=1}if(kX===1){i=kW.statRequestCount-kW.statResponseCount;k0=kW.statResponseCount}kY.noTimeoutCount=kZ;kY.timeoutCount=kX;kY.timeoutNoLoaded=i;kY.timeoutLoaded=k0;kW._map.dispatchEvent(kY)},500)},clearLabel:function(){var e=this._width;var T=this._height;var i=this.ratio;this._labelCtx.clearRect(0,0,e*i,T*i)},updateLabel:function(){var i=this._map;var e=i.getCenterIn();var kq=this._width;var kt=this._height;var kw=i.getZoom();var kv=this._tileType.getTileSize(kw);var ku=this._getZoomUnits(kw);var T=this._labelCtx;this._labelCanvas.style.left=-i.offsetX+"px";this._labelCanvas.style.top=-i.offsetY+"px";var ks=this._curViewLabels;ks._centerX=e.lng;ks._centerY=e.lat;var kr=this._biz.bizLabels;this._computedLabel=this._labelStrategy.preComputeLabel(ks,kq,kt,ku,kv,kr);this._computedLabel._zoom=kw;this.clearLabel();this._vectorDrawLib.drawIconAndText(T,this._computedLabel,kw);this._addSpotData();i.temp.isPermitSpotOver=true;if(ks.length>0){this.isDrawText=true}},_loadLabelData:function(kz,ky,kx,T,kA,e){var ks=kz.toString();var kq=ky.toString();var ku="cbk_"+ks.replace("-","_")+"_"+kq.replace("-","__")+"_"+Math.floor(kx);var kE=fB+"."+ku;var kD=this._labelDataUrls;var kw=Math.abs(kz+ky)%kD.length;var kJ=kD[kw];if(window.offLineIPAddress){kJ=window.offLineIPAddress+"pvd/"}var i=this.labelStyleParam;var kC="?qt=vtile";var kF="";if(this._map.config.style!=="default"){kF="&styleId=1"}var kB="x={x}&y={y}&z={z}&udt={udt}&v={v}&styles={styles}"+kF+"&textonly=1&textimg=1&scaler={scaler}&fn="+encodeURIComponent(kE);var kG=e9.calcLoopParam(kz,kx).col;var kv=this.ratio>1?2:1;var kt=kB.replace(/{x}/,kG).replace(/{y}/,ky).replace(/{z}/,Math.floor(kx)).replace(/{styles}/,i).replace(/{udt}/,this._udt).replace(/{v}/,this._version).replace(/{scaler}/,kv);var kr=kJ+kC+"&param="+window.encodeURIComponent(e2(kt));var kI=this;var kH=kI._map;bD[ku]=function(kK){kI._vectorDrawLib.parseLabelData(kK,kz,ky,kx,T,kA,function(kP){var kM=kH.getCenterIn();var kQ=kH.getZoom();var kS="viewKey_"+Math.floor(kM.lng)+"_"+Math.floor(kM.lat)+"_"+kQ;kI._labelCount--;var kT=kI._getCache(kz,ky,kx,T).updateLabelCounter;kI._labelCount-=kT;var kN=kI._curViewLabels;if(kS===e||(kI._labelCount<0&&kQ===kx)){kN.push(kP)}if(kS===e){kI.statResponseCount++}if(kI._labelCount<=0){var kL=(new Date()).getTime();kI.updateLabel();var kO=(new Date()).getTime();var kR=new fS("oncanvasmaploaded");kR.drawTime=kO-kL;if(kI.statResponseCount===kI.statRequestCount){kR.isAllLoadedDrawing=true}kH.dispatchEvent(kR)}kI._setCacheValue(kz,ky,kx,T,kP);delete bD[ku]})};gX.load(kr)},drawLabel:function(T,kq,kx,i,kv,kr,e,ks,kw,kt){var ku=this;if(!ku._computedLabel){return}if(ku._computedLabel._zoom!==kx){ku.clearLabel();return}ku._map.temp.isPermitSpotOver=false;ku.clearLabel();ku._vectorDrawLib.zoomingIconAndText(this._labelCtx,ku._computedLabel,T,kq,i,kv,kr,e,ks,kw,kt)},_addSpotData:function(){this._spotData=[];var kx=this._map.getZoom();for(var ks=0,kr=this._computedLabel.length;ks<kr;ks++){var ku=this._computedLabel[ks];if(!this.isClickableLabel(ku)||(ku.guidExt===1&&ku.startScale>kx)){continue}var kt=[];kt[0]=(ku.minX-ku.maxX)/2;kt[1]=(ku.minY-ku.maxY)/2;kt[2]=(ku.maxX-ku.minX)/2;kt[3]=(ku.maxY-ku.minY)/2;var kq=null;if(ku.iconPos){kq=new cD(ku.iconPos.geoX,ku.iconPos.geoY)}var T=ku.name?ku.name.replace("\\\\","<br>"):"";if(ku.iconPos&&ku.iconPos.iconType.indexOf("ditie")>-1&&this._map.getZoom()>14){T=""}var kw={n:T,pt:new cD(ku.geoX,ku.geoY),userdata:{iconPoint:kq,uid:ku.guid,name:T,type:ku.iconPos?ku.iconPos.iconType:"",iconImg:ku.iconImg,mapPoi:true,adver_log:ku.adver_log||""},bd:kt,tag:"MAP_SPOT_INFO"};this._spotData.push(kw)}var kv=new fS("onspotsdataready");kv.spots=this._spotData;this._map._spotDataOnCanvas=this._spotData;this._map.dispatchEvent(kv)},isClickableLabel:function(e){if(e.isDel||(!e.guid&&!e.name)){return false}return true},getFilterImageData:function(T,kt){var ku=T.data,ks=this._labelStrategy,kt=parseInt(kt);for(var kv=0,kr=ku.length;kv<kr;kv+=4){var e=ku[kv],kw=ku[kv+1],kx=ku[kv+2],ky=ku[kv+3];if(ky===0){continue}var kq=Math.round((e+kw+kx)/3);var kz=kq-90;kz=kz<0?0:kz;if(kt===ks.RANK5){ku[kv]=51+kz*1.3;ku[kv+1]=133+kz*0.8;ku[kv+2]=255}}return T},showLabelCanvas:function(){this._labelCanvas.style.visibility=""},hideLabelCanvas:function(){this._labelCanvas.style.visibility="hidden"}});var aU=5;var jj=4;var gJ=3;var N=2;var ez=1;var hG=0;var ko=3;var iD=5;var fq={3:{start:3,base:3},4:{start:4,base:5},5:{start:4,base:5},6:{start:6,base:7},7:{start:6,base:7},8:{start:8,base:9},9:{start:8,base:9},10:{start:10,base:10},11:{start:11,base:12},12:{start:11,base:12},13:{start:11,base:12},14:{start:14,base:15},15:{start:14,base:15},16:{start:16,base:17},17:{start:16,base:17},18:{start:18,base:19},19:{start:18,base:19},20:{start:18,base:19},21:{start:18,base:19}};function hd(kq){this._canvas2dMapMgr=kq;var i=this.ratio=kq._map.config.ratio;this._featureStyle=null;this._map=kq._map;var T=bE();var e="udt="+T.udt+"&v="+T.ver;this.sizeRatio=this.ratio>1?2:1;this._binaryCache={};this._iconCache={};this._initColorCanvas()}e6.extend(hd.prototype,{_initColorCanvas:function(){var i=256,T=b3("canvas"),e=T.style;e.width=i+"px";e.height=i+"px";T.width=i;T.height=i;this._colorCvs=T;this._colorCtx=T.getContext("2d")},parseLabelData:function(i,ks,kr,kq,e,kv,ku){if(!this._featureStyle){this._featureStyle=this._canvas2dMapMgr.getStyle()}if(!i||!i[0]){ku([]);return}var kt=this._map.getZoomUnits();var T=this;this.loadTextPng(i,kv,ks,kr,kq,e,kt,ku)},loadTextPng:function(kH,ky,kw,kv,kt,i,kr,kq){var kG=this;var e=kH[5];var kF=this._map;var kC=kF.getZoom();var T=kF.getSize();var kD=T.width;var kB=T.height;var kE=kF.getCenterIn();var ku=kE.lng;var ks=kE.lat;var kA=kw*ky*kr;var kz=(kv+1)*ky*kr;if(e){var kx=new Image();kx.onload=function(){kG.calcIconAndTextInfo(kH,kx,ky,kw,kv,kt,i,kr,kA,kz,kq);delete this.onload};kx.src=e}else{setTimeout(function(){kG.calcIconAndTextInfo(kH,null,ky,kw,kv,kt,i,kr,kA,kz,kq)},1)}},calcIconAndTextInfo:function(kJ,kA,kB,kz,kw,ku,kq,ks,kD,kC,kr){var kI=this;var kH=kI._featureStyle;var kx=[];kx.x=kz;kx.y=kw;kx.z=ku;var ky=kI._canvas2dMapMgr,T=kz*ks*kB,kG=(kw+1)*ks*kB,kt={tileLeft:T,tileTop:kG,zoomUnits:ks};var e=[];if(kJ[0]){for(var kE=0;kE<kJ[0].length;kE++){if(kJ[0][kE][0]===ko){e.push(kJ[0][kE])}}}var kv=kJ[2]||[];for(var kE=0;kE<e.length;kE++){this._getFixedLabelInfo(e[kE],kA,kq,ks,kB,kD,kC,kx)}var kF=Math.pow(2,kq-ku);for(kE=0;kE<kv.length;kE++){this._getLineLabelInfo(kv[kE],kA,ku,kq,ks,kB,kD,kC,kF,kx)}kr(kx)},_getFixedLabelInfo:function(kA,kE,kr,kv,kF,kI,kH,kK){var kz=kA[1];if(!kz){return}var kM=this._map.getZoom();var kU=this._map.config.style;var kV=this._featureStyle;var kw=kr;if(kw===9){kw=8}for(var kR=0;kR<kz.length;kR++){var kW=kz[kR];var e=kW[0];var kq=a1.getStyleFromCache(kU,e,"point",kw,kV);var kQ=a1.getStyleFromCache(kU,e,"pointText",kw,kV);if((!kQ||kQ.length===0)&&(!kq||kq.length===0)){if(kw===5){var ku=kW[1];if(!ku){continue}for(var kN=0;kN<ku.length;kN++){var kL=ku[kN][4];if(kL&&kL[7]==="北京"){kq=a1.getStyleFromCache(kU,e,"point",6,kV);kQ=a1.getStyleFromCache(kU,e,"pointText",6,kV);break}else{continue}}}else{continue}}var ku=kW[1];if(!ku){continue}var kS=null;var kx=1;var T=0;var kD=0;if(kq&&kq[0]){kq=kq[0];kS=kq.icon;kx=kq.zoom?kq.zoom/100:1}else{kq=null}for(var kN=0;kN<ku.length;kN++){var kL=ku[kN][4];if(!kL){continue}var kP=kL[2];if(!this._isVisible(kP,kM)){continue}var ky=kL[12];if(kQ&&kQ.length>0&&!ky){continue}var kC=Math.round(kL[0]/100);var kB=Math.round(kL[1]/100);var kO={lng:kI+kC,lat:kH-(kF*kv-kB)};var kt=kC/kv;var ks=kF-kB/kv;var kG=kL[7]||"";var kT=kL[5];var kJ={type:"fixed",name:kG,textImg:kE,rank:kL[4],baseX:kt,baseY:ks,iconPos:null,textPos:null,guid:kL[3]||"",tracer:kP,direction:kT,startScale:3};if((kT!==jj&&ky||!ky)&&kS!==null){kJ.iconPos=this._getIconPosition(kS,kx,kt,ks,kO);if(kJ.iconPos){T=kJ.iconPos.width;kD=kJ.iconPos.height}}if(T===0){kJ.direction=jj}if(ky){kJ.textPos=this._getTextDrawData(kL,kt,ks,T,kD)}if(kJ.textPos||kJ.iconPos){kK.push(kJ)}}}},_isVisible:function(e,i){var kq;if(!this._binaryCache[e]){kq=e.toString(2);if(kq.length<8){kq=new Array(8-kq.length+1).join("0")+kq}this._binaryCache[e]=kq}kq=this._binaryCache[e];var T=fq[i].start;return kq[i-T]==="1"},_getIconPosition:function(ku,ks,T,i,e){var kq=this._map.config.style;var kv=bD["iconSetInfo"+kq][ku];if(!kv){if(ku.charCodeAt(0)>=48&&ku.charCodeAt(0)<=57){kv=bD["iconSetInfo"+kq]["_"+ku]}}if(!kv){return null}var kr=kv[0];var kt=kv[1];kr=kr*ks;kt=kt*ks;return{srcX:0,srcY:0,destX:T-kr/2,destY:i-kt/2,width:kr,height:kt,geoX:e.lng,geoY:e.lat,mcPt:e,iconType:ku}},_getTextDrawData:function(kB,kA,kz,kq,kx){var kG=kB[5];if(typeof kG!=="number"){kG=0}var kv=this.ratio;var ku=kv/2;kq*=ku;kx*=ku;var kw=kB[12];var kr=kw.length;var kJ=0;var kI=0;var kF=[];var kE=0;var kH=0;for(var kD=0;kD<kr;kD++){kH+=Math.round(kw[kD][3])}for(var kD=0;kD<kr;kD++){var kt=kw[kD];var ks=kt[0];var i=kt[1];var T=kt[2];var e=kt[3];var kK=2*kv;var kC=0;if(kq!==0){kC=2*kv}if(kq===0){kG=jj}switch(kG){case gJ:var ky=kz-kH/2-kK*(kr-1)/2;kJ=kA-T-kq/2-kC;kI=ky+kE+kK*kD;break;case ez:var ky=kz-kH/2-kK*(kr-1)/2;kJ=kA+kq/2+kC;kI=ky+kE+kK*kD;break;case N:var ky=kz-kx/2-kH-kK*(kr-1)-kK;kJ=kA-T/2;kI=ky+kE+kK*kD;break;case hG:var ky=kz+kx/2+kK/2;kJ=kA-T/2;kI=ky+kE+kK*kD;break;case jj:var ky=kz-e/2-kK*(kr-1)/2;kJ=kA-T/2;kI=ky+kE+kK*kD;break}kE+=e;if(T>0&&e>0){kF.push({srcX:ks,srcY:i,destX:kJ,destY:kI,width:T,height:e})}}if(kF.length>0){return kF}return null},_getLineLabelInfo:function(ky,kq,kr,kN,k0,kF,kL,kK,kM,kE){if(ky.length!==10){return}var kP=this.ratio;var T=this.ratio;var kW=ky[7].length;var kG=ky[1];var kY=ky[3];var k4=ky[8];var ku=ky[4];var e=2;var ks=ku.slice(0,e);for(var k1=e;k1<ku.length;k1+=e){ks[k1]=ks[k1-e]+ku[k1];ks[k1+1]=ks[k1-(e-1)]+ku[k1+1]}for(var k1=e;k1<ku.length;k1+=e){if(k1%(kY*e)===0||k1%(kY*e)===1){continue}ks[k1]=ks[k1-e]+ku[k1]/kM;ks[k1+1]=ks[k1-(e-1)]+ku[k1+1]/kM}for(var k3=0;k3<kW;k3++){var kZ=ky[7][k3];if(!this._isVisible(kZ,kN)){continue}var kR=ky[6][k3];var kD=k3*kY*e;ku=ks.slice(kD,kD+kY*e);var kH=[];var kQ=undefined;var kO=undefined;var kC=undefined;var kB=undefined;var k4=ky[9].slice(0);if(kR){k4.reverse()}var kU;var kS;for(var k2=0;k2<kY;k2++){var kA=ky[5][kY*k3+k2];var kV=ku[k2*e]/100;var kT=ku[k2*e+1]/100;var kz=k4[k2];var kv=kz[0];var kx=kz[1];var kt=kz[2];var kw=kz[3];var kJ;var kI;var k6;var k5;if(k2===0){kU=k6=kV/k0;kS=kF-kT/k0;k5=kT/k0}else{k6=kV/k0;k5=kT/k0}var k8=kU+(k6-kU)*T-kt/2;var k7=kS+(kF-k5-kS)*T-kw/2;if(kQ===undefined){kQ=kU-kt/2;kO=kS-kw/2;kC=kQ+kt;kB=kO+kw}else{if(k8<kQ){kQ=k8}if(k7<kO){kO=k7}if(k8+kt>kC){kC=k8+kt}if(k7+kw>kB){kB=k7+kw}}kH.push({angle:kA,srcX:kv,srcY:kx,destX:k8,destY:k7,width:kt,height:kw})}var kX={type:"line",textImg:kq,rank:kG,baseX:kU,baseY:kS,arrWordPos:kH,minXOriginal:kQ,minYOriginal:kO,maxXOriginal:kC,maxYOriginal:kB,text:""};kE.push(kX)}},alterColor:function(kt,e,ks){var T=this._colorCtx,i=this._canvas2dMapMgr;T.clearRect(0,0,kt.width,kt.height);T.drawImage(e,kt.srcX,kt.srcY,kt.width,kt.height,0,0,kt.width,kt.height);var kr=T.getImageData(0,0,kt.width,kt.height),kq=i.getFilterImageData(kr,ks);T.putImageData(kq,0,0)},drawIconAndText:function(kF,kE,e){var kw=this.ratio;var ku=this.sizeRatio/kw;var ky=2/kw;var kQ=this;for(var kI=0,kG=kE.length;kI<kG;kI++){var kx=kE[kI];if(kx.isDel==false){var kr=kx.baseDrawX;var kq=kx.baseDrawY;if(kx.type=="fixed"){var kt=kx.iconPos,kJ=kx.textPos,kC=kx.textImg,kM=kx.startScale;if(kt&&kM<=e){var T=this._iconCache[kt.iconType];if(T){if(T.img){kF.drawImage(T.img,0,0,T.img.width,T.img.height,Math.round(kr*kw+(kt.drawX-kr)/ky),Math.round(kq*kw+(kt.drawY-kq)/ky),kt.width/ky,kt.height/ky)}else{T.drawLabels.push(kx)}}else{if(!T){this._iconCache[kt.iconType]={img:null,drawLabels:[kx]};var kS=new Image();kS._iconName=kt.iconType;kS.onload=function(){var kY=kQ._iconCache[this._iconName];kY.img=this;this.onload=null;for(var kU=0;kU<kY.drawLabels.length;kU++){var kW=kY.drawLabels[kU];var kV=kW.baseDrawX;var kT=kW.baseDrawY;var kX=kW.iconPos;kF.drawImage(this,0,0,this.width,this.height,Math.round(kV*kw+(kX.drawX-kV)/ky),Math.round(kT*kw+(kX.drawY-kT)/ky),kX.width/ky,kX.height/ky)}kY.drawPos=[]};kS.src=C.getIconSetPath(kQ._map.config.style)+kt.iconType+".png"}}}if(kJ&&kC&&kM<=e){for(var kv=0;kv<kJ.length;kv++){var kD=kJ[kv];if(!kx._tempRank){kF.drawImage(kC,kD.srcX,kD.srcY,kD.width,kD.height,Math.round(kr*kw+(kD.drawX-kr)/ku),Math.round(kq*kw+(kD.drawY-kq)/ku),kD.width/ku,kD.height/ku)}else{this.alterColor(kD,kC,kx._tempRank);kF.drawImage(this._colorCvs,0,0,kD.width,kD.height,Math.round(kr*kw+(kD.drawX-kr)/ku),Math.round(kq*kw+(kD.drawY-kq)/ku),kD.width/ku,kD.height/ku)}}}}else{var ks=kx.arrWordPos,kC=kx.textImg,kB=kx.tileX,kz=kx.tileY;for(var kH=0,kA=ks.length;kH<kA;kH++){var kK=ks[kH];var kR=Math.round(kB+kK.destX);var kP=Math.round(kz+kK.destY);var kL=kK.angle;kR=kr*kw+kR-kr;kP=kq*kw+kP-kq;if(kL>10&&kL<350){kF.save();var kO=Math.round(kR+kK.width/2);var kN=Math.round(kP+kK.height/2);kF.translate(kO,kN);kF.rotate(-kL/180*Math.PI);kF.drawImage(kC,kK.srcX,kK.srcY,kK.width,kK.height,-Math.round(kK.width/2),-Math.round(kK.height/2),kK.width/ku,kK.height/ku);kF.restore()}else{kF.drawImage(kC,kK.srcX,kK.srcY,kK.width,kK.height,kR,kP,kK.width/ku,kK.height/ku)}}}}}},isCollide:function(ks,kB,kA,e,ku,T,kw){for(var kr=0,kq=T.length;kr<kq;kr++){var kv=T[kr],kt=1/Math.pow(2,kw+1),kz=kt*kv[3]/2,ky=kt*kv[4]/2,kx=kv[0];if(kx!=ks){if(!(kB+e<kv[1]-kz||kB>kv[1]+kv[3]+kz||kA+ku<kv[2]-ky||kA>kv[2]+kv[4]+ky)){return true}}}return false},zoomingIconAndText:function(kQ,kK,kq,kO,kP,lh,kX,ky,k3,kW,kH){var li=this.ratio;var kz=this.sizeRatio/li;var lj=2/li;var lu=li/2;var ld=kO.x;var lc=kO.y;var kR=2*li;if(kH!==0){lc+=kW}var kC=undefined,kv=undefined,ks=undefined,kx=undefined,kG=undefined;var k2=lh>0?true:false;if(!k2){kC=[];var k6=1-kX}for(var lq=0,lo=kK.length;lq<lo;lq++){var lk=kK[lq];if(lk.isDel==false){var lv=lk.baseDrawX;var ls=lk.baseDrawY;kQ.save();kQ.translate(-ky*li,-k3*li);if(lk.isFadeout){if(!k2&&lk._schedule<=kX&&!lk._isIgnore){kQ.globalAlpha=k6;lk._schedule=kX}else{lk._isIgnore=true;continue}}if(lk.type=="fixed"){var kS=lk.iconPos,kZ=lk.textPos,kt=lk.textImg,kT=lk.startScale;var T;var la=0;if(kS){la=kR}if(kS&&!lk.iconImg&&this._iconCache[kS.iconType]){T=this._iconCache[kS.iconType].img}if(kS&&kT<=kP&&T){kx=kS.width;kG=kS.height;kv=(ld+(lv-ld)*kq)*li-kx/2/lj;ks=(lc+(ls-lc)*kq)*li-kG/2/lj+kH;if(!k2&&this.isCollide(lq,kv,ks,kx,kG,kC,lh)){lk.isFadeout=true}kQ.drawImage(T,kS.srcX,kS.srcY,T.width,T.height,Math.round(kv),Math.round(ks),kx/lj,kG/lj);!k2&&kC.push([lq,kv,ks,kx,kG])}if(kZ&&kt&&kT<=kP){var kY;var k0;var kJ=0;var kV=0;if(kS){kJ=kS.width;kV=kS.height}var lb=kZ.length;var kB=0;var k1=0;for(var kL=0;kL<lb;kL++){var ln=kZ[kL];k1+=ln.height;if(kB<ln.width){kB=ln.width}}k1+=(kL-1)*kR;if(!k2&&this.isCollide(lq,kv,ks,kB,k1,kC,lh)){lk.isFadeout=true}var lm=0;for(var kL=0;kL<lb;kL++){var ln=kZ[kL];switch(lk.direction){case gJ:kY=-(kJ/2/lj+ln.width+la);k0=-k1/2+lm+kR*kL;break;case ez:kY=kJ/2/lj+la;k0=-k1/2+lm+kR*kL;break;case N:kY=-ln.width/2;k0=-kV/2/lj-k1+lm-kR*(kL+1);break;case hG:kY=-ln.width/2;k0=kV/2/lj+lm+kR*(kL+1);break;case jj:kY=-ln.width/2;k0=-k1/2+lm+kR*kL;break}lm+=ln.height;kv=(ld+(lv-ld)*kq)*li+kY/kz;ks=(lc+(ls-lc)*kq)*li+k0/kz;+kH;kx=ln.width;kG=ln.height;if(!lk._tempRank){kQ.drawImage(kt,ln.srcX,ln.srcY,kx,kG,Math.round(kv),Math.round(ks),kx/kz,kG/kz)}else{this.alterColor(ln,kt,lk._tempRank);kQ.drawImage(this._colorCvs,0,0,kx,kG,Math.round(kv),Math.round(ks),kx/kz,kG/kz)}!k2&&kC.push([lq,kv,ks,kx,kG])}}}else{var kI=lk.arrWordPos,kt=lk.textImg,lt=lk.tileX,lr=lk.tileY;var kA=kI[0];var kw=Math.round(lt+kA.destX);var ku=Math.round(lr+kA.destY);for(var lp=0,k9=kI.length;lp<k9;lp++){var lg=kI[lp];var lx=Math.round(lt+lg.destX);var lw=Math.round(lr+lg.destY);var kN=lg.angle;var k8=Math.round((ld+(lv-ld)*kq)*li-kA.width/2+lx-kw);var k7=Math.round((lc+(ls-lc)*kq)*li-kA.height/2+lw-ku);kv=k8;ks=k7;kx=lg.width;kG=lg.height;if(!k2&&this.isCollide(lq,kv,ks,kx,kG,kC,lh)){lk.isFadeout=true}if(kN>10&&kN<350){var lf=k8+lg.width/2;var le=k7+lg.height/2;var kr=kN/180*Math.PI;var kU=Math.cos(kr);var kD=Math.sin(kr);var k5=kU;var kE=kU;var k4=kD;var kF=-kD;var kM=lf-lf*kU-le*kD;var e=le+lf*kD-le*kU;kQ.save();kQ.transform(k5,kF,k4,kE,kM,e);kQ.drawImage(kt,lg.srcX,lg.srcY,kx,kG,kv,ks,kx/kz,kG/kz);kQ.restore()}else{kQ.drawImage(kt,lg.srcX,lg.srcY,kx,kG,kv,ks,kx/kz,kG/kz)}!k2&&kC.push([lq,kv,ks,kx,kG])}}kQ.restore()}}}});function eA(e){this.initVars(e)}e6.extend(eA.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(ks,kw){var ku=this;this.bizData=ks;this.objTextsPng=null;this.arrIconsPng=null;var T=ks.textsPng;var ky=ks.iconsPng;if(!T||!ky){return}var kv=new Image();kv.onload=function(){ku.objTextsPng=this;ku.calcIconAndTextInfo(kw);this.onload=null};kv.src=this.base64Prefix+T;var kx=ky.length;var e=[];for(var kr=0;kr<kx;kr++){var kt=ky[kr];var kq=new Image();(function(i){kq.onload=function(){kx--;e[i]=this;if(kx===0){ku.arrIconsPng=e;ku.calcIconAndTextInfo(kw)}this.onload=null}})(kr);kq.src=this.base64Prefix+kt}},calcIconAndTextInfo:function(kz){if(this.objTextsPng&&this.arrIconsPng){var kv=this.bizData;var kt=kv.pois;var e=[];for(var kw=0,ks=kt.length;kw<ks;kw++){var kq=kt[kw];var ku=this.arrIconsPng[kq.iconPng];var kr=ku.height/2;var ky={type:"fixed",name:"",textImg:this.objTextsPng,iconImg:ku,rank:kq.rank,iconPos:{srcX:0,srcY:0,destX:-ku.width/2,destY:-kr/2,width:ku.width,height:kr,geoX:kq.x,geoY:kq.y,iconType:"vectorCustom"},textPos:this.calcTextPos(kq.pos,ku),startScale:kq.from<12?12:kq.from,guid:kq.guid,guidExt:1,adver_log:kq.adver_log||""};var T={type:"fixed",textDirLeft:"left",name:"",textImg:this.objTextsPng,iconImg:ku,rank:kq.rank,iconPos:{srcX:0,srcY:0,destX:-ku.width/2,destY:-kr/2,width:ku.width,height:kr,geoX:kq.x,geoY:kq.y,iconType:"vectorCustom"},textPos:this.calcTextPosLeft(kq.pos,ku),startScale:kq.from<12?12:kq.from,guid:kq.guid,guidExt:1,adver_log:kq.adver_log||""};var kx=[ky,T];e.push(kx)}this.bizLabels=e;kz&&kz()}},calcTextPos:function(kt,T){var i=[];var ks=kt.length/4;var kr=T.width/2;if(ks===1){var kq={srcX:kt[0],srcY:kt[1],destX:kr,destY:-kt[3]/2,width:kt[2],height:kt[3]};i.push(kq)}else{var kq={srcX:kt[0],srcY:kt[1],destX:kr,destY:-kt[3],width:kt[2],height:kt[3]};var e={srcX:kt[4],srcY:kt[5],destX:kr,destY:0,width:kt[6],height:kt[7]};i.push(kq);i.push(e)}return i},calcTextPosLeft:function(kt,T){var i=[];var ks=kt.length/4;var kr=T.width/2;if(ks===1){var kq={srcX:kt[0],srcY:kt[1],destX:-kr-kt[2],destY:-kt[3]/2,width:kt[2],height:kt[3]};i.push(kq)}else{var kq={srcX:kt[0],srcY:kt[1],destX:-kr-kt[2],destY:-kt[3],width:kt[2],height:kt[3]};var e={srcX:kt[4],srcY:kt[5],destX:-kr-kt[2],destY:0,width:kt[6],height:kt[7]};i.push(kq);i.push(e)}return i},clearBizData:function(){this.bizData=null;this.bizLabels=null}});var jM={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Float32:"FLOAT"};var ih={Int8:1,Uint8:1,Int16:2,Uint16:2,Float32:4};function w(kq,ks,T,kr){this.arrayBuffer=kq;this.attributes=ks.members;this.bytesPerElement=0;if(this.attributes){for(var e=0;e<this.attributes.length;e++){this.bytesPerElement+=ih[this.attributes[e].type]*this.attributes[e].components}}else{this.bytesPerElement=kq.BYTES_PER_ELEMENT*ks.components}this.length=kr||kq.byteLength/this.bytesPerElement;this.type=T;this.arrayType=ks}w.prototype.bind=function(i){var e=i[this.type];if(!this.buffer){this.buffer=i.createBuffer();i.bindBuffer(e,this.buffer);i.bufferData(e,this.arrayBuffer,i.STATIC_DRAW);this.arrayBuffer=null}else{i.bindBuffer(e,this.buffer)}};w.prototype.setVertexAttribPointers=function(kq,e){for(var i=0;i<this.attributes.length;i++){var kr=this.attributes[i];var T=e.attributes[kr.name];kq.vertexAttribPointer(T,kr.components,kq[jM[kr.type]],kr.normalize,this.bytesPerElement,kr.offset)}};w.prototype.updateVertexData=function(kq,i,T){this.arrayBuffer=i;if(!this.buffer){return this.bind(kq)}if(T<=this.length){var e=kq[this.type];kq.bindBuffer(e,this.buffer);kq.bufferData(e,this.arrayBuffer,kq.STATIC_DRAW)}else{this.destroy(kq);this.bind(kq)}this.length=T};w.prototype.destroy=function(e){if(this.buffer){e.deleteBuffer(this.buffer);this.buffer=null}};w.BufferType={VERTEX:"ARRAY_BUFFER",ELEMENT:"ELEMENT_ARRAY_BUFFER"};w.ELEMENT_ATTRIBUTE_TYPE="Uint16";w.VERTEX_ATTRIBUTE_ALIGNMENT=4;function dV(){this.boundProgram=null;this.boundVertexBuffer=null;this.boundElementBuffer=null;this.vao=null}dV.prototype.bind=function(ku,e,kq,kt){var kr=ku.extVertexArrayObject;if(kr===undefined){kr=ku.extVertexArrayObject=ku.getExtension("OES_vertex_array_object")}if(kr){if(!this.vao){this.vao=kr.createVertexArrayOES()}kr.bindVertexArrayOES(this.vao)}else{}if(!this.boundProgram){var kv=kr?0:(ku.currentNumAttributes||0);var ks=e.numAttributes;var T;for(T=kv;T<ks;T++){ku.enableVertexAttribArray(T)}if(!kr){for(T=ks;T<kv;T++){ku.disableVertexAttribArray(T)}ku.currentNumAttributes=ks}kq.bind(ku);kq.setVertexAttribPointers(ku,e);if(kt){kt.bind(ku)}if(kr){this.boundProgram=e;this.boundVertexBuffer=kq;this.boundElementBuffer=kt}}};dV.prototype.update=function(ku,kq,T,kt,e,i,ks){var kr=ku.extVertexArrayObject;if(kr===undefined){kr=ku.extVertexArrayObject=ku.getExtension("OES_vertex_array_object")}if(kr){kr.bindVertexArrayOES(this.vao);if(this.boundVertexBuffer){this.boundVertexBuffer.updateVertexData(ku,T,kt);this.boundVertexBuffer.setVertexAttribPointers(ku,this.boundProgram)}if(e&&this.boundElementBuffer){this.boundElementBuffer.updateVertexData(ku,i,ks)}}else{kq.updateVertexData(ku,T,kt);if(e){e.updateVertexData(ku,i,ks)}}};dV.prototype.unbind=function(i){var e=i.extVertexArrayObject;if(e){e.bindVertexArrayOES(null);this.boundProgram=null;this.boundVertexBuffer=null;this.boundElementBuffer=null}};dV.prototype.destroy=function(i){var e=i.extVertexArrayObject;if(e&&this.vao){e.deleteVertexArrayOES(this.vao);this.vao=null;this.boundProgram=null;this.boundVertexBuffer=null;this.boundElementBuffer=null}};function D(){}e6.extend(D.prototype,{centerAndZoomIn:function(T,kw,kx){kx=kx||{};if(!this.loaded){this.firstTileLoad=false}kw=this._getProperZoom(kw).zoom;if(kx.noAnimation!==true&&this.loaded){var ks=this._ifUseAnimation(T,kw);if(ks){this.flyToIn(T,kw,kx);return}}var ku=this;if(!T&&!kw){return}this._stopAllAnimations();if(T&&!T.equals(this.centerPoint)){this.fire(new fS("oncenter_changed"))}if(kw&&kw!==this.zoomLevel){this.fire(new fS("onzoom_changed"))}T=T||this.centerPoint;kw=kw||this.zoomLevel;kw=this._getProperZoom(kw).zoom;if(this.mapType===BMAP_EARTH_MAP){if(!this._earth){this.mapType=BMAPGL_NORMAL_MAP;this.temp.originMapType=BMAP_EARTH_MAP;function kv(){ku._earth=new bD.Earth(ku,{showRealSunlight:ku.config.showRealSunlight,showMilkyway:ku.config.showMilkyway,earthBackground:ku.config.earthBackground});ku._proxyEarthEvents();ku._changeEarthMapType(BMAP_EARTH_MAP);e6.extend(ku,bD.EarthView.prototype);delete ku.temp.originMapType}he.load("earth",function(){if(bD["FeatureStyle"+ku.config.style]){kv()}else{ku.loadMapStyleFiles(function(){kv()})}})}}this.lastLevel=this.zoomLevel||kw;this.zoomLevel=kw;var kt=new fS("onload");kt.point=T;kt.zoom=kw;this.centerPoint=new cD(T.lng,T.lat);this.defaultZoomLevel=this.defaultZoomLevel||this.zoomLevel;this.defaultCenter=this.defaultCenter||this.centerPoint;if(this.mapType!==BMAP_EARTH_MAP){this.centerPoint=this.restrictCenter(this.centerPoint)}if(!this.loaded&&!(this.temp.originMapType===BMAP_EARTH_MAP)){var i=this.config.defaultMaxBounds;var kr=new m(i,"baidu",this.mapType);if(this.mapType!==BMAP_NONE_MAP){var kq=new hH({mapType:this.mapType,copyright:kr,dataType:this.mapType===BMAP_SATELLITE_MAP?gQ:hV,customLayer:this.mapType===BMAP_SATELLITE_MAP,baseLayer:true,transparentPng:false,tileTypeName:this.mapType===BMAP_SATELLITE_MAP?"web":"na"});kq._isInnerLayer=true;this.addTileLayer(kq);this.baseLayerAdded=true}if(this.mapType===BMAP_NONE_MAP){hI.sendMessage(aZ(4,3,15),["layer","blank"])}else{if(this.mapType===BMAP_SATELLITE_MAP){hI.sendMessage(aZ(4,3,2),["layer","raster"])}else{hI.sendMessage(aZ(4,3,1,1),["layer","vector","normal"])}}if(this.mapType===BMAP_SATELLITE_MAP&&this.config.showVectorStreetLayer){this._addHybirdVectorMap()}else{if(this.mapType===BMAP_SATELLITE_MAP&&this._isHybridShow===true){this._addHybirdMap()}}this.on("zoom_changed",function(){if(this._heading===0){return}if(this.getZoom()<7&&this.config.restrictCenter===true){ku.resetHeading()}})}this.loaded=true;this.dispatchEvent(kt);kx.callback&&kx.callback()},_ifUseAnimation:function(kq,kv){var ku=this.getSize();var T={zoom:this.zoomLevel};var kx={zoom:kv};var kw=this.pointToPixelIn(this.centerPoint);var kr=this.pointToPixelIn(kq,T);var kt=this.pointToPixelIn(this.centerPoint,kx);var kz=this.pointToPixelIn(kq,kx);var ks=Math.abs(kw.x-kr.x);var i=Math.abs(kw.y-kr.y);var e=Math.abs(kt.x-kz.x);var ky=Math.abs(kt.y-kz.y);if((ks>ku.width||i>ku.height)&&(e>ku.width||ky>ku.height)){return false}return true},_setPlatformPosition:function(kx,kw,kz){kz=kz||{};if(kx===0&&kw===0&&!kz.point){return}if(isNaN(kz.initMapOffsetX)){kz.initMapOffsetX=this.offsetX}if(isNaN(kz.initMapOffsetY)){kz.initMapOffsetY=this.offsetY}var kt=iP(this._heading);if(this._tilt>0){kw=kw/Math.cos(iP(this._tilt))}var ky=kx*Math.cos(kt)+kw*Math.sin(kt);var kv=-kx*Math.sin(kt)+kw*Math.cos(kt);ky=ky+kz.initMapOffsetX;kv=kv+kz.initMapOffsetY;if(kz.point){var i=this.restrictCenter(kz.point);if(!i.equals(this.centerPoint)){this.centerPoint=i.clone();this.fire(new fS("oncenter_changed"))}}else{var kq=this.offsetX-ky;var e=this.offsetY-kv;var ku=this.centerPoint.lng;var ks=this.centerPoint.lat;var kr=new cD(ku,ks);var T=this.getZoomUnits();this.centerPoint=this.restrictCenter(new cD(kr.lng+kq*T,kr.lat-e*T),T);this.fire(new fS("oncenter_changed"))}this.offsetX=ky;this.offsetY=kv;this.dispatchEvent(new fS("onmoving"))},restrictCenter:function(ky,e){if(this.config.restrictCenter===false){return ky}e=e||this.getZoomUnits();var kw=this.pixelToPointIn(new fr(this.width,0),{center:ky});var kt=this.pixelToPointIn(new fr(0,this.height),{center:ky});var kz=ky.lng;var kE=ky.lat;if(this.config.restrictBounds!==null&&!this.config.restrictBounds.isEmpty()){var kD=this.config.restrictBounds;var T=kD.getSouthWest();var kB=kD.getNorthEast();var kx=jn.convertLL2MC(T);var kr=jn.convertLL2MC(kB);var ku=this.calcNewZoomByRestriction(kz,kE,kt,kw,kx.lng,kr.lng,kx.lat,kr.lat);if(ku>this.zoomLevel){this.zoomLevel=ku;return ky}ky.lng=this.calcNewLngByBounds(kz,kt,kw,kx.lng,kr.lng,e);ky.lat=this.calcNewLatByBounds(kE,kt,kw,kx.lat,kr.lat,e);return ky}var kv=this.pixelToPointIn(new fr(0,0),{center:ky});var kq=this.pixelToPointIn(new fr(0,this.height),{center:ky});if(this.zoomLevel<5){if(kv.lat>hX.MAX_LAT&&kq.lat<hX.MIN_LAT){var i=hX.MAX_LAT-ky.lat;var ks=ky.lat-hX.MIN_LAT;var kC;if(i<ks){kC=i/(this.height/2)}else{kC=ks/(this.height/2)}var kA=18-p(kC);this.zoomLevel=kA;return ky}}if(kv.lat>hX.MAX_LAT){ky.lat=hX.MAX_LAT-this.height/2*e}else{if(kq.lat<hX.MIN_LAT){ky.lat=hX.MIN_LAT+this.height/2*e}}return ky},calcNewZoomByRestriction:function(kx,kw,e,kv,kr,kt,kq,ks){var kA=0;var kB=0;if(typeof kq==="number"&&typeof ks==="number"&&kv.lat>ks&&e.lat<kq){var T=ks-kw;var i=kw-kq;var ku;if(T<i){ku=T/(this.height/2)}else{ku=i/(this.height/2)}kA=18-p(ku)}if(typeof kr==="number"&&typeof kt==="number"&&kv.lng>kt&&e.lng<kr){var kz=kt-kx;var ky=kx-kr;var ku;if(kz<ky){ku=kz/(this.width/2)}else{ku=ky/(this.width/2)}kB=18-p(ku)}return Math.max(kA,kB)||this.zoomLevel},calcNewLatByBounds:function(i,kq,T,kt,ks,e){var kr=i;if(T.lat>ks){kr=ks-this.height/2*e}else{if(kq.lat<kt){kr=kt+this.height/2*e}}return kr},calcNewLngByBounds:function(kt,ks,kq,kr,T,e){var i=kt;if(kq.lng>T){i=T-this.width/2*e}else{if(ks.lng<kr){i=kr+this.width/2*e}}return i},zoomTo:function(e,kC,kD){var ky=es[this.mapType];if(!ky){return}var kx=this._getProperZoom(e);e=kx.zoom;if(this.zoomLevel===e){kD&&kD.callback&&kD.callback();return}var ks=e;this.lastLevel=this.zoomLevel;kD=kD||{};if(this.zoomEventStatus==="idle"){this.fire(new fS("onzoomstart"));this.zoomEventStatus="zooming"}if(!kC&&(this.getInfoWindow()&&this.temp.infoWin&&this.temp.infoWin.isOpen())){kC=jn.convertLL2MC(this.getInfoWindow().getPoint())}var T=null;if(kD.fixPixel){T=kD.fixPixel}else{if(kC){T=this.pointToPixelIn(kC,{useRound:false})}}var kt=this.pixelToPointIn(T);var ku=this.centerPoint.clone();this.fixPoint=kC;this.fixPixel=T;this.fixCenter=ku;this.mousePosMCPoint=kt;if(kD.noAnimation){e=kx.zoom;this.zoomLevel=e;this.fire(new fS("onzoom_changed"));var kr=this.getCurrentMaxTilt();if(this._tilt>kr){this._tilt=kr}if(kC){if(this._heading%360!==0||this._tilt>0){var i=this._webglMapCamera.fromScreenPixelToMC(T.x,T.y,{center:ku,zoom:this.zoomLevel});if(i){var kz=i.sub(kt);var kq=ku.sub(kz);this.centerPoint=this.restrictCenter(kq)}}else{var kw=this.getZoomUnits();var kq=new cD(kC.lng-kw*(T.x-this.width/2),kC.lat+kw*(T.y-this.height/2));this.centerPoint=this.restrictCenter(kq,kw)}this.fire(new fS("oncenter_changed"))}this._checkFireZoomend();kD.callback&&kD.callback();return}this._animationInfo.zoom={current:this.zoomLevel,diff:e-this.zoomLevel,target:e};var kA=this;var kB=this._tilt;if(this.fixPoint||kB>hX.MAX_DRAG_TILT_L2){kD.renderCallback=function(){var kH=kA.getCurrentMaxTilt();if(kA._tilt>kH){kA._tilt=kH}var kI=kA.fixPixel;if(!kA.fixPixel||!kA.fixPoint){return}var kE=kA.fixPixel;var kO=kA.fixPoint;var kL=kA.fixCenter;var kJ=kA.mousePosMCPoint;if(kA._heading%360!==0||kA._tilt>0){var kF=kA._webglMapCamera.fromScreenPixelToMC(kE.x,kE.y,{center:kL,zoom:kA.zoomLevel,tilt:kA._tilt});if(kF){var kN=kF.sub(kJ);var kG=kL.sub(kN);kA.centerPoint=kA.restrictCenter(kG)}}else{var kK=kE;var kM=kA.getZoomUnits();var kG=new cD(kO.lng-kM*(kK.x-kA.width/2),kO.lat+kM*(kK.y-kA.height/2));kA.centerPoint=kA.restrictCenter(kG,kM)}kA.fire(new fS("oncenter_changed"))}}if(kD.fromMouseWheel===true){this._startInfiniteZoomAnimation(kD);kD.callback&&kD.callback();kA._checkFireZoomend();return}if(!kD.callback){kD.callback=function(){kA._checkFireZoomend()}}else{var kv=kD.callback;kD.callback=function(kE,kF){kv(kE,kF);kA._checkFireZoomend()}}this._startAnimation(kD)},_checkFireZoomend:function(){var e=this;if(e.fireZoomendTimer){clearTimeout(e.fireZoomendTimer)}e.fireZoomendTimer=setTimeout(function(){if(e.zoomEventStatus==="zooming"){e.fire(new fS("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(T,kU,kF){kF=kF||{};var kr=this._getProperZoom(kU);kU=kr.zoom;if(this.centerPoint.equals(T)&&this.zoomLevel===kU&&typeof kF.heading!=="number"&&typeof kF.tilt!=="number"){return}var e=this.getHeading()%360;var kx=this.getTilt();var kD=0;var kH=0;var kA=this.getBounds().containsPoint(T);if(typeof kF.heading==="number"){kD=kF.heading}else{if(kA){kD=e}}if(typeof kF.tilt==="number"){kH=kF.tilt}else{if(kA){kH=kx}}this._heading=e;var kR=kD-e;var kN=kH-kx;var kB=this;var kt=this.zoomLevel;var ku=1.42;var kJ=this.zoomScale(kU-kt);var kW=this.getZoomUnits();var kz=this.centerPoint.div(kW);var kX=T.div(kW);var kQ=this.worldSize();var kM=ku;var kL=Math.max(this.width,this.height);var kK=kL/kJ;var ky=kX.sub(kz).mag();var i=kM*kM;function kT(kZ){var kY=(kK*kK-kL*kL+(kZ?-1:1)*i*i*ky*ky)/(2*(kZ?kK:kL)*i*ky);return Math.log(Math.sqrt(kY*kY+1)-kY)}function kq(kY){return(Math.exp(kY)-Math.exp(-kY))/2}function kv(kY){return(Math.exp(kY)+Math.exp(-kY))/2}function kE(kY){return kq(kY)/kv(kY)}var kw=kT(0);var kO=function(kY){return(kv(kw)/kv(kw+kM*kY))};var kP=function(kY){return kL*((kv(kw)*kE(kw+kM*kY)-kq(kw))/i)/ky};var ks=(kT(1)-kw)/kM;if(Math.abs(ky)<0.000001||ks===Infinity||isNaN(ks)){if(Math.abs(kL-kK)<0.000001){this._animationInfo.zoom={current:this.zoomLevel,diff:kU-this.zoomLevel};this._animationInfo.center={current:this.centerPoint,diff:T.sub(this.centerPoint)};this._animationInfo.heading={current:e,diff:kD-e};this._animationInfo.tilt={current:kx,diff:kH-kx};this.setLock(true);this._startAnimation({callback:function(kY){kB.setLock(false);if(kF.callback){kF.callback(kY)}},duration:kF.duration});return}var kV=kK<kL?-1:1;ks=Math.abs(Math.log(kK/kL))/kM;kP=function(){return 0};kO=function(kY){return Math.exp(kV*kM*kY)}}var kS=1.7;if(ks<0.3){kS=0.8}else{if(ks>5){kS=(ks-5)/2+kS}}var kG=kF.duration||1000*ks/kS;if(isNaN(kG)){var kI={};for(var kC in kF){kI[kC]=kF[kC];kI.noAnimation=true}this.centerAndZoomIn(T,kU,kI);return}this.fire(new fS("onmovestart"));this.fire(new fS("onzoomstart"));this.setLock(true);this._startAnimation({duration:kG,renderCallback:function(kY,kZ){var k0=kY*ks;var k3=kP(k0);var k2=kt+kB.scaleZoom(1/kO(k0));if(k2<kB.getMinZoom()){k2=kB.getMinZoom()}if(k2>kB.getMaxZoom()){k2=kB.getMaxZoom()}if(k2!==kB.zoomLevel){kB.zoomLevel=k2;kB.fire(new fS("onzoom_changed"))}kB.centerPoint=kz.add(kX.sub(kz).mult(k3)).mult(kW);kB.fire(new fS("oncenter_changed"));if(typeof kD==="number"){var k1=kY/0.7;if(k1>1){k1=1}kB.setHeading(e+kR*kY,{noAnimation:true})}if(typeof kH==="number"){kB.setTilt(kx+kN*kY,{noAnimation:true})}},callback:function(kY,kZ){kB.setLock(false);if(kZ&&kZ.stop===true){kB.fire(new fS("onmoveend"));kB.fire(new fS("onzoomend"));kF.callback&&kF.callback(kY);return}if(kU!==kB.zoomLevel){kB.zoomLevel=kU;kB.fire(new fS("onzoom_changed"))}kB.fire(new fS("onmoveend"));kB.fire(new fS("onzoomend"));kF.callback&&kF.callback(kY)}})},zoomScale:function(e){return Math.pow(2,e)},scaleZoom:function(e){return Math.log(e)/Math.LN2},panToIn:function(i,T){T=T||{};if(!i||i.equals(this.centerPoint)){T.callback&&T.callback();return}var kq=this.pointToPixelIn(i);var e=Math.round(this.width/2);var ks=Math.round(this.height/2);var kr=this._ifUseAnimation(i,this.zoomLevel);if(T.noAnimation===true||kr===false){this._stopAllAnimations();this._panToIn(e-kq.x,ks-kq.y,i);T.callback&&T.callback();return}this.flyToIn(i,this.zoomLevel,T)},_panToIn:function(i,e,kq){var T=this.temp;if(T.operating===true){return}if(T.dragAni){T.dragAni.stop(false,{readyToMove:true});T.dragAni=null}this.dispatchEvent(new fS("onmovestart"));this._setPlatformPosition(i,e,{point:kq});this.dispatchEvent(new fS("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,T){i=Math.round(i)||0;e=Math.round(e)||0;T=T||{};if(Math.abs(i)<=this.width&&Math.abs(e)<=this.height&&T.noAnimation!==true){this._panBy(i,e,T)}else{this._panToIn(i,e,T.point);T.callback&&T.callback()}},_panBy:function(i,e,kr){if(this.temp.operating===true){return}kr=kr||{};this.dispatchEvent(new fS("onmovestart"));var kq=this;var T=kq.temp;T.pl=kq.offsetX;T.pt=kq.offsetY;if(T.tlPan){T.tlPan.cancel()}if(T.dragAni){T.dragAni.stop(false,{readyToMove:true});T.dragAni=null}T.tlPan=new fH({fps:kr.fps||kq.config.fps,duration:kr.duration||kq.config.actionDuration,transition:kr.transition||gL.easeInOutQuad,render:function(ks){this.terminative=kq.temp.operating;if(kq.temp.operating){return}kq._setPlatformPosition(i*ks,e*ks,{initMapOffsetX:T.pl,initMapOffsetY:T.pt})},finish:function(ks){kq.dispatchEvent(new fS("onmoveend"));kq.temp.tlPan=false;if(kq.temp.stopArrow===true){kq.temp.stopArrow=false;if(kq.temp.arrow!==0){kq._arrow()}}}})},_startAnimation:function(i){var kr=this._animationInfo;var T=this;i=i||{};if(T._ani){T._ani.stop(!!i.goToEnd,{stopCurrentAnimation:i.stopCurrentAnimation})}if(T._infiniteAni){T._infiniteAni.stop();T._infiniteAni=null}var ks=i.duration||500;var kt=i.transition||gL.ease;var e=new fS("onanimation_start");this.fire(e);if(i.unstopable){kr=this._animationInfoUnstopable}var kq=new fH({duration:ks,transition:kt,render:function(kw,kv){for(var ku in kr){if(!kr.hasOwnProperty(ku)){continue}var ky=kr[ku].current;var kx=kr[ku].diff;T._setValueTick(ku,ky,kx,kw)}if(i.renderCallback){i.renderCallback(kw,kv)}},finish:function(ku){T.fire(new fS("onanimation_end"));if(i.unstopable){T._animationInfoUnstopable={};T._unstopableAni=null}else{T._ani=null;T._animationInfo={}}if(i.mapNeedCbk){i.mapNeedCbk()}if(i.callback){i.callback(ku)}},onStop:function(ku){ku=ku||{};T.fire(new fS("onanimation_end"));if(ku.stopCurrentAnimation){T._animationInfo={}}T._ani=null;if(i.mapNeedCbk){i.mapNeedCbk()}if(i.callback){i.callback(null,{stop:true})}}});if(i.unstopable){T._unstopableAni=kq}else{T._ani=kq}},_startInfiniteZoomAnimation:function(e){var i=this;if(i._ani){i._ani.stop(!!e.goToEnd,{stopCurrentAnimation:e.stopCurrentAnimation})}if(i._infiniteAni){return}this.fire(new fS("onanimation_start"));i._infiniteAni=new fH({duration:10000,transition:gL.linear,render:function(){var T=i._animationInfo.zoom;if(Math.abs(T.current-T.target)<0.001){i._setValue("zoom",T.target);i._infiniteAni&&i._infiniteAni.stop();return}T.current+=(T.target-T.current)*0.35;i._setValue("zoom",T.current);if(e.renderCallback){e.renderCallback()}},finish:function(){i._infiniteAni=null;i._animationInfo={};i.fire(new fS("onanimation_end"));if(e.callback){e.callback()}},onStop:function(){i._infiniteAni=null;i._animationInfo={};i.fire(new fS("onanimation_end"));if(e.callback){e.callback()}}})},_setValue:function(e,T){if(e==="zoom"){this._preZoomLevel=this.zoomLevel;var i=this._getProperZoom(T);T=i.zoom;if(T!==this.zoomLevel){this.zoomLevel=T;if(T<5){this.restrictCenter(this.centerPoint)}this.fire(new fS("on"+e+"_changed"))}return}else{if(e==="center"){this.centerPoint=T}}this["_"+e]=T;this.fire(new fS("on"+e+"_changed"))},_setValueTick:function(e,kr,kq,i){if(e==="center"){var T=new cD(kr.lng+kq.lng*i,kr.lat+kq.lat*i);this._setValue(e,T);return}if(e==="zoom"){this._setValue(e,Math.pow(kr,1-i)*Math.pow(kr+kq,i));return}this._setValue(e,kr+kq*i)},setHeading:function(kq,i){i=i||{};if(kq===this._heading){i.callback&&i.callback();return}var T=en(this._heading,360);var e=en(kq,360);if(e===T){this._heading=kq;i.callback&&i.callback();return}if(i.noAnimation){this._setValue("heading",kq);i.callback&&i.callback();return}if(i.unstopable){this._animationInfoUnstopable.heading={current:this._heading,diff:kq-this._heading}}else{this._animationInfo.heading={current:this._heading,diff:kq-this._heading}}this._startAnimation(i)},resetHeading:function(e){var i=this._heading;while(i<0){i+=360}i=i%360;if(i>180){i-=360}this._heading=i;e=e||{};e.unstopable=true;this.setHeading(0,e)},getHeading:function(){return this._heading},setTilt:function(e,i){i=i||{};if(e===this._tilt){i.callback&&i.callback();return}if(e>hX.MAX_TILT){e=hX.MAX_TILT}if(e<hX.MIN_TILT){e=hX.MIN_TILT}if(i&&i.noAnimation){this._setValue("tilt",e);i.callback&&i.callback();return}this._animationInfo.tilt={current:this._tilt,diff:e-this._tilt};this._startAnimation(i)},getTilt:function(){return this._tilt},getCenterIn:function(){return this.centerPoint},getZoom:function(){return this.zoomLevel},getCameraPosition:function(T){T=T||{};var e=T.center||this.centerPoint;var kq=T.zoom||this.zoomLevel;var kt=typeof T.heading==="number"?T.heading:this._heading;var i=typeof T.tilt==="number"?T.tilt:this._tilt;var ks=this._webglMapCamera.generateMVMatrix(e,kq,kt,i);var kr=mat4.create(Float32Array);mat4.invert(kr,ks);return this._webglMapCamera.getPosition(kr)}});function bp(i){this._jobQueue=[];this._idleOnlyJobQueue=[];var e=this;this.isIdle=true;i.on("updateframe",function(kq){var T=12-kq.frameTime;T=T<1?1:T;e.isIdle=false;if(e.idleWorkTimer){clearInterval(e.idleWorkTimer);e.idleWorkTimer=null}e.runJobs(T)});this._idleWorkerTicker=(function(T){return function(){if(T.isIdle){T.runJobs();T.runIdleOnlyJobs()}}})(this);i.on("mapglidle",function(){e.isIdle=true;e.runJobs();e.runIdleOnlyJobs();e.idleWorkTimer=setInterval(e._idleWorkerTicker,bp.MAX_IDLE_TIME)});i.on("destroy",function(){if(e.idleWorkTimer){clearInterval(e.idleWorkTimer);e.idleWorkTimer=null}})}bp.MAX_IDLE_TIME=50;bp.MAX_FRAME_TIME=6;bp.prototype.runJobs=function(i){if(this._jobQueue.length===0){return}var kq=ip();var e=0;i=i||bp.MAX_FRAME_TIME;while(this._jobQueue.length&&e<i){var T=this._jobQueue.shift();if(T.state!=="invalid"){T.call()}e=ip()-kq}};bp.prototype.runIdleOnlyJobs=function(){if(this._idleOnlyJobQueue.length===0){return}var T=ip();var e=0;while(this._idleOnlyJobQueue.length&&e<bp.MAX_IDLE_TIME){var i=this._idleOnlyJobQueue.shift();if(i.state!=="invalid"){i.call()}e=ip()-T}};bp.prototype.checkIdleRunning=function(){if(this.isIdle&&!this.idleWorkTimer){this.runJobs();this.runIdleOnlyJobs();this.idleWorkTimer=setInterval(this._idleWorkerTicker,50)}};bp.prototype.addJob=function(e){this._jobQueue.push(e);this.checkIdleRunning()};bp.prototype.clearJobs=function(){this._jobQueue.length=0;this._idleOnlyJobQueue.length=0};bp.prototype.addIdleOnlyJob=function(e){this._idleOnlyJobQueue.push(e);this.checkIdleRunning()};var d1={};(function(kt){if(!kx){var kx=0.000001}if(!i){var i=(typeof Float32Array!=="undefined")?Float32Array:Array}if(!kr){var kr=Math.random}var T={};var ks=Math.PI/180;T.toRadian=function(ky){return ky*ks};var kw={};kw.create=function(kz){kz=kz||i;var ky=new kz(2);ky[0]=0;ky[1]=0;return ky};kw.clone=function(ky,kA){kA=kA||i;var kz=new kA(2);kz[0]=ky[0];kz[1]=ky[1];return kz};kw.fromValues=function(ky,kB,kA){kA=kA||i;var kz=new kA(2);kz[0]=ky;kz[1]=kB;return kz};kw.copy=function(kz,ky){kz[0]=ky[0];kz[1]=ky[1];return kz};kw.set=function(kz,ky,kA){kz[0]=ky;kz[1]=kA;return kz};kw.add=function(kA,kz,ky){kA[0]=kz[0]+ky[0];kA[1]=kz[1]+ky[1];return kA};kw.subtract=function(kA,kz,ky){kA[0]=kz[0]-ky[0];kA[1]=kz[1]-ky[1];return kA};kw.sub=kw.subtract;kw.multiply=function(kA,kz,ky){kA[0]=kz[0]*ky[0];kA[1]=kz[1]*ky[1];return kA};kw.mul=kw.multiply;kw.divide=function(kA,kz,ky){kA[0]=kz[0]/ky[0];kA[1]=kz[1]/ky[1];return kA};kw.div=kw.divide;kw.min=function(kA,kz,ky){kA[0]=Math.min(kz[0],ky[0]);kA[1]=Math.min(kz[1],ky[1]);return kA};kw.max=function(kA,kz,ky){kA[0]=Math.max(kz[0],ky[0]);kA[1]=Math.max(kz[1],ky[1]);return kA};kw.scale=function(kA,kz,ky){kA[0]=kz[0]*ky;kA[1]=kz[1]*ky;return kA};kw.scaleAndAdd=function(kA,kz,ky,kB){kA[0]=kz[0]+(ky[0]*kB);kA[1]=kz[1]+(ky[1]*kB);return kA};kw.distance=function(kA,kz){var ky=kz[0]-kA[0],kB=kz[1]-kA[1];return Math.sqrt(ky*ky+kB*kB)};kw.dist=kw.distance;kw.squaredDistance=function(kA,kz){var ky=kz[0]-kA[0],kB=kz[1]-kA[1];return ky*ky+kB*kB};kw.sqrDist=kw.squaredDistance;kw.length=function(kz){var ky=kz[0],kA=kz[1];return Math.sqrt(ky*ky+kA*kA)};kw.len=kw.length;kw.squaredLength=function(kz){var ky=kz[0],kA=kz[1];return ky*ky+kA*kA};kw.sqrLen=kw.squaredLength;kw.negate=function(kz,ky){kz[0]=-ky[0];kz[1]=-ky[1];return kz};kw.normalize=function(kB,kA){var kz=kA[0],kC=kA[1];var ky=kz*kz+kC*kC;if(ky>0){ky=1/Math.sqrt(ky);kB[0]=kA[0]*ky;kB[1]=kA[1]*ky}return kB};kw.dot=function(kz,ky){return kz[0]*ky[0]+kz[1]*ky[1]};kw.cross=function(kA,kz,ky){var kB=kz[0]*ky[1]-kz[1]*ky[0];kA[0]=kA[1]=0;kA[2]=kB;return kA};kw.lerp=function(kA,kz,ky,kB){var kD=kz[0],kC=kz[1];kA[0]=kD+kB*(ky[0]-kD);kA[1]=kC+kB*(ky[1]-kC);return kA};kw.random=function(ky,kA){kA=kA||1;var kz=kr()*2*Math.PI;ky[0]=Math.cos(kz)*kA;ky[1]=Math.sin(kz)*kA;return ky};kw.transformMat2=function(kB,kA,kz){var ky=kA[0],kC=kA[1];kB[0]=kz[0]*ky+kz[2]*kC;kB[1]=kz[1]*ky+kz[3]*kC;return kB};kw.transformMat2d=function(kB,kA,kz){var ky=kA[0],kC=kA[1];kB[0]=kz[0]*ky+kz[2]*kC+kz[4];kB[1]=kz[1]*ky+kz[3]*kC+kz[5];return kB};kw.transformMat3=function(kB,kA,kz){var ky=kA[0],kC=kA[1];kB[0]=kz[0]*ky+kz[3]*kC+kz[6];kB[1]=kz[1]*ky+kz[4]*kC+kz[7];return kB};kw.transformMat4=function(kB,kA,kz){var ky=kA[0],kC=kA[1];kB[0]=kz[0]*ky+kz[4]*kC+kz[12];kB[1]=kz[1]*ky+kz[5]*kC+kz[13];return kB};kw.rotate=function(kB,kz,ky,kF){var kE=kz[0]-ky[0];var kD=kz[1]-ky[1];var kA=Math.sin(kF);var kC=Math.cos(kF);kB[0]=kE*kC-kD*kA+ky[0];kB[1]=kE*kA+kD*kC+ky[1];return kB};kw.forEach=(function(){var ky=kw.create();return function(kB,kF,kG,kE,kD,kz){var kC,kA;if(!kF){kF=2}if(!kG){kG=0}if(kE){kA=Math.min((kE*kF)+kG,kB.length)}else{kA=kB.length}for(kC=kG;kC<kA;kC+=kF){ky[0]=kB[kC];ky[1]=kB[kC+1];kD(ky,ky,kz);kB[kC]=ky[0];kB[kC+1]=ky[1]}return kB}})();kw.str=function(ky){return"vec2("+ky[0]+", "+ky[1]+")"};kt.vec2=kw;var kv={};kv.create=function(kz){kz=kz||i;var ky=new kz(3);ky[0]=0;ky[1]=0;ky[2]=0;return ky};kv.clone=function(ky,kA){kA=kA||i;var kz=new kA(3);kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];return kz};kv.fromValues=function(ky,kC,kA,kB){kB=kB||i;var kz=new kB(3);kz[0]=ky;kz[1]=kC;kz[2]=kA;return kz};kv.copy=function(kz,ky){kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];return kz};kv.set=function(kz,ky,kB,kA){kz[0]=ky;kz[1]=kB;kz[2]=kA;return kz};kv.add=function(kA,kz,ky){kA[0]=kz[0]+ky[0];kA[1]=kz[1]+ky[1];kA[2]=kz[2]+ky[2];return kA};kv.subtract=function(kA,kz,ky){kA[0]=kz[0]-ky[0];kA[1]=kz[1]-ky[1];kA[2]=kz[2]-ky[2];return kA};kv.sub=kv.subtract;kv.multiply=function(kA,kz,ky){kA[0]=kz[0]*ky[0];kA[1]=kz[1]*ky[1];kA[2]=kz[2]*ky[2];return kA};kv.mul=kv.multiply;kv.divide=function(kA,kz,ky){kA[0]=kz[0]/ky[0];kA[1]=kz[1]/ky[1];kA[2]=kz[2]/ky[2];return kA};kv.div=kv.divide;kv.min=function(kA,kz,ky){kA[0]=Math.min(kz[0],ky[0]);kA[1]=Math.min(kz[1],ky[1]);kA[2]=Math.min(kz[2],ky[2]);return kA};kv.max=function(kA,kz,ky){kA[0]=Math.max(kz[0],ky[0]);kA[1]=Math.max(kz[1],ky[1]);kA[2]=Math.max(kz[2],ky[2]);return kA};kv.scale=function(kA,kz,ky){kA[0]=kz[0]*ky;kA[1]=kz[1]*ky;kA[2]=kz[2]*ky;return kA};kv.scaleAndAdd=function(kA,kz,ky,kB){kA[0]=kz[0]+(ky[0]*kB);kA[1]=kz[1]+(ky[1]*kB);kA[2]=kz[2]+(ky[2]*kB);return kA};kv.distance=function(kA,kz){var ky=kz[0]-kA[0],kC=kz[1]-kA[1],kB=kz[2]-kA[2];return Math.sqrt(ky*ky+kC*kC+kB*kB)};kv.dist=kv.distance;kv.squaredDistance=function(kA,kz){var ky=kz[0]-kA[0],kC=kz[1]-kA[1],kB=kz[2]-kA[2];return ky*ky+kC*kC+kB*kB};kv.sqrDist=kv.squaredDistance;kv.length=function(kz){var ky=kz[0],kB=kz[1],kA=kz[2];return Math.sqrt(ky*ky+kB*kB+kA*kA)};kv.len=kv.length;kv.squaredLength=function(kz){var ky=kz[0],kB=kz[1],kA=kz[2];return ky*ky+kB*kB+kA*kA};kv.sqrLen=kv.squaredLength;kv.negate=function(kz,ky){kz[0]=-ky[0];kz[1]=-ky[1];kz[2]=-ky[2];return kz};kv.normalize=function(kB,kA){var kz=kA[0],kD=kA[1],kC=kA[2];var ky=kz*kz+kD*kD+kC*kC;if(ky>0){ky=1/Math.sqrt(ky);kB[0]=kA[0]*ky;kB[1]=kA[1]*ky;kB[2]=kA[2]*ky}return kB};kv.dot=function(kz,ky){return kz[0]*ky[0]+kz[1]*ky[1]+kz[2]*ky[2]};kv.cross=function(kz,kE,kD){var ky=kE[0],kG=kE[1],kF=kE[2],kC=kD[0],kB=kD[1],kA=kD[2];kz[0]=kG*kA-kF*kB;kz[1]=kF*kC-ky*kA;kz[2]=ky*kB-kG*kC;return kz};kv.lerp=function(kA,kz,ky,kB){var kE=kz[0],kD=kz[1],kC=kz[2];kA[0]=kE+kB*(ky[0]-kE);kA[1]=kD+kB*(ky[1]-kD);kA[2]=kC+kB*(ky[2]-kC);return kA};kv.random=function(ky,kC){kC=kC||1;var kA=kr()*2*Math.PI;var kB=(kr()*2)-1;var kz=Math.sqrt(1-kB*kB)*kC;ky[0]=Math.cos(kA)*kz;ky[1]=Math.sin(kA)*kz;ky[2]=kB*kC;return ky};kv.transformMat4=function(kB,kA,kz){var ky=kA[0],kD=kA[1],kC=kA[2];kB[0]=kz[0]*ky+kz[4]*kD+kz[8]*kC+kz[12];kB[1]=kz[1]*ky+kz[5]*kD+kz[9]*kC+kz[13];kB[2]=kz[2]*ky+kz[6]*kD+kz[10]*kC+kz[14];return kB};kv.transformMat3=function(kB,kA,kz){var ky=kA[0],kD=kA[1],kC=kA[2];kB[0]=ky*kz[0]+kD*kz[3]+kC*kz[6];kB[1]=ky*kz[1]+kD*kz[4]+kC*kz[7];kB[2]=ky*kz[2]+kD*kz[5]+kC*kz[8];return kB};kv.transformQuat=function(kE,kK,ky){var kL=kK[0],kJ=kK[1],kI=kK[2],kG=ky[0],kF=ky[1],kD=ky[2],kH=ky[3],kB=kH*kL+kF*kI-kD*kJ,kA=kH*kJ+kD*kL-kG*kI,kz=kH*kI+kG*kJ-kF*kL,kC=-kG*kL-kF*kJ-kD*kI;kE[0]=kB*kH+kC*-kG+kA*-kD-kz*-kF;kE[1]=kA*kH+kC*-kF+kz*-kG-kB*-kD;kE[2]=kz*kH+kC*-kD+kB*-kF-kA*-kG;return kE};kv.rotateX=function(kA,kz,ky,kD){var kC=[],kB=[];kC[0]=kz[0]-ky[0];kC[1]=kz[1]-ky[1];kC[2]=kz[2]-ky[2];kB[0]=kC[0];kB[1]=kC[1]*Math.cos(kD)-kC[2]*Math.sin(kD);kB[2]=kC[1]*Math.sin(kD)+kC[2]*Math.cos(kD);kA[0]=kB[0]+ky[0];kA[1]=kB[1]+ky[1];kA[2]=kB[2]+ky[2];return kA};kv.rotateY=function(kA,kz,ky,kD){var kC=[],kB=[];kC[0]=kz[0]-ky[0];kC[1]=kz[1]-ky[1];kC[2]=kz[2]-ky[2];kB[0]=kC[2]*Math.sin(kD)+kC[0]*Math.cos(kD);kB[1]=kC[1];kB[2]=kC[2]*Math.cos(kD)-kC[0]*Math.sin(kD);kA[0]=kB[0]+ky[0];kA[1]=kB[1]+ky[1];kA[2]=kB[2]+ky[2];return kA};kv.rotateZ=function(kA,kz,ky,kD){var kC=[],kB=[];kC[0]=kz[0]-ky[0];kC[1]=kz[1]-ky[1];kC[2]=kz[2]-ky[2];kB[0]=kC[0]*Math.cos(kD)-kC[1]*Math.sin(kD);kB[1]=kC[0]*Math.sin(kD)+kC[1]*Math.cos(kD);kB[2]=kC[2];kA[0]=kB[0]+ky[0];kA[1]=kB[1]+ky[1];kA[2]=kB[2]+ky[2];return kA};kv.forEach=(function(){var ky=kv.create();return function(kB,kF,kG,kE,kD,kz){var kC,kA;if(!kF){kF=3}if(!kG){kG=0}if(kE){kA=Math.min((kE*kF)+kG,kB.length)}else{kA=kB.length}for(kC=kG;kC<kA;kC+=kF){ky[0]=kB[kC];ky[1]=kB[kC+1];ky[2]=kB[kC+2];kD(ky,ky,kz);kB[kC]=ky[0];kB[kC+1]=ky[1];kB[kC+2]=ky[2]}return kB}})();kv.str=function(ky){return"vec3("+ky[0]+", "+ky[1]+", "+ky[2]+")"};kt.vec3=kv;var ku={};ku.create=function(kz){kz=kz||i;var ky=new kz(4);ky[0]=0;ky[1]=0;ky[2]=0;ky[3]=0;return ky};ku.clone=function(ky,kA){kA=kA||i;var kz=new kA(4);kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];kz[3]=ky[3];return kz};ku.fromValues=function(ky,kD,kB,kz,kC){kC=kC||i;var kA=new kC(4);kA[0]=ky;kA[1]=kD;kA[2]=kB;kA[3]=kz;return kA};ku.copy=function(kz,ky){kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];kz[3]=ky[3];return kz};ku.set=function(kA,ky,kC,kB,kz){kA[0]=ky;kA[1]=kC;kA[2]=kB;kA[3]=kz;return kA};ku.add=function(kA,kz,ky){kA[0]=kz[0]+ky[0];kA[1]=kz[1]+ky[1];kA[2]=kz[2]+ky[2];kA[3]=kz[3]+ky[3];return kA};ku.subtract=function(kA,kz,ky){kA[0]=kz[0]-ky[0];kA[1]=kz[1]-ky[1];kA[2]=kz[2]-ky[2];kA[3]=kz[3]-ky[3];return kA};ku.sub=ku.subtract;ku.multiply=function(kA,kz,ky){kA[0]=kz[0]*ky[0];kA[1]=kz[1]*ky[1];kA[2]=kz[2]*ky[2];kA[3]=kz[3]*ky[3];return kA};ku.mul=ku.multiply;ku.divide=function(kA,kz,ky){kA[0]=kz[0]/ky[0];kA[1]=kz[1]/ky[1];kA[2]=kz[2]/ky[2];kA[3]=kz[3]/ky[3];return kA};ku.div=ku.divide;ku.min=function(kA,kz,ky){kA[0]=Math.min(kz[0],ky[0]);kA[1]=Math.min(kz[1],ky[1]);kA[2]=Math.min(kz[2],ky[2]);kA[3]=Math.min(kz[3],ky[3]);return kA};ku.max=function(kA,kz,ky){kA[0]=Math.max(kz[0],ky[0]);kA[1]=Math.max(kz[1],ky[1]);kA[2]=Math.max(kz[2],ky[2]);kA[3]=Math.max(kz[3],ky[3]);return kA};ku.scale=function(kA,kz,ky){kA[0]=kz[0]*ky;kA[1]=kz[1]*ky;kA[2]=kz[2]*ky;kA[3]=kz[3]*ky;return kA};ku.scaleAndAdd=function(kA,kz,ky,kB){kA[0]=kz[0]+(ky[0]*kB);kA[1]=kz[1]+(ky[1]*kB);kA[2]=kz[2]+(ky[2]*kB);kA[3]=kz[3]+(ky[3]*kB);return kA};ku.distance=function(kB,kz){var ky=kz[0]-kB[0],kD=kz[1]-kB[1],kC=kz[2]-kB[2],kA=kz[3]-kB[3];return Math.sqrt(ky*ky+kD*kD+kC*kC+kA*kA)};ku.dist=ku.distance;ku.squaredDistance=function(kB,kz){var ky=kz[0]-kB[0],kD=kz[1]-kB[1],kC=kz[2]-kB[2],kA=kz[3]-kB[3];return ky*ky+kD*kD+kC*kC+kA*kA};ku.sqrDist=ku.squaredDistance;ku.length=function(kA){var ky=kA[0],kC=kA[1],kB=kA[2],kz=kA[3];return Math.sqrt(ky*ky+kC*kC+kB*kB+kz*kz)};ku.len=ku.length;ku.squaredLength=function(kA){var ky=kA[0],kC=kA[1],kB=kA[2],kz=kA[3];return ky*ky+kC*kC+kB*kB+kz*kz};ku.sqrLen=ku.squaredLength;ku.negate=function(kz,ky){kz[0]=-ky[0];kz[1]=-ky[1];kz[2]=-ky[2];kz[3]=-ky[3];return kz};ku.normalize=function(kC,kB){var kz=kB[0],kE=kB[1],kD=kB[2],kA=kB[3];var ky=kz*kz+kE*kE+kD*kD+kA*kA;if(ky>0){ky=1/Math.sqrt(ky);kC[0]=kB[0]*ky;kC[1]=kB[1]*ky;kC[2]=kB[2]*ky;kC[3]=kB[3]*ky}return kC};ku.dot=function(kz,ky){return kz[0]*ky[0]+kz[1]*ky[1]+kz[2]*ky[2]+kz[3]*ky[3]};ku.lerp=function(kA,kz,ky,kB){var kE=kz[0],kD=kz[1],kC=kz[2],kF=kz[3];kA[0]=kE+kB*(ky[0]-kE);kA[1]=kD+kB*(ky[1]-kD);kA[2]=kC+kB*(ky[2]-kC);kA[3]=kF+kB*(ky[3]-kF);return kA};ku.random=function(ky,kz){kz=kz||1;ky[0]=kr();ky[1]=kr();ky[2]=kr();ky[3]=kr();ku.normalize(ky,ky);ku.scale(ky,ky,kz);return ky};ku.transformMat4=function(kC,kB,kz){var ky=kB[0],kE=kB[1],kD=kB[2],kA=kB[3];kC[0]=kz[0]*ky+kz[4]*kE+kz[8]*kD+kz[12]*kA;kC[1]=kz[1]*ky+kz[5]*kE+kz[9]*kD+kz[13]*kA;kC[2]=kz[2]*ky+kz[6]*kE+kz[10]*kD+kz[14]*kA;kC[3]=kz[3]*ky+kz[7]*kE+kz[11]*kD+kz[15]*kA;return kC};ku.transformQuat=function(kE,kK,ky){var kL=kK[0],kJ=kK[1],kI=kK[2],kG=ky[0],kF=ky[1],kD=ky[2],kH=ky[3],kB=kH*kL+kF*kI-kD*kJ,kA=kH*kJ+kD*kL-kG*kI,kz=kH*kI+kG*kJ-kF*kL,kC=-kG*kL-kF*kJ-kD*kI;kE[0]=kB*kH+kC*-kG+kA*-kD-kz*-kF;kE[1]=kA*kH+kC*-kF+kz*-kG-kB*-kD;kE[2]=kz*kH+kC*-kD+kB*-kF-kA*-kG;return kE};ku.forEach=(function(){var ky=ku.create();return function(kB,kF,kG,kE,kD,kz){var kC,kA;if(!kF){kF=4}if(!kG){kG=0}if(kE){kA=Math.min((kE*kF)+kG,kB.length)}else{kA=kB.length}for(kC=kG;kC<kA;kC+=kF){ky[0]=kB[kC];ky[1]=kB[kC+1];ky[2]=kB[kC+2];ky[3]=kB[kC+3];kD(ky,ky,kz);kB[kC]=ky[0];kB[kC+1]=ky[1];kB[kC+2]=ky[2];kB[kC+3]=ky[3]}return kB}})();ku.str=function(ky){return"vec4("+ky[0]+", "+ky[1]+", "+ky[2]+", "+ky[3]+")"};kt.vec4=ku;var kq={};kq.create=function(kz){kz=kz||i;var ky=new kz(4);ky[0]=1;ky[1]=0;ky[2]=0;ky[3]=1;return ky};kq.clone=function(ky,kA){kA=kA||i;var kz=new kA(4);kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];kz[3]=ky[3];return kz};kq.copy=function(kz,ky){kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];kz[3]=ky[3];return kz};kq.identity=function(ky){ky[0]=1;ky[1]=0;ky[2]=0;ky[3]=1;return ky};kq.transpose=function(kA,kz){if(kA===kz){var ky=kz[1];kA[1]=kz[2];kA[2]=ky}else{kA[0]=kz[0];kA[1]=kz[2];kA[2]=kz[1];kA[3]=kz[3]}return kA};kq.invert=function(kC,kA){var kB=kA[0],kz=kA[1],ky=kA[2],kE=kA[3],kD=kB*kE-ky*kz;if(!kD){return null}kD=1/kD;kC[0]=kE*kD;kC[1]=-kz*kD;kC[2]=-ky*kD;kC[3]=kB*kD;return kC};kq.adjoint=function(kA,ky){var kz=ky[0];kA[0]=ky[3];kA[1]=-ky[1];kA[2]=-ky[2];kA[3]=kz;return kA};kq.determinant=function(ky){return ky[0]*ky[3]-ky[2]*ky[1]};kq.multiply=function(kC,kH,kF){var kB=kH[0],kA=kH[1],kz=kH[2],ky=kH[3];var kI=kF[0],kG=kF[1],kE=kF[2],kD=kF[3];kC[0]=kB*kI+kz*kG;kC[1]=kA*kI+ky*kG;kC[2]=kB*kE+kz*kD;kC[3]=kA*kE+ky*kD;return kC};kq.mul=kq.multiply;kq.rotate=function(kC,kF,kE){var kB=kF[0],kA=kF[1],kz=kF[2],ky=kF[3],kG=Math.sin(kE),kD=Math.cos(kE);kC[0]=kB*kD+kz*kG;kC[1]=kA*kD+ky*kG;kC[2]=kB*-kG+kz*kD;kC[3]=kA*-kG+ky*kD;return kC};kq.scale=function(kC,kD,kF){var kB=kD[0],kA=kD[1],kz=kD[2],ky=kD[3],kG=kF[0],kE=kF[1];kC[0]=kB*kG;kC[1]=kA*kG;kC[2]=kz*kE;kC[3]=ky*kE;return kC};kq.str=function(ky){return"mat2("+ky[0]+", "+ky[1]+", "+ky[2]+", "+ky[3]+")"};kq.frob=function(ky){return(Math.sqrt(Math.pow(ky[0],2)+Math.pow(ky[1],2)+Math.pow(ky[2],2)+Math.pow(ky[3],2)))};kq.LDU=function(ky,kB,kA,kz){ky[2]=kz[2]/kz[0];kA[0]=kz[0];kA[1]=kz[1];kA[3]=kz[3]-ky[2]*kA[1];return[ky,kB,kA]};kt.mat2=kq;var e={};e.create=function(kz){kz=kz||i;var ky=new kz(16);ky[0]=1;ky[1]=0;ky[2]=0;ky[3]=0;ky[4]=0;ky[5]=1;ky[6]=0;ky[7]=0;ky[8]=0;ky[9]=0;ky[10]=1;ky[11]=0;ky[12]=0;ky[13]=0;ky[14]=0;ky[15]=1;return ky};e.clone=function(ky){var kz=new i(16);kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];kz[3]=ky[3];kz[4]=ky[4];kz[5]=ky[5];kz[6]=ky[6];kz[7]=ky[7];kz[8]=ky[8];kz[9]=ky[9];kz[10]=ky[10];kz[11]=ky[11];kz[12]=ky[12];kz[13]=ky[13];kz[14]=ky[14];kz[15]=ky[15];return kz};e.copy=function(kz,ky){kz[0]=ky[0];kz[1]=ky[1];kz[2]=ky[2];kz[3]=ky[3];kz[4]=ky[4];kz[5]=ky[5];kz[6]=ky[6];kz[7]=ky[7];kz[8]=ky[8];kz[9]=ky[9];kz[10]=ky[10];kz[11]=ky[11];kz[12]=ky[12];kz[13]=ky[13];kz[14]=ky[14];kz[15]=ky[15];return kz};e.identity=function(ky){ky[0]=1;ky[1]=0;ky[2]=0;ky[3]=0;ky[4]=0;ky[5]=1;ky[6]=0;ky[7]=0;ky[8]=0;ky[9]=0;ky[10]=1;ky[11]=0;ky[12]=0;ky[13]=0;ky[14]=0;ky[15]=1;return ky};e.transpose=function(kB,kA){if(kB===kA){var kF=kA[1],kD=kA[2],kC=kA[3],ky=kA[6],kE=kA[7],kz=kA[11];kB[1]=kA[4];kB[2]=kA[8];kB[3]=kA[12];kB[4]=kF;kB[6]=kA[9];kB[7]=kA[13];kB[8]=kD;kB[9]=ky;kB[11]=kA[14];kB[12]=kC;kB[13]=kE;kB[14]=kz}else{kB[0]=kA[0];kB[1]=kA[4];kB[2]=kA[8];kB[3]=kA[12];kB[4]=kA[1];kB[5]=kA[5];kB[6]=kA[9];kB[7]=kA[13];kB[8]=kA[2];kB[9]=kA[6];kB[10]=kA[10];kB[11]=kA[14];kB[12]=kA[3];kB[13]=kA[7];kB[14]=kA[11];kB[15]=kA[15]}return kB};e.invert=function(kR,kW){var k0=kW[0],kY=kW[1],kX=kW[2],kU=kW[3],kC=kW[4],kB=kW[5],kA=kW[6],kz=kW[7],kQ=kW[8],kP=kW[9],kO=kW[10],kN=kW[11],k2=kW[12],k1=kW[13],kZ=kW[14],kV=kW[15],kM=k0*kB-kY*kC,kL=k0*kA-kX*kC,kK=k0*kz-kU*kC,kJ=kY*kA-kX*kB,kI=kY*kz-kU*kB,kH=kX*kz-kU*kA,kG=kQ*k1-kP*k2,kF=kQ*kZ-kO*k2,kE=kQ*kV-kN*k2,kD=kP*kZ-kO*k1,kT=kP*kV-kN*k1,kS=kO*kV-kN*kZ,ky=kM*kS-kL*kT+kK*kD+kJ*kE-kI*kF+kH*kG;if(!ky){return null}ky=1/ky;kR[0]=(kB*kS-kA*kT+kz*kD)*ky;kR[1]=(kX*kT-kY*kS-kU*kD)*ky;kR[2]=(k1*kH-kZ*kI+kV*kJ)*ky;kR[3]=(kO*kI-kP*kH-kN*kJ)*ky;kR[4]=(kA*kE-kC*kS-kz*kF)*ky;kR[5]=(k0*kS-kX*kE+kU*kF)*ky;kR[6]=(kZ*kK-k2*kH-kV*kL)*ky;kR[7]=(kQ*kH-kO*kK+kN*kL)*ky;kR[8]=(kC*kT-kB*kE+kz*kG)*ky;kR[9]=(kY*kE-k0*kT-kU*kG)*ky;kR[10]=(k2*kI-k1*kK+kV*kM)*ky;kR[11]=(kP*kK-kQ*kI-kN*kM)*ky;kR[12]=(kB*kF-kC*kD-kA*kG)*ky;kR[13]=(k0*kD-kY*kF+kX*kG)*ky;kR[14]=(k1*kL-k2*kJ-kZ*kM)*ky;kR[15]=(kQ*kJ-kP*kL+kO*kM)*ky;return kR};e.adjoint=function(kG,kJ){var kN=kJ[0],kL=kJ[1],kK=kJ[2],kH=kJ[3],kB=kJ[4],kA=kJ[5],kz=kJ[6],ky=kJ[7],kF=kJ[8],kE=kJ[9],kD=kJ[10],kC=kJ[11],kP=kJ[12],kO=kJ[13],kM=kJ[14],kI=kJ[15];kG[0]=(kA*(kD*kI-kC*kM)-kE*(kz*kI-ky*kM)+kO*(kz*kC-ky*kD));kG[1]=-(kL*(kD*kI-kC*kM)-kE*(kK*kI-kH*kM)+kO*(kK*kC-kH*kD));kG[2]=(kL*(kz*kI-ky*kM)-kA*(kK*kI-kH*kM)+kO*(kK*ky-kH*kz));kG[3]=-(kL*(kz*kC-ky*kD)-kA*(kK*kC-kH*kD)+kE*(kK*ky-kH*kz));kG[4]=-(kB*(kD*kI-kC*kM)-kF*(kz*kI-ky*kM)+kP*(kz*kC-ky*kD));kG[5]=(kN*(kD*kI-kC*kM)-kF*(kK*kI-kH*kM)+kP*(kK*kC-kH*kD));kG[6]=-(kN*(kz*kI-ky*kM)-kB*(kK*kI-kH*kM)+kP*(kK*ky-kH*kz));kG[7]=(kN*(kz*kC-ky*kD)-kB*(kK*kC-kH*kD)+kF*(kK*ky-kH*kz));kG[8]=(kB*(kE*kI-kC*kO)-kF*(kA*kI-ky*kO)+kP*(kA*kC-ky*kE));kG[9]=-(kN*(kE*kI-kC*kO)-kF*(kL*kI-kH*kO)+kP*(kL*kC-kH*kE));kG[10]=(kN*(kA*kI-ky*kO)-kB*(kL*kI-kH*kO)+kP*(kL*ky-kH*kA));kG[11]=-(kN*(kA*kC-ky*kE)-kB*(kL*kC-kH*kE)+kF*(kL*ky-kH*kA));kG[12]=-(kB*(kE*kM-kD*kO)-kF*(kA*kM-kz*kO)+kP*(kA*kD-kz*kE));kG[13]=(kN*(kE*kM-kD*kO)-kF*(kL*kM-kK*kO)+kP*(kL*kD-kK*kE));kG[14]=-(kN*(kA*kM-kz*kO)-kB*(kL*kM-kK*kO)+kP*(kL*kz-kK*kA));kG[15]=(kN*(kA*kD-kz*kE)-kB*(kL*kD-kK*kE)+kF*(kL*kz-kK*kA));return kG};e.determinant=function(kT){var kY=kT[0],kW=kT[1],kU=kT[2],kS=kT[3],kB=kT[4],kA=kT[5],kz=kT[6],ky=kT[7],kP=kT[8],kO=kT[9],kN=kT[10],kM=kT[11],k0=kT[12],kZ=kT[13],kX=kT[14],kV=kT[15],kL=kY*kA-kW*kB,kK=kY*kz-kU*kB,kJ=kY*ky-kS*kB,kI=kW*kz-kU*kA,kH=kW*ky-kS*kA,kG=kU*ky-kS*kz,kF=kP*kZ-kO*k0,kE=kP*kX-kN*k0,kD=kP*kV-kM*k0,kC=kO*kX-kN*kZ,kR=kO*kV-kM*kZ,kQ=kN*kV-kM*kX;return kL*kQ-kK*kR+kJ*kC+kI*kD-kH*kE+kG*kF};e.multiply=function(kK,kO,kL){var kS=kO[0],kR=kO[1],kP=kO[2],kM=kO[3],kE=kO[4],kC=kO[5],kA=kO[6],ky=kO[7],kJ=kO[8],kI=kO[9],kH=kO[10],kG=kO[11],kU=kO[12],kT=kO[13],kQ=kO[14],kN=kO[15];var kF=kL[0],kD=kL[1],kB=kL[2],kz=kL[3];kK[0]=kF*kS+kD*kE+kB*kJ+kz*kU;kK[1]=kF*kR+kD*kC+kB*kI+kz*kT;kK[2]=kF*kP+kD*kA+kB*kH+kz*kQ;kK[3]=kF*kM+kD*ky+kB*kG+kz*kN;kF=kL[4];kD=kL[5];kB=kL[6];kz=kL[7];kK[4]=kF*kS+kD*kE+kB*kJ+kz*kU;kK[5]=kF*kR+kD*kC+kB*kI+kz*kT;kK[6]=kF*kP+kD*kA+kB*kH+kz*kQ;kK[7]=kF*kM+kD*ky+kB*kG+kz*kN;kF=kL[8];kD=kL[9];kB=kL[10];kz=kL[11];kK[8]=kF*kS+kD*kE+kB*kJ+kz*kU;kK[9]=kF*kR+kD*kC+kB*kI+kz*kT;kK[10]=kF*kP+kD*kA+kB*kH+kz*kQ;kK[11]=kF*kM+kD*ky+kB*kG+kz*kN;kF=kL[12];kD=kL[13];kB=kL[14];kz=kL[15];kK[12]=kF*kS+kD*kE+kB*kJ+kz*kU;kK[13]=kF*kR+kD*kC+kB*kI+kz*kT;kK[14]=kF*kP+kD*kA+kB*kH+kz*kQ;kK[15]=kF*kM+kD*ky+kB*kG+kz*kN;return kK};e.mul=e.multiply;e.translate=function(kK,kM,kF){var kE=kF[0],kD=kF[1],kC=kF[2],kP,kO,kN,kL,kB,kA,kz,ky,kJ,kI,kH,kG;if(kM===kK){kK[12]=kM[0]*kE+kM[4]*kD+kM[8]*kC+kM[12];kK[13]=kM[1]*kE+kM[5]*kD+kM[9]*kC+kM[13];kK[14]=kM[2]*kE+kM[6]*kD+kM[10]*kC+kM[14];kK[15]=kM[3]*kE+kM[7]*kD+kM[11]*kC+kM[15]}else{kP=kM[0];kO=kM[1];kN=kM[2];kL=kM[3];kB=kM[4];kA=kM[5];kz=kM[6];ky=kM[7];kJ=kM[8];kI=kM[9];kH=kM[10];kG=kM[11];kK[0]=kP;kK[1]=kO;kK[2]=kN;kK[3]=kL;kK[4]=kB;kK[5]=kA;kK[6]=kz;kK[7]=ky;kK[8]=kJ;kK[9]=kI;kK[10]=kH;kK[11]=kG;kK[12]=kP*kE+kB*kD+kJ*kC+kM[12];kK[13]=kO*kE+kA*kD+kI*kC+kM[13];kK[14]=kN*kE+kz*kD+kH*kC+kM[14];kK[15]=kL*kE+ky*kD+kG*kC+kM[15]}return kK};e.scale=function(kB,kz,kA){var ky=kA[0],kD=kA[1],kC=kA[2];kB[0]=kz[0]*ky;kB[1]=kz[1]*ky;kB[2]=kz[2]*ky;kB[3]=kz[3]*ky;kB[4]=kz[4]*kD;kB[5]=kz[5]*kD;kB[6]=kz[6]*kD;kB[7]=kz[7]*kD;kB[8]=kz[8]*kC;kB[9]=kz[9]*kC;kB[10]=kz[10]*kC;kB[11]=kz[11]*kC;kB[12]=kz[12];kB[13]=kz[13];kB[14]=kz[14];kB[15]=kz[15];return kB};e.rotate=function(kS,kZ,k1,ky){var kI=ky[0],kH=ky[1],kG=ky[2],kT=Math.sqrt(kI*kI+kH*kH+kG*kG),kN,kX,kM,k3,k2,k0,kY,kF,kE,kD,kC,kR,kQ,kP,kO,kL,kK,kJ,kW,kV,kU,kB,kA,kz;if(Math.abs(kT)<kx){return null}kT=1/kT;kI*=kT;kH*=kT;kG*=kT;kN=Math.sin(k1);kX=Math.cos(k1);kM=1-kX;k3=kZ[0];k2=kZ[1];k0=kZ[2];kY=kZ[3];kF=kZ[4];kE=kZ[5];kD=kZ[6];kC=kZ[7];kR=kZ[8];kQ=kZ[9];kP=kZ[10];kO=kZ[11];kL=kI*kI*kM+kX;kK=kH*kI*kM+kG*kN;kJ=kG*kI*kM-kH*kN;kW=kI*kH*kM-kG*kN;kV=kH*kH*kM+kX;kU=kG*kH*kM+kI*kN;kB=kI*kG*kM+kH*kN;kA=kH*kG*kM-kI*kN;kz=kG*kG*kM+kX;kS[0]=k3*kL+kF*kK+kR*kJ;kS[1]=k2*kL+kE*kK+kQ*kJ;kS[2]=k0*kL+kD*kK+kP*kJ;kS[3]=kY*kL+kC*kK+kO*kJ;kS[4]=k3*kW+kF*kV+kR*kU;kS[5]=k2*kW+kE*kV+kQ*kU;kS[6]=k0*kW+kD*kV+kP*kU;kS[7]=kY*kW+kC*kV+kO*kU;kS[8]=k3*kB+kF*kA+kR*kz;kS[9]=k2*kB+kE*kA+kQ*kz;kS[10]=k0*kB+kD*kA+kP*kz;kS[11]=kY*kB+kC*kA+kO*kz;if(kZ!==kS){kS[12]=kZ[12];kS[13]=kZ[13];kS[14]=kZ[14];kS[15]=kZ[15]}return kS};e.rotateX=function(ky,kF,kE){var kK=Math.sin(kE),kD=Math.cos(kE),kJ=kF[4],kI=kF[5],kH=kF[6],kG=kF[7],kC=kF[8],kB=kF[9],kA=kF[10],kz=kF[11];if(kF!==ky){ky[0]=kF[0];ky[1]=kF[1];ky[2]=kF[2];ky[3]=kF[3];ky[12]=kF[12];ky[13]=kF[13];ky[14]=kF[14];ky[15]=kF[15]}ky[4]=kJ*kD+kC*kK;ky[5]=kI*kD+kB*kK;ky[6]=kH*kD+kA*kK;ky[7]=kG*kD+kz*kK;ky[8]=kC*kD-kJ*kK;ky[9]=kB*kD-kI*kK;ky[10]=kA*kD-kH*kK;ky[11]=kz*kD-kG*kK;return ky};e.rotateY=function(kC,kJ,kI){var kK=Math.sin(kI),kH=Math.cos(kI),kB=kJ[0],kA=kJ[1],kz=kJ[2],ky=kJ[3],kG=kJ[8],kF=kJ[9],kE=kJ[10],kD=kJ[11];if(kJ!==kC){kC[4]=kJ[4];kC[5]=kJ[5];kC[6]=kJ[6];kC[7]=kJ[7];kC[12]=kJ[12];kC[13]=kJ[13];kC[14]=kJ[14];kC[15]=kJ[15]}kC[0]=kB*kH-kG*kK;kC[1]=kA*kH-kF*kK;kC[2]=kz*kH-kE*kK;kC[3]=ky*kH-kD*kK;kC[8]=kB*kK+kG*kH;kC[9]=kA*kK+kF*kH;kC[10]=kz*kK+kE*kH;kC[11]=ky*kK+kD*kH;return kC};e.rotateZ=function(kC,kF,kE){var kK=Math.sin(kE),kD=Math.cos(kE),kB=kF[0],kA=kF[1],kz=kF[2],ky=kF[3],kJ=kF[4],kI=kF[5],kH=kF[6],kG=kF[7];if(kF!==kC){kC[8]=kF[8];kC[9]=kF[9];kC[10]=kF[10];kC[11]=kF[11];kC[12]=kF[12];kC[13]=kF[13];kC[14]=kF[14];kC[15]=kF[15]}kC[0]=kB*kD+kJ*kK;kC[1]=kA*kD+kI*kK;kC[2]=kz*kD+kH*kK;kC[3]=ky*kD+kG*kK;kC[4]=kJ*kD-kB*kK;kC[5]=kI*kD-kA*kK;kC[6]=kH*kD-kz*kK;kC[7]=kG*kD-ky*kK;return kC};e.fromRotationTranslation=function(kL,kJ,kH){var kE=kJ[0],kD=kJ[1],kC=kJ[2],kF=kJ[3],kM=kE+kE,ky=kD+kD,kG=kC+kC,kB=kE*kM,kA=kE*ky,kz=kE*kG,kK=kD*ky,kI=kD*kG,kP=kC*kG,kQ=kF*kM,kO=kF*ky,kN=kF*kG;kL[0]=1-(kK+kP);kL[1]=kA+kN;kL[2]=kz-kO;kL[3]=0;kL[4]=kA-kN;kL[5]=1-(kB+kP);kL[6]=kI+kQ;kL[7]=0;kL[8]=kz+kO;kL[9]=kI-kQ;kL[10]=1-(kB+kK);kL[11]=0;kL[12]=kH[0];kL[13]=kH[1];kL[14]=kH[2];kL[15]=1;return kL};e.fromQuat=function(kI,kF){var kC=kF[0],kB=kF[1],kA=kF[2],kD=kF[3],kJ=kC+kC,ky=kB+kB,kE=kA+kA,kz=kC*kJ,kH=kB*kJ,kG=kB*ky,kP=kA*kJ,kO=kA*ky,kM=kA*kE,kN=kD*kJ,kL=kD*ky,kK=kD*kE;kI[0]=1-kG-kM;kI[1]=kH+kK;kI[2]=kP-kL;kI[3]=0;kI[4]=kH-kK;kI[5]=1-kz-kM;kI[6]=kO+kN;kI[7]=0;kI[8]=kP+kL;kI[9]=kO-kN;kI[10]=1-kz-kG;kI[11]=0;kI[12]=0;kI[13]=0;kI[14]=0;kI[15]=1;return kI};e.frustum=function(kC,kz,kH,ky,kG,kE,kD){var kF=1/(kH-kz),kB=1/(kG-ky),kA=1/(kE-kD);kC[0]=(kE*2)*kF;kC[1]=0;kC[2]=0;kC[3]=0;kC[4]=0;kC[5]=(kE*2)*kB;kC[6]=0;kC[7]=0;kC[8]=(kH+kz)*kF;kC[9]=(kG+ky)*kB;kC[10]=(kD+kE)*kA;kC[11]=-1;kC[12]=0;kC[13]=0;kC[14]=(kD*kE*2)*kA;kC[15]=0;return kC};e.perspective=function(kB,kA,kz,kC,ky){var kE=1/Math.tan(kA/2),kD=1/(kC-ky);kB[0]=kE/kz;kB[1]=0;kB[2]=0;kB[3]=0;kB[4]=0;kB[5]=kE;kB[6]=0;kB[7]=0;kB[8]=0;kB[9]=0;kB[10]=(ky+kC)*kD;kB[11]=-1;kB[12]=0;kB[13]=0;kB[14]=(2*ky*kC)*kD;kB[15]=0;return kB};e.ortho=function(kB,kz,kH,ky,kF,kE,kD){var kC=1/(kz-kH),kG=1/(ky-kF),kA=1/(kE-kD);kB[0]=-2*kC;kB[1]=0;kB[2]=0;kB[3]=0;kB[4]=0;kB[5]=-2*kG;kB[6]=0;kB[7]=0;kB[8]=0;kB[9]=0;kB[10]=2*kA;kB[11]=0;kB[12]=(kz+kH)*kC;kB[13]=(kF+ky)*kG;kB[14]=(kD+kE)*kA;kB[15]=1;return kB};e.lookAt=function(kM,kT,kU,kE){var kS,kR,kP,kA,kz,ky,kH,kG,kF,kN,kQ=kT[0],kO=kT[1],kL=kT[2],kD=kE[0],kC=kE[1],kB=kE[2],kK=kU[0],kJ=kU[1],kI=kU[2];if(Math.abs(kQ-kK)<kx&&Math.abs(kO-kJ)<kx&&Math.abs(kL-kI)<kx){return e.identity(kM)}kH=kQ-kK;kG=kO-kJ;kF=kL-kI;kN=1/Math.sqrt(kH*kH+kG*kG+kF*kF);kH*=kN;kG*=kN;kF*=kN;kS=kC*kF-kB*kG;kR=kB*kH-kD*kF;kP=kD*kG-kC*kH;kN=Math.sqrt(kS*kS+kR*kR+kP*kP);if(!kN){kS=0;kR=0;kP=0}else{kN=1/kN;kS*=kN;kR*=kN;kP*=kN}kA=kG*kP-kF*kR;kz=kF*kS-kH*kP;ky=kH*kR-kG*kS;kN=Math.sqrt(kA*kA+kz*kz+ky*ky);if(!kN){kA=0;kz=0;ky=0}else{kN=1/kN;kA*=kN;kz*=kN;ky*=kN}kM[0]=kS;kM[1]=kA;kM[2]=kH;kM[3]=0;kM[4]=kR;kM[5]=kz;kM[6]=kG;kM[7]=0;kM[8]=kP;kM[9]=ky;kM[10]=kF;kM[11]=0;kM[12]=-(kS*kQ+kR*kO+kP*kL);kM[13]=-(kA*kQ+kz*kO+ky*kL);kM[14]=-(kH*kQ+kG*kO+kF*kL);kM[15]=1;return kM};e.str=function(ky){return"mat4("+ky[0]+", "+ky[1]+", "+ky[2]+", "+ky[3]+", "+ky[4]+", "+ky[5]+", "+ky[6]+", "+ky[7]+", "+ky[8]+", "+ky[9]+", "+ky[10]+", "+ky[11]+", "+ky[12]+", "+ky[13]+", "+ky[14]+", "+ky[15]+")"};e.frob=function(ky){return(Math.sqrt(Math.pow(ky[0],2)+Math.pow(ky[1],2)+Math.pow(ky[2],2)+Math.pow(ky[3],2)+Math.pow(ky[4],2)+Math.pow(ky[5],2)+Math.pow(ky[6],2)+Math.pow(ky[6],2)+Math.pow(ky[7],2)+Math.pow(ky[8],2)+Math.pow(ky[9],2)+Math.pow(ky[10],2)+Math.pow(ky[11],2)+Math.pow(ky[12],2)+Math.pow(ky[13],2)+Math.pow(ky[14],2)+Math.pow(ky[15],2)))};kt.mat4=e})(window);function cj(){this.result={bkData:[],eleData:[[],[],[],[],[],[],[],[],[],[]],tileLabels:[]}}e6.extend(cj.prototype,{createLayer:function(T,i){var e=this.result.bkData;i=i||{};if(!e[T]){e[T]=[[],[],[]]}e[T].tileTypeName=i.tileTypeName||"na";e[T].dataType=i.dataType||2;e[T].png8=i.png8||false;e[T].pack=i.pack||false;e[T].clipTile=i.clipTile||false;e[T].boundary=i.boundary||false;if(i.ontology){e[T].ontology=i.ontology}},removeLayer:function(i){var e=this.result.bkData;e[i]=null},hasLayerBoundary:function(){var e=this.result.bkData;var T=false;for(var kq=0;kq<e.length;kq++){if(e[kq]&&e[kq].boundary){T=true;break}}return T},getResult:function(){return this.result},setData:function(ks,kr,kt){var e=this.result.bkData;var T=e[kr]?e[kr][kt]:null;if(!T){return}for(var kq=0;kq<T.length;kq++){if(T[kq].key&&T[kq].key===ks.key){T[kq]=ks;return}}T.push(ks)},setLabelData:function(T,i){var e=this.result.tileLabels;e[i||0]=T},getLabelData:function(i){var e=this.result.tileLabels;if(i===undefined){return e}return e[i]||[]},clearLabelData:function(i){var e=this.result.tileLabels;if(i===undefined){e=[];return}e[i]=[]},setOverlayData:function(T,e,i){if(!this.result.eleData[e]){return}if(e>=2&&e<=4){this.result.eleData[e][i||0]=T;return}else{if(e===0||e===5||e===6){T.sort(function(kr,kq){return kr.overlay.zIndex-kq.overlay.zIndex})}}this.result.eleData[e]=T},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(kq){var e=this.result.bkData;if(typeof kq==="number"){if(e[kq]){e[kq][0]=[];e[kq][1]=[];e[kq][2]=[]}return}for(var T=0;T<e.length;T++){if(!e[T]){continue}e[T][0]=[];e[T][1]=[];e[T][2]=[]}},sortThumbData:function(i){var e=this.result.bkData;var T=e[i];if(!T){return}if(T[0]&&T[0].length>0){T[0].sort(function(kr,kq){return kr.tileInfo.useZoom-kq.tileInfo.useZoom})}}});var gy=(function(){var kA=new Int8Array(4);var T=new Int32Array(kA.buffer,0,1);var kv=new Float32Array(kA.buffer,0,1);function kC(kJ){T[0]=kJ;return kv[0]}function i(kJ){kv[0]=kJ;return T[0]}function kw(kJ){var kL=(kJ[3]<<24|kJ[2]<<16|kJ[1]<<8|kJ[0]);var kK=kC(kL&4278190079);return kK}var kr=0;var ku=1;var ky=2;var kG=0;var kD=1;var kB=2;var ks=9;function kz(kJ,kK){var kL;if(kK%2===0){kL=[-kJ[1],kJ[0]]}else{kL=[kJ[1],-kJ[0]]}return kL}function e(kJ,kK,kL){var kM=kz(kJ,kK);var kN;if(kL===ku){return kM}else{if(kK===4||kK===5){kN=[kM[0]-kJ[0],kM[1]-kJ[1]]}else{kN=[kM[0]+kJ[0],kM[1]+kJ[1]]}if(kL===kr){vec2.normalize(kN,kN)}return kN}}function kF(kK,kJ){return Math.sqrt(Math.pow(kK[0]-kJ[0],2)+Math.pow(kK[1]-kJ[1],2))}function kq(kN,kM,kL,kJ){var kK=vec2.dot(kN,kM);if(kL===kB||kL===kD){if((kJ===0||kJ===1)&&kK>0){return true}else{if((kJ===2||kJ===3)&&kK<0){return true}}}if((kJ===0||kJ===1)&&kK<0){return true}else{if((kJ===2||kJ===3)&&kK>0){return true}}return false}function kx(kK,kP,kR){var kQ=kz(kK,kP);var kM;var kO=kK;var kN=kR;var kT=[];vec2.normalize(kT,[kO[0]+kN[0],kO[1]+kN[1]]);var kS=vec2.dot(kQ,[-kT[1],kT[0]]);if(Math.abs(kS)<0.1){kS=1}var kL=1/kS;kM=[-kT[1]*kL,kT[0]*kL];var kJ=vec2.dot(kK,kM);if(kJ<0){vec2.negate(kM,kM)}return{cos2:kJ,offset:kM}}function kI(kK,kP,kR,kJ){var kQ=kz(kK,kP);var kO;var kN;var kM;if(kP===0||kP===1){kO=kR;kN=kK}else{kO=kK;kN=kR}if(!kO||!kN){return kQ}var kT=[kO[0]+kN[0],kO[1]+kN[1]];if(kT[0]===0&&kT[1]===0){vec2.normalize(kT,kN)}else{vec2.normalize(kT,kT)}var kU=kq(kT,kQ,kJ,kP);if(kU){return kQ}var kS=vec2.dot(kQ,[-kT[1],kT[0]]);if(Math.abs(kS)<0.1){kS=1}var kL=1/kS;kM=[-kT[1]*kL,kT[0]*kL];return kM}function kH(kU,kV,kO,kN,kW,kT,kM,kP,kL,kS){var kR;var kK=0;var kJ=false;kR=kT.length/ks-1;kt(kV[0],kU[0],kO[0],kW,kN,4,kP,kL,undefined,kT,kS);kR++;kK++;kt(kV[0],kU[0],kO[0],kW,kN,5,kP,kL,undefined,kT,kS);kR++;kK++;for(var kQ=0;kQ<kU.length;kQ++){kt(kV[kQ],kU[kQ],kO[kQ],kW,kN,0,kP,kL,kU[kQ-1],kT,kS);kE(kM,++kR,++kK,kJ);kt(kV[kQ],kU[kQ],kO[kQ],kW,kN,1,kP,kL,kU[kQ-1],kT,kS);kE(kM,++kR,++kK,kJ);kt(kV[kQ+1],kU[kQ],kO[kQ+1],kW,kN,2,kP,kL,kU[kQ+1],kT,kS);kE(kM,++kR,++kK,kJ);kt(kV[kQ+1],kU[kQ],kO[kQ+1],kW,kN,3,kP,kL,kU[kQ+1],kT,kS);kE(kM,++kR,++kK,kJ);if(kN===kD&&kQ!==kU.length-1){kt(kV[kQ+1],kU[kQ],kO[kQ+1],kW,kN,8,kP,kL,kU[kQ+1],kT,kS);kE(kM,++kR,++kK,kJ);kJ=kJ?false:true}}kt(kV[kV.length-1],kU[kU.length-1],kO[kV.length-1],kW,kN,6,kP,kL,undefined,kT,kS);kE(kM,++kR,++kK,kJ);kt(kV[kV.length-1],kU[kU.length-1],kO[kV.length-1],kW,kN,7,kP,kL,undefined,kT,kS);kE(kM,++kR,++kK,kJ)}function kt(kW,kM,kQ,kX,kL,kR,kO,kK,kU,kT,kS){var kV=kR%2===0?1:-1;var kP;if(kR===4||kR===5||kR===6||kR===7){kP=e(kM,kR,kX)}else{if(kR===0||kR===1||kR===2||kR===3){kP=kI(kM,kR,kU,kL)}else{if(kR===8){var kN=kx(kM,kR,kU);kP=kN.offset;vec2.normalize(kP,kP);var kJ=kN.cos2;if(kJ<0){kV=-kV}}}}kT[kT.length]=kW[0]*10;kT[kT.length]=kW[1]*10;kT[kT.length]=kP[0]*kK*10;kT[kT.length]=kP[1]*kK*10;kT[kT.length]=kO;kT[kT.length]=kV;kT[kT.length]=0;kT[kT.length]=kS||0;kT[kT.length]=kQ}function kE(kN,kL,kJ,kM){var kK;if(kJ%2===0){if(kM){kN[kN.length]=kL-2;kN[kN.length]=kL-1;kN[kN.length]=kL}else{kN[kN.length]=kL-1;kN[kN.length]=kL-2;kN[kN.length]=kL}}else{if(kM){kN[kN.length]=kL-1;kN[kN.length]=kL-2;kN[kN.length]=kL}else{kN[kN.length]=kL-2;kN[kN.length]=kL-1;kN[kN.length]=kL}}}return{getVertexCount:function(kK,kJ){if(kJ===kD){return kK*5-2}else{return kK*4}},buildData:function(kV,kL,kW,kR,kJ,kO,kK,kS,kU){var kT=[];var kQ=kU?kU:0;var kN=[kQ*10];for(var kP=0;kP<kV.length;kP++){if(kP>0){kQ+=kF(kV[kP],kV[kP-1]);kN.push(kQ*10)}if(kP!==kV.length-1){var kM=[kV[kP+1][0]-kV[kP][0],kV[kP+1][1]-kV[kP][1]];var kX=[];if(kM[0]===0&&kM[1]===0){kX=[0,0]}else{vec2.normalize(kX,kM)}kT[kT.length]=[kX[0],kX[1]]}}return kH(kT,kV,kN,kL,kW,kR,kJ,kw(kO),kK,kS)},toTileSolidLineVertices:function(kN,kK){var kL=new Float32Array(kN.length/ks*5);var kJ=new Int16Array(kL.buffer);var kP=0;var kM=0;for(var kO=0;kO<kN.length;kO+=ks){kJ[kP]=~~kN[kO];kJ[kP+1]=~~kN[kO+1];kJ[kP+2]=~~kN[kO+2];kJ[kP+3]=~~kN[kO+3];kL[kM+2]=kN[kO+4];kJ[kP+6]=kN[kO+5];kJ[kP+7]=kK?kK:0;kJ[kP+8]=kN[kO+7];kJ[kP+9]=0;kP+=10;kM+=5}return kL}}})();var gQ=1;var hV=2;var fn={drawIndex:0,devicePixelRatio:go(),zoomState:1,curViewTilesInfo:null,iconSetImg:null,LAST_CALC_ZOOM:-1,LAST_LOAD_VECTOR_ZOOM_CHANGE:false,lastCollisionTestTime:0,remove:function(){this.tileCache.clear();this.removeLabel(this.drawIndex);if(this.tileLabels){this.tileLabels=[]}},removeLabel:function(i){if(this.dataType===2){this.map._featureMgr.clearData(i);this.map._featureMgr.clearLabelOverlayData(i);this.map._featureMgr.clearLabelData(i);var T=new fS("onspotsdataremove");T.index=i;this.map.dispatchEvent(T);if(this.ontology&&this.ontology instanceof eh){this.clearCache();return}var e=new fS("onlayer_update");e.name="na";this.map.fire(e)}},initDrawData:function(){this.drawIndex=this.zIndex;var e={tileTypeName:this.tileType.getName(),dataType:this.dataType,png8:this.png8,pack:this.pack,clipTile:this.clipTile,boundary:this.boundary};if(this.ontology){e.ontology=this.ontology}this.map._featureMgr.createLayer(this.drawIndex,e);this.dispatchEvent(new fS("oninitDrawData"))},destroyDrawData:function(){this.map._featureMgr.removeLayer(this.drawIndex);var i=new fS("onremoveLayerMask");i.hasLayerBoundary=this.map._featureMgr.hasLayerBoundary();this.map.dispatchEvent(i)},setZIndex:function(ku){ku=Math.abs(Math.floor(ku))||1;if(!ku||ku===this.zIndex){return}var kr=this.map._featureMgr.result.bkData;var kq=this.map.tileMgr.tileLayers;var kw=this.map._normalLayerMgr.layers;function kx(kC){var kA=null;var kB=[kq,kw];for(var ky=0;ky<kB.length;ky++){for(var kz=0;kz<kB[ky].length;kz++){if(kB[ky][kz].zIndex===kC){kA=kB[ky][kz];break}}if(kA){break}}return kA}var T=[];var kt=[];var kv=this.zIndex;var i=kx(ku);if(kr[ku]&&i){T.push(i);kt.push(kr[ku]);this.setTargetZIndex(ku);kr[ku]=kr[kv];kr[kv]=null}else{this.setTargetZIndex(ku);kr[ku]=kr[kv];kr[kv]=null;this.map.dispatchEvent(new fS("onupdate"));return}var ks=ku+1;while(ks){var e=kx(ks);if(kr[ks]&&e){T.push(e);kt.push(kr[ks]);T.shift().setTargetZIndex(ks);kr[ks]=kt.shift();ks+=1}else{T.shift().setTargetZIndex(ks);kr[ks]=kt.shift();ks=0}}this.map.dispatchEvent(new fS("onupdate"))},setZIndexTop:function(){var e=this.map._featureMgr.result.bkData;e[e.length]=e[this.zIndex];e[this.zIndex]=null;this.setTargetZIndex(e.length-1);this.map.dispatchEvent(new fS("onrefresh"))},setUpLevel:function(){var e=this._getAdjoinZIndex("up");if(this.zIndex!==e){this.setZIndex(e)}},setDownLevel:function(){var e=this._getAdjoinZIndex("down");if(this.zIndex!==e){this.setZIndex(e)}},getTileKey:function(e,kq){kq=kq||{};var i=typeof kq.useZoom==="number"?kq.useZoom:e.useZoom;var T=e.style||this.mapStyleId||"default";return this.mapType+"_"+T+"_"+e.col+"_"+e.row+"_"+e.zoom+"_"+i},getTileRenderDataKey:function(i){var T=i.col;var kq=i.zoom;var e=i.baseTileSize;T=e9.calcLoopParam(T,kq,e).col;return this.mapType+"_"+T+"_"+i.row+"_"+kq+"_"+i.useZoom},getTileUnits:function(e){var kq=this.map;var T=es[kq.getMapType()];var i=T.baseUnits*Math.pow(2,T.zoomLevelBase-e);return i},getTilesUrl:function(kr,kA,kB){var i=kr.x;var kC=kr.y;var kx=j2("ditu","normal");var kt=kx.ver;var ku=kx.udt;i=e9.calcLoopParam(i,kA,kB).col;var kz=es.B_NORMAL_MAP.vectorTileUrls;var ks=Math.abs(i+kC)%kz.length;var ky=kz[ks];if(window.offLineIPAddress){kz=[window.offLineIPAddress+"pvd/"];ky=kz[0]}var T="x="+i+"&y="+kC+"&z="+Math.floor(kA);var kw=this.devicePixelRatio>1?"&scaler=2":"";var kv="&textimg=1";if(this.map.config.textRenderType==="canvas"){kv="&textimg=0"}var kq=this.map.config.style;if(typeof kq==="string"&&kq!=="default"){T+="&styleId="+C.mapStyleNameIdPair[kq]}T+="&styles=pl"+kv+kw+"&v="+kt+"&udt="+ku+"&json=0";var e=ky+"?qt=vtile&param="+window.encodeURIComponent(e2(T));return e},getRasterTilesUrl:function(T,ks,kq){var kr=es[this.map.mapType];var i=this.map.config.style;var e=kr.tileUrls[Math.abs(ks+T)%kr.tileUrls.length]+"?qt=tile&x="+T+"&y="+ks+"&z="+kq+((i==="default"||typeof i!=="string")?"":("&styleId="+C.mapStyleNameIdPair[i]))+"&styles=pl&udt="+this.normalUdt+"&scaler="+this.scaler+"&p=1";e=e.replace(/-(\d+)/gi,"M$1");return e},getZoomState:function(){var T=this.map;var i=T.getZoom();var e=i-this.lastZoom;if(e>0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState},releaseOutViewTileData:function(e){var kr=this.map._workerMgr.releasePendingData(e);for(var kq=0,T=kr.length;kq<T;kq++){var ks=this.getTileKey(kr[kq]);this.tileCache.removeData(ks)}},loadLayerData:function(e,kq,i){this.hasZoomChange=i;this.curViewTilesInfo=e;if(this.ontology instanceof eh){this.loadTileData&&this.loadTileData(e,kq);return}this.mapStyleId=this.map.getMapStyleId();this.releaseOutViewTileData(e);var T=this.getZoomState();if(this.dataType===hV){if(kq){this.getVectorLayerDataFromCache(e,T)}else{this.loadVectorLayerData(e)}}else{this.loadRasterLayerData(e,kq)}},getVectorLayerDataFromCache:function(kv,kF){this.map.temp.isPermitSpotOver=false;this.tileLabels=[];var kH=this.map._displayOptions;if(this.baseLayer===true){var kz=this.map._customLabelMgr.virtualTiles.custom;if(kz&&kz instanceof Array){for(var kD=0;kD<kz.length;kD++){this.tileLabels.push(kz[kD].label)}}}this.thumbCache={};var kG=-1;for(var kD=0,kA=kv.length;kD<kA;kD++){var kE=kv[kD];var kr=kE.col;var ks=kE.row;var T=kE.zoom;var kB=this._getTileTexImgKey(kE);var kq=kE.useZoom;kG=T;var kt=this.getTileKey(kE);var kJ=this.tileCache.getData(kt);if(kJ&&kJ.status==="ready"){var kK=kJ;this.map._featureMgr.setData(kJ,this.drawIndex,2);if(kH.poi&&kJ.label){if(kJ.label.status==="ready"){kJ.label.tileInfo=kJ.tileInfo;this.tileLabels.push(kJ.label);if(kJ.label.textureSources&&kJ.label.textureSources[kq]&&this.map._webglMapScene){var kI=this.map._webglMapScene._painter;if(!kI._labelTextureAtlasOffset[kB]){kI._addToAsyncJob(kJ.label.textureSources[kq])}}}else{if(kJ.label.status!=="processing"){this.processLabelData(kJ)}}}}else{var kC={tileInfo:kE,dataType:hV,key:kt};this.map._featureMgr.setData(kC,this.drawIndex,2);if(this.useThumbData){this.setThumbData(kr,ks,T,kq,kF)}}}this.tileLabels.labelZoom=kG;this.updateLabels(kF);var kw=this.map.getZoom();var ku=Math.floor(kw);var ky=kw-ku;var kx=Math.floor(this.LAST_CALC_ZOOM);var e=this.LAST_CALC_ZOOM-kx;var kL=false;if(this.hasZoomChange){if(Math.abs(kw-this.LAST_CALC_ZOOM)>=0.5){kL=true}else{if(ky<0.5&&e>=0.5){kL=true}else{if(ky>=0.5&&e<0.5){kL=true}}}if(kL){this.cacheDataCollideLabels(0)}this.LAST_CALC_ZOOM=kw}else{if(this.tileLabels.length>0){this.cacheDataCollideLabels(e6.Browser.ie?50:30)}}},loadVectorLayerData:function(kw){this.map.temp.isPermitSpotOver=false;var kv=this;function ku(i,kx){var kz=kv.tileCache.getData(kx);if(!kz){return}if(!i||i.error){i.event&&bD.fetchDebug&&bD.fetchDebug.sendError({title:i.event.title,msg:i.event.msg,category:bD.fetchDebug.category.AJAX,level:bD.fetchDebug.levels.ERROR,url:i.event.title});var ky=new fS("ontileloaderror");i=i||{};ky.error=i.error||"";ky.message=i.message||"";kv.map.fire(ky);kz.status="init";kz.reloadTimer=setTimeout(function(){if(kz.retry<3){kz.retry++;kz.status="loading";kv.loadVectorTileData(i.tileInfo,ku)}else{kv.tileCache.removeData(kx);kv._checkTilesLoaded()}},4000);if(kv.map._featureMgr){kv.map._featureMgr.clearData(kv.drawIndex)}kv.getVectorLayerDataFromCache(kv.curViewTilesInfo,kv.getZoomState());return}if(kz.reloadTimer){clearTimeout(kz.reloadTimer);kz.reloadTimer=null}kv.callbackDataQueue.push([i,kx]);if(kv.processDataTimer){return}kv.processDataTimer=setTimeout(function(){while(kv.callbackDataQueue.length>0){var kB=kv.callbackDataQueue.shift();kv.vectorTileDataCbk(kB[0],kB[1]);kv._checkTilesLoaded()}if(kv.map._featureMgr){kv.map._featureMgr.clearData(kv.drawIndex)}kv.getVectorLayerDataFromCache(kv.curViewTilesInfo,kv.getZoomState());var kA=new fS("onrefresh");kA.source="webgllayer";kv.map.dispatchEvent(kA);kv.processDataTimer=null},200)}for(var kt=0,kr=kw.length;kt<kr;kt++){var T=kw[kt];var ks=this.getTileKey(T);var e=this.tileCache.getData(ks);if(!e){e={status:"init",tileInfo:T,dataType:hV,key:ks,retry:0}}if(e.status!=="ready"&&e.status!=="loading"){this.numLoading++;this.numTileLoading++;e.status="loading";this.tileCache.setData(ks,e);var kq=this.getProcessedLabelZoom(T);if(kq){T.processedLabelZooms=kq}this.loadVectorTileData(T,ku)}}},setThumbData:function(i,kr,kq,e,T){if(T===1){if(this._findParentZoomTile(i,kr,kq,e,8)===false){this._findChildZoomTile(i,kr,kq,e,3)}}else{if(T===-1){if(this._findChildZoomTile(i,kr,kq,e,3)===false){this._findParentZoomTile(i,kr,kq,e,8)}}}this.map._featureMgr.sortThumbData(this.drawIndex)},_findParentZoomTile:function(kt,kC,kB,kr,kw){var ks=es[this.getMapType()];var T=ks.minDataZoom;var e=kt;var kz=kC;var kx=kB;var ky=kr;for(var kv=1;kv<=kw;kv++){var kq=this.tileType.getParentTile(e,kz,kx,ky,T);if(kq===null){continue}var kA=this.getTileKey(kq);var ku=this.tileCache.getData(kA);if(ku&&ku.status==="ready"){if(this.thumbCache[kA]){continue}this.map._featureMgr.setData(ku,this.drawIndex,0);this.thumbCache[kA]=true;return true}e=kq.col;kz=kq.row;kx=kq.zoom;ky=kq.useZoom}return false},_findChildZoomTile:function(ku,kw,e,kr,kF){var kD=es[this.getMapType()];var kz=kD.maxDataZoom;var kt=ku;var kv=kw;var kx=e;var kq=kr;var ks=true;for(var kC=1;kC<=kF;kC++){var kA=false;var T=this.tileType.getChildTiles(kt,kv,kx,kq,kz,kC);if(!T){continue}for(var kB=0;kB<T.length;kB++){var ky=this.getTileKey(T[kB]);var kE=this.tileCache.getData(ky);if(kE&&kE.status==="ready"){if(!this.thumbCache[ky]){this.map._featureMgr.setData(kE,this.drawIndex,1);this.thumbCache[ky]=true}kA=true}else{ks=false}}if(kA){break}}return ks},loadVectorTileData:function(kD,kE){var kr=kD.col;var ks=kD.row;var e=kD.zoom;var kB=kD.baseTileSize;var kq=this.getTilesUrl(new fr(kr,ks),e,kB);var kt=this.map.getPrivateRegions();if(!this.processData&&this.map.getPrivateStatus()&&kt){var kz=kD.useZoom;var ky=this.tileType.getMercatorSize(kz);var kx=kr*ky;var kw=ks*ky;var kA=new cD(kx+ky/2,kw+ky/2);var kv=new ib(new cD(kx,kw),new cD(kx+ky,kw+ky));var ku=go()>=1.5?2:1;for(var kC=0;kC<kt.length;kC++){if(kt[kC] instanceof cS){if(kt[kC].crossPoint(kA,kv,kz)){var kF={x:kr,y:ks,z:e,mapZoom:kz,scalerRadio:ku,textimg:this.map.config.textRenderType==="canvas"?0:1};var T=kt[kC].tileUrlFunction(kq,kF);if(T&&T.url){kq=T.url;T.header&&(kD.header=T.header)}break}}}}if(!kq){return}var kH=this.getTileKey(kD);hs(this.map);if(!this.processData){if(!this.map||!this.map._workerMgr){return}this.map._workerMgr.loadTileData(kq,kD,kH,kE);return}var kE="cbk"+kH.replace(/-/g,"_");var kG=this;bD[kE]=function(i){var kI=(function(kJ){return function(){kJ.tileInfo=kD;var kP=kG.processData(kJ);if(!kP.road){return}var kM={tileInfo:kD,renderData:{base:[]},status:"ready",key:kH,mapType:kG.mapType};var kS=[];var kV=[];for(var kO=0;kO<kP.road.length;kO++){var kR=kP.road[kO];var kQ=-1;for(var kN=0;kN<kR.length;kN++){var kT=kR[kN];var kU=[];if(kS.length/7+kT[0].length/2>65536){kM.renderData.base.push({type:"line",data:[gy.toTileSolidLineVertices(kS,4000),new Uint16Array(kV)]});kS=[];kV=[]}for(var kL=0;kL<kT[0].length;kL+=2){kU[kU.length]=[kT[0][kL],kT[0][kL+1]]}var kK=kT[3];gy.buildData(kU,kT[1],kT[2],kS,kV,kK,kT[4],kO+20)}kM.renderData.base.push({type:"line",data:[gy.toTileSolidLineVertices(kS,4000),new Uint16Array(kV)]})}kG.tileCache.setData(kH,kM);if(kG.map._featureMgr){kG.map._featureMgr.clearData(kG.drawIndex)}kG.getVectorLayerDataFromCache(kG.curViewTilesInfo,kG.getZoomState());kG.map.dispatchEvent(new fS("onrefresh"))}})(i);kG.map.jobScheduler.addJob(kI);delete bD[kE]};kq+="&fn="+encodeURIComponent(fB+"."+kE);gX.load(kq)},vectorTileDataCbk:function(kq,kr){var kv=new fS("ontileloaded");kv.perfStat=kq.perfStat||[];var e=this.map;e.fire(kv);var i=kq.tileInfo;var T=i.col;var kA=i.row;var kz=i.zoom;var ky=i.baseTileSize;var kt=this.tileCache.getData(kr);if(!kt){return}if(!this.showLabel){kq.label=null}kt.renderData=kq;kt.tileInfo=i;var ks=e9.calcLoopParam(T,kz,ky);var kw=ks.geoOffsetX;kt.tileInfo.loopOffsetX=kw;kt.status="ready";kt.mapType=this.mapType;this.tileCache.setData(kr,kt);kt.label=kq.label;kq.label=null;if(kq.indoorData&&e._indoorMgr){e._indoorMgr.setData(kq.indoorData)}var ku="id_"+T+"_"+kA+"_"+kz;if(!this.curViewTilesInfo[ku]){e.fire(new fS("ontilenotinview"));return}var kx=e._displayOptions;if(kx.poi){this.processLabelData(kt)}if(kq.indoorData&&e._indoorMgr&&e._indoorMgr.currentUid){this._refreshIndoorData(e._indoorMgr.currentUid,e._indoorMgr.currentFloor)}},_refreshIndoorData:function(ky,kx){var kA=this.map._indoorMgr.getIndoorData(ky);if(this.map&&this.map.parking){this.map.parking.currentUid=ky;this.map.parking.currentFloor=kx}var kD=kA.tileKeys;var kB=Math.floor(this.map.getZoom());for(var kv=0;kv<kD.length;kv++){var ks=kD[kv];var ku=this.tileCache.getData(ks);if(!ku||!ku.renderData){continue}var kC=ku.renderData;if(!kC){continue}kC.indoorBase=[];kC.indoorBaseContour=[];kC.indoorBorder3D=[];kC.indoorArea3D=[];ku.label.indoorLabel=[];this.labelProcessor.clearCollisionCache(ku.label);for(var kw in kC.indoorData){if(kw==="tileInfo"){continue}var e=kC.indoorData[kw];var kr=e.defaultFloor;if(kw===ky){kr=kx;e.currentFloor=kx}if(e.floors[kr]){if(e.floors[kr].base){for(var kt=0;kt<e.floors[kr].base.length;kt++){kC.indoorBase.push(e.floors[kr].base[kt])}}if(e.floors[kr].contour){for(var kt=0;kt<e.floors[kr].contour.length;kt++){kC.indoorBaseContour.push(e.floors[kr].contour[kt])}}if(e.floors[kr].indoorBorder3D){kC.indoorBorder3D.push(e.floors[kr].indoorBorder3D)}if(e.floors[kr].area3D){kC.indoorArea3D.push(e.floors[kr].area3D)}if(e.floors[kr].pois){ku.label.indoorLabel=ku.label.indoorLabel.concat(e.floors[kr].pois)}}}this.updateAllIconsTextureCoords(ku);var kz=this;this.labelProcessor.loadIconImages(ku,function(i){kz.updateAllIconsTextureCoords(i)},"indoor");var kq=ks.split("_");var T=parseInt(kq[kq.length-1],10);if(T!==kB){continue}kz.map._featureMgr.setData(ku,this.drawIndex,2)}this.dataBackCollideLabels();this.map.dispatchEvent(new fS("onrefresh"))},_removeIndoorData:function(i){if(!i.indoorData){return}for(var e in i.indoorData){if(e==="tileInfo"){continue}this.map._indoorMgr.removeData(e,i.key)}},getProcessedLabelZoom:function(kq){var kr=kl.baseZoomInfo[kq.zoom];if(!kr){return false}var T=[];for(var ks=0;ks<kr.length;ks++){var kt=this.getTileKey(kq,{useZoom:kr[ks]});var e=this.tileCache.getData(kt);if(e&&e.status==="ready"&&e.label&&e.label.status==="ready"){T.push(kr[ks])}}if(T.length){return T}else{return false}},getSameZoomDataFromCache:function(T){var kq=kl.baseZoomInfo[T.zoom];for(var kr=0;kr<kq.length;kr++){var ks=this.getTileKey(T,{useZoom:kq[kr]});if(T.useZoom===kq[kr]){continue}var e=this.tileCache.getData(ks);if(e&&e.status==="ready"&&e.label&&e.label.status==="ready"){return e}}return false},hasSameLabelData:function(kq,T){for(var e=0;e<T.length;e++){if(T[e].key===kq){return true}}return false},getDataByFloorName:function(T,kq){for(var e=0;e<T.length;e++){if(T[e].floorName===kq){return T[e]}}return null},mergeIndoorLabelData:function(kv,e){for(var kt in kv){if(kt==="tileInfo"){continue}if(e[kt]){var T=kv[kt].floors;var kw=e[kt].floors;for(var kr=0;kr<T.length;kr++){var kq=T[kr];var ku=kq.floorName;var ks=this.getDataByFloorName(kw,ku);if(ks){if(ks.pois){ks.pois=ks.pois.concat(kq.pois);kq.pois=ks.pois}else{ks.pois=kq.pois}}}}}},mergeSameZoomLabelData:function(kt){var kr=kt.label;if(!kr){return}var e=kt.tileInfo;var ks=this.getSameZoomDataFromCache(e);if(!ks){return}var kq=ks.label;if(!kq){return}for(var T=0;T<kr.fixedLabel.length;T++){if(!this.hasSameLabelData(kr.fixedLabel[T].key,kq.fixedLabel)){kq.hasNewData=true;kq.fixedLabel.push(kr.fixedLabel[T])}}for(var T=0;T<kr.lineLabel.length;T++){if(!this.hasSameLabelData(kr.lineLabel[T].key,kq.lineLabel)){kq.hasNewData=true;kq.lineLabel.push(kr.lineLabel[T])}}for(var T=0;T<kr.indoorLabel.length;T++){if(!this.hasSameLabelData(kr.indoorLabel[T].key,kq.indoorLabel)){kq.hasNewData=true;kq.indoorLabel.push(kr.indoorLabel[T])}}kt.label=kq;if(ks.renderData.indoorData&&kt.renderData.indoorData){this.mergeIndoorLabelData(kt.renderData.indoorData,ks.renderData.indoorData)}},processLabelData:function(ks){if(!ks.label){return}if(ks.label.status==="processing"){return}ks.label.status="processing";var kq=this;kq.updateAllIconsTextureCoords(ks);this.labelProcessor.loadIconImages(ks,function(kt){kq.updateAllIconsTextureCoords(kt)});if(this.map.config.textRenderType==="canvas"){var e=this.labelProcessor.drawLabelsOnCanvas(ks,function(kv,kx){var ku=ks.tileInfo;var kw=kq.map.config.mapStyleId;if(!bD["customStyleInfo_"+kw]){kq.mergeSameZoomLabelData(ks)}if(kv){if(!ks.label.textureHeights){ks.label.textureHeights=[]}ks.label.textureHeights[ku.useZoom]=kv.height}if(kx){if(!ks.label.indoorTextureHeights){ks.label.indoorTextureHeights=[]}ks.label.indoorTextureHeights[ku.useZoom]=kx.height}var kt=kq._getTileTexImgKey(ku);kq._doWorkAfterLabelImageLoad(ks,kv,kx,kt)});return}var T=ks.label.textImageBitmap||ks.label.textImgStr;var kr=ks.label.indoorTextImageBitmap||ks.label.indoorTextImgStr;this.labelProcessor.loadImgByStr(T,kr,function i(ky,kw){var kv=ks.label.textureHeight;var kz=ks.label.indoorTextureHeight;ks.label.textureHeight=undefined;ks.label.indoorTextureHeight=undefined;var ku=ks.tileInfo;kq.mergeSameZoomLabelData(ks);var kx=ks.label;kx.textImgStr="";kx.indoorTextImgStr&&(kx.indoorTextImgStr="");if(!kx.textureHeights){kx.textureHeights=[]}kx.textureHeights[ku.useZoom]=kv;if(!kx.indoorTextureHeights){kx.indoorTextureHeights=[]}kx.indoorTextureHeights[ku.useZoom]=kz;var kt=kq._getTileTexImgKey(ku);kq._doWorkAfterLabelImageLoad(ks,ky,kw,kt)})},_getTileTexImgKey:function(i){var T=i.style||this.mapStyleId||"default";var e=T+"_"+i.col+"_"+i.row+"_"+i.zoom;if(this.map.config.textRenderType==="canvas"){e+="_"+i.useZoom}return e},_doWorkAfterLabelImageLoad:function(ku,ks,kq,i){var kt=this;var kr=ku.label;kr.tileInfo=ku.tileInfo;kr.status="ready";if(ks||kq){var e=kr.tileInfo;if(ks){ks.id=i;if(!kr.textureSources){kr.textureSources=[]}kr.textureSources[e.useZoom]=ks}if(kq){kq.id=i+"_indoor";if(!kr.indoorTextureSources){kr.indoorTextureSources=[]}kr.indoorTextureSources[e.useZoom]=kq}if(kt.map._webglMapScene){var T=kt.map._webglMapScene._painter;if(ks){T._addToAsyncJob(kr.textureSources[e.useZoom])}}}if(ku.custom!==true){kt.tileLabels.push(kr)}else{kt.updateAllIconsTextureCoords(ku);this.labelProcessor.loadIconImages(ku,function(kv){kt.updateAllIconsTextureCoords(ku)},true)}if(kt.collisionTimer){return}kt.collisionTimer=setTimeout(function(){kt.dataBackCollideLabels();kt.collisionTimer=null},300)},_updateIconTextureCoords:function(ku,T){if(!ku){return}var kt=this.map;for(var kq=0;kq<ku.length;kq++){var ks=ku[kq];if(!ks.iconPos){continue}if(kt._webglMapScene){var e=kt._webglMapScene._painter;var kr=T+"_"+ks.iconPos.iconType;ks.iconPos.texcoord=e._iconTextureAtlasCoords[kr]||null}}},updateAllIconsTextureCoords:function(kr){if(this.map.viewAnimationTime){return}if(kr){if(kr.label){var i=kr.tileInfo.style;this._updateIconTextureCoords(kr.label.fixedLabel,i);this._updateIconTextureCoords(kr.label.indoorLabel,i)}}else{var kq=this.tileCache.getAllData();for(var T in kq){var e=kq[T].data;if(e.status==="ready"&&e.label){var i=e.tileInfo.style;this._updateIconTextureCoords(e.label.fixedLabel,i);this._updateIconTextureCoords(e.label.indoorLabel,i)}}}this.updateLabels();this.map.dispatchEvent(new fS("onrefresh"))},cacheDataCollideLabels:function(T){var kr=this;var i=this.map._featureMgr;function kq(){if(kr&&!kr.map.tileMgr&&!kr.map.tileMgr.isExitTileLayer(kr)){return}kr.cacheLabelTimer=null;var ks;var kt=kr.map.getTilt();var kv=kr.map.getHeading()%360;if(kr.tileLabels.length===0||(kr.tileLabels.length===1&&kr.tileLabels[0].tileInfo.zoom===0)){ks=i.getLabelData(kr.drawIndex);if(ks.length>0){ks=kr.labelProcessor.collisionTest(ks,-1)}}else{if(kt||kv){if(this._collisionTimer){if(!kt){clearTimeout(this._collisionTimer)}else{if(Date.now()-kr.lastCollisionTestTime>500){kr.lastCollisionTestTime=Date.now()}else{clearTimeout(this._collisionTimer)}}}this._collisionTimer=setTimeout(function(){if(kr&&!kr.map.tileMgr&&!kr.map.tileMgr.isExitTileLayer(kr)){kr._collisionTimer=null;return}ks=kr.labelProcessor.collisionTest(kr.tileLabels);if(ks){if(kr._isInnerLayer&&kr.map.stencil&&kr.map.stencil.isPoiMask){var kw=kr.isPoiInPolygon(ks);i.setLabelData(kw,kr.drawIndex)}else{i.setLabelData(ks,kr.drawIndex)}}kr.updateLabels();kr.map.dispatchEvent(new fS("onrefresh"));kr._collisionTimer=null},60);return}else{ks=kr.labelProcessor.getCachedLabels(kr.tileLabels)}}if(ks){if(kr._isInnerLayer&&kr.map.stencil&&kr.map.stencil.isPoiMask){var ku=kr.isPoiInPolygon(ks);i.setLabelData(ku,kr.drawIndex)}else{i.setLabelData(ks,kr.drawIndex)}}kr.updateLabels();kr.map.dispatchEvent(new fS("onrefresh"))}if(!T){clearTimeout(kr.cacheLabelTimer);kq()}else{if(kr.cacheLabelTimer){return}kr.cacheLabelTimer=setTimeout(function e(){kq()},T)}},isPoiInPolygon:function(T){var kJ=this;var kz=kJ.map.stencil;var kr=kJ.map._featureMgr.result.eleData[9];var kq=[];for(var kE=0;kE<kr.length;kE++){var kA=kr[kE].overlay.points;kq=kq.concat(kA)}for(var kH=0;kH<T.length;kH++){var kt=[];var ks=[];for(var kF=0;kF<T[kH].fixedLabel.length;kF++){var ky=T[kH].fixedLabel[kF];var kC=ky.pt;if(ky.pt&&au(kC,kq)){kt.push(ky)}else{ks.push(ky)}}if(kz.showRegion==="inside"){T[kH].fixedLabel=kt}else{if(kz.showRegion==="outside"){T[kH].fixedLabel=ks}}var kD=[];var kv=[];for(var kE=0;kE<T[kH].lineLabel.length;kE++){var kG=T[kH].lineLabel[kE];var e=kG.pt;if(e&&au(e,kq)){kD.push(kG)}else{kv.push(kG)}}if(kz.showRegion==="inside"){T[kH].lineLabel=kD}else{if(kz.showRegion==="outside"){T[kH].lineLabel=kv}}var kB=[];var kx=[];for(var kw=0;kw<T[kH].indoorLabel.length;kw++){var kI=T[kH].indoorLabel[kw];var ku=kI.pt;if(ku&&au(ku,kq)){kB.push(kI)}else{kx.push(kI)}}if(kz.showRegion==="inside"){T[kH].indoorLabel=kB}else{if(kz.showRegion==="outside"){T[kH].indoorLabel=kx}}}return T},dataBackCollideLabels:function(){var T=this;if(T&&!T.map.tileMgr&&!T.map.tileMgr.isExitTileLayer(T)){return}if(!T.tileLabels||(T.tileLabels&&T.tileLabels.length===0)){return}var e;T.labelProcessor.calcLabelsCollision(T.tileLabels);e=T.labelProcessor.getCachedLabels(T.tileLabels);if(e){if(T._isInnerLayer&&T.map.stencil&&T.map.stencil.isPoiMask){var i=T.isPoiInPolygon(e);T.map._featureMgr.setLabelData(i,T.drawIndex)}else{T.map._featureMgr.setLabelData(e,T.drawIndex)}}T.updateLabels();T.map.dispatchEvent(new fS("onupdate"));if(b2()){this.labelProcessor._refreshSpotData()}},updateLabels:function(kr){var ks=this.map;if(!ks._featureMgr){return}var i=ks._featureMgr;var T=i.getLabelData(this.drawIndex);if(T.length>0){var kq=ks.getZoom();if(T.labelZoom-kq<3){this.labelProcessor.updateLabels(T);var e=this.labelProcessor.fixDataFormat(T);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)}ks.temp.isPermitSpotOver=false;this.labelProcessor.curSpotAdded=false}},loadRasterLayerData:function(kv,kq){this.thumbCache={};var kw=this.getZoomState();if(kq){for(var kt=0,kr=kv.length;kt<kr;kt++){var T=kv[kt];var ks=this.getTileKey(T);var e=this.tileCache.getData(ks);if(e&&e.status==="ready"){if(T.tileTypeName==="xyz"){e.tileInfo=T}this.map._featureMgr.setData(e,this.drawIndex,2)}else{if(this.useThumbData){this.setThumbData(T.col,T.row,T.zoom,T.useZoom,kw)}}}return}for(var kt=0,kr=kv.length;kt<kr;kt++){var T=kv[kt];var ks=this.getTileKey(T);var e=this.tileCache.getData(ks);if(!e){this.numTileLoading++;this.tileCache.setData(ks,{});var ku=this;this.loadRasterTileData(T,function(i,kx){ku._checkLayerTilesLoaded();ku.rasterTileDataCbk(i,kx)})}}},loadRasterTileData:function(i,e){var T=new Image();var kr=i.col;var ku=i.row;var ks=i.zoom;var kq=this.getTilesUrl(new fr(kr,ku),ks,i);if(!kq){return}var kt=this.getTileKey(i);if(i.combine){T=kq;T.tileInfo=i;if(T){e&&e(T,kt)}else{e&&e(null,kt)}}else{T=this.loadTileImage(kq,kt,e)}T.tileInfo=i},loadTileImage:function(ku,kt,e){var T=new Image();T.crossOrigin="anonymous";var kq;var i=this;function kr(){if(i.retry){kq&&clearInterval(kq);kq=null}}if(this.retry){var ks=1;kq=setInterval(function(){if(ks>3){kr();return}T.src=ku;ks++},this.retryTime)}T.onload=function(){kr();e&&e(this,kt)};T.onerror=function(){kr();bD.fetchDebug&&bD.fetchDebug.sendError({title:ku,msg:ku,category:bD.fetchDebug.category.RESOURCE,level:bD.fetchDebug.levels.ERROR,url:ku});e&&e(null,kt)};T.src=ku;return T},rasterTileDataCbk:function(ks,kq){if(!ks||typeof ks==="string"){this.tileCache.removeData(kq);return}var i=ks.tileInfo;var T=i.col;var ky=i.row;var kx=i.zoom;var e=this.tileCache.getData(kq);if(!e){return}var kt="id_"+T+"_"+ky+"_"+kx;var kw=this;e.dataType=gQ;e.tileInfo=i;if(i.tileTypeName==="xyz"){var kv=i.tileSize;e.textureSource=ks;e.renderData={vertexAll:[0,0,0,0,0,kv,0,0,1,0,kv,kv,0,1,1,0,0,0,0,0,kv,kv,0,1,1,0,kv,0,0,1]};kw.setRasterTileData(kq,e,kt)}else{e.textureSource=ks;var kr=e9.calcLoopParam(T,kx);var ku=kr.geoOffsetX;ks.tileInfo.loopOffsetX=ku;e.renderData={vertexAll:[0,0,0,0,0,256,0,0,1,0,256,256,0,1,1,0,0,0,0,0,256,256,0,1,1,0,256,0,0,1]};this.setRasterTileData(kq,e,kt)}},setRasterTileData:function(kr,e,kq){e.status="ready";this.tileCache.setData(kr,e);var T=false;if(this.curViewTilesInfo[kq]){e.dataType=gQ;e.png8=this.png8||false;this.map._featureMgr.setData(e,this.drawIndex,2);T=true}if(T){var i=new fS("onrefresh");i.source="webgllayer";this.map.dispatchEvent(i)}},_checkLayerTilesLoaded:function(){this.numTileLoading--;if(this.firstTileLoad===false){this.dispatchEvent(new fS("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 fS("ontilesloadend"));e.firstTileLoad=false}e._checkTileLoadedTimer=null},60)}},_checkTilesLoaded:function(){this._checkLayerTilesLoaded();this.numLoading--;if(this.map.firstTileLoad===false){this.map.dispatchEvent(new fS("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 fS("ontilesloaded"));e.map.firstTileLoad=false}e._checkLoadedTimer=null},60)}},isClickableLabel:function(e){if(e.isDel){return false}if(e.zoom>9&&!e.guid){return false}if(e.zoom<=9&&!e.name&&!e.guid){return false}return true}};var aU=5;var jj=4;var gJ=3;var N=2;var ez=1;var hG=0;function ax(e){this._ratio=go();this._iconCache={};this._map=e;this._drawingCanvasPool=[];this._drawingCanvasHeight=4096;this._bufferSpan=[5,5]}e6.extend(ax.prototype,{_loadIcons:function(T,kw,ks){var kq=0;var kt=this;var kr=this._map.config.style;for(var ku in T){kq++;var kv=new Image();kv.id=ku;kv.crossOrigin="anonymous";kv.onload=function(){kt._iconCache[this.id].loaded=true;kq--;if(kq===0){kw()}this.onload=null};kv.onerror=function(){kt._iconCache[this.id]=null;kq--;if(kq===0){kw()}this.onerror=null};if(!ks){var e=C.getIconSetPath(kr)+ku+".png";var i=bE();if(i&&i.udt){e+="?udt="+i.udt}}else{var e=ku}kv.src=e;this._iconCache[ku]={loaded:false,image:kv}}},_getEmptyDrawingCanvas:function(){for(var T=0;T<this._drawingCanvasPool.length;T++){if(this._drawingCanvasPool[T]._free===true){this._drawingCanvasPool[T]._free=false;return this._drawingCanvasPool[T]}}var e=this._createNewDrawingCanvas();this._drawingCanvasPool.push(e);e._free=false;return e},_createNewDrawingCanvas:function(){var e=b3("canvas");e.width=512;e.height=this._drawingCanvasHeight;e._free=true;e._id=bD.getGUID();var i=e.getContext("2d",{colorSpace:"display-p3"});i.textBaseline="bottom";i.lineJoin="round";return e},drawLabelsOnCanvas:function(kI,kq){var ky=kI.label.fixedLabel.slice(0);var kE=kI.label.lineLabel.slice(0);var T=kI.label.indoorLabel.slice(0);if(ky.length===0&&kE.length===0&&T.length===0){kq();return}var kt=function(kN,i){return kN.styleId-i.styleId};ky.sort(kt);kE.sort(kt);T.sort(kt);var kH={};var e=this._getEmptyDrawingCanvas();var kD=e.getContext("2d",{colorSpace:"display-p3"});kD.clearRect(0,0,e.width,e.height);var kL=0;var kz=null;var ks=0;if(ky.length>0){while(ks<ky.length&&!ky[ks].styleText[0]){ks++}if(ky[ks]&&ky[ks].styleText[0]){kz=ky[ks].styleText[0].fontSize+ky[ks].styleText[0].haloSize*2}}if(kz===null&&T.length>0){ks=0;while(ks<T.length&&!T[ks].styleText[0]){ks++}if(T[ks]&&T[ks].styleText[0]){kz=T[ks].styleText[0].fontSize+T[ks].styleText[0].haloSize*2}}if(kz===null&&kE.length>0){ks=0;while(ks<kE.length&&!kE[ks].styleText[0]){ks++}if(kE[ks]&&kE[ks].styleText[0]){kz=kE[ks].styleText[0].fontSize+kE[ks].styleText[0].haloSize*2}}if(kz===null||isNaN(kz)){kq();return}var kv=0;var ku=kz;ku+=this._bufferSpan[1];var kB={};var kM=0;var kC=[];for(var kG=0;kG<ky.length;kG++){var kx=ky[kG];var kA=kx.name;var kF=kx.styleText;if(!kA||kF.length===0){continue}var kr=kx.icon;if(kx.textOnIcon&&(!this._iconCache[kr]||this._iconCache[kr].loaded===false)){kC.push(kx);kM++;if(!kB[kr]){kB[kr]=true}continue}var kJ=this._drawEachText(kD,kx,kL,kv,ku,kz,kH);if(!kJ){continue}kv=kJ.curX;ku=kJ.curY;kz=kJ.curLineHeight;kL=kJ.styleId}var kJ=this._drawEachTypeOfLabels(kD,T,kL,kv,ku,kz,kH);kL=kJ.curStyleId;kv=kJ.curX;ku=kJ.curY;kz=kJ.curLineHeight;var kJ=this._drawEachTypeOfLabels(kD,kE,kL,kv,ku,kz,kH);kL=kJ.curStyleId;kv=kJ.curX;ku=kJ.curY;kz=kJ.curLineHeight;if(kM>0){var kK=this;this._loadIcons(kB,function(){kJ=kK._drawEachTypeOfLabels(kD,kC,kL,kv,ku,kz,kH);kL=kJ.curStyleId;kv=kJ.curX;ku=kJ.curY;kz=kJ.curLineHeight;var i=kK._generateEachLabelCanvas(e,ku,ky,kE,T,kI);kq(i[0],i[1])});return}var kw=this._generateEachLabelCanvas(e,ku,ky,kE,T,kI);kq(kw[0],kw[1])},drawCustomLabelsOnCanvas:function(kv,ku,T){if(kv.length===0){ku();return}var ks={};var kr=false;for(var kq=0;kq<kv.length;kq++){var kt=null;if(kv[kq].textOnIcon&&kv[kq].icon){kt=kv[kq].icon}if(kt&&!ks[kt]&&(!this._iconCache[kt]||this._iconCache[kt].loaded===false)){ks[kt]=true;kr=true}}var e=this;if(kr){this._loadIcons(ks,function(){e._drawCustomLabel(kv,ku,T)},true)}else{e._drawCustomLabel(kv,ku,T)}},_drawCustomLabel:function(kD,kr,T){var kt;var ks;var ku;var kC;var kF;var e;var ky;var kq=0;var kB=kD.length;var kw=T?[]:null;var kx=this;for(var kz=0;kz<kD.length;kz++){if(!kD[kz].name){continue}var kE=kA(kD[kz]);if(!kE){continue}if(kE.overHeight){if(T){kB=(kz-kq);kw.push(kv(kq,kB));ky=null;kq=kz;kB=kD.length;kz=kz-1}else{break}}kt=kE.curX+this._bufferSpan[0];ks=kE.curY;ku=kE.curLineHeight;kF=kE.styleId}if(!ky){kG({style:{}})}if(T){kB=kB-kq;kw.push(kv(kq,kB))}else{kw=kv(kq,kB)}ky=null;kr(kw);function kG(i){kt=0+kx._bufferSpan[0];ks=((i.style.fontSize||0)+(i.style.haloSize||0)*2)+kx._bufferSpan[1]||0;ku=ks-kx._bufferSpan[1];kC={};kF=-1;e=kx._getEmptyDrawingCanvas();ky=e.getContext("2d",{colorSpace:"display-p3"});ky.clearRect(0,0,e.width,e.height)}function kA(i){if(!ky){kG(i)}if(T){i.cachedIsDel={}}var kH=kx._drawEachText(ky,i,kF,kt,ks,ku,kC);return kH}function kv(kL,kK){var kI=ks;var kH=kx._copyToNewCanvas(e,kI+kx._bufferSpan[0]);for(var kJ=kL;kJ<kD.length&&kJ<kL+kK;kJ++){if(!kD[kJ].name&&kD[kJ].style.iconSize){kx._addFixedLabelBounds(kD[kJ]);continue}if(!kD[kJ].textSize){continue}kx._updateFixedLabelCoords(kD[kJ],kI+kx._bufferSpan[0]);kx._addFixedLabelBounds(kD[kJ])}kH.range=[kL,kK];return kH}},_drawEachTypeOfLabels:function(kz,kt,kx,kq,T,kr,kv){for(var ks=0;ks<kt.length;ks++){var ku=kt[ks];var ky=ku.name;var e=ku.styleText;if(!ky||e.length===0){continue}var kw=this._drawEachText(kz,ku,kx,kq,T,kr,kv);if(!kw){continue}kq=kw.curX+this._bufferSpan[0];T=kw.curY;kr=kw.curLineHeight;kx=kw.styleId;if(kw.curY>this._drawingCanvasHeight){return{curX:kq,curY:T,curLineHeight:kr,curStyleId:kx}}}return{curX:kq,curY:T,curLineHeight:kr,curStyleId:kx}},_drawIndoorTextLabelOnCanvas:function(kr){var e=this._getEmptyDrawingCanvas();var ky=e.getContext("2d",{colorSpace:"display-p3"});ky.clearRect(0,0,e.width,e.height);var kG=0;var kx=null;var kw=0;var ku;var kD={};var kC=[];for(var ks in kr){if(ks==="tileInfo"){continue}var kq=kr[ks];var kB=kq.defaultFloor;var kv=kq.floors;for(var kA=0;kA<kv.length;kA++){if(kA===kB){continue}var kE=kv[kA];if(!kE.pois){continue}var kt=kE.pois;for(var kz=0;kz<kt.length;kz++){if(kx===null&&kt[kz].styleText[0]){kx=kt[kz].styleText[0].fontSize+kt[kz].styleText[0].haloSize*2;ku=kx}kC.push(kt[kz])}}}if(kx===null){return null}kC.sort(function(kH,i){return i.rank-kH.rank||kH.styleId-i.styleId});var kF=this._drawEachTypeOfLabels(ky,kC,kG,kw,ku,kx,kD);kG=kF.curStyleId;kw=kF.curX;ku=kF.curY;kx=kF.curLineHeight;var T=this._copyToNewCanvas(e,ku);return T},_updateIndoorLabelsCoords:function(kx,ky){for(var kw in kx){if(kw==="tileInfo"){continue}var e=kx[kw];var ks=e.defaultFloor;var kt=e.floors;for(var ku=0;ku<kt.length;ku++){if(ku===ks){continue}var T=kt[ku];if(!T.pois){continue}var kr=T.pois;for(var kq=0;kq<kr.length;kq++){var kv=kr[kq];if(kv.name&&(!kv.textSize||kv.textSize.length===0)){kr.splice(kq,1);kq--;continue}this._updateFixedLabelCoords(kv,ky);this._addFixedLabelBounds(kv)}}}},_generateEachLabelCanvas:function(kt,ks,ku,e,kw,T){ks=Math.min(ks,this._drawingCanvasHeight);var kv=this._copyToNewCanvas(kt,ks);var kq=null;if(T.renderData.indoorData){kq=this._drawIndoorTextLabelOnCanvas(T.renderData.indoorData);if(kq){this._updateIndoorLabelsCoords(T.renderData.indoorData,kq.height)}}for(var kr=0;kr<ku.length;kr++){if(!ku[kr].textSize){continue}this._updateFixedLabelCoords(ku[kr],ks);this._addFixedLabelBounds(ku[kr])}for(var kr=0;kr<kw.length;kr++){if(!kw[kr].textSize){continue}this._updateFixedLabelCoords(kw[kr],ks);this._addFixedLabelBounds(kw[kr])}for(var kr=0;kr<e.length;kr++){this._updateLineLabelCoords(e[kr],ks)}return[kv,kq]},_copyToNewCanvas:function(T,i){if(i===0){return null}var kq=b3("canvas");kq.width=T.width;kq.height=i;var e=kq.getContext("2d",{colorSpace:"display-p3"});e.drawImage(T,0,0,512,i,0,0,512,i);kq._id=T._id;T._free=true;return kq},_drawEachText:function(kJ,ku,T,kL,kK,kS,kr){var kR=ku.name;var kz=ku.styleText?ku.styleText[0]:ku.style;if(!kz){return null}var kC=kz.fontSize||0;var kW=kz.fontWeight;var k9=kz.haloSize||0;var ld=kz.padding||[0,0];if(!kE){}if(kz.fontRgba){var lg=kz.fontRgba[3]/255;var ky=[];ky[3]=lg;for(var lf=0;lf<3;lf++){ky[lf]=kz.fontRgba[lf]}}if(kz.haloRgba){var lg=kz.haloRgba[3]/255;var kF=[];kF[3]=lg;for(var lf=0;lf<3;lf++){kF[lf]=kz.haloRgba[lf]}}var k3=ky?"rgba("+ky.join(",")+")":kz.color;var kt=kF?"rgba("+kF.join(",")+")":kz.strokeColor;var lb=ku.styleId||0;if(k9>4){k9=4}var kT=[];var kH=[];var kP=0;if(kr&&!kr[lb]){kr[lb]={}}var kB=kC+k9*2+ld[0]*2;var kU=kB;if(ku.containDescendings){kU+=4}if(k9===0){kU+=2}if(ku.textOnIcon){kU=Math.max(kU,ku.iconSize[1])}if(lb!==T||kU>kS){T=lb;if(kW>=10&&kW%10===0){kJ.font=kW*10+" "+kC+"px sans-serif"}else{kJ.font=kC+"px sans-serif"}if(kU>kS){var kQ=kU-kS;kS+=kQ;kK+=kQ}if(k9>0){kJ.lineWidth=k9*2;kJ.strokeStyle=kt}kJ.fillStyle=k3}if(ku.type==="line"){var kw=kR.split("");for(var lc=0;lc<kw.length;lc++){var k5=kw[lc];var kM;var kX;if(kr[lb][k5]){var kE=kr[lb][k5];kM=kE.displaySize;kX=kE.curWordPosition}else{var kq=Math.ceil(kJ.measureText(k5).width);if(kL+kq>512){kL=0+this._bufferSpan[0];kK+=kU;kK+=this._bufferSpan[1];kS=kU}if(kK+this._bufferSpan[1]>this._drawingCanvasHeight){return{curX:kL,curY:kK,curLineHeight:kS,styleId:lb}}var k6=kL;if(k9>0){kq+=k9;k6-=Math.round(k9/2);kJ.strokeText(k5,kL,kK)}kJ.fillText(k5,kL,kK);var k2=[kq,kU];kM=[Math.round(k2[0]/2),Math.round(k2[1]/2)];kX=[k6,kK-kU];kr[lb][k5]={displaySize:kM,curWordPosition:kX,totalHeight:kP};kL+=kq+2}kT.push(kM);kH.push(kX)}kP=Math.round(kT[0][1])}else{if(kr[lb][kR]){var kE=kr[lb][kR];kT=kE.textSize;kH=kE.labelImagePosition;kP=kE.totalHeight}else{var kD=kR.split("\\");if(kD.length>1&&ku.textOnIcon){var le=0;var la=0;var lh=[];var kN=8;for(var lc=0;lc<kD.length;lc++){var kR=kD[lc];var kA=Math.ceil(kJ.measureText(kR).width);if(kA>le){le=kA}lh.push(Math.round(kA/2));la+=kU}var kx=le+2*kN;var k8=la+2*kN;if(kL+kx>512){kL=0+this._bufferSpan[0];kK+=kS;kK+=this._bufferSpan[1]}kK+=la-kU+2*kN;var k1=kL;var kO=kK-k8;var e=Math.round(kx/2);var kG=this._iconCache[ku.icon].image;this.drawStretchedIcon(kJ,kG,[k1,kO],kN,le,la);for(var lc=0;lc<kD.length;lc++){var kR=kD[lc];var k7=k1+(e-lh[lc]);var k4=kO+4+(lc+1)*kU;kJ.fillText(kR,k7,k4)}kT.push([Math.round(kx/2),Math.round(k8/2)]);kH.push([k1,kO]);kL+=kx;kS=k8;kP=Math.round(k8/2)}else{for(var lc=0;lc<kD.length;lc++){var kR=kD[lc];var kA=Math.ceil(kJ.measureText(kR).width);var kx=kA;var ks=0;if(ku.textOnIcon){ks=10;kx+=ks*2;if(ku.styleId===519){kx=ku.iconSize[0];ks=Math.round((kx-kA)/2)}}if(kL+kx>512){kK+=kU;kK+=this._bufferSpan[1];if(kK+this._bufferSpan[1]>this._drawingCanvasHeight){kK-=kU;kK-=this._bufferSpan[1];return{overHeight:true,curX:kL,curY:kK,curLineHeight:kS,styleId:lb}}kL=0+this._bufferSpan[0];kS=kU}else{if(kK+this._bufferSpan[1]>this._drawingCanvasHeight){return{overHeight:true,curX:kL,curY:kK,curLineHeight:kS,styleId:lb}}}var k1=kL;var kO=kK-kU;var k0=kL;var kZ=kK;if(ku.containDescendings){kZ-=4}if(ku.textOnIcon){var kV=false;var kG=this._iconCache[ku.icon].image;var kY=ku.iconSize.concat([]);if(kB>=kY[1]){kY[1]=kB;kV=true;kU+=ks*2;var kQ=kU-kS;if(kQ>0){kK+=kQ;kS=kU;kZ+=(kQ-ks);kO+=(kQ-ks*2)}else{kZ-=ks;kO-=ks*2}}if(kA>=kY[0]){kY[0]=kA}if(ku.styleId===519){kJ.drawImage(kG,0,0,kY[0],kY[1],k1,kO,kY[0],kY[1])}else{if(ku.noStretch){kZ-=kB/2;var kI=kA+ks*2;kJ.drawImage(kG,0,0,kG.width,kG.height,k1,kO,kI,kB)}else{if(kV){this.drawStretchedIcon(kJ,kG,[k1,kO],ks,kA,kY[1])}else{this.draw3StretchedIcon(kJ,kG,[k1,kO],ks,kA,kY[1])}}}k0+=ks;if(ku.iconSize[1]>kB){kZ-=(ku.iconSize[1]-kB)/2-1}}if(k9>0){if(lb===71028){kU-=2}if(lb===32){kU-=2}kJ.strokeText(kR,k0,kZ)}kJ.fillText(kR,k0,kZ);var kv=[kx,kU];var kM=[Math.round(kv[0]/2),Math.round(kv[1]/2)];kT.push(kM);kH.push([k1,kO]);kP+=Math.round(kM[1]);kL+=kx}}kr[lb][kR]={textSize:kT,labelImagePosition:kH,totalHeight:kP}}}ku.textSize=kT;ku.labelImagePosition=kH;ku.totalHeight=kP;return{curX:kL,curY:kK,curLineHeight:kS,styleId:lb}},drawStretchedIcon:function(e,T,kq,kt,ku,i){var ks=kq[0];var kr=kq[1];e.drawImage(T,0,0,kt,kt,ks,kr,kt,kt);e.drawImage(T,kt,0,1,kt,ks+kt,kr,ku,kt);e.drawImage(T,T.width-kt,0,kt,kt,ks+ku+kt,kr,kt,kt);e.drawImage(T,0,kt,kt,1,ks,kr+kt,kt,i);e.drawImage(T,kt,kt,1,1,ks+kt,kr+kt,ku,i);e.drawImage(T,T.width-kt,kt,kt,1,ks+ku+kt,kr+kt,kt,i);e.drawImage(T,0,T.height-kt,kt,kt,ks,kr+i+kt,kt,kt);e.drawImage(T,kt,T.height-kt,1,kt,ks+kt,kr+i+kt,ku,kt);e.drawImage(T,T.width-kt,T.height-kt,kt,kt,ks+ku+kt,kr+i+kt,kt,kt)},draw3StretchedIcon:function(e,i,T,ks,ku,kt){var kr=T[0];var kq=T[1];e.drawImage(i,0,0,ks,i.height,kr,kq,ks,i.height);e.drawImage(i,ks,0,1,i.height,kr+ks,kq,ku,i.height);e.drawImage(i,i.width-ks,0,ks,i.height,kr+ks+ku,kq,ks,i.height)},_updateFixedLabelCoords:function(kr,kG){if(kG===0){return}var kB=[];var kN=[];var kO=0;var kE=kr.totalHeight;var kW=kr.textSize.length;var ks=kr.direction;if(typeof ks!=="number"){ks=0}for(var kP=0;kP<kW;kP++){var kH=kr.labelImagePosition[kP];var kF=kr.textSize[kP];var kD=kH[0];var kq=kH[1];var kt=kF[0];var ky=kF[1];var kA=0;var kM=0;if(typeof kr.textMargin==="number"){kM=kr.textMargin}var kz;var e;var kv=0;var kC=0;if(!kr.iconPos){if(!kr.custom){ks=jj}}else{kv=kr.iconPos.width;kC=kr.iconPos.height}switch(ks){case gJ:var T=kE/2-ky+kA*(kW-1)/2;kz=Math.round(-kv/2-kt-kM);e=Math.round(T-kO-kA*kP);break;case ez:var T=kE/2-ky+kA*(kW-1)/2;kz=Math.round(kv/2+kM);e=Math.round(T-kO-kA*kP);break;case N:var T=kC/2+kE-ky+kA*kW;kz=Math.round(-kt/2);e=Math.round(T-kO-kA*kP);break;case hG:var T=-kC/2-kA-ky;kz=Math.round(-kt/2);e=Math.round(T-kO-kA*kP);break;case jj:var T=-kE/2-kA*(kW-1)/2;kz=Math.round(-kt/2);e=Math.round(T-kO-kA*kP);break}kO+=ky;var kx=kz+kt;var kX=e;var kw=kx;var kV=kX+ky;var ku=kz;var kU=kV;kB.push(kz,e,kx,kX,kw,kV,kz,e,kw,kV,ku,kU);var kT=kD/512;var kL=(kG-kq-ky*2)/kG;var kS=(kD+kt*2)/512;var kK=kL;var kR=kS;var kJ=(kG-kq)/kG;var kQ=kT;var kI=kJ;kN.push(kT,kL,kS,kK,kR,kJ,kT,kL,kR,kJ,kQ,kI)}if(!kr.textPos){kr.textPos={}}kr.textPos.vertex=kB;kr.textPos.texcoord=kN},_addFixedLabelBounds:function(kw){var ks=1000;var kq=1000;var T=-1000;var e=-1000;if(kw.iconPos){var ku=kw.iconPos["vertex"];for(var kv=0,kr=ku.length;kv<kr;kv+=2){var kA=ku[kv];var ky=ku[kv+1];if(kA<ks){ks=kA}if(kA>T){T=kA}if(ky<kq){kq=ky}if(ky>e){e=ky}}}if(kw.custom&&kw.style.iconSize&&!kw.name){var kx=kw.style.iconSize;var kz=kw.direction;switch(kz){case jj:ks=-Math.round(kx[0]/2);kq=-Math.round(kx[1]/2);T=Math.round(kx[0]/2);e=Math.round(kx[1]/2);break;case N:ks=-Math.round(kx[0]/2);kq=0;T=Math.round(kx[0]/2);e=kx[1];break}}if(kw.textPos){var kt=kw.textPos["vertex"];for(var kv=0,kr=kt.length;kv<kr;kv+=2){var kA=kt[kv];var ky=kt[kv+1];if(kA<ks){ks=kA}if(kA>T){T=kA}if(ky<kq){kq=ky}if(ky>e){e=ky}}}kw.bds=[ks,kq,T,e]},_updateLineLabelCoords:function(kH,kx){if(kx===0){return}var kq=kH.wordsInfo;var kE=kH.wordCount;if(!kH.labelImagePosition){return}var kz=kH.labelImagePosition.slice(0);if(kH.reverse){kz.reverse()}var kQ=1000;var kN=1000;var kO=-1000;var kM=-1000;for(var kI=0;kI<kE;kI++){var kR=kz[kI];var kP=kR[0];var kF=kR[1];var kD=kH.textSize[kI];var kw=kD[0];var e=kD[1];var kv=kP/512;var kC=(kx-kF-e*2)/kx;var kt=(kP+kw*2)/512;var kB=kC;var kr=kt;var kA=(kx-kF)/kx;var T=kv;var ky=kA;kq[kI].size=[kw,e];kq[kI].texcoord=[kv,kC,kt,kB,kr,kA,kv,kC,kr,kA,T,ky];var kL=kq[kI].offset[0];var kK=kq[kI].offset[1];var kJ=kL-kw/2;var ku=kK+e/2;var ks=kK-e/2;var kG=kL+kw/2;if(kJ<kQ){kQ=kJ}if(kG>kO){kO=kG}if(ks<kN){kN=ks}if(ku>kM){kM=ku}}kH.bds=[kQ,kN,kO,kM]}});var gc={0:"00000000",16:"00010000",32:"00100000",48:"00110000",64:"01000000",96:"01100000"};function eq(ks,ku,kq){var kr=ks.bds;if(!kr){return false}var kt=ks.tracer;var T;if(kt){if(!gc[kt]){T=kt.toString(2);if(T.length<8){T=new Array(8-T.length+1).join("0")+T}gc[kt]=T}T=gc[kt];var e=kl.mapZoomStartZoomMapping[ku];var kv=ku>20?21:ku;return T[kv-e]==="1"}var i=ks.displayRange;if(kq>=i[0]&&kq<=i[1]){return true}return false}function jp(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=go();this._useRound=true;this._sharpenRender=false;if(this._ratio>hX.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 aA((b2()||e6.Browser.ie)?64:128,{clearCallback:function(T){}});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()}e6.extend(jp.prototype,{bind:function(){var T=this.map;var i=this;T.addEventListener("mapstatusbusy_inner",function(kq){i._mapIsMoving=true;if(i._ratio>hX.HIGH_RES_MIN_RATIO){i._sharpenRender=false}else{i._useRound=false}});T.addEventListener("mapstatusidle_inner",function(kq){if(i._ratio>hX.HIGH_RES_MIN_RATIO){i._sharpenRender=true}else{i._useRound=true}i._mapIsMoving=false});T.addEventListener("onspotmouseover",function(ks){if(!this.temp.isPermitSpotOver){return}if(ks.spots.length>0){var kr=ks.spots[0].userdata.uid;var kt=ks.spots[0].userdata.tilePosStr;var kq=i.getLabelByUid(kr,kt);kq&&kq.formatedData&&i._toHighlightColor(kq.formatedData)}});T.addEventListener("onspotmouseout",function(ks){if(!this.temp.isPermitSpotOver){return}if(ks.spots.length>0){var kr=ks.spots[0].userdata.uid;var kt=ks.spots[0].userdata.tilePosStr;var kq=i.getLabelByUid(kr,kt);kq&&kq.formatedData&&i._toDefaultColor(kq.formatedData)}});T.addEventListener("spotclick",function(ks){if(ks.spots&&ks.spots.length>0){if(ks.spots[0].userdata.zoom<10){return}var kr=ks.spots[0].userdata.uid;var kt=ks.spots[0].userdata.tilePosStr;if(i.currentSelectedLabel&&(i.currentSelectedLabel.uid!==kr||i.currentSelectedLabel.tilePosStr!==kt)){i._recoverNormalState()}var kq=i.getLabelByUid(kr,kt);kq&&i._changeBaseMapState(kq)}else{i._recoverNormalState()}});T.on("spot_status_reset",function(){i._recoverNormalState()});T.on("spot_highlight",function(kr){var kq=i.getLabelByUid(kr.uid,kr.tilePosStr);kq&&kq.formatedData&&i._toHighlightColor(kq.formatedData)});T.addEventListener("mousemove",function(kq){if(i.curSpotAdded){return}if(this.currentOperation!==em.idle||i._mapIsMoving===true){return}i._refreshSpotData();this.temp.isPermitSpotOver=true;i.curSpotAdded=true});if(b2()){function e(){i._refreshSpotData()}T.addEventListener("mapstatusidle_inner",e)}T.on("style_loaded",function(){if(i.map.config.textRenderType==="canvas"&&!i._labelTextCanvas){i._labelTextCanvas=i.map.tileMgr.getLabelTextCanvas()}});T.on("destroy",function(){i.iconCache.clear();i.fixedLabelData=[];i.lineLabelData=[];i.highlightLabelData=[];for(var kq=0;kq<i.allLabels.length;kq++){i.allLabels[kq]._mcBds=null}i.allLabels=[];for(var kq=0;kq<i._spotData.length;kq++){i._spotData[kq].pt=null;i._spotData[kq].userdata.iconPoint=null}i._spotData=[]})},getLabelByUid:function(ku,kv){var e=this.map._featureMgr.getResult().tileLabels[this.layer.drawIndex]||[];for(var kt=0;kt<e.length;kt++){var kq=e[kt].fixedLabel;for(var ks=0;ks<kq.length;ks++){if(e[kt].fixedLabel[ks].guid===ku&&e[kt].fixedLabel[ks].tilePosStr===kv){return e[kt].fixedLabel[ks]}}var kr=e[kt].indoorLabel;for(var T=0;T<kr.length;T++){if(e[kt].indoorLabel[T].guid===ku&&e[kt].indoorLabel[T].tilePosStr===kv){return e[kt].indoorLabel[T]}}}return null},getTileByLabelUid:function(ku){var e=this.map._featureMgr.getResult().tileLabels[this.layer.drawIndex]||[];for(var kt=0;kt<e.length;kt++){var kq=e[kt].fixedLabel;for(var ks=0;ks<kq.length;ks++){if(e[kt].fixedLabel[ks].guid===ku){return e[kt]}}var kr=e[kt].indoorLabel;for(var T=0;T<kr.length;T++){if(e[kt].indoorLabel[T].guid===ku){return e[kt]}}}return null},_toHighlightColor:function(T){if(T.tempRank&&T.tempRank===this.RANK5){return}var e=this.map._featureMgr.getResult().eleData[4][this.layer.drawIndex]||[];var kr=false;for(var kq=0;kq<e.length;kq++){if(e[kq]===T||(e[kq].guid===T.guid&&e[kq].tilePosStr===T.tilePosStr&&e[kq].zoom===T.zoom)){kr=true;break}}if(kr){return}e.push(T);this.map._featureMgr.setOverlayData(e,4,this.layer.drawIndex);this.map.dispatchEvent(new fS("onrefresh"))},_toDefaultColor:function(T){if(T.tempRank&&T.tempRank===this.RANK5){return}var e=this.map._featureMgr.getResult().eleData[4][this.layer.drawIndex]||[];for(var kq=0;kq<e.length;kq++){if(T===e[kq]||(T.guid===e[kq].guid&&T.tilePosStr===e[kq].tilePosStr&&T.zoom===e[kq].zoom)){e.splice(kq,1);break}}this.map._featureMgr.setOverlayData(e,4,this.layer.drawIndex);this.map.dispatchEvent(new fS("onrefresh"))},_changeBaseMapState:function(i){var kr=i.guid;var kv=i.formatedData.guidExt;var kw={guid:kr,tilePosStr:i.tilePosStr,guidExt:kv};this._strategyInfo=kw;this.currentSelectedLabel=i;var kq=this.map._featureMgr;var e=kq.getLabelData(this.layer.drawIndex);e=this.collisionTest(e);this.updateLabels(e);var kx=this.fixDataFormat(e);kq.setOverlayData(kx[0],2,this.layer.drawIndex);kq.setOverlayData(kx[1],3,this.layer.drawIndex);kq.setOverlayData(kx[2],4,this.layer.drawIndex);var T=this.getTileByLabelUid(kr);this.currentSelectedLabel.tileInfo=T.tileInfo;var ku=this.layer.tileCache.getAllData();for(var kt in ku){var ks=ku[kt].data;if(!ks.label){continue}this.clearCollisionCache(ks.label)}this.map.dispatchEvent(new fS("onrefresh"))},_recoverNormalState:function(){this._strategyInfo=null;var ku=false;var ks=this.map._featureMgr.getLabelData(this.layer.drawIndex);if(this.currentSelectedLabel){var T=this.currentSelectedLabel.guid;this.clearCollisionCache(this.getTileByLabelUid(T));var kr=this.layer.tileCache.getAllData();for(var kq in kr){if(Object.prototype.hasOwnProperty.call(kr,kq)){var kt=kr[kq].data;if(!kt.label){continue}this.clearCollisionCache(kt.label)}}this.currentSelectedLabel.tempRank=null;this.currentSelectedLabel=null;ku=true}ks=this.collisionTest(ks);this.updateLabels(ks);var e=this.fixDataFormat(ks);var i=this.map._featureMgr;i.setOverlayData(e[0],2,this.layer.drawIndex);i.setOverlayData(e[1],3,this.layer.drawIndex);i.setOverlayData([],4,this.layer.drawIndex);this.map.dispatchEvent(new fS("onrefresh"));if(ku){this.curSpotAdded=false;this._refreshSpotData()}},loadIconImages:function(kD,kt,T){var kC=kD.label;var kF=kD.tileInfo.style;var kr=kC.fixedLabel;if(T==="indoor"){kr=[]}var kB=kC.indoorLabel;var kA=kr.length+kB.length;var kG=this;var kE=0;var ky=200;for(var kz=0;kz<kA;kz++){var kw;if(kz<kr.length){kw=kr[kz]}else{kw=kB[kz-kr.length]}if(!kw.iconPos){var kv=this.loadSVGSymbol(kw,kF);if(!kv){continue}else{if(kv!==true){var ku=kw.iconPos.iconType;var e=kF+"_"+ku;this.iconCache.setData(e,{loaded:false,image:kv});kw.iconPos.img=kv}}}var ku=kw.iconPos.iconType;var e=kF+"_"+ku;kE++;if(this.iconCache.getData(e)){if(this.iconCache.getData(e).loaded){kt(kD)}else{if(kw.iconPos.img){kw.iconPos.img.id=e;kw.iconPos.img.iconUrl=ku;this.iconCache.setData(e,{loaded:true,image:kw.iconPos.img});this._addToIconTexture(kw.iconPos.img);kt(kD)}}continue}if(!T||T==="indoor"){var ks=C.getIconSetPath(this.map.config.style)+ku+".png";var kx=bE();if(kx&&kx.udt){ks+="?udt="+kx.udt}}else{var ks=ku}var kq=new Image();kq.id=e;kq.iconUrl=ks;kq.crossOrigin="anonymous";kq.onload=function(){if(kG.iconCache.getData(this.id)){kG.iconCache.getData(this.id).loaded=true;kG._addToIconTexture(this)}if(!kG._iconLoadTimer){kG._iconLoadTimer=setTimeout(function(){kt();kG._iconLoadTimer=null},ky)}this.onload=null};kq.onerror=function(){if(!kG._iconLoadTimer){kG._iconLoadTimer=setTimeout(function(){kt();kG._iconLoadTimer=null},ky)}kG.iconCache.removeData(this.id);this.onerror=null;bD.fetchDebug&&bD.fetchDebug.sendError({title:this.iconUrl,msg:this.iconUrl,category:bD.fetchDebug.category.RESOURCE,level:bD.fetchDebug.levels.ERROR,url:this.iconUrl})};kq.src=ks;this.iconCache.setData(e,{loaded:false,image:kq})}return kE},_addToIconTexture:function(ks){if(!this.map._webglMapScene){return}var ku=this.map._webglMapScene._painter;var e=ku._iconTextureAtlas.addTexture(ks);if(e===false){this.map.fire(new fS("onlayer_clear"))}if(!e){return}ku._iconTextureAtlasOffset[ks.id]=e;var kx=0*ks.width/1024+e.width;var kr=0*ks.height/1024+e.height;var kw=ks.width/1024+e.width;var kq=kr;var kv=kw;var T=ks.height/1024+e.height;var kt=kx;var i=T;ku._iconTextureAtlasCoords[ks.id]=[kx,kr,kw,kq,kv,T,kx,kr,kv,T,kt,i]},loadSVGSymbol:function(kq,T){var i=kq.symbol||{};var kt=dR.generateKey(i.path,i);if(!kt){return null}var ks=this.iconCache.getData(T+"_"+kt);if(ks&&ks.loaded){kq.iconPos=this.createVertex(ks.image.width/2,ks.image.height/2,kt);return true}var kr=new dR(i.path,i);kr.add();var e=kr.render();if(!e){return null}kq.iconPos=this.createVertex(kr.size.width,kr.size.height,kt);return kr.data},createVertex:function(ks,kw,T){var kr=Math.round(-ks/2);var ky=Math.round(-kw/2);var kq=kr+ks;var kx=ky;var i=kq;var kv=kx+kw;var e=kr;var ku=kv;var kt={vertex:[kr,ky,kq,kx,i,kv,kr,ky,i,kv,e,ku],texcoord:null,width:ks,height:kw,iconType:T};return kt},loadImgByStr:function(kq,kr,ks){if(!kq&&!kr){ks&&ks(null,null);return}if(typeof kq==="object"&&typeof kr==="object"){ks(kq,kr);return}var i=0;var T=null;var e=null;if(kq){i++;T=new Image();T.onload=function(){i--;if(i===0){ks&&ks(this,e)}this.onload=null};T.src=kq}if(kr){i++;e=new Image();e.onload=function(){i--;if(i===0){ks&&ks(T,this)}this.onload=null};e.src=kr}},collisionTest:function(lh,kB,kI){if(this.map.viewAnimationTime){return[]}if(!lh){return[]}if(this.layer.ontology&&this.layer.ontology.noCollision){for(var kT=0;kT<lh.length;kT++){var lw=lh[kT].fixedLabel;for(var kR=0;kR<lw.length;kR++){var kt=lw[kR];var ly=this.layer.ontology.getLayerVisible(kt.layerName);kt.isDel=!ly}}return lh}var kE=this.map;var lm=kE.getHeading();lm=this.calcLoopHeading(lm);var k4=kE.height;var kW=this.allLabels;for(var kT=0;kT<kW.length;kT++){kW[kT]._mcBds=null}kW.length=0;lh.sort(function(ll,i){var lA=ll.tileInfo;var lz=i.tileInfo;if(lA.col*lA.row<lz.col*lz.row){return -1}else{return 1}});var kF=kE.getTilt();var ln=kE.getZoom();if(this.layer.ontology){ln+=(this.layer.spanLevel||0)}var kP;if(kI){kP=kI}else{kP=this.getZoomStep()}for(var kT=0,kN=lh.length;kT<kN;kT++){var T=lh[kT];var kX=T.tileInfo;var kQ=kX.zoom;var k5=kX.loopOffsetX/Math.pow(2,18-kQ);if(!lm&&!kF){if(T.unnecessaryCollisionTest&&T.unnecessaryCollisionTest[kI]){continue}}var lw=T.fixedLabel||[];for(var kR=0,lt=lw.length;kR<lt;kR++){var kt=lw[kR];kt.zoom=kQ;if(kB===-1&&kt.isDel){continue}if(this.layer.ontology){var ly=this.layer.ontology.getLayerVisible(kt.layerName);if(!ly){continue}}if(!eq(kt,kX.useZoom,ln)){kt.isDel=true;continue}this.calcCollisionBounds(kt,kP,k5,k4);kW.push(kt)}var kS=T.indoorLabel||[];for(var kO=0,k0=kS.length;kO<k0;kO++){var kZ=kS[kO];kZ.zoom=kQ;if(kB===-1&&kZ.isDel){continue}if(!eq(kZ,kX.useZoom)){kZ.isDel=true;continue}this.calcCollisionBounds(kZ,kP,k5,k4);kW.push(kZ)}var ls=T.lineLabel||[];for(var kV=0,kG=ls.length;kV<kG;kV++){var ld=ls[kV];if(kB===-1&&ld.isDel){continue}if(!eq(ld,kX.useZoom)){ld.isDel=true;continue}var ku=ld.pt;var lc=kE.pointToPixelIn(ku,{zoom:kP,useRound:this._useRound});var lv=lc.x+k5;var lu=k4-lc.y;var kr=ld.bds;var lf=kr[0];var le=kr[1];var kK=kr[2];var kJ=kr[3];var kD=lf;var kC=le;var lr=kK;var lq=kJ;if((lm>=0&&lm<45)||(lm>=315&&lm<360)){kD=lf;kC=le;lr=kK;lq=kJ}else{if(lm>=45&&lm<135){kD=le;kC=-kK;lr=kJ;lq=-lf}else{if(lm>=135&&lm<225){kD=-kK;kC=-kJ;lr=-lf;lq=-le}else{if(lm>=225&&lm<315){kD=-kJ;kC=lf;lr=-le;lq=kK}}}}ld._tempBds=[lv+kD,lu+kC,lv+lr,lu+lq];var lj=kE.pixelToPointIn(new fr(ld._tempBds[0],lc.y+kC),{zoom:kP});var lb=kE.pixelToPointIn(new fr(ld._tempBds[2],lc.y+lq),{zoom:kP});ld._mcBds=[lj,lb];kW.push(ld)}}var la=this._strategyInfo;if(la){var kU=la.guid;var kL=la.guidExt;var k8=false;for(var kM=0,kA=kW.length;kM<kA;kM++){var ks=kW[kM];delete ks.tempRank;if(!this.layer.isClickableLabel(ks)||(kL===1&&!ks.guidExt)){continue}if(kU===ks.guid&&la.tilePosStr===ks.tilePosStr){ks.tempRank=this.RANK5;k8=true}}if(!k8&&this.currentSelectedLabel){this.currentSelectedLabel.tempRank=this.RANK5;var kY=this.currentSelectedLabel.tileInfo;if(kY){var kH=kY.zoom;var lk=kY.loopOffsetX/Math.pow(2,18-kH);this.calcCollisionBounds(this.currentSelectedLabel,kP,lk,k4);kW.push(this.currentSelectedLabel)}}}else{for(var kq=0,kz=kW.length;kq<kz;kq++){var kw=kW[kq];if(kw.type==="line"||!kw.iconPos){continue}delete kw.tempRank}}kW.sort(function(lz,ll){var lA=lz.tempRank?lz.tempRank:lz.rank;var i=ll.tempRank?ll.tempRank:ll.rank;return i-lA||lz.startZoom-ll.startZoom||ll.pt.lng-lz.pt.lng||ll.pt.lat-lz.pt.lat});var lp=0;if(kF>0){lp=6}ln=kE.getZoom();if(ln>=8&&ln<9){ln<8.5?(lp=6):(lp=3)}if(kE._displayOptions.labelMargin>0){lp=kE._displayOptions.labelMargin}var k6=2;if(ln<6&&ln>=5){k6=-1}for(var k9=0,ky=kW.length;k9<ky;k9++){var lo=kW[k9];var lg=lo._tempBds;lo.isDel=false;lo._intersectIdx=[];for(var k2=k9+1;k2<ky;k2++){var k3=kW[k2];var lx=k3._tempBds;if(!(lg[2]+lp+k6<lx[0]-lp||lg[0]-lp>lx[2]+lp+k6||lg[3]+lp+k6<lx[1]-lp||lg[1]-lp>lx[3]+lp+k6)){lo._intersectIdx.push(k2)}}}for(var k7=0,kx=kW.length;k7<kx;k7++){var kv=kW[k7];if(kv.isDel===false){var e=kv._intersectIdx;for(var k1=0,li=e.length;k1<li;k1++){kW[e[k1]].isDel=true}}}return lh},calcCollisionBounds:function(kw,ku,i,kv){var ks=kw.ptFix||kw.pt;var kq=this.map;var kr=kq.pointToPixelIn(ks,{zoom:ku,useRound:this._useRound});var T=kr.x+i;var ky=kv-kr.y;var e=kw.bds;kw._tempBds=[T+e[0],ky+e[1],T+e[2],ky+e[3]];var kt=kq.pixelToPointIn(new fr(kw._tempBds[0],kr.y+e[1]),{zoom:ku});var kx=kq.pixelToPointIn(new fr(kw._tempBds[2],kr.y+e[3]),{zoom:ku});kw._mcBds=[kt,kx]},getZoomStep:function(){var T=this.map.getZoom();var e=Math.floor(T);var i=T-e>=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 T=this.getZoomStep();var ks=false;for(var kq=0;kq<e.length;kq++){var kr=e[kq];if(!kr.cacheState||!kr.cacheState[T]){ks=true;break}if(kr.hasNewData){ks=true;break}}if(ks){this.calcLabelsCollision(e)}return e},calcLabelsCollision:function(T){var kr=this.getZoomStep();var ks={};var kz;var kq;var kB;var kD;var kC;var kA;T=this.collisionTest(T,undefined,kr);a0.addLabelIntoAreaSpots(T);for(var kw=0;kw<T.length;kw++){kz=T[kw];kq=kz.tileInfo;kD=kq.col+","+kq.row;ks[kD]=1}var e={};for(var ku=0;ku<T.length;ku++){kz=T[ku];if(!kz.cacheState){kz.cacheState={}}kq=kz.tileInfo;kC=kq.col;kA=kq.row;kD=kC+","+kA;if(kz.cacheState[kr]==="stable"){e[kD]=1;if(!kz.hasNewData){continue}}for(var kv=0;kv<kz.fixedLabel.length;kv++){kB=kz.fixedLabel[kv];if(!kB.cachedIsDel){kB.cachedIsDel={}}kB.cachedIsDel[kr]=kB.isDel}for(var ky=0;ky<kz.indoorLabel.length;ky++){kB=kz.indoorLabel[ky];if(!kB.cachedIsDel){kB.cachedIsDel={}}kB.cachedIsDel[kr]=kB.isDel}for(var kx=0;kx<kz.lineLabel.length;kx++){kB=kz.lineLabel[kx];if(!kB.cachedIsDel){kB.cachedIsDel={}}kB.cachedIsDel[kr]=kB.isDel}if(ks[(kC-1)+","+(kA-1)]&&ks[(kC-1)+","+kA]&&ks[(kC-1)+","+(kA+1)]&&ks[kC+","+(kA-1)]&&ks[kC+","+(kA+1)]&&ks[(kC+1)+","+(kA-1)]&&ks[(kC+1)+","+kA]&&ks[(kC+1)+","+(kA+1)]){kz.cacheState[kr]="stable";e[kD]=1}else{if(!kz.cacheState[kr]){kz.cacheState[kr]="unstable"}}}for(var kt=0;kt<T.length;kt++){kz=T[kt];kq=kz.tileInfo;kD=kq.col+","+kq.row;kC=+kq.col;kA=+kq.row;if(e[(kC-1)+","+(kA-1)]&&e[(kC-1)+","+kA]&&e[(kC-1)+","+(kA+1)]&&e[kC+","+(kA-1)]&&e[kC+","+(kA+1)]&&e[(kC+1)+","+(kA-1)]&&e[(kC+1)+","+kA]&&e[(kC+1)+","+(kA+1)]){if(!kz.unnecessaryCollisionTest){kz.unnecessaryCollisionTest={}}kz.unnecessaryCollisionTest[kr]=1}}T.hasNewData=false},updateLabels:function(kr){var T=this.map;var kx=T.getZoom();var kz=T.getHeading();kz=this.calcLoopHeading(kz);var ky=T.getTilt();var ks=this.getZoomStep();for(var kw=0,kt=kr.length;kw<kt;kw++){var kv=kr[kw];var kq=kv.tileInfo;var ku=kq.loopOffsetX||0;var e={zoom:kx,mcOffsetX:ku};this.updateFixedLabel(kv.fixedLabel,ky,kz,kv,ks,e);e={zoom:kx,mcOffsetX:0};this.updateFixedLabel(kv.indoorLabel,ky,kz,kv,ks,e);this.updateLineLabel(kv.lineLabel,ky,kz,kv,ks)}},updateFixedLabel:function(kv,ky,i,kB,kr,kw){if(kv.length===1){}var e=kw.zoom;var kq=kw.mcOffsetX;var kG;for(var kC=0,kt=kv.length;kC<kt;kC++){var kx=kv[kC];if(!kx.cachedIsDel){continue}if(!ky&&!i&&kB.cacheState&&kB.cacheState[kr]){kx.isDel=kx.cachedIsDel[kr];if(typeof kx.isDel==="undefined"){kx.isDel=kx.cachedIsDel[kr]=true}}if(kx.startScale>e){kx.isDel=true}if(kx.isDel){continue}var kE=kx.pt;var T=kx.iconPos;if(T&&T.texcoord){if(!T.rtVertex){T.rtVertex=[];kG=T.vertex;var ku=iW(kE.lng);var kD=iW(kE.lat);T.rtVertex=[ku[0],kD[0],ku[1],kD[1],0,kG[0],kG[1],0,0,T.texcoord[0],T.texcoord[1],ku[0],kD[0],ku[1],kD[1],0,kG[2],kG[3],0,0,T.texcoord[2],T.texcoord[3],ku[0],kD[0],ku[1],kD[1],0,kG[4],kG[5],0,0,T.texcoord[4],T.texcoord[5],ku[0],kD[0],ku[1],kD[1],0,kG[6],kG[7],0,0,T.texcoord[6],T.texcoord[7],ku[0],kD[0],ku[1],kD[1],0,kG[8],kG[9],0,0,T.texcoord[8],T.texcoord[9],ku[0],kD[0],ku[1],kD[1],0,kG[10],kG[11],0,0,T.texcoord[10],T.texcoord[11]]}}var kF=kx.textPos;if(kF){if(!kF.rtVertex){kF.rtVertex=[];kG=kF.vertex;var ks=kF.rtVertex;var kA=iW(kE.lng);var kJ=iW(kE.lat);var kI=iW(kq);for(var kz=0,kH=kG.length;kz<kH;kz+=12){ks.push(kA[0],kJ[0],kA[1],kJ[1],0,kG[kz],kG[kz+1],kI[0],kI[1],kF.texcoord[0],kF.texcoord[1]);ks.push(kA[0],kJ[0],kA[1],kJ[1],0,kG[kz+2],kG[kz+3],kI[0],kI[1],kF.texcoord[2],kF.texcoord[3]);ks.push(kA[0],kJ[0],kA[1],kJ[1],0,kG[kz+4],kG[kz+5],kI[0],kI[1],kF.texcoord[4],kF.texcoord[5]);ks.push(kA[0],kJ[0],kA[1],kJ[1],0,kG[kz+6],kG[kz+7],kI[0],kI[1],kF.texcoord[6],kF.texcoord[7]);ks.push(kA[0],kJ[0],kA[1],kJ[1],0,kG[kz+8],kG[kz+9],kI[0],kI[1],kF.texcoord[8],kF.texcoord[9]);ks.push(kA[0],kJ[0],kA[1],kJ[1],0,kG[kz+10],kG[kz+11],kI[0],kI[1],kF.texcoord[10],kF.texcoord[11])}}}}},updateLineLabel:function(kv,kY,kO,kJ,kK){kv=kv||[];var kE=this.map;var ky=kE.getZoomUnits();for(var kX=0,kV=kv.length;kX<kV;kX++){var ku=kv[kX];if(!ku.cachedIsDel){continue}if(!kY&&!kO&&kJ.cacheState&&kJ.cacheState[kK]){ku.isDel=ku.cachedIsDel[kK];if(typeof ku.isDel==="undefined"){ku.isDel=ku.cachedIsDel[kK]=true}}if(ku.isDel){continue}if(!ku.styleText||ku.styleText.length===0){continue}var kw=ku.mcInTile;var kR=kw.x;var kP=kw.y;var kI=ku.wordsInfo;var kG=ku.labelAngle;var kC=false;var kQ=0;if(kO!==0){var kD=kI[0].angle;var kU=this.calcLoopHeading(kD-kO);if(kU>45&&kU<315){if(kU>45&&kU<=135){kQ=270}else{if(kU>135&&kU<=225){kQ=180}else{if(kU>225&&kU<315){kQ=90}}}if(kG>225&&kG<=315&&kQ<=180){kC=true}else{if((kG>=0&&kG<=45||kG>=315&&kG<360)&&kQ>=180){kC=true}}}}for(var kW=0,kz=kI.length;kW<kz;kW++){var kT=kI[kW];var kB=kT.calcInfo;var kN=kT.offset[0];var kL=kT.offset[1];if(!kT.size){continue}var e=kT.size[0];var T=kT.size[1];var kA=kT.angle;if(!kB){kB={}}if(kO!==kB.mapHeading||ky!==kB.zoomUnits){kB.mapHeading=kO;kB.zoomUnits=ky;if(kC){var kF=kI[kz-1-kW];kN=kF.offset[0];kL=kF.offset[1];kA=kF.angle}var kr=kR+kN*ky;var kq=kP+kL*ky;kB.rotationCenter={lng:kr,lat:kq};kB.calcHeading=kQ;kB.angle=kA;kB.offsetX=kN;kB.offsetY=kL;kT.calcInfo=kB}if(!kT.rtVertex){kT.rtVertex=[]}kT.rtVertex.length=0;var kH=kB.calcHeading+kB.angle;var ks=kB.rotationCenter;kN=kB.offsetX;kL=kB.offsetY;var kt=Math.round(kN-e/2);var kS=Math.round(kN+e/2);var kM=Math.round(kL+T/2);var kx=Math.round(kL-T/2);kT.rtVertex.push(kR,kP,kT.z,kt,kx,ks.lng,ks.lat,kH,kT.texcoord[0],kT.texcoord[1],kR,kP,kT.z,kS,kx,ks.lng,ks.lat,kH,kT.texcoord[2],kT.texcoord[3],kR,kP,kT.z,kS,kM,ks.lng,ks.lat,kH,kT.texcoord[4],kT.texcoord[5],kR,kP,kT.z,kt,kx,ks.lng,ks.lat,kH,kT.texcoord[6],kT.texcoord[7],kR,kP,kT.z,kS,kM,ks.lng,ks.lat,kH,kT.texcoord[8],kT.texcoord[9],kR,kP,kT.z,kt,kM,ks.lng,ks.lat,kH,kT.texcoord[10],kT.texcoord[11])}}},calcLoopHeading:function(e){while(e>=360){e-=360}while(e<0){e+=360}return e},fixDataFormat:function(ky){var kq=this.fixedLabelData;var e=this.lineLabelData;var T=this.highlightLabelData;var kG=0;var ku=0;var kD=0;var kE;if(this.currentSelectedLabel){var kt=this.getLabelByUid(this.currentSelectedLabel.guid,this.currentSelectedLabel.tilePosStr);if(!kt||kt.isDel){kq[kG]=this.currentSelectedLabel.formatedData;kG++;T[kD]=this.currentSelectedLabel.formatedData;kD++}}for(var kC=0;kC<ky.length;kC++){var kw=ky[kC];var kv=kw.fixedLabel;var kr=kw.indoorLabel;var kB=kw.lineLabel;var kF={highlightLabelData:T,highlightLabelDataLen:kD};kE=this.fixFixedLabelDataFormat(kv,kw,kq,kG,kF);kG=kE[0];kD=kE[1];kE=this.fixFixedLabelDataFormat(kr,kw,kq,kG,kF,true);kG=kE[0];kD=kE[1];e[ku]={tileInfo:kw.tileInfo,lineLabels:[]};for(var kA=0;kA<kB.length;kA++){if(kB[kA].isDel){continue}var kx=kB[kA].wordsInfo;if(kx){for(var kz=0;kz<kx.length;kz++){if(!kx[kz].rtVertex){continue}var ks=kx[kz].formatedData;if(!ks){ks={textureSource:kw.textureSources[kB[kA].processedInZoom],textureHeight:kw.textureHeights[kB[kA].processedInZoom],renderData:{vertex:kx[kz].rtVertex,textureCoord:kx[kz].texcoord}};kx[kz].formatedData=ks}e[ku].lineLabels.push(ks)}}}ku++}kq.length=kG;e.length=ku;T.length=kD;return[e,kq,T]},fixFixedLabelDataFormat:function(ku,kx,ky,kv,T,kw){var ks=T.highlightLabelData;var e=T.highlightLabelDataLen;for(var i=0;i<ku.length;i++){if(ku[i].isDel){continue}var kt=ku[i].textPos;var kr=ku[i].iconPos;var kq=null;if(kt&&kt.rtVertex){if(!ku[i].formatedData){kq={guid:ku[i].guid,guidExt:ku[i].guidExt,tilePosStr:ku[i].tilePosStr,zoom:ku[i].zoom,tempRank:ku[i].tempRank,textureSource:kx.textureSources[ku[i].processedInZoom],textureHeight:kx.textureHeights[ku[i].processedInZoom],renderData:{vertex:kt.rtVertex,textureCoord:kt.texcoord}};if(kw&&ku[i].onDefaultFloor===false){kq.textureSource=kx.indoorTextureSources[ku[i].processedInZoom];kq.textureHeight=kx.indoorTextureHeights[ku[i].processedInZoom]}ku[i].formatedData=kq}else{kq=ku[i].formatedData;kq.tempRank=ku[i].tempRank}if(this.currentSelectedLabel&&kq.guid===this.currentSelectedLabel.guid&&kq.tilePosStr===this.currentSelectedLabel.tilePosStr){ks[e]=kq;e++}}if(kr&&kr.rtVertex){if(kq){if(!kq.iconRenderData){kq.iconRenderData={vertex:kr.rtVertex,textureCoord:kr.texcoord}}}else{kq={guid:ku[i].guid,guidExt:ku[i].guidExt,zoom:ku[i].zoom,tempRank:ku[i].tempRank,iconRenderData:{vertex:kr.rtVertex,textureCoord:kr.texcoord}};ku[i].formatedData=kq}}ky[kv]=kq;kv++}return[kv,e]},_refreshSpotData:function(){this._spotData.length=0;var kv=this.map;var kt=Math.floor(kv.getZoom());var T=this.map._featureMgr.getLabelData(this.layer.drawIndex);if(this.layer.drawIndex!==0){return}if(T){for(var kr=0,kq=T.length;kr<kq;kr++){this._addFixedSpotData(T[kr].fixedLabel,kt);this._addFixedSpotData(T[kr].indoorLabel,kt)}}var kw=this.currentSelectedLabel;if(kw&&!this.getTileByLabelUid(kw.guid,kw.tilePosStr)){var ks=this._getSpotDataFromLabel(this.currentSelectedLabel);if(ks){this._spotData.push(ks)}}var ku=new fS("onspotsdataready");ku.spots=this._spotData;ku.index=this.layer.drawIndex;kv._spotDataOnCanvas=this._spotData;kv.dispatchEvent(ku)},_addFixedSpotData:function(kr,kq){for(var e=0;e<kr.length;e++){var T=kr[e];if(!this.layer.isClickableLabel(T)||(T.guidExt===1&&T.startScale>kq)){continue}var i=kr[e].spot||this._getSpotDataFromLabel(kr[e]);if(i){this._spotData.push(i)}}},_getSpotDataFromLabel:function(T){var ks=this.map;if(!T.bds){return null}var e=T.bds.slice(0);var kq=null;if(T.iconPos){kq=new cD(T.pt.lng,T.pt.lat)}var i=T.name?T.name.replace("\\\\","<br>"):"";if(T.iconPos&&T.iconPos.iconType.indexOf("ditie")>-1&&ks.getZoom()>14){i=""}var kr={n:i,pt:new cD(T.pt.lng,T.pt.lat),userdata:{iconPoint:kq,uid:T.guid,name:i,mapPoi:true,type:T.iconPos?T.iconPos.iconType:"",rank:T.rank,zoom:T.zoom,tilePosStr:T.tilePosStr},bd:e,tag:"MAP_SPOT_INFO"};T.spot=kr;return kr},drawLabelsOnCanvas:function(i,e){if(this._labelTextCanvas){this._labelTextCanvas.drawLabelsOnCanvas(i,e)}}});function ji(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()}ji.prototype.init=function(){var T=this._map;var i=this;function e(kq){i.updateLabels(kq)}T.addEventListener("add_tile_labels",e);T.addEventListener("onremove_tile_labels",e);T.addEventListener("onclear_labels",e);T.addEventListener("onlayer_clear",e)};ji.prototype.updateLabels=function(kt){var kx=this._map.tileMgr.getLabelTextCanvas();var T=this._map;var kv=this;var ku=c9();if(kt&&kt.model==="mvt"){var kz=kt.data;var ky="mvt_"+kt.index;if(!this._task[ky]){this._task[ky]=[ku]}else{this._task[ky].push(ku)}}else{var kz=T._customTileLabels;var ky="custom";if(!this._task[ky]){this._task[ky]=[ku]}else{this._task[ky].push(ku)}}var ks=JSON.parse(JSON.stringify(kz));for(var kr=0;kr<ks.length;kr++){var kw=ks[kr];kw.guid=kw.guid||kw.uid;kw.iconPos=this.getIconVertexData(kw.style,1);var kq={textMargin:kw.textMargin,textOnIcon:kw.textOnIcon,iconSize:kw.iconSize,style:{color:kw.style.color,strokeColor:kw.style.strokeColor,fontSize:kw.style.fontSize,haloSize:kw.style.haloSize,}};ks[kr].styleId=ks[kr].styleId||o(kq)}ks.taskId=ku;kx.drawCustomLabelsOnCanvas(ks,function(kE){var kF=true;for(var kC=0;kC<kv._task[ky].length;kC++){if(kv._task[ky][kC]===ks.taskId){kv._task[ky].splice(0,kC+1);kF=false;break}}if(kF){return}if(!kE||!ks||ks.length===0){var e=JSON.parse(JSON.stringify(kv.virtualTile));e.label.tileInfo=e.tileInfo;var kA=null;e.label.fixedLabel=ks;kv.virtualTiles[ky]={};var kD=new fS("oncustom_labels_ready");kD.virtualTile=e;kD.labelCanvas=kA;kD.model=ky;kD.imgKey=bD.getGUID("custom_labels_");T.dispatchEvent(kD);return}else{kv.virtualTiles[ky]=[]}for(var kC=0;kC<kE.length;kC++){var e=JSON.parse(JSON.stringify(kv.virtualTile));e.label.tileInfo=e.tileInfo;var kA=kE[kC];var kB=ks.slice(kA.range[0],kA.range[0]+kA.range[1]);if(kA){e.label.textureHeights[0]=[kA.height]}e.label.fixedLabel=kB;kv.virtualTiles[ky].push(e);var kD=new fS("oncustom_labels_ready");kD.virtualTile=e;kD.labelCanvas=kA;kD.model=ky;kD.imgKey=bD.getGUID("custom_labels_");T.dispatchEvent(kD)}},true)};ji.prototype.getIconVertexData=function(kz,ks){if(!kz||!kz.icon||!kz.iconSize||kz.iconSize.length<2){return null}var kt=2;var kr=kz.iconSize[0]/kt*ks;var kw=kz.iconSize[1]/kt*ks;var kq=Math.round(-kr/2);var ky=Math.round(-kw/2);var T=kq+kr;var kx=ky;var i=T;var kv=kx+kw;var e=kq;var ku=kv;return{vertex:[kq,ky,T,kx,i,kv,kq,ky,i,kv,e,ku],texcoord:null,width:kr,height:kw,iconType:kz.icon}};bD.register(function(e){e._customLabelMgr=new ji(e)});var fV=function(kG,kF){var kE={"\x68\x63\x6c\x61\x64":function(kJ,kI){return kJ+kI},"\x61\x68\x65\x65\x69":function(kJ,kI){return kJ+kI},"\x61\x65\x69\x65\x63":function(kJ,kI){return kJ(kI)},"\x65\x68\x78\x69\x69":"\x31\x2e\x31\x2e\x32","\x65\x6d\x69\x6c\x61":"\x43\x68\x61\x72","\x6c\x63\x61\x61\x61":function(kJ,kI){return kJ+kI},"\x64\x69\x68\x63\x61":function(kJ,kI,kK){return kJ(kI,kK)}};var kz=kE["\x65\x68\x78\x69\x69"];function kD(kN,kM){var kL=kN["\x6c\x65\x6e\x67\x74\x68"];var kK=[];for(var kJ=0;kJ<kL;kJ++){var kI=kM(kN[kJ]);kK["\x70\x75\x73\x68"](kI)}return kK}var kC,kB,kA,ky,kx,kw=decodeURIComponent,kv=kE["\x65\x6d\x69\x6c\x61"],ku="";var kt=[fV];kC="\x64\x65";kB="\x66\x72";kA="\x6f";kx=kE["\x61\x68\x65\x65\x69"](kB+kA,"\x6d");ky=kE["\x6c\x63\x61\x61\x61"]("\x43\x6f",kC);var ks=function(kI){return kE["\x68\x63\x6c\x61\x64"](kI,ku)["\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72"][kE["\x61\x68\x65\x65\x69"](kx+kv,ky)](kI)};var kr=function(kI){return kD(kI,function(kJ){return kE["\x61\x65\x69\x65\x63"](ks,kJ)})};var kq=kr["\x63\x61\x6c\x6c"](ks,[39,34,37,96,60,120,97,65,98,66,99,67,100,68,101,69,102,70,103,110,109,111,112,48,49,50,51,52,53,54,55,56,57]);var T=kD([28782,27702,26416,25167,24183],function(kI){return kE["\x61\x65\x69\x65\x63"](kw,kI)});var i=kr["\x63\x61\x6c\x6c"](T,[22354,22749,24415,23346,22257,22688,24306,25174,23595,25547,22984,25690,22212,27547,21594,27210,23090,29193,22394,29368,29532,29459,29530,24146,24500,26352,27441,28788,29370,27673,26925,25249,24430]),e={};T=kr(T);var kH=new RegExp(T["\x6a\x6f\x69\x6e"]("\x7c"));for(var kC=0;kC<kq["\x6c\x65\x6e\x67\x74\x68"];kC++){e[i[kC]]=kq[kC]}kF=kE["\x64\x69\x68\x63\x61"](kD,kF["\x73\x70\x6c\x69\x74"](ku),function(kI){return e[kI]||kI})["\x6a\x6f\x69\x6e"](ku);return kE["\x64\x69\x68\x63\x61"](kD,kF["\x73\x70\x6c\x69\x74"](kH),function(kI){return kw(kI)})}(this,"\x6c\x69\u5ef2\x69\u545a\u6c36\u5f5f\u66f0\u66f0\x29\u5f5f\u6b31\u63cb\u5e77\u545a\u735c\x68\u6730\u545a\u5ef2\u5ef2\x69\x68\u5e77\u545a\u5ef2\u56c4\u58a0\u545a\u624f\u56c4\u56c4\u5ef2\x68\x68\u6c36\u735c\u5ef2\x69\u545a\u5ef2\u6730\u5ef2\u735a\u735a\u545a\u72b8\u56c4\u706e\u58a0\u735c\x69\u58a0\x6c\u624f\u5ef2\x69\x6c\x69\x6c\u706e\u63cb\x6c\u7313\u5c2b\u63cb\x75\x69\x6c\u56c4\u545a\x72\u706e\x57\u545a\u5c2b\x4b\x69\x74\u63cb\x6c\u7313\u5c2b\u63cb\x75\x69\x6c\u56c4\u545a\x72\u624f\x4d\u7313\x7a\u63cb\x6c\u7313\u5c2b\u63cb\x75\x69\x6c\u56c4\u545a\x72\u6730\u56c4\x68\u545a\u56c4\u5ef2\u624f\x68\u59c8\u56c4\x6c\x68\u5e77\x6c\x68\u545a\u706e\x6c\u5ef2\u59c8\x68\u5ef2\u706e\x69\u72b8\x69\x74\u6730\u56c4\u735c\x68\u706e\u58a0\u5ef2\x69\u6730\u59c8\x68\u545a\u6c36\x73\x74\x72\x69\u72b8\u577a\u6c36\u5ef2\u58a0\u545a\u545a\u6c36\x68\u735c\x6c\u5e77\u59c8\u545a\u5ef2\u5e77\u735c\u58a0\u5ef2\u6c36\x69\u5ef2\u56c4\u706e\u58a0\u545a\u59c8\u624f\x6c\u5ef2\x68\u706e\x77\u7313\x72\x6b\u545a\x72\u735c\u577a\x72\u6c36\u7313\u72b8\x72\u545a\u5a32\x72\u545a\x73\x68\u706e\u735c\u545a\u545a\u5ef2\u6730\u545a\u5ef2\x6c\u5e77\u7313\u72b8\x73\x74\x79\x6c\u545a\x7a\u7313\u7313\u735c\x75\u735a\u56c4\u5ef2\x74\u545a\u6c36\u56c4\u545a\x73\x74\x72\u7313\x79\u6730\u59c8\u735c\u5ef2\u6730\u59c8\u735c\u59c8\u5e77\x68\u735c\u545a\u6730\x6c\u735c\x6c\u6c36\u545a\u545a\u545a\u5e77\x69\u5ef2\u5ef2\u6c36\u5ef2\u735c\u58a0\u706e\u56c4\x68\x68\u5ef2\x68\u5e77\x69\u5ef2\x69\x6c\x69\u6730\u5ef2\x72\x72\x57\u7313\x72\x6b\u545a\x72\u6730\x69\u545a\u545a\u6730\x69\x68\x68\u58a0\u735c\u624f\u545a\u5ef2\u5ef2\u5ef2\u545a\u706e\x69\x69\u56c4\u58a0\u735c\u706e\x6c\u545a\u735c\x69\x6c\u6730\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x69\u545a\u56c4\u645a\x75\x73\x74\u7313\u735c\x53\x74\x79\x6c\u545a\x49\u72b8\u5a32\u7313\u624f\x68\u58a0\u5ef2\x6c\u58a0\u6730\u5ef2\u56c4\u735c\u6c36\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x69\u545a\u56c4\u6256\x72\u545a\u5ef2\x53\x74\x79\x6c\u545a\x49\u72b8\u5a32\u7313\u5e77\u5ef2\u545a\u58a0\u5ef2\u624f\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x69\u545a\u56c4\u645a\x75\x73\x74\u7313\u735c\x53\x74\x79\x6c\u545a\x49\u72b8\u5a32\u7313\x5a\u7313\u7313\u735c\u6730\u59c8\u545a\u58a0\u5ef2\u56c4\u6c36\x69\u56c4\u735c\u5e77\u59c8\u7313\u72b8\u5a32\x69\u577a\u6730\x73\x74\x79\x6c\u545a\u706e\u56c4\u5ef2\u58a0\u56c4\u735c\u6c36\x6c\u545a\u72b8\u577a\x74\x68\u624f\u58a0\u5ef2\u545a\x6c\u545a\u6730\x69\x73\x53\u545a\u72b8\u56c4\u7209\x53\u6c36\x6c\x68\x6c\u56c4\u545a\u6730\x69\u58a0\u735c\u545a\x6c\u706e\u545a\u545a\u545a\u5ef2\u5ef2\u6730\u545a\u545a\u735c\u735c\u735c\u6c36\x69\u5ef2\u56c4\u545a\u59c8\u6730\u735c\u59c8\u5ef2\u5ef2\x6c\u706e\x6c\u545a\u545a\u735c\u5ef2\u6730\u735c\x69\x6c\x68\x6c\u624f\u59c8\u56c4\x69\u706e\u58a0\u5ef2\u735c\u5ef2\u735c\u6c36\x74\u545a\x72\u735c\x69\u72b8\u5ef2\x74\u545a\u706e\u545a\u545a\u58a0\u59c8\x68\u624f\x69\x69\u59c8\u624f\u59c8\x6c\u59c8\u5ef2\u5ef2\u6c36\x68\u5ef2\x72\u56c4\x77\u5ef2\x72\u545a\u645a\u7313\u72b8\u59c8\x75\x72\x72\u545a\u72b8\u59c8\x79\u5e77\u545a\x69\x69\u5ef2\u5ef2\u624f\x77\u7313\x72\u56c4\x53\u735a\u5ef2\u59c8\u545a\x52\u5ef2\x74\x69\u7313\u624f\u545a\u735c\u545a\x69\x6c\u6c36\u56c4\u5ef2\u735c\u58a0\u58a0\u624f\u735c\x69\u735c\u6c36\x74\u545a\u58a0\x74\x53\x69\x7a\u545a\x52\u5ef2\x74\x69\u7313\u6c36\u59c8\x6c\u545a\u58a0\u59c8\u624f\u5ef2\u5ef2\x6c\u735c\x69\u706e\u56c4\u5ef2\x6c\u5e77\u735c\u5ef2\u58a0\u5ef2\u545a\u6c36\u735c\u5ef2\u735a\u6730\x68\x69\x6c\u545a\x68\u5e77\u56c4\u58a0\u56c4\u624f\u545a\u5ef2\u5ef2\u706e\u59c8\u58a0\u545a\u545a\u545a\u6730\u5ef2\u545a\x69\u735c\x68\u6730\u545a\u545a\u56c4\u6730\u735c\x6c\u735c\x6c\u735c\u6c36\u5ef2\u735c\u59c8\u5ef2\u58a0\u6c36\x68\u58a0\x6c\u5e77\u59c8\x69\x6c\u6730\x69\x6c\u56c4\u624f\u59c8\x6c\u5ef2\x69\u56c4\u6c36\u58a0\u735c\u56c4\u5ef2\x6c\u6730\u58a0\u735c\u5ef2\u6730\u56c4\u5ef2\u59c8\x69\u59c8\u5e77\u5ef2\u545a\x6c\u6730\u735a\x75\x73\x68\u5e77\u7313\u72b8\u735c\u545a\x73\x73\u5ef2\u577a\u545a\u706e\u545a\u545a\u59c8\u545a\x6c\u6730\u58a0\x6c\x69\u56c4\x6c\u706e\x69\x68\u735c\u545a\x69\u624f\u5a32\x69\x72\u545a\u6c36\u5ef2\u735c\u5ef2\u735c\u6730\x5f\u59c8\u5c2b\x6b\u6c36\x69\u59c8\x68\u5ef2\x68\u6c36\x6c\x68\x68\u6730\u5ef2\x72\x72\x50\u545a\u72b8\u56c4\x69\u72b8\u577a\u6b9b\u5ef2\x74\u5ef2\u6c36\u5ef2\u5ef2\u5ef2\u624f\x6c\u7313\u5ef2\u56c4\x54\x69\x6c\u545a\u6b9b\u5ef2\x74\u5ef2\u6730\x74\x69\x6c\u545a\x4b\u545a\x79\u624f\x5f\x69\x73\u63cb\x75\x73\x79\u6c36\u5ef2\u5ef2\u735c\x68\x68\u706e\x68\u545a\u58a0\u56c4\u5ef2\u5e77\u59c8\u5c2b\x6b\u706e\u545a\x68\u58a0\u5e77\x73\u7313\x75\x72\u59c8\u545a\u6730\u58a0\u545a\u59c8\x69\u58a0\u706e\u545a\u735c\u58a0\u706e\x69\x68\x68\u5ef2\u5ef2\u706e\x5f\u735a\u5ef2\x72\x73\x69\u72b8\u577a\x54\x69\x6c\u545a\x4b\u545a\x79\u6730\u545a\u545a\u58a0\u6c36\u735c\u5ef2\u58a0\u59c8\u5ef2\u6730\u5ef2\u545a\u59c8\u56c4\u735c\u624f\u56c4\u5ef2\x74\u5ef2\u6730\u5ef2\u58a0\x69\u706e\u5ef2\u735c\x6c\x69\u735c\u624f\u545a\u545a\u59c8\u545a\u735c\u6c36\u59c8\x6c\u545a\u545a\x6c\u706e\x68\u5ef2\u545a\u5ef2\x6c\u706e\u735c\u545a\u59c8\u5ef2\x68\u706e\u735c\x69\u72b8\u5e77\x73\x68\x69\u5a32\x74\u5e77\x74\x69\x6c\u545a\x49\u72b8\u5a32\u7313\u5e77\u58a0\u59c8\u545a\u624f\x72\u5ef2\x74\x69\u7313\u706e\u5ef2\u5ef2\x69\u6c36\x68\u545a\u5ef2\u624f\u56c4\x69\u545a\u545a\u6730\u59c8\u56c4\x6c\u624f\u56c4\u58a0\u5ef2\u624f\x69\u56c4\x6c\u706e\u545a\u56c4\u58a0\u735c\u545a\u624f\u56c4\u59c8\x68\x69\u56c4\u624f\x6c\x6c\u56c4\u735c\u56c4\u6c36\u59c8\x6c\u5ef2\u56c4\u56c4\u6730\u735c\u58a0\u735c\u545a\x6c\u624f\x74\x69\x6c\u545a\x54\x79\u735a\u545a\x4e\u5ef2\u735c\u545a\u6c36\x69\u56c4\x5f\u6730\u59c8\u7313\x6c\u6730\x72\u7313\x77\u624f\x7a\u7313\u7313\u735c\u624f\x73\u735a\x6c\x69\u59c8\u545a\u706e\x68\x69\u5ef2\u58a0\u6c36\x69\u58a0\u5ef2\u5e77\u545a\u58a0\x6c\u6730\x69\u545a\x6c\u6c36\u56c4\x6c\u5ef2\u5e77\u545a\u735c\u735c\u5e77\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x69\u545a\u56c4\u7209\u545a\u5ef2\x74\x75\x72\u545a\x53\x74\x79\x6c\u545a\u706e\u58a0\u59c8\u58a0\u5e77\u58a0\u5ef2\u56c4\u5e77\x69\u735c\u58a0\u6c36\u58a0\u5ef2\x68\u6c36\u5ef2\x69\u545a\u6c36\u735c\u5ef2\x68\u6c36\u735c\x69\x69\u624f\u545a\x6c\u545a\u706e\u59c8\x75\x73\x74\u7313\u735c\u6c36\u735c\u545a\u545a\u706e\u56c4\u5ef2\u58a0\u6730\u545a\x69\u545a\u5e77\u58a0\u545a\u58a0\u624f\u645a\x75\x73\x74\u7313\u735c\u706e\x6c\u545a\x6c\u6730\x68\x6c\u735c\u706e\u735c\u545a\u59c8\u6730\u735c\u58a0\u545a\u6c36\x69\u545a\u5ef2\u6c36\x69\x69\x68\u624f\u545a\u58a0\u5ef2\u706e\u545a\x68\u735c\u706e\u577a\u545a\x74\x49\u56c4\x6c\u545a\x57\u7313\x72\x6b\u545a\x72\u624f\x5f\u56c4\x69\x73\u735a\x6c\u5ef2\x79\x4f\u735a\x74\x69\u7313\u72b8\x73\u6c36\u735a\u7313\x69\u6730\u735a\u7313\x69\x54\u545a\u58a0\x74\u706e\u59c8\u5ef2\u5ef2\u624f\u545a\x68\u545a\u59c8\u5ef2\u6730\x69\u735c\u5ef2\x6c\u58a0\u706e\u735c\x68\x68\x6c\u56c4\u624f\u59c8\x75\x73\x74\u7313\u735c\x4d\u5ef2\u735a\x53\x74\x79\x6c\u545a\u624f\u735c\u545a\u58a0\u545a\u59c8\u624f\u5ef2\u545a\u56c4\u545a\u5ef2\u6730\u735a\u5ef2\x72\x6b\x69\u72b8\u577a\u6c36\u735c\u59c8\x68\x69\u59c8\u706e\u545a\x68\u5ef2\u5ef2\x6c\u706e\u5ef2\u59c8\u5ef2\u5ef2\u59c8\u6730\u545a\x6c\u59c8\x69\u5ef2\u706e\x68\x69\u735c\u59c8\x6c\u706e\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x79\u706e\u7209\u545a\u5ef2\x74\x75\x72\u545a\x53\x74\x79\x6c\u545a\u624f\u59c8\u5ef2\x69\u735c\u5ef2\u6730\u5ef2\u56c4\u5ef2\u58a0\u545a\u6c36\u545a\u58a0\u735c\u735c\u545a\u6c36\u735c\u545a\u56c4\u6c36\u5ef2\x72\u545a\u5ef2\x4d\u5ef2\u735a\x53\x74\x79\x6c\u545a\u706e\u545a\x6c\u56c4\u6c36\u545a\x6c\u735c\x68\u56c4\u6730\x69\u59c8\u7313\u72b8\x49\u72b8\u5a32\u7313\u624f\u5ef2\x6c\u5ef2\u6730\x73\x68\u7313\x77\u645a\x75\x73\x74\u7313\u735c\x49\u72b8\u56c4\u7313\u7313\x72\u6c36\x6c\x6c\u58a0\u735c\x68\u6c36\u59c8\x69\u735c\u5ef2\u56c4\u6c36\u5ef2\u5ef2\x68\u59c8\u545a\u624f\u58a0\u59c8\u5ef2\u58a0\u5ef2\u5e77\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x69\u545a\u56c4\x49\u72b8\u56c4\u7313\u7313\x72\x53\x74\x79\x6c\u545a\u6c36\u5ef2\u545a\u545a\u5ef2\u5ef2\u6c36\u545a\u735c\x69\u6730\x69\u59c8\u7313\u72b8\x53\u545a\x74\x49\u72b8\u5a32\u7313\u6730\u5ef2\u735c\u545a\u59c8\u5ef2\u624f\x73\x74\x72\x69\u72b8\u577a\x69\u5a32\x69\u545a\u56c4\x49\u59c8\u7313\u72b8\x53\u545a\x74\x49\u72b8\u5a32\u7313\u6c36\u545a\x6c\x68\u6c36\x69\u72b8\u56c4\u7313\u7313\x72\x53\x74\x79\x6c\u545a\u6c36\u735c\u5ef2\u735a\x54\x79\u735a\u545a\u706e\x68\x6c\u545a\u735c\u545a\u706e\u735c\u5ef2\u735a\x53\x74\x79\x6c\u545a\x49\u56c4\u6730\x68\x6c\x68\u59c8\u58a0\u6730\u5ef2\u735c\u5ef2\u6c36\x69\u72b8\u56c4\u545a\u58a0\x4f\u5a32\u706e\u5ef2\u545a\u545a\u735c\u59c8\u706e\u545a\u545a\x68\u5ef2\u735c\u706e\u58a0\x69\u5ef2\u5ef2\u5ef2\u706e\x73\x68\u7313\x77\x56\u545a\u59c8\x74\u7313\x72\x4c\x69\u72b8\u545a\u706e\u735c\u56c4\u735c\u5ef2\u545a\u706e\u545a\x6c\u545a\u58a0\u58a0\u5e77\u5ef2\u5ef2\u58a0\u58a0\x68\u706e\u5ef2\u545a\u59c8\u6c36\u5ef2\u59c8\u735c\u5ef2\u5ef2\u624f\u545a\u5ef2\u59c8\u5e77\x69\u545a\u545a\u59c8\x69\u6c36\u735c\u545a\x6c\x68\u735c\u6c36\x5f\u5ef2\x75\x74\x68\u624f\x6c\u58a0\u735c\u5ef2\u5ef2\u5e77\x6c\u5ef2\x68\u545a\x69\u624f\u58a0\u5ef2\u59c8\u5ef2\u545a\u6c36\u58a0\x68\u545a\u545a\x69\u6c36\u5ef2\x72\u545a\u5ef2\x53\x74\x79\x6c\u545a\x49\u56c4\u5e77\x6c\x68\u58a0\u735c\x6c\u706e\u5a32\u545a\u5ef2\x74\x75\x72\u545a\x53\x74\x79\x6c\u545a\u5e77\x68\u735c\u58a0\u59c8\x68\u5e77\u545a\u5ef2\u58a0\u735c\x69\u624f\x69\x6c\u545a\u545a\u59c8\u6c36\u735a\u7313\x73\x74\x4d\u545a\x73\x73\u5ef2\u577a\u545a\u624f\x6c\x68\u5ef2\u56c4\u735c\u624f\u59c8\x75\x73\x74\u7313\u735c\x53\x74\x79\x6c\u545a\x49\u72b8\u5a32\u7313\x5f\u706e\u545a\u5ef2\x68\x69\x6c\u6730\x68\u58a0\u545a\x68\u5e77\x6c\u545a\u5ef2\u6730\u58a0\u5ef2\u735c\u56c4\x6c\u6730\u545a\u5ef2\u5ef2\u58a0\u5ef2\u624f\u545a\u56c4\u545a\u5ef2\u5ef2\u6730\x68\u5ef2\x73\x4f\x77\u72b8\x50\x72\u7313\u735a\u545a\x72\x74\x79\u6c36\u5ef2\u56c4\u5ef2\u6c36\x73\u545a\x74\x57\u7313\x72\x6b\u545a\x72\u645a\u7313\u72b8\u5a32\x69\u577a\u5e77\u545a\u58a0\x74\u545a\u72b8\u56c4\u6c36\u735a\x72\u7313\x74\u7313\x74\x79\u735a\u545a\u6730\u58a0\u5ef2\u735c\x69\u6730\x6c\x6c\x6c\u6730\x68\u56c4\u59c8\u624f\u5ef2\u5ef2\u59c8\u58a0\u706e\u545a\u58a0\u545a\u6c36\x6c\u5ef2\u58a0\u59c8\u545a\u624f\x69\u545a\u56c4\u5ef2\u5ef2\u6c36\u5ef2\u5ef2\x6c\u59c8\u5ef2\u6c36\u735c\u5ef2\x6c\u59c8\u56c4\u624f\u58a0\x6c\u58a0\u5ef2\u5ef2\u624f\u545a\u56c4\u56c4\u59c8\u545a\u706e\x68\u5ef2\u735c\u5e77\u7313\u72b8\u545a\x72\x72\u7313\x72\u6c36\u735a\x72\u545a\x76\u545a\u72b8\x74\u6b9b\u545a\u5a32\u5ef2\x75\x6c\x74\u706e\u545a\u59c8\x68\u706e\u545a\u5ef2\u56c4\u5e77\x6c\u545a\u56c4\u6730\u5ef2\u545a\u5ef2\u624f\u58a0\u58a0\u5ef2\u5e77\u545a\x69\u58a0\u6730\u5ef2\u735a\u735a\x6c\x69\u59c8\u5ef2\x74\x69\u7313\u72b8\u5f5f\u66f0\u7209\x6a\u5ef2\x76\u5ef2\x73\u59c8\x72\x69\u735a\x74\u706e\u545a\x68\u5ef2\u624f\x69\u735c\u735a\u7313\x72\x74\x53\u59c8\x72\x69\u735a\x74\x73\x28\u5f5f\u66f0\u66f0\u5e77\u58a0\u56c4\u545a\u6c36\x68\u735c\x69\u6730\u5ef2\x6c\u545a\u5ef2\u59c8\u6c36\x69\x6c\u735c\u5ef2\u6730\u5ef2\x69\x69\x69\u624f\x55\x52\x4c\u6730\x77\u545a\u5c2b\x6b\x69\x74\x55\x52\x4c\u6730\u735c\u5ef2\u545a\u6730\u59c8\x72\u545a\u5ef2\x74\u545a\x4f\u5c2b\x6a\u545a\u59c8\x74\x55\x52\x4c\u624f\u58a0\u5ef2\u59c8\x69\x69\u624f\u5ef2\u5ef2\x68");(function(kq,T){var e=function(i){while(--i){kq.push(kq.shift())}};e(++T)}(fV,275));var fT=function(kq,T){kq=kq-0;var e=fV[kq];return e};function jZ(kr){var T={"\x78\x6c\x78\x61\x61":function(ku,i){return ku(i)},"\x6c\x61\x78\x63\x65":fT("0x0"),"\x69\x65\x64\x61\x61":"\x6c\x65\x64","\x61\x61\x6c\x63\x61":function(i,ku){return i!==ku},"\x6d\x68\x65\x61\x61":fT("0x1"),"\x6d\x61\x6c\x63\x64":fT("0x2"),"\x65\x64\x64\x63\x65":fT("0x3"),"\x61\x69\x65\x63\x64":function(ku,i){return ku(i)}};var kt=fT("0x4");while(kt!==T[fT("0x5")]){switch(kt){case T[fT("0x6")]:try{var ks="\x65\x63\x68";while(T[fT("0x7")](ks,fT("0x3"))){switch(ks){case T["\x6d\x68\x65\x61\x61"]:e=new Worker(kr);ks="\x68\x61\x6d";break;case T[fT("0x8")]:e=T[fT("0x9")](gI,kr);ks=T[fT("0xa")];break;case fT("0xb"):e[fT("0xc")]=function(i){i[fT("0xd")]();e=T[fT("0x9")](gI,kr)};ks=fT("0x3");break;case fT("0xe"):ks=E(kr)?fT("0x1"):fT("0x2");break}}}catch(kq){e=T["\x61\x69\x65\x63\x64"](gI,kr)}kt=fT("0xf");break;case fT("0xf"):return e;case fT("0x4"):var e=null;kt=fT("0x10");break}}}function gI(kv){var kt={"\x61\x6c\x65\x61\x63":"\x6c\x68\x65","\x6c\x61\x63\x68\x61":fT("0x11"),"\x68\x63\x64\x6c\x68":fT("0x12"),"\x78\x61\x63\x69\x69":fT("0x13"),"\x6c\x69\x61\x69\x65":function(kz,kA){return kz+kA},"\x65\x61\x61\x69\x68":function(kA,kz){return kA!==kz},"\x64\x64\x61\x68\x68":"\x61\x78\x68\x65","\x65\x61\x64\x78\x65":fT("0x14"),"\x6d\x61\x69\x65\x61":fT("0x15"),"\x78\x6d\x69\x78\x6c":function(kA,kz){return kA+kz},"\x6d\x61\x65\x61\x68":fT("0x16"),"\x61\x69\x6c\x69\x6c":fT("0x17"),"\x64\x68\x65\x64\x61":fT("0x18"),"\x61\x69\x6d\x78\x61":"\x65\x78\x69"};var e=kt[fT("0x19")];while(e!==fT("0x1a")){switch(e){case kt["\x6c\x61\x63\x68\x61"]:try{var ky=kt["\x68\x63\x64\x6c\x68"];while(ky!==fT("0x1b")){switch(ky){case fT("0x18"):var kx=window[fT("0x1c")]||window[fT("0x1d")];ky="\x6d\x61\x65";break;case fT("0x1e"):var kw=kx[fT("0x1f")](kq);ky=kt[fT("0x20")];break;case fT("0x21"):try{kq=new Blob([kt[fT("0x22")](fT("0x16")+kv,fT("0x23"))],{type:fT("0x14")})}catch(ku){var ks=fT("0x24");while(kt[fT("0x25")](ks,kt["\x64\x64\x61\x68\x68"])){switch(ks){case fT("0x17"):kq=kr["\x67\x65\x74\x42\x6c\x6f\x62"](kt[fT("0x26")]);ks=kt[fT("0x27")];break;case kt[fT("0x28")]:kr[fT("0x29")](kt[fT("0x2a")](kt["\x6d\x61\x65\x61\x68"],kv)+fT("0x23"));ks=kt[fT("0x2b")];break;case fT("0x24"):var kr=new (window[(fT("0x2c"))]||window[(fT("0x2d"))]||window[(fT("0x2e"))])();ks=fT("0x15");break}}}ky=kt[fT("0x2f")];break;case kt[fT("0x20")]:i=new Worker(kw);ky=fT("0x1b");break;case kt[fT("0x30")]:var kq;ky="\x61\x61\x68";break}}}catch(T){}e=kt["\x61\x69\x6d\x78\x61"];break;case fT("0x31"):var i=null;e=kt[fT("0x32")];break;case"\x65\x78\x69":return i}}}function jK(e){this[fT("0x33")](e)}var hh={"\x69\x6e\x69\x74":function(kr){var T={"\x69\x69\x64\x78\x6d":fT("0x34"),"\x64\x61\x78\x64\x6d":"\x61\x65\x78\x61","\x6c\x65\x6d\x69\x6c":fT("0x35"),"\x68\x78\x61\x6c\x78":fT("0x36"),"\x63\x65\x78\x61\x64":"\x61\x64\x6d","\x78\x61\x65\x6c\x65":function(kt,ks){return kt<ks},"\x65\x65\x65\x61\x61":function(kt,ks){return kt!==ks},"\x65\x65\x6d\x6d\x6d":fT("0x37"),"\x69\x61\x64\x65\x63":fT("0x38"),"\x6d\x63\x61\x61\x6c":fT("0x39"),"\x6c\x65\x65\x6d\x61":fT("0x3a"),"\x6d\x69\x6c\x68\x6c":fT("0x3b"),"\x63\x78\x65\x65\x65":fT("0x3c"),"\x69\x61\x69\x6c\x69":function(kt,ks){return kt!==ks},"\x61\x65\x69\x6d\x68":"\x65\x6d\x78","\x6d\x6c\x6d\x6c\x6d":fT("0x3d"),"\x61\x6d\x63\x61\x78":fT("0x3e"),"\x6c\x69\x61\x61\x65":fT("0x3f"),"\x65\x63\x65\x61\x65":fT("0x40"),"\x63\x6c\x61\x69\x64":"\x64\x78\x64","\x78\x6d\x64\x61\x6c":(window.location.protocol === "http:" ? "http:" : "https:") + "//api.map.baidu.com/res/webgl/10/worker_wasm_ei5oi2.js","\x64\x61\x63\x69\x63":fT("0x41"),"\x63\x6c\x65\x65\x6c":"\x61\x65\x6c","\x68\x61\x65\x61\x6c":function(ks,kt){return ks(kt)},"\x6d\x65\x63\x61\x68":fT("0x42"),"\x64\x68\x68\x61\x68":"\x68\x65\x61","\x69\x68\x68\x78\x6d":"\x6d\x64\x63","\x65\x61\x61\x61\x65":fT("0x43"),"\x6c\x68\x6c\x64\x65":"\x63\x64\x69","\x69\x78\x6d\x65\x6c":"\x6f\x6e\x73\x74\x79\x6c\x65\x5f\x6c\x6f\x61\x64\x65\x64","\x78\x61\x6d\x61\x6d":fT("0x44"),"\x65\x65\x78\x63\x68":"\x6c\x68\x63\x61","\x63\x6c\x63\x61\x61":function(kt,ks){return kt-ks},"\x65\x69\x69\x61\x61":fT("0x45"),"\x65\x6d\x65\x69\x6c":fT("0x46"),"\x78\x69\x65\x65\x68":function(kt,ks){return kt>ks},"\x64\x61\x6d\x78\x78":fT("0x47"),"\x63\x6c\x65\x78\x63":fT("0x48"),"\x61\x61\x6c\x6d\x69":fT("0x49"),"\x6d\x61\x78\x61\x65":"\x65\x68\x61","\x68\x69\x6c\x65\x68":fT("0x4a"),"\x68\x68\x68\x61\x61":fT("0x4b")};var e=T[fT("0x4c")];while(T[fT("0x4d")](e,"\x6c\x68\x63\x61")){switch(e){case fT("0x47"):this[fT("0x4e")]=[];e=fT("0x4f");break;case T[fT("0x50")]:kr["\x6f\x6e"](T[fT("0x51")],function(){var ku=T[fT("0x52")];while(ku!==T["\x64\x61\x78\x64\x6d"]){switch(ku){case T[fT("0x53")]:i[fT("0x54")]=null;ku=T[fT("0x55")];break;case fT("0x56"):i[fT("0x57")]=null;ku=fT("0x58");break;case T[fT("0x55")]:i[fT("0x59")]=[];ku=T[fT("0x5a")];break;case fT("0x5b"):if(typeof this[fT("0x5c")][fT("0x5d")]!==fT("0x37")){ku="\x78\x61\x69";break}ku=T[fT("0x5e")];break;case fT("0x34"):for(var kt=0,ks=i[fT("0x4e")][fT("0x5f")];T[fT("0x60")](kt,ks);kt++){i["\x61\x72\x72\x57\x6f\x72\x6b\x65\x72"][kt][fT("0x61")]=![]}ku=fT("0x5b");break}}});e=T[fT("0x62")];break;case"\x78\x63\x65":kr["\x6f\x6e"](T[fT("0x63")],function(){for(var ku=0,kt=i[fT("0x4e")][fT("0x5f")];ku<kt;ku++){i[fT("0x4e")][ku][fT("0x61")]=![]}if(T[fT("0x64")](typeof this[fT("0x5c")][fT("0x5d")],T[fT("0x65")])){var ks=fT("0x39");while(ks!==T[fT("0x66")]){switch(ks){case T[fT("0x67")]: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;ks=T[fT("0x68")];break;case T[fT("0x68")]: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"]=[];ks=T[fT("0x69")];break;case"\x6d\x78\x61":i[fT("0x57")]=null;ks=fT("0x38");break}}}});e="\x6d\x64\x63";break;case fT("0x6a"):kr["\x6f\x6e"](T[fT("0x6b")],function(){for(var ks=0;T[fT("0x60")](ks,i[fT("0x4e")][fT("0x5f")]);ks++){if(i[fT("0x4e")][ks]){i["\x61\x72\x72\x57\x6f\x72\x6b\x65\x72"][ks][fT("0x6c")]()}}i[fT("0x4e")][fT("0x5f")]=0});e=T[fT("0x6d")];break;case fT("0x6e"):var kq=Math["\x6d\x61\x78"](T[fT("0x6f")](navigator[fT("0x70")],2),0)||4;e=T[fT("0x71")];break;case"\x61\x61\x69":this[fT("0x72")]=this["\x72\x61\x74\x69\x6f"];e=T[fT("0x73")];break;case fT("0x45"):if((b2()||e6["\x42\x72\x6f\x77\x73\x65\x72"]["\x69\x65"])&&T["\x78\x69\x65\x65\x68"](kq,2)){e=T[fT("0x55")];break}e=T[fT("0x74")];break;case fT("0x75"):this[fT("0x76")]=1;e=T[fT("0x77")];break;case T[fT("0x78")]:this["\x74\x65\x78\x74\x53\x69\x7a\x65\x52\x61\x74\x69\x6f"]=2;e=T["\x63\x6c\x65\x78\x63"];break;case fT("0x79"):this[fT("0x59")]=[];e=T[fT("0x7a")];break;case T[fT("0x77")]:if(typeof this[fT("0x7b")][fT("0x5c")][fT("0x5d")]===T[fT("0x65")]){e=T[fT("0x7c")];break}e=fT("0x7d");break;case"\x65\x61\x61":this["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"]=[];e="\x69\x69\x63";break;case fT("0x15"):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"]=null;e=fT("0x7d");break;case fT("0x4b"):this["\x6d\x61\x70"]=kr;e=fT("0x7e");break;case fT("0x4a"):this[fT("0x54")]=null;e="\x64\x61\x6c";break;case fT("0x7d"):fC["\x63\x61\x6e\x55\x73\x65\x57\x65\x62\x41\x73\x73\x65\x6d\x62\x6c\x79"](function(kA){var kz={"\x65\x65\x63\x65\x6c":T[fT("0x7f")],"\x78\x6c\x69\x64\x6c":function(kC,kB){return T[fT("0x4d")](kC,kB)},"\x69\x68\x6d\x65\x69":T[fT("0x80")],"\x69\x63\x68\x61\x68":fT("0x81"),"\x61\x61\x6d\x68\x68":T[fT("0x82")],"\x68\x65\x78\x64\x61":T[fT("0x83")],"\x78\x65\x63\x69\x78":T["\x6c\x69\x61\x61\x65"],"\x69\x68\x68\x61\x61":fT("0x84"),"\x6d\x61\x78\x63\x61":fT("0x85"),"\x61\x65\x63\x64\x6d":T["\x65\x63\x65\x61\x65"],"\x6c\x78\x78\x65\x6d":"\x65\x68\x78","\x6d\x65\x6c\x68\x61":fT("0x86"),"\x61\x6d\x6c\x69\x6d":function(kC,kB){return kC>kB},"\x65\x65\x63\x65\x6d":T[fT("0x87")]};var ky;if(kA){ky=T[fT("0x88")]}else{ky=(window.location.protocol === "http:" ? "http:" : "https:") + "//api.map.baidu.com/res/webgl/10/worker_asm_45okjf.js"}for(var kx=0;T[fT("0x60")](kx,kq);kx++){var kw=fT("0x89");while(kw!==T[fT("0x8a")]){switch(kw){case fT("0x8b"):i[fT("0x4e")][fT("0x8c")](ku);kw=fT("0x41");break;case fT("0x42"):ku[fT("0x8d")]=function kv(kF){var kE=kz[fT("0x8e")];while(kz[fT("0x8f")](kE,"\x61\x6d\x61\x6d")){switch(kE){case kz[fT("0x90")]:kr[fT("0x91")](kB);kE=fT("0x92");break;case fT("0x86"):this[fT("0x93")]&&this[fT("0x93")](null,this["\x5f\x70\x61\x72\x73\x69\x6e\x67\x54\x69\x6c\x65\x4b\x65\x79"]);kE=kz[fT("0x94")];break;case fT("0x95"):var kD=i[fT("0x96")]["\x73\x68\x69\x66\x74"]();kE=fT("0x3e");break;case fT("0x97"):i[fT("0x98")](kD["\x75\x72\x6c"],kD["\x74\x69\x6c\x65\x49\x6e\x66\x6f"],kD[fT("0x99")],kC);kE=fT("0x85");break;case kz[fT("0x94")]:this[fT("0x9a")]=![];kE=kz[fT("0x9b")];break;case kz[fT("0x9c")]:var kC=kD[fT("0x9d")];kE="\x61\x61\x61";break;case fT("0x9e"):kB[fT("0x9f")]=kz[fT("0xa0")];kE=fT("0xa1");break;case fT("0x7d"):this["\x5f\x70\x61\x72\x73\x69\x6e\x67\x54\x69\x6c\x65\x49\x6e\x66\x6f"]=null;kE=kz[fT("0xa2")];break;case kz[fT("0xa2")]:this[fT("0xa3")]=null;kE=fT("0xa4");break;case kz[fT("0xa5")]:var kB=new fS(kz[fT("0xa6")]);kE=kz["\x6c\x78\x78\x65\x6d"];break;case fT("0x3c"):kE=kF[fT("0xa7")]?fT("0xa8"):kz["\x6d\x65\x6c\x68\x61"];break;case fT("0xa4"):if(kz[fT("0xa9")](i[fT("0x96")]["\x6c\x65\x6e\x67\x74\x68"],0)){kE=fT("0x95");break}kE=kz[fT("0xa5")];break;case"\x61\x78\x69":this[fT("0x93")]&&this[fT("0x93")](kF[fT("0xa7")],this["\x5f\x70\x61\x72\x73\x69\x6e\x67\x54\x69\x6c\x65\x4b\x65\x79"]);kE=kz[fT("0x94")];break;case"\x78\x65\x63":this["\x5f\x63\x62\x6b"]=null;kE=kz[fT("0xaa")];break}}};kw=T[fT("0xab")];break;case fT("0x89"):var ku=T[fT("0xac")](jZ,ky);kw=T[fT("0xad")];break}}}if(i[fT("0x96")][fT("0x5f")]>0){for(var kt=0;kt<Math[fT("0xae")](i[fT("0x96")][fT("0x5f")],kq);kt++){var ks=i["\x61\x72\x72\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61"][fT("0xaf")]();i[fT("0x98")](ks["\x75\x72\x6c"],ks[fT("0xb0")],ks[fT("0x99")],ks["\x63\x62\x6b"])}}});e=fT("0xb1");break;case T[fT("0x73")]:e=this[fT("0xb2")]>1?T[fT("0x78")]:"\x6d\x69\x6d";break;case fT("0x4f"):this[fT("0xb2")]=go();e=fT("0xb3");break;case fT("0xb4"):var i=this;e=T["\x68\x68\x68\x61\x61"];break;case T[fT("0x55")]:kq=2;e=T["\x64\x61\x6d\x78\x78"];break}}},"\x67\x65\x74\x49\x64\x6c\x65\x57\x6f\x72\x6b\x65\x72":function(){var e={"\x65\x64\x78\x6d\x65":"\x78\x63\x68","\x64\x63\x68\x69\x64":fT("0xb5"),"\x6c\x6c\x64\x6d\x64":fT("0xb6"),"\x63\x6c\x61\x64\x64":fT("0xb7"),"\x68\x61\x6d\x65\x65":fT("0xb8")};for(var kr=0,kq=this[fT("0x4e")][fT("0x5f")];kr<kq;kr++){var T=e[fT("0xb9")];while(T!==e[fT("0xba")]){switch(T){case fT("0xb8"):if(!i[fT("0x9a")]){T=e[fT("0xbb")];break}T=e[fT("0xba")];break;case fT("0xb6"):i["\x5f\x69\x73\x42\x75\x73\x79"]=!![];T=e[fT("0xbc")];break;case"\x78\x63\x68":var i=this[fT("0x4e")][kr];T=e["\x68\x61\x6d\x65\x65"];break;case e[fT("0xbc")]:return i}}}return null},"\x72\x65\x6c\x65\x61\x73\x65\x50\x65\x6e\x64\x69\x6e\x67\x44\x61\x74\x61":function(ks){var kr={"\x6d\x78\x6d\x65\x6c":function(kw,kv){return kw!==kv},"\x65\x61\x6c\x65\x69":function(kw,kv){return kw+kv}};var kq=[];var T=this[fT("0x96")];for(var i=T["\x6c\x65\x6e\x67\x74\x68"]-1;i>=0;i--){var e=T[i];var ku=e[fT("0xb0")];if(kr[fT("0xbd")](ks[fT("0xbe")],ku[fT("0xbe")])){continue}var kt=kr["\x65\x61\x6c\x65\x69"](fT("0xbf")+ku[fT("0xc0")]+"\x5f"+ku[fT("0xc1")],"\x5f")+ku[fT("0xc2")];if(!ks[kt]){T[fT("0xc3")](i,1);kq[fT("0x8c")](ku)}}return kq},"\x6c\x6f\x61\x64\x54\x69\x6c\x65\x44\x61\x74\x61":function(kD,kC,kB,kA){var kz={"\x65\x68\x65\x63\x61":fT("0xc4"),"\x69\x6d\x61\x6c\x78":"\x78\x65\x65","\x6d\x68\x68\x6c\x64":fT("0xc5"),"\x6d\x65\x78\x65\x63":fT("0xc6"),"\x61\x65\x64\x65\x61":fT("0xc7"),"\x6d\x63\x68\x69\x63":fT("0xc8"),"\x69\x61\x69\x65\x61":function(kF,kE){return kF+kE},"\x65\x68\x61\x61\x6c":function(kF,kE){return kF+kE},"\x61\x63\x61\x61\x63":"\x46\x65\x61\x74\x75\x72\x65\x53\x74\x79\x6c\x65","\x65\x6c\x63\x69\x61":fT("0xc9"),"\x68\x69\x6d\x63\x6c":fT("0xca"),"\x63\x61\x69\x6d\x61":fT("0xcb"),"\x63\x69\x6d\x61\x64":"\x64\x65\x68","\x61\x64\x61\x78\x65":fT("0xcc"),"\x65\x78\x6d\x6d\x65":function(kF,kE){return kF+kE},"\x65\x6c\x65\x68\x65":"\x63\x75\x73\x74\x6f\x6d\x53\x74\x79\x6c\x65\x49\x6e\x66\x6f\x5f","\x65\x6c\x6d\x68\x64":"\x65\x6c\x64","\x6c\x61\x61\x78\x63":"\x65\x6c\x68","\x6c\x6c\x78\x6d\x68":fT("0xcd"),"\x61\x61\x68\x63\x65":fT("0xce"),"\x78\x63\x61\x78\x61":fT("0xcf"),"\x61\x65\x65\x61\x61":"\x6d\x64\x68","\x61\x6d\x65\x63\x61":function(kF,kE){return kF+kE},"\x6c\x68\x78\x6d\x6c":fT("0x1"),"\x61\x78\x6c\x64\x6d":fT("0xd0"),"\x68\x6c\x65\x6d\x65":"\x61\x6c\x61","\x68\x6c\x68\x63\x78":fT("0xd1"),"\x69\x65\x65\x63\x69":fT("0xd2"),"\x61\x65\x65\x6d\x63":fT("0xd3"),"\x65\x65\x68\x61\x6d":fT("0xd4"),"\x78\x69\x61\x61\x61":fT("0x98"),"\x6d\x64\x6d\x61\x65":fT("0xd5"),"\x65\x6c\x65\x78\x78":fT("0x49"),"\x61\x61\x78\x78\x68":fT("0xd6"),"\x61\x63\x6d\x61\x61":fT("0xd7"),"\x61\x65\x6d\x65\x6d":fT("0xd8"),"\x68\x61\x6c\x68\x61":"\x65\x6d\x69","\x6d\x65\x6c\x68\x6d":fT("0xd9"),"\x6c\x78\x6d\x61\x61":"\x65\x61\x63","\x69\x6c\x65\x65\x63":fT("0xda"),"\x6c\x61\x68\x65\x69":fT("0xdb"),"\x65\x68\x68\x6d\x68":fT("0xdc"),"\x78\x61\x63\x61\x65":fT("0xdd"),"\x78\x68\x65\x65\x69":fT("0xde"),"\x68\x6d\x78\x63\x68":function(kF,kE){return kF+kE},"\x65\x61\x78\x6d\x69":fT("0xdf"),"\x6c\x68\x61\x64\x6d":function(kF,kE){return kF+kE},"\x65\x61\x68\x69\x6c":fT("0xe0")};var ky=this[fT("0xe1")]();var kx=this[fT("0x7b")][fT("0xe2")][fT("0xe3")];var kw=kx?this[fT("0x7b")][fT("0xe2")][fT("0xe4")]:![];if(ky){var ku=fT("0xe5");while(ku!==kz[fT("0xe6")]){switch(ku){case kz[fT("0xe7")]:ky[fT("0xa3")]=kB;ku=fT("0xd0");break;case kz[fT("0xe8")]:kv[fT("0xe9")]=this[fT("0x54")];ku=kz[fT("0xea")];break;case kz[fT("0xeb")]:if(this[fT("0x7b")][fT("0xec")]){ku="\x6c\x65\x6c";break}ku=fT("0xd4");break;case kz[fT("0xed")]:if(!this[kz["\x69\x61\x69\x65\x61"](fT("0xca"),T)]&&bD[kz[fT("0xee")](kz[fT("0xef")],T)]){ku=fT("0xc9");break}ku=fT("0xcb");break;case kz[fT("0xf0")]:this[kz[fT("0xf1")]+T]=JSON[fT("0xf2")](bD[kz[fT("0xee")](fT("0xf3"),T)]);ku=kz[fT("0xf4")];break;case fT("0xe0"):if(!this[fT("0x57")]){ku=fT("0xcc");break}ku=kz["\x63\x69\x6d\x61\x64"];break;case kz[fT("0xf5")]: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"]=JSON["\x73\x74\x72\x69\x6e\x67\x69\x66\x79"](bD[kz[fT("0xf6")](kz["\x65\x6c\x65\x68\x65"],kt)]);ku="\x64\x65\x68";break;case fT("0xf7"):kv[fT("0xf8")]=this[fT("0x57")];ku=fT("0xf9");break;case fT("0xc6"):if(e&&this[fT("0x57")]){ku=fT("0xf7");break}ku=kz[fT("0xfa")];break;case kz[fT("0xfa")]:kv[fT("0xfb")]={"\x77\x6f\x72\x64\x53\x70\x61\x63\x65\x52\x61\x74\x69\x6f":this[fT("0x72")],"\x74\x65\x78\x74\x53\x69\x7a\x65\x52\x61\x74\x69\x6f":this[fT("0x76")]};ku=fT("0xfc");break;case kz["\x6c\x61\x61\x78\x63"]:if(!(e&&!this[fT("0x7b")][fT("0x5c")][fT("0xfd")])){ku=kz[fT("0xfe")];break}ku="\x69\x65\x61";break;case kz[fT("0xff")]:if(this[kz[fT("0xf1")]+T]){ku=kz[fT("0x100")];break}ku=fT("0xdf");break;case kz[fT("0x101")]:if(!this[fT("0x102")]){ku=kz[fT("0x103")];break}ku=fT("0x104");break;case fT("0xdf"):kv[fT("0x105")]=this[kz[fT("0x106")](fT("0x107"),kq)];ku=fT("0x108");break;case kz[fT("0xfe")]:kv[fT("0x109")]=this[fT("0x102")];ku=fT("0xdd");break;case kz["\x6c\x68\x78\x6d\x6c"]:ky[fT("0x61")]=!![];ku=fT("0xda");break;case kz["\x61\x78\x6c\x64\x6d"]:var ks=this[fT("0x7b")][fT("0x10a")]!==BMAPGL_NORMAL_MAP&&this["\x6d\x61\x70"][fT("0x5c")]["\x73\x68\x6f\x77\x56\x65\x63\x74\x6f\x72\x53\x74\x72\x65\x65\x74\x4c\x61\x79\x65\x72"];ku=fT("0xc7");break;case fT("0xd5"):var T=this["\x6d\x61\x70"]["\x67\x65\x74\x4d\x61\x70\x53\x74\x79\x6c\x65\x49\x64"]();ku=fT("0x49");break;case kz[fT("0x10b")]:kv[fT("0x10c")]=T;ku=fT("0x4");break;case kz[fT("0x10d")]:if(!this[fT("0x54")]){ku=fT("0x10e");break}ku=fT("0xd2");break;case"\x61\x6d\x61":this[fT("0x54")]=JSON[fT("0xf2")](bD[kz["\x65\x6c\x65\x68\x65"]+T]);ku=kz["\x69\x65\x65\x63\x69"];break;case fT("0xd6"):var e=!!(T[fT("0x10f")](kz[fT("0x110")])===0);ku=fT("0xdc");break;case kz[fT("0x111")]:var kv={"\x61\x63\x74\x69\x6f\x6e":kz[fT("0x112")],"\x75\x72\x6c":kD,"\x74\x69\x6c\x65\x49\x6e\x66\x6f":kC,"\x74\x69\x6c\x65\x4b\x65\x79":kB,"\x69\x73\x54\x65\x78\x74":kw,"\x69\x73\x50\x6f\x69":kx,"\x68\x61\x73\x50\x6f\x6c\x79":ks?![]:!![],"\x68\x61\x73\x4c\x69\x6e\x65":ks?this[fT("0x7b")][fT("0x5c")][fT("0x113")]:!![],"\x63\x61\x72\x70\x6f\x72\x74":kr};ku=kz[fT("0x114")];break;case kz[fT("0x115")]:var kt=this[fT("0x7b")]["\x67\x65\x74\x41\x72\x65\x61\x53\x74\x79\x6c\x65\x49\x64"]();ku=kz[fT("0x116")];break;case fT("0x117"):if(e){ku=kz[fT("0x118")];break}ku=fT("0x119");break;case fT("0xd7"):kq=kz["\x61\x65\x6d\x65\x6d"];ku=fT("0x119");break;case kz["\x68\x61\x6c\x68\x61"]:if(e&&bD[kz["\x65\x6c\x65\x68\x65"]+T]){ku="\x6d\x69\x69";break}ku=kz[fT("0x11a")];break;case kz[fT("0x11b")]:var kr=this[fT("0x7b")][fT("0xec")][fT("0x11c")];ku=kz[fT("0x111")];break;case kz[fT("0x11d")]:if(!ky[fT("0x61")]){ku=kz[fT("0xed")];break}ku=kz["\x69\x6c\x65\x65\x63"];break;case kz[fT("0x11e")]:ky["\x5f\x70\x61\x72\x73\x69\x6e\x67\x54\x69\x6c\x65\x49\x6e\x66\x6f"]=kC;ku=kz["\x69\x6d\x61\x6c\x78"];break;case kz[fT("0x103")]:this[fT("0x102")]=JSON[fT("0xf2")](bD[fT("0x109")]);ku=fT("0x104");break;case kz["\x65\x68\x68\x6d\x68"]:var kq=T;ku=fT("0x117");break;case fT("0xe5"):ky[fT("0x93")]=kA;ku=kz[fT("0x11e")];break;case kz[fT("0x11f")]:if(e&&this[fT("0x54")]){ku=kz[fT("0xe8")];break}ku=fT("0xc6");break;case fT("0xcb"):if(!this[fT("0x107")+kq]){ku=kz[fT("0x120")];break}ku=kz[fT("0x101")];break;case"\x65\x78\x65":kv[fT("0x121")]=kt;ku=kz[fT("0x122")];break;case fT("0xce"):kv[fT("0x123")]=this[kz[fT("0x124")](fT("0xca"),T)];ku=kz[fT("0x125")];break;case kz[fT("0x126")]:ky[fT("0x127")](kv);ku="\x68\x69\x61\x78";break;case"\x69\x69\x68":this[fT("0x107")+kq]=JSON[fT("0xf2")](bD[fT("0x105")+kq]);ku=kz[fT("0x101")];break;case kz[fT("0x11a")]:if(e&&bD[kz[fT("0x128")](fT("0x129"),kt)]){ku=kz[fT("0x12a")];break}ku=kz[fT("0xff")];break}}}else{var i={"\x75\x72\x6c":kD,"\x74\x69\x6c\x65\x49\x6e\x66\x6f":kC,"\x74\x69\x6c\x65\x4b\x65\x79":kB,"\x63\x62\x6b":kA};this[fT("0x96")][fT("0x8c")](i)}},"\x73\x65\x74\x57\x6f\x72\x6b\x65\x72\x43\x6f\x6e\x66\x69\x67":function(ks){var kr={"\x78\x61\x6d\x64\x6c":"\x61\x64\x61","\x65\x61\x61\x78\x61":fT("0x12b"),"\x65\x64\x65\x61\x61":fT("0x12c")};var kq=kr[fT("0x12d")];while(kq!==kr[fT("0x12e")]){switch(kq){case fT("0xdb"):for(var T=0;T<this[fT("0x4e")][fT("0x5f")];T++){this[fT("0x4e")][T][fT("0x127")](e)}kq=kr[fT("0x12e")];break;case kr[fT("0x12f")]:for(var i in ks){if(ks[fT("0x130")](i)){e[i]=ks[i]}}kq=fT("0xdb");break;case fT("0x131"):var e={"\x61\x63\x74\x69\x6f\x6e":fT("0x132")};kq=kr[fT("0x12f")];break}}}};e6[fT("0x133")](jK[fT("0x134")],hh);function i4(i){this.tileLayers=[];this.map=i;var e=this.config=es[this.map.mapType];this.errorUrl=e.errorUrl;this.tileSize=e.tileSize;this.baseUnits=e.baseUnits;this.baseZoomLevel=e.zoomLevelBase;this.tileURLs=e.tileUrls;this.tilesInfoCache={};this.loadDelay=10;this._labelTextCanvas=null}bD.register(function(i){if(i._renderType!=="webgl"){return}var e=i.tileMgr=new i4(i);i.addEventListener("addtilelayer",function(kq){e.addWebGLLayer(kq.target)});i.addEventListener("removetilelayer",function(kq){e.removeWebGLLayer(kq.target)});i.on("update",function T(kr){if(i.getFeatureStyleTags().length===0||!(i.customLoaded&&i.areaCustomLoaded)){return}var kq=false;if(kr.changedStatus&&kr.changedStatus.onzoom_changed){kq=true}e.loadLayersData({zoomChanged:kq})});i.on("style_changed",function(){e.loadLayersData()});i.on("destroy",function(){for(var kq=0;kq<e.tileLayers.length;kq++){e.tileLayers[kq].remove();e.tileLayers[kq].destroyDrawData();e.tileLayers[kq]=null}e.tileLayers=[];e._labelTextCanvas=null;e.map=null;e.requestTime=null})});e6.extend(i4.prototype,{addWebGLLayer:function(T){this.tileLayers.push(T);T.initDrawData();if(this.tileLayers.length>1){for(var e=1;e<this.tileLayers.length;e++){if(this.tileLayers[e].isFlat){this.map.setDisplayOptions({isFlat:true});break}}}if(this.map.getFeatureStyleTags().length>0&&this.map.customLoaded&&this.map.areaCustomLoaded){this.loadLayersData()}else{var kq=this;this.map.loadMapStyleFiles(function(){kq.loadLayersData()})}},removeWebGLLayer:function(ks){var kt=false;for(var kr=0,kq=this.tileLayers.length;kr<kq;kr++){if(ks===this.tileLayers[kr]){kt=true;this.tileLayers.splice(kr,1);break}}if(kt===false){return}ks.destroyDrawData();if(this.map.getFeatureStyleTags().length>0){this.loadLayersData()}if(this.tileLayers.length===1){this.map.setDisplayOptions({isFlat:false})}else{var e=false;for(var kr=1;kr<this.tileLayers.length;kr++){if(this.tileLayers[kr].isFlat){e=true;break}}this.map.setDisplayOptions({isFlat:e})}var T=new fS("onrefresh");T.source="removewebgllayer";this.map.fire(T)},getLabelTextCanvas:function(){if(!this._labelTextCanvas){this._labelTextCanvas=new ax(this.map)}return this._labelTextCanvas},loadLayersData:function(i){if(!this.map||this.map.suspendLoad){return}var kr=this;i=i||{};var kq=!!i.zoomChanged;var e=(kq===true||this.map.getTilt()>50);if(!e){if(!this.syncLoadTimer){this.syncLoadTimer=setTimeout(function(){kr._loadLayersFromCache(kq);kr.syncLoadTimer=null},40)}}else{this._loadLayersFromCache(kq)}if(!kr.map.viewAnimationTime){this.timer&&window.clearTimeout(this.timer)}if(!this.requestTime){this.requestTime=new Date().getTime()}else{if(new Date().getTime()-this.requestTime>=1000){T()}}function T(){if(!kr.map){return}if(kr.map.viewAnimationTime){if(new Date().getTime()-kr.map.viewAnimationTime<1000){return}kr.map.viewAnimationTime=new Date().getTime()}var kt=kr.tileLayers.length;kr.tilesInfoCache={};for(var kv=0;kv<kt;kv++){var kx=kr.tileLayers[kv];var kw=kx.tileType;var ks=null;var ku=kr._getTilesInfoKey(kw,kx);if(kr.tilesInfoCache[ku]){ks=kr.tilesInfoCache[ku]}else{ks=kr.calcTilesInfo(kw,kx);kr.tilesInfoCache[ku]=ks}ks&&kx.loadLayerData(ks,false,kq)}kr.timer=null;kr.requestTime=null}this.timer=window.setTimeout(T,this.loadDelay);if((b2()||e6.Browser.ie)&&kq){this.loadDelay=200}else{this.loadDelay=80}},_getTilesInfoKey:function(i,T){var e=i.getName();e+=("_"+(T.transform?T.transform.source:"default"));e+=("_"+T.spanLevel||0);return e},_loadLayersFromCache:function(ks){if(!this.map){return}this.map._featureMgr.clearData();this.map.tileLabels=[];var kv=this.tileLayers;kv.sort(function(kw,i){return kw.zIndex-i.zIndex>0});var T=kv.length;this.tilesInfoCache={};for(var kr=0;kr<T;kr++){var ku=kv[kr];var kt=ku.tileType;var e=null;var kq=this._getTilesInfoKey(kt,ku);if(this.tilesInfoCache[kq]){e=this.tilesInfoCache[kq]}else{e=this.calcTilesInfo(kt,ku);this.tilesInfoCache[kq]=e}e&&ku.loadLayerData(e,true,ks)}},calcTilesInfo:function(kD,k4){var kQ=this.map;var kW=kQ.getMapType();var kR=es[kW];var kK=kQ.getZoom();var e=Math.floor(kK);var kt=kD.getDataZoom(kK);var k9=kD.getName();kt=ch(kt,kR.minDataZoom,kR.maxDataZoom);var kZ=e;if(kD._name==="web"||kD._name==="xyz"){kZ=kt}else{if(kZ<3){kZ=3}}var kO=kD.getTileSize(kK);var ks=kD.getBaseTileSize(kK);var kM=kQ.getBoundsIn();if(!kM){return}var kH=kD.getMercatorSize(kK,kt);var kG;var kX;var kN;var k1;var kS=kQ.getCenterIn();if(kW!==BMAP_SATELLITE_MAP){kS=e9.calcLoopCenterPoint(kS)}if(k9==="xyz"){return this.calcXYZTilesInfo(kS,kM,kt,k9,k4,kQ)}var kL=Math.floor(kS.lng/kH);var kv=Math.floor(kS.lat/kH);var kU=0;var kq=0;if(k9!=="web"){kM=e9.calcLoopMapBounds(kM,kQ.getCenter())}if(kM.ne.lng>e9._mc180X){var kB=e9.getSpaceDistanceInPixel(kt);kU=Math.ceil(kB/ks)}if(kM.sw.lng<e9._mcM180X){var kB=e9.getSpaceDistanceInPixel(kt);kq=Math.ceil(kB/ks)}if(kM.ne.lat>19505879.362428114||kM.sw.lat<-15949096.637571886){kM.ne.lat=19505879.362428114;kM.sw.lat=-15949096.637571886}var kx=[Math.floor(kM.sw.lng/kH)-kq,Math.floor(kM.sw.lat/kH)];var k7=[Math.floor(kM.ne.lng/kH)+kU,Math.floor(kM.ne.lat/kH)];kG=kx[0];kX=k7[0]+1;kN=kx[1];k1=k7[1]+1;var kC=[];for(var kz=kG;kz<kX;kz++){if(e9.isTileBlank(kz,kt,ks)===true){continue}for(var kE=kN;kE<k1;kE++){var k3=false;var ky=256;if(k9==="web"){var kY=e9.calcLoopParam(kz,kt);var k6={col:kY.col,row:kE,baseTileSize:256,zoom:kt};var kP=jn.prototype.tileToBound(k6,kQ.getCenter());if(kP.LL.sw.lng*kP.LL.ne.lng<0&&Math.floor(kP.LL.ne.lng)<0){k3=true;ky=e9.pixelWidth(kP.MC.sw.lng,kQ.getZoom())}}var kA={col:kz,row:kE,zoom:kt,useZoom:kZ,tileTypeName:k9,loopOffsetX:0,tileSize:kO,baseTileSize:ks,mercatorSize:kH,combine:k3,dataIndex:ky};kC.push(kA);var kV="id_"+kz+"_"+kE+"_"+kt;kC[kV]=true}}if(kW!==BMAP_SATELLITE_MAP){kC=e9.calcLoopTiles(kC,kt,ks,kH)}if(kt===3){for(var k5=0,k2=kC.length;k5<k2;k5++){var kz=kC[k5].col;var kE=kC[k5].row;var kY=e9.calcLoopParam(kz,kt);var ku=kY.T;var kI=kz>=0?kz-ku:kz+ku;var kJ="id_"+kI+"_"+kE+"_"+kt;if(!kC[kJ]){var kA={col:kI,row:kE,zoom:kt,useZoom:kZ,loopOffsetX:0,tileSize:kO,baseTileSize:ks,mercatorSize:kH,combine:false};kC.push(kA);kC[kJ]=true}}}if(this.map._tilt>0){for(var k5=0;k5<kC.length;k5++){var kw=kC[k5];var k0=kw.col;var k8=kw.row;var kT=[];kT.minX=k0*kH;kT.maxX=(k0+1)*kH;kT.minY=k8*kH;kT.maxY=(k8+1)*kH;var kr=new cD(0,0);kr.lng=(kT.minX+kT.maxX)/2;kr.lat=(kT.minY+kT.maxY)/2;var kF=kQ.pointToPixelIn(kr);if(kF.x>0&&kF.x<this.map.width&&kF.y>0&&kF.y<this.map.height){continue}if(kT.minX<kS.lng&&kT.maxX>kS.lng&&kT.minY<kS.lat&&kT.maxY>kS.lat){continue}if(!this.ifTileInMapBounds(kT,kM,k0,k8)){kC.splice(k5,1);k5--}}}kC.sort((function(i){return function(T,la){return((0.4*Math.abs(T.col-i[0])+0.6*Math.abs(T.row-i[1]))-(0.4*Math.abs(la.col-i[0])+0.6*Math.abs(la.row-i[1])))}})([kL,kv]));kC.zoom=kt;kC.tileTypeName=k9;return kC},calcXYZTilesInfo:function(kB,ku,kA,kF,kt,kI){var kw=kI.width;var kG=kI.height;var kv=Math.floor(kA);var kx=null;if(kt.transform.target==="EPSG3857"){var kq=dI.transformBDmcPoint(kB,kt.transform);var kr=dI.getRangeExtent(kq,kw,kG,kv,kt.transform);kx=[kr.minX,kr.minY,kr.maxX,kr.maxY]}else{if(kt.transform.source==="BD09MC"){var kq=[kB.lng,kB.lat];kx=[ku.sw.lng,ku.sw.lat,ku.ne.lng,ku.ne.lat]}else{var kq=dI.transformBDmcPoint(kB,kt.transform);var ks=dI.transformBDmcPoint(ku.ne,kt.transform);var kz=dI.transformBDmcPoint(ku.sw,kt.transform);kx=dI.getLoopBox(kq,[kz[0],kz[1],ks[0],ks[1]])}}if(!kq||!kx){return[]}kv=kv+kt.spanLevel;var T=dI.getTileRangeForExtentFactory(kx,kv,kt.transform);var e=[];var kJ=dI.getResolutionScale(kv,kt.transform);for(var kE=T.minX;kE<=T.maxX;kE++){for(var kC=T.minY;kC<=T.maxY;kC++){var kD={col:kE,row:kC,zoom:kv,useZoom:kv,tileTypeName:kF,loopOffsetX:0,tileSize:256*kJ,transform:kt.transform,combine:false,dataIndex:0};e.push(kD);var ky="id_"+kE+"_"+kC+"_"+kv;e[ky]=true}}var kH=dI.getTileCoordForCoordAndZ(kq,kv);e.sort((function(i){return function(kK,kL){return((0.4*Math.abs(kK.col-i[0])+0.6*Math.abs(kK.row-i[1]))-(0.4*Math.abs(kL.col-i[0])+0.6*Math.abs(kL.row-i[1])))}})([kH[1],kH[2]]));e.zoom=kv;e.tileTypeName=kF;return e},getCurrentViewTilesInfo:function(T,kq){var i=this._getTilesInfoKey(T,kq);var e=this.tilesInfoCache[i];if(!e){return this.calcTilesInfo(T,kq)}return e},ifTileInMapBounds:function(e,ks,T,kr){var i=ks.normalizedBottomLeft;var kD=ks.normalizedTopRight;var kv=ks.normalizedTopLeft;var kt=ks.normalizedBottomRight;var kq=false;var kC=new cD(e.minX,e.minY);var kz=new cD(e.maxX,e.maxY);var ku=new cD(kz.lng,kC.lat);var kA=new cD(kC.lng,kz.lat);var kx=[kA,kz,ku,kC];for(var kB=0,kw=kx.length;kB<kw;kB++){var ky=kB+1;if(ky===kw){ky=0}var kE=kB;var kF=jm(kx[ky],kx[kE],kv,i);if(kF){kq=true;break}kF=jm(kx[ky],kx[kE],kt,kD);if(kF){kq=true;break}kF=jm(kx[ky],kx[kE],kD,kv);if(kF){kq=true;break}kF=jm(kx[ky],kx[kE],i,kt);if(kF){kq=true;break}}return kq},getTileLayer:function(kr){for(var kq=0,e=this.tileLayers.length;kq<e;kq++){var T=this.tileLayers[kq];if(T.mapType===kr){return T}}return null},isExitTileLayer:function(kr){for(var kq=0,e=this.tileLayers.length;kq<e;kq++){var T=this.tileLayers[kq];if(T===kr){return true}}return false},getZoomState:function(i){var e=i-this.lastZoom;if(e>0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState}});function iO(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 cD(12069475.280738307,3929271.1724863998);this.iconCache=new aA((b2()||e6.Browser.ie)?64:128,{clearCallback:function(i){}})}bD.register(function(i){if(i._renderType!=="webgl"){return}var e=i._normalLayerMgr=new iO(i);i.toFormatCoords=function(ks,kv){var ku=[];var kt=e.base;if(kv&&kv.center){kt=jn.convertLL2MC(kv.center)}for(var kr=0;kr<ks.length;kr++){var T=jn.convertLL2MC(new cD(ks[kr][0],ks[kr][1]));var kq=[T.lng-kt.lng,T.lat-kt.lat];ku.push(kq)}return ku};i.indexToRgb=function(kq){kq++;var T=Math.floor(kq/65536);kq-=T*65536;var ks=Math.floor(kq/256);kq-=ks*256;var kr=kq;return[kr,ks,T]};i.addEventListener("addnormallayer",function(T){e.addWebGLLayer(T.target)});i.addEventListener("removenormallayer",function(T){e.removeWebGLLayer(T.target)});i.addEventListener("onmousemove",e._layerMouseEvent.bind(e));i.addEventListener("onclick",e._layerClickEvent.bind(e));i.addEventListener("ondblclick",e._layerDBLClickEvent.bind(e));i.addEventListener("onrightclick",e._layerRightClickEvent.bind(e));i.on("destroy",function(){e.removeAllLayers(true);i.indexToRgb=null;i.toFormatCoords=null;e.pickFBO=null;e.preFramebuffer=null;e.gl=null;e.iconCache.clear()});i.on("glmoduleloaded",function(){e.gl=i._webglPainter.gl;e.pickFBO=e.createFramebuffer();for(var T=0;T<e.layers.length;T++){e.layers[T].onInit(i,e.gl)}i.dispatchEvent(new fS("onupdate"))});i.addEventListener("layer_clear",function(T){e.iconCache.clear()})});e6.extend(iO.prototype,{init:function(){var e=this;this.map.toFormatCoords=function(ks){var kt=[];for(var kr=0;kr<ks.length;kr++){var T=jn.convertLL2MC(new cD(ks[kr][0],ks[kr][1]));var kq=[T.lng-e.base.lng,T.lat-e.base.lat];kt.push(kq)}return kt};this.map.indexToRgb=function(kq){kq++;var T=Math.floor(kq/65536);kq-=T*65536;var ks=Math.floor(kq/256);kq-=ks*256;var kr=kq;return[kr,ks,T]};this.pickFBO=this.createFramebuffer();var i=this;this.map.addEventListener("addnormallayer",function(T){i.addWebGLLayer(T.target)});this.map.addEventListener("removenormallayer",function(T){i.removeWebGLLayer(T.target)});this.map.addEventListener("onmousemove",this._layerMouseEvent.bind(this));this.map.addEventListener("onclick",this._layerClickEvent.bind(this));this.map.addEventListener("onrightclick",this._layerRightClickEvent.bind(this));this.map.addEventListener("ondblclick",this._layerDBLClickEvent.bind(this));this.map.on("destroy",function(){i.removeAllLayers(true);i.map.indexToRgb=null;i.map.toFormatCoords=null;i.pickFBO=null;i.preFramebuffer=null})},addWebGLLayer:function(T){var kq=false;for(var e=0;e<this.layers.length;e++){if(this.layers[e]===T){kq=true;break}}if(!kq){this.layers.push(T);if(this.gl){T.onInit(this.map,this.gl)}this.map.dispatchEvent(new fS("onupdate"))}},removeWebGLLayer:function(T){for(var e=0;e<this.layers.length;e++){if(this.layers[e]===T){this.map._featureMgr.removeLayer(T.zIndex);this.layers.splice(e,1);T.onDestroy();this.map.dispatchEvent(new fS("onupdate"));break}}},removeAllLayers:function(kq){for(var T=0;T<this.layers.length;T++){var e=this.layers[T];if(e.visible){this.map._featureMgr.removeLayer(e.zIndex)}if(kq){e.onKill&&e.onKill()}e.onDestroy()}this.layers=[];this.map.dispatchEvent(new fS("onupdate"))},sortLayer:function(){this.layers.sort(function(i,e){return i.zIndex-e.zIndex>0})},_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(T,e){var kq=null;var i=Date.now();return function(){var ku=Date.now();var kt=e-(ku-i);var ks=this;var kr=arguments;if(kq){clearTimeout(kq)}if(kt<=0){T.apply(ks,kr);i=Date.now()}else{kq=setTimeout(function(){T.apply(ks,kr)},kt)}}},pick:function(kv,kt){if(!this.layers.length){return false}var kq=false;var T=false;for(var ks=0;ks<this.layers.length;ks++){var kr=this.layers[ks];if(kr.doRender()){T=true;if(kr.pick){if(kt==="onmousemove"||kr.hasEvent(kt)){var ku=kr.pick(kv.x,kv.y,kt)}else{continue}if(ku&&ku.dataIndex!==-1){if(kt==="onmousemove"){kq=true}if(kr.hasEvent(kt)){kr.dispatcher(kv,ku,kt)}if(!kr.popEvent){break}}else{if(kr.hasEvent(kt)){kr.dispatcher(kv,ku,kt)}}}}}if(kt==="onmousemove"&&T){this.mousePointerThrottle(kq)}this.map.dispatchEvent(new fS("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 e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.preFramebuffer)},createFramebuffer:function(kq,i){var ku=this.gl;kq=kq||ku.canvas.width;i=i||ku.canvas.height;var ks=ku.createFramebuffer();var kr=ku.createTexture();ku.bindTexture(ku.TEXTURE_2D,kr);ku.texImage2D(ku.TEXTURE_2D,0,ku.RGBA,kq,i,0,ku.RGBA,ku.UNSIGNED_BYTE,null);ku.texParameteri(ku.TEXTURE_2D,ku.TEXTURE_MAG_FILTER,ku.LINEAR);ku.texParameteri(ku.TEXTURE_2D,ku.TEXTURE_MIN_FILTER,ku.LINEAR);ku.texParameteri(ku.TEXTURE_2D,ku.TEXTURE_WRAP_S,ku.CLAMP_TO_EDGE);ku.texParameteri(ku.TEXTURE_2D,ku.TEXTURE_WRAP_T,ku.CLAMP_TO_EDGE);ks.texture=kr;var T=ku.createRenderbuffer();ku.bindRenderbuffer(ku.RENDERBUFFER,T);ku.renderbufferStorage(ku.RENDERBUFFER,ku.DEPTH_STENCIL,kq,i);ks.depthBuffer=T;ku.bindFramebuffer(ku.FRAMEBUFFER,ks);ku.framebufferTexture2D(ku.FRAMEBUFFER,ku.COLOR_ATTACHMENT0,ku.TEXTURE_2D,kr,0);ku.framebufferRenderbuffer(ku.FRAMEBUFFER,ku.DEPTH_STENCIL_ATTACHMENT,ku.RENDERBUFFER,T);var kt=ku.checkFramebufferStatus(ku.FRAMEBUFFER);if(ku.FRAMEBUFFER_COMPLETE!==kt){console.log("Frame buffer object is incomplete: "+kt.toString());return}ku.bindFramebuffer(ku.FRAMEBUFFER,null);ku.bindTexture(ku.TEXTURE_2D,null);ku.bindRenderbuffer(ku.RENDERBUFFER,null);return ks},loadIconImages:function(kq,kx){var ky=kq;var kz=ky.length;var kt=this;var T=0;var kw=200;for(var kr=0;kr<kz;kr++){var ks=ky[kr];var e=ks.icon;var kv=e;if(e instanceof HTMLCanvasElement){kv=e.id;if(!this.iconCache.getData(kv)){this._addToIconTexture(e);this.iconCache.setData(kv,{loaded:true,image:e})}continue}T++;if(this.iconCache.getData(kv)){if(this.iconCache.getData(kv).loaded){kx(kq)}continue}var ku=new Image();ku.id=kv;ku.iconUrl=e;ku.crossOrigin="anonymous";ku.onload=function(){if(kt.iconCache.getData(this.id)){kt.iconCache.getData(this.id).loaded=true;kt._addToIconTexture(this)}if(!kt._iconLoadTimer){kt._iconLoadTimer=setTimeout(function(){kx(kq);kt._iconLoadTimer=null},kw)}this.onload=null};ku.onerror=function(){if(!kt._iconLoadTimer){kt._iconLoadTimer=setTimeout(function(){kx(kq);kt._iconLoadTimer=null},kw)}kt.iconCache.removeData(this.id);this.onerror=null};ku.src=e;this.iconCache.setData(kv,{loaded:false,image:ku})}kx(kq)},_addToIconTexture:function(ks){if(!this.map._webglMapScene){return}var ku=this.map._webglMapScene._painter;var e=ku._iconTextureAtlas.addTexture(ks);if(e===false){this.map.fire(new fS("onlayer_clear"));return}if(!e){return}ku._iconTextureAtlasOffset[ks.id]=e;var kx=0*ks.width/1024+e.width;var kr=0*ks.height/1024+e.height;var kw=ks.width/1024+e.width;var kq=kr;var kv=kw;var T=ks.height/1024+e.height;var kt=kx;var i=T;ku._iconTextureAtlasCoords[ks.id]=[kx,kr,kw,kq,kv,T,kt,i]}});var hP=(function(){function kw(kX,k2,kY,kZ,k4){kY=kY||2;var k0=k2&&k2.length;var kV=k0?k2[0]*kY:kX.length;var k1=kL(kX,0,kV,kY,true);var kU=k4||[];if(!k1){return kU}var kT;var kS;var kR;var kQ;var k5;var k3;var k6;kZ=kZ||0;if(k0){k1=kF(kX,k2,k1,kY)}if(kX.length>80*kY){kT=kR=kX[0];kS=kQ=kX[1];for(var kW=kY;kW<kV;kW+=kY){k5=kX[kW];k3=kX[kW+1];if(k5<kT){kT=k5}if(k3<kS){kS=k3}if(k5>kR){kR=k5}if(k3>kQ){kQ=k3}}k6=Math.max(kR-kT,kQ-kS)}T(k1,kU,kY,kT,kS,k6,null,kZ);return kU}function kL(kU,kW,kQ,kV,kR){var kS;var kT;if(kR===(kP(kU,kW,kQ,kV)>0)){for(kS=kW;kS<kQ;kS+=kV){kT=kt(kS,kU[kS],kU[kS+1],kT)}}else{for(kS=kQ-kV;kS>=kW;kS-=kV){kT=kt(kS,kU[kS],kU[kS+1],kT)}}if(kT&&kz(kT,kT.next)){kH(kT);kT=kT.next}return kT}function kD(kT,kQ){if(!kT){return kT}if(!kQ){kQ=kT}var kS=kT;var kR;do{kR=false;if(!kS.steiner&&(kz(kS,kS.next)||kJ(kS.prev,kS,kS.next)===0)){kH(kS);kS=kQ=kS.prev;if(kS===kS.next){return null}kR=true}else{kS=kS.next}}while(kR||kS!==kQ);return kQ}function T(kR,kT,kW,kU,kQ,k0,kZ,kX){if(!kR){return}if(!kZ&&k0){ky(kR,kU,kQ,k0)}var kY=kR;var kS;var kV;while(kR.prev!==kR.next){kS=kR.prev;kV=kR.next;if(k0?kO(kR,kU,kQ,k0):kG(kR)){kT.push(kS.i/kW+kX);kT.push(kR.i/kW+kX);kT.push(kV.i/kW+kX);kH(kR);kR=kV.next;kY=kV.next;continue}kR=kV;if(kR===kY){if(!kZ){T(kD(kR),kT,kW,kU,kQ,k0,1,kX)}else{if(kZ===1){kR=kC(kR,kT,kW,kX);T(kR,kT,kW,kU,kQ,k0,2,kX)}else{if(kZ===2){kB(kR,kT,kW,kU,kQ,k0,kX)}}}break}}}function kG(kS){var kR=kS.prev;var kQ=kS;var kU=kS.next;if(kJ(kR,kQ,kU)>=0){return false}var kT=kS.next.next;while(kT!==kS.prev){if(kA(kR.x,kR.y,kQ.x,kQ.y,kU.x,kU.y,kT.x,kT.y)&&kJ(kT.prev,kT,kT.next)>=0){return false}kT=kT.next}return true}function kO(kV,kW,kU,k2){var kZ=kV.prev;var kY=kV;var kX=kV.next;if(kJ(kZ,kY,kX)>=0){return false}var k3=kZ.x<kY.x?(kZ.x<kX.x?kZ.x:kX.x):(kY.x<kX.x?kY.x:kX.x);var k0=kZ.y<kY.y?(kZ.y<kX.y?kZ.y:kX.y):(kY.y<kX.y?kY.y:kX.y);var kT=kZ.x>kY.x?(kZ.x>kX.x?kZ.x:kX.x):(kY.x>kX.x?kY.x:kX.x);var kS=kZ.y>kY.y?(kZ.y>kX.y?kZ.y:kX.y):(kY.y>kX.y?kY.y:kX.y);var kR=e(k3,k0,kW,kU,k2);var k1=e(kT,kS,kW,kU,k2);var kQ=kV.nextZ;while(kQ&&kQ.z<=k1){if(kQ!==kV.prev&&kQ!==kV.next&&kA(kZ.x,kZ.y,kY.x,kY.y,kX.x,kX.y,kQ.x,kQ.y)&&kJ(kQ.prev,kQ,kQ.next)>=0){return false}kQ=kQ.nextZ}kQ=kV.prevZ;while(kQ&&kQ.z>=kR){if(kQ!==kV.prev&&kQ!==kV.next&&kA(kZ.x,kZ.y,kY.x,kY.y,kX.x,kX.y,kQ.x,kQ.y)&&kJ(kQ.prev,kQ,kQ.next)>=0){return false}kQ=kQ.prevZ}return true}function kC(kW,kS,kV,kU){var kT=kW;do{var kR=kT.prev;var kQ=kT.next.next;if(!kz(kR,kQ)&&i(kR,kT,kT.next,kQ)&&kK(kR,kQ)&&kK(kQ,kR)){kS.push(kR.i/kV+kU);kS.push(kT.i/kV+kU);kS.push(kQ.i/kV+kU);kH(kT);kH(kT.next);kT=kW=kQ}kT=kT.next}while(kT!==kW);return kT}function kB(kQ,kS,kU,kT,kR,kZ,kV){var kY=kQ;do{var kX=kY.next.next;while(kX!==kY.prev){if(kY.i!==kX.i&&kI(kY,kX)){var kW=kx(kY,kX);kY=kD(kY,kY.next);kW=kD(kW,kW.next);T(kY,kS,kU,kT,kR,kZ,null,kV);T(kW,kS,kU,kT,kR,kZ,null,kV);return}kX=kX.next}kY=kY.next}while(kY!==kQ)}function kF(kS,kZ,kV,kU){var kW=[];var kT;var kX;var kQ;var kR;var kY;for(kT=0,kX=kZ.length;kT<kX;kT++){kQ=kZ[kT]*kU;kR=kT<kX-1?kZ[kT+1]*kU:kS.length;kY=kL(kS,kQ,kR,kU,false);if(kY===kY.next){kY.steiner=true}kW.push(ku(kY))}kW.sort(kv);for(kT=0;kT<kW.length;kT++){ks(kW[kT],kV);kV=kD(kV,kV.next)}return kV}function kv(kR,kQ){return kR.x-kQ.x}function ks(kS,kR){kR=kM(kS,kR);if(kR){var kQ=kx(kR,kS);kD(kQ,kQ.next)}}function kM(kQ,kU){var kR=kU;var kW=kQ.x;var kV=kQ.y;var kT=-Infinity;var kS;do{if(kV<=kR.y&&kV>=kR.next.y){var kZ=kR.x+(kV-kR.y)*(kR.next.x-kR.x)/(kR.next.y-kR.y);if(kZ<=kW&&kZ>kT){kT=kZ;if(kZ===kW){if(kV===kR.y){return kR}if(kV===kR.next.y){return kR.next}}kS=kR.x<kR.next.x?kR:kR.next}}kR=kR.next}while(kR!==kU);if(!kS){return null}if(kW===kT){return kS.prev}var kY=kS;var k2=kS.x;var k0=kS.y;var k1=Infinity;var kX;kR=kS.next;while(kR!==kY){if(kW>=kR.x&&kR.x>=k2&&kA(kV<k0?kW:kT,kV,k2,k0,kV<k0?kT:kW,kV,kR.x,kR.y)){kX=Math.abs(kV-kR.y)/(kW-kR.x);if((kX<k1||(kX===k1&&kR.x>kS.x))&&kK(kR,kQ)){kS=kR;k1=kX}}kR=kR.next}return kS}function ky(kU,kQ,kT,kR){var kS=kU;do{if(kS.z===null){kS.z=e(kS.x,kS.y,kQ,kT,kR)}kS.prevZ=kS.prev;kS.nextZ=kS.next;kS=kS.next}while(kS!==kU);kS.prevZ.nextZ=null;kS.prevZ=null;kr(kS)}function kr(kW){var kT;var kS;var kR;var kV;var kX;var kQ;var kY;var kU;var kZ=1;do{kS=kW;kW=null;kX=null;kQ=0;while(kS){kQ++;kR=kS;kY=0;for(kT=0;kT<kZ;kT++){kY++;kR=kR.nextZ;if(!kR){break}}kU=kZ;while(kY>0||(kU>0&&kR)){if(kY===0){kV=kR;kR=kR.nextZ;kU--}else{if(kU===0||!kR){kV=kS;kS=kS.nextZ;kY--}else{if(kS.z<=kR.z){kV=kS;kS=kS.nextZ;kY--}else{kV=kR;kR=kR.nextZ;kU--}}}if(kX){kX.nextZ=kV}else{kW=kV}kV.prevZ=kX;kX=kV}kS=kR}kX.nextZ=null;kZ*=2}while(kQ>1);return kW}function e(kR,kU,kQ,kT,kS){kR=32767*(kR-kQ)/kS;kU=32767*(kU-kT)/kS;kR=(kR|(kR<<8))&16711935;kR=(kR|(kR<<4))&252645135;kR=(kR|(kR<<2))&858993459;kR=(kR|(kR<<1))&1431655765;kU=(kU|(kU<<8))&16711935;kU=(kU|(kU<<4))&252645135;kU=(kU|(kU<<2))&858993459;kU=(kU|(kU<<1))&1431655765;return kR|(kU<<1)}function ku(kS){var kR=kS;var kQ=kS;do{if(kR.x<kQ.x){kQ=kR}kR=kR.next}while(kR!==kS);return kQ}function kA(kU,kT,kW,kV,kQ,kX,kS,kR){return(kQ-kS)*(kT-kR)-(kU-kS)*(kX-kR)>=0&&(kU-kS)*(kV-kR)-(kW-kS)*(kT-kR)>=0&&(kW-kS)*(kX-kR)-(kQ-kS)*(kV-kR)>=0}function kI(kR,kQ){return kR.next.i!==kQ.i&&kR.prev.i!==kQ.i&&!kE(kR,kQ)&&kK(kR,kQ)&&kK(kQ,kR)&&kq(kR,kQ)}function kJ(kS,kR,kQ){return(kR.y-kS.y)*(kQ.x-kR.x)-(kR.x-kS.x)*(kQ.y-kR.y)}function kz(kR,kQ){return kR.x===kQ.x&&kR.y===kQ.y}function i(kS,kQ,kR,kT){if((kz(kS,kQ)&&kz(kR,kT))||(kz(kS,kT)&&kz(kR,kQ))){return true}return kJ(kS,kQ,kR)>0!==kJ(kS,kQ,kT)>0&&kJ(kR,kT,kS)>0!==kJ(kR,kT,kQ)>0}function kE(kR,kQ){var kS=kR;do{if(kS.i!==kR.i&&kS.next.i!==kR.i&&kS.i!==kQ.i&&kS.next.i!==kQ.i&&i(kS,kS.next,kR,kQ)){return true}kS=kS.next}while(kS!==kR);return false}function kK(kR,kQ){return kJ(kR.prev,kR,kR.next)<0?kJ(kR,kQ,kR.next)>=0&&kJ(kR,kR.prev,kQ)>=0:kJ(kR,kQ,kR.prev)<0||kJ(kR,kR.next,kQ)<0}function kq(kS,kR){var kV=kS;var kQ=false;var kU=(kS.x+kR.x)/2;var kT=(kS.y+kR.y)/2;do{if(((kV.y>kT)!==(kV.next.y>kT))&&(kU<(kV.next.x-kV.x)*(kT-kV.y)/(kV.next.y-kV.y)+kV.x)){kQ=!kQ}kV=kV.next}while(kV!==kS);return kQ}function kx(kS,kR){var kQ=new kN(kS.i,kS.x,kS.y);var kT=new kN(kR.i,kR.x,kR.y);var kV=kS.next;var kU=kR.prev;kS.next=kR;kR.prev=kS;kQ.next=kV;kV.prev=kQ;kT.next=kQ;kQ.prev=kT;kU.next=kT;kT.prev=kU;return kT}function kt(kR,kQ,kU,kS){var kT=new kN(kR,kQ,kU);if(!kS){kT.prev=kT;kT.next=kT}else{kT.next=kS.next;kT.prev=kS;kS.next.prev=kT;kS.next=kT}return kT}function kH(kQ){kQ.next.prev=kQ.prev;kQ.prev.next=kQ.next;if(kQ.prevZ){kQ.prevZ.nextZ=kQ.nextZ}if(kQ.nextZ){kQ.nextZ.prevZ=kQ.prevZ}}function kN(kR,kQ,kS){this.i=kR;this.x=kQ;this.y=kS;this.prev=null;this.next=null;this.z=null;this.prevZ=null;this.nextZ=null;this.steiner=false}kw.deviation=function(kV,k0,kX,kS){var kY=k0&&k0.length;var kU=kY?k0[0]*kX:kV.length;var kR=Math.abs(kP(kV,0,kU,kX));if(kY){for(var kW=0,kZ=k0.length;kW<kZ;kW++){var kQ=k0[kW]*kX;var kT=kW<kZ-1?k0[kW+1]*kX:kV.length;kR-=Math.abs(kP(kV,kQ,kT,kX))}}var k4=0;for(kW=0;kW<kS.length;kW+=3){var k3=kS[kW]*kX;var k2=kS[kW+1]*kX;var k1=kS[kW+2]*kX;k4+=Math.abs((kV[k3]-kV[k1])*(kV[k2+1]-kV[k3+1])-(kV[k3]-kV[k2])*(kV[k1+1]-kV[k3+1]))}return kR===0&&k4===0?0:Math.abs((k4-kR)/kR)};function kP(kU,kW,kQ,kV){var kT=0;for(var kS=kW,kR=kQ-kV;kS<kQ;kS+=kV){kT+=(kU[kR]-kU[kS])*(kU[kS+1]+kU[kR+1]);kR=kS}return kT}kw.flatten=function(kU){var kV=kU[0][0].length;var kQ={vertices:[],holes:[],dimensions:kV};var kS=0;for(var kT=0;kT<kU.length;kT++){for(var kR=0;kR<kU[kT].length;kR++){for(var kW=0;kW<kV;kW++){kQ.vertices.push(kU[kT][kR][kW])}}if(kT>0){kS+=kU[kT-1].length;kQ.holes.push(kS)}}return kQ};return kw})();function cI(i,e){this.id=gd();this.workerPool=i;this.actors=[];this.currentActorIndex=0;this.ready=false;this.init(e)}cI.prototype.init=function(ks){const e=this.workerPool.acquire(this.id);for(var kq=0;kq<e.length;kq++){const kt=e[kq];const kr=new jF(kt,ks,this.id);kr.name="Worker "+kq;this.actors.push(kr)}var T=this;this.broadcast("hasReady",null,function(){T.ready=true})};cI.prototype.broadcast=function(i,T,e){e=e||function(){};k(this.actors,function(kr,kq){kr.send(i,T,kq)},e)};cI.prototype.getActor=function(){const e=this.actors.filter(function(i){return !i.busy})[0];if(e){return e}this.currentActorIndex=(this.currentActorIndex+1)%this.actors.length;return this.actors[this.currentActorIndex]};cI.prototype.stop=function(){for(var e=0;e<this.actors.length;e++){var T=this.actors[e];T.stop()}};cI.prototype.remove=function(){for(var e=0;e<this.actors.length;e++){var T=this.actors[e];T.remove()}this.actors.length=0;this.workerPool.release(this.id)};function jF(T,i,e){this.target=T;this.parent=i;this.mapId=e;this.busy=false;this.taskQueue=[];this.callbacks={};this.init()}jF.prototype.init=function(){this.receive=this.receive.bind(this);this.target.addEventListener("message",this.receive,false)};jF.prototype.setBusy=function(e){this.busy=e;if(!e&&this.taskQueue.length){var i=this.taskQueue.shift();this.send(i.action,i.data,i.callback,i.targetMapId,i.mustQueue,i.callbackMetadata)}};jF.prototype.receive=function(kq){const kr=kq.data;const ku=kr.id;if(!ku){return}if(kr.targetMapId&&this.mapId!==kr.targetMapId){return}if(kr.action==="<response>"){this.setBusy(false);const kt=this.callbacks[ku];delete this.callbacks[ku];if(kt){if(kr.error){kt(io(kr.error))}else{kt(null,io(kr.data))}}}else{var T=this;const i=[];const e=kr.hasCallback?function(kv,kw){T.target.postMessage({id:ku,action:"<response>",sourceMapId:T.mapId,error:kv?jG(kv):null,data:jG(kw,i)},i)}:function(kv){};const ks=io(kr.data);if(this.parent[kr.action]){this.parent[kr.action](kr.sourceMapId,ks,e)}}};jF.prototype.send=function(i,T,kt,kq,kr,ku){if(i==="release"){this.releasePendingData(T,kt);return}if(this.busy){this.taskQueue.push({action:i,data:T,callback:kt,targetMapId:kq,mustQueue:kr,callbackMetadata:ku});return}this.setBusy(true);var ks=Math.round((Math.random()*1000000000000000000)).toString(36).substring(0,10);const e=this.mapId+"_"+i+"_"+ks;if(kt){kt.metadata=ku;this.callbacks[e]=kt}const kv=[];this.target.postMessage({id:e,action:i,hasCallback:!!kt,targetMapId:kq,mustQueue:kr,sourceMapId:this.mapId,data:jG(T,kv)},kv);return{cancel:function(){if(kt){delete this.callbacks[e]}this.target.postMessage({id:e,action:"<cancel>",targetMapId:kq,sourceMapId:this.mapId})}}};jF.prototype.stop=function(){this.taskQueue.length=0;this.busy=false;this.callbacks={}};jF.prototype.remove=function(){this.taskQueue.length=0;this.busy=false;this.target.removeEventListener("message",this.receive,false)};jF.prototype.releasePendingData=function(e,kt){var T=[];var kr=this.taskQueue;for(var kq=kr.length-1;kq>=0;kq--){var ks=kr[kq]["data"];if(!ks||!ks.layerId){break}if(ks.layerId!==e.layerId){continue}if(!e["id_"+ks.x+"_"+ks.y+"_"+ks.z]){kr.splice(kq,1);T.push(ks)}}kt(null,T)};var kg;function hx(){if(!kg){kg=new hD()}return kg}function hD(){this.active={}}hD.prototype.acquire=function(i){if(!this.workers){this.workers=[];var T=(window.location.protocol === "http:" ? "http:" : "https:") + "//api.map.baidu.com/res/webgl/10/worker_mvt_xyk5ez.js";while(this.workers.length<hD.workerCount){var e=jZ(T);this.workers.push(e)}}this.active[i]=true;return this.workers.slice()};hD.prototype.release=function(T){delete this.active[T];if(this.numActive()===0){for(var e=0;e<this.workers.length;e++){this.workers[e].terminate()}this.workers=null}};hD.prototype.numActive=function(){return Object.keys(this.active).length};hD.workerCount=2;function hE(e){this._map=e;this._spotsId={};this._init()}hE.prototype._init=function(){var i=this._map;var e=this;i.addEventListener("onspotsdataready",function(kq){var T=kq.spots;if(e._spotsId[kq.index]){i.removeSpots(e._spotsId[kq.index])}e._spotsId[kq.index]=i.addSpots(T)});i.addEventListener("onspotsdataremove",function(T){if(e._spotsId[T.index]){i.removeSpots(e._spotsId[T.index])}})};bD.register(function(e){if(!e.config.enableIconClick){return}e._mapIcon=new hE(e)});function dd(e){this._indoorData={};this._map=e;this.currentUid=null;this.currentFloor=null;this._indoorControl=null;this.enterMethod=null;this.showMask=true;this._isMobile=b2();this._autoEnterZoom=19;if(this._isMobile){this._autoEnterZoom=17}this._init(e);window._indoorMgr=this}dd.prototype._init=function(i){var e=this;i.on("indoor_status_changed",function(kt){var T=kt.uid;var kr=kt.floor;if(T===null){T=e.currentUid;if(e._indoorData[T]){kr=e._indoorData[T].defaultFloor}if(e._indoorControl){e._indoorControl.hide()}e.currentUid=null;e.currentFloor=null;e.enterMethod=null}else{if(e._indoorData[T]){var ks=e._indoorData[T];kr=(typeof kr==="number")?kr:ks.defaultFloor;if(!e._indoorControl){if((i.config.showControls||i.config.indoorControl)&&i._displayOptions.indoor){e._indoorControl=new av(i,ks)}}else{e._indoorControl.setInfo(ks);e._indoorControl.show()}e.currentUid=T;e.currentFloor=kr}}if(!e._indoorData||!e._indoorData[T]||e._indoorData[T].currentFloor===kr){this.fire(new fS("onrefresh"));return}var kq=new fS("onindoor_data_refresh");kq.uid=T;kq.floor=kr;kq.tileKey=e._indoorData[T].tileKey;e._indoorData[T].currentFloor=kr;e.currentFloor=kr;this.fire(kq);hI.sendMessage(aZ(4,3,4),["layer","indoor"])});i.on("spotclick",function(kq){var T=null;if(kq.curAreaSpot&&this.areaSpots[kq.curAreaSpot]){T=this.areaSpots[kq.curAreaSpot].userData.uid}if(T===e.currentUid){if(kq.curAreaSpot){e.enterMethod="byClick"}return}if(T===null){if(e.currentUid&&e.enterMethod==="byClick"){i.showIndoor(null);e.enterMethod=null}}else{e.enterMethod="byClick";if(e.currentUid){i.showIndoor(e.currentUid,e._indoorData[e.currentUid].defaultFloor)}i.showIndoor(T,e._indoorData[T].defaultFloor)}});i.on("moveend",function(){if(this.getZoom()>=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)}}})};dd.prototype._checkIndoorByMove=function(){var T=this._map;var kw=T.getSize();var kB={x:kw.width/2,y:kw.height/2};var kA=Math.max(kw.width,kw.height);var kC=[];for(var kx in this._indoorData){var e=this._indoorData[kx].center;var kq=T.pointToPixelIn(new bD.Point(e[0],e[1]));var kt=co(kB,kq);kC.push({uid:kx,distance:kt})}if(kC.length===0){return}kC.sort(function(kD,i){return kD.distance-i.distance});var ks=kC[0];var ky=T.getCenterIn();var kr=false;for(var kv=0;kv<this._indoorData[ks.uid].contour.length;kv++){if(bQ([ky.lng,ky.lat],this._indoorData[ks.uid].contour[kv])){kr=true;break}}if(kr===false&&ks.uid==="e96b44200baa3b4082288acc"){var ku=this._indoorData[ks.uid].boundsMin;var kz=this._indoorData[ks.uid].boundsMax;if(ky.lng>ku[0]&&ky.lat>ku[1]&&ky.lng<kz[0]&&ky.lat<kz[1]){kr=true}}if(kr){if(this.enterMethod!=="byClick"){if(this.currentUid!==null&&this.currentUid!==ks.uid){this._map.showIndoor(this.currentUid,this._indoorData[this.currentUid].defaultFloor)}if(this.currentUid!==ks.uid){this._map.showIndoor(ks.uid,this._indoorData[ks.uid].defaultFloor)}this.enterMethod="byMove"}}else{if(this.enterMethod!=="byClick"){this._map.showIndoor(null)}}};dd.prototype.setData=function(kq){if(kq===null){return}for(var T in kq){if(T==="tileInfo"){continue}var kr=kq[T].tileKey;if(this._indoorData[T]){if(!this._indoorData[T][kr]){this._indoorData[T].tileKeys.push(kr);this._indoorData[T][kr]=true}}else{this._indoorData[T]=kq[T];this._indoorData[T].tileKeys=[kq[T].tileKey];this._indoorData[T][kr]=true;for(var e=0;e<this._indoorData[T].contour.length;e++){this._map.addAreaSpot(this._indoorData[T].contour[e],{id:T+e,userData:{uid:T}})}}}if(this._map.getZoom()>=this._autoEnterZoom){this._checkIndoorByMove()}};dd.prototype.removeData=function(T,kr){if(!this._indoorData[T]){return}var kq=this._indoorData[T];for(var e=0;e<kq.tileKeys.length;e++){if(kq.tileKeys[e]===kr){kq.tileKeys.splice(e,1);break}}delete kq[kr];if(kq.tileKeys.length===0){delete this._indoorData[T]}};dd.prototype.getIndoorData=function(e){return this._indoorData[e]||null};dd.prototype.getData=function(){return this._indoorData};bD.register(function(e){e._indoorMgr=new dd(e)});var a1=(function(){var kq={};var kz={};var kv={};function kx(kB){if(Object.prototype.toString.call(kB)==="[object Object]"){for(var kA in kB){return false}return true}else{return false}}function kw(kH,kI,kL,kE,kK){var kA=kA||null;kE=kE||kA;var kC;if(kL>21){kL=21}if(kE){kC=ky(kH,kI,kL,kE)}else{kC=T(kH,kI,kL,kK)}var kG=kC.drawId;var kB=kC.style;var kJ=kC.styleUpdate;var kM=[];if(!kG){return kM}for(var kD=0;kD<kG.length;kD++){var kF=kJ[kG[kD]]||kB[kG[kD]];if(kF){switch(kI){case"polygon":kF=kr(kF,kH);break;case"line":kF=ku(kF,kH);break;case"pointText":kF=ks(kF,kH);break;case"point":kF=e(kF,kH);break;case"polygon3d":kF=kt(kF,kH);break}if(kF){kF.did=kG[kD];kM[kM.length]=kF}}}return kM}function ky(kB,kD,kE,kA){var kC=kA[2];switch(kD){case"point":kC=kC[0];break;case"pointText":kC=kC[1];break;case"line":kC=kC[3];break;case"polygon":kC=kC[4];break;case"polygon3d":kC=kC[5];break}var kG=kE-1;if(kD==="line"&&kE===12){kG=kE}var kH=kA[1][kG][0];var kF=kH[kB];if(!kF&&kE<21){if(kD==="point"||kD==="pointText"){kH=kA[1][kE][0];kF=kH[kB]}}return{drawId:kF,style:kC,styleUpdate:[]}}function T(kE,kF,kI,kH){if(!kH||!kH.baseFs){return{drawId:null,style:[],styleUpdate:[]}}var kG;var kC=kH.baseFs;if(kx(kH.zoomRegion)){kG=kH.StyleBody||[]}else{kG=kH.zoomStyleBody[kI]||[]}var kB=kC[2];switch(kF){case"point":kB=kB[0];kG=kG[0]||{};break;case"pointText":kB=kB[1];kG=kG[1]||{};break;case"line":kB=kB[3];kG=kG[3]||{};break;case"polygon":kB=kB[4];kG=kG[4]||{};break;case"polygon3d":kB=kB[5];kG=kG[5]||{};break}var kA=kC[1][kI-1][0];var kD=kA[kE];if(!kD&&kI<21){if(kF==="point"||kF==="pointText"){kA=kC[1][kI][0];kD=kA[kE]}}return{drawId:kD,style:kB,styleUpdate:kG}}function ks(kB,kA){if(!kB||kB.length===0){return null}return{sid:kA,fontRgba:i(kB[0]),haloRgba:i(kB[1]),backRgba:i(kB[2]),fontSize:kB[3],haloSize:kB[4],fontWeight:kB[5],fontStyle:kB[6],density:kB[7]}}function e(kB,kA){return{sid:kA,rank:kB[0],ucflag:kB[1],icon:kB[2],iconType:kB[3],nineGG:kB[4],density:kB[5],zoom:kB[6]}}function ku(kB,kA){return{sid:kA,borderRgba:i(kB[0]),fillRgba:i(kB[1]),borderWidth:kB[2],fillWidth:kB[3],borderCap:kB[4],fillCap:kB[5],haveBorderLine:kB[6],haveBorderTexture:kB[7],haveFillTexture:kB[8],isUseBorderRgba:kB[9],isUseFillRgba:kB[10],borderTexture:kB[11],fillTexture:kB[12],borderTextureType:kB[13],fillTextureType:kB[14],isRealWidth:kB[15],haveArrow:kB[16],needRound:kB[17],realBorderWidth:kB[18]}}function kr(kB,kA){return{sid:kA,fillRgba:i(kB[0]),borderRgba:i(kB[1]),borderWidth:kB[2],borderTexture:kB[3],borderTextureType:kB[4],waterStyle:kB[5],haloStyle:kB[6],textureStyle:kB[7],thickRgba:i(kB[8])}}function kt(kB,kA){return{sid:kA,filter:kB[0],ratio:kB[1],haveBorder:kB[2],borderWidth:kB[3],borderRgba:i(kB[4]),fillTop:i(kB[5]),fillSide:i(kB[6]),polyTexture:kB[7]}}function i(kF){var kE=kF;if(kv[kE]){return kv[kE]}kF=kF>>>0;var kD=(kF)&255;var kC=(kF>>8)&255;var kA=(kF>>16)&255;var kB=(kF>>24)&255;kv[kE]=[kD,kC,kA,kB];return kv[kE]}return{getStyleFromCache:function(kH,kC,kF,kG,kB,kE,kA){kH=kH||"default";var kD=kH+"-"+kC+"-"+kF+"-"+kG;if(kE){kD+="-indoor"}if(kB){if(!kz[kD]){kz[kD]=kw(kC,kF,kG,kB)}return kz[kD]}if(!kq[kD]){kq[kD]=kw(kC,kF,kG,kB,kA)}return kq[kD]}}})();bD.register(function(i){var e=new im(i)});function im(e){e.container.appendChild(this.render());this.bind(e)}im.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};im.prototype.bind=function(i){var e=this;i.addEventListener("spotclick",function(T){if(!T.spots||T.spots.length===0){return}e._div.style.left=T.pixel.x+"px";e._div.style.top=T.pixel.y+"px";e6.ac(e._ripple,"ripple-playing")});i.addEventListener("hotclick",function(T){if(!T||!T.pixel||!(T.pixel instanceof fr)){return}e._div.style.left=T.pixel.x+"px";e._div.style.top=T.pixel.y+"px";e6.ac(e._ripple,"ripple-playing")});e6.on(e._ripple,"transitionend",function(){e6.rc(e._ripple,"ripple-playing")})};function b1(e){de.call(this);if(!e){return}this._opts={};this._map=e;this._maxLat=84.6;this._minLat=-80.6;this._maxLatMC=jn.convertLL2MC(new cx(this._maxLat,0)).lat;this._minLatMC=jn.convertLL2MC(new cx(this._minLat,0)).lat}b1.inherits(de,"ToolbarItem");e6.extend(b1.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,"&lt;").replace(/>/g,"&gt;")}});function cl(T,i){b1.call(this,T);i=i||{};this._opts=e6.extend(e6.extend(this._opts||{},{autoClear:false,tips:"测距",followText:"单击确定起点,双击结束绘制",unit:"metric",showResult:true,lineColor:"blue",lineStroke:2,opacity:1,lineStyle:"solid",cursor:C.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=C.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;he.load("tools",function(){e._draw()})}cl.inherits(b1,"PolylineTItem");e6.extend(cl.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 T=0,e=this._overlays.length;T<e;T++){if(this._overlays[T]){this._map.removeOverlay(this._overlays[T])}}this._overlays.length=0;for(var T=0,e=this._dots.length;T<e;T++){if(this._dots[T]&&this._dots[T].parentNode){this._dots[T].parentNode.removeChild(this._dots[T])}}this._dots.length=0},setCursor:function(e){if(this._opts.showResult===true){return}this._opts.cursor=e},getCursor:function(){if(this._opts.showResult===true){return this._dCursor}var e=this._opts.cursor.match(/^url\((.+)\)(,.*)?/);if(e!==null){return e[1]}else{return this._opts.cursor}},showResult:function(e){this._opts.showResult=!!e}});function bI(){var kr=3;var ky=256;var kq=Math.pow(2,18-kr)*ky;var kz=2;var kx=(kz+1)*kq;var T=jn.convertLL2MC(new cD(180,0));var kv=T.lng;var kt=kx-kv;var kw=-3;var e=kw*kq;var ks=jn.convertLL2MC(new cD(-180,0));var ku=ks.lng;var i=ku-e;this._validPixels=kv/Math.pow(2,18-kr);this._mc180X=kv;this._mcM180X=ku;this._loopOffset=kt+i;this._mcTSpan=kv-ku;this._spaceDistance=kt;this._mSpaceDistance=i}bI.prototype={calcLoopParam:function(kq,i,kx){kx=kx||256;var ku=0;var kr=3;var kt=6;var ks=kt*Math.pow(2,(i-kr))*256/kx;var kw=ks/2-1;var kv=-ks/2;while(kq>kw){kq-=ks;ku-=this._loopOffset}while(kq<kv){kq+=ks;ku+=this._loopOffset}var e=ku;ku=Math.round(ku/Math.pow(2,18-i));return{offsetX:ku,geoOffsetX:e,col:kq,T:ks,maxCol:kw,minCol:kv}},calcLoopCenterPoint:function(i){var e=i.lng;while(e>this._mc180X){e-=this._mcTSpan}while(e<this._mcM180X){e+=this._mcTSpan}i.lng=e;return i},calcLoopMapBounds:function(T,kq){var i=kq||T.getCenter();var e=T.sw.lng;var kr=T.ne.lng;while(i.lng>this._mc180X){i.lng-=this._mcTSpan;e-=this._mcTSpan;kr-=this._mcTSpan}while(i.lng<this._mcM180X){i.lng+=this._mcTSpan;e+=this._mcTSpan;kr+=this._mcTSpan}T.sw.lng=e;T.ne.lng=kr;if(T.pointBottomLeft){T.pointBottomLeft=this.calcLoopCenterPoint(T.pointBottomLeft);T.pointTopLeft=this.calcLoopCenterPoint(T.pointTopLeft);T.pointTopRight=this.calcLoopCenterPoint(T.pointTopRight);T.pointBottomRight=this.calcLoopCenterPoint(T.pointBottomRight)}return T},calcLoopTiles:function(ky,e,kC,kv){kC=kC||256;var kr=kv||Math.pow(2,18-e)*kC;var kx=Math.floor(this._mc180X/kr);var kt=Math.floor(this._mcM180X/kr);var kz=Math.floor(this._loopOffset/kr);var kA=[];for(var ku=0;ku<ky.length;ku++){var kB=ky[ku];var kq=kB[0];var kD=kB[1];if(kq>=kx){var kw=kq+kz;if(this.isTileBlank(kw,e,kC)===true){continue}var T="id_"+kw+"_"+kD+"_"+e;if(!ky[T]){ky[T]=true;kA.push([kw,kD,e,0])}}else{if(kq<=kt){var kw=kq-kz;if(this.isTileBlank(kw,e,kC)===true){continue}var T="id_"+kw+"_"+kD+"_"+e;if(!ky[T]){ky[T]=true;kA.push([kw,kD,e,0])}}}}for(var ku=0,ks=kA.length;ku<ks;ku++){ky.push(kA[ku])}for(var ku=ky.length-1;ku>=0;ku--){var kq=ky[ku][0];if(this.isTileBlank(kq,e,kC)){ky.splice(ku,1)}}return ky},isTileBlank:function(T,kr,e){var ks=Math.pow(2,kr-3);var i=Math.round(this._validPixels*ks);var kq=6*ks*256/e;while(T>kq/2-1){T-=kq}while(T<-(kq/2)){T+=kq}if(T>0&&T*e>i){return true}if(T<0&&Math.abs((T+1)*e)>i){return true}return false},isAddWidth:function(e,i){return e<this._mcM180X||i>this._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 e9=new bI();function ex(){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}ex.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}};ex.prototype.deserialize=function(e){this.setId(e.id);this.setType(e.type);this.grid=e.grid;this.layerName=e.layerName;this.geojson=e.geojson;this.setProperties(e.properties);this.setState(e.state);this._visible=e.visible||true;this.renderData=e.renderData;this.setGeometry(e.geometry);this.setBox(e.box);return this};ex.prototype.getType=function(){return this._type};ex.prototype.getGeometry=function(){return this._geometry};ex.prototype.getId=function(){return this._id};ex.prototype.getProperties=function(){return this._properties};ex.prototype.getBox=function(){return this._box};ex.prototype.getState=function(){if(Object.keys(this._state).length>0){return this._state}else{return null}};ex.prototype.getStyle=function(){return this._style};ex.prototype.getStyleFunction=function(){return this._styleFunction};ex.prototype.setType=function(e){return this._type=e};ex.prototype.setGeometry=function(e){this._geometry=e};ex.prototype.setStyle=function(e){if(!e||Object.keys(e).length===0){return}for(var i in e){this.set(i,e[i],this._style)}};ex.prototype.setState=function(e){for(var i in e){this.set(i,e[i],this._state)}};ex.prototype.setId=function(e){this._id=e};ex.prototype.setProperties=function(e){for(var i in e){this.set(i,e[i],this._properties)}};ex.prototype.setBox=function(e){return this._box=e};ex.prototype.isPointInBox=function(e){return this._pointInBox(e,this._box)};ex.prototype.getPointGeoJSON=function(kq){var kz=this.renderData;if(kz){var kt=kz.active;if(!kz[kt]||!kz[kt]["poi"]){return null}var ky=[];var kv=kz[kt]["poi"];for(var kw=0;kw<kv.length;kw++){if(kv[kw].bds&&kv[kw].bds.length===4){var kr=kq.pointToPixelIn(kv[kw].pt);var ku=kr.x-kv[kw].bds[0];var ks=kr.y-kv[kw].bds[1];var T=kr.x-kv[kw].bds[2];var e=kr.y-kv[kw].bds[3];ky.push([[ku,ks],[T,ks],[T,e],[ku,e],[ku,ks]])}}if(ky.length===0){return null}else{var kx="Polygon";if(ky.length>0){kx="MultiPolygon"}return{type:"Feature",properties:{},geometry:{type:kx,coordinates:[ky]}}}}};ex.prototype._pointInBox=function(e,i){if(i[0]>e[0]||i[1]>e[1]||i[2]<e[0]||i[3]<e[1]){return false}else{return true}};ex.prototype._pixelPnpoint=function(kr,kv,e){var kw=false;if(kv){var kq=kv.active;if(!kv[kq]||!kv[kq]["poi"]){return kw}var ks=kv[kq]["poi"];for(var kt=0;kt<ks.length;kt++){if(ks[kt].bds&&ks[kt].bds.length===4){var T=e.pointToPixelIn(ks[kt].pt);if((kr.x-T.x<ks[kt].bds[2]&&kr.x-T.x>ks[kt].bds[0])&&(T.y-kr.y<ks[kt].bds[3]&&T.y-kr.y>ks[kt].bds[1])){if(e.getTilt()>55){var ku=e.pointToOverlayPixelIn(ks[kt].pt);if(ku.outOfFrustum){continue}}kw=true;break}}}}return kw};ex.prototype._pixelPnpoly=function(kr,kt){var e=kt.length;var T=0;var ks=false;for(var kq=0;kq<e;kq++){T=(kq===e-1)?0:T+1;if((kt[kq].lat!==kt[T].lat)&&(((kr.lat>=kt[kq].lat)&&(kr.lat<kt[T].lat))||((kr.lat>=kt[T].lat)&&(kr.lat<kt[kq].lat)))&&(kr.lng<(kt[T].lng-kt[kq].lng)*(kr.lat-kt[kq].lat)/(kt[T].lat-kt[kq].lat)+kt[kq].lng)){ks=!ks}}return ks};ex.prototype._getProximity=function(kA,kw){var T,kq,kz,ku,kt,ky,kx;var kD=kw.length;if(kD>1){for(var kB=1;kB<kD;kB++){var kv=kw[kB-1];var kH=kw[kB];if(!kv||!kH){continue}if(kv.lng!=kH.lng){var kG=(kH.lat-kv.lat)/(kH.lng-kv.lng);var kE=kH.lat-kG*kH.lng;kx=Math.abs(kG*kA.lng+kE-kA.lat)/Math.sqrt(kG*kG+1)}else{kx=Math.abs(kA.lng-kH.lng)}var kC=Math.pow(kH.lat-kv.lat,2)+Math.pow(kH.lng-kv.lng,2);var kr=Math.pow(kH.lat-kA.lat,2)+Math.pow(kH.lng-kA.lng,2);var kF=Math.pow(kv.lat-kA.lat,2)+Math.pow(kv.lng-kA.lng,2);var ks=Math.pow(kx,2);var e=kr-ks+kF-ks;if(e>kC){kx=Math.sqrt(Math.min(kr,kF))}if((T==null)||(T>kx)){kq=Math.sqrt(kF-ks)/Math.sqrt(kC);kz=Math.sqrt(kr-ks)/Math.sqrt(kC);T=kx;ky=kB}T=Math.min(T,kx)}}return{dist:T}};ex.prototype.isPointInGeometry=function(T,kv){var e=false;switch(this._type){case fZ.POINT:e=this._pixelPnpoint(T,this.renderData,kv);break;case fZ.LINE_STRING:var kr=this._getProximity({lng:T[0],lat:T[1]},this._geometry);var ku=this.renderData[this.renderData.active];if(!ku||!ku.line||!ku.line[0]||!ku.line[0].width){var kt=2}else{var kt=this.renderData[this.renderData.active]["line"][0].width;if(this.grid===eh.GridModel.GOOGLEWEB){kt=Math.max(kt/2*dI.gridScaleFromBDMCTo3857,2)}else{kt=Math.max(kt/2,2)}}if(kr.dist<kt){e=true}break;case fZ.POLYGON:e=this._pixelPnpoly({lng:T[0],lat:T[1]},this._geometry);break;case fZ.MULTI_POLYGON:for(var ks=0;ks<this._geometry.length;ks++){if(this._geometry[ks][0] instanceof cD){e=this._pixelPnpoly({lng:T[0],lat:T[1]},this._geometry[ks])}else{e=this._pixelPnpoly({lng:T[0],lat:T[1]},this._geometry[ks][0]);if(e){for(var kq=1;kq<this._geometry[ks].length;kq++){e=this._pixelPnpoly({lng:T[0],lat:T[1]},this._geometry[ks][kq]);if(e){e=false;break}}}}if(e){break}}break;case fZ.MULTI_LINE_STRING:var ku=this.renderData[this.renderData.active];if(!ku||!ku.line||!ku.line[0]||!ku.line[0].width){var kt=6}else{var kt=this.renderData[this.renderData.active]["line"][0].width;kt=Math.max(kt/2*dI.gridScaleFromBDMCTo3857,6)}for(var ks=0;ks<this._geometry.length;ks++){if(this._geometry[ks][0] instanceof cD){var kr=this._getProximity({lng:T[0],lat:T[1]},this._geometry[ks]);if(kr.dist<kt){e=true;break}}}break;case fZ.MULTI_POINT:e=this._pixelPnpoint(T,this.renderData,kv);break;default:throw new Error("geojson类型错误: "+this._type)}return e};ex.prototype.set=function(i,T,kq){var e=kq||(kq={});e[i]=T};var gH=(function(){function kx(kD){var kC=kD?kD:{};if(kC.reference){this.reference=kC.reference}else{this.reference=null}return this}kx.prototype.readFeatureFromObject=function(kD,kG){var kC=null;if(kD.type&&kD.type.toLowerCase()==="feature"){kC=kD}else{kC={type:"Feature",geometry:kD,properties:null,}}kG=kG||{};kG.reference=(kG.reference===undefined?this.reference:kG.reference);if(kG.isPoints){kG.onlyGeometry=true}var kH=T(kC.geometry,kG,kC.properties);var kF=e(ks(kC),kG);if(!kH){return null}if(kG&&kG.onlyGeometry&&!kG.isPoints){return{geometry:kH,type:kC.geometry["type"],bBox:kF}}if(kH instanceof Array&&!(kH[0] instanceof cD)){for(var kE=0;kE<kH.length;kE++){if(kG.isPoints){kH[kE]={points:kH[kE],properties:kC.properties,index:kG.__index,brotherIndex:kE}}else{kH[kE]["properties"]=kC.properties}}}else{if(kG.isPoints){kH={points:kH,properties:kC.properties,index:kG.__index,brotherIndex:-1}}else{kH.properties=kC.properties}}return kH};kx.prototype.readFeaturesFromObject=function(kF,kN,kC){var kK=kF;var kD=null;if(kK.type&&kK.type.toLowerCase()==="featurecollection"){var kH=kF;kD=[];var kJ=kH.features;var kE=kN||{};for(var kI=0,kL=kJ.length;kI<kL;++kI){kE.__index=kI;var kM=this.readFeatureFromObject(kJ[kI],kN);if(kM instanceof Array){for(var kG=0;kG<kM.length;kG++){kC&&kC(kM[kG]);kD.push(kM[kG])}}else{kC&&kC(kM);kD.push(kM)}}}else{var kM=this.readFeatureFromObject(kF,kN);if(kM instanceof Array){kD=[];for(var kI=0;kI<kM.length;kI++){kC&&kC(kM[kI]);kD.push(kM[kI])}}else{kC&&kC(kM);kD=[kM]}}return kD};function T(kC,kE,kD){if(!kC){return null}var kF;switch(kC.type){case fZ.POINT:kF=ku(kC,kE,kD);break;case fZ.LINE_STRING:kF=kq(kC,kE,kD);break;case fZ.POLYGON:kF=kv(kC,kE,kD);break;case fZ.MULTI_POINT:kF=kw(kC,kE,kD);break;case fZ.MULTI_LINE_STRING:kF=kz(kC,kE,kD);break;case fZ.MULTI_POLYGON:kF=kA(kC,kE,kD);break;default:throw new Error("geojson类型错误: "+kC.type)}return kF}function ku(kD,kG,kE){var kH=kD.coordinates;if(kG.reference&&kG.reference!=="BD09LL"){kH=gcoord.transform(kH,kG.reference||"WGS84",gcoord.BD09LL)}if(kG&&kG.onlyGeometry){return new cD(kH[0],kH[1])}var kF=kG;if(kG.markerStyle){kF=kG.markerStyle;if(kG.markerStyle instanceof Function){kF=kG.markerStyle(kE)||{}}}var kC=new s(new cD(kH[0],kH[1]),kF);return kC}function kB(kG,kD){if(!kG){return[]}var kF=[];for(var kC=0;kC<kG.length;kC++){var kE=kG[kC];if(kD.reference&&kD.reference!=="BD09LL"){kE=gcoord.transform(kE,kD.reference||"WGS84",gcoord.BD09LL)}kF.push(new cD(kE[0],kE[1]))}return kF}function kq(kD,kG,kE){var kH=kD.coordinates;if(kG&&kG.onlyGeometry){return kB(kH,kG)}var kF=kG;if(kG.polylineStyle){kF=kG.polylineStyle;if(kG.polylineStyle instanceof Function){kF=kG.polylineStyle(kE)||{}}}var kC=new br(kB(kH,kG),kF);return kC}function kv(kC,kG,kE){var kH=kC.coordinates;if(kG&&kG.onlyGeometry){return kB(kH[0],kG)}var kF=kG;if(kG.polygonStyle){kF=kG.polygonStyle;if(kG.polygonStyle instanceof Function){kF=kG.polygonStyle(kE)||{}}}var kD=new iU(kB(kH[0],kG),kF);return kD}function kw(kE,kK,kH){var kI=kE.coordinates;var kC=[];for(var kG=0;kG<kI.length;kG++){var kJ=kI[kG];if(kK.reference&&kK.reference!=="BD09LL"){kJ=gcoord.transform(kJ,kK.reference||"WGS84",gcoord.BD09LL)}if(kK&&kK.onlyGeometry){kC.push(new cD(kJ[0],kJ[1]))}else{var kD=kK;if(kK.markerStyle){kD=kK.markerStyle;if(kK.markerStyle instanceof Function){kD=kK.markerStyle(kH)||{}}}var kF=new s(new cD(kJ[0],kJ[1]),kD);kC.push(kF)}}return kC}function kz(kD,kH,kF){var kJ=kD.coordinates;var kI=[];for(var kE=0;kE<kJ.length;kE++){if(kH&&kH.onlyGeometry){kI.push(kB(kJ[kE],kH))}else{var kG=kH;if(kH.polylineStyle){kG=kH.polylineStyle;if(kH.polylineStyle instanceof Function){kG=kH.polylineStyle(kF)||{}}}var kC=new br(kB(kJ[kE],kH),kG);kI.push(kC)}}return kI}function kA(kF,kM,kJ){var kL=kF.coordinates;var kC=[];for(var kI=0;kI<kL.length;kI++){var kN=[];for(var kG=0,kE=kL[kI];kG<kE.length;kG++){var kH=kB(kE[kG],kM);if(kM&&kM.onlyGeometry){if(kE.length===1){kC.push(kH)}else{kN.push(kH)}}else{if(kE.length===1){var kD=kM;if(kM.polygonStyle){kD=kM.polygonStyle;if(kM.polygonStyle instanceof Function){kD=kM.polygonStyle(kJ)||{}}}var kK=new iU(kH,kD);kC.push(kK)}else{kN.push(kH)}}}if(kE.length!==1){if(kM&&kM.onlyGeometry){kC.push(kN)}else{var kD=kM;if(kM.polygonStyle){kD=kM.polygonStyle;if(kM.polygonStyle instanceof Function){kD=kM.polygonStyle(kJ)||{}}}var kK=new iU(kN,kD);kC.push(kK)}}}return kC}function kr(kC){}function e(kG,kD){var kF=[];for(var kC=0;kC<kG.length;kC+=2){var kE=[kG[kC],kG[kC+1]];if(kD.reference&&kD.reference!=="BD09LL"){kE=gcoord.transform(kE,kD.reference||"WGS84",gcoord.BD09LL)}kF.push(kE[0]);kF.push(kE[1])}return kF}function ks(kC){var kD=[Infinity,Infinity,-Infinity,-Infinity];kt(kC,function(kE){if(kD[0]>kE[0]){kD[0]=kE[0]}if(kD[1]>kE[1]){kD[1]=kE[1]}if(kD[2]<kE[0]){kD[2]=kE[0]}if(kD[3]<kE[1]){kD[3]=kE[1]}});return kD}function kt(kL,kQ){var kH,kE,kD,kK,kC,kN,kP,kO,kG,kJ,kF=(kL.type&&kL.type.toLowerCase()==="featurecollection"),kI=(kL.type&&kL.type.toLowerCase()==="feature"),kM=kF?kL.features.length:1;for(kH=0;kH<kM;kH++){kG=(kF?kL.features[kH]["geometry"]:(kI?kL.geometry:kL));kJ=kG.type==="GeometryCollection";kP=kJ?kG.geometries.length:1;for(kK=0;kK<kP;kK++){kN=kJ?kG.geometries[kK]:kG;kO=kN.coordinates;if(kN.type==="Point"){kQ(kO)}else{if(kN.type==="LineString"||kN.type==="MultiPoint"){for(kE=0;kE<kO.length;kE++){kQ(kO[kE])}}else{if(kN.type==="Polygon"||kN.type==="MultiLineString"){for(kE=0;kE<kO.length;kE++){for(kD=0;kD<kO[kE].length;kD++){kQ(kO[kE][kD])}}}else{if(kN.type==="MultiPolygon"){for(kE=0;kE<kO.length;kE++){for(kD=0;kD<kO[kE].length;kD++){for(kC=0;kC<kO[kE][kD].length;kC++){kQ(kO[kE][kD][kC])}}}}else{throw new Error("类型错误")}}}}}}}function i(kL,kQ){var kH,kE,kD,kK,kC,kN,kP,kO,kG,kJ,kF=kL.type==="FeatureCollection",kI=kL.type==="Feature",kM=kF?kL.features.length:1;for(kH=0;kH<kM;kH++){kG=(kF?kL.features[kH]["geometry"]:(kI?kL.geometry:kL));kJ=kG.type==="GeometryCollection";kP=kJ?kG.geometries.length:1;for(kK=0;kK<kP;kK++){kN=kJ?kG.geometries[kK]:kG;kO=kN.coordinates;if(kN.type==="Point"){kO=kQ(kO)}else{if(kN.type==="LineString"||kN.type==="MultiPoint"){for(kE=0;kE<kO.length;kE++){kO[kE]=kQ(kO[kE])}}else{if(kN.type==="Polygon"||kN.type==="MultiLineString"){for(kE=0;kE<kO.length;kE++){for(kD=0;kD<kO[kE].length;kD++){kO[kE][kD]=kQ(kO[kE][kD])}}}else{if(kN.type==="MultiPolygon"){for(kE=0;kE<kO.length;kE++){for(kD=0;kD<kO[kE].length;kD++){for(kC=0;kC<kO[kE][kD].length;kC++){kO[kE][kD][kC]=kQ(kO[kE][kD][kC])}}}}else{throw new Error("类型错误")}}}}}}}function ky(kD){var kC=kD.type==="FeatureCollection";var kE=kD.type==="Feature";var kF=(kC?kD.features[0]["geometry"]:(kE?kD.geometry:kD));if(kF.type){return kF.type}else{throw new Error("类型错误")}}kx.bbox=ks;kx.coordEachReplace=i;kx.getType=ky;return kx})();const c5={point:{symbolPath:{format:"string",defaultValue:""},symbolFillColor:{format:"string",defaultValue:"#000"},symbolFillOpacity:{format:"number",defaultValue:1},symbolScale:{format:"number",defaultValue:1},symbolRotation:{format:"number",defaultValue:0},symbolStrokeColor:{format:"string",defaultValue:"#000"},symbolStrokeOpacity:{format:"number",defaultValue:0},symbolStrokeWeight:{format:"number",defaultValue:0},icon:{format:"string",defaultValue:""},iconSize:{format:"array",defaultValue:[32,32]},uid:{format:"string",defaultValue:"custom-vector-0"},name:{format:"string",defaultValue:""},fontSize:{format:"number",defaultValue:22},color:{format:"string",defaultValue:"#0d20c9"},haloSize:{format:"number",defaultValue:2},strokeColor:{format:"string",defaultValue:"#fff"},textOnIcon:{format:"string",defaultValue:false},textOnIconSize:{format:"array",defaultValue:[32,32]},textOnIconUrl:{format:"string",defaultValue:""},textMargin:{format:"number",defaultValue:0},direction:{format:"number",defaultValue:0},rank:{format:"number",defaultValue:50000},visibility:{format:"boolean",defaultValue:true},nodeType:{format:"number",defaultValue:0},shapeType:{format:"number",defaultValue:0},anchor:{format:"number",defaultValue:0},size:{format:"number",defaultValue:32},scale:{format:"number",defaultValue:1},offset:{format:"object",defaultValue:[0,0]},rotation:{format:"number",defaultValue:0},opacity:{format:"number",defaultValue:1},strokeWeight:{format:"number",defaultValue:0}},polyline:{strokeLineJoin:{format:"string",defaultValue:"miter"},strokeLineCap:{format:"string",defaultValue:"round"},strokeColor:{format:"string",defaultValue:"#142655"},strokeWeight:{format:"number",defaultValue:2},strokeOpacity:{format:"number",defaultValue:1},borderColor:{format:"string",defaultValue:"rgba(27, 142, 236, 1)"},borderWeight:{format:"number",defaultValue:0},strokeTextureUrl:{format:"string",defaultValue:""},strokeTextureWidth:{format:"number",defaultValue:16},strokeTextureHeight:{format:"number",defaultValue:16},strokeStyle:{format:"string",defaultValue:"solid"},dashArray:{format:"object",defaultValue:[8,4]},shapeType:{format:"number",defaultValue:0},visibility:{format:"boolean",defaultValue:true}},polygon:{fillColor:{format:"string",defaultValue:"#142655"},fillOpacity:{format:"number",defaultValue:1},patternMapping:{format:"string",defaultValue:"0, 0, 32, 32"},patternScale:{format:"number",defaultValue:1},patternOffset:{format:"string",defaultValue:"0, 0"},strokeWeight:{format:"number",defaultValue:0},strokeLineJoin:{format:"string",defaultValue:"bevel"},strokeLineCap:{format:"string",defaultValue:"round"},strokeColor:{format:"string",defaultValue:"#dec41b"},strokeOpacity:{format:"number",defaultValue:1},strokeStyle:{format:"string",defaultValue:"solid"},dashArray:{format:"object",defaultValue:[8,4]},visibility:{format:"boolean",defaultValue:true}}};const cy=(function(i){var e={};for(var kq in i){e[kq]={};for(var T in i[kq]){e[kq][T]=i[kq][T].defaultValue}}return e})(c5);const fZ={POINT:"Point",LINE_STRING:"LineString",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",CIRCLE:"Circle",};function fO(e){return e&&typeof ArrayBuffer!=="undefined"&&(e instanceof ArrayBuffer||(e.constructor&&e.constructor.name==="ArrayBuffer"))}function gt(e){if(self){if(self.ImageBitmap&&e instanceof self.ImageBitmap){return true}}else{if(window&&window.ImageBitmap){if(e instanceof window.ImageBitmap){return true}}}return false}const jh={};function aH(i,kq,T){var e=T||{};Object.defineProperty(i,"_classRegistryKey",{value:kq,writeable:false});jh[kq]={_class:i,escape:e.escape||[]}}aH(Object,"Object");aH(cD,"Point");function jG(kv,kt){if(kv===null||kv===undefined||typeof kv==="boolean"||typeof kv==="number"||typeof kv==="string"||kv instanceof Boolean||kv instanceof Number||kv instanceof String||kv instanceof Date||kv instanceof RegExp){return kv}if(fO(kv)){if(kt){kt.push(kv)}return kv}if(gt(kv)){if(kt){var ky=kt.filter(function(i){if(i===kv){return true}else{return false}});!ky&&kt.push(kv)}return kv}if(ArrayBuffer.isView(kv)){const ku=kv;if(kt){kt.push(ku.buffer)}return ku}if(kv instanceof ImageData){if(kt){var ky=kt.filter(function(i){if(i===kv.data.buffer){return true}else{return false}});!ky&&kt.push(kv.data.buffer)}return kv}if(Array.isArray(kv)){const T=[];for(var kq=0;kq<kv.length;kq++){var kz=kv[kq];T.push(jG(kz,kt))}return T}if(typeof kv==="object"){const kr=kv.constructor;const e=kr._classRegistryKey;if(!e){throw new Error("不能被序列化")}const ks=kr.serialize?kr.serialize(kv,kt):{};if(!kr.serialize){for(var kx in kv){if(!kv.hasOwnProperty(kx)){continue}if(jh[e]["escape"].indexOf(kx)>=0){continue}const kw=kv[kx];ks[kx]=jG(kw,kt)}if(kv instanceof Error){ks.message=kv.message}}if(e!=="Object"){ks["_$name"]=e}return ks}else{if(kv instanceof Function){return null}}throw new Error("不能被序列化")}function io(ks){if(ks===null||ks===undefined||typeof ks==="boolean"||typeof ks==="number"||typeof ks==="string"||ks instanceof Boolean||ks instanceof Number||ks instanceof String||ks instanceof Date||ks instanceof RegExp||fO(ks)||gt(ks)||ArrayBuffer.isView(ks)||ks instanceof ImageData){return ks}if(Array.isArray(ks)){var e=ks["_$name"];if(e){var kq=jh[e]["_class"];if(!kq){throw new Error("不能被反序列化")}if(kq.deserialize){return kq.deserialize(ks)}}const kr=[];for(var T=0;T<ks.length;T++){var kv=ks[T];kr.push(io(kv))}return kr}if(typeof ks==="object"){var e=ks["_$name"]||"Object";var kq=jh[e]["_class"];if(!kq){throw new Error("不能被反序列化")}if(kq.deserialize){return kq.deserialize(ks)}const kx=Object.create(kq.prototype);const kw=Object.keys(ks);for(var T=0;T<kw.length;T++){const ku=kw[T];if(ku==="_$name"){continue}const kt=ks[ku];kx[ku]=io(kt)}return kx}throw new Error("不能被反序列化")}function k(ku,ks,kt){if(!ku.length){return kt(null,[])}var kr=ku.length;const kq=new Array(ku.length);var e=null;for(var T=0;T<ku.length;T++){ks(ku[T],function(kv,i){if(kv){e=kv}kq[T]=i;if(--kr===0){kt(e,kq)}},T)}}function gh(kv,ks,ku){if(!kv.length){return ku(null,[])}var kr=kv.length;const kq=new Array(kv.length);var e=null;var T=0;function kt(){ks(kv[T],function(kw,i){if(kw){e=kw}kq[T]=i;if(--kr===0){ku(e,kq)}else{T++;kt()}},T)}kt()}var jS=(function(){var i=true;var kr=256;var e=true;var kt=j2("ditu","normalTraffic");var kq=kt.udt;var ku="//its.map.baidu.com/traffic/";var ks=[[2,"79,210,125,1",3,2,0,[],0,0],[2,"79,210,125,1",3,2,0,[],0,0],[2,"79,210,125,1",4,2,0,[],0,0],[2,"79,210,125,1",5,2,0,[],0,0],[2,"79,210,125,1",6,2,0,[],0,0],[2,"255,208,69,1",3,2,0,[],0,0],[2,"255,208,69,1",3,2,0,[],0,0],[2,"255,208,69,1",4,2,0,[],0,0],[2,"255,208,69,1",5,2,0,[],0,0],[2,"255,208,69,1",6,2,0,[],0,0],[2,"232,14,14,1",3,2,0,[],0,0],[2,"232,14,14,1",3,2,0,[],0,0],[2,"232,14,14,1",4,2,0,[],0,0],[2,"232,14,14,1",5,2,0,[],0,0],[2,"232,14,14,1",6,2,0,[],0,0],[2,"181,0,0,1",3,2,0,[],0,0],[2,"181,0,0,1",3,2,0,[],0,0],[2,"181,0,0,1",4,2,0,[],0,0],[2,"181,0,0,1",5,2,0,[],0,0],[2,"181,0,0,1",6,2,0,[],0,0],[2,"255,255,255,1",4,0,0,[],0,0],[2,"255,255,255,1",5.5,0,0,[],0,0],[2,"255,255,255,1",7,0,0,[],0,0],[2,"255,255,255,1",8.5,0,0,[],0,0],[2,"255,255,255,1",10,0,0,[],0,0]];var T=new hH({transparentPng:true,dataType:2,cacheSize:256,clipTile:true,isFlat:true});T.zIndex=2;T.getTilesUrl=function(kx,ky){if(!kx||ky<7){return null}var kw=kx.x;var kz=kx.y;var kv=ku+"TrafficTileService?level="+ky+"&x="+kw+"&y="+kz+"&time="+(+new Date());if(this.map.getRenderType()==="webgl"){kv=ku+"?qt=vtraffic&z="+ky+"&x="+kw+"&y="+kz+"&udt="+kq}return kv};T.setColors=function(kv){for(var ky=0;ky<ks.length;ky++){var kx=Math.floor(ky/5);var kw=kv[kx];if(kw){if(Object.prototype.toString.call(kw)==="[object String]"){kw=hO.parseCSSColor(kw)}ks[ky][1]=[kw[0],kw[1],kw[2],kw[3]/255].join(",")}}};T.setEdge=function(kv){e=!!kv};T.processData=function(ky){var kC=ky.content;var kA=10;if(typeof ky.precision==="number"){kA=ky.precision*10}var kJ={road:[[],[]]};if(!kC){return kJ}var kH=kC.tf;if(!kH){return kJ}for(var kz=0;kz<kH.length;kz++){var kI=kH[kz][1];var kG=[];var kE=0;var kD=0;var kF=ks[kH[kz][3]];for(var kx=0,kv=kI.length;kx<kv/2;kx++){kE+=kI[kx*2]/kA;kD+=kI[kx*2+1]/kA;kG.push(kE,256-kD)}var kw=kF[1].split(",");kw[3]=kw[3]*255;var kB=kF[2]/2;if(e){kJ.road[0].push([kG,1,2,[255,255,255,255],kB+2])}kJ.road[1].push([kG,1,2,kw,kB])}return kJ};return T})();function ju(){hI.sendMessage(aZ(4,3,3),["layer","traffic"])}ju.prototype=jS;function d7(e){eJ.call(this);e=e||{};this._opts={};this._opts.districts=e.name||"";this._opts.kind=e.kind||0;this._config={};this._config.strokeColor=e.strokeColor||"#00f";this._config.strokeOpacity=typeof e.strokeOpacity==="number"?e.strokeOpacity:1;ch(this._config.strokeOpacity,0,1);this._config.fillColor=e.fillColor||"#ff0";this._config.fillOpacity=typeof e.fillOpacity==="number"?e.fillOpacity:0.6;ch(this._config.fillOpacity,0,1);this._config.strokeWeight=e.strokeWeight||1;this._config.viewport=e.viewport||false;this.disOverlays=[];this.eventAndCallback={};hI.sendMessage(aZ(4,3,6),["layer","district"]);var i=this;he.load("layer",function(){i._asyncSearch()})}d7.inherits(de,"DistrictLayer");e6.extend(d7.prototype,{initialize:function(e){this._map=e;this.addDistrict()},removeDistrict:function(i,e){this._map=i;this.deleteDistrict(e)},toString:function(){return"DistrictLayer"}});function aO(e,i){i=i||{};this.layerName=e||"unknown";this.reference=i.reference;this.level=i.level||-99;this.visible=(i.visible===undefined?true:!!i.visible);this.minZoom=i.minZoom||3;this.maxZoom=i.maxZoom||21;this.markerStyle=i.markerStyle||{};this.polylineStyle=i.polylineStyle||{};this.polygonStyle=i.polygonStyle||{};this.overlayData=[];this._onMap=false;this.clickDistrict=5;this.setData(i.dataSource);hI.sendMessage(aZ(4,3,12),["layer","geojson"])}aO.inherits(e6.BaseClass,"GeoJSONLayer");aO.prototype.init=function(kt){if(this.map){return}this.map=kt;var kr=this;this._onZoomEvent=function(){if(kr.map.getZoom()>=kr.minZoom&&kr.map.getZoom()<=kr.maxZoom){if(!kr._onMap){kr.addDataToMap();kr._onMap=true}}else{if(kr._onMap){kr.removeDataFromMap();kr._onMap=false}}};this.map.on("zoomend",this._onZoomEvent);var kr=this;var e=false;var kq={x:0,y:0};this._layerMouseEvent=function(kw){if(!kr.map||!kr._listeners||!kr.visible||!kr._onMap){return}if(!kr._listeners.onmousemove||Object.keys(kr._listeners.onmousemove).length===0){return}var kv=kr.pickOverlays(kw);var i;if(kv&&kv.length>0){i=new fS("onmousemove");i.features=kv;kr.map.platform.style.cursor=kr.map.config.overlayMoveCursor;e=true}else{if(!e||!kr._listeners.onmouseout||Object.keys(kr._listeners.onmouseout).length===0){return}kr.map.platform.style.cursor=kr.map.config.defaultCursor;i=new fS("onmouseout");i.features=null;e=false}if(i){i.point=kw.point;i.pixel=kw.pixel;i.latLng=kw.latlng;kr.dispatchEvent(i)}};this._layerClickEvent=function(kx){if(!kr.map||!kr._listeners||!kr.visible){return}if((!kr._listeners.onclick&&!kr._listeners.dblclick)||(Object.keys(kr._listeners.onclick).length===0&&Object.keys(kr._listeners.dblclick).length===0)){return}var kv={x:kx.clientX,y:kx.clientY};if(Math.abs(kv.x-kq.x)>kr.clickDistrict||Math.abs(kv.y-kq.y)>kr.clickDistrict){return}var kw=kr.pickOverlays(kx);var i=new fS(kx.type);i.point=kx.point;i.pixel=kx.pixel;i.latLng=kx.latlng;i.features=kw;kr.dispatchEvent(i)};this._layerMouseDownEvent=function(i){kq={x:i.clientX,y:i.clientY}};kt.addEventListener("onmousemove",this._layerMouseEvent);kt.addEventListener("onmouseout",this._layerMouseEvent);kt.addEventListener("onmousedown",this._layerMouseDownEvent);var ks=["onclick"];for(var T=0;T<ks.length;T++){var ku=ks[T];kt.addEventListener(ku,this._layerClickEvent)}this._onZoomEvent()};aO.prototype.remove=function(){if(this.map){this.removeDataFromMap();this.map.removeEventListener("onmousemove",this._layerMouseEvent);this.map.removeEventListener("onmouseout",this._layerMouseEvent);this.map.removeEventListener("onclick",this._layerClickEvent);this.map.removeEventListener("onmousedown",this._layerMouseDownEvent);this.map.removeEventListener("onzoomend",this._onZoomEvent)}this.map=null};aO.prototype.destroy=function(){if(this.map){this.clearData();this.map.removeEventListener("onmousemove",this._layerMouseEvent);this.map.removeEventListener("onmouseout",this._layerMouseEvent);this.map.removeEventListener("onclick",this._layerClickEvent);this.map.removeEventListener("onmousedown",this._layerMouseDownEvent);this.map.removeEventListener("onzoomend",this._onZoomEvent)}this.map=null};aO.prototype.setData=function(e){if(!this.gParse){this.gParse=new gH({reference:this.reference})}if(!e){return}if(this.dataSource&&this.overlayData.length>0){this.clearData()}this.dataSource=e;this.overlayData=this.gParse.readFeaturesFromObject(e,{markerStyle:this.markerStyle,polylineStyle:this.polylineStyle,polygonStyle:this.polygonStyle},this._register.bind(this))};aO.prototype._register=function(e){e.layerName=this.layerName;e.setZIndex(this.level)};aO.prototype.resetStyle=function(){for(var e=0;e<this.overlayData.length;e++){if(this.overlayData[e] instanceof s){var i=this.markerStyle;if(this.markerStyle instanceof Function){i=this.markerStyle(this.overlayData[e].properties)||{}}}if(this.overlayData[e] instanceof br){var i=this.polylineStyle;if(this.polylineStyle instanceof Function){i=this.polylineStyle(this.overlayData[e].properties)||{}}}if(this.overlayData[e] instanceof iU){var i=this.polygonStyle;if(this.polygonStyle instanceof Function){i=this.polygonStyle(this.overlayData[e].properties)||{}}}if(i){this.overlayData[e].setOptions(i)}}};aO.prototype.getData=function(){return this.overlayData};aO.prototype.addOverlay=function(e){var kt=e;if(!(e instanceof Array)){kt=[e]}for(var kq=0;kq<kt.length;kq++){var T=kt[kq];if(T.__proto__ instanceof aS){this._register(T);this.overlayData.push(T);this.map.addOverlay(T)}else{var ks=this.gParse.readFeaturesFromObject(T,{markerStyle:this.markerStyle,polylineStyle:this.polylineStyle,polygonStyle:this.polygonStyle},this._register.bind(this));for(var kr=0;kr<ks.length;kr++){this.overlayData.push(ks[kr]);this.map.addOverlay(ks[kr])}}}};aO.prototype.removeOverlay=function(kq){var kr=kq;if(!(kq instanceof Array)){kr=[kq]}for(var T=0;T<kr.length;T++){var i=kr[T];var e=this.findItemIndex(i);if(e>=0){this.overlayData.splice(e,1);this.map.removeOverlay(i)}}};aO.prototype.findItemIndex=function(T){var i=-1;for(var e=0;e<this.overlayData.length;e++){if(this.overlayData[e].hashCode===T.hashCode){i=e;break}}return i};aO.prototype.addDataToMap=function(){if(this.visible&&this.map&&this.map.getZoom()>=this.minZoom&&this.map.getZoom()<=this.maxZoom){for(var e=0;e<this.overlayData.length;e++){this.map.addOverlay(this.overlayData[e])}}};aO.prototype.removeDataFromMap=function(){if(this.map&&this.overlayData.length>0){for(var e=0;e<this.overlayData.length;e++){this.map.removeOverlay(this.overlayData[e])}}};aO.prototype.clearData=function(){this.dataSource=null;if(this.map&&this.overlayData.length>0){this.removeDataFromMap()}this.overlayData=[]};aO.prototype.pickOverlays=function(ku){var kt=[];if(!this.visible||!this._onMap){return null}for(var kr=0;kr<this.overlayData.length;kr++){var ks=this.overlayData[kr];var kq;if(!ks&&!ks.isVisible()){continue}if(ks.toString()==="Marker"){kq=ks._getInPnBox(ku.pixel);if(kq){kt.push(ks)}continue}if(ks.toString()!=="Polyline"){kq=ks._getInPnpoly(ku.point)}else{kq=ks._getProximity(ku.point)}var T=kq.dist;if(T>=0&&T<ks._config.mouseOverTolerance){kt.push(ks)}}return kt.length>0?kt:null};aO.prototype.setLevel=function(e){if(e>-999&&e<9999){this.level=e;for(var T=0;T<this.overlayData.length;T++){this.overlayData[T].setZIndex(this.level)}if(this.map){this.map.fire(new BMapGL.Event("onupdate","line"))}}};aO.prototype.setClickDistrict=function(e){this.clickDistrict=e||5};aO.prototype.getLevel=function(){return this.level};aO.prototype.setVisible=function(i){var e=!!i;if(this.visible!==e){this.visible=e;if(e){this.addDataToMap()}else{this.removeDataFromMap()}}};aO.prototype.getVisible=function(){return this.visible};aO.prototype.toString=function(){return"GeoJSONLayer"};function kd(i){var i=i||{};var ks=i.transform||{source:"EPSG3857",target:"BD09MC"};if(!ks.source){ks.target="EPSG3857"}if(!ks.target){ks.target="BD09MC"}const kq=i.tileUrlTemplate||"";const kw=i.xTemplate||function(kD,kF,kE){return kD};const kA=i.yTemplate||(i.tms?function(kD,kF,kE){return Math.pow(2,kE)-kF-1}:function(kD,kF,kE){return kF});const ku=i.zTemplate||function(kD,kF,kE){return kE};const kz=i.bTemplate||function(kD,kG,kF){const kE=dI.getTileRangeExtent([kF,kD,kG]);return kE.minX+","+kE.minY+","+kE.maxX+","+kE.maxY};const kr=i.wTemplate||function(kD,kF,kE){return 512};const kv=i.hTemplate||function(kD,kF,kE){return 512};var kB=i.extent||[];const kt=i.extentCRSIsWGS84||false;var T=i.minZoom||0;var kx=i.maxZoom||23;var ky=i.spanLevel||0;if(!i.showRegion||"insideoutside".indexOf(i.showRegion)===-1){i.showRegion="inside"}var kC=new hH({transform:ks,png8:i.png8||false,retry:i.retry||false,retryTime:i.retryTime||600,transparentPng:true,dataType:i.dataType||1,spanLevel:ky,tileTypeName:"xyz",cacheSize:256,customLayer:true,clipTile:false,boundary:i.boundary||false,showRegion:i.showRegion,useThumbData:i.useThumbData||false});if(i.zIndex){kC.zIndex=i.zIndex}(kB.length===4)&&kt&&(kB=dI.fromEPSG4326(kB));kC.getTilesUrl=function(kE,kK,kI){if(!kE||kK<0||kK<(T+ky)||kK>(kx+ky)){kC.tileCache.clear();return null}if(ks.source!=="BD09MC"){kE.x=dI.getTilesLoop(kK,kE.x)}if(kB.length===4){var kJ=dI.getTileRangeExtent([kK,kE.x,kE.y]);var kH=e([kJ.minX,kJ.minY,kJ.maxX,kJ.maxY]);if(!kH){return null}}var kF="";if(kq){kF=kq;var kG=/[^\{}]*\{(.*)\}[^\}]*/;kF.match(kG);var kD=[];if(RegExp.$1){kD=RegExp.$1.split(",")}kF=kF.replace(/\{(.*)\}/,kD[(kE.x+kE.y)%kD.length]);kF=kF.replace(/\[x\]/gi,kw(kE.x,kE.y,kK));kF=kF.replace(/\[y\]/gi,kA(kE.x,kE.y,kK));kF=kF.replace(/\[z\]/gi,ku(kE.x,kE.y,kK));kF=kF.replace(/\[b\]/gi,kz(kE.x,kE.y,kK));kF=kF.replace(/\[w\]/gi,kr(kE.x,kE.y,kK));kF=kF.replace(/\[h\]/gi,kv(kE.x,kE.y,kK))}else{return null}return kF};function e(kD){if(kB&&kB instanceof Array&&kB.length===4){if((kB[0]<=kD[2]&&kB[1]<=kD[3])&&(kB[2]>=kD[0]&&kB[3]>=kD[1])){return true}else{return false}}return true}hI.sendMessage(aZ(4,3,7),["layer","xyz"]);return kC}function dy(i){this.src=c9();this.tileMaskUvCache=new aA(64,{clearCallback:function(ks){}});var kr=6;if(i.pixelMap){this.opacity=typeof i.pixelMap.opacity==="number"?i.pixelMap.opacity:1;ch(this.opacity,0,1);if(this.opacity<1){i.useThumbData=false}var kq=i.pixelMap||{};this.colors=kq.colors||["#F9F871","#FFC75F","#FF9671","#FF6F91","#D65DB1","#845EC2"];this.positions=kq.positions||[0,0.2,0.4,0.6,0.8,1];this.domain=kq.domain||[0,255];this.clamp=kq.clamp||this.domain;this.noData=(kq.noData!==undefined)?kq.noData:-99999;this.fomularC=kq.fomularC||"float generateValue(vec4 pixel){return pixel.r * 255.;}";this.fomularJS=kq.fomularJS||function(ks){return ks.r};this.maskPng=kq.maskPng||null;if(this.maskPng){this.loadMaskPng(this.maskPng)}this.maskData=kq.maskData||-1;this.maskCoord=kq.maskCoord||null;this.fHashcode=o({str:this.fomularC});var e=this.canPixelMap();if(e){this.isPixelMap=true;this.setPixelMap()}kr=i.pixelMap.cacheSize||kr}var T=new kd(i);T.ontology=this;this.layer=T;this.cacheSize=kr;this.tileCache=new aA(this.cacheSize,{clearCallback:function(ks){}});this.tileImageDataCache=new aA(this.cacheSize,{clearCallback:function(ks){}});hI.sendMessage(aZ(4,3,16),["layer","pixel"])}dy.inherits(e6.BaseClass,"PixelLayer");e6.extend(dy.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=o({colors:i,positions:e});this.pixelColorMap=hO.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=o({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 fS("onupdate");this.layer.map.dispatchEvent(e)}},_getInLayer:function(ky){if(!this.map){return null}var kx=Math.floor(this.map.getZoom());var kq=dI.transformBDmcPoint(ky,this.layer.transform);var ku=dI.getTileCoordForXYAndZ_(kq[0],kq[1],kx,false);var T=ku.join("-");var e=this.tileCache.getData(T);if(e){return e}var kr=this.layer.zIndex;var kt=this.map._featureMgr.result.bkData;var kv=kt[kr][2];var kz=null;for(var ks=0;ks<kv.length;ks++){var ku=kv[ks];var kw=ku.tileInfo.zoom+"-"+ku.tileInfo.col+"-"+ku.tileInfo.row;if(T===kw){kz=ku;break}}this.tileCache.setData(T,kz);return kz},_initEvent:function(kr){this.map=kr;var T=this;this._layerMouseEvent=function(kv){if(!T.map){return}var kt;var i=kv.point;var ku=T._getInLayer(i);if(ku){T.prox=ku;kt=new fS("onmousemove");T.map.platform.style.cursor=T.map.config.overlayMoveCursor}else{T.map.platform.style.cursor=T.map.config.defaultCursor;T.prox=null}if(kt){kt.point=kv.point;kt.pixel=kv.pixel;kt.latLng=kv.latlng;T.dispatchEvent(kt)}};this._layerClickEvent=function(kv){if(!T.map){return}var kt;var i=kv.point;var ku=T.getImagePixel(i);if(ku){kt=new fS(kv.type);kt.point=i;kt.pixel=kv.pixel;kt.latLng=kv.latlng;kt.color=ku;kt.value=T.getValue(kt.color);T.dispatchEvent(kt)}};kr.addEventListener("onmousemove",this._layerMouseEvent);var kq=["onclick","dblclick"];for(var e=0;e<kq.length;e++){var ks=kq[e];kr.addEventListener(ks,this._layerClickEvent)}kr.addEventListener("removetilelayer",function(i){if(i.target&&i.target.ontology){if(i.target.ontology.src===T.src){kr.removeEventListener("onmousemove",T._layerMouseEvent);kr.removeEventListener("onclick",T._layerClickEvent);kr.removeEventListener("ondblclick",T._layerClickEvent);T._clearCache()}}});kr.on("destroy",function(){T._clearCache()})},_clearCache:function(){var e=this;e.prox=null;e.tileCache.clear();e.tileImageDataCache.clear();e.tileMaskUvCache.clear();e._layerMouseEvent=null;e._layerClickEvent=null;e.imageMaskObject=null;e.pHashcode=null;e.pixelColorMap=null;e.layer.ontology=null;e.layer=null},getImagePixel:function(kv){if(!this.map){return null}var kq=dI.transformBDmcPoint(kv,this.layer.transform);var ku=this._getInLayer(kv);if(!ku){return null}if(!this.getImageMaskPixel(kq)){return null}var ks=[ku.tileInfo.zoom,ku.tileInfo.col,ku.tileInfo.row];var kt=dI.getTileRangeExtent(ks);var e=this.getImageObject(ku.textureSource,ks.join("-"));var T=Math.floor((kq[0]-kt.minX)/(kt.maxX-kt.minX)*e.width);var i=Math.floor((-kq[1]+kt.maxY)/(kt.maxY-kt.minY)*e.height);var kr=Math.floor((i*e.width+T)*4);return[e.data.data[kr],e.data.data[kr+1],e.data.data[kr+2],e.data.data[kr+3],]},getImageObject:function(kr,kq){var ks=this.tileImageDataCache.getData(kq);if(ks){return ks}var i=document.createElement("canvas");i.width=kr.width;i.height=kr.height;var T=i.getContext("2d");T.drawImage(kr,0,0,kr.width,kr.height);var e={width:kr.width,height:kr.height,data:T.getImageData(0,0,kr.width,kr.height)};this.tileImageDataCache.setData(kq,e);T=null;i=null;return e},getValue:function(i){if(this.isPixelMap&&i&&this.fomularJS){if(!(i instanceof Array)){i=this.getImagePixel(i.point)}var e=this.fomularJS({r:i[0],g:i[1],b:i[2],a:i[3]});if(e>=this.clamp[0]&&e<=this.clamp[1]){return e}}return null},setMaskImageObject:function(T){var e=document.createElement("canvas");e.width=T.width;e.height=T.height;var i=e.getContext("2d");i.drawImage(T,0,0,T.width,T.height);this.imageMaskObject={width:T.width,height:T.height,data:i.getImageData(0,0,T.width,T.height)};i=null;e=null},getImageMaskPixel:function(e){if(!this.imageMaskObject||!this.maskBox){return true}var kq=[e];var kv=this.maskBox||[];var ks=kv[1][0]-kv[0][0];var kr=kv[1][1]-kv[0][1];var T=Math.floor((kq[0][0]-kv[0][0])/ks*this.imageMaskObject.width);var i=Math.floor((-kq[0][1]+kv[1][1])/kr*this.imageMaskObject.height);var ku=Math.floor((i*this.imageMaskObject.width+T)*4);if(T>this.imageMaskObject.width||T<0){return null}if(i>this.imageMaskObject.height||i<0){return null}var kt=this.imageMaskObject.data.data;if(ku+3>kt.length){return false}if(kt[ku+3]>0){if(this.maskData>-1&&this.maskData!==kt[ku]){return false}return true}return false},calMaskBox:function(){var T=this.maskCoord||[];if(this.hasMaskPng&&T&&T.length===2){var e=[];for(var kq=0;kq<T.length;kq++){e[kq]=dI.transformBDmcPoint(jn.convertLL2MC(T[kq]),this.layer.transform)}this.maskBox=e;this.tileMaskUvCache.clear()}else{this.maskBox=null}},buildFillMaskVertex:function(kw,ku,kt){var kv=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];if(!this.maskBox){return kv}var ky=[kw,ku,kt].join("-");var e=this.tileMaskUvCache.getData(ky);if(e){return e}if(this.hasMaskPng){var kB=this.maskBox||[];var ks=[kt,kw,ku];var kx=dI.getTileRangeExtent(ks);var kr=kB[1][0]-kB[0][0];var T=kB[1][1]-kB[0][1];var kA=(kx.minX-kB[0][0])/kr;var kz=(kx.minY-kB[0][1])/T;var kq=(kx.maxX-kB[0][0])/kr;var i=(kx.maxY-kB[0][1])/T;kv=[kA,kz,kq,kz,kq,i,kA,kz,kq,i,kA,i]}this.tileMaskUvCache.setData(ky,kv);return kv},loadMaskPng:function(T){var e=this;function i(kr,kq){e.maskTextureSource=kq?kr:null;if(kq){e.hasMaskPng=true;e.setMaskImageObject(kr);e.calMaskBox();e.doOnceDraw()}else{e.hasMaskPng=false}}this.imageLoad(T,i)},imageLoad:function(i,kr){if(!i){kr&&kr(null,false)}var e=new Image();e.crossOrigin="anonymous";e.onload=function kq(){kr&&kr(this,true)};e.onerror=function T(){kr&&kr(null,false)};e.src=i},toString:function(){return"PixelLayer"}});function jo(i,e){this.id=i;this.layerName=e;this.properties=null}function eh(e){this._opt=e||{};this._layerId=c9();this._opt.defaultOrder=(this._opt.defaultOrder===undefined)?true:this._opt.defaultOrder;this.minZoom=this._opt.minZoom||3;this.maxZoom=this._opt.maxZoom||23;this.useThumb=(this._opt.useThumb===undefined)?true:this._opt.useThumb;this.gridModel=this._opt.gridModel||eh.GridModel.BAIDUWEB;this.noCollision=(this._opt.noCollision===undefined)?true:this._opt.noCollision;if(this.gridModel===eh.GridModel.BAIDUWEB){this._opt.reference="BD09MC"}else{if(!this._opt.transform){this._opt.transform={source:"BD09MC",target:"BD09MC"};this._opt.reference="BD09MC"}else{this._opt.reference=this._opt.transform.source||"GCJ02";if(this._opt.reference==="EPSG3857"){this._opt.reference="WGS84"}}}this.loadModule=false;if(this._opt.useWorker===undefined){this._opt.useWorker=true}this.upStyle=this._opt.useWorker?false:"useMain";this._stateCube={};hI.sendMessage(aZ(4,3,8),["layer","mvt"]);var i=this;he.load("mvtParse",function(){i._async()},true);i.init(e)}eh.GridModel={BAIDUWEB:0,GOOGLEWEB:1};eh.LayerTypes={POINT:"point",LINE:"line",FILL:"fill"};eh.inherits(e6.BaseClass,"MVTLayer");e6.extend(eh.prototype,{_async:function(){this.loadModule=true;this.mvt=new eh.MVTParse(this._opt);this.resolveStyle(this._opt);if(this.upStyle){this.doOnceDraw()}},init:function(i){i.dataType=2;i.cacheSize=256;if(i.spanLevel===undefined||typeof i.spanLevel!=="number"){i.spanLevel=0}if(this.gridModel===eh.GridModel.BAIDUWEB){var e=this.createTileLayer(i);i.spanLevel=0;this.spanLevel=0}else{if(this.gridModel===eh.GridModel.GOOGLEWEB){var e=new kd(i);this.spanLevel=i.spanLevel}}var kq={type:"vector",layerId:this._layerId,g:this.gridModel,mc:this._opt.reference==="BD09MC"?true:false,};this.layerOption=Object.assign(kq,this._opt);if(i.index&&i.index>0){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 fS("ontilesloadstart"))});e.addEventListener("ontilesloadend",function(){T.dispatchEvent(new fS("ontilesloadend"))})},createTileLayer:function(i){const kq=i.tileUrlTemplate||"";const kv=i.xTemplate||function(kC,kE,kD){return kC};const kA=i.yTemplate||function(kC,kE,kD){return kE};const kt=i.zTemplate||function(kC,kE,kD){return kD};const kz=i.bTemplate||function(kC,kF,kE){const kD=jn.tileToBoundRange({col:kC,row:kF,zoom:kE,baseTileSize:256});return kD.MC.sw.lng+","+kD.MC.sw.lat+","+kD.MC.ne.lng+","+kD.MC.ne.lat};var kB=i.extent||[];const ku=i.extentCRSIsWGS84||false;var T=i.minZoom||0;var kx=i.maxZoom||23;var ky=i.spanLevel||0;var kw=new hH({transparentPng:true,dataType:2,spanLevel:ky,tileTypeName:"web",cacheSize:256,customLayer:true,clipTile:false,boundary:false,useThumbData:i.useThumbData||false});if(kB.length===4){if(ku){kB=dI.fromEPSG4326(kB)}var kr=dI.transformPointArr([kB[0],kB[1]],"EPSG3857","BD09MC");var ks=dI.transformPointArr([kB[2],kB[3]],"EPSG3857","BD09MC");kB=[kr[0],kr[1],ks[0],ks[1]]}kw.getTilesUrl=function(kD,kJ,kI){if(!kD||kJ<0||kJ<(T+ky)||kJ>(kx+ky)){kw.tileCache.clear();return null}if(kB.length===4){const kG=jn.tileToBoundRange({col:x,row:y,zoom:z,baseTileSize:256});var kH=e([kG.MC.getMin().lng,kG.MC.getMin().lat,kG.MC.getMax().lng,kG.MC.getMax().lat]);if(!kH){return null}}var kE="";if(kq){kE=kq;var kF=/[^\{}]*\{(.*)\}[^\}]*/;kE.match(kF);var kC=[];if(RegExp.$1){kC=RegExp.$1.split(",")}kE=kE.replace(/\{(.*)\}/,kC[(kD.x+kD.y)%kC.length]);kE=kE.replace(/\[x\]/gi,kv(kD.x,kD.y,kJ));kE=kE.replace(/\[y\]/gi,kA(kD.x,kD.y,kJ));kE=kE.replace(/\[z\]/gi,kt(kD.x,kD.y,kJ));kE=kE.replace(/\[b\]/gi,kz(kD.x,kD.y,kJ))}else{return null}return kE};function e(kC){if(kB&&kB instanceof Array&&kB.length===4){if((kB[0]<=kC[2]&&kB[1]<=kC[3])&&(kB[2]>=kC[0]&&kB[3]>=kC[1])){return true}else{return false}}return true}return kw},compileExpress:function(i,e){var i=eh.ExpressParse.normalizePropertyExpression(i,e);return i},resolveStyle:function(ks){var kq=ks||{};if(kq.style){var kr={};if(!kq.layers||kq.layers.length===0){var ku=eh.LayerTypes.POINT;var i=eh.LayerTypes.LINE;var kt=eh.LayerTypes.FILL;if(kq.style[ku]){kq.style[ku].type="point"}if(kq.style[i]){kq.style[i].type="polyline"}if(kq.style[kt]){kq.style[kt].type="polygon"}}for(var T in kq.style){if(kq.style.hasOwnProperty(T)){var e=kq.style[T];this._styleFormat(e.type,e.painter,T,kr)}}this.styleExpress=kr}},_styleFormat:function(kr,e,i,kq){var kt={};var ku=c5[kr];if(!ku){return}for(var T in e){if(e.hasOwnProperty(T)){var ks=this.compileExpress(e[T],ku[T]);kt[T]=ks}}kq[i]={type:kr,painter:kt}},evaluateContext:function(e,T,kq){var i=e+"_"+T.getId();var kr=this._stateCube[i];if(kr){T.setState(kr)}else{T._state={}}return{properties:function(){return T&&T.getProperties()},featureState:kq===true?{}:(T&&T.getState())}},evaluates:function(i,kq,kr){if(!this.styleExpress||!this.styleExpress.hasOwnProperty(i)){return null}var kt=this.styleExpress[i].painter;var e={};for(var T in kt){if(kt.hasOwnProperty(T)){var ks=kt[T].evaluate(this.evaluateContext(i,kq,kr));e[T]=ks}}return e},_updateState:function(T,kq,e){if(T instanceof jo&&T.layerName&&T.id){var i=T.layerName+"_"+T.id;if(e){this._set(kq,this._stateCube,i)}else{this._stateCube[i]=kq}this._stateCube[i].rank=(this._stateCube[i].rank||0)+1}else{if(typeof T==="string"){if(e){this._set(kq,this._stateCube,T)}else{this._stateCube[T]=kq}this._stateCube[T].rank=(this._stateCube[T].rank||0)+1}}},updateState:function(kr,ks,e){var T=JSON.stringify(this._stateCube);if(!(ks&&typeof ks==="object"&&Object.keys(ks).length>0)){return}if(!e){this._stateCube={}}if(kr instanceof Array){for(var kq=0;kq<kr.length;kq++){this._updateState(kr[kq],ks,e)}}else{this._updateState(kr,ks,e)}var kt=JSON.stringify(this._stateCube);if(T!==kt){this.doOnceDraw()}},replaceAllState:function(e){var i=JSON.stringify(this._stateCube);this._stateCube=e;var T=JSON.stringify(this._stateCube);if(i!==T){this.doOnceDraw()}},getAllState:function(){return this._stateCube},getStateByLayerName:function(){},removeState:function(kq){var e=JSON.stringify(this._stateCube);if(kq instanceof Array){for(var T=0;T<kq.length;T++){if(kq[T] instanceof jo&&kq[T].layerName){delete this._stateCube[kq[T].layerName+"_"+kq[T].id]}else{if(typeof kq[T]==="string"){delete this._stateCube[kq[T]]}}}}else{if(kq instanceof jo&&kq.layerName){delete this._stateCube[kq.layerName+"_"+kq.id]}else{if(typeof kq==="string"){delete this._stateCube[kq]}}}var kr=JSON.stringify(this._stateCube);if(e!==kr){this.doOnceDraw()}},clearState:function(){var e=JSON.stringify(this._stateCube);if(e!=="{}"){this._stateCube={};this.doOnceDraw()}},_set:function(i,kr,T){var kq=kr[T]||(kr[T]={});for(var e in i){kq[e]=i[e]}},doOnceDraw:function(){if(this.map){var e=new fS("onupdate");this.map.dispatchEvent(e)}},_releaseOutViewTileData:function(e){if(!this.map||!this.map.dispatcher){return}var i=this;e.layerId=this._layerId;this.map.dispatcher.broadcast("release",e,function(ks,T){for(var kr=0;kr<T.length;kr++){for(var kq=0;kq<T[kr].length;kq++){i.layer.tileCache.removeData(T[kr][kq].tileKey);i.layer._checkLayerTilesLoaded()}}})},_loadTile:function(ks,T){this.curViewTilesInfo=ks;if(!this.loadModule||!this.upStyle){return}var kD=this.layer.map;this._releaseOutViewTileData(ks);var kt=kD.getZoom();if(kt<this.minZoom||kt>this.maxZoom){kD._featureMgr.clearData(this.layer.drawIndex);kD._featureMgr.clearLabelOverlayData(this.layer.drawIndex);kD._featureMgr.clearLabelData(this.layer.drawIndex);return}var ku=this.layer.getZoomState();if(T){this.thumbCache={};var kB=-1;this.layer.tileLabels=[];var kx=kD._customLabelMgr.virtualTiles["mvt_"+this.layer.drawIndex];if(kx&&kx.label){this.layer.tileLabels.push(kx.label)}for(var kz=0,ky=ks.length;kz<ky;kz++){var kA=ks[kz];var kq=this.layer.getTileKey(kA);var kC=this.layer.tileCache.getData(kq);kB=kA.zoom;if(this.useThumb){this._setThumbData(kC,kA,ku)}else{if(kC&&kC.status==="ready"){kD._featureMgr.setData(kC,this.layer.drawIndex,2);this._loadCacheLabel(kA,kC)}}}this.layer.tileLabels.labelZoom=kB;this.layer.updateLabels(ku);if(!this.noCollision){var kr=Math.floor(kt);var kw=kt-kr;var kv=Math.floor(this.layer.LAST_CALC_ZOOM);var e=this.layer.LAST_CALC_ZOOM-kv;var kF=false;if(this.layer.hasZoomChange){if(Math.abs(kt-this.layer.LAST_CALC_ZOOM)>=0.5){kF=true}else{if(kw<0.5&&e>=0.5){kF=true}else{if(kw>=0.5&&e<0.5){kF=true}}}if(kF){this.layer.cacheDataCollideLabels(0)}this.layer.LAST_CALC_ZOOM=kt}else{if(this.layer.tileLabels.length>0){this.layer.cacheDataCollideLabels(e6.Browser.ie?50:30)}}}else{this.layer.cacheDataCollideLabels(0)}return}for(var kz=0,ky=ks.length;kz<ky;kz++){var kA=ks[kz];var kq=this.layer.getTileKey(kA);var kC=this.layer.tileCache.getData(kq);if(!kC){kC={status:"init",retry:0};this.layer.numTileLoading++}if(kC.status!=="ignore"&&kC.status!=="ready"&&kC.status!=="loading"){kC.status="loading";this.layer.tileCache.setData(kq,kC);if(this.upStyle==="useMain"){var kE=this;this._loadTileData(kA,function(kG,kH,i){kE._tileDataCbk(kG,kH,i)})}else{if(this.upStyle){this._loadTileDataByWorker(kA)}}}}},_loadCacheLabel:function(T,i){var kr=i.tileData.hasChangeLabel();if(kr){i.label.status="init"}if(i.label.status==="ready"){i.label.tileInfo=i.tileInfo;this.layer.tileLabels.push(i.label);if(i.label.textureSources&&i.label.textureSources[T.zoom]&&this.map._webglMapScene){var kq=this.map._webglMapScene._painter;var e=i.label.imgKey;if(!kq._labelTextureAtlasOffset[e]){kq._addToAsyncJob(i.label.textureSources[T.zoom])}}}else{if(i.label.status!=="processing"){this._processLabelData(i)}}},getLayerVisible:function(i){var T=this._opt.style;if(!T||!T[i]){return true}else{if(T[i].visible===false){return false}else{var kr=this._opt.style[i].minZoom||3;var e=this._opt.style[i].maxZoom||23;var kq=this.map.getZoom();if(kq<kr||kq>e){return false}return true}}},_setThumbData:function(i,e,T){if(T===1){this._dataFitGrid(i,e,3)}else{if(T===-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(kq,kt){var T=this.minZoom;var e=kq.col;var kw=kq.row;var kv=kq.zoom;for(var ku=1;ku<=kt;ku++){var kr=this._getParentTiles(e,kw,kv,T);if(kr===null){continue}kr.tileSize=kq.tileSize;kr.tileTypeName=kq.tileTypeName;kr.transform=kq.transform;var kx=this.layer.getTileKey(kr);var ks=this.layer.tileCache.getData(kx);if(ks&&ks.status==="ready"){ks.key=kx;return ks}e=kr.col;kw=kr.row;kv=kr.zoom}return false},_findChild:function(i,kt){var kv=this.maxZoom;var e=i.col;var kw=i.row;var ku=i.zoom;var kr=this._getChildTiles(e,kw,ku,kv,kt);if(!kr){return false}for(var kq=0;kq<kr.length;kq++){var T=this.layer.getTileKey(kr[kq]);var ks=this.layer.tileCache.getData(T);if(this.curViewTilesInfo["id_"+kr[kq].col+"_"+kr[kq].row+"_"+kr[kq].zoom]&&(!ks||ks.status!=="ready")){return false}}return true},_dataFitGrid:function(T,i,kq){var e=this._findParent(i,kq);if(e){if(this.thumbCache[e.key]){this.map._featureMgr.setData(T,this.layer.drawIndex,2);this._loadCacheLabel(i,T)}else{if(this.thumbCache[e.key]===undefined){if(this._findChild(e.tileInfo,i.zoom-e.tileInfo.zoom)){this.thumbCache[e.key]=true;this.map._featureMgr.setData(T,this.layer.drawIndex,2);this._loadCacheLabel(i,T)}else{this.thumbCache[e.key]=false;this.layer.map._featureMgr.setData(e,this.layer.drawIndex,0);this._loadCacheLabel(e.tileInfo,e)}}}}else{if(T&&T.status==="ready"){this.map._featureMgr.setData(T,this.layer.drawIndex,2);this._loadCacheLabel(i,T)}}},_findChildZoomTile:function(T,ku){var kx=this.maxZoom;var e=T.col;var ky=T.row;var kw=T.zoom;for(var kv=1;kv<=ku;kv++){var kz=false;var ks=this._getChildTiles(e,ky,kw,kx,kv);if(!ks){continue}for(var kr=0;kr<ks.length;kr++){var kq=this.layer.getTileKey(ks[kr]);var kt=this.layer.tileCache.getData(kq);if(kt&&kt.status==="ready"){this.layer.map._featureMgr.setData(kt,this.layer.drawIndex,1);this._loadCacheLabel(ks[kr],kt);kz=true}}if(kz){break}}},_getParentTiles:function(e,T,i,kq){if(i-1<kq){return null}return{col:Math.floor(e/2),row:Math.floor(T/2),zoom:i-1,useZoom:i-1,loopOffsetX:0}},_getChildTiles:function(kq,kz,ky,kx,kt){var kA=[];if(ky+kt>kx){return null}var kw=Math.pow(2,kt);var e=kq*kw;var kv=kz*kw;var ku=ky+kt;var kA=[];for(var kr=0;kr<kw;kr++){var ks=e+kr;for(var T=0;T<kw;T++){var i=kv+T;kA.push({col:ks,row:i,zoom:ku,useZoom:ku,loopOffsetX:0})}}return kA},_loadTileDataByWorker:function(i){if(!this.map||!this.map.dispatcher){return}var ks=this.map.dispatcher.getActor();if(!ks){return}var T=i.col;var kx=i.row;var kw=i.zoom;var e=this.layer.getTilesUrl(new fr(T,kx),kw,i);if(!e){return}var kr=this.layer.getTileKey(i);var ku="id_"+T+"_"+kx+"_"+kw;var kt=this._opt.header||null;if(this._opt.header instanceof Function){kt=this._opt.header(e)}if(this._opt.urlCallback instanceof Function){e=this._opt.urlCallback(e)}var kq={type:"vector",layerId:this._layerId,x:T,y:kx,z:kw,tileKey:kr,tileUrl:e,spanLevel:this._opt.spanLevel,header:kt,encrypt:this._opt.encrypt||false};var kv=this;ks.send("loadTile",kq,function(kA,kz){if(!kv.layer.tileCache){kv.layer._checkLayerTilesLoaded();return}var ky=kv.layer.tileCache.getData(kr);if(!ky){kv.layer._checkLayerTilesLoaded();return}if(kA||!kz){ky.status="ignore";kv.layer._checkLayerTilesLoaded()}else{var kB=new eh.TileFamilyParse(kv.layerOption,kq).deserialize(kz,kv);ky.tileInfo=i;ky.tileData=kB;kv._processLabelData(ky);kv.layer.callbackDataQueue.push([kr,ky,ku]);if(kv.processDataTimer){return}kv.processDataTimer=setTimeout(function(){while(kv.layer&&kv.layer.callbackDataQueue.length>0){kv.layer._checkLayerTilesLoaded();var kD=kv.layer.callbackDataQueue.shift();kv._setTileData(kD[0],kD[1],kD[2])}var kC=new fS("onupdate");kv.map.dispatchEvent(kC);kv.processDataTimer=null},0)}})},_loadTileData:function(i,e){var kq=i.col;var ku=i.row;var kr=i.zoom;var T=this.layer.getTilesUrl(new fr(kq,ku),kr,i);if(!T){return}var kt=this.layer.getTileKey(i);var ks=new XMLHttpRequest();ks.open("GET",T,true);ks.responseType="arraybuffer";ks.timeout=3000;ks.ontimeout=function(){e&&e(null,kt,i)};ks.onreadystatechange=function(kv){if(this.readyState===4){if(this.status===200){e&&e(ks.response,kt,i);return}if(this.status>=400||this.status===0){e&&e(null,kt,i)}else{e&&e(null,kt,i)}}};ks.send()},_tileDataCbk:function(kr,kt,i){var e=this.layer.tileCache.getData(kt);if(!e){return}var ks=this.layer.map;var T=this;if(!kr||typeof kr==="string"){e.status="init";e.reloadTimer=setTimeout(function(){if(e.retry<3){e.retry++;e.status="loading";T._loadTileData(i,function(kv,kw,ku){T._tileDataCbk(kv,kw,ku)})}else{e.status="ignore"}},3000);return}if(e.reloadTimer){clearTimeout(e.reloadTimer);e.reloadTimer=null}var kq=(function(ku){return function(){var kv=i.col;var ky=i.row;var kw=i.zoom;var kx="id_"+kv+"_"+ky+"_"+kw;e.tileInfo=i;e.tileData=T.mvt.readFeatures(ku,T,ks,{x:kv,y:ky,z:kw,g:T.gridModel,mc:T._opt.transform&&T._opt.transform.source==="BD09MC"?true:false});T._processLabelData(e);T.layer.callbackDataQueue.push([kt,e,kx]);if(T.processDataTimer){return}T.processDataTimer=setTimeout(function(){while(T.layer.callbackDataQueue.length>0){var kz=T.layer.callbackDataQueue.shift();T._setTileData(kz[0],kz[1],kz[2])}T.doOnceDraw();T.processDataTimer=null},200)}})(kr);ks.jobScheduler.addJob(kq)},_setTileData:function(T,e,i){e.status="ready";this.layer.tileCache.setData(T,e);if(this.layer.curViewTilesInfo[i]){e.dataType=hV}},_processLabelData:function(T){if(!T.tileData){return}T.label=T.tileData.getTileLabels();if(!T.label){return}if(T.label.status==="processing"){return}var i=T.tileInfo;var e=this._getTileTexImgKey(i);T.label.imgKey=e;T.label.status="processing";var kq=this;kq.layer.updateAllIconsTextureCoords(T);this.layer.labelProcessor.loadIconImages(T,function(ks){kq.layer.updateAllIconsTextureCoords(ks)},true);var kr=this.layer.map.tileMgr.getLabelTextCanvas();kr.drawCustomLabelsOnCanvas(T.label.fixedLabel,function(ks){if(ks){if(!T.label.textureHeights){T.label.textureHeights=[]}T.label.textureHeights[i.useZoom]=ks.height}kq.layer._doWorkAfterLabelImageLoad(T,ks,null,e)})},_getTileTexImgKey:function(i){var e="mvt_"+this.layer.drawIndex+"_"+i.col+"_"+i.row+"_"+i.zoom+"_";e=bD.getGUID(e);return e},_updateBRushCube:function(kt){var kv=kt.tileData;for(var T in kv){if(kv.hasOwnProperty(T)){var e=kv[T];for(var kr=0;kr<e.length;kr++){var kq=e[kr];var ks=kq.getBox();var ku={minX:ks[0],minY:ks[1],maxX:ks[2],maxY:ks[3],lN:T,f:kq}}}}},intersectFeatures:function(e){var ks=this._geojsonToSouceXY(e);var T=this._bboxTile(ks);T=this._intersectTile(ks,T);if(!T){return null}var ku=this.layer.map._featureMgr.result.bkData[this.layer.drawIndex][2];var kq=[];var kz=null;for(var kv=0;kv<ku.length;kv++){var kr=ku[kv].tileInfo;var kA=kr.zoom+"_"+kr.col+"_"+kr.row;if(T[kA]){if(!ku[kv].tileData||!ku[kv].tileData.layers){continue}var kt=ku[kv].tileData.layers;var ky=null;for(var kx in kt){var kw=kt[kx];if(T[kA][4]){this._featuresInter(kx,kw.features,kq)}else{if(kw.layerType==="Point"||kw.layerType==="MultiPoint"){if(!kz){kz=this._geojsonToScreenXY(e)}this._pointFeaturesInter(kx,kw.features,kq,kz)}else{if(!ky){ky=this._geojsonToTileXY(ks,T[kA])}if(!ky){continue}this._noPointFeaturesInter(kx,kw.features,kq,ky)}}}}}return kq.length===0?null:kq},_featuresInter:function(T,kq,kr){for(var i in kq){if(!kq[i]._visible){continue}if(kr[T+"_"+kq[i].getId()]){continue}kq[i].layerName=T;var e=new jo(kq[i].getId(),T);e.properties=kq[i].getProperties();kr.push(e);kr[T+"_"+kq[i].getId()]=true}},_pointFeaturesInter:function(kr,ks,kt,kq){for(var T in ks){if(!ks[T]._visible){continue}if(kt[kr+"_"+ks[T].getId()]){continue}var ku=ks[T].getPointGeoJSON(this.layer.map);if(!ku){continue}var i=eh.booleanDisjoint(ku,kq);if(!i){ks[T].layerName=kr;var e=new jo(ks[T].getId(),kr);e.properties=ks[T].getProperties();kt.push(e);kt[kr+"_"+ks[T].getId()]=true}}},_noPointFeaturesInter:function(kr,ks,kt,kq){for(var T in ks){if(!ks[T]._visible){continue}if(kt[kr+"_"+ks[T].getId()]){continue}var i=eh.booleanDisjoint(ks[T].geojson,kq);if(!i){ks[T].layerName=kr;var e=new jo(ks[T].getId(),kr);e.properties=ks[T].getProperties();kt.push(e);kt[kr+"_"+ks[T].getId()]=true}}},pickFeatures:function(kD,kr){if(this.running){return}var T=Math.floor(this.map.getZoom()+this.spanLevel);if(this.gridModel===eh.GridModel.BAIDUWEB){var kB=Math.pow(2,18-T);var ks=Math.floor(kD.lng/kB/256);var kv=Math.floor(kD.lat/kB/256);var kq=kD.lng/kB-ks*256;var kw=kD.lat/kB-kv*256;var ku=[kq,kw];var kJ=[T,ks,kv]}else{var kH=dI.transformBDmcPoint(kD,this.layer.transform);var kC=dI.getPointPixelCoor(kD,T,this.layer.transform);var kJ=dI.getTileCoordForCoordAndZ(kH,T);var ku=dI.getRelativePixelCoor(kJ,kC)}var kK=this.layer.map._featureMgr.result.bkData[this.layer.drawIndex][2];var kA=kJ.join("_");var kx=[];for(var kF=0;kF<kK.length;kF++){var kG=kK[kF].tileInfo;var kL=kG.zoom+"_"+kG.col+"_"+kG.row;if(kA===kL){this.running=true;if(!kK[kF].tileData||!kK[kF].tileData.layers){continue}var ky=kK[kF].tileData.layers;for(var kI in ky){var kt=ky[kI].features;for(var kE in kt){if(!kt[kE]._visible){continue}if(kx[kI+"_"+kt[kE].getId()]){continue}if(kt[kE].getType()===fZ.POINT||kt[kE].getType()===fZ.MULTI_POINT){var e=kt[kE].isPointInGeometry(kr,this.layer.map)}else{var e=kt[kE].isPointInBox(ku);if(e){e=kt[kE].isPointInGeometry(ku)}}if(e){kt[kE].layerName=kI;var kz=new jo(kt[kE].getId(),kI);kz.properties=kt[kE].getProperties();kx.push(kz);kx[kI+"_"+kt[kE].getId()]=true}}}break}}this.running=false;return kx},_geojsonToScreenXY:function(T){var i=JSON.parse(JSON.stringify(T));var e=this;gH.coordEachReplace(i,function(ks){var kq=jn.convertLL2MC(new cD(ks[0],ks[1]));var kr=e.map.pointToPixelIn(kq);return[kr.x,kr.y]});return i},_geojsonToTileXY:function(T,kr){if(kr.length<4){return null}var i=JSON.parse(JSON.stringify(T));var kq=Math.floor(this.map.getZoom()+this.spanLevel);if(this.gridModel===eh.GridModel.BAIDUWEB){var e=Math.pow(2,(18-kq))}else{var e=dI.resolutions[kq]}gH.coordEachReplace(i,function(ks){return[(ks[0]-kr[2])/e,(ks[1]-kr[3])/e]});return i},_geojsonToSouceXY:function(T){var i=JSON.parse(JSON.stringify(T));var e=this;gH.coordEachReplace(i,function(ks){var kq=jn.convertLL2MC(new cD(ks[0],ks[1]));var kr=[kq.lng,kq.lat];if(e.gridModel!==eh.GridModel.BAIDUWEB){kr=dI.transformBDmcPoint(kq,e.layer.transform)}return kr});return i},_bboxTile:function(T){var kt=gH.bbox(T);var ky=Math.floor(this.map.getZoom()+this.spanLevel);if(this.gridModel===eh.GridModel.BAIDUWEB){var kw=new cD(kt[0],kt[1]);var kz=new cD(kt[2],kt[3]);var ku=Math.pow(2,18-ky);var kA=Math.floor(kw.lng/ku/256);var ks=Math.floor(kw.lat/ku/256);var kr=Math.floor(kz.lng/ku/256);var i=Math.floor(kz.lat/ku/256);return[ky,kA,ks,kr,i]}else{var e=[kt[0],kt[3]];var kv=[kt[2],kt[1]];var kx=dI.getTileCoordForCoordAndZ(e,ky);var kq=dI.getTileCoordForCoordAndZ(kv,ky);return[kx[0],kx[1],kx[2],kq[1],kq[2]]}},_intersectTile:function(e,kt){var kA={};if(kt.length<5){return null}var kw=gH.getType(e);var kB=false;if(e.type==="Feature"&&kw==="Polygon"){kB=true}for(var kr=kt[1];kr<=kt[3];kr++){for(var kq=kt[2];kq<=kt[4];kq++){if(this.gridModel===eh.GridModel.BAIDUWEB){var kv=jn.tileToBoundRange({col:kr,row:kq,zoom:kt[0],baseTileSize:256});var ks=[kv.MC.sw.lng,kv.MC.sw.lat,kv.MC.ne.lng,kv.MC.ne.lat]}else{var kv=dI.getTileRangeExtent([kt[0],kr,kq]);var ks=[kv.minX,kv.minY,kv.maxX,kv.maxY]}var ku={type:"Feature"};ku.bbox=ks;ku.geometry={type:"Polygon",coordinates:[[[ks[0],ks[1]],[ks[2],ks[1]],[ks[2],ks[3]],[ks[0],ks[3]],[ks[0],ks[1]],]]};var T=eh.booleanDisjoint(ku,e);if(!T){var kz=kt[0]+"_"+kr+"_"+kq;var ky=[kr,kq,ks[0],ks[1],false];if(kB){var kx=eh.booleanContains(e,ku);if(kx){ky[4]=true}}kA[kz]=ky}}}return Object.keys(kA).length===0?null:kA},_initEvent:function(kt){this.map=kt;if(!this.map.dispatcher){this.map.dispatcher=new cI(hx(),eh)}var kr=this;this.map.dispatcher.broadcast("setLayerStyle",kr.layerOption,function(kv,i){kr.upStyle=true;if(kr.loadModule){kr.doOnceDraw()}});var kq=this;var e=false;this._layerMouseEvent=function(kx){if(!kq.map||!kq._listeners){return}if(!kq._listeners.onmousemove||Object.keys(kq._listeners.onmousemove).length===0){return}var kv;var i=kx.point;var kw=kq.pickFeatures(i,kx.pixel);if(kw&&kw.length>0){kv=new fS("onmousemove");kv.value=kw;kq.map.platform.style.cursor=kq.map.config.overlayMoveCursor;e=true}else{kq.map.platform.style.cursor=kq.map.config.defaultCursor;if(!e||!kq._listeners.onmouseout||Object.keys(kq._listeners.onmouseout).length===0){return}kv=new fS("onmouseout");e=false}if(kv){kv.point=kx.point;kv.pixel=kx.pixel;kv.latLng=kx.latlng;kq.dispatchEvent(kv)}};this._layerClickEvent=function(kx){if(!kq.map||!kq._listeners){return}if((!kq._listeners.onclick&&!kq._listeners.dblclick)||(Object.keys(kq._listeners.onclick).length===0&&Object.keys(kq._listeners.dblclick).length===0)){return}var kv;var i=kx.point;var kw=kq.pickFeatures(i,kx.pixel);kv=new fS(kx.type);kv.point=i;kv.pixel=kx.pixel;kv.latLng=kx.latlng;kv.value=kw;kq.dispatchEvent(kv)};kt.addEventListener("onmousemove",this._layerMouseEvent);var ks=["onclick","dblclick"];for(var T=0;T<ks.length;T++){var ku=ks[T];kt.addEventListener(ku,this._layerClickEvent)}kt.addEventListener("removetilelayer",function(i){if(i.target&&i.target.ontology){if(i.target.ontology===kq){kq.layer.tileCache.clear();kq.stateCube={};kq.upStyle=false;kt.removeEventListener("onmousemove",kq._layerMouseEvent);kt.removeEventListener("onclick",kq._layerClickEvent);kt.removeEventListener("ondblclick",kq._layerClickEvent);kq.layer.ontology=null;kq.layer=null;if(kt.dispatcher){kt.dispatcher.broadcast("removeLayer",kq.layerOption,function(kx,kv){var kz=kt.tileMgr.tileLayers;var kw=false;for(var ky=0;ky<kz.length;ky++){if(kz[ky].ontology instanceof eh){kw=true;break}}if(!kw&&kt.dispatcher){kt.dispatcher.remove();kt.dispatcher=null}})}}}});kt.on("destroy",function(){if(kq.map&&kq.map.dispatcher){kq.map.dispatcher.remove();kq.map.dispatcher=null}kq.layer.ontology=null;kq.layer=null});this.addEventListener("onmousemove",function(){})},setStyle:function(e){this._opt.style=e;if(!this.map||!this.loadModule){return}this.resolveStyle(this._opt);var i=this;if(this.upStyle===true){this.map.dispatcher.stop();this.map.dispatcher.broadcast("stop",null,function(kq,T){i.layerOption=Object.assign(i.layerOption,i._opt);i.map.dispatcher.broadcast("setLayerStyle",i.layerOption,function(ks,kr){i.layer.tileCache.clear();i.doOnceDraw()})})}else{i.layer.tileCache.clear();i.doOnceDraw()}},setZIndex:function(e){if(this.layer&&parseInt(e)>0){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"}});eh._generateTexture=function(kt,ks,T){var kr=document.createElement("canvas");var e;var kq;if(ks.strokeStyle==="dashed"){e=16;kq=e*8}else{if(ks.strokeStyle==="dotted"){e=32;kq=e*2}}kr.width=e;kr.height=kq;var i=kr.getContext("2d");i.fillStyle=ks.strokeColor;i.globalAlpha=ks.strokeOpacity;var ku=ks.strokeWeight*2;if(ks.strokeStyle==="dashed"){ku=eh._drawDashArrayTexture(i,e,kq,ks)}else{if(ks.strokeStyle==="dotted"){ku=eh._drawDottedTexture(i,e,kq,ks.strokeWeight)}}if(window.createImageBitmap&&!ks.sync){createImageBitmap(kr,{imageOrientation:"flipY"}).then(function(kv){T(null,{totalDashLen:ku,texture:kv,textureSize:[e,kq]})})}else{T(null,{totalDashLen:ku,texture:kr.toDataURL(),textureSize:[e,kq]})}};eh._drawDashArrayTexture=function(kw,kq,ks,T){var ku=T.dashArray;if(!ku){kw.fillRect(0,0,kq,ks/2);return T.strokeWeight*4}else{var kv=0;if(ku.length%2!==0){ku=ku.concat(ku)}for(var kr=0;kr<ku.length;kr++){kv+=ku[kr]}var e=0;for(var kr=0;kr<ku.length;kr++){var kt=ku[kr]/kv*ks;if(kr%2===0){kw.fillRect(0,e,kq,kt)}e+=kt}return kv}};eh._drawDottedTexture=function(i,e,T,kq){i.beginPath();i.arc(e/2,e/2,e/2,0,2*Math.PI);i.fill();i.closePath();return kq*2};var V=function(e){var e=e||{};this.inputCRS=e.inputCRS||"EPSG3857";this.outCRS=e.outCRS||"EPSG3857";this.minZoom=e.minZoom||3;this.maxZoom=e.maxZoom||19;this.retry=e.retry||false;this.retryTime=e.retryTime||600;this.useThumbData=e.useThumbData||true;this.lastZoom=3;this.cacheSize=e.cacheSize||128;this.tileType=ic.getInstance("web");this._mapCenter={};this._featureMgr=[[],[],[]];this._gridRefs={row:{},col:{}};this.tileCache=new aA(this.cacheSize,{clearCallback:function(i){}})};V.inherits(de,"BaiduLayer");e6.extend(V.prototype,{fetch:function(i,kq,kr){var kq=Math.ceil(kq)||3;var i=i||[];if(i.length!==4||kq>19){kr(null);return}var e=this.getZoomState(kq);var T=this.calCoord(i,kq,e);this.curViewTilesInfo=this.calTilesOrders(T.sw,T.ne,kq);this.clearData();this.clearRefs();this.loadLayerData(this.curViewTilesInfo,e,true,kr)},calCoord:function(T,kq,i){if(T.length!==4){return}var e=gcoord.transform([T[0],T[1]],gcoord[this.inputCRS],gcoord.BD09MC);var kr=gcoord.transform([T[2],T[3]],gcoord[this.inputCRS],gcoord.BD09MC);if(kr[1]>19505879.362428114||e[1]<-15949096.637571886){kr[1]=19505879.362428114;e[1]=-15949096.637571886}this._mapCenter[kq]=new cD((e[0]+kr[0])/2,(e[1]+kr[1])/2);return{sw:e,ne:kr}},calTilesOrders:function(kv,kB,kx){var ky=this.tileType.getMercatorSize(kx,kx);var kt=[Math.floor(kv[0]/ky),Math.floor(kv[1]/ky)];var i=[Math.floor(kB[0]/ky),Math.floor(kB[1]/ky)];var ku=kt[0]-1;var ks=i[0]+2;var kr=kt[1]-1;var kA=i[1]+2;var kw=[];for(var kq=ku;kq<ks;kq++){for(var kz=kr;kz<kA;kz++){var T={col:kq,row:kz,zoom:kx,useZoom:kx,tileTypeName:"web",loopOffsetX:0,tileSize:256,baseTileSize:256,mercatorSize:ky,combine:false,dataIndex:256};kw.push(T);var e="id_"+kq+"_"+kz+"_"+kx;kw[e]=true}}kw.sort((function(kC){return function(kD,kE){return((0.4*Math.abs(kD.col-kC[0])+0.6*Math.abs(kD.row-kC[1]))-(0.4*Math.abs(kE.col-kC[0])+0.6*Math.abs(kE.row-kC[1])))}})([(ku+ks)/2,(kr+kA)/2]));kw.zoom=kx;kw.tileTypeName="web";return kw},getZoomState:function(i){var e=i-this.lastZoom;if(e>0){this.zoomState=1}else{if(e<0){this.zoomState=-1}}this.lastZoom=i;return this.zoomState||0},loadLayerData:function(kx,kq,kr,kw){this.thumbCache={};if(kr){for(var ku=0,ks=kx.length;ku<ks;ku++){var T=kx[ku];var kt=this.getTileKey(T);var e=this.tileCache.getData(kt);if(e&&e.status==="ready"){e.key=kt;this.setData(e,2)}else{if(this.useThumbData){kq===1&&this.setThumbData(T.col,T.row,T.zoom,T.useZoom,kq)}}}this.calOutData(kw)}for(var ku=0,ks=kx.length;ku<ks;ku++){var T=kx[ku];var kt=this.getTileKey(T);var e=this.tileCache.getData(kt);if(!e){this.tileCache.setData(kt,{});var kv=this;this.loadRasterTileData(T,function(i,ky){kv.rasterTileDataCbk(i,ky,kw)})}}},loadRasterTileData:function(i,e){var T=new Image();var kr=i.col;var ku=i.row;var ks=i.zoom;var kq=this.getTilesUrl(new fr(kr,ku),ks);if(!kq){return}var kt=this.getTileKey(i);T=this.loadTileImage(kq,i,kt,e);T.tileInfo=i},loadTileImage:function(ku,e,T,ks){var kq=new Image();kq.crossOrigin="anonymous";var kt=this;var kr;function kv(){if(kt.retry){kr&&clearInterval(kr);kr=null}}if(this.retry){var i=1;kr=setInterval(function(){if(i>3){kv();return}var kw=kt.getTilesUrl(new fr(e.col,e.row),e.zoom,i);kq.src=kw;i++},this.retryTime)}kq.onload=function(){kv();ks&&ks(this,T)};kq.onerror=function(){kv();ks&&ks(null,T)};kq.src=ku;return kq},rasterTileDataCbk:function(kr,kq,ku){if(!kr||typeof kr==="string"){this.tileCache.removeData(kq);return}var i=kr.tileInfo;var T=i.col;var kw=i.row;var kv=i.zoom;var e=this.tileCache.getData(kq);if(!e){return}e.textureSource=kr;e.dataType=gQ;e.tileInfo=i;e.status="ready";this.tileCache.setData(kq,e);var ks="id_"+T+"_"+kw+"_"+kv;var kt=false;if(this.curViewTilesInfo[ks]){e.png8=this.png8||false;e.key=kq;this.setData(e,2);kt=true}if(kt){this.calOutData(ku,e)}},getTilesUrl:function(kr,ky,i){var kt=i||0;var T=kr.x;var kz=kr.y;var kv=j2("ditu","normal");var ku=kv.udt;var kx=es.B_NORMAL_MAP.tileUrls;var ks=Math.abs(T+kz+kt)%kx.length;var kw=kx[ks];if(T<0){T="M"+(-T)}if(kz<0){kz="M"+(-kz)}var kq="x="+T+"&y="+kz+"&z="+Math.floor(ky);kq+="&styles=pl&scaler=2&udt="+ku+"&from=jsapi3_0";var e=kw+"?qt=vtile&"+kq;return e},calOutData:function(kw,T){if(!T){for(var kt=0;kt<this._featureMgr.length;kt++){var e=this._featureMgr[kt];for(var kr=0;kr<e.length;kr++){var kq=e[kr].tileInfo;if(kt===2){var ku=e[kr].extent;if(ku){this.addRefs(ku,kq.col,kq.row)}else{var kv=this.calBoxCoord(kq);if(!kv){continue}e[kr].extent=this.findRefs(kv,kq.col,kq.row)}}}}kw({size:this.curViewTilesInfo.length,zoom:this.lastZoom,data:this._featureMgr})}else{var ks=this.calBoxCoord(T.tileInfo);if(!ks){return}T.extent=this.findRefs(ks,T.tileInfo.col,T.tileInfo.row);kw({zoom:this.lastZoom,size:this.curViewTilesInfo.length,data:[[],[],[T]]})}},calOutData_back:function(ky,kq){if(!kq){var ks;var kz;var kw;for(var ku=0;ku<this._featureMgr.length;ku++){var T=this._featureMgr[ku];for(var kt=0;kt<T.length;kt++){var kr=T[kt].tileInfo;if(ku===2){if(kt===0){var kv=this.calBoxCoord(kr);T[0].extent=kv;ks=T[0];kz=kv[2]-kv[0];kw=kv[3]-kv[1]}else{if(ks&&kz&&kw){var e=(kr.row-ks.tileInfo.row)*kw;var kx=(kr.col-ks.tileInfo.col)*kz;var kv=ks.extent;T[kt].extent=[kv[0]+kx,kv[1]+e,kv[2]+kx,kv[3]+e]}}}else{var kv=this.calBoxCoord(kr);T[kt].extent=kv}}}ky({size:this.curViewTilesInfo.length,zoom:this.lastZoom,data:this._featureMgr})}else{if(this._featureMgr[2].length===1){var kv=this.calBoxCoord(kq.tileInfo);kq.extent=kv;this.featureCell=kq;this.cellW=kv[2]-kv[0];this.cellH=kv[3]-kv[1]}else{var e=(kq.tileInfo.row-this.featureCell.tileInfo.row)*this.cellH;var kx=(kq.tileInfo.col-this.featureCell.tileInfo.col)*this.cellW;var kv=this.featureCell.extent;kq.extent=[kv[0]+kx,kv[1]+e,kv[2]+kx,kv[3]+e]}ky({zoom:this.lastZoom,size:this.curViewTilesInfo.length,data:[[],[],[kq]]})}},calBoxCoord:function(e){var i=jn.prototype.tileToBound(e,this._mapCenter[e.zoom]).LL;var T=gcoord.transform([i.sw.lng,i.sw.lat],gcoord.BD09LL,gcoord[this.outCRS]);var kq=gcoord.transform([i.ne.lng,i.ne.lat],gcoord.BD09LL,gcoord[this.outCRS]);return[T[0],T[1],kq[0],kq[1]]},clearData:function(){this._featureMgr=[[],[],[]]},addRefs:function(i,e,T){this._gridRefs.row[T]=i[1];this._gridRefs.row[T+1]=i[3];this._gridRefs.col[e]=i[0];this._gridRefs.col[e+1]=i[2]},findRefs:function(i,e,kq){var T=[];this._gridRefs.row[kq]&&(T[1]=this._gridRefs.row[kq]);this._gridRefs.row[kq+1]&&(T[3]=this._gridRefs.row[kq+1]);this._gridRefs.col[e]&&(T[0]=this._gridRefs.col[e]);this._gridRefs.col[e+1]&&(T[2]=this._gridRefs.col[e+1]);!this._gridRefs.row[kq]&&(this._gridRefs.row[kq]=i[1])&&(T[1]=i[1]);!this._gridRefs.row[kq+1]&&(this._gridRefs.row[kq+1]=i[3])&&(T[3]=i[3]);!this._gridRefs.col[e]&&(this._gridRefs.col[e]=i[0])&&(T[0]=i[0]);!this._gridRefs.col[e+1]&&(this._gridRefs.col[e+1]=i[2])&&(T[2]=i[2]);return T},clearRefs:function(){this._gridRefs={row:{},col:{}}},destroy:function(){this.tileCache.clear();this.clearData();this.clearRefs();this._mapCenter={}},setData:function(kr,T){var e=this._featureMgr[T];for(var kq=0;kq<e.length;kq++){if(e[kq].key&&e[kq].key===kr.key){e[kq]=kr;return}}e.push(kr)},getTileKey:function(e,kq){kq=kq||{};var i=typeof kq.useZoom==="number"?kq.useZoom:e.useZoom;var T="default";return"web_"+T+"_"+e.col+"_"+e.row+"_"+e.zoom+"_"+i},setThumbData:function(i,kr,kq,e,T){if(T===1){if(this._findParentZoomTile(i,kr,kq,e,8)===false){this._findChildZoomTile(i,kr,kq,e,3)}}else{if(T===-1){if(this._findChildZoomTile(i,kr,kq,e,3)===false){this._findParentZoomTile(i,kr,kq,e,8)}}}this.sortThumbData()},_findParentZoomTile:function(kt,kC,kB,kr,kw){var ks="web";var T=3;var e=kt;var kz=kC;var kx=kB;var ky=kr;for(var kv=1;kv<=kw;kv++){var kq=this.tileType.getParentTile(e,kz,kx,ky,T);if(kq===null){continue}var kA=this.getTileKey(kq);var ku=this.tileCache.getData(kA);if(ku&&ku.status==="ready"){if(this.thumbCache[kA]){continue}ku.key=kA;this.setData(ku,0);this.thumbCache[kA]=true;return true}e=kq.col;kz=kq.row;kx=kq.zoom;ky=kq.useZoom}return false},_findChildZoomTile:function(ku,kw,e,kr,kF){var kD="web";var kz=21;var kt=ku;var kv=kw;var kx=e;var kq=kr;var ks=true;for(var kC=1;kC<=kF;kC++){var kA=false;var T=this.tileType.getChildTiles(kt,kv,kx,kq,kz,kC);if(!T){continue}for(var kB=0;kB<T.length;kB++){var ky=this.getTileKey(T[kB]);var kE=this.tileCache.getData(ky);if(kE&&kE.status==="ready"){if(!this.thumbCache[ky]){kE.key=ky;this.setData(kE,1);this.thumbCache[ky]=true}kA=true}else{ks=false}}if(kA){break}}return ks},sortThumbData:function(){var e=this._featureMgr;if(!e){return}if(e[0]&&e[0].length>0){e[0].sort(function(T,i){return T.tileInfo.useZoom-i.tileInfo.useZoom})}}});function dE(T,i){aS.call(this,i);if(!bX(T)){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.offsetX=e.offsetX||0;this.config.offsetY=e.offsetY||0;this.config.coordinate=e.coordinate||"BD09";this.config.enableDraggingMap=e.enableDraggingMap||false;this.createDOM=T;this.data=e.data||null;this.overlaysList=[];hI.sendMessage(aZ(4,3,13),["layer","overlay"])}dE.inherits(de,"CustomHtmlLayer");e6.extend(dE.prototype,{initialize:function(i){this.map=i;var e=this;this._zoomShowEvent=function(kq){var T=e.map.getZoom();if(T<e.config.minZoom||T>e.config.maxZoom){e.hide()}else{e.show()}};this.addToMap();this.initEvent(i)},initEvent:function(){if(!this.overlaysList||!this.map){return}var e=this;this.map.addEventListener("zoomend",e._zoomShowEvent);this.map.on("destory",function(){e._distory()})},addEventListener:function(kq,ks){if(!this.overlaysList||!this.map){return}var kr=this.overlaysList;var e=this.overlaysList.length;for(var T=0;T<e;T++){kr[T].addEventListener(kq,ks)}},show:function(){if(!this.overlaysList){return}var e=this.overlaysList.length;if(e>0){for(var T=0;T<e;T++){this.overlaysList[T].show()}}},hide:function(){if(!this.overlaysList){return}var e=this.overlaysList.length;if(e>0){for(var T=0;T<e;T++){this.overlaysList[T].hide()}}},addToMap:function(){if(!this.overlaysList||!this.map){return}var e=this.overlaysList.length;var kq=this.overlaysList;if(e>0){for(var T=0;T<e;T++){this.map.addOverlay(kq[T])}}},render:function(i){this.config.enableMassClear=false;this.config.point=i.points;this.config.properties=i.properties;var e=new bR(this.createDOM,this.config);return e},setData:function(e){var kq=this;if(this.map&&(this.map.getZoom()<this.config.minZoom||this.map.getZoom()>this.config.maxZoom)){return}this.data=e;var T=gH.getType(e);if(T.toLowerCase()==="point"){var i=new gH({reference:this.config.coordinate});i.readFeaturesFromObject(e,{isPoints:true},function(ks){var kr=kq.render(ks);kr.id="cus_"+parseInt(Math.random()*1000000,10);kq.overlaysList.push(kr)});i=null}},updateData:function(e){this.removeAllOverlays();this.data=null;this.overlaysList=[];this.setData(e);this.addToMap();this.initEvent()},removeLayer:function(T){if(!(T instanceof dE)||!this.map){return}var kq=T.overlaysList;for(var e=0;e<kq.length;e++){this.map.removeOverlay(kq[e])}this._distory(T)},removeAllOverlays:function(){if(!this.map||!this.overlaysList){return}var T=this.overlaysList;for(var e=0;e<T.length;e++){this.map.removeOverlay(T[e])}},removeOverlay:function(T){if(!this.map||!(this.overlaysList)||this.overlaysList.length<=0){return}var e=this.overlaysList.length;var kr=this.overlaysList;if(typeof T==="string"){for(var kq=0;kq<e;kq++){if(kr[kq].id===T){this.map.removeOverlay(kr[kq]);kr.splice(kq,1)}}}else{if(T instanceof aS){for(var kq=0;kq<e;kq++){if(T===kr[kq]){this.map.removeOverlay(T);this.overlaysList.splice(kq,1);return}}}}},_distory:function(){this.map.removeEventListener("zoomend",this._zoomShowEvent);var T=this.overlaysList;for(var e=0;e<T.length;e++){T[e].div=null}this.overlaysList=[];this.createDOM=null;this.config=null;this.data=null},getCustomOverlays:function(){return this.overlaysList},toString:function(){return"CustomHtmlLayer"}});function iz(e){aS.call(this,e);var e=e||{};this.options={};this.options.callback=e.callback?e.callback:null;this._auth=false;this._remove=false;this.currentFloor=e.floor||1;this.currentFloorName="B1";this.currentFloorKV=[];this.currentFloorStr="";this.currentUid="";this.currentCityId=0;this.floorsCache=[];this.spotFillCache=[];this.spotFillLayer;this.spotFillData=[];this.spotOutFillLayer;this.spotOutFillData=[];this.cusInLabelUids=[];this.cusInBubbleUids=[];this.cusOutLabelUids=[];this.cusOutBubbleUids=[];this.labels=[];this.labelDatas=[];this.outLabels=[];this.outLabelDatas=[];this.bubbleDatas=[];this.jixieDatas=[];this.indoorUids;this.outdoorUids;this.indoorChange=true;this.cityChange=true;hI.sendMessage(aZ(4,3,14),["layer","parking"])}iz.inherits(de,"ParkingSpot");e6.extend(iz.prototype,{initialize:function(e){this.map=e;this.map.parking=this;this._verify()},_verify:function(){var e=this;j9.request(function(T){if(T&&T.result&&!T.result["error"]&&T.content&&!T.content["errno"]){var kq=T.content["data"];e._auth=true;e.indoorUids=kq.support_indoor;e.outdoorUids=kq.support_outdoor;e._bindCityChange();e._bindIndoorChange();setInterval(function(){e.getIndoorDataByUid(e.currentUid,e.currentFloorName)},60000);var i=new aI(e.map);if(i&&i._getIdByLoc){i._getIdByLoc(i._loc,function(kr){e.currentCityId=kr;e.getOutdoorDataByCityId(e.currentCityId);setInterval(function(){e.getOutdoorDataByCityId(e.currentCityId)},60000)})}}else{console.error("你未开通智能停车高级服务!")}},{qt:d0,ak:eW})},_initGraph:function(e){if(e==="indoor"){this.spotFillLayer=new ea({crs:"BD09LL",enablePicked:true,autoSelect:true,zIndex:1,selectedColor:"#e5e7eb",pickWidth:2,pickHeight:2,style:{fillColor:["match",["get","state"],1,"#ffbfbb",2,"#ddf4d7","#e5e7eb"],fillOpacity:1,strokeWeight:1,strokeColor:"#fff"}})}else{this.spotOutFillLayer=new ea({crs:"BD09LL",enablePicked:true,autoSelect:true,zIndex:1,selectedColor:"#e5e7eb",pickWidth:2,pickHeight:2,style:{fillColor:["match",["get","state"],1,"#ffbfbb",2,"#ddf4d7","#e5e7eb"],fillOpacity:1,strokeWeight:1,strokeColor:"#fff"}})}},_bindCityChange:function(){var e=this;this.map.addEventListener("citychange",function(i){e.cityChange=true;if(e.currentCityId!==i.code){e.currentCityId=i.code;e.getOutdoorDataByCityId(i.code)}})},_bindIndoorChange:function(){var e=this;var i=function(ku){var kt=ku._indoorData[e.currentUid]?ku._indoorData[e.currentUid].floors:[];var ks=[];for(var kr=0;kr<kt.length;kr++){if(kt[kr].floorName.charAt(0)==="B"||kt[kr].floorName.charAt(0)==="M"){e.currentFloorKV[kt[kr].floorName]=kr;ks.push(kt[kr].floorName)}}e.currentFloorStr=ks.join(",");e.getDataBefore(e.currentUid,e.currentFloorStr)};if(e.currentUid||e.map._indoorMgr.currentUid){var kq=e.map._indoorMgr;e.currentUid=kq.currentUid;e.currentFloor=kq.currentFloor;i(kq);var T=kq.getIndoorData(e.currentUid);e.currentFloorName=T.floors[e.currentFloor]?T.floors[e.currentFloor].floorName:"";e.getIndoorDataByUid(e.currentUid,e.currentFloorName,true)}map.on("indoor_status_changed",function(ku){var kr=ku.uid;var ks=ku.floor;e.indoorChange=true;e.hideLayer("indoor");var kv=e.map._indoorMgr;if(e.currentUid||e.map._indoorMgr.currentUid){var kv=e.map._indoorMgr;e.currentUid=kv.currentUid;e.currentFloor=kv.currentFloor;i(kv)}if(!kr){e.hideLabel()}else{if(this._indoorMgr&&this._indoorMgr._indoorData[kr]){var kt=this._indoorMgr._indoorData[kr];e.currentUid=kr;e.currentFloor=ks;e.currentFloorName=kt.floors[ks].floorName;if(e.currentFloorName.charAt(0)==="F"){e.hideLabel()}e.getIndoorDataByUid(kr,e.currentFloorName,e.indoorChange)}}})},_unzip:function(kr){if(!kr||typeof kr!=="string"){return}var e=atob(kr);var ks=new Uint8Array(e.length);for(var kq=0;kq<e.length;kq++){ks[kq]=e.charCodeAt(kq)}var T=pako.inflate(ks,{to:"string"});return JSON.parse(T)},getDataBefore:function(T,kq){if(!T||!kq||this._remove){return}var e=this;var i=kq.split(",");j9.request(function(kt){if(kt&&kt.result&&!kt.result["error"]&&kt.content){var kv=kt.content;if(!kv){return}for(var ks=0;ks<i.length;ks++){if(kv[i[ks]]){var ku=e._unzip(kv[i[ks]]);var kr=e.currentFloorKV[i[ks]];e.floorsCache[kr]=ku}}e.spotFillCache[T]=e.floorsCache}else{console.log("获取室内车位数据失败,请检查是否已开通智能停车服务!")}},{qt:B,ak:eW,building_uid:T,floor:kq})},getOutdoorDataByCityId:function(i){if(i&&typeof i==="number"){i=i.toString()||"131"}if(!this.outdoorUids[i]||this._remove){return}var e=this;j9.request(function(T){if(T&&T.result&&!T.result["error"]&&T.content){var kq=e._unzip(T.content);if(!kq||!kq.carport_data){return}e.spotOutFillData=e._parseParkingData(kq);if(e.cityChange){if(e.cusOutLabelUids){e.map.removeLabelsFromMapTile(e.cusOutLabelUids)}e._addLabels(kq.carport_data,"outdoor");e.cityChange=false}if(e.cusOutBubbleUids){e.map.removeLabelsFromMapTile(e.cusOutBubbleUids)}e._addJixieLabels(kq.bubble_data);if(!e.spotOutFillLayer){e._addLabels(kq.carport_data,"outdoor");e._initGraph("outdoor");e._initEvent("outdoor",e.options.callback);e.addToMap("outdoor")}else{e.spotOutFillLayer.setData(e.spotOutFillData)}}else{console.log("获取室外车位数据失败,请检查是否已开通智能停车服务!")}},{qt:B,ak:eW,city_id:i})},getIndoorDataByUid:function(kq,ks,i){if(!kq||!ks||this._remove||!this.indoorUids[this.currentCityId]||(this.indoorUids[this.currentCityId]&&!this.indoorUids[this.currentCityId].includes(kq))){return}var T=this;var kt=function(ku){if(T.cusInBubbleUids){T.map.removeLabelsFromMapTile(T.cusInBubbleUids)}if(ku.bubble_data&&ku.bubble_data.length>0){T._addBubbles(ku.bubble_data)}if(T.cusInLabelUids){T.map.removeLabelsFromMapTile(T.cusInLabelUids)}T._addLabels(ku.carport_data,"indoor")};if(this.spotFillCache[kq]&&this.spotFillCache[kq][this.currentFloor]&&i){var kr=this.spotFillCache[kq][this.currentFloor];var e=T._parseParkingData(kr);T.spotFillLayer.setData(e);kt(kr)}j9.request(function(ku){if(ku&&ku.result&&!ku.result["error"]&&ku.content){var kv=T._unzip(ku.content[ks]);if(!kv||!kv.carport_data){return}T.spotFillData=T._parseParkingData(kv);if(kv&&kv.carport_data.length>0){T.floorsCache[T.currentFloor]=kv;T.spotFillCache[kq]=T.floorsCache}if(!T.spotFillLayer){T._addLabels(kv.carport_data,"indoor");T._addBubbles(kv.bubble_data);T._initGraph("indoor");T._initEvent("indoor",T.options.callback);T.addToMap("indoor")}else{if(kv&&kv.carport_data.length>0){T.spotFillLayer.setData(T.spotFillData)}}kt(kv)}else{console.log("获取室内车位数据失败,请检查是否已开通智能停车服务!")}},{qt:B,ak:eW,building_uid:kq,floor:ks})},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(kq){if(!kq){return}var T=kq.carport_data;var e={type:"FeatureCollection",features:[]};if(!T){var i={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[]}};e.features.push(i);return e}T.forEach(function(kr){if(kr.geo&&typeof kr.geo==="string"){kr.geo=JSON.parse(kr.geo)}var ks={type:"Feature",properties:{center:[kr.x,kr.y],state:kr.carport_state,type:kr.carport_type,name:kr.carport_name,uid:kr.carport_uid,floor:kr.floor,angle:kr.angle,label:kr.label},geometry:{type:"Polygon",coordinates:[kr.geo]}};e.features.push(ks)});return e},_initEvent:function(i,T){if(!this.map){return}var e=this;if(i==="indoor"){this.spotFillLayer.addEventListener("click",function(kv){if(kv.value.dataIndex!==-1&&kv.value.dataItem){var kt=kv.value.dataItem;var kq=kt.properties.center;var kr=kt.properties.bubble_data;var ku="";switch(kt.properties.state){case 1:ku="占用";break;case 2:ku="空闲";break;case 0:ku="未知";break;default:ku="未知";break}var ks={center:kq,state:ku,properties:kt.properties};T&&T(ks)}})}else{this.spotOutFillLayer.addEventListener("click",function(kv){if(kv.value.dataIndex!==-1&&kv.value.dataItem){var kt=kv.value.dataItem;var kq=kt.properties.center;var kr=kt.properties.bubble_data;var ku="";switch(kt.properties.state){case 1:ku="占用";break;case 2:ku="空闲";break;case 0:ku="未知";break;default:ku="未知";break}var ks={center:kq,state:ku,properties:kt.properties};T&&T(ks)}})}this.map.on("destory",function(){e._distory()})},_addBubbles:function(kt){if(!kt){return}this.bubbleDatas=[];this.cusInBubbleUids=[];for(var ks=0;ks<kt.length;ks++){var e=kt[ks].bubble.name+""+kt[ks].bubble.label;var ku=kt[ks].bubble.rank.split("-");var kq=kt[ks].bubble.color;var kv=jn.convertLL2MC(new cD(kt[ks].x,kt[ks].y));var kr="bubble_"+kt[ks].poi_uid+Math.floor(Math.random()*Math.pow(10,6));var T={position:kv,uid:kr,name:e,displayRange:ku,textMargin:8,direction:0,rank:60000,textOnIcon:true,iconSize:[100,24],noStretch:true,icon:"//bj.bcebos.com/v1/mapopen-pub-jsapigl/assets/images/spot/jixie_bk.png",style:{haloSize:0,fontSize:28,color:"#fff",strokeColor:"#fff",padding:[10,0],}};this.bubbleDatas.push(T);this.cusInBubbleUids.push(kr)}this.map.addLabelsToMapTile(this.bubbleDatas)},_addJixieLabels:function(kr){if(!kr){return}this.jixieDatas=[];this.cusOutBubbleUids=[];for(var kq=0;kq<kr.length;kq++){var ks=jn.convertLL2MC(new cD(kr[kq].x,kr[kq].y));var T="out_bubble_"+kr[kq].poi_uid;var e={position:ks,uid:T,name:kr[kq].poi_name,displayRange:[15,22],textMargin:0,direction:0,rank:60000,textOnIcon:true,iconSize:[20,30],icon:"//bj.bcebos.com/v1/mapopen-pub-jsapigl/assets/images/spot/bubble.png",style:{haloSize:0,fontSize:22,color:"#fff",strokeColor:"#fff"}};this.jixieDatas.push(e);this.cusOutBubbleUids.push(T)}this.map.addLabelsToMapTile(this.jixieDatas)},_addLabels:function(ks,kq){if(kq==="indoor"){this.labelDatas=[];this.inLabelUids=[]}else{if(kq==="outdoor"){this.outLabelDatas=[];this.outLabelUids=[]}}for(var T=0;T<ks.length;T++){var kt=jn.convertLL2MC(new cD(ks[T].x,ks[T].y));var e="carspot_lb_"+kq+"_"+ks[T].carport_name;if(ks[T].label){var kr={position:kt,uid:e,name:ks[T].carport_name+"\\["+ks[T].label+"]",displayRange:[3,22],textMargin:0,direction:0,rank:50000,style:{haloSize:2,fontSize:24,color:"#008857",strokeColor:"#fff"}}}else{var kr={position:kt,uid:e,name:ks[T].carport_name,displayRange:[3,22],textMargin:0,direction:0,rank:50000,style:{haloSize:2,fontSize:22,color:"#657d95",strokeColor:"#fff"}}}if(kq==="indoor"){this.cusInLabelUids.push(e);this.labelDatas.push(kr)}else{if(kq==="outdoor"){this.cusOutLabelUids.push(e);this.outLabelDatas.push(kr)}}}if(kq==="indoor"){this.map.addLabelsToMapTile(this.labelDatas)}else{if(kq==="outdoor"){this.map.addLabelsToMapTile(this.outLabelDatas)}}},removeParkingSpot:function(){if(this.spotFillLayer){this.map.removeNormalLayer(this.spotFillLayer);this.spotFillLayer=null;this.spotFillData=[]}if(this.spotOutFillLayer){this.map.removeNormalLayer(this.spotOutFillLayer);this.spotOutFillLayer=null;this.spotOutFillData=[]}if(this.cusOutLabelUids){this.map.removeLabelsFromMapTile(this.cusOutLabelUids);this.cusOutLabelUids=[]}if(this.cusOutBubbleUids){this.map.removeLabelsFromMapTile(this.cusOutBubbleUids);this.cusOutBubbleUids=[]}if(this.cusInLabelUids){this.map.removeLabelsFromMapTile(this.cusInLabelUids);this.cusInLabelUids=[]}if(this.cusInBubbleUids){this.map.removeLabelsFromMapTile(this.cusInBubbleUids);this.cusInBubbleUids=[]}this.spotFillCache=[];this.floorsCache=[];this._remove=true},hideLayer:function(e){if(e==="indoor"&&this.spotFillLayer){var i=this._parseParkingData([]);this.spotFillLayer.setData(i)}else{if(e==="outdoor"&&this.spotOutFillLayer){var i=this._parseParkingData([]);this.spotOutFillLayer.setData(i)}}},hideLabel:function(){if(this.cusInLabelUids){this.map.removeLabelsFromMapTile(this.cusInLabelUids)}if(this.cusInBubbleUids){this.map.removeLabelsFromMapTile(this.cusInBubbleUids)}},showLayer:function(e){if(e==="indoor"&&this.spotFillLayer){var i=this._parseParkingData([]);this.spotFillLayer.setData(i)}else{if(e==="outdoor"&&this.spotOutFillLayer){}}},searchParkingRoute:function(T,e,i){if(!this.auth){return}},toString:function(){return"ParkingSpot"}});function cs(e){e=e||{};this.visible=(e.visible===undefined?true:!!e.visible);this.minZoom=e.minZoom||3;this.maxZoom=e.maxZoom||21;this.opacity=isNaN(Number(e.opacity))?1:Math.max(0,Math.min(1,Number(e.opacity)));this.zIndex=e.zIndex||1;this.enablePicked=e.enablePicked||false;this.autoSelect=e.autoSelect||false;this.popEvent=e.popEvent||true;this.autoUpdate=false;this.pickWidth=e.pickWidth||30;this.pickHeight=e.pickHeight||30;this.center=e.referCenter||null;this.isTop=e.isTop||false;this.guid=bD.getGUID("normal_layer_")}cs.inherits(de,"NormalLayer");e6.extend(cs.prototype,{onInit:function(kq,kr){if(this.zIndex>0){this.adjustZIndex(kq);kq._normalLayerMgr.sortLayer()}else{var e=kq._featureMgr.result.bkData;this.zIndex=e.length||1}var T={tileTypeName:this.getType?this.getType():"custom",dataType:this.toString(),ontology:this};kq._featureMgr.createLayer(this.zIndex,T);this.map=kq;this.gl=kr;this.onAdd(kq,kr);var i=this;kq.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(kr){var T=this.zIndex;if(this.map&&this.map._featureMgr){var e=this.map._featureMgr.result.bkData;if(kr==="up"){for(var kq=this.zIndex+1;kq<e.length;kq++){if(e[kq]){T=kq+1;break}}}else{for(var kq=this.zIndex-1;kq>0;kq--){if(e[kq]){T=kq;break}}}}return T},setTargetZIndex:function(e){this.zIndex=e;if(this.map){this.map._normalLayerMgr.sortLayer()}},setZIndex:function(ku){ku=Math.abs(Math.floor(ku))||1;if(!ku||ku===this.zIndex){return}var kr=this.map._featureMgr.result.bkData;var kq=this.map.tileMgr.tileLayers;var kw=this.map._normalLayerMgr.layers;function kx(kC){var kA=null;var kB=[kq,kw];for(var ky=0;ky<kB.length;ky++){for(var kz=0;kz<kB[ky].length;kz++){if(kB[ky][kz].zIndex===kC){kA=kB[ky][kz];break}}if(kA){break}}return kA}var T=[];var kt=[];var kv=this.zIndex;var i=kx(ku);if(kr[ku]&&i){T.push(i);kt.push(kr[ku]);this.setTargetZIndex(ku);kr[ku]=kr[kv];kr[kv]=null}else{this.setTargetZIndex(ku);kr[ku]=kr[kv];kr[kv]=null;this.doOnceDraw();return}var ks=ku+1;while(ks){var e=kx(ks);if(kr[ks]&&e){T.push(e);kt.push(kr[ks]);T.shift().setTargetZIndex(ks);kr[ks]=kt.shift();ks+=1}else{T.shift().setTargetZIndex(ks);kr[ks]=kt.shift();ks=0}}this.doOnceDraw()},setRefCenter:function(e){if(e instanceof cD){this.center=e;this.parseData&&this.parseData(e)}},getRefCenter:function(){return this.center},setTop:function(e){this.isTop=!!e;this.doOnceDraw()},setOpacity:function(e){if(isNaN(Number(e))){return}this.opacity=Math.max(0,Math.min(1,Number(e)));this.doOnceDraw()},getOpacity:function(){return this.opacity},setZIndexTop:function(){var e=this.map._featureMgr.result.bkData;e[e.length]=e[this.zIndex];e[this.zIndex]=null;this.setTargetZIndex(e.length-1);this.doOnceDraw()},setUpLevel:function(){var e=this._getAdjoinZIndex("up");if(this.zIndex!==e){this.setZIndex(e)}},setDownLevel:function(){var e=this._getAdjoinZIndex("down");if(this.zIndex!==e){this.setZIndex(e)}},onAdd:function(e,i){throw new Error("用户未实现onAdd方法")},preRender:function(i,e){},rgbToIndex:function(kr){var ku=kr.length/4;var kq=Math.floor(ku/2);const T=function(kw){return kr[kw]+kr[kw+1]*256+kr[kw+2]*65536-1};for(var kt=0;;kt++){var ks=kq+kt;var kv=kq-kt;if(ks===kv){var e=T(ks*4);if(e>-1){return e}continue}if(ks<ku){var e=T(ks*4);if(e>-1){return e}}if(kv>=0){var e=T(kv*4);if(e>-1){return e}}if(ks>=ku&&kv<0){break}}return -1},pick:function(ku,kt,kq){var T=this.gl;var kv=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 ks=mat4.create(Float64Array);mat4.multiply(ks,this.map._webglPainter.projMatrix,i);this.render(T,ks,{isPickRender:true});var e=new Uint8Array(4*this.pickWidth*this.pickHeight);T.readPixels(ku*kv-Math.floor(this.pickWidth/2),T.canvas.height-kt*kv-Math.floor(this.pickHeight/2),this.pickWidth,this.pickHeight,T.RGBA,T.UNSIGNED_BYTE,e);var kr=this.rgbToIndex(e);if(this.getPickedItem){var kw=this.getPickedItem(kr,kq)}this.map._normalLayerMgr.restoreFramebuffer();return kw},render:function(T,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 fS("onupdate");this.map.dispatchEvent(e)}},doRender:function(){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("图层未添加到地图")}},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(kr,kq,T){var i=new fS(T);i.pixel=kr.pixel;i.latLng=kr.latlng;i.value=kq;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 eb(e){e=e||{};cs.call(this,e);this.base_opt={idKey:"id",crs:"BD09LL",isFlat:true,drawPart:1,selectedIndex:-1,selectedColor:"rgba(20, 20, 200, 1.0)"};this.setBaseOptions(e);this.loadModule=false;this._stateCube={};this.def=[];this.DEL_COUNT=100;this.delIndexs=[];var i=this;he.load("mvtParse",function(){i._async()},true);this.select_color=this.getColorStyleForGL(this.base_opt.selectedColor);var T=new Int8Array(4);this.int32View=new Int32Array(T.buffer,0,1);this.float32View=new Float32Array(T.buffer,0,1)}eb.inherits(cs,"FeatureLayer");e6.extend(eb.prototype,{_async:function(){this.loadModule=true;this.resolveStyle();this.parseData()},compileExpress:function(i,e){var i=eh.ExpressParse.normalizePropertyExpression(i,e);return i},resolveStyle:function(){var e=this.style_opt||{};var kq=c5[this.type];if(this._appendStyle){kq=JSON.parse(JSON.stringify(kq));Object.assign(kq,this._appendStyle)}if(e&&this.type&&kq){var T={};for(var i in e){var ks=kq[i];if(e.hasOwnProperty(i)&&ks!==undefined){var kr=this.compileExpress(e[i],ks);T[i]=kr}}this.styleExpress=T}},evaluateContext:function(e,T){var i=T.id||e;var kq=this._stateCube[i];return{properties:function(){return T&&T.properties},featureState:kq||{}}},evaluates:function(i,kq){if(!this.styleExpress){return null}var ks=this.styleExpress;var e={};for(var T in ks){if(ks.hasOwnProperty(T)){var kr=ks[T].evaluate(this.evaluateContext(i,kq));e[T]=kr}}return e},_updateState:function(T,i,e){if(e){this._set(i,this._stateCube,T)}else{this._stateCube[T]=i}},_set:function(i,kr,T){var kq=kr[T]||(kr[T]={});for(var e in i){kq[e]=i[e]}},updateState:function(kr,ks,e){var T=JSON.stringify(this._stateCube);if(!(ks&&typeof ks==="object"&&Object.keys(ks).length>0)){return}if(!e){this._stateCube={}}if(kr instanceof Array){for(var kq=0;kq<kr.length;kq++){this._updateState(kr[kq],ks,e)}}else{this._updateState(kr,ks,e)}var kt=JSON.stringify(this._stateCube);if(T!==kt){this.parseData()}if(this.attach){this.attach.updateState(kr,ks,e)}},replaceAllState:function(e){var i=JSON.stringify(this._stateCube);this._stateCube=e;var T=JSON.stringify(this._stateCube);if(i!==T){this.parseData()}},getAllState:function(){return this._stateCube},removeState:function(kq){var e=JSON.stringify(this._stateCube);if(kq instanceof Array){for(var T=0;T<kq.length;T++){delete this._stateCube[kq[T]]}}else{delete this._stateCube[kq]}var kr=JSON.stringify(this._stateCube);if(e!==kr){this.parseData()}},clearState:function(){var e=JSON.stringify(this._stateCube);if(e!=="{}"){this._stateCube={};this.parseData()}},getType:function(){return"feature"},setData:function(T,kq){if(T.length<=0){return}this.params=kq=kq||{};this.data=T;this.delIndexs=[];this._stateCube={};if(kq.changeCenter&&T&&T.features&&T.features[0]){var e=T.features[0];var kr=null;if(e.geometry&&e.geometry.type==="Point"){kr=e.geometry.coordinates}if(e.geometry&&(e.geometry.type==="LineString"||e.geometry.type==="MultiLineString"||e.geometry.type==="Polygon")){var i=e.geometry.coordinates[0];if(i&&i[0]){kr=i[0]}}if(kr){if(this.base_opt.crs==="BD09LL"){this.center=new cD(kr[0],kr[1])}else{kr=gcoord.transform(kr,this.base_opt.crs,gcoord.BD09LL);this.center=new cD(kr[0],kr[1])}}}this.parseData&&this.parseData(this.center)},getData:function(){return this.data},addDelIndex:function(T){if(this.delIndexs.length>=this.DEL_COUNT){new Error("超出"+this.DEL_COUNT+"个限制")}var e=false;for(var kq=0;kq<this.delIndexs.length;kq++){if(this.delIndexs[kq]===T){e=true;break}}if(!e){this.delIndexs.push(T);this.doOnceDraw()}if(this.attach){this.attach.addDelIndex(T)}},removeDelIndex:function(e){for(var T=0;T<this.delIndexs.length;T++){if(this.delIndexs[T]===e){this.delIndexs.splice(T,1);this.doOnceDraw();return}}if(this.attach){this.attach.removeDelIndex(e)}},clearDelIndex:function(){this.delIndexs=[];this.doOnceDraw();if(this.attach){this.attach.clearDelIndex()}},setBaseOptions:function(i){i=i||{};var e=Object.assign({},this.getBaseOptions());Object.assign(this.base_opt,i);this.onOptionsChanged&&this.onOptionsChanged(this.getBaseOptions(),e);if(i.data){this.setData(i.data);delete i.data}},setStyleOptions:function(i){i=i||{};var e=Object.assign({},this.getStyleOptions());Object.assign(this.style_opt,i);this.onOptionsChanged&&this.onOptionsChanged(this.getStyleOptions(),e);if(i.data){this.setData(i.data);delete i.data}else{if(i.autoRender!==false){}}},getBaseOptions:function(){return this.base_opt||{}},getStyleOptions:function(){return this.style_opt||{}},getProperty:function(e,kq,T){if(Object.prototype.toString.call(kq)==="[object Function]"){return kq(T)}else{var i=T[e]||kq;if("properties" in T&&e in T.properties){i=T.properties[e]}return i}},getPickedItem:function(i,e){if(this.autoSelect){if(e==="onmousemove"){this.selectedIndex=i}else{this.selectedIndex=-1}}if(e==="onclick"&&this.enablePicked){this.selectedIndex=i}var T=this.dataset?this.dataset.normal:[];return{dataIndex:i,dataItem:T[i]}},formatData:function(T){var i=new gH({reference:this.base_opt.crs});var kr=i.readFeaturesFromObject(T,{isPoints:true});var e=null;var kq=this;if(this.base_opt.nodeStrict){e=JSON.parse(JSON.stringify(T));gH.coordEachReplace(e,function(ks){return[ks[0].toFixed(kq.base_opt.nodeJoin),ks[1].toFixed(kq.base_opt.nodeJoin)]})}return{normal:T.features,inner:kr,join:e?e.features:null}},_pointGeoFilter:function(kD){var kT=[];for(var kU=0;kU<kD.features.length;kU++){var ky=kD.features[kU];if(ky.geometry.type!=="LineString"){continue}var ks=ky.geometry.coordinates;var kB=ky.properties||{};if(ks.length<2){continue}var kv=kT.length;if(this.base_opt.nodeBreakpoint||this.base_opt.nodeMiddleShow){var kE;var kI=0;for(var kR=0;kR<ks.length;kR++){var kJ=jn.convertLL2MC(new cD(ks[kR][0],ks[kR][1]));if(kE&&kE.similar(kJ)){continue}if(kR>0){var kL=kT[kT.length-1];var kw=kL.geometry.coordinates;var kN=bf(kJ.lat-kw[1],kJ.lng-kw[0]);kT[kT.length-1].properties.endPoint=kJ.lng+","+kJ.lat;kT[kT.length-1].properties.rotation=kN;if(kR>1){var kF=kT[kT.length-2];var kG=kF.geometry.coordinates;kN=gY(kG,kw,[kJ.lng,kJ.lat]);kT[kT.length-1].properties.rotationPlus=Math.abs(kN)}}var kK=JSON.parse(JSON.stringify(kB));kK.index=kU;kK.line_node_type=kR===0?1:3;kK.startPoint=kR===0?"":kE.lng+","+kE.lat;kK.endPoint="";kK.rotationPlus=0;kT.push({type:"Feature",properties:kK,geometry:{coordinates:[kJ.lng,kJ.lat],type:"Point"}});kE=kJ;kI++}if(kI===1){kT.splice(kT.length-1,1)}if(kI>=2&&kT[kT.length-1].properties.endPoint===""){var ku=kT[kT.length-2];var T=ku.geometry.coordinates;var kt=kT[kT.length-1];var e=kt.geometry.coordinates;var kN=bf(e[1]-T[1],e[0]-T[0]);kK.rotation=kN;kK.line_node_type=2}}else{var ku=ks[0];var kS=jn.convertLL2MC(new cD(ku[0],ku[1]));var kA=ks[1];var kQ=jn.convertLL2MC(new cD(kA[0],kA[1]));var kt=ks[ks.length-1];var kW=jn.convertLL2MC(new cD(kt[0],kt[1]));var kH=ks[ks.length-2];var kx=jn.convertLL2MC(new cD(kH[0],kH[1]));var kM=[[kQ,kS],[kW,kx]];for(var kR=0;kR<2;kR++){var kV=[kM[kR][0].lng,kM[kR][0].lat];var kC=[kM[kR][1].lng,kM[kR][1].lat];var kK=JSON.parse(JSON.stringify(kB));kK.index=kU;var kN=bf(kV[1]-kC[1],kV[0]-kC[0]);kK.rotation=kN;kK.line_node_type=kR===0?1:2;kK.startPoint=kR===0?"":kV.join(",");kK.endPoint=kR===0?kC.join(","):"";kK.rotationPlus=0;kT.push({type:"Feature",properties:kK,geometry:{coordinates:kR===0?kC:kV,type:"Point"}})}}if(this.base_opt.nodeMiddleShow&&kv+1<=kT.length){var kr=kT.length;for(var kP=kv+1;kP<kr;kP++){var kz=JSON.parse(JSON.stringify(kT[kP]));var kq=kT[kP].geometry.coordinates;kz.properties.line_node_type=4;kz.properties.startPoint="";kz.properties.endPoint="";kz.properties.rotationPlus=0;kz.properties.rotation=kT[kP-1].properties.rotation;var kO=kT[kP-1].geometry.coordinates;kz.geometry.coordinates=[(kq[0]+kO[0])/2,(kq[1]+kO[1])/2];kT.push(kz)}}}return{type:"FeatureCollection",features:kT}},_toFormatPointGeometry:function(e,i){if(!i){var kq=jn.convertLL2MC(e)}else{var kq=e}var kr=this.map._normalLayerMgr.base;var T=[kq.lng-kr.lng,kq.lat-kr.lat];return T},getColorStyleForGL:function(kq,e,T){var i=hO.formatColorCssToRgbaArray(kq,e,T);return i},rgb2value:function(e){return e[0]+e[1]*256+e[2]*65536-1},int8ArrayToFloat:function(e){var i=(e[3]<<24|e[2]<<16|e[1]<<8|e[0]);this.int32View[0]=i&4294967295;return this.float32View[0]},_toFormatPolGeometry:function(kr,e){var kq=[];if(!e){kq[0]=this._toFormatCoords(kr)}else{for(var T=0;T<kr.length;T++){kq.push(this._toFormatCoords(kr[T]))}}return kq},_toFormatCoords:function(kw){var kv=[];var ks=[];kv.pointsArray=ks;var kx=jn.convertLL2MC(kw[0]);if(this.center){var e=jn.convertLL2MC(this.center)}else{var e=this.map._normalLayerMgr.base}var ku=[kx.lng-e.lng,kx.lat-e.lat];kv.push(ku);ks.push(ku[0],ku[1]);for(var kr=1,kq=1,T=kw.length;kr<T;kr++){kx=jn.convertLL2MC(kw[kr]);var kt=[kx.lng-e.lng,kx.lat-e.lat];if(kt[0]!==kv[kq-1][0]||kt[1]!==kv[kq-1][1]){kv.push(kt);ks.push(kt[0],kt[1]);kq++}}return kv},onDestroy:function(){this.data=null;this.params={};this._stateCube={};this.delIndexs.length=0},toString:function(){return"FeatureLayer"}});function bY(e){e=e||{};this.type="polyline";this.style_opt={sequence:false,marginLength:16,traceControl:null,traceColor:[],traceDisappear:false,linksLine:false,strokeColorControl:null,strokeColor:"rgba(25, 25, 250, 1)",strokeWeight:2,borderCovered:true,borderColor:"rgba(27, 142, 236, 1)",borderWeight:0,borderMask:true,strokeOpacity:1,strokeLineJoin:"round",strokeLineCap:"square",strokeTextureUrl:"",strokeTextureWidth:16,strokeTextureHeight:16,strokeStyle:"solid",dashArray:[8,4]};this.setStyleOptions(e.style||{});this._bufferArray=[];this._texture={};e.nodeShow=e.nodeShow===undefined?false:e.nodeShow;e.linkLine=e.linkLine===undefined?true:e.linkLine;e.nodeMask=e.nodeMask===undefined?false:e.nodeMask;e.nodeStrict=e.nodeStrict===undefined?false:e.nodeStrict;e.nodeJoin=e.nodeJoin===undefined?5:e.nodeJoin;e.nodeBreakpoint=e.nodeBreakpoint===undefined?false:e.nodeBreakpoint;e.nodeMiddleShow=e.nodeMiddleShow===undefined?false:e.nodeMiddleShow;e.nodeMinZoom=(!e.nodeMinZoom||e.nodeMinZoom<3||e.nodeMinZoom>25)?6:e.nodeMinZoom;eb.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 aX(i)}hI.sendMessage(aZ(4,3,10),["layer","line"])}bY.Segment={START_POINT:1,END_POINT:2,BREAK_POINT:3,MIDDLE_POINT:4,1:1,2:2,3:3,4:4};bY.inherits(eb,"LineLayer");e6.extend(bY.prototype,{onAdd:function(e,i){if(this.attachNode){this.attachNode.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 T=this.getData();if(!T){return}var kq=this.dataset=this.formatData(T);this.dispatchEvent(new fS("ondataparsed"));var i=this.linesParse(kq.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(kD){var kv=[[],[]];var ks=0;var kz=-1;for(var kH=0;kH<kD.length;kH++){var kJ=kD[kH].points;var kt=false;if(!(kJ[0] instanceof cD)){kt=true}var kx=kD[kH].properties||{};var kq=kx.hasOwnProperty(this.base_opt.idKey)?kx[this.base_opt.idKey]:false;var kw=kH;var kB=-1;if(kD[kH].index!==undefined){kw=kD[kH].index}if(kD[kH].brotherIndex!==undefined){kB=kD[kH].brotherIndex}if(kz!==kw){kz=kw;ks=0}var kI=this.evaluates(kw,{properties:kx,id:kq});kI=Object.assign(JSON.parse(JSON.stringify(cy[this.type])),kI||{});if(this.base_opt.nodeStrict){kx.line_node_type=1;var ku=this.styleExpress.shapeType.evaluate(this.evaluateContext(kw,{properties:kx,id:kq}));kx.line_node_type=2;var kr=this.styleExpress.shapeType.evaluate(this.evaluateContext(kw,{properties:kx,id:kq}))}if(kI.borderWeight!==0){var e=this.getColorStyleForGL(kI.borderColor,undefined,false);if(kI.borderWeight<0){this.style_opt.borderMask=false}var ky=kI.strokeWeight/2+kI.borderWeight;if(ky>0){var kG=this.buildLineVertex(kI,kD[kH],kt,ky,e,ks);kv[0][kv[0].length]={index:kw,styleData:kG,textureKey:-1,texture:null,textureSize:null,zoomWithMap:true,start:aX.hasMask(ku),end:aX.hasMask(kr),overlay:{_config:{textureRepeat:true},_totalDashLen:null,}}}}var kE=kI.strokeWeight/2;var kF=this.getColorStyleForGL(kI.strokeColor,kI.strokeOpacity,false);if(kB>-1&&this.style_opt.linksLine&&this.style_opt.strokeColorControl instanceof Function){var kA=this.style_opt.strokeColorControl(kw,kB);kF=this.getColorStyleForGL(kA,undefined,false)}var kG=this.buildLineVertex(kI,kD[kH],kt,kE,kF,ks);var kA=this._generateTexture(kI)||{};var kC=kA.value||null;var T={index:kw,styleData:kG,textureKey:kA.key||-1,texture:kC?kC.texture:null,textureSize:kC?kC.textureSize:null,zoomWithMap:true,start:this.base_opt.nodeMask&&aX.hasMask(ku),end:this.base_opt.nodeMask&&aX.hasMask(kr),overlay:{_config:{textureRepeat:true},_totalDashLen:kC?kC.totalDashLen:null,}};if(this.style_opt.borderCovered&&!this.base_opt.nodeStrict){kv[1][kv[1].length]=T}else{kv[0][kv[0].length]=T}if(kG[0]&&kG[0][0] instanceof Array){ks=kG[0][0][kG[0][0].length-1]/10||0}}return kv},combineLine:function(ks){var ky=[];var kq=[];var kE=[];for(var ku=0;ku<ks.length;ku++){var kA={};var kt=ks[ku];var T=-1;for(var kv=0;kv<kt.length;kv++){if(!this.base_opt.nodeStrict){if(!kA[kt[kv].textureKey]){kA[kt[kv].textureKey]=[{style:[],styleData:[[],[]],index:[]}]}this._mergeOnePolylineData(kA[kt[kv].textureKey],kt[kv])}else{var kD=kt[kv];if(T!==kt[kv].index){T=kt[kv].index;var kC=this.dataset.join[kD.index];if(!kC.properties){kC.properties={}}kC.properties.__index=kt[kv].index;this._onLine(kC,kq,kD.start,kD.end)}}}ky.push(kA)}if(kq.length>0){var kA={};for(var kv=0;kv<kq.length;kv++){var kt=kq[kv];if(!kA[kv+1]){kA[kv+1]={}}var kr=[];for(var ku=0;ku<kt.length;ku++){var kw=kt[ku].properties.__index;kr.push(kw);var kx=this._findLineIndex(kw,ks[0]);if(kx>=0){var kC=ks[0][kx];if(!kA[kv+1][kC.textureKey]){kA[kv+1][kC.textureKey]=[{style:[],styleData:[[],[]],index:[]}]}this._mergeOnePolylineData(kA[kv+1][kC.textureKey],kC);var e=ks[0][kx+1];if(e&&e.index===kw){if(!kA[kv+1][e.textureKey]){kA[kv+1][e.textureKey]=[{style:[],styleData:[[],[]],index:[]}]}this._mergeOnePolylineData(kA[kv+1][e.textureKey],e)}}}kE.push(kr)}ky[0]=kA}if(this.attachNode){var kB=this._pointGeoFilter(this.getData());var kz=JSON.parse(JSON.stringify(this.params||{}));kz.nodeStrictIndex=kE;this.attachNode.setData(kB,kz)}return ky},_findLineIndex:function(e,kq){for(var T=0;T<kq.length;T++){if(kq[T].index===e){return T}}return -1},_pointOnLine:function(ku,kt,e,ks){var kv=e[ks];if(ku.length>0){for(var kr=0;kr<kv.length;kr++){var kw=kv[kr];for(var kq=0;kq<ku.length;kq++){var T=eh.booleanDisjoint({type:"Feature",geometry:{coordinates:ku[kq],type:"Point",}},kw);if(!T){return true}}}}for(var kr=0;kr<kv.length;kr++){var kw=kv[kr];var ku=kw.properties.__nodes||[];if(ku.length>0){for(var kq=0;kq<ku.length;kq++){var T=eh.booleanDisjoint({type:"Feature",geometry:{coordinates:ku[kq],type:"Point",}},kt);if(!T){return true}}}}return false},_onLine:function(kq,e,kv,T){if(kq.geometry.type!=="LineString"){return -1}var ku=kq.geometry.coordinates;var kt=[];if(kv){kt.push(ku[0])}if(T){kt.push(ku[ku.length-1])}kq.properties.__nodes=kt;var ks=false;for(var kr=0;kr<e.length;kr++){ks=this._pointOnLine(kt,kq,e,kr);if(!ks){e[kr].push(kq);return kr}}e.push([kq]);return e.length-1},_mergeOnePolylineData:function(e,kB){var kz=e.length-1;var kr=e[kz];var i=e[kz]["styleData"][0];var kw=e[kz]["styleData"][1];var kx=10;for(var kq=0;kq<kB.styleData.length;kq++){var T=kB.styleData[kq];var kA=T[0];var kt=T[1];var kv=i.length/kx;var ky=kA.length/(kx-1);if(kv+ky>65536){kz++;kr=e[kz]={style:[],styleData:[[],[]],index:[],texture:null,textureSize:null,zoomWithMap:null,overlay:null};i=kr.styleData[0];kw=kr.styleData[1];kv=0}if(kr.styleData[0].length===0){kr.texture=kB.texture;kr.textureSize=kB.textureSize;kr.zoomWithMap=kB.zoomWithMap;kr.overlay=kB.overlay}kr.index[kr.index.length]=kB.index;for(var ku=0;ku<ky;ku++){i[i.length]=kA[ku*(kx-1)];i[i.length]=kA[ku*(kx-1)+1];i[i.length]=kA[ku*(kx-1)+2];i[i.length]=kA[ku*(kx-1)+3];i[i.length]=kA[ku*(kx-1)+4];i[i.length]=kA[ku*(kx-1)+5];i[i.length]=kA[ku*(kx-1)+6];i[i.length]=kA[ku*(kx-1)+7];i[i.length]=kA[ku*(kx-1)+8];i[i.length]=kB.index}for(var ks=0;ks<kt.length;ks++){kw[kw.length]=kt[ks]+kv}}},buildLineVertex:function(T,kD,kq,kr,ku,kt){var kw=[];var kA=[];var kC=[];var kx=kD.points;var kB=T.strokeLineCap;var e=T.strokeLineJoin;var ks=iN.JOININDEX[e];var kz=iN.CAPINDEX[kB];var ky=this._toFormatPolGeometry(kx,kq);for(var kv=0;kv<ky.length;kv++){if(ky[kv].length<2){continue}if(kw.length/6+gy.getVertexCount(ky[kv].length)>65536){kC.push([kw,kA]);kw=[];kA=[]}gy.buildData(ky[kv],ks,kz,kw,kA,ku,kr,undefined,kt)}kC.push([kw,kA]);return kC},createBuffer:function(i){var T=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 w(i,{components:T,members:e},w.BufferType.VERTEX)},createBufferArrData:function(kA){var kx=[];var ky=0;for(var kD in kA){if(!kA.hasOwnProperty(kD)){continue}var kt=kA[kD];var kC=[];for(var kq in kt){if(!kt.hasOwnProperty(kq)){continue}var kw=kt[kq];var kz=[];for(var kv=0;kv<kw.length;kv++){var ks=kw[kv].styleData[0];var ku=kw[kv].styleData[1];if(!ks||!ks.length){continue}if(!this._bufferArray[kz.length+ky]){this._bufferArray[kz.length+ky]={vertex:null,element1:null,vao1:null}}var kB=this._bufferArray[kz.length+ky];kB.textureKey=kq;kB.index=kw[kv].index;if(!kB.vertex){var kr=new Float32Array(ks.length);kr.set(ks);kB.vertex=this.createBuffer(kr)}var T=new Uint16Array(ku.length);T.set(ku);if(!kB.element1){kB.element1=new w(T,{components:1},w.BufferType.ELEMENT,ku.length)}if(!kB.vao1){kB.vao1=new dV()}var e=new Float32Array(ks);e.set(ks);kB.vao1.update(this.gl,kB.vertex,e,ks.length,kB.element1,T,ku.length);kz.push(kB)}kC.push(kz);ky+=kz.length}kx.push(kC)}return kx},createBufferData:function(kz){var kw=[];var kx=0;for(var kt=0;kt<kz.length;kt++){var kA=kz[kt];var ky=[];for(var kC in kA){if(!kA.hasOwnProperty(kC)){continue}var kv=kA[kC];for(var ku=0;ku<kv.length;ku++){var kr=kv[ku].styleData[0];var ks=kv[ku].styleData[1];if(!kr||!kr.length){continue}if(!this._bufferArray[ky.length+kx]){this._bufferArray[ky.length+kx]={vertex:null,element1:null,vao1:null}}var kB=this._bufferArray[ky.length+kx];kB.textureKey=kC;kB.index=kv[ku].index;if(!kB.vertex){var kq=new Float32Array(kr.length);kq.set(kr);kB.vertex=this.createBuffer(kq)}var T=new Uint16Array(ks.length);T.set(ks);if(!kB.element1){kB.element1=new w(T,{components:1},w.BufferType.ELEMENT,ks.length)}if(!kB.vao1){kB.vao1=new dV()}var e=new Float32Array(kr);e.set(kr);kB.vao1.update(this.gl,kB.vertex,e,kr.length,kB.element1,T,ks.length);ky.push(kB)}}kx+=ky.length;kw.push(ky)}return kw},_generateTexture:function(kq){if(kq.strokeTextureUrl){var kr=kq.strokeTextureUrl+"_"+kq.strokeWeight;if(this._texture[kr]){return{key:kr,value:this._texture[kr]}}var kt=kq.strokeTextureUrl;var ks=kq.strokeTextureWidth||16;var i=kq.strokeTextureHeight||16;var ku=kq.strokeWeight*Math.round(i/ks);var e={totalDashLen:ku,texture:kt,textureSize:[ks,i]};this._texture[kr]=e;return{key:kr,value:e}}if(kq.strokeStyle==="dashed"||kq.strokeStyle==="dotted"){var kr=[kq.strokeStyle,kq.strokeWeight,kq.strokeColor,kq.strokeOpacity,kq.dashArray.join(",")];kr=kr.join("-");if(this._texture[kr]){return{key:kr,value:this._texture[kr]}}kq.sync=true;var T=this;eh._generateTexture(null,kq,function(kw,kv){T._texture[kr]=kv});return{key:kr,value:this._texture[kr]}}return null},preRender:function(T,i,e){},render:function(ku,kq,kt){if(!this.buffer){return}kt=kt||{};this.pickModel=kt.isPickRender||false;var T=this.map._webglPainter;var e=T._state;if(this.base_opt.nodeShow&&this.attachNode){if(this.base_opt.nodeStrict){for(var ks=0;ks<this.buffer.length;ks++){kt.renderIndex=ks;for(var kr=0;kr<this.buffer[ks].length;kr++){this._renderItem(ku,T,this.buffer[ks][kr],kq,kt)}}}else{if(this.map.getZoom()>this.base_opt.nodeMinZoom&&this.base_opt.nodeMask){ku.clear(ku.STENCIL_BUFFER_BIT);ku.stencilFunc(ku.ALWAYS,1,255);e.stencilOp(ku.KEEP,ku.KEEP,ku.REPLACE);ku.stencilMask(255);e.colorMask(false,false,false,false);kt.isMask=true;this.attachNode.render(ku,kq,kt);ku.stencilFunc(ku.NOTEQUAL,1,255);ku.stencilMask(0);e.stencilOp(ku.KEEP,ku.KEEP,ku.KEEP);e.colorMask(true,true,true,true)}for(var ks=0;ks<this.buffer[0].length;ks++){this.drawLine(T,this.buffer[0][ks],false)}for(var ks=0;ks<this.buffer[1].length;ks++){this.drawLine(T,this.buffer[1][ks],false)}if(this.map.getZoom()>this.base_opt.nodeMinZoom){ku.clear(ku.STENCIL_BUFFER_BIT);ku.stencilMask(255);ku.stencilFunc(ku.ALWAYS,1,255);kt.isMask=false;this.attachNode.render(ku,kq,kt)}}return}if(this.buffer[0].length>0){if(this.style_opt.borderMask&&this.style_opt.borderCovered){ku.clear(ku.STENCIL_BUFFER_BIT);ku.stencilFunc(ku.ALWAYS,1,255);e.stencilOp(ku.KEEP,ku.KEEP,ku.REPLACE);ku.stencilMask(255);e.colorMask(false,false,false,false);for(var ks=0;ks<this.buffer[1].length;ks++){this.drawLine(T,this.buffer[1][ks],true)}ku.stencilFunc(ku.NOTEQUAL,1,255);ku.stencilMask(0);e.stencilOp(ku.KEEP,ku.KEEP,ku.KEEP);e.colorMask(true,true,true,true);for(var ks=0;ks<this.buffer[0].length;ks++){this.drawLine(T,this.buffer[0][ks],false)}ku.clear(ku.STENCIL_BUFFER_BIT);ku.stencilMask(255);ku.stencilFunc(ku.ALWAYS,1,255);for(var ks=0;ks<this.buffer[1].length;ks++){this.drawLine(T,this.buffer[1][ks],false,true)}return}else{for(var ks=0;ks<this.buffer[0].length;ks++){this.drawLine(T,this.buffer[0][ks],false)}}}for(var ks=0;ks<this.buffer[1].length;ks++){this.drawLine(T,this.buffer[1][ks],false)}},_renderItem:function(kt,i,ks,T,kr){var e=i._state;if(this.map.getZoom()>this.base_opt.nodeMinZoom&&this.base_opt.nodeMask){kt.clear(kt.STENCIL_BUFFER_BIT);kt.stencilFunc(kt.ALWAYS,1,255);e.stencilOp(kt.KEEP,kt.KEEP,kt.REPLACE);kt.stencilMask(255);e.colorMask(false,false,false,false);kr.isMask=true;this.attachNode.render(kt,T,kr);kt.stencilFunc(kt.NOTEQUAL,1,255);kt.stencilMask(0);e.stencilOp(kt.KEEP,kt.KEEP,kt.KEEP);e.colorMask(true,true,true,true)}for(var kq=0;kq<ks.length;kq++){this.drawLine(i,ks[kq],false)}if(this.map.getZoom()>this.base_opt.nodeMinZoom){kt.clear(kt.STENCIL_BUFFER_BIT);kt.stencilMask(255);kt.stencilFunc(kt.ALWAYS,1,255);kr.isMask=false;this.attachNode.render(kt,T,kr)}},traceControl:function(i){if(this.style_opt.traceControl instanceof Function){var e=this.style_opt.traceControl(i);if(e instanceof Array&&e.length===i.length){return e}}return[]},_formatArrayBuffer:function(kq,i){var e;if(i){e=new Int32Array(this.DEL_COUNT)}else{e=new Int16Array(this.DEL_COUNT)}if(kq&&kq.length){var T=0;for(;T<kq.length&&T<this.DEL_COUNT;T++){e[T]=parseInt(kq[T])}if(T<this.DEL_COUNT){e[T]=-1}}else{e[0]=-1}return e},drawLine:function(kK,kD,kH,kM){if(!kD.element1||(kD.element1&&kD.element1.length===0)){return}var kI=kK.gl;var ks=kK.programMgr.useProgram("linelayer",{def:this.def});var kx=this._texture[kD.textureKey];var ky=null;var kL=0;var kA=this.map.getZoom();var kz=this;if(kx){var kB=kx.texture;if(kB instanceof HTMLCanvasElement||(window.ImageBitmap&&kB instanceof window.ImageBitmap)){if(!kx.glTexture){kx.glTexture=d1.utils.createTexture(kI,kB,{flipY:false,wrap:kI.REPEAT,mipmap:true,unpackAlpha:true})}ky=kx.glTexture}else{if(!kx.glTexture){kx.glTexture={status:"init"};var kO=new Image();kO.crossOrigin="anonymous";kO.onload=function(){kx.glTexture.texture=d1.utils.createTexture(kI,this,{flipY:false,wrap:kI.REPEAT,mipmap:true,unpackAlpha:true});kx.glTexture.status="done";kz.doOnceDraw()};kO.src=kB}if(kx.glTexture.status!=="done"){return}ky=kx.glTexture.texture}kK._state.activeTexture(kI.TEXTURE4);kI.bindTexture(kI.TEXTURE_2D,ky);if(ks.uniforms.lastSampler!==4){kI.uniform1i(ks.uniforms.u_image,4);ks.uniforms.lastSampler=4}kL=kx.totalDashLen}var kq=this.opacity;if(ks.lastState.opacity!==kq){kI.uniform1f(ks.uniforms.u_opacity,kq);ks.lastState.opacity=kq}var kt=this.style_opt.sequence;if(ks.lastState.sequence!==kt){kI.uniform1i(ks.uniforms.u_sequence,kt);ks.lastState.sequence=kt}var T=this.style_opt.marginLength;if(ks.lastState.marginLength!==T){kI.uniform1f(ks.uniforms.u_margin_length,T);ks.lastState.marginLength=T}if(ks.lastState.dash!==kL){kI.uniform1f(ks.uniforms.u_dash_length,kL);ks.lastState.dash=kL}if(ks.lastState.mapZoom!==kA){kI.uniform1f(ks.uniforms.u_map_zoom,kA);ks.lastState.mapZoom=kA}var kE=kK._camera._modelViewMatrixLayer;if(!ks.lastState.projMatrix){kI.uniformMatrix4fv(ks.uniforms.u_proj_matrix,false,kK.projMatrix);ks.lastState.projMatrix=true}kI.uniformMatrix4fv(ks.uniforms.u_mv_matrix,false,kE);var kN=Math.pow(2,18-this.map.getZoom());if(ks.lastState.scale!==kN){kI.uniform1f(ks.uniforms.u_scale,kN);ks.lastState.scale=kN}var kw=this.base_opt.isFlat;if(ks.lastState.isFlat!==kw){kI.uniform1i(ks.uniforms.u_flat,kw);ks.lastState.isFlat=kw}var kG=this.base_opt.drawPart||1;if(ks.lastState.drawPart!==kG){kI.uniform1i(ks.uniforms.u_draw_part,kG);ks.lastState.drawPart=kG}var ku=kK._camera._far||4000;if(ks.lastState.cameraFar!==ku){kI.uniform1f(ks.uniforms.u_camera_far,ku);ks.lastState.cameraFar=ku}kI.uniform1i(ks.uniforms.u_no_gradual,kM||false);var kC;if(!(this.style_opt.traceColor instanceof Array)||this.style_opt.traceColor.length<3){kC=[153,153,153]}else{kC=this.style_opt.traceColor.slice(0,3)}kI.uniform3fv(ks.uniforms.u_trace_color,kC);kI.uniform1i(ks.uniforms.u_trace_disappear,this.style_opt.traceDisappear||false);kI.uniform1i(ks.uniforms.u_pick_model,kH||this.pickModel);if(ks.lastState.selectColor!==this.select_color){kI.uniform4fv(ks.uniforms.u_pick_color,this.select_color);ks.lastState.selectColor=this.select_color}if(ks.lastState.pickTag!==this.selectedIndex){kI.uniform1i(ks.uniforms.u_pick_tag,this.selectedIndex+1);ks.lastState.pickTag=this.selectedIndex}var kJ=new Int16Array(this.DEL_COUNT);if(this.delIndexs.length){for(var kF=0;kF<this.delIndexs.length&&kF<this.DEL_COUNT;kF++){kJ[kF]=this.delIndexs[kF]}}kI.uniform1iv(ks.uniforms["u_del_tags[0]"],kJ);var kr=this._formatArrayBuffer(kD.index);kI.uniform1iv(ks.uniforms["u_trace_index[0]"],kr);var e=this.traceControl(kD.index);var kv=this._formatArrayBuffer(e,true);kI.uniform1iv(ks.uniforms["u_trace_len[0]"],kv);kD.vao1.bind(kI,ks,kD.vertex,kD.element1);kI.drawElements(kI.TRIANGLES,kD.element1.length,kI.UNSIGNED_SHORT,0);tags=null},onDestroy:function(e,i){this.lines=null;this.buffer=null;this._bufferArray=[];this._texture={};eb.prototype.onDestroy.call(this);if(this.attachNode){this.attachNode.onDestroy()}},toString:function(){return"LineLayer"}});function ea(e){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"};this.setStyleOptions(e.style||{});this._bufferArray=[];this._texture=null;eb.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 bY(i)}hI.sendMessage(aZ(4,3,11),["layer","fill"])}ea.inherits(eb,"FillLayer");e6.extend(ea.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 T=this.getData();if(!T){return}if(this.attach){if(e&&e instanceof cD){this.attach.center=e}this.attach.setData(T,this.params)}var kq=this.dataset=this.formatData(T);this.dispatchEvent(new fS("ondataparsed"));var i=this.fillsParse(kq.inner);this.fills=this.combineFill(i);this.buffer=this.createBufferData(this.fills);this.doOnceDraw()},fillsParse:function(kx){var kE=[];for(var kw=0;kw<kx.length;kw++){var kv=kx[kw].points;var T=false;if(!(kv[0] instanceof cD)){T=true}var kB=kx[kw].properties||{};var kD=kB.hasOwnProperty(this.base_opt.idKey)?kB[this.base_opt.idKey]:false;var ks=kw;if(kx[kw].index!==undefined){ks=kx[kw].index}var e=this.evaluates(ks,{properties:kB,id:kD});e=Object.assign(JSON.parse(JSON.stringify(cy[this.type])),e||{});var kC=this.getColorStyleForGL(e.fillColor,e.fillOpacity,true).join(",");var kA=[];if(this.style_opt.pattern&&this.style_opt.patternUrl){kA=[e.patternMapping.split(","),e.patternScale,e.patternOffset.split(",")]}var kr=this.buildFillVertex(kv,T);var kz=kr[0].length/2*3;var kt=new Float32Array(kz);var ky=0;for(var ku=0;ku<kr[0].length;ku++){kt[ky]=kr[0][ku];ky++;if((ku+1)%2===0){kt[ky]=ks;ky++}}var kq=[kC,kt,kr[1],kA];kq.hasMultipleParts=T;kE.push(kq)}return kE},buildFillVertex:function(kq,e){var kw=this._toFormatPolGeometry(kq,e);var kx=[];var kt;var ku=[];var ks=0;for(var kr=0;kr<kw.length;kr++){if(kr>0){ks+=kw[kr-1].length}kt=hP(kw[kr].pointsArray,null,null,ks);for(var T=0,kv=kt.length;T<kv;T+=3){kx.push(kt[T],kt[T+1],kt[T+2])}ku=ku.concat(kw[kr].pointsArray)}var ky=[new Float32Array(ku),new Uint16Array(kx)];return ky},combineFill:function(T){var kv={};var e=[];for(var ks=0;ks<T.length;ks++){var ku=this._cloneFill(T[ks]);if(ku.hasMultipleParts){e.push(ku)}else{var kr=ku[0]+"_"+ku[3].join("-");if(kv[kr]){if((kv[kr][1].length+ku[1].length)/3<65536){this.mergeDataItem(kv[kr],ku,kv[kr][1].length/3)}else{e.push(this._cloneFill(kv[kr]));kv[kr]=ku}}else{kv[kr]=ku}}}var kt=Object.keys(kv);for(var kq=0;kq<kt.length;kq++){e.push(kv[kt[kq]])}return e},_cloneFill:function(kr){var kq=kr[1].constructor;var i=new kq(kr[1].length);i.set(kr[1],0);var ks=kr[2].constructor;var T=new ks(kr[2].length);T.set(kr[2],0);var e=[kr[0],i,T,kr[3]];if(kr.hasMultipleParts){e.hasMultipleParts=kr.hasMultipleParts}return e},mergeDataItem:function(e,ks,T){var i=e[1];var kr=ks[1];var kq=e[2];var kt=ks[2];e[1]=this.concatTypedArray(i,kr);e[2]=this.concatTypedArray(kq,kt,T);return e},concatTypedArray:function(e,kt,ks){if(e.constructor===ArrayBuffer){var kq=new Uint8Array(e.byteLength+kt.byteLength);kq.set(new Uint8Array(e),0);kq.set(new Uint8Array(kt),e.byteLength);return kq.buffer}else{var kr=e.constructor;var kq=new kr(e.length+kt.length);kq.set(e,0);if(ks){for(var T=0;T<kt.length;T++){kt[T]+=ks}}kq.set(kt,e.length);return kq}},createBuffer:function(i){var T=3;var e=[{name:"a_pos",components:2,offset:0,type:"Float32"},{name:"a_id",components:1,offset:8,type:"Float32"}];return new w(i,{components:T,members:e},w.BufferType.VERTEX)},createBufferData:function(ks){var kt=[];for(var T=0;T<ks.length;T++){var kr=ks[T][1];var e=ks[T][2];if(!kr||!kr.length){continue}if(!this._bufferArray[kt.length]){this._bufferArray[kt.length]={vertex:null,element1:null,vao1:null};var kq=this._bufferArray[kt.length];kq.vertex=this.createBuffer(kr);kq.element1=new w(e,{components:1},w.BufferType.ELEMENT,e.length);kq.vao1=new dV()}else{var kq=this._bufferArray[kt.length];kq.vao1.update(this.gl,kq.vertex,kr,kr.length,kq.element1,e,e.length)}kt.push(kq)}return kt},preRender:function(T,i,e){},render:function(ks,ku,e){if(!this.buffer){return}e=e||{};if(this.style_opt.pattern&&this.style_opt.patternUrl){if(!this._texture){this._texture={status:"init"};var kw=this;var kr=new Image();kr.crossOrigin="anonymous";kr.onload=function(){kw._texture=d1.utils.createTexture(ks,this,{flipY:true,wrap:ks.REPEAT,mipmap:false,unpackAlpha:true});kw._texture.size=[this.width,this.height];kw._texture.status="done";kw.doOnceDraw()};kr.src=this.style_opt.patternUrl}if(this._texture.status!=="done"){return}}this.pickModel=e.isPickRender||false;var kv=this.map._webglPainter;var kx=kv._state;for(var kq=0;kq<this.buffer.length;kq++){var T=this.fills[kq][0];T=T.split(",");T=[T[0]/255,T[1]/255,T[2]/255,parseFloat(T[3])];var kt=this.fills[kq][3];if(this.fills[kq].hasMultipleParts){ks.clear(ks.STENCIL_BUFFER_BIT);ks.stencilFunc(ks.NEVER,0,255);kx.stencilOp(ks.INVERT,ks.INVERT,ks.INVERT);ks.stencilMask(255);kx.colorMask(false,false,false,false);this.drawFill(kv,this.buffer[kq],T,kt);ks.stencilFunc(ks.EQUAL,255,255);ks.stencilMask(0);kx.stencilOp(ks.KEEP,ks.KEEP,ks.KEEP);kx.colorMask(true,true,true,true);this.drawFill(kv,this.buffer[kq],T,kt);ks.clear(ks.STENCIL_BUFFER_BIT);ks.stencilMask(255);ks.stencilFunc(ks.ALWAYS,1,255)}else{this.drawFill(kv,this.buffer[kq],T,kt)}}if(this.attach){this.attach.render(ks,ku,e)}},drawFill:function(kG,ky,kz,kE){if(ky.element1&&ky.element1.length===0){return}var kD=kG.gl;var ks=kG.programMgr.useProgram("filllayer",{def:this.def});var kA=kG._camera._modelViewMatrixLayer;if(!ks.lastState.projMatrix){kD.uniformMatrix4fv(ks.uniforms.u_proj_matrix,false,kG.projMatrix);ks.lastState.projMatrix=true}kD.uniformMatrix4fv(ks.uniforms.u_mv_matrix,false,kA);kD.uniform4fv(ks.uniforms.u_color,kz);var T=this.opacity;if(ks.lastState.opacity!==T){kD.uniform1f(ks.uniforms.u_opacity,T);ks.lastState.opacity=T}var kt=this.style_opt.pattern;if(kt&&this._texture){kG._state.activeTexture(kD.TEXTURE5);kD.bindTexture(kD.TEXTURE_2D,this._texture);if(ks.uniforms.lastSampler!==5){kD.uniform1i(ks.uniforms.u_image,5);ks.uniforms.lastSampler=5}var kw=this._texture.size;if(ks.lastState.size!==kw){kD.uniform2fv(ks.uniforms.u_size,kw);ks.lastState.size=kw}}if(ks.lastState.pattern!==kt){kD.uniform1i(ks.uniforms.u_pattern,kt);ks.lastState.pattern=kt}var kq=this.style_opt.patternMask;if(ks.lastState.patternMask!==kq){kD.uniform1i(ks.uniforms.u_pattern_mask,kq);ks.lastState.patternMask=kq}var kx=this.map.getZoom();if(ks.lastState.mapZoom!==kx){kD.uniform1f(ks.uniforms.u_map_zoom,kx);ks.lastState.mapZoom=kx}var e=kE.length>=3?kE[0]:[0,0,0,0];if(ks.lastState.bound!==e){kD.uniform4fv(ks.uniforms.u_bound,e);ks.lastState.bound=e}var kH=kE.length>=3?kE[1]:0;if(ks.lastState.scale!==kH){kD.uniform1f(ks.uniforms.u_scale,kH);ks.lastState.scale=kH}var kr=kE.length>=3?kE[2]:[0,0];if(ks.lastState.offset!==kr){kD.uniform2fv(ks.uniforms.u_offset,kr);ks.lastState.offset=kr}var kv=this.base_opt.isFlat;if(ks.lastState.isFlat!==kv){kD.uniform1i(ks.uniforms.u_flat,kv);ks.lastState.isFlat=kv}var kC=this.base_opt.drawPart||1;if(ks.lastState.drawPart!==kC){kD.uniform1i(ks.uniforms.u_draw_part,kC);ks.lastState.drawPart=kC}var ku=kG._camera._far||4000;if(ks.lastState.cameraFar!==ku){kD.uniform1f(ks.uniforms.u_camera_far,ku);ks.lastState.cameraFar=ku}kD.uniform1i(ks.uniforms.u_pick_model,this.pickModel);if(ks.lastState.selectColor!==this.select_color){kD.uniform4fv(ks.uniforms.u_pick_color,this.select_color);ks.lastState.selectColor=this.select_color}if(ks.lastState.pickTag!==this.selectedIndex){kD.uniform1i(ks.uniforms.u_pick_tag,this.selectedIndex+1);ks.lastState.pickTag=this.selectedIndex}var kF=new Int16Array(this.DEL_COUNT);if(this.delIndexs.length){for(var kB=0;kB<this.delIndexs.length&&kB<this.DEL_COUNT;kB++){kF[kB]=this.delIndexs[kB]}}kD.uniform1iv(ks.uniforms["u_del_tags[0]"],kF);ky.vao1.bind(kD,ks,ky.vertex,ky.element1);kD.drawElements(kD.TRIANGLES,ky.element1.length,kD.UNSIGNED_SHORT,0);tags=null},onDestroy:function(e,i){this.fills=null;this.buffer=null;this._bufferArray=[];this._texture=null;eb.prototype.onDestroy.call(this);if(this.attach){this.attach.onDestroy()}},toString:function(){return"FillLayer"}});function aX(e){e=e||{};this.type="point";this.style_opt={visibility:true,nodeType:aX.NodeType.SHAPE,shapeType:aX.ShapeType.TRIANGLE,anchor:aX.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;eb.call(this,e);hI.sendMessage(aZ(4,3,9,2),["layer","point","shape"])}aX.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};aX.NodeType={ICON:1,SHAPE:2};aX.ShapeType={CIRCLE:0,TRIANGLE:2,CROSS:4,ARROW:5,ARROW_TAIL:6,0:0,2:2,4:4,5:5,6:6};aX.inherits(eb,"PointShapeLayer");aX.hasMask=function(e){if(e===aX.ShapeType.TRIANGLE||e===aX.ShapeType.ARROW){return true}else{return false}};e6.extend(aX.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 kr=this.getData();if(!kr){return}var ks=this.dataset=this.formatData(kr);this.dispatchEvent(new fS("ondataparsed"));var kt=this.pointsParse(ks);this.buffer=[];var e=0;for(var T=0;T<kt.length;T++){var kq=this.combineVertex(kt[T]);this.buffer.push(this.createBufferData(kq,e));e+=kq.length}this.doOnceDraw()},preRender:function(T,i,e){},pointsParse:function(ku){var kB=ku.inner;var kw=[];var kC=this.params.nodeStrictIndex||[];for(var kv=0;kv<kB.length;kv++){var kA=kB[kv];var kx=kA.properties||{};var kz=kx.hasOwnProperty(this.base_opt.idKey)?kx[this.base_opt.idKey]:false;var kr=this.evaluates(kA.properties.index,{properties:kx,id:kz});kr=Object.assign(JSON.parse(JSON.stringify(cy[this.type])),kr||{});if(this.base_opt.nodeBreakpoint===false&&kx.line_node_type===3){continue}if(!kr.visibility){continue}var e=this._toFormatPointGeometry(kA.points,this.base_opt.coorSysMc);kr.position=e;kr.index=isNaN(kx.index)?kv:kx.index;kr.id=isNaN(kz)||kz===false?kv:kz;kr.anchor=aX.Anchor[kr.anchor]===undefined?"center":kr.anchor;kr.shapeType=aX.ShapeType[kr.shapeType]===undefined?0:kr.shapeType;if(kx.line_node_type===1&&this.base_opt.linkLine){kr.rotation-=180}kr.lineNodeType=kx.line_node_type||9;if(kx.startPoint){var kt=kx.startPoint.split(",");if(kt.length==2){var kq=new cD(parseFloat(kt[0]),parseFloat(kt[1]));var ks=this._toFormatPointGeometry(kq,this.base_opt.coorSysMc);kr.startPoint=ks}}if(kx.endPoint){var kt=kx.endPoint.split(",");if(kt.length==2){var kq=new cD(parseFloat(kt[0]),parseFloat(kt[1]));var ky=this._toFormatPointGeometry(kq,this.base_opt.coorSysMc);kr.endPoint=ky}}if(kC.length===0){if(!kw[0]){kw[0]=[]}kw[0].push(kr)}else{var T=this._findTargetGroup(kr.index,kC);if(T>=0){if(!kw[T]){kw[T]=[]}kw[T].push(kr)}}}return kw},_findTargetGroup:function(T,kr){for(var kq=0;kq<kr.length;kq++){for(var e=0;e<kr[kq].length;e++){if(kr[kq][e]===T){return kq}}}return -1},combineVertex:function(kw){var kz=[{vertex:[],indices:[]}];var ku=kz[kz.length-1].vertex;var kx=kz[kz.length-1].indices;for(var kt=0,kv=kw.length;kt<kv;kt++){var T=kw[kt];if((ku.length+16*4)>65536){kz.push({vertex:[],indices:[]});ku=kz[kz.length-1].vertex;kx=kz[kz.length-1].indices}for(var ks=0;ks<4;ks++){ku.push(T.position[0],T.position[1]);var kq=this.int8ArrayToFloat([T.anchor,ks,T.shapeType,T.lineNodeType]);ku.push(kq);ku.push(T.size,T.scale,T.rotation*Math.PI/180);ku.push(T.offset[0],T.offset[1]);var e=this.getColorStyleForGL(T.color,undefined,true);var ky=this.getColorStyleForGL(T.strokeColor,undefined,true);ku.push(this.rgb2value(e),T.opacity,this.rgb2value(ky),T.strokeWeight);if(T.startPoint){ku.push(T.startPoint[0],T.startPoint[1])}else{ku.push(0.1,0.1)}if(T.endPoint){ku.push(T.endPoint[0],T.endPoint[1])}else{ku.push(0.1,0.1)}ku.push(T.index,T.id)}var kr=(kx.length/6)*4;kx.push(kr,kr+2,kr+1,kr,kr+3,kr+2)}return kz},createBuffer:function(i){var T=18;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_index",components:1,offset:64,type:"Float32"},{name:"a_id",components:1,offset:68,type:"Float32"}];return new w(i,{components:T,members:e},w.BufferType.VERTEX)},createBufferData:function(kt,e){var ku=[];e=e||0;for(var kq=0;kq<kt.length;kq++){var ks=new Float32Array(kt[kq].vertex.length);ks.set(kt[kq].vertex);var T=new Uint16Array(kt[kq].indices.length);T.set(kt[kq].indices);if(!ks||!ks.length){continue}if(!this._bufferArray[ku.length+e]){this._bufferArray[ku.length+e]={vertex:null,element1:null,vao1:null};var kr=this._bufferArray[ku.length+e];kr.vertex=this.createBuffer(ks);kr.element1=new w(T,{components:1},w.BufferType.ELEMENT,T.length);kr.vao1=new dV()}else{var kr=this._bufferArray[ku.length+e];kr.vao1.update(this.gl,kr.vertex,ks,ks.length,kr.element1,T,T.length)}ku.push(kr)}return ku},render:function(ku,kq,kt){if(!this.buffer){return}kt=kt||{};this.pickModel=kt.isPickRender||false;var T=kt.isMask===undefined?false:kt.isMask;var e=this.map._webglPainter;if(kt.renderIndex!==undefined&&this.buffer.length>kt.renderIndex){for(var kr=0;kr<this.buffer[kt.renderIndex].length;kr++){this.drawPointShape(e,this.buffer[kt.renderIndex][kr],T)}}else{for(var ks=0;ks<this.buffer.length;ks++){for(var kr=0;kr<this.buffer[ks].length;kr++){this.drawPointShape(e,this.buffer[ks][kr],T)}}}},drawPointShape:function(kw,e,kr){if(e.element1&&e.element1.length===0){return}var T=kw.gl;var i=kw.programMgr.useProgram("pointshapelayer",{def:this.def});var kv=kw._camera._modelViewMatrixLayer;if(!i.lastState.projMatrix){T.uniformMatrix4fv(i.uniforms.u_proj_matrix,false,kw.projMatrix);i.lastState.projMatrix=true}T.uniformMatrix4fv(i.uniforms.u_mv_matrix,false,kv);var kq=this.map.getZoom();if(i.lastState.mapZoom!==kq){T.uniform1f(i.uniforms.u_map_zoom,kq);i.lastState.mapZoom=kq}var ku=kw._camera._far||4000;if(i.lastState.cameraFar!==ku){T.uniform1f(i.uniforms.u_camera_far,ku);i.lastState.cameraFar=ku}if(i.lastState.isMask!==kr){T.uniform1i(i.uniforms.u_mask,kr);i.lastState.isMask=kr}T.uniform1i(i.uniforms.u_pick_model,this.pickModel||false);var kt=[2/this.map.width,2/this.map.height];if(i.lastState.resolutionRatio!==kt){T.uniform2fv(i.uniforms.u_resolution_ratio,kt);i.lastState.resolutionRatio=kt}var ks=this.base_opt.isFlat;if(i.lastState.isFlat!==ks){T.uniform1i(i.uniforms.u_flat,ks);i.lastState.isFlat=ks}if(i.lastState.selectColor!==this.select_color){T.uniform4fv(i.uniforms.u_pick_color,this.select_color);i.lastState.selectColor=this.select_color}if(i.lastState.pickTag!==this.selectedIndex){T.uniform1i(i.uniforms.u_pick_tag,this.selectedIndex+1);i.lastState.pickTag=this.selectedIndex}e.vao1.bind(T,i,e.vertex,e.element1);T.drawElements(T.TRIANGLES,e.element1.length,T.UNSIGNED_SHORT,0)},onDestroy:function(e,i){this.buffer=null;this._bufferArray=[];eb.prototype.onDestroy.call(this)},toString:function(){return"PointShapeLayer"}});function gi(e){e=e||{};this.type="point";this.style_opt={visibility:true,nodeType:gi.NodeType.ICON,icon:"",iconObj:null,anchors:[0,0],sizes:[32,32],scale:1,rotation:0,offset:[0,0],opacity:1,};this._appendStyle={anchors:{format:"object",defaultValue:[0,0]},sizes:{format:"object",defaultValue:[32,32]},};this.setStyleOptions(e.style||{});this._bufferArray=[];e.isFlat=e.isFlat===undefined?true:e.isFlat;e.isFixed=e.isFixed===undefined?true:e.isFixed;e.refLevel=e.refLevel===undefined?18:e.refLevel;eb.call(this,e);hI.sendMessage(aZ(4,3,9,1),["layer","point","icon"])}gi.NodeType={ICON:1,SHAPE:2};gi.inherits(eb,"PointIconLayer");e6.extend(gi.prototype,{onAdd:function(i,T){if(!this.map){this.map=i;this.gl=T}if(!this.buffer){this.parseData()}var e=this;i.addEventListener("oniconupdate",function(kq){e.updateVertex()})},parseData:function(){if(!this.loadModule||!this.styleExpress||!this.map||!this.map._normalLayerMgr){return}var e=this.getData();if(!e){return}this.dataset=this.formatData(e);this.dispatchEvent(new fS("ondataparsed"));this.updateVertex()},updateVertex:function(){if(!this.dataset){return}var i=this.pointsParse(this.dataset);this.updateAllIconsTextureCoords(i[0]);var e=this;this.map._normalLayerMgr.loadIconImages(i[0],function(T){e.updateAllIconsTextureCoords(i[0])},true)},updateAllIconsTextureCoords:function(ks){var ku=[];for(var kq=0;kq<ks.length;kq++){var kt=ks[kq];if(this.map._webglMapScene){var T=this.map._webglMapScene._painter;if(kt.icon instanceof HTMLCanvasElement){var kr=kt.icon.id}else{var kr=kt.icon}if(T._iconTextureAtlasCoords[kr]){kt.texcoord=T._iconTextureAtlasCoords[kr];ku.push(kt)}}}this.buffer=[];var e=[{vertex:[],indices:[]}];for(var kq=0;kq<ku.length;kq++){this.combineVertex(ku[kq],e)}this.buffer.push(this.createBufferData(e));this.doOnceDraw()},preRender:function(T,i,e){},pointsParse:function(kq){var kx=kq.inner;var ks=[];for(var kr=0;kr<kx.length;kr++){var kv=kx[kr];var kt=kv.properties||{};var ku=kt.hasOwnProperty(this.base_opt.idKey)?kt[this.base_opt.idKey]:false;var T=this.evaluates(kv.properties.index,{properties:kt,id:ku});var kz=JSON.parse(JSON.stringify(cy[this.type]));if(this._appendStyle){for(var kw in this._appendStyle){kz[kw]=this._appendStyle[kw].defaultValue}}T=Object.assign(kz,T||{});if(this.base_opt.nodeBreakpoint===false&&kt.line_node_type===3){continue}if(!T.visibility){continue}var e=this._toFormatPointGeometry(kv.points,this.base_opt.coorSysMc);T.position=e;T.index=isNaN(kt.index)?kr:kt.index;T.id=isNaN(ku)||ku===false?kr:ku;if(!T.icon&&this.style_opt.iconObj&&this.style_opt.iconObj instanceof Function){var ky=this.style_opt.iconObj(T,kt);T.icon=ky.canvas;if(ky.id!==undefined){T.icon.id=this.guid+"_"+ky.id}else{T.icon.id=this.guid+"_"+T.id}}if(!ks[0]){ks[0]=[]}ks[0].push(T)}return ks},combineVertex:function(kr,e){var kq=e[e.length-1].vertex;var ks=e[e.length-1].indices;if((kq.length+14*4)>65536){e.push({vertex:[],indices:[]});kq=e[e.length-1].vertex;ks=e[e.length-1].indices}for(var T=3;T>=0;T--){kq.push(kr.position[0],kr.position[1]);kq.push(kr.sizes[0],kr.sizes[1],kr.anchors[0],kr.anchors[1]);kq.push(kr.scale,kr.rotation*Math.PI/180,4-T,kr.opacity);kq.push(kr.offset[0],kr.offset[1],kr.texcoord[T*2],kr.texcoord[T*2+1]);kq.push(kr.index,kr.id)}var i=(ks.length/6)*4;ks.push(i,i+2,i+1,i,i+3,i+2)},createBuffer:function(i){var T=14;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_index",components:1,offset:56,type:"Float32"},{name:"a_id",components:1,offset:60,type:"Float32"}];return new w(i,{components:T,members:e},w.BufferType.VERTEX)},createBufferData:function(ks){var kt=[];for(var T=0;T<ks.length;T++){var kr=new Float32Array(ks[T].vertex.length);kr.set(ks[T].vertex);var e=new Uint16Array(ks[T].indices.length);e.set(ks[T].indices);if(!kr||!kr.length){continue}if(!this._bufferArray[kt.length]){this._bufferArray[kt.length]={vertex:null,element1:null,vao1:null};var kq=this._bufferArray[kt.length];kq.vertex=this.createBuffer(kr);kq.element1=new w(e,{components:1},w.BufferType.ELEMENT,e.length);kq.vao1=new dV()}else{var kq=this._bufferArray[kt.length];kq.vao1.update(this.gl,kq.vertex,kr,kr.length,kq.element1,e,e.length)}kt.push(kq)}return kt},render:function(ku,kq,kt){if(!this.buffer){return}kt=kt||{};this.pickModel=kt.isPickRender||false;var T=kt.isMask===undefined?false:kt.isMask;var e=this.map._webglPainter;if(kt.renderIndex!==undefined&&this.buffer.length>kt.renderIndex){for(var kr=0;kr<this.buffer[kt.renderIndex].length;kr++){this.drawPointIcon(e,this.buffer[kt.renderIndex][kr],T)}}else{for(var ks=0;ks<this.buffer.length;ks++){for(var kr=0;kr<this.buffer[ks].length;kr++){this.drawPointIcon(e,this.buffer[ks][kr],T)}}}},drawPointIcon:function(kz,i,kt){if(i.element1&&i.element1.length===0){return}var kr=kz.gl;var kq=kz.programMgr.useProgram("pointiconlayer",{def:this.def});var ky=kz._camera._modelViewMatrixLayer;if(!kq.lastState.projMatrix){kr.uniformMatrix4fv(kq.uniforms.u_proj_matrix,false,kz.projMatrix);kq.lastState.projMatrix=true}kr.uniformMatrix4fv(kq.uniforms.u_mv_matrix,false,ky);var ks=this.map.getZoom();if(kq.lastState.mapZoom!==ks){kr.uniform1f(kq.uniforms.u_map_zoom,ks);kq.lastState.mapZoom=ks}var kx=kz._camera._far||4000;if(kq.lastState.cameraFar!==kx){kr.uniform1f(kq.uniforms.u_camera_far,kx);kq.lastState.cameraFar=kx}kr.uniform1i(kq.uniforms.u_pick_model,this.pickModel||false);var kw=[2/this.map.width,2/this.map.height];if(kq.lastState.resolutionRatio!==kw){kr.uniform2fv(kq.uniforms.u_resolution_ratio,kw);kq.lastState.resolutionRatio=kw}var kv=this.base_opt.isFlat;if(kq.lastState.isFlat!==kv){kr.uniform1i(kq.uniforms.u_flat,kv);kq.lastState.isFlat=kv}var e=this.base_opt.isFixed;if(kq.lastState.isFixed!==e){kr.uniform1i(kq.uniforms.u_fixed,e);kq.lastState.isFixed=e}var T=this.base_opt.refLevel;if(kq.lastState.refLevel!==T){kr.uniform1f(kq.uniforms.u_ref_level,T);kq.lastState.isFlat=T}if(kq.lastState.selectColor!==this.select_color){kr.uniform4fv(kq.uniforms.u_pick_color,this.select_color);kq.lastState.selectColor=this.select_color}if(kq.lastState.pickTag!==this.selectedIndex){kr.uniform1i(kq.uniforms.u_pick_tag,this.selectedIndex+1);kq.lastState.pickTag=this.selectedIndex}var ku=kz._iconTextureAtlas.getTexture();kz._state.activeTexture(kr.TEXTURE5);kr.bindTexture(kr.TEXTURE_2D,ku);if(kq.uniforms.lastSamper!==5){kr.uniform1i(kq.uniforms.u_sampler,5);kq.uniforms.lastSamper=5}i.vao1.bind(kr,kq,i.vertex,i.element1);kr.drawElements(kr.TRIANGLES,i.element1.length,kr.UNSIGNED_SHORT,0)},onDestroy:function(e,i){this.buffer=null;this._bufferArray=[];eb.prototype.onDestroy.call(this)},toString:function(){return"PointIconLayer"}});var hb=null;bD.register(function(i){if(i.config&&i.config.isOverviewMap){return}if(i.isLoaded()){K(i);hb=jx(i)}else{i.addEventListener("load",function(){K(this);hb=jx(this)})}i.cityName="中国";i.cCode="1";var e={};e.enableRequest=true;e.request=function(){if(e.enableRequest){e.enableRequest=false;setTimeout(function(){e._request()},500)}};e._request=function(){var kq=i.getBoundsIn();if(!kq){return}var ks=i.getZoom();var T=kq.getSouthWest();var kr=kq.getNorthEast();j9.request(function(kw){if(kw.current_city["code"]>=9000&&kw.current_city["code"]<=9378){kw.current_city["name"]="台湾省"}if(kw.current_city["code"]>=20000&&kw.current_city["code"]<=20499){kw.current_city["name"]="新加坡"}if(kw.current_city["code"]>=20500&&kw.current_city["code"]<=25999){kw.current_city["name"]="泰国"}if(kw.current_city["code"]>=26000&&kw.current_city["code"]<=29999){kw.current_city["name"]="日本"}if(kw.current_city["code"]>=30000&&kw.current_city["code"]<=30999){kw.current_city["name"]="韩国"}if(kw.current_city["code"]>=31000&&kw.current_city["code"]<=37000){kw.current_city["name"]="亚太"}if(kw.current_city["code"]>=46609&&kw.current_city["code"]<=52505){kw.current_city["name"]="欧洲"}if(kw.current_city["code"]>=39509&&kw.current_city["code"]<=53500){kw.current_city["name"]="南美洲"}if(kw.current_city["code"]>=54000&&kw.current_city["code"]<=70000){kw.current_city["name"]="北美洲"}if(kw.current_city["code"]===54003&&kw.current_city["code"]>=60731&&kw.current_city["code"]<=61123){kw.current_city["name"]="美国"}if(kw.current_city["code"]===54015||kw.current_city["code"]>=57970&&kw.current_city["code"]<=60223){kw.current_city["name"]="加拿大"}if(kw.current_city["code"]===54025||kw.current_city["code"]>=54338&&kw.current_city["code"]<=57374){kw.current_city["name"]="墨西哥"}e.enableRequest=true;if(kw&&kw.current_city){var kv=kw.current_city["name"];var ku=kw.current_city["code"];if(ku!==i.cCode){var kt=new fS("oncitychange");kt.name=kv;kt.code=ku;i.dispatchEvent(kt)}i.cityName=kv;i.cCode=ku;if(!b2()){c7(i)}}},{qt:"cen",b:T.lng+","+T.lat+";"+kr.lng+","+kr.lat,l:ks},"","",true)};i.addEventListener("load",function(T){e.request()});i.addEventListener("moveend",function(T){e.request()});i.addEventListener("zoomend",function(T){e.request()});e.request()});function jx(T){var e={};var i=new j7(e);T.addControl(i);return i}function K(i){if(i.temp.copyadded){return}i.temp.copyadded=true;if(!i.cpyCtrl){var kq=new je(2,2);i.config.cpyCtrlOffset=kq;if(b2()){kq.width=72;kq.height=0}var T=new gg({offset:kq,printable:true});i.cpyCtrl=T}if(!b2()){c7(i);i.addEventListener("maptypechange",function(){c7(i)})}i.addControl(T);var e=new bG();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();T.setOffset(i.config.cpyCtrlOffset)}else{e.hide();T.setOffset(new je(4,2))}});if(i.getSize().width>=300&&i.getSize().height>=100){e.show()}else{e.hide();T.setOffset(new je(4,2))}i.addEventListener("oncopyrightoffsetchange",function(kr){i.logoCtrl.setOffset(kr.target.logo);i.cpyCtrl.setOffset(kr.target.cpy)});i.dispatchEvent(new fS("oncopyrightaddend"))}function c7(kF){if(!kF.cpyCtrl){var kN=new je(2,2);if(b2()){kN.width=72;kN.height=0}var kI=new gg({offset:kN,printable:true});kF.cpyCtrl=kI}var kW=kF.cityName||"中国";var kG=kF.getMapType();var kH=["常州市","南昌市","乌鲁木齐市","无锡市","福州市","泉州市","珠海市","贵阳市"];var kz=["北京市","上海市","广州市","深圳市","宁波市","石家庄市","沈阳市","长春市","青岛市","温州市","台州市","金华市","佛山市","中山市","昆明市","南宁市","苏州市","西安市","济南市","郑州市","合肥市","呼和浩特市","杭州市","成都市","武汉市","长沙市","天津市","南京市","重庆市","大连市","东莞市","厦门市"];var kB=["香港特别行政区"];var kv=["台湾省"];var kO=["日本"];var kU=["韩国"];var kJ=["泰国"];var kM=["亚太"];var kw=["新加坡"];var kV=["欧洲"];var kq=["南美洲"];var kR=["北美洲"];var T=["美国"];var kL=["墨西哥"];var kt=["加拿大"];for(var kS in kH){if(kH[kS]===kW){var kC=true;break}}for(var kS in kz){if(kz[kS]===kW){var kr=true;break}}for(var kS in kB){if(kB[kS]===kW){var kY=true;break}}if(kv[0]===kW){var kQ=true}if(kw[0]===kW){var i=true}if(kO[0]===kW){var ky=true}if(kU[0]===kW){var kE=true}if(kJ[0]===kW){var kD=true}if(kM[0]===kW){var ku=true}if(kV[0]===kW){var kA=true}if(kq[0]===kW){var kx=true}if(kR[0]===kW){var e=true}if(T[0]===kW){var kT=true}if(kt[0]===kW){var kP=true}if(kL[0]===kW){var ks=true}var kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "];var kK="rgba(255, 255, 255, 0.701961)";if(kF.getZoom()<=9){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(kQ){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(ky||kE){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(i||kD){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(ku){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(kA){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(kx){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}else{if(e){kX=["&copy;&nbsp;2023 Baidu - GS(2021)6026号 - 甲测资字11111342 - 京ICP证030173号 - Data &copy; "]}}}}}}}}if(kF.getZoom()<=9){kX.push("百度智图");kX.push(' &amp; <a target="_blank" href="http://www.openstreetmap.org/">OpenStreetMap</a>');kX.push(' &amp; <a target="_blank" href="http://corporate.navteq.com/supplier_terms.html">HERE</a>');if(kG===BMAP_SATELLITE_MAP||kG===BMAP_HYBRID_MAP){kX.push(' &amp; <a target="_blank" href="http://www.eso.org/public/">ESO</a>');kK="rgba(0,0,0,.7)"}}else{if(ky||kE){kX.push('<a target="_blank" href="http://www.openstreetmap.org/">OpenStreetMap</a>')}else{if(i||kD){kX.push('<a target="_blank" href="http://corporate.navteq.com/supplier_terms.html">HERE</a>')}else{if(ku){kX.push('<a target="_blank" href="http://corporate.navteq.com/supplier_terms.html">HERE</a>');kX.push(' &amp; <a target="_blank" href="https://www.mapbox.com/">Mapbox</a>')}else{if(kA){kX.push('<a target="_blank" href="http://www.openstreetmap.org/">OpenStreetMap</a>');kX.push(' &amp; <a target="_blank" href="https://www.mapbox.com/">Mapbox</a>')}else{if(kx){kX.push('<a target="_blank" href="http://www.openstreetmap.org/">OpenStreetMap</a>');kX.push(' &amp; <a target="_blank" href="https://www.mapbox.com/">Mapbox</a>')}else{if(kT||ks||kP){kX.push('<a target="_blank" href="http://corporate.navteq.com/supplier_terms.html">HERE</a>');kX.push(' &amp; <a target="_blank" href="https://www.mapbox.com/">Mapbox</a>')}else{if(e){kX.push('<a target="_blank" href="http://www.openstreetmap.org/">OpenStreetMap</a>');kX.push(' &amp; <a target="_blank" href="https://www.mapbox.com/">Mapbox</a>')}else{kX.push("百度智图");if(kC){kX.push(' &amp; <a target="_blank" href="http://www.palmcity.cn/palmcity/">PalmCity</a>')}if(kY){kX.push(' &amp; <a target="_blank" href="http://www.mapking.com/HongKong/eng/home/MapKing_Webmap.html">MapKing</a>')}if(kQ){kX.push(' &amp; <a target="_blank" href="http://corporate.navteq.com/supplier_terms.html">HERE</a>');kX.push(' &amp; <a target="_blank" href="http://www.localking.com.tw/about/localking.aspx">樂客LocalKing</a>')}if(kG===BMAP_SATELLITE_MAP||kG===BMAP_HYBRID_MAP){kK="rgba(0,0,0,.7)"}}}}}}}}}kX.unshift('<span style="background: '+kK+';padding: 0px 1px;line-height: 16px;display: inline;height: 16px;">');kX.push("</span>");kX=kX.join("");kF.cpyCtrl.addCopyright({id:1,content:kX})}function j7(e){this["defaultAnchor"]=BMAP_ANCHOR_TOP_RIGHT;this["defaultOffset"]=e.defaultOffset||new je(90,6);this._cZIndex=9999;this._visible=false}j7.prototype=new gS();j7.prototype.initialize=function(kr){this._map=kr;var kq=this;var e=b3("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 ks=b3("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;"});ks.innerText="确定";ks.addEventListener("click",function(){kq.hide()});var T=b3("div");var kt=T.style;kt.position="relative";kt.width="100%";kt.height="100%";kt.color="#000";kt.fontSize="14px";kt.wordBreak="break-all";e.appendChild(T);e.appendChild(ks);kr.getContainer().appendChild(e);return e};j7.prototype._setPosition=function(){};j7.prototype.update=function(e){if(!this.isVisible()){this._container.firstChild.innerText=e;this.show()}};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 B="carport_list";var d0="carport_auth";var dk="cur";var aa="cen";var J="s";var dD="con";var dv="bd";var cX="nb";var ha="bt";var aP="nav";var il="walk";var f1="gc";var d4="rgc";var L="dec";var iE="iploc";var gT="bse";var gp="nse";var dh="s";var ew="bsl";var fY="bda";var et="sa";var bb="nba";var iu="drag";var jf="ext";var jT="exts";var jW="hip";var hM="ride";var j6="drct";var b7="ldt";var fx=2;var bk=4;var f8=7;var iv=11;var ce=12;var e1=14;var cU=15;var ek=18;var aB=20;var ba=21;var I=19;var a=23;var iQ=26;var aD=28;var gq=31;var fd=35;var iF=44;var bi=45;var ay=46;var jR=47;var gv=-1;var bd=0;var bC=1;var jk=2;var dT=3;window.BMAP_POI_TYPE_NORMAL=0;var cH=1;var ix=2;BMapGL.I=e6.I;var bM={};bM.removeHtml=function(e){e=e.replace(/<\/?[^>]*>/g,"");e=e.replace(/[ | ]* /g," ");return e};bM.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;")};bM.parseGeoExtReg2=function(i,e){var T=new RegExp("(((-?\\d+)(\\.\\d+)?),((-?\\d+)(\\.\\d+)?);)(((-?\\d+)(\\.\\d+)?),((-?\\d+)(\\.\\d+)?);){"+e+"}","ig");return i.replace(T,"$1")};var dL=0;var dj=1;var U=2;bM.unique=function(T){var ks=false;var kr=[];var kt={};for(var kq=0,e=T.length;kq<e;kq++){if(!kt[T[kq]]){kt[T[kq]]=true;kr.push(T[kq])}}return kr};bM.getBestLevel=function(T,i){if(i){var e=Math.min(i.width/1100,i.height/660);T=Math.round(T+(Math.log(e)/Math.log(2)))}if(T<1){T=1}if(T>21){T=21}return T};bM.parseGeo=function(kt,kw){if(typeof kt!="string"||!kt){return}var ky=kt.split("|");var e;var kr;var T;if(ky.length==1){e=b8(kt)}else{e=b8(ky[2]);kr=b8(ky[0]);T=b8(ky[1]);if(!kw){return e}}var ku={type:e.geoType};if(kw){switch(ku.type){case U:var kv=new cD(e.geo[0][0],e.geo[0][1]);var kx=jn.convertMC2LL(kv);ku.point=kx;ku.points=[kx];break;case dj:ku.points=[];var kz=e.geo[0];for(var ks=0,kq=kz.length-1;ks<kq;ks+=2){var kA=new cD(kz[ks],kz[ks+1]);kA=jn.convertMC2LL(kA);ku.points.push(kA)}kr=new cD(kr.geo[0][0],kr.geo[0][1]);T=new cD(T.geo[0][0],T.geo[0][1]);kr=jn.convertMC2LL(kr);T=jn.convertMC2LL(T);ku.bounds=new ib(kr,T);break;default:break}}return ku};bM.parseGeoExt=function(kJ,kA){if(!kA){kA=0}else{if(kA<0.25){kA=0}else{if(kA>0.25&&kA<1){kA=1}else{if(kA>32){kA=32}}}}var kv=kJ.split("|");if(kv.length==1){var kq=b8(kv[0]);return{type:kq.type,bound:"",points:kq.geo.join(",")}}else{if(kv.length>1){var kB=kJ.split(";.=");var kx=[];var kr=[];var kC=0;var kG=kB.length;for(var kD=0;kD<kG;kD++){var kI=kB[kD];if(kG>1){if(kD==0){kI=kI+";"}if(kD>0&&kD<kG-1){kI=".="+kI+";"}if(kD==kG-1){kI=".="+kI}}var ks=kI.split("|");var kF=b8(ks[0]);var kE=b8(ks[1]);kx.push(kF.geo.join(","));kx.push(kE.geo.join(","));var kq=b8(ks[2]);kC=kq.type;var kH=kq.geo.join(",");kH=bM.parseGeoExtReg1(kH);if(kA>0){kH=bM.parseGeoExtReg2(kH,kA)}kr.push(kH)}if(kG<=1){kr=kr.join(";")}if(kG==2){var T=kr[0]+";"+kr[1];var kt=T.split(";");var e=[];for(var kD=0;kD<kt.length;kD++){var kw=kt[kD].split(",")[0];var ku=kt[kD].split(",")[1];var ky=new cD(kw,ku);var kz=jn.convertMC2LL(ky);e.push(kz)}kr=e}return{type:kC,bound:kx.join(";"),points:kr}}}};bM.getPoiPoint=function(e){var T=[];var i=null;if(e.toString()=="Point"){i=e}else{if(typeof e=="string"){T=e6.trim(e).split(",");if(T.length<2){return}T[0]=parseFloat(e6.trim(T[0]));T[1]=parseFloat(e6.trim(T[1]))}else{T=e.slice(0);if(T.length<2){return}}i=new BMap.Point(T[0],T[1])}return i};bM.parseGeoStr=function(T){var i=T.split(",");var e=new cD(i[0],i[1]);return jn.convertMC2LL(e)};bM.level={country:4,province:11,city:12,area:13};var ho=["=",".","-","*"];var df=1<<23;function b8(kw){var kv=h7(kw.charAt(0));var T=kw.substr(1);var ky=0;var e=T.length;var kz=[];var kt=[];var ku=[];while(ky<e){if(T.charAt(ky)==ho[0]){if((e-ky)<13){return 0}ku=ej(T.substr(ky,13),kz);if(ku<0){return 0}ky+=13}else{if(T.charAt(ky)==";"){kt.push(kz.slice(0));kz.length=0;++ky}else{if((e-ky)<8){return 0}ku=ck(T.substr(ky,8),kz);if(ku<0){return 0}ky+=8}}}for(var ks=0,kq=kt.length;ks<kq;ks++){for(var kr=0,kx=kt[ks].length;kr<kx;kr++){kt[ks][kr]/=100}}return{geoType:kv,geo:kt}}function h7(i){var e=-1;if(i==ho[1]){e=U}else{if(i==ho[2]){e=dj}else{if(i==ho[3]){e=dL}}}return e}function ej(kr,T){var e=0;var kt=0;var ks=0;for(var kq=0;kq<6;kq++){ks=dC(kr.substr(1+kq,1));if(ks<0){return -1-kq}e+=ks<<(6*kq);ks=dC(kr.substr(7+kq,1));if(ks<0){return -7-kq}kt+=ks<<(6*kq)}T.push(e);T.push(kt);return 0}function ck(ks,kq){var T=kq.length;if(T<2){return -1}var e=0;var ku=0;var kt=0;for(var kr=0;kr<4;kr++){kt=dC(ks.substr(kr,1));if(kt<0){return -1-kr}e+=kt<<(6*kr);kt=dC(ks.substr(4+kr,1));if(kt<0){return -5-kr}ku+=kt<<(6*kr)}if(e>df){e=df-e}if(ku>df){ku=df-ku}kq.push(kq[T-2]+e);kq.push(kq[T-1]+ku);return 0}function dC(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}bM.pathToPoints=function(ks){var kq=[];if(typeof ks!=="string"){return kq}else{var kr=ks.split(";");for(var T=0;T<kr.length;T++){var e=kr[T].split(",");kq.push(new cD(e[0],e[1]))}}return kq};bM.pointsToString=function(kr){var kq="";if(typeof kr!=="object"){return kr}else{for(var T=0;T<kr.length;T++){var e=kr[T].lat+","+kr[T].lng;if(T!==kr.length-1){kq=kq+e+"|"}else{kq=kq+e}}}return kq};bM.stringToPoints=function(ks){var kq=[];if(typeof ks!=="string"||!ks){return kq}else{var kr=ks.split("|");for(var T=0;T<kr.length;T++){var e=kr[T].split(",");kq.push(new cD(e[1],e[0]))}}return kq};window.BMAP_POI_TYPE_NORMAL=0;window.BMAP_POI_TYPE_BUSSTOP=1;window.BMAP_POI_TYPE_BUSLINE=2;window.BMAP_POI_TYPE_SUBSTOP=3;window.BMAP_POI_TYPE_SUBLINE=4;var R=0;var hR=1;var fM={};window.APIPack=fM;function aI(i,e){de.call(this);this._loc={};this.setLocation(i);e=e||{};e.renderOptions=e.renderOptions||{};this._opts={renderOptions:{panel:e.renderOptions.panel||null,map:e.renderOptions.map||null,autoViewport:e.renderOptions.autoViewport||true,selectFirstResult:e.renderOptions.selectFirstResult,highlightMode:e.renderOptions.highlightMode,enableDragging:e.renderOptions.enableDragging||false},onSearchComplete:e.onSearchComplete||function(){},onMarkersSet:e.onMarkersSet||function(){},onInfoHtmlSet:e.onInfoHtmlSet||function(){},onResultsHtmlSet:e.onResultsHtmlSet||function(){},onGetBusListComplete:e.onGetBusListComplete||function(){},onGetBusLineComplete:e.onGetBusLineComplete||function(){},onBusListHtmlSet:e.onBusListHtmlSet||function(){},onBusLineHtmlSet:e.onBusLineHtmlSet||function(){},onPolylinesSet:e.onPolylinesSet||function(){},reqFrom:e.reqFrom||""};if(typeof e!="undefined"&&typeof e.renderOptions!="undefined"&&typeof e.renderOptions["autoViewport"]!="undefined"){this._opts.renderOptions.autoViewport=e.renderOptions["autoViewport"]}else{this._opts.renderOptions.autoViewport=true}this._opts.renderOptions.panel=e6.G(this._opts.renderOptions.panel)}aI.inherits(de,"BaseSearch");e6.extend(aI.prototype,{getResults:function(){if(!this._isMultiKey){return this._results}else{return this._arrResults}},enableAutoViewport:function(){this._opts.renderOptions.autoViewport=true},disableAutoViewport:function(){this._opts.renderOptions.autoViewport=false},setLocation:function(e){if(!e){return}this._loc.src=e},setSearchCompleteCallback:function(e){this._opts.onSearchComplete=e||function(){}},setMarkersSetCallback:function(e){this._opts.onMarkersSet=e||function(){}},setPolylinesSetCallback:function(e){this._opts.onPolylinesSet=e||function(){}},setInfoHtmlSetCallback:function(e){this._opts.onInfoHtmlSet=e||function(){}},setResultsHtmlSetCallback:function(e){this._opts.onResultsHtmlSet=e||function(){}},getStatus:function(){return this._status}});var cG=function(T,i){aI.call(this,T,i);i=i||{};i.renderOptions=i.renderOptions||{};this.setPageCapacity(i.pageCapacity);if(typeof i.renderOptions["selectFirstResult"]!="undefined"&&!i.renderOptions["selectFirstResult"]){this.disableFirstResultSelection()}else{this.enableFirstResultSelection()}this._overlays=[];this._arrPois=[];this._curIndex=-1;this._queryList=[];var e=this;he.load("localSearch",function(){e._check()},true)};cG.inherits(aI,"LocalSearch");cG.DEFAULT_PAGE_CAPACITY=10;cG.MIN_PAGE_CAPACITY=1;cG.MAX_PAGE_CAPACITY=100;cG.DEFAULT_RADIUS=2000;cG.MAX_RADIUS=100000;e6.extend(cG.prototype,{search:function(e,i){this._queryList.push({method:"search",arguments:[e,i]});hI.sendMessage(aZ(4,4,6,1),["service","poi","normal"])},searchInBounds:function(e,T,i){this._queryList.push({method:"searchInBounds",arguments:[e,T,i]});hI.sendMessage(aZ(4,4,6,2),["service","poi","bound"])},searchNearby:function(T,i,e,kq){this._queryList.push({method:"searchNearby",arguments:[T,i,e,kq]});hI.sendMessage(aZ(4,4,6,3),["service","poi","circle"])},clearResults:function(){delete this._json;delete this._status;delete this._results;delete this._ud;this._curIndex=-1;this._setStatus();if(this._opts.renderOptions.panel){this._opts.renderOptions.panel.innerHTML=""}},gotoPage:function(){},enableFirstResultSelection:function(){this._opts.renderOptions.selectFirstResult=true},disableFirstResultSelection:function(){this._opts.renderOptions.selectFirstResult=false},setPageCapacity:function(e){if(typeof e=="number"&&!isNaN(e)){this._opts.pageCapacity=e<1?cG.DEFAULT_PAGE_CAPACITY:(e>cG.MAX_PAGE_CAPACITY?cG.DEFAULT_PAGE_CAPACITY:e)}else{this._opts.pageCapacity=cG.DEFAULT_PAGE_CAPACITY}},getPageCapacity:function(){return this._opts.pageCapacity},toString:function(){return"LocalSearch"}});function bl(i){this._opts={};e6.extend(this._opts,i);this._queryList=[];var e=this;he.load("otherSearch",function(){e._asyncSearch()})}bl.inherits(de,"Geocoder");e6.extend(bl.prototype,{getPoint:function(e,T,i){this._queryList.push({method:"getPoint",arguments:[e,T,i]})},getLocation:function(e,T,i){this._queryList.push({method:"getLocation",arguments:[e,T,i]})},toString:function(){return"Geocoder"}});function c2(e){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;he.load("otherSearch",function(){var T=i._pendingCalls.length;for(var kq=0;kq<T;kq++){var kr=i._pendingCalls[kq];i[kr.method].apply(i,kr.arguments)}})}e6.extend(c2.prototype,{getCurrentPosition:function(e,i){this._pendingCalls.push({method:"getCurrentPosition",arguments:arguments})},getStatus:function(){return BMAP_STATUS_UNKNOWN_LOCATION},enableSDKLocation:function(){if(b2()){this.config.SDKLocation=true}},disableSDKLocation:function(){this.config.SDKLocation=false}});function ft(){this._queryList=[];var e=this;he.load("otherSearch",function(){e._asyncSearch()})}ft.inherits(de,"Boundary");e6.extend(ft.prototype,{get:function(i,e){this._queryList.push({method:"get",arguments:[i,e]})},toString:function(){return"Boundary"},parsebdStr:function(i,e){}});function fm(i){i=i||{};i.renderOptions=i.renderOptions||{};this._opts={renderOptions:{map:i.renderOptions.map||null}};this._queryList=[];var e=this;he.load("otherSearch",function(){e._asyncSearch()})}fm.inherits(de,"LocalCity");e6.extend(fm.prototype,{get:function(e){this._queryList.push({method:"get",arguments:[e]})},toString:function(){return"LocalCity"}});function hr(e,T){de.call(this);this.markersList=[];this.destList=[];this.pointsList=[];this._opts=T;this.json=e;this.map=this._opts.renderOptions.map||null;this.sType=this._opts.sType;this.infoWindow=null;this.curPointIndex=0;this.startName="";this.endIndex=1;this.endName="";this.resCity=[0,0,0,0,0,0,0];this.locPois=[];this.curPageIndex=[1,1,1,1,1,1,1];this.totalPage=[1,1,1,1,1,1,1];this.resCount=[0,0,0,0,0,0,0];this.resType=[0,0,0,0,0,0,0];this.qInfo=[{n:"",c:0,u:0,x:0,y:0,t:-1},{n:"",c:0,u:0,x:0,y:0,t:-1},{n:"",c:0,u:0,x:0,y:0,t:-1},{n:"",c:0,u:0,x:0,y:0,t:-1},{n:"",c:0,u:0,x:0,y:0,t:-1},{n:"",c:0,u:0,x:0,y:0,t:-1},{n:"",c:0,u:0,x:0,y:0,t:-1}];this.curSelectedIndex=-1;this.tpList=[];this.tpListInMap=[];var i=this;he.load("route",function(){})}hr.inherits(de,"RouteAddr");function eG(T,i){aI.call(this,T,i);this.QUERY_TYPE_BUSLIST=dh;this.RETURN_TYPE_BUSLIST=cU;this.QUERY_TYPE_BUSLINE=ew;this.RETURN_TYPE_BUSLINE=ek;this._queryList=[];var e=this;he.load("buslineSearch",function(){e._asyncSearch()})}var fK=C.staticHost+"/wolfman/static/common/images/";eG._iconOpen=C.apiIMG+"/iw_plus.gif";eG._iconClose=C.apiIMG+"/iw_minus.gif";eG._stopUrl=fK+"new/bus-stop-1x_ddd4723.png";eG.inherits(aI,"BusLineSearch");e6.extend(eG.prototype,{getBusList:function(e){this._queryList.push({method:"getBusList",arguments:[e]})},getBusLine:function(e){this._queryList.push({method:"getBusLine",arguments:[e]})},setGetBusListCompleteCallback:function(e){this._opts.onGetBusListComplete=e||function(){}},setGetBusLineCompleteCallback:function(e){this._opts.onGetBusLineComplete=e||function(){}},setBusListHtmlSetCallback:function(e){this._opts.onBusListHtmlSet=e||function(){}},setBusLineHtmlSetCallback:function(e){this._opts.onBusLineHtmlSet=e||function(){}},setPolylinesSetCallback:function(e){this._opts.onPolylinesSet=e||function(){}}});function jg(i){aI.call(this,i);i=i||{};this._options={input:i.input||null,baseDom:i.baseDom||null,types:i.types||[],onSearchComplete:i.onSearchComplete||function(){}};this._loc.src=i.location||"全国";this._word="";this._show=false;this._suggestion=null;this._inputValue="";this._initialize();var e=this;he.load("autocomplete",function(){e._asyncSearch()},true)}jg.inherits(aI,"Autocomplete");e6.extend(jg.prototype,{_initialize:function(){},show:function(){this._show=true},hide:function(){this._show=false},setTypes:function(e){this._options.types=e},setLocation:function(e){this._loc.src=e},search:function(e){this._word=e},setInputValue:function(e){this._inputValue=e},setSearchCompleteCallback:function(e){this._options.onSearchComplete=e}});var jY=function(i,e){aI.call(this,i,e)};e6.inherit(jY,aI,"BaseRoute");e6.extend(jY.prototype,{clearResults:function(){}});window.BMAP_TRANSIT_POLICY_RECOMMEND=0;window.BMAP_TRANSIT_POLICY_LEAST_TIME=4;window.BMAP_TRANSIT_POLICY_LEAST_TRANSFER=1;window.BMAP_TRANSIT_POLICY_LEAST_WALKING=2;window.BMAP_TRANSIT_POLICY_AVOID_SUBWAYS=3;window.BMAP_TRANSIT_POLICY_FIRST_SUBWAYS=5;window.BMAP_LINE_TYPE_BUS=0;window.BMAP_LINE_TYPE_SUBWAY=1;window.BMAP_LINE_TYPE_FERRY=2;window.BMAP_LINE_TYPE_TRAIN=3;window.BMAP_LINE_TYPE_AIRPLANE=4;window.BMAP_LINE_TYPE_COACH=5;var iy=3;var ei=4;var ah=1;var iw=2;var aY=5;var cW=6;window.BMAP_TRANSIT_TYPE_IN_CITY=0;window.BMAP_TRANSIT_TYPE_CROSS_CITY=1;window.BMAP_TRANSIT_PLAN_TYPE_ROUTE=0;window.BMAP_TRANSIT_PLAN_TYPE_LINE=1;window.BMAP_TRANSIT_TYPE_POLICY_TRAIN=0;window.BMAP_TRANSIT_TYPE_POLICY_AIRPLANE=1;window.BMAP_TRANSIT_TYPE_POLICY_COACH=2;window.BMAP_INTERCITY_POLICY_LEAST_TIME=0;window.BMAP_INTERCITY_POLICY_EARLY_START=1;window.BMAP_INTERCITY_POLICY_CHEAP_PRICE=2;function eV(T,i){jY.call(this,T,i);i=i||{};this.setPolicy(i.policy);this.setIntercityPolicy(i.intercityPolicy);this.setTransitTypePolicy(i.transitTypePolicy);this.setPageCapacity(i.pageCapacity);this.QUERY_TYPE=ha;this.RETURN_TYPE=e1;this.ROUTE_TYPE=hR;this._overlays=[];this._curIndex=-1;this._opts._enableTraffic=i.enableTraffic||false;this._queryList=[];var e=this;he.load("route",function(){e._asyncSearch()},true)}eV.MAX_PAGE_CAPACITY=100;eV.LINE_TYPE_MAPPING=[0,1,0,0,0,0,0,0,2,0,0,0,1,1,1];eV.LINE_TYPE_MAPPING_CROSS_CITY=[0,3,4,0,0,0,5];e6.inherit(eV,jY,"TransitRoute");e6.extend(eV.prototype,{setPolicy:function(e){if(e>=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){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=eV.MAX_PAGE_CAPACITY;return}}if(typeof e!=="number"){this._opts.pageCapacity=eV.MAX_PAGE_CAPACITY;return}if(e>=1&&e<=eV.MAX_PAGE_CAPACITY){this._opts.pageCapacity=Math.round(e)}else{this._opts.pageCapacity=eV.MAX_PAGE_CAPACITY}},toString:function(){return"TransitRoute"},_shortTitle:function(e){return e.replace(/\(.*\)/,"")}});window.BMAP_HIGHLIGHT_STEP=1;window.BMAP_HIGHLIGHT_ROUTE=2;var cL=function(e,kq){jY.call(this,e,kq);this._overlays=[];this._curIndex=-1;this._queryList=[];var T=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;he.load("route",function(){T._asyncSearch()},true);if(this.init_d){this.init_d()}};cL.ROAD_TYPE=["","环岛","无属性道路","主路","高速连接路","交叉点内路段","连接道路","停车场内部道路","服务区内部道路","桥","步行街","辅路","匝道","全封闭道路","未定义交通区域","POI连接路","隧道","步行道","公交专用道","提前右转道"];e6.inherit(cL,jY,"DWRoute");e6.extend(cL.prototype,{search:function(T,e,i){this._queryList.push({method:"search",arguments:[T,e,i]})}});var iY=function(e,T){jY.call(this,e,T);this._overlays=[];this._queryList=[];var i=this;this.map=T.renderOptions.map;this._enableDragging=this._opts.renderOptions.enableDragging?true:false;this._menu=new BMapGL.ContextMenu();this._menu.addItem(new h9("删除该点",function(ks,kr,kq){i._deleteVia(kq.curNo-1)},60));this.map.addContextMenu(this._menu,true);he.load("route",function(){i._asyncSearch()},true);if(this.init_d){this.init_d()}};e6.inherit(iY,jY,"LineLayerRoute");e6.extend(iY.prototype,{search:function(T,e,i){this._queryList.push({method:"search",arguments:[T,e,i]})}});window.BMAP_DRIVING_POLICY_DEFAULT=0;window.BMAP_DRIVING_POLICY_AVOID_HIGHWAYS=3;window.BMAP_DRIVING_POLICY_FIRST_HIGHWAYS=4;window.BMAP_DRIVING_POLICY_AVOID_CONGESTION=5;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 cw(e,i){cL.call(this,e,i);i=i||{};this._opts._enableTraffic=i.enableTraffic||false;this.setPolicy(i.policy);this.QUERY_TYPE=aP;this.RETURN_TYPE=aB;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_DRIVING;hI.sendMessage(aZ(4,4,1,1),["service","drive","overlay"])}function ga(e,i){iY.call(this,e,i);i=i||{};this.setPolicy(i.policy);this.QUERY_TYPE=aP;hI.sendMessage(aZ(4,4,1,2),["service","drive","layer"])}e6.inherit(ga,iY,"DrivingRouteLine");e6.inherit(cw,cL,"DrivingRoute");cw.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}};ga.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}};function fy(e,i){cL.call(this,e,i);this.QUERY_TYPE=il;this.RETURN_TYPE=gq;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_WALKING;this._enableDragging=false;hI.sendMessage(aZ(4,4,4),["service","walk"])}e6.inherit(fy,cL,"WalkingRoute");function da(e,i){cL.call(this,e,i);this.QUERY_TYPE=hM;this.ROUTE_TYPE=BMAP_ROUTE_TYPE_RIDING;this._enableDragging=false;hI.sendMessage(aZ(4,4,3),["service","ride"])}e6.inherit(da,cL,"RidingRoute");function X(e,i){iY.call(this,e,i);i=i||{};this.QUERY_TYPE=b7;this.setPolicy(i.policy);hI.sendMessage(aZ(4,4,2),["service","truck"])}e6.inherit(X,iY,"TruckRoute");X.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 a5={web:"//api.map.baidu.com/direction?",android:"bdapp://map/direction?",ios:"baidumap://map/direction?"};function iV(e){this.opts=e||{}}e6.extend(iV.prototype,{routeCall:function(kq,e,T){var i=this;he.load("route",function(){i._asyncSearch(kq,e,T)})}});function eg(){return Pano.getStreetViewCoverageLayer(bD)}function eX(){Pano.PanoramaService.call(this)}e6.inherit(eX,Pano.PanoramaService,"PanoramaService");e6.extend(eX.prototype,{getPanoramaById:function(T,i){var e=this;this.getPanoById(T,function(kq){i&&i(e._makeData(kq))})},getPanoramaByLocation:function(e,T){e=jn.convertLL2MC(e);var i=this;this.getPanoByLocation(e,50,function(kq){T&&T(i._makeData(kq))})},_makeData:function(T){if(!T){return null}var i={};var e=T.content[0];i.description=e.Rname||e.Info||"";i.id=e.ID;i.pointX=e.X/100;i.pointY=e.Y/100;i.position=jn.convertMC2LL(new cD(i.pointX,i.pointY));return i}});function fo(){if(window.PANORAMA_URL){return Pano.getPanoControl(bD,{imgPath:C.imgPath,tileBaseUrl:C.panoTilePath,})}return Pano.getPanoControl(bD)}function P(T,e){if(!e){return}this.content=T;if(e.position&&!Array.isArray(e.position)){e.position=jn.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,})}e6.inherit(P,Pano.PanoOverlay,"PanoramaLabel");e6.extend(P.prototype,{init:function(e){var i=this;this._pano=e;this.updatedDistance();Pano.PanoOverlay.prototype.init.call(this,e);this._pano.on("dataload",function(T){i.updatedDistance()})},_createDom:function(){var kq=this.content;var kt=document.createElement("div");var i=kt.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";kt.appendChild(e);var T=document.createElement("span");T.style.margin="0 14px";T.innerText=kq;e.appendChild(T);if(!this.hideDistance){var ks=document.createElement("span");ks.style.color="color:rgba(255,255,255,0.3)";ks.innerText="|";e.appendChild(ks);var kr=document.createElement("span");kr.style.margin="0 8px";kr.style.color="#60c7fa";kr.style.fontSize="12px";kr.innerText="0米";e.appendChild(kr);this._distanceDom=kr}this._dom=kt;this._titleDom=T;return kt},updatedDistance:function(){if(this.hideDistance){return}var T=0;if(this._pano){var i=this._pano.position;var e=this.position;if(i&&!i.equals(e)){T=jn.getDistanceByMC(i,e)}}if(T>100){T=T/1000;T=T<100?T.toFixed(2):T.toFixed(0);T+="公里"}else{T=T<100?T.toFixed(2):T.toFixed(0);T+="米"}this._distanceDom.innerText=T},});function d(i){if(typeof i==="string"&&/^(?!#)(\w)*/.test(i)){i="#"+i}var kq={};if(window.PANORAMA_URL){kq.imgPath=C.imgPath;kq.tileBaseUrls=[C.panoTilePath]}var e=Pano.init(i,kq);var T=e.setPosition;e.setPosition=function(ks){var kt=jn.convertLL2MC(ks);T.call(e,kt)};var kr=e.addEventListener;e.addEventListener=function(ks,kt){if(ks==="position_changed"){kr.call(e,ks,function(ku){var kv=jn.convertMC2LL(ku);kt(kv)})}else{kr.call(e,ks,kt)}};hI.sendMessage(aZ(4,3,5),["layer","pano"]);return e}bD.Map=hX;bD.MapType=es;bD.Point=cD;bD.Pixel=fr;bD.Size=je;bD.Bounds=ib;bD.PrivateRegionDataModel=cS;bD.TileLayer=hH;bD.Copyright=m;bD.Projection=bD.Project=jn;bD.XYZProjection=bD.XYZProject=dI;bD.Convertor=f3;bD.RenderTypeUtils=dc;bD.Overlay=aS;bD.Label=h4;bD.Marker=s;bD.Symbol=fp;bD.SVGSymbol=dR;bD.Icon=jH;bD.Polyline=br;bD.BezierCurve=cN;bD.PolylineMultipart=eu;bD.Polygon=iU;bD.MapMask=kc;bD.Prism=bx;bD.Marker3D=el;bD.GroundOverlay=f9;bD.GroundPoint=dW;bD.CustomOverlay=bR;bD.CustomHtmlLayer=dE;bD.ParkingSpot=iz;bD.InfoWindow=ec;bD.SimpleInfoWindow=ie;bD.Circle=aV;bD.Control=gS;bD.NavigationControl=jV;bD.IndoorManager=dd;bD.NavigationControl3D=e8;bD.CopyrightControl=gg;bD.ScaleControl=kp;bD.CityListControl=by;bD.MapTypeControl=v;bD.ZoomControl=jq;bD.LocationControl=gz;bD.LogoControl=bG;bD.DistanceTool=cl;bD.ContextMenu=hy;bD.MenuItem=h9;bD.OperationMask=ak;bD.Animation=fH;bD.ViewAnimation=q;bD.Transitions=gL;bD.Event=fS;bD.trafficLayer=jS;bD.TrafficLayer=ju;bD.GeoJSONLayer=aO;bD.XYZLayer=kd;bD.PixelLayer=dy;bD.GeoJSONParse=gH;bD.NormalLayer=cs;bD.LineLayer=bY;bD.FillLayer=ea;bD.PointShapeLayer=aX;bD.PointIconLayer=gi;bD.Entity=jo;bD.MVTLayer=eh;bD.BaiduLayer=V;bD.Geolocation=c2;bD.Geocoder=bl;bD.Boundary=ft;bD.DistrictLayer=d7;bD.LocalCity=fm;bD.LocalSearch=cG;bD.Autocomplete=jg;bD.BusLineSearch=eG;bD.WalkingRoute=fy;bD.RidingRoute=da;bD.DrivingRoute=cw;bD.DrivingRouteLine=ga;bD.TransitRoute=eV;bD.RouteSearch=iV;bD.TruckRoute=X;bD.PanoramaCoverageLayer=eg;bD.PanoramaControl=fo;bD.PanoramaService=eX;bD.PanoramaLabel=P;bD.Panorama=d;function hp(e,i){for(var T in i){e[T]=i[T]}}bD.fetchDebug&&bD.fetchDebug.init();bD.verify();bD.apiLoad();bD.frequency();bD.getSeckeyCid();window._layer=1;e6.extend(d7.prototype,{_asyncSearch:function(){for(var T=0,e=this._queryList.length;T<e;T++){var kq=this._queryList[T];this[kq.method].apply(this,kq.arguments)}delete this._queryList},addDistrict:function(){if(this._opts.districts){var e=this._opts.districts;if(typeof e==="string"){this.getDistrictData(e)}else{if(Object.prototype.toString.call(e)==="[object Array]"){var i=this.parseArrayParams(e);this.getDistrictData(i)}}}},parseArrayParams:function(e){var kr="";for(var kq=0;kq<e.length;kq++){if(e[kq] instanceof Array){kr+="(";for(var T=0;T<e.length;T++){kr+=e[T]}kr+=")"}else{kr+="("+e[kq]+")"}}return kr},getDistrictData:function(e){var i=this;j9.request(function(kq){var T=i._parseGeoData(kq);i._drawToMap(i,T)},{qt:jT,adnames:e,level:i._opts.kind})},_drawToMap:function(kz,kv){var ky=kv.boundaries.length;if(ky===0){alert("未能获取当前输入行政区域");return}var kA=this._config.fillColor;var ks=this._config.fillOpacity;var T=this._config.strokeColor;var e=this._config.strokeOpacity;var kw=this._config.strokeWeight;if(typeof kA==="string"){var kq=kA;var kB=[];for(var ku=0;ku<ky;ku++){var kx=new BMapGL.Polygon(kv.boundaries[ku],{strokeWeight:kw,strokeColor:T,strokeOpacity:e,fillColor:kq,fillOpacity:ks});kx.style={strokeWeight:kw,strokecolor:T,strokeOpacity:e,fillColor:kq,fillOpacity:ks};this.disOverlays.push(kx);this.addEventListenerIn();kz._map.addOverlay(kx);kB=kB.concat(kx.getPath())}if(this._config.viewport){kz._map.setViewport(kB)}}else{if(Object.prototype.toString.call(kA)==="[object Array]"){var kB=[];var kt=kA.length;if(kt<ky){for(var ku=0,kr=0;ku<ky-kt;ku++){if(kr<kt-1){kA.push(kA[kr++])}else{kA.push(kA[0])}}}for(var ku=0;ku<ky;ku++){var kq=kA[ku];var kx=new BMapGL.Polygon(kv.boundaries[ku],{strokeWeight:kw,strokeColor:T,strokeOpacity:e,fillColor:kq,fillOpacity:ks});kx.style={strokeWeight:kw,strokecolor:T,strokeOpacity:e,fillColor:kq,fillOpacity:ks};this.disOverlays.push(kx);this.addEventListenerIn();kz._map.addOverlay(kx);kB=kB.concat(kx.getPath())}if(this._config.viewport){kz._map.setViewport(kB)}}}},_parseGeoData:function(kz){var kC={};kC.boundaries=[];if(kz&&kz.content&&kz.content["geo"]){for(var kH=0;kH<kz.content["geo"].length;kH++){var kq=bM.parseGeo(kz.content["geo"][kH],false);if(kq.geo&&kq.geo.length&&kq.geo.length>0){var kF=kq.geo.length;for(jC=0;jC<kF;jC++){var T=kq.geo[jC];if(T&&T.length&&T.length>0){var kx=T.length-1;var kE=[];var kw=false;var kD=0;var kB=0;for(var kG=0;kG<kx;kG+=2){var ku=T[kG];var ks=T[kG+1];var kA=new cD(ku,ks);kA=jn.convertMC2LL(kA);if(kG<kx-3){var i=T[kG+2];var e=T[kG+3];var ky=new cD(i,e);ky=jn.convertMC2LL(ky)}kE.push(kA.lng+", "+kA.lat)}if(kw===true){if(kD>kB){var kI=kD;kD=kB;kB=kI}var kv=kE;var kt=kE.splice(kD+1);var kr=kt.splice(kB-kD);kv=kv.concat(kr);kC.boundaries.push(kv.join(";"));kC.boundaries.push(kt.join(";"));kw=false;continue}if(kE.length!==0){kC.boundaries.push(kE.join(";"))}}}}}}return kC},deleteDistrict:function(kq){var T=kq.disOverlays;for(var e=0;e<T.length;e++){this._map.removeOverlay(T[e])}},addEventListener:function(e,i){this.eventAndCallback[e]=i},addEventListenerIn:function(){var kq=this;var ks=Object.keys(kq.eventAndCallback);if(ks.length>0){for(var T=0;T<ks.length;T++){var kr=kq.eventAndCallback[ks[T]];for(var e=0;e<kq.disOverlays.length;e++){kq.disOverlays[e].addEventListener(ks[T],kr)}}}},searchBoundary:function(i,kr){i=i||{};var e=i.name||"";var T=i.kind||0;var kq=this;j9.request(function(kt){var ks=kq._parseGeoData(kt);kr&&kr(ks)},{qt:jT,adnames:e,level:T})}});window._layer=2;})(BMapGL,"BMapGL");