XWWitPark/witpark_zhwy/xw_zhwy_web/public/lib/mapV/mapv.min.js
2024-09-12 08:10:00 +08:00

2 lines
77 KiB
JavaScript

/* 2020-9-22 15:23:19 | 版权所有 军懋国兴 */
function _typeof(t){return(_typeof="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)}!function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.mapv=t.mapv||{})}(this,function(t){"use strict";function n(){this._subscribers={}}function O(t,e){n.bind(this)(),this._options=e||{},this._data=[],t&&this.add(t)}function g(t,e,n,i){for(var o,r,a,s,l=0;l<6;l++){var u=(o={x:e,y:n},r=i,s=a=void 0,a=60*l+30,s=Math.PI/180*a,[o.x+r*Math.cos(s),o.y+r*Math.sin(s)]);t.lineTo(u[0],u[1])}}function x(t,e){var n;return"undefined"==typeof document||(n=document.createElement("canvas"),t&&(n.width=t),e&&(n.height=e)),n}function I(t){t=t||{},this.gradient=t.gradient||{.25:"rgba(0, 0, 255, 1)",.55:"rgba(0, 255, 0, 1)",.85:"rgba(255, 255, 0, 1)",1:"rgba(255, 0, 0, 1)"},this.maxSize=t.maxSize||35,this.minSize=t.minSize||0,this.max=t.max||100,this.min=t.min||0,this.initPalette()}function l(r,t,a){var s=a.max||100,e=a.min||0,n=a._size;null!=n||null==(n=a.size)&&(n=13);var i,o,l,u,h,c,g,p=new I({gradient:a.gradient,max:s,min:e}),f=(u=new x(2*(l=(i=n)+(o=i/2)),2*l),(h=u.getContext("2d")).shadowBlur=o,h.shadowColor="black",h.shadowOffsetX=h.shadowOffsetY=1e4,h.beginPath(),h.arc(l-1e4,l-1e4,i,0,2*Math.PI,!0),h.closePath(),h.fill(),u),d=f.width/2,v=f.height/2,y=t,m={};for(c in y.forEach(function(t,e){var n=void 0===t.count?1:t.count,i=Math.min(1,n/s).toFixed(2);m[i]=m[i]||[],m[i].push(t)}),m){isNaN(c)||(g=m[c],r.beginPath(),a.withoutAlpha||(r.globalAlpha=c),r.strokeStyle=p.getColor(c*s),g.forEach(function(t,e){var n,i,o;t.geometry&&(n=t.geometry._coordinates||t.geometry.coordinates,"Point"===(i=t.geometry.type)?(o=void 0===t.count?1:t.count,r.globalAlpha=o/s,r.drawImage(f,n[0]-d,n[1]-v)):"LineString"===i&&(o=void 0===t.count?1:t.count,r.globalAlpha=o/s,r.beginPath(),F.draw(r,t,a),r.stroke()))}))}}function a(t,e,n){var i=t.createShader(n);return t.shaderSource(i,e),t.compileShader(i),i}function w(t,e,n){var i=a(t,e,t.VERTEX_SHADER),o=a(t,n,t.FRAGMENT_SHADER),r=t.createProgram();return t.attachShader(r,i),t.attachShader(r,o),t.linkProgram(r),t.useProgram(r),r}function _(t){var e=document.createElement("canvas"),n=e.getContext("2d");return e.width=1,e.height=1,n.fillStyle=t,n.fillRect(0,0,1,1),n.getImageData(0,0,1,1).data}function m(t,e,n){n=n||2;var i,o,r,a,s,l,u,h=e&&e.length,c=h?e[0]*n:t.length,g=d(t,0,c,n,!0),p=[];if(!g)return p;if(h&&(g=function(t,e,n,i){var o,r,a,s,l,u=[];for(o=0,r=e.length;o<r;o++)a=e[o]*i,s=o<r-1?e[o+1]*i:t.length,(l=d(t,a,s,i,!1))===l.next&&(l.steiner=!0),u.push(function(t){var e=t,n=t;for(;e.x<n.x&&(n=e),e=e.next,e!==t;);return n}(l));for(u.sort(b),o=0;o<u.length;o++)(function(t,e){{var n;(e=function(t,e){var n,i=e,o=t.x,r=t.y,a=-1/0;do{if(r<=i.y&&r>=i.next.y){var s=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=o&&a<s){if((a=s)===o){if(r===i.y)return i;if(r===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(o===a)return n.prev;var l,u=n,h=n.x,c=n.y,g=1/0;for(i=n.next;i!==u;)o>=i.x&&i.x>=h&&S(r<c?o:a,r,h,c,r<c?a:o,r,i.x,i.y)&&(((l=Math.abs(r-i.y)/(o-i.x))<g||l===g&&i.x>n.x)&&C(i,t)&&(n=i,g=l)),i=i.next;return n}(t,e))&&v(n=A(e,t),n.next)}})(u[o],n),n=v(n,n.next);return n}(t,e,g,n)),t.length>80*n){i=r=t[0],o=a=t[1];for(var f=n;f<c;f+=n)(s=t[f])<i&&(i=s),(l=t[f+1])<o&&(o=l),r<s&&(r=s),a<l&&(a=l);u=Math.max(r-i,a-o)}return y(g,p,n,i,o,u),p}function d(t,e,n,i,o){var r,a;if(o===0<L(t,e,n,i))for(r=e;r<n;r+=i)a=s(r,t[r],t[r+1],a);else for(r=n-i;e<=r;r-=i)a=s(r,t[r],t[r+1],a);return a&&h(a,a.next)&&(p(a),a=a.next),a}function v(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!h(i,i.next)&&0!==M(i.prev,i,i.next))i=i.next;else{if(p(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function y(t,e,n,i,o,r,a){if(t){!a&&r&&function(t,e,n,i){var o=t;for(;null===o.z&&(o.z=f(o.x,o.y,e,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next,o!==t;);o.prevZ.nextZ=null,o.prevZ=null,function(t){var e,n,i,o,r,a,s,l,u=1;do{for(n=t,r=t=null,a=0;n;){for(a++,i=n,e=s=0;e<u&&(s++,i=i.nextZ);e++);for(l=u;0<s||0<l&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(n=(o=n).nextZ,s--):(i=(o=i).nextZ,l--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;n=i}r.nextZ=null,u*=2}while(1<a)}(o)}(t,i,o,r);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,r?function(t,e,n,i){var o=t.prev,r=t,a=t.next;if(0<=M(o,r,a))return!1;for(var s=o.x<r.x?o.x<a.x?o.x:a.x:r.x<a.x?r.x:a.x,l=o.y<r.y?o.y<a.y?o.y:a.y:r.y<a.y?r.y:a.y,u=o.x>r.x?o.x>a.x?o.x:a.x:r.x>a.x?r.x:a.x,h=o.y>r.y?o.y>a.y?o.y:a.y:r.y>a.y?r.y:a.y,c=f(s,l,e,n,i),g=f(u,h,e,n,i),p=t.nextZ;p&&p.z<=g;){if(p!==t.prev&&p!==t.next&&S(o.x,o.y,r.x,r.y,a.x,a.y,p.x,p.y)&&0<=M(p.prev,p,p.next))return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&S(o.x,o.y,r.x,r.y,a.x,a.y,p.x,p.y)&&0<=M(p.prev,p,p.next))return!1;p=p.prevZ}return!0}(t,i,o,r):function(t){var e=t.prev,n=t,i=t.next;if(0<=M(e,n,i))return!1;for(var o=t.next.next;o!==t.prev;){if(S(e.x,e.y,n.x,n.y,i.x,i.y,o.x,o.y)&&0<=M(o.prev,o,o.next))return!1;o=o.next}return!0}(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),p(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?y(t=function(t,e,n){var i=t;do{var o=i.prev,r=i.next.next;!h(o,r)&&c(o,i,i.next,r)&&C(o,r)&&C(r,o)&&(e.push(o.i/n),e.push(i.i/n),e.push(r.i/n),p(i),p(i.next),i=t=r),i=i.next}while(i!==t);return i}(t,e,n),e,n,i,o,r,2):2===a&&function(t,e,n,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&c(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&C(t,e)&&C(e,t)&&function(t,e){var n=t,i=!1,o=(t.x+e.x)/2,r=(t.y+e.y)/2;for(;n.y>r!=n.next.y>r&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next,n!==t;);return i}(t,e)}(a,s)){var l=A(a,s);return a=v(a,a.next),l=v(l,l.next),y(a,e,n,i,o,r),y(l,e,n,i,o,r)}s=s.next}a=a.next}while(a!==t)}(t,e,n,i,o,r):y(v(t),e,n,i,o,r,1);break}}}function b(t,e){return t.x-e.x}function f(t,e,n,i,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function S(t,e,n,i,o,r,a,s){return 0<=(o-a)*(e-s)-(t-a)*(r-s)&&0<=(t-a)*(i-s)-(n-a)*(e-s)&&0<=(n-a)*(r-s)-(o-a)*(i-s)}function M(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function h(t,e){return t.x===e.x&&t.y===e.y}function c(t,e,n,i){return h(t,e)&&h(n,i)||h(t,i)&&h(n,e)||0<M(t,e,n)!=0<M(t,e,i)&&0<M(n,i,t)!=0<M(n,i,e)}function C(t,e){return M(t.prev,t,t.next)<0?0<=M(t,e,t.next)&&0<=M(t,t.prev,e):M(t,e,t.prev)<0||M(t,t.next,e)<0}function A(t,e){var n=new u(t.i,t.x,t.y),i=new u(e.i,e.x,e.y),o=t.next,r=e.prev;return(t.next=e).prev=t,(n.next=o).prev=n,(i.next=n).prev=i,(r.next=i).prev=r,i}function s(t,e,n,i){var o=new u(t,e,n);return i?(o.next=i.next,(o.prev=i).next.prev=o,i.next=o):(o.prev=o).next=o,o}function p(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function u(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function L(t,e,n,i){for(var o=0,r=e,a=n-i;r<n;r+=i)o+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return o}function r(t){var e=t.split("|");return e[0]=e[0].split(","),{lng:parseFloat(e[0][0]),lat:parseFloat(e[0][1])}}function i(t){this.splitList=t||{other:1}}function o(t){this.splitList=t||[{start:0,value:"red"}]}function k(t){this.options=t||{},this.paneName=this.options.paneName||"mapPane",this.context=this.options.context||"2d",this.zIndex=this.options.zIndex||0,this.mixBlendMode=this.options.mixBlendMode||null,this.enableMassClear=this.options.enableMassClear,this._map=t.map,this._lastDrawTime=null,this.show()}function E(t,e){for(var n,i,o,r,a,s,l=0;l<t.length;l++)if(n=t[l],i=e,s=a=r=o=void 0,o=Math.min(n.ne.x,i.ne.x),r=Math.min(n.sw.y,i.sw.y),a=Math.max(n.sw.x,i.sw.x),s=Math.max(n.ne.y,i.ne.y),a<o&&s<r)return 1}function z(t){function e(t,e){return function(){e.apply(t)}}this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=z.DEFAULT_PANE_NAME_,this.updateHandler_=null,this.resizeHandler_=null,this.topLeft_=null,this.centerListener_=null,this.resizeListener_=null,this.needsResize_=!0,this.requestAnimationFrameId_=null;var n=document.createElement("canvas");n.style.position="absolute",n.style.top=0,n.style.left=0,n.style.pointerEvents="none",this.canvas=n,this.canvasCssWidth_=300,this.canvasCssHeight_=150,this.resolutionScale_=1,this.repositionFunction_=e(this,this.repositionCanvas_),this.resizeFunction_=e(this,this.resize_),this.requestUpdateFunction_=e(this,this.update_),t&&this.setOptions(t)}function R(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}n.prototype.on=function(t,e){var n=this._subscribers[t];n||(n=[],this._subscribers[t]=n),n.push({callback:e})},n.prototype.off=function(t,e){var n=this._subscribers[t];if(n)for(var i=0;i<n.length;i++)n[i].callback==e&&(n.splice(i,1),i--)},n.prototype._trigger=function(t,e,n){if("*"==t)throw new Error("Cannot trigger event *");var i=[];t in this._subscribers&&(i=i.concat(this._subscribers[t])),"*"in this._subscribers&&(i=i.concat(this._subscribers["*"]));for(var o=0,r=i.length;o<r;o++){var a=i[o];a.callback&&a.callback(t,e,n||null)}},(O.prototype=n.prototype).add=function(t,e){if(Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var o;t[n].time&&14==t[n].time.length&&"20"==t[n].time.substr(0,2)&&(o=t[n].time,t[n].time=new Date(o.substr(0,4)+"-"+o.substr(4,2)+"-"+o.substr(6,2)+" "+o.substr(8,2)+":"+o.substr(10,2)+":"+o.substr(12,2)).getTime()),this._data.push(t[n])}else{if(!(t instanceof Object))throw new Error("Unknown dataType");this._data.push(t)}},O.prototype.get=function(t){t=t||{};var e=(new Date,this._data);if(new Date,t.filter){for(var n=[],i=0;i<e.length;i++)t.filter(e[i])&&n.push(e[i]);e=n}return t.transferCoordinate&&(e=this.transferCoordinate(e,t.transferCoordinate,t.fromColumn,t.toColumn)),e},O.prototype.set=function(t){this._set(t),this._trigger("change")},O.prototype._set=function(t){this.clear(),this.add(t)},O.prototype.clear=function(t){this._data=[]},O.prototype.remove=function(t){},O.prototype.update=function(t,e){for(var n=this._data,i=0;i<n.length;i++)if(e){var o,r=!0;for(o in e)n[i][o]!=e[o]&&(r=!1);r&&t&&t(n[i])}else t&&t(n[i]);this._trigger("change")},O.prototype.transferCoordinate=function(t,a,e,n){function i(t){for(var e=[],n=0;n<t.length;n++){for(var i=t[n],o=[],r=0;r<i.length;r++)o.push(a(i[r]));e.push(o)}return e}n=n||"_coordinates",e=e||"coordinates";for(var o=0;o<t.length;o++){var r=t[o].geometry,s=r[e];switch(r.type){case"Point":r[n]=a(s);break;case"LineString":for(var l=[],u=0;u<s.length;u++)l.push(a(s[u]));r[n]=l;break;case"Polygon":l=i(s);r[n]=l;break;case"MultiPolygon":for(var l=[],h=0;h<s.length;h++){var c=i(c=s[h]);l.push(c)}r[n]=l}}return t},O.prototype.initGeometry=function(e){e?this._data.forEach(function(t){t.geometry=e(t)}):this._data.forEach(function(t){!t.geometry&&t.lng&&t.lat&&(t.geometry={type:"Point",coordinates:[t.lng,t.lat]})})},O.prototype.getMax=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=parseFloat(e[0][t]),i=1;i<e.length;i++){var o=parseFloat(e[i][t]);n<o&&(n=o)}return n}},O.prototype.getSum=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=0,i=0;i<e.length;i++)e[i][t]&&(n+=parseFloat(e[i][t]));return n}},O.prototype.getMin=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=parseFloat(e[0][t]),i=1;i<e.length;i++){var o=parseFloat(e[i][t]);o<n&&(n=o)}return n}};var F={drawDataSet:function(t,e,n){for(var i=e instanceof O?e.get():e,o=0,r=i.length;o<r;o++){var a=i[o];this.draw(t,a,n)}},draw:function(t,e,n){var i=e.geometry.type,o=e.geometry._coordinates||e.geometry.coordinates,r=n.symbol||"circle";switch(i){case"Point":var a=e._size||e.size||n._size||n.size||5;"circle"===r?("Point"===n.bigData&&t.moveTo(o[0],o[1]),t.arc(o[0],o[1],a,0,2*Math.PI)):"rect"===r?t.rect(o[0]-a/2,o[1]-a/2,a,a):"honeycomb"===r&&g(t,o[0],o[1],a);break;case"LineString":for(var s=0;s<o.length;s++){var l=o[s][0],u=o[s][1];0==s?t.moveTo(l,u):t.lineTo(l,u)}break;case"Polygon":this.drawPolygon(t,o);break;case"MultiPolygon":for(var h=0;h<o.length;h++){var c=o[h];this.drawPolygon(t,c)}t.closePath();break;default:console.log("type"+i+"is not support now!")}},drawPolygon:function(t,e){for(var n=0;n<e.length;n++){var i=e[n];t.moveTo(i[0][0],i[0][1]);for(var o=1;o<i.length;o++)t.lineTo(i[o][0],i[o][1]);t.lineTo(i[0][0],i[0][1])}}},T={draw:function(t,e,n){var i,o=e instanceof O?e.get():e;for(i in t.save(),n)t[i]=n[i];if(n.bigData){t.save(),t.beginPath();for(var r=0,a=o.length;r<a;r++){var s=o[r];F.draw(t,s,n)}"Point"==(l=n.bigData)||"Polygon"==l||"MultiPolygon"==l?(t.fill(),(s.strokeStyle||n.strokeStyle)&&n.lineWidth&&t.stroke()):"LineString"==l&&t.stroke(),t.restore()}else for(r=0,a=o.length;r<a;r++){s=o[r];t.save(),(s.fillStyle||s._fillStyle)&&(t.fillStyle=s.fillStyle||s._fillStyle),(s.strokeStyle||s._strokeStyle)&&(t.strokeStyle=s.strokeStyle||s._strokeStyle);var l=s.geometry.type;t.beginPath(),F.draw(t,s,n),"Point"==l||"Polygon"==l||"MultiPolygon"==l?(t.fill(),(s.strokeStyle||n.strokeStyle)&&n.lineWidth&&t.stroke()):"LineString"==l&&t.stroke(),t.restore()}t.restore()}};I.prototype.setMax=function(t){this.max=t||100},I.prototype.setMin=function(t){this.min=t||0},I.prototype.setMaxSize=function(t){this.maxSize=t||35},I.prototype.setMinSize=function(t){this.minSize=t||0},I.prototype.initPalette=function(){var t,e=this.gradient,n=new x(256,1),i=this.paletteCtx=n.getContext("2d"),o=i.createLinearGradient(0,0,256,1);for(t in e)o.addColorStop(parseFloat(t),e[t]);i.fillStyle=o,i.fillRect(0,0,256,1)},I.prototype.getColor=function(t){var e=this.getImageData(t);return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]/256+")"},I.prototype.getImageData=function(t){var e=this.paletteCtx.getImageData(0,0,256,1).data;if(void 0===t)return e;var n=this.max,i=this.min;n<t&&(t=n),t<i&&(t=i);var o=4*Math.floor((t-i)/(n-i)*255);return[e[o],e[1+o],e[2+o],e[3+o]]},I.prototype.getSize=function(t){var e=this.max,n=this.min,i=this.maxSize,o=this.minSize;return e<t&&(t=e),t<n&&(t=n),o+(t-n)/(e-n)*(i-o)},I.prototype.getLegend=function(t){var e,n=this.gradient,i=t.width||20,o=t.height||180,r=new x(i,o),a=r.getContext("2d"),s=a.createLinearGradient(0,o,0,0);for(e in n)s.addColorStop(parseFloat(e),n[e]);return a.fillStyle=s,a.fillRect(0,0,i,o),r};var B=("undefined"==typeof window?{}:window).devicePixelRatio||1,D={draw:function(t,e,n){var i=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+i+")";var o=new x(t.canvas.width,t.canvas.height).getContext("2d");o.scale(B,B),n=n||{};var r=e instanceof O?e.get():e;t.save();var a,s=new I({gradient:n.gradient});l(o,r,n),n.absolute||(function(t,e,n){for(var i,o=n.maxOpacity||.8,r=3,a=t.length;r<a;r+=4)i=4*t[r],t[r]/256>o&&(t[r]=256*o),t[r-3]=e[i],t[r-2]=e[1+i],t[r-1]=e[2+i]}((a=o.getImageData(0,0,t.canvas.width,t.canvas.height)).data,s.getImageData(),n),t.putImageData(a,0,0),t.restore()),s=null}},U={draw:function(t,e,n){t.save();for(var i=e instanceof O?e.get():e,o={},r=n._size||n.size||50,a=n.offset||{x:0,y:0},s=0;s<i.length;s++){var l=i[s].geometry._coordinates||i[s].geometry.coordinates;o[h=Math.floor((l[0]-a.x)/r)+","+Math.floor((l[1]-a.y)/r)]||(o[h]=0),o[h]+=~~(i[s].count||1)}var u=new I({max:n.max||100,gradient:n.gradient});for(h in o)h=h.split(","),t.beginPath(),t.rect(h[0]*r+.5+a.x,h[1]*r+.5+a.y,r,r),t.fillStyle=u.getColor(o[h]),t.fill(),n.strokeStyle&&n.lineWidth&&t.stroke();if(n.label&&!1!==n.label.show)for(var h in t.fillStyle=n.label.fillStyle||"white",n.label.font&&(t.font=n.label.font),n.label.shadowColor&&(t.shadowColor=n.label.shadowColor),n.label.shadowBlur&&(t.shadowBlur=n.label.shadowBlur),o){var c=o[h=h.split(",")],g=t.measureText(c).width;t.fillText(c,h[0]*r+.5+a.x+r/2-g/2,h[1]*r+.5+a.y+r/2+5)}t.restore()}},j={draw:function(t,e,n){t.save();var i=e instanceof O?e.get():e;for(R in n)t[R]=n[R];for(var o=n.offset||{x:10,y:10},r=n._size||n.size||40,a=2*(r=r/2/Math.sin(Math.PI/3))*Math.sin(Math.PI/3),s=1.5*r,l={},u=0;u<i.length;u++){var h,c,g,p,f,d=i[u].geometry._coordinates||i[u].geometry.coordinates,v=(d[1]-o.y)/s,y=Math.round(v),m=(d[0]-o.x)/a-(1&y?.5:0),x=Math.round(m),w=v-y;1<3*Math.abs(w)&&((p=m-(c=x+(m<x?-1:1)/2))*p+(f=v-(g=y+(v<y?-1:1)))*f<(h=m-x)*h+w*w&&(x=c+(1&y?1:-1)/2,y=g));var _=x+"-"+y,b=l[_];b?b.push(i[u]):((b=l[_]=[i[u]]).i=x,b.j=y,b.x=(x+(1&y?.5:0))*a,b.y=y*s)}var S,M,P,C,A=new I({max:n.max||100,maxSize:r,gradient:n.gradient});for(R in l){var L=l[R];t.beginPath();for(var k=0;k<6;k++){var E=(S={x:L.x+o.x,y:L.y+o.y},M=r,C=P=void 0,P=60*k+30,C=Math.PI/180*P,[S.x+M*Math.cos(C),S.y+M*Math.sin(C)]);t.lineTo(E[0],E[1])}t.closePath();for(var z=0,u=0;u<L.length;u++)z+=L[u].count||1;L.count=z,t.fillStyle=A.getColor(z),t.fill(),n.strokeStyle&&n.lineWidth&&t.stroke()}if(n.label&&!1!==n.label.show)for(var R in t.fillStyle=n.label.fillStyle||"white",n.label.font&&(t.font=n.label.font),n.label.shadowColor&&(t.shadowColor=n.label.shadowColor),n.label.shadowBlur&&(t.shadowBlur=n.label.shadowBlur),l){var F=(F=(L=l[R]).count)<0?F.toFixed(2):~~F,T=t.measureText(F).width;t.fillText(F,L.x+o.x-T/2,L.y+o.y+5)}t.restore()}},N=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),Z=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),H={draw:function(t,e,n){if(e){var i=w(t,N,Z);t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE),t.clear(t.COLOR_BUFFER_BIT);var o=t.canvas.width/2,r=t.canvas.height/2,a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a);var s=t.getAttribLocation(i,"a_Position");t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s);var l=t.getUniformLocation(i,"u_FragColor"),u=_(n.strokeStyle||"red");t.uniform4f(l,u[0]/255,u[1]/255,u[2]/255,u[3]/255),t.lineWidth(n.lineWidth||1);for(var h=0,c=e.length;h<c;h++){for(var g=e[h].geometry._coordinates,p=[],f=0;f<g.length;f++){var d=g[f],v=(d[0]-o)/o,y=(r-d[1])/r;p.push(v,y)}var m=new Float32Array(p);t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW),t.drawArrays(t.LINE_STRIP,0,g.length)}}}},q=["attribute vec4 a_Position;","attribute float a_PointSize;","void main() {","gl_Position = a_Position;","gl_PointSize = a_PointSize;","}"].join(""),W=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),Y={draw:function(t,e,n){if(e){var i=w(t,q,W),o=t.getAttribLocation(i,"a_Position"),r=t.getAttribLocation(i,"a_PointSize"),a=t.getUniformLocation(i,"u_FragColor");t.clear(t.COLOR_BUFFER_BIT);for(var s=t.canvas.width/2,l=t.canvas.height/2,u=[],h=0,c=0;c<e.length;c++){var g=e[c].geometry._coordinates,p=(g[0]-s)/s,f=(l-g[1])/l;p<-1||1<p||f<-1||1<f||(u.push(p,f),h++)}var d=new Float32Array(u),v=h,y=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,y),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.vertexAttribPointer(o,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o),t.vertexAttrib1f(r,n._size);var m=_(n.fillStyle||"red");t.uniform4f(a,m[0]/255,m[1]/255,m[2]/255,m[3]/255),t.drawArrays(t.POINTS,0,v)}}};m.deviation=function(t,e,n,i){var o=e&&e.length,r=o?e[0]*n:t.length,a=Math.abs(L(t,0,r,n));if(o)for(var s=0,l=e.length;s<l;s++){var u=e[s]*n,h=s<l-1?e[s+1]*n:t.length;a-=Math.abs(L(t,u,h,n))}for(var c=0,s=0;s<i.length;s+=3){var g=i[s]*n,p=i[s+1]*n,f=i[s+2]*n;c+=Math.abs((t[g]-t[f])*(t[1+p]-t[1+g])-(t[g]-t[p])*(t[1+f]-t[1+g]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},m.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,o=0;o<t.length;o++){for(var r=0;r<t[o].length;r++)for(var a=0;a<e;a++)n.vertices.push(t[o][r][a]);0<o&&(i+=t[o-1].length,n.holes.push(i))}return n};var G=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),V=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),J={draw:function(t,e,n){if(e){t.clear(t.COLOR_BUFFER_BIT),t.viewport(0,0,t.canvas.width,t.canvas.height);var i=w(t,G,V);t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE);var o=t.canvas.width/2,r=t.canvas.height/2;t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,t.createBuffer());var a=t.getAttribLocation(i,"a_Position");t.vertexAttribPointer(a,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(a);var s=t.getUniformLocation(i,"u_FragColor"),l=_(n.fillStyle||"red");t.uniform4f(s,l[0]/255,l[1]/255,l[2]/255,l[3]/255),t.lineWidth(n.lineWidth||1);for(var u=[],h=[],c=0,g=0,p=e.length;g<p;g++){for(var f=m.flatten(e[g].geometry._coordinates||e[g].geometry.coordinates),d=f.vertices,c=u.length/2,v=0;v<d.length;v+=2)d[v]=(d[v]-o)/o,d[v+1]=(r-d[v+1])/r;65536<(u.length+d.length)/2&&(t.bufferData(t.ARRAY_BUFFER,new Float32Array(u),t.STATIC_DRAW),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(h),t.STATIC_DRAW),t.drawElements(t.TRIANGLES,h.length,t.UNSIGNED_SHORT,0),u.length=0,c=h.length=0);for(v=0;v<d.length;v++)u.push(d[v]);for(var y=m(d,f.holes,f.dimensions),v=0;v<y.length;v++)h.push(y[v]+c)}t.bufferData(t.ARRAY_BUFFER,new Float32Array(u),t.STATIC_DRAW),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(h),t.STATIC_DRAW),t.drawElements(t.TRIANGLES,h.length,t.UNSIGNED_SHORT,0),t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}}},Q={draw:function(t,e,n){var i=e instanceof O?e.get():e;0<i.length&&("LineString"==i[0].geometry.type?H.draw(t,i,n):"Polygon"==i[0].geometry.type||"MultiPolygon"==i[0].geometry.type?J.draw(t,i,n):Y.draw(t,i,n))}},X={municipalities:[{n:"北京",g:"116.395645,39.929986|12"},{n:"上海",g:"121.487899,31.249162|12"},{n:"天津",g:"117.210813,39.14393|12"},{n:"重庆",g:"106.530635,29.544606|12"}],provinces:[{n:"安徽",g:"117.216005,31.859252|8",cities:[{n:"合肥",g:"117.282699,31.866942|12"},{n:"安庆",g:"117.058739,30.537898|13"},{n:"蚌埠",g:"117.35708,32.929499|13"},{n:"亳州",g:"115.787928,33.871211|13"},{n:"巢湖",g:"117.88049,31.608733|13"},{n:"池州",g:"117.494477,30.660019|14"},{n:"滁州",g:"118.32457,32.317351|13"},{n:"阜阳",g:"115.820932,32.901211|13"},{n:"淮北",g:"116.791447,33.960023|13"},{n:"淮南",g:"117.018639,32.642812|13"},{n:"黄山",g:"118.29357,29.734435|13"},{n:"六安",g:"116.505253,31.755558|13"},{n:"马鞍山",g:"118.515882,31.688528|13"},{n:"宿州",g:"116.988692,33.636772|13"},{n:"铜陵",g:"117.819429,30.94093|14"},{n:"芜湖",g:"118.384108,31.36602|12"},{n:"宣城",g:"118.752096,30.951642|13"}]},{n:"福建",g:"117.984943,26.050118|8",cities:[{n:"福州",g:"119.330221,26.047125|12"},{n:"龙岩",g:"117.017997,25.078685|13"},{n:"南平",g:"118.181883,26.643626|13"},{n:"宁德",g:"119.542082,26.656527|14"},{n:"莆田",g:"119.077731,25.44845|13"},{n:"泉州",g:"118.600362,24.901652|12"},{n:"三明",g:"117.642194,26.270835|14"},{n:"厦门",g:"118.103886,24.489231|12"},{n:"漳州",g:"117.676205,24.517065|12"}]},{n:"甘肃",g:"102.457625,38.103267|6",cities:[{n:"兰州",g:"103.823305,36.064226|12"},{n:"白银",g:"104.171241,36.546682|13"},{n:"定西",g:"104.626638,35.586056|13"},{n:"甘南州",g:"102.917442,34.992211|14"},{n:"嘉峪关",g:"98.281635,39.802397|13"},{n:"金昌",g:"102.208126,38.516072|13"},{n:"酒泉",g:"98.508415,39.741474|13"},{n:"临夏州",g:"103.215249,35.598514|13"},{n:"陇南",g:"104.934573,33.39448|14"},{n:"平凉",g:"106.688911,35.55011|13"},{n:"庆阳",g:"107.644227,35.726801|13"},{n:"天水",g:"105.736932,34.584319|13"},{n:"武威",g:"102.640147,37.933172|13"},{n:"张掖",g:"100.459892,38.93932|13"}]},{n:"广东",g:"113.394818,23.408004|8",cities:[{n:"广州",g:"113.30765,23.120049|12"},{n:"潮州",g:"116.630076,23.661812|13"},{n:"东莞",g:"113.763434,23.043024|12"},{n:"佛山",g:"113.134026,23.035095|13"},{n:"河源",g:"114.713721,23.757251|12"},{n:"惠州",g:"114.410658,23.11354|12"},{n:"江门",g:"113.078125,22.575117|13"},{n:"揭阳",g:"116.379501,23.547999|13"},{n:"茂名",g:"110.931245,21.668226|13"},{n:"梅州",g:"116.126403,24.304571|13"},{n:"清远",g:"113.040773,23.698469|13"},{n:"汕头",g:"116.72865,23.383908|13"},{n:"汕尾",g:"115.372924,22.778731|14"},{n:"韶关",g:"113.594461,24.80296|13"},{n:"深圳",g:"114.025974,22.546054|12"},{n:"阳江",g:"111.97701,21.871517|14"},{n:"云浮",g:"112.050946,22.937976|13"},{n:"湛江",g:"110.365067,21.257463|13"},{n:"肇庆",g:"112.479653,23.078663|13"},{n:"中山",g:"113.42206,22.545178|12"},{n:"珠海",g:"113.562447,22.256915|13"}]},{n:"广西",g:"108.924274,23.552255|7",cities:[{n:"南宁",g:"108.297234,22.806493|12"},{n:"百色",g:"106.631821,23.901512|13"},{n:"北海",g:"109.122628,21.472718|13"},{n:"崇左",g:"107.357322,22.415455|14"},{n:"防城港",g:"108.351791,21.617398|15"},{n:"桂林",g:"110.26092,25.262901|12"},{n:"贵港",g:"109.613708,23.103373|13"},{n:"河池",g:"108.069948,24.699521|14"},{n:"贺州",g:"111.552594,24.411054|14"},{n:"来宾",g:"109.231817,23.741166|14"},{n:"柳州",g:"109.422402,24.329053|12"},{n:"钦州",g:"108.638798,21.97335|13"},{n:"梧州",g:"111.305472,23.485395|13"},{n:"玉林",g:"110.151676,22.643974|14"}]},{n:"贵州",g:"106.734996,26.902826|8",cities:[{n:"贵阳",g:"106.709177,26.629907|12"},{n:"安顺",g:"105.92827,26.228595|13"},{n:"毕节地区",g:"105.300492,27.302612|14"},{n:"六盘水",g:"104.852087,26.591866|13"},{n:"铜仁地区",g:"109.196161,27.726271|14"},{n:"遵义",g:"106.93126,27.699961|13"},{n:"黔西南州",g:"104.900558,25.095148|11"},{n:"黔东南州",g:"107.985353,26.583992|11"},{n:"黔南州",g:"107.523205,26.264536|11"}]},{n:"海南",g:"109.733755,19.180501|9",cities:[{n:"海口",g:"110.330802,20.022071|13"},{n:"白沙",g:"109.358586,19.216056|12"},{n:"保亭",g:"109.656113,18.597592|12"},{n:"昌江",g:"109.0113,19.222483|12"},{n:"儋州",g:"109.413973,19.571153|13"},{n:"澄迈",g:"109.996736,19.693135|13"},{n:"东方",g:"108.85101,18.998161|13"},{n:"定安",g:"110.32009,19.490991|13"},{n:"琼海",g:"110.414359,19.21483|13"},{n:"琼中",g:"109.861849,19.039771|12"},{n:"乐东",g:"109.062698,18.658614|12"},{n:"临高",g:"109.724101,19.805922|13"},{n:"陵水",g:"109.948661,18.575985|12"},{n:"三亚",g:"109.522771,18.257776|12"},{n:"屯昌",g:"110.063364,19.347749|13"},{n:"万宁",g:"110.292505,18.839886|13"},{n:"文昌",g:"110.780909,19.750947|13"},{n:"五指山",g:"109.51775,18.831306|13"}]},{n:"河北",g:"115.661434,38.61384|7",cities:[{n:"石家庄",g:"114.522082,38.048958|12"},{n:"保定",g:"115.49481,38.886565|13"},{n:"沧州",g:"116.863806,38.297615|13"},{n:"承德",g:"117.933822,40.992521|14"},{n:"邯郸",g:"114.482694,36.609308|13"},{n:"衡水",g:"115.686229,37.746929|13"},{n:"廊坊",g:"116.703602,39.518611|13"},{n:"秦皇岛",g:"119.604368,39.945462|12"},{n:"唐山",g:"118.183451,39.650531|13"},{n:"邢台",g:"114.520487,37.069531|13"},{n:"张家口",g:"114.893782,40.811188|13"}]},{n:"河南",g:"113.486804,34.157184|7",cities:[{n:"郑州",g:"113.649644,34.75661|12"},{n:"安阳",g:"114.351807,36.110267|12"},{n:"鹤壁",g:"114.29777,35.755426|13"},{n:"焦作",g:"113.211836,35.234608|13"},{n:"开封",g:"114.351642,34.801854|13"},{n:"洛阳",g:"112.447525,34.657368|12"},{n:"漯河",g:"114.046061,33.576279|13"},{n:"南阳",g:"112.542842,33.01142|13"},{n:"平顶山",g:"113.300849,33.745301|13"},{n:"濮阳",g:"115.026627,35.753298|12"},{n:"三门峡",g:"111.181262,34.78332|13"},{n:"商丘",g:"115.641886,34.438589|13"},{n:"新乡",g:"113.91269,35.307258|13"},{n:"信阳",g:"114.085491,32.128582|13"},{n:"许昌",g:"113.835312,34.02674|13"},{n:"周口",g:"114.654102,33.623741|13"},{n:"驻马店",g:"114.049154,32.983158|13"}]},{n:"黑龙江",g:"128.047414,47.356592|6",cities:[{n:"哈尔滨",g:"126.657717,45.773225|12"},{n:"大庆",g:"125.02184,46.596709|12"},{n:"大兴安岭地区",g:"124.196104,51.991789|10"},{n:"鹤岗",g:"130.292472,47.338666|13"},{n:"黑河",g:"127.50083,50.25069|14"},{n:"鸡西",g:"130.941767,45.32154|13"},{n:"佳木斯",g:"130.284735,46.81378|12"},{n:"牡丹江",g:"129.608035,44.588521|13"},{n:"七台河",g:"131.019048,45.775005|14"},{n:"齐齐哈尔",g:"123.987289,47.3477|13"},{n:"双鸭山",g:"131.171402,46.655102|13"},{n:"绥化",g:"126.989095,46.646064|13"},{n:"伊春",g:"128.910766,47.734685|14"}]},{n:"湖北",g:"112.410562,31.209316|8",cities:[{n:"武汉",g:"114.3162,30.581084|12"},{n:"鄂州",g:"114.895594,30.384439|14"},{n:"恩施",g:"109.517433,30.308978|14"},{n:"黄冈",g:"114.906618,30.446109|14"},{n:"黄石",g:"115.050683,30.216127|13"},{n:"荆门",g:"112.21733,31.042611|13"},{n:"荆州",g:"112.241866,30.332591|12"},{n:"潜江",g:"112.768768,30.343116|13"},{n:"神农架林区",g:"110.487231,31.595768|13"},{n:"十堰",g:"110.801229,32.636994|13"},{n:"随州",g:"113.379358,31.717858|13"},{n:"天门",g:"113.12623,30.649047|13"},{n:"仙桃",g:"113.387448,30.293966|13"},{n:"咸宁",g:"114.300061,29.880657|13"},{n:"襄阳",g:"112.176326,32.094934|12"},{n:"孝感",g:"113.935734,30.927955|13"},{n:"宜昌",g:"111.310981,30.732758|13"}]},{n:"湖南",g:"111.720664,27.695864|7",cities:[{n:"长沙",g:"112.979353,28.213478|12"},{n:"常德",g:"111.653718,29.012149|12"},{n:"郴州",g:"113.037704,25.782264|13"},{n:"衡阳",g:"112.583819,26.898164|13"},{n:"怀化",g:"109.986959,27.557483|13"},{n:"娄底",g:"111.996396,27.741073|13"},{n:"邵阳",g:"111.461525,27.236811|13"},{n:"湘潭",g:"112.935556,27.835095|13"},{n:"湘西州",g:"109.745746,28.317951|14"},{n:"益阳",g:"112.366547,28.588088|13"},{n:"永州",g:"111.614648,26.435972|13"},{n:"岳阳",g:"113.146196,29.378007|13"},{n:"张家界",g:"110.48162,29.124889|13"},{n:"株洲",g:"113.131695,27.827433|13"}]},{n:"江苏",g:"119.368489,33.013797|8",cities:[{n:"南京",g:"118.778074,32.057236|12"},{n:"常州",g:"119.981861,31.771397|12"},{n:"淮安",g:"119.030186,33.606513|12"},{n:"连云港",g:"119.173872,34.601549|12"},{n:"南通",g:"120.873801,32.014665|12"},{n:"苏州",g:"120.619907,31.317987|12"},{n:"宿迁",g:"118.296893,33.95205|13"},{n:"泰州",g:"119.919606,32.476053|13"},{n:"无锡",g:"120.305456,31.570037|12"},{n:"徐州",g:"117.188107,34.271553|12"},{n:"盐城",g:"120.148872,33.379862|12"},{n:"扬州",g:"119.427778,32.408505|13"},{n:"镇江",g:"119.455835,32.204409|13"}]},{n:"江西",g:"115.676082,27.757258|7",cities:[{n:"南昌",g:"115.893528,28.689578|12"},{n:"抚州",g:"116.360919,27.954545|13"},{n:"赣州",g:"114.935909,25.845296|13"},{n:"吉安",g:"114.992039,27.113848|13"},{n:"景德镇",g:"117.186523,29.303563|12"},{n:"九江",g:"115.999848,29.71964|13"},{n:"萍乡",g:"113.859917,27.639544|13"},{n:"上饶",g:"117.955464,28.457623|13"},{n:"新余",g:"114.947117,27.822322|13"},{n:"宜春",g:"114.400039,27.81113|13"},{n:"鹰潭",g:"117.03545,28.24131|13"}]},{n:"吉林",g:"126.262876,43.678846|7",cities:[{n:"长春",g:"125.313642,43.898338|12"},{n:"白城",g:"122.840777,45.621086|13"},{n:"白山",g:"126.435798,41.945859|13"},{n:"吉林市",g:"126.564544,43.871988|12"},{n:"辽源",g:"125.133686,42.923303|13"},{n:"四平",g:"124.391382,43.175525|12"},{n:"松原",g:"124.832995,45.136049|13"},{n:"通化",g:"125.94265,41.736397|13"},{n:"延边",g:"129.485902,42.896414|13"}]},{n:"辽宁",g:"122.753592,41.6216|8",cities:[{n:"沈阳",g:"123.432791,41.808645|12"},{n:"鞍山",g:"123.007763,41.118744|13"},{n:"本溪",g:"123.778062,41.325838|12"},{n:"朝阳",g:"120.446163,41.571828|13"},{n:"大连",g:"121.593478,38.94871|12"},{n:"丹东",g:"124.338543,40.129023|12"},{n:"抚顺",g:"123.92982,41.877304|12"},{n:"阜新",g:"121.660822,42.01925|14"},{n:"葫芦岛",g:"120.860758,40.74303|13"},{n:"锦州",g:"121.147749,41.130879|13"},{n:"辽阳",g:"123.172451,41.273339|14"},{n:"盘锦",g:"122.073228,41.141248|13"},{n:"铁岭",g:"123.85485,42.299757|13"},{n:"营口",g:"122.233391,40.668651|13"}]},{n:"内蒙古",g:"114.415868,43.468238|5",cities:[{n:"呼和浩特",g:"111.660351,40.828319|12"},{n:"阿拉善盟",g:"105.695683,38.843075|14"},{n:"包头",g:"109.846239,40.647119|12"},{n:"巴彦淖尔",g:"107.423807,40.76918|12"},{n:"赤峰",g:"118.930761,42.297112|12"},{n:"鄂尔多斯",g:"109.993706,39.81649|12"},{n:"呼伦贝尔",g:"119.760822,49.201636|12"},{n:"通辽",g:"122.260363,43.633756|12"},{n:"乌海",g:"106.831999,39.683177|13"},{n:"乌兰察布",g:"113.112846,41.022363|12"},{n:"锡林郭勒盟",g:"116.02734,43.939705|11"},{n:"兴安盟",g:"122.048167,46.083757|11"}]},{n:"宁夏",g:"106.155481,37.321323|8",cities:[{n:"银川",g:"106.206479,38.502621|12"},{n:"固原",g:"106.285268,36.021523|13"},{n:"石嘴山",g:"106.379337,39.020223|13"},{n:"吴忠",g:"106.208254,37.993561|14"},{n:"中卫",g:"105.196754,37.521124|14"}]},{n:"青海",g:"96.202544,35.499761|7",cities:[{n:"西宁",g:"101.767921,36.640739|12"},{n:"果洛州",g:"100.223723,34.480485|11"},{n:"海东地区",g:"102.085207,36.51761|11"},{n:"海北州",g:"100.879802,36.960654|11"},{n:"海南州",g:"100.624066,36.284364|11"},{n:"海西州",g:"97.342625,37.373799|11"},{n:"黄南州",g:"102.0076,35.522852|11"},{n:"玉树州",g:"97.013316,33.00624|14"}]},{n:"山东",g:"118.527663,36.09929|8",cities:[{n:"济南",g:"117.024967,36.682785|12"},{n:"滨州",g:"117.968292,37.405314|12"},{n:"东营",g:"118.583926,37.487121|12"},{n:"德州",g:"116.328161,37.460826|12"},{n:"菏泽",g:"115.46336,35.26244|13"},{n:"济宁",g:"116.600798,35.402122|13"},{n:"莱芜",g:"117.684667,36.233654|13"},{n:"聊城",g:"115.986869,36.455829|12"},{n:"临沂",g:"118.340768,35.072409|12"},{n:"青岛",g:"120.384428,36.105215|12"},{n:"日照",g:"119.50718,35.420225|12"},{n:"泰安",g:"117.089415,36.188078|13"},{n:"威海",g:"122.093958,37.528787|13"},{n:"潍坊",g:"119.142634,36.716115|12"},{n:"烟台",g:"121.309555,37.536562|12"},{n:"枣庄",g:"117.279305,34.807883|13"},{n:"淄博",g:"118.059134,36.804685|12"}]},{n:"山西",g:"112.515496,37.866566|7",cities:[{n:"太原",g:"112.550864,37.890277|12"},{n:"长治",g:"113.120292,36.201664|12"},{n:"大同",g:"113.290509,40.113744|12"},{n:"晋城",g:"112.867333,35.499834|13"},{n:"晋中",g:"112.738514,37.693362|13"},{n:"临汾",g:"111.538788,36.099745|13"},{n:"吕梁",g:"111.143157,37.527316|14"},{n:"朔州",g:"112.479928,39.337672|13"},{n:"忻州",g:"112.727939,38.461031|12"},{n:"阳泉",g:"113.569238,37.869529|13"},{n:"运城",g:"111.006854,35.038859|13"}]},{n:"陕西",g:"109.503789,35.860026|7",cities:[{n:"西安",g:"108.953098,34.2778|12"},{n:"安康",g:"109.038045,32.70437|13"},{n:"宝鸡",g:"107.170645,34.364081|12"},{n:"汉中",g:"107.045478,33.081569|13"},{n:"商洛",g:"109.934208,33.873907|13"},{n:"铜川",g:"108.968067,34.908368|13"},{n:"渭南",g:"109.483933,34.502358|13"},{n:"咸阳",g:"108.707509,34.345373|13"},{n:"延安",g:"109.50051,36.60332|13"},{n:"榆林",g:"109.745926,38.279439|12"}]},{n:"四川",g:"102.89916,30.367481|7",cities:[{n:"成都",g:"104.067923,30.679943|12"},{n:"阿坝州",g:"102.228565,31.905763|15"},{n:"巴中",g:"106.757916,31.869189|14"},{n:"达州",g:"107.494973,31.214199|14"},{n:"德阳",g:"104.402398,31.13114|13"},{n:"甘孜州",g:"101.969232,30.055144|15"},{n:"广安",g:"106.63572,30.463984|13"},{n:"广元",g:"105.819687,32.44104|13"},{n:"乐山",g:"103.760824,29.600958|13"},{n:"凉山州",g:"102.259591,27.892393|14"},{n:"泸州",g:"105.44397,28.89593|14"},{n:"南充",g:"106.105554,30.800965|13"},{n:"眉山",g:"103.84143,30.061115|13"},{n:"绵阳",g:"104.705519,31.504701|12"},{n:"内江",g:"105.073056,29.599462|13"},{n:"攀枝花",g:"101.722423,26.587571|14"},{n:"遂宁",g:"105.564888,30.557491|12"},{n:"雅安",g:"103.009356,29.999716|13"},{n:"宜宾",g:"104.633019,28.769675|13"},{n:"资阳",g:"104.63593,30.132191|13"},{n:"自贡",g:"104.776071,29.359157|13"}]},{n:"西藏",g:"89.137982,31.367315|6",cities:[{n:"拉萨",g:"91.111891,29.662557|13"},{n:"阿里地区",g:"81.107669,30.404557|11"},{n:"昌都地区",g:"97.185582,31.140576|15"},{n:"林芝地区",g:"94.349985,29.666941|11"},{n:"那曲地区",g:"92.067018,31.48068|14"},{n:"日喀则地区",g:"88.891486,29.269023|14"},{n:"山南地区",g:"91.750644,29.229027|11"}]},{n:"新疆",g:"85.614899,42.127001|6",cities:[{n:"乌鲁木齐",g:"87.564988,43.84038|12"},{n:"阿拉尔",g:"81.291737,40.61568|13"},{n:"阿克苏地区",g:"80.269846,41.171731|12"},{n:"阿勒泰地区",g:"88.137915,47.839744|13"},{n:"巴音郭楞",g:"86.121688,41.771362|12"},{n:"博尔塔拉州",g:"82.052436,44.913651|11"},{n:"昌吉州",g:"87.296038,44.007058|13"},{n:"哈密地区",g:"93.528355,42.858596|13"},{n:"和田地区",g:"79.930239,37.116774|13"},{n:"喀什地区",g:"75.992973,39.470627|12"},{n:"克拉玛依",g:"84.88118,45.594331|13"},{n:"克孜勒苏州",g:"76.137564,39.750346|11"},{n:"石河子",g:"86.041865,44.308259|13"},{n:"塔城地区",g:"82.974881,46.758684|12"},{n:"图木舒克",g:"79.198155,39.889223|13"},{n:"吐鲁番地区",g:"89.181595,42.96047|13"},{n:"五家渠",g:"87.565449,44.368899|13"},{n:"伊犁州",g:"81.297854,43.922248|11"}]},{n:"云南",g:"101.592952,24.864213|7",cities:[{n:"昆明",g:"102.714601,25.049153|12"},{n:"保山",g:"99.177996,25.120489|13"},{n:"楚雄州",g:"101.529382,25.066356|13"},{n:"大理州",g:"100.223675,25.5969|14"},{n:"德宏州",g:"98.589434,24.44124|14"},{n:"迪庆州",g:"99.713682,27.831029|14"},{n:"红河州",g:"103.384065,23.367718|11"},{n:"丽江",g:"100.229628,26.875351|13"},{n:"临沧",g:"100.092613,23.887806|14"},{n:"怒江州",g:"98.859932,25.860677|14"},{n:"普洱",g:"100.980058,22.788778|14"},{n:"曲靖",g:"103.782539,25.520758|12"},{n:"昭通",g:"103.725021,27.340633|13"},{n:"文山",g:"104.089112,23.401781|14"},{n:"西双版纳",g:"100.803038,22.009433|13"},{n:"玉溪",g:"102.545068,24.370447|13"}]},{n:"浙江",g:"119.957202,29.159494|8",cities:[{n:"杭州",g:"120.219375,30.259244|12"},{n:"湖州",g:"120.137243,30.877925|12"},{n:"嘉兴",g:"120.760428,30.773992|13"},{n:"金华",g:"119.652576,29.102899|12"},{n:"丽水",g:"119.929576,28.4563|13"},{n:"宁波",g:"121.579006,29.885259|12"},{n:"衢州",g:"118.875842,28.95691|12"},{n:"绍兴",g:"120.592467,30.002365|13"},{n:"台州",g:"121.440613,28.668283|13"},{n:"温州",g:"120.690635,28.002838|12"},{n:"舟山",g:"122.169872,30.03601|13"}]}],other:[{n:"香港",g:"114.186124,22.293586|11"},{n:"澳门",g:"113.557519,22.204118|13"},{n:"台湾",g:"120.961454,23.80406|8"}]},e={getProvinceNameByCityName:function(t){for(var e=X.provinces,n=0;n<e.length;n++)for(var i=e[n].n,o=e[n].cities,r=0;r<o.length;r++)if(o[r].n==t)return i;return null},getCenterByCityName:function(t){for(var e=0;e<X.municipalities.length;e++)if(X.municipalities[e].n==t)return r(X.municipalities[e].g);for(e=0;e<X.other.length;e++)if(X.other[e].n==t)return r(X.other[e].g);for(var n=X.provinces,e=0;e<n.length;e++){if(n[e].n==t)return r(n[e].g);for(var i=n[e].cities,o=0;o<i.length;o++)if(i[o].n==t)return r(i[o].g)}return null}},K={getPoints:function(t){for(var e=[],n=0;n<t.length-1;n++){var i=function(t,e){if(!t||!e)return null;function n(t){return 1-2*t+t*t}function i(t){return 2*t-2*t*t}function o(t){return t*t}var r,a,s,l,u,h,c=[],g=0,p=0;if(void 0===e)return void(void 0!==c&&(c=[]));var f=parseFloat(t.lat),d=parseFloat(e.lat),v=parseFloat(t.lng),y=parseFloat(e.lng);for(v<y&&180<parseFloat(y-v)&&v<0&&(v=parseFloat(360+v)),y<v&&180<parseFloat(v-y)&&y<0&&(y=parseFloat(360+y)),h=0,a=d==f?(r=0,v-y):y==v?(r=Math.PI/2,f-d):(r=Math.atan((d-f)/(y-v)),(d-f)/Math.sin(r)),0==h&&(h=r+Math.PI/5),u=(s=a/2)*Math.cos(h)+v,l=s*Math.sin(h)+f,g=0;g<41;g++)c.push([v*n(p)+u*i(p)+y*o(p),f*n(p)+l*i(p)+d*o(p)]),p+=.025;return c}(t[n],t[n+1]);i&&0<i.length&&(e=e.concat(i))}return e}};i.prototype.get=function(t){var e,n=this.splitList,i=n.other;for(e in n)if(t==e){i=n[e];break}return i},i.prototype.generateByDataSet=function(t){var e=["rgba(255, 255, 0, 0.8)","rgba(253, 98, 104, 0.8)","rgba(255, 146, 149, 0.8)","rgba(255, 241, 193, 0.8)","rgba(110, 176, 253, 0.8)","rgba(52, 139, 251, 0.8)","rgba(17, 102, 252, 0.8)"],n=t.get();this.splitList={};for(var i=0,o=0;o<n.length&&(void 0===this.splitList[n[o].count]&&(this.splitList[n[o].count]=e[i],i++),!(e.length-1<=i));o++);this.splitList.other=e[e.length-1]},i.prototype.getLegend=function(t){var e=this.splitList,n=document.createElement("div");n.style.cssText="background:#fff; padding: 5px; border: 1px solid #ccc;";var i,o="";for(i in e)o+='<div style="line-height: 19px;" value="'+i+'"><span style="vertical-align: -2px; display: inline-block; width: 30px;height: 19px;background:'+e[i]+';"></span><span style="margin-left: 3px;">'+i+"<span></div>";return n.innerHTML=o,n},o.prototype.get=function(t){for(var e=this.splitList,n=!1,i=0;i<e.length;i++)if((void 0===e[i].start||void 0!==e[i].start&&t>=e[i].start)&&(void 0===e[i].end||void 0!==e[i].end&&t<e[i].end)){n=e[i].value;break}return n},o.prototype.generateByDataSet=function(t){var e=t.getMin("count"),n=t.getMax("count");this.generateByMinMax(e,n)},o.prototype.generateByMinMax=function(t,e){var n=["rgba(255, 255, 0, 0.8)","rgba(253, 98, 104, 0.8)","rgba(255, 146, 149, 0.8)","rgba(255, 241, 193, 0.8)","rgba(110, 176, 253, 0.8)","rgba(52, 139, 251, 0.8)","rgba(17, 102, 252, 0.8)"],i=(e-t)/7,o=t;this.splitList=[];for(var r=0;o<e;)this.splitList.push({start:o,end:o+i,value:n[r]}),r++,o+=i},o.prototype.getLegend=function(t){this.splitList};var $=(function(t,e,n){return e&&nt(t.prototype,e),n&&nt(t,n),t}(et,[{key:"addLayer",value:function(t,e){if("baidu"==this.type)return new mapv.baiduMapLayer(this.map,dataSet,e)}},{key:"getMap",value:function(){return this.map}}]),et),tt="undefined"==typeof window?{}:window;function et(t,e,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,et),!t||!e)return console.warn("id 和 type 为必填项"),!1;if("baidu"==e){if(!BMap)return console.warn("请先引入百度地图JS API"),!1}else console.warn("暂不支持你的地图类型");this.type=e;var i=n&&n.center?n.center:[106.962497,38.208726],o=n&&n.zoom?n.zoom:5,r=this.map=new BMap.Map(t,{enableMapClick:!1});r.centerAndZoom(new BMap.Point(i[0],i[1]),o),r.enableScrollWheelZoom(!0),r.setMapStyle({style:"light"})}function nt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}tt.BMap&&((k.prototype=new BMap.Overlay).initialize=function(t){this._map=t;var e=this.canvas=document.createElement("canvas");e.style.cssText="position:absolute;left:0;top:0;z-index:"+this.zIndex+";user-select:none;",e.style.mixBlendMode=this.mixBlendMode,this.adjustSize(),t.getPanes()[this.paneName].appendChild(e);var n=this;return t.addEventListener("resize",function(){n.adjustSize(),n._draw()}),this.canvas},k.prototype.adjustSize=function(){var t=this._map.getSize(),e=this.canvas,n=this.devicePixelRatio=tt.devicePixelRatio||1;e.width=t.width*n,e.height=t.height*n,"2d"==this.context&&e.getContext(this.context).scale(n,n),e.style.width=t.width+"px",e.style.height=t.height+"px"},k.prototype.draw=function(){var t=this;clearTimeout(t.timeoutID),t.timeoutID=setTimeout(function(){t._draw()},15)},k.prototype._draw=function(){var t,e=this._map,n=e.getSize(),i=e.getCenter();i&&(t=e.pointToOverlayPixel(i),this.canvas.style.left=t.x-n.width/2+"px",this.canvas.style.top=t.y-n.height/2+"px",this.dispatchEvent("draw"),this.options.update&&this.options.update.call(this))},k.prototype.getContainer=function(){return this.canvas},k.prototype.show=function(){this.canvas||this._map.addOverlay(this),this.canvas.style.display="block"},k.prototype.hide=function(){this.canvas.style.display="none"},k.prototype.setZIndex=function(t){this.canvas.style.zIndex=t},k.prototype.getZIndex=function(){return this.zIndex});var it,ot,rt=rt||(it=[],{getAll:function(){return it},removeAll:function(){it=[]},add:function(t){it.push(t)},remove:function(t){var e=it.indexOf(t);-1!==e&&it.splice(e,1)},update:function(t,e){if(0===it.length)return!1;var n=0;for(t=void 0!==t?t:rt.now();n<it.length;)it[n].update(t)||e?n++:it.splice(n,1);return!0}});"undefined"==typeof window&&"undefined"!=typeof process?rt.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?rt.now=window.performance.now.bind(window.performance):void 0!==Date.now?rt.now=Date.now:rt.now=function(){return(new Date).getTime()},rt.Tween=function(t){var u,h=t,c={},g={},p={},f=1e3,d=0,v=!1,n=!1,y=0,m=null,x=rt.Easing.Linear.None,w=rt.Interpolation.Linear,_=[],b=null,S=!1,M=null,P=null,e=null;this.to=function(t,e){return g=t,void 0!==e&&(f=e),this},this.start=function(t){for(var e in rt.add(this),S=!(n=!0),m=void 0!==t?t:rt.now(),m+=y,g){if(g[e]instanceof Array){if(0===g[e].length)continue;g[e]=[h[e]].concat(g[e])}void 0!==h[e]&&(c[e]=h[e],c[e]instanceof Array==0&&(c[e]*=1),p[e]=c[e]||0)}return this},this.stop=function(){return n&&(rt.remove(this),n=!1,null!==e&&e.call(h,h),this.stopChainedTweens()),this},this.end=function(){return this.update(m+f),this},this.stopChainedTweens=function(){for(var t=0,e=_.length;t<e;t++)_[t].stop()},this.delay=function(t){return y=t,this},this.repeat=function(t){return d=t,this},this.repeatDelay=function(t){return u=t,this},this.yoyo=function(t){return v=t,this},this.easing=function(t){return x=t,this},this.interpolation=function(t){return w=t,this},this.chain=function(){return _=arguments,this},this.onStart=function(t){return b=t,this},this.onUpdate=function(t){return M=t,this},this.onComplete=function(t){return P=t,this},this.onStop=function(t){return e=t,this},this.update=function(t){var e,n,i,o,r,a;if(t<m)return!0;for(e in!1===S&&(null!==b&&b.call(h,h),S=!0),i=x(n=1<(n=(t-m)/f)?1:n),g){void 0!==c[e]&&(o=c[e]||0,(r=g[e])instanceof Array?h[e]=w(r,i):("string"==typeof r&&(r="+"===r.charAt(0)||"-"===r.charAt(0)?o+parseFloat(r):parseFloat(r)),"number"==typeof r&&(h[e]=o+(r-o)*i)))}if(null!==M&&M.call(h,i),1!==n)return!0;if(0<d){for(e in isFinite(d)&&d--,p){"string"==typeof g[e]&&(p[e]=p[e]+parseFloat(g[e])),v&&(a=p[e],p[e]=g[e],g[e]=a),c[e]=p[e]}return v&&0,m=void 0!==u?t+u:t+y,!0}null!==P&&P.call(h,h);for(var s=0,l=_.length;s<l;s++)_[s].start(m+f);return!1}},rt.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)}},Bounce:{In:function(t){return 1-rt.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*rt.Easing.Bounce.In(2*t):.5*rt.Easing.Bounce.Out(2*t-1)+.5}}},rt.Interpolation={Linear:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=rt.Interpolation.Utils.Linear;return e<0?r(t[0],t[1],i):1<e?r(t[n],t[n-1],n-i):r(t[o],t[n<o+1?n:o+1],i-o)},Bezier:function(t,e){for(var n=0,i=t.length-1,o=Math.pow,r=rt.Interpolation.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-e,i-a)*o(e,a)*t[a]*r(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),r=rt.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),r(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o)):e<0?t[0]-(r(t[0],t[0],t[1],t[1],-i)-t[0]):1<e?t[n]-(r(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):r(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=rt.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(ot=[1],function(t){var e=1;if(ot[t])return ot[t];for(var n=t;1<n;n--)e*=n;return ot[t]=e}),CatmullRom:function(t,e,n,i,o){var r=.5*(n-t),a=.5*(i-e),s=o*o;return(2*e-2*n+r+a)*(o*s)+(-3*e+3*n-2*r-a)*s+r*o+e}}};var at=function(t,e,n){var i,o=e instanceof O?e.get():e;for(i in t.save(),n)t[i]=n[i];var r=n.offset||{x:0,y:0},a=[],s=n._size||n.size;s?t.font="bold "+s+"px Arial":s=12;var l=n.textKey||"text";if(n.textAlign||(t.textAlign="center"),n.textBaseline||(t.textBaseline="middle"),n.avoid)for(var u=0,h=o.length;u<h;u++){var c=(m=o[u].geometry._coordinates||o[u].geometry.coordinates)[0]+r.x,g=m[1]+r.y,p=o[u][l],f=t.measureText(p).width,d=c-f/2,v=g-s/2,y={sw:{x:d,y:v+s},ne:{x:d+f,y:v}};E(a,y)||(a.push(y),d+=f/2,v+=s/2,t.fillText(p,d,v))}else for(u=0,h=o.length;u<h;u++){var m,c=(m=o[u].geometry._coordinates||o[u].geometry.coordinates)[0]+r.x,g=m[1]+r.y,p=o[u][l];t.fillText(p,c,g)}t.restore()},st=function(t,e,n){var i=e instanceof O?e.get():e;t.fillStyle="white",t.textAlign="center",t.textBaseline="middle";for(var o,r,a,s,l,u,h,c=n.offset||{x:0,y:0},g=0,p=i.length;g<p;g++){i[g].geometry&&(o=i[g].deg||n.deg,r=i[g].icon||n.icon,u=(a=i[g].geometry._coordinates||i[g].geometry.coordinates)[0],h=a[1],o&&(t.save(),t.translate(u,h),t.rotate(o*Math.PI/180),t.translate(-u,-h)),s=n._width||n.width||r.width,l=n._height||n.height||r.height,u=u-s/2+c.x,h=h-l/2+c.y,n.sx&&n.sy&&n.swidth&&n.sheight&&n.width&&n.height?t.drawImage(r,n.sx,n.sy,n.swidth,n.sheight,u,h,s,l):n.width&&n.height?t.drawImage(r,u,h,s,l):t.drawImage(r,u,h),o&&t.restore())}},lt=function(t,e,n){return e&&ut(t.prototype,e),n&&ut(t,n),t};function ut(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}"undefined"!=typeof window&&requestAnimationFrame(function t(e){requestAnimationFrame(t),rt.update(e)});function ht(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:ht(o,e,n)}if("value"in i)return i.value;var r=i.get;return void 0!==r?r.call(n):void 0}var ct=(lt(_t,[{key:"getDefaultContextConfig",value:function(){return{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0,strokeStyle:"#000000",fillStyle:"#000000",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0)",lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,lineDashOffset:0,font:"10px sans-serif",textAlign:"start",textBaseline:"alphabetic"}}},{key:"initDataRange",value:function(){var t,e,n=this;n.intensity=new I({maxSize:n.options.maxSize,minSize:n.options.minSize,gradient:n.options.gradient,max:n.options.max||this.dataSet.getMax("count")}),n.category=new i(n.options.splitList),n.choropleth=new o(n.options.splitList),void 0===n.options.splitList&&n.category.generateByDataSet(this.dataSet),void 0===n.options.splitList&&(t=n.options.min||this.dataSet.getMin("count"),e=n.options.max||this.dataSet.getMax("count"),n.choropleth.generateByMinMax(t,e))}},{key:"getLegend",value:function(t){var e=(this.options.draw,this);return"intensity"==e.options.draw||"heatmap"==e.options.draw?this.intensity.getLegend(t):"category"==e.options.draw?this.category.getLegend(t):void 0}},{key:"processData",value:function(t){var e=this,n=e.options.draw;if("bubble"==n||"intensity"==n||"category"==n||"choropleth"==n||"simple"==n)for(var i=0;i<t.length;i++){var o=t[i];"bubble"==e.options.draw?t[i]._size=e.intensity.getSize(o.count):t[i]._size=void 0;var r="_fillStyle";"LineString"!==t[i].geometry.type&&"stroke"!==e.options.styleType||(r="_strokeStyle"),"intensity"==e.options.draw?t[i][r]=e.intensity.getColor(o.count):"category"==e.options.draw?t[i][r]=e.category.get(o.count):"choropleth"==e.options.draw&&(t[i][r]=e.choropleth.get(o.count))}}},{key:"isEnabledTime",value:function(){var t=this.options.animation;return t&&!(!1===t.enabled)}},{key:"argCheck",value:function(t){"heatmap"==t.draw&&t.strokeStyle&&console.warn("[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]")}},{key:"drawContext",value:function(t,e,n,i){var o=this;switch(o.options.draw){case"heatmap":D.draw(t,e,o.options);break;case"grid":case"honeycomb":o.options.offset={x:i.x,y:i.y},"grid"==o.options.draw?U.draw(t,e,o.options):j.draw(t,e,o.options);break;case"text":at(t,e,o.options);break;case"icon":st(t,e,o.options);break;case"clip":t.save(),t.fillStyle=o.options.fillStyle||"rgba(0, 0, 0, 0.5)",t.fillRect(0,0,t.canvas.width,t.canvas.height),T.draw(t,e,o.options),t.beginPath(),F.drawDataSet(t,e,o.options),t.clip(),R(t),t.restore();break;default:"webgl"==o.options.context?Q.draw(o.canvasLayer.canvas.getContext("webgl"),e,o.options):T.draw(t,e,o.options)}}},{key:"isPointInPath",value:function(t,e){for(var t=this.canvasLayer.canvas.getContext(this.context),n=this.dataSet.get(),i=0;i<n.length;i++){t.beginPath(),F.draw(t,n[i],this.options);var o=e.x*this.canvasLayer.devicePixelRatio,r=e.y*this.canvasLayer.devicePixelRatio;if(t.isPointInPath(o,r)||t.isPointInStroke(o,r))return n[i]}}},{key:"clickEvent",value:function(t,e){var n=this.isPointInPath(this.getContext(),t);n?this.options.methods.click(n,e):this.options.methods.click(null,e)}},{key:"mousemoveEvent",value:function(t,e){var n=this.isPointInPath(this.getContext(),t);n?this.options.methods.mousemove(n,e):this.options.methods.mousemove(null,e)}},{key:"update",value:function(t,e){var n,i=t.options,o=this.options;for(n in i)o[n]=i[n];this.init(o),!1!==e&&this.draw()}},{key:"setOptions",value:function(t){this.init(t),this.draw()}},{key:"set",value:function(t){var e,n=this.getContext(),i=this.getDefaultContextConfig();for(e in i)n[e]=i[e];this.init(t.options),this.draw()}},{key:"destroy",value:function(){this.unbindEvent(),this.hide()}},{key:"initAnimator",value:function(){var t,e=this,n=e.options.animation;"time"==e.options.draw||e.isEnabledTime()?(n.stepsRange||(n.stepsRange={start:this.dataSet.getMin("time")||0,end:this.dataSet.getMax("time")||0}),this.steps={step:n.stepsRange.start},e.animator=new rt.Tween(this.steps).onUpdate(function(){e._canvasUpdate(this.step)}).repeat(1/0),this.addAnimatorEvent(),t=1e3*n.duration||5e3,e.animator.to({step:n.stepsRange.end},t),e.animator.start()):e.animator&&e.animator.stop()}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start,this.animator.stop())}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator&&this.animator.start()}}]),_t),gt=function(t,e,n){return e&&wt(t.prototype,e),n&&wt(t,n),t},pt=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(xt,ct),gt(xt,[{key:"init",value:function(t){var e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(e.options.zIndex),e.options.max&&this.intensity.setMax(e.options.max),e.options.min&&this.intensity.setMin(e.options.min),this.initAnimator()}},{key:"transferToMercator",value:function(){var t,n=this.map.getMapType().getProjection();"bd09mc"!==this.options.coordType&&(t=this.dataSet.get(),t=this.dataSet.transferCoordinate(t,function(t){var e=n.lngLatToPoint({lng:t[0],lat:t[1]});return[e.x,e.y]},"coordinates","coordinates_mercator"),this.dataSet._set(t))}},{key:"_canvasUpdate",value:function(){var t,e,n,i,o,r=this.ctx;r&&(t=this.map,e=Math.pow(2,18-t.getZoom()),n=t.getMapType().getProjection().lngLatToPoint(t.getCenter()),i=new BMap.Pixel(n.x-t.getSize().width/2*e,n.y+t.getSize().height/2*e),R(r),o={fromColumn:"bd09mc"==this.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){if(t)return[(t[0]-i.x)/e,(i.y-t[1])/e]}},this.data=this.dataSet.get(o),this.processData(this.data),this.drawAnimation())}},{key:"drawAnimation",value:function(){var t=this.ctx,e=this.data;if(e){t.save(),t.globalCompositeOperation="destination-out",t.fillStyle="rgba(0, 0, 0, .1)",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.restore(),t.save(),this.options.shadowColor&&(t.shadowColor=this.options.shadowColor),this.options.shadowBlur&&(t.shadowBlur=this.options.shadowBlur),this.options.globalAlpha&&(t.globalAlpha=this.options.globalAlpha),this.options.globalCompositeOperation&&(t.globalCompositeOperation=this.options.globalCompositeOperation);for(var n,i,o,r,a,s,l=this.options,u=0;u<e.length;u++){"Point"===e[u].geometry.type?(t.beginPath(),n=e[u].size||this.options.size,o=e[u].minSize||this.options.minSize||0,void 0===e[u]._size&&(e[u]._size=o),t.arc(e[u].geometry._coordinates[0],e[u].geometry._coordinates[1],e[u]._size,0,2*Math.PI,!0),t.closePath(),e[u]._size++,e[u]._size>n&&(e[u]._size=o),t.lineWidth=1,t.strokeStyle=e[u].strokeStyle||e[u]._strokeStyle||l.strokeStyle||"yellow",t.stroke(),(s=e[u].fillStyle||e[u]._fillStyle||l.fillStyle)&&(t.fillStyle=s,t.fill())):"LineString"===e[u].geometry.type&&(t.beginPath(),i=e[u].size||this.options.size||5,o=e[u].minSize||this.options.minSize||0,void 0===e[u]._index&&(e[u]._index=0),r=e[u]._index,t.arc(e[u].geometry._coordinates[r][0],e[u].geometry._coordinates[r][1],i,0,2*Math.PI,!0),t.closePath(),e[u]._index++,e[u]._index>=e[u].geometry._coordinates.length&&(e[u]._index=0),t.lineWidth=l.lineWidth||1,a=e[u].strokeStyle||l.strokeStyle,s=e[u].fillStyle||l.fillStyle||"yellow",t.fillStyle=s,t.fill(),a&&(t.strokeStyle=a,t.stroke()))}t.restore()}}},{key:"animate",value:function(){this.drawAnimation();var t=this.options.animateTime||100;this.timeout=setTimeout(this.animate.bind(this),t)}},{key:"start",value:function(){this.stop(),this.animate()}},{key:"stop",value:function(){clearTimeout(this.timeout)}},{key:"unbindEvent",value:function(){}},{key:"hide",value:function(){this.canvasLayer.hide(),this.stop()}},{key:"show",value:function(){this.start()}}]),xt),ft=function(t,e,n){return e&&mt(t.prototype,e),n&&mt(t,n),t},dt=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(yt,ct),ft(yt,[{key:"clickEvent",value:function(t){var e=t.pixel;ht(yt.prototype.__proto__||Object.getPrototypeOf(yt.prototype),"clickEvent",this).call(this,e,t)}},{key:"mousemoveEvent",value:function(t){var e=t.pixel;ht(yt.prototype.__proto__||Object.getPrototypeOf(yt.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"bindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&(t.setDefaultCursor("default"),t.addEventListener("click",this.clickEvent)),this.options.methods.mousemove&&t.addEventListener("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.removeEventListener("click",this.clickEvent),this.options.methods.mousemove&&t.removeEventListener("mousemove",this.mousemoveEvent))}},{key:"transferToMercator",value:function(){var t,n=this.map.getMapType().getProjection();"bd09mc"!==this.options.coordType&&(t=this.dataSet.get(),t=this.dataSet.transferCoordinate(t,function(t){var e=n.lngLatToPoint({lng:t[0],lat:t[1]});return[e.x,e.y]},"coordinates","coordinates_mercator"),this.dataSet._set(t))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(n){if(this.canvasLayer){var e,t,i,o,r=this,a=r.options.animation,s=this.canvasLayer._map,l=Math.pow(2,18-s.getZoom()),u=s.getMapType().getProjection().lngLatToPoint(s.getCenter()),h=new BMap.Pixel(u.x-s.getSize().width/2*l,u.y+s.getSize().height/2*l),c=this.getContext();if(r.isEnabledTime()){if(void 0===n)return void R(c);"2d"==this.context&&(c.save(),c.globalCompositeOperation="destination-out",c.fillStyle="rgba(0, 0, 0, .1)",c.fillRect(0,0,c.canvas.width,c.canvas.height),c.restore())}else R(c);if("2d"==this.context)for(var g in r.options)c[g]=r.options[g];else c.clear(c.COLOR_BUFFER_BIT);r.options.minZoom&&s.getZoom()<r.options.minZoom||r.options.maxZoom&&s.getZoom()>r.options.maxZoom||(e=1,"2d"!=this.context&&(e=this.canvasLayer.devicePixelRatio),t={fromColumn:"bd09mc"==r.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){return[(t[0]-h.x)/l*e,(h.y-t[1])/l*e]}},void 0!==n&&(t.filter=function(t){var e=a.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),i=r.dataSet.get(t),this.processData(i),o=s.pointToPixel(new BMap.Point(0,0)),"m"==r.options.unit?(r.options.size&&(r.options._size=r.options.size/l),r.options.width&&(r.options._width=r.options.width/l),r.options.height&&(r.options._height=r.options.height/l)):(r.options._size=r.options.size,r.options._height=r.options.height,r.options._width=r.options.width),this.drawContext(c,i,r.options,o),r.options.updateCallback&&r.options.updateCallback(n))}}},{key:"init",value:function(t){var e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(e.options.zIndex),e.options.max&&this.intensity.setMax(e.options.max),e.options.min&&this.intensity.setMin(e.options.min),this.initAnimator()}},{key:"addAnimatorEvent",value:function(){this.map.addEventListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addEventListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer)}},{key:"hide",value:function(){this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){this.canvasLayer.draw()}}]),yt),vt="undefined"==typeof window?{}:window;function yt(t,e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,yt);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=_typeof(e)&&"function"!=typeof e?t:e}(this,(yt.__proto__||Object.getPrototypeOf(yt)).call(this,t,e,n)),o=i;n=n||{},o.init(n),o.argCheck(n),o.transferToMercator();var r=i.canvasLayer=new k({map:t,context:i.context,paneName:n.paneName,mixBlendMode:n.mixBlendMode,enableMassClear:n.enableMassClear,zIndex:n.zIndex,update:function(){o._canvasUpdate()}});return e.on("change",function(){o.transferToMercator(),r.draw()}),i.clickEvent=i.clickEvent.bind(i),i.mousemoveEvent=i.mousemoveEvent.bind(i),i.bindEvent(),i}function mt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function xt(t,e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,xt);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=_typeof(e)&&"function"!=typeof e?t:e}(this,(xt.__proto__||Object.getPrototypeOf(xt)).call(this,t,e,n));i.map=t,i.options=n||{},i.dataSet=e,i.init(n);var o=new k({map:t,update:i._canvasUpdate.bind(i)});i.canvasLayer=o,i.transferToMercator();var r=i;return e.on("change",function(){r.transferToMercator(),o.draw()}),i.ctx=o.canvas.getContext("2d"),i.start(),i}function wt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _t(t,e,n){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,_t),e instanceof O||(e=new O(e)),this.dataSet=e,this.map=t}vt.google&&vt.google.maps&&(z.prototype=new google.maps.OverlayView,z.DEFAULT_PANE_NAME_="overlayLayer",z.CSS_TRANSFORM_=function(){for(var t=document.createElement("div"),e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],n=0;n<e.length;n++){var i=e[n];if(void 0!==t.style[i])return i}return e[0]}(),z.prototype.requestAnimFrame_=vt.requestAnimationFrame||vt.webkitRequestAnimationFrame||vt.mozRequestAnimationFrame||vt.oRequestAnimationFrame||vt.msRequestAnimationFrame||function(t){return vt.setTimeout(t,1e3/60)},z.prototype.cancelAnimFrame_=vt.cancelAnimationFrame||vt.webkitCancelAnimationFrame||vt.mozCancelAnimationFrame||vt.oCancelAnimationFrame||vt.msCancelAnimationFrame||function(t){},z.prototype.setOptions=function(t){void 0!==t.animate&&this.setAnimate(t.animate),void 0!==t.paneName&&this.setPaneName(t.paneName),void 0!==t.updateHandler&&this.setUpdateHandler(t.updateHandler),void 0!==t.resizeHandler&&this.setResizeHandler(t.resizeHandler),void 0!==t.resolutionScale&&this.setResolutionScale(t.resolutionScale),void 0!==t.map&&this.setMap(t.map)},z.prototype.setAnimate=function(t){this.isAnimated_=!!t,this.isAnimated_&&this.scheduleUpdate()},z.prototype.isAnimated=function(){return this.isAnimated_},z.prototype.setPaneName=function(t){this.paneName_=t,this.setPane_()},z.prototype.getPaneName=function(){return this.paneName_},z.prototype.setPane_=function(){if(this.isAdded_){var t=this.getPanes();if(!t[this.paneName_])throw new Error('"'+this.paneName_+'" is not a valid MapPane name.');t[this.paneName_].appendChild(this.canvas)}},z.prototype.setResizeHandler=function(t){this.resizeHandler_=t},z.prototype.setResolutionScale=function(t){"number"==typeof t&&(this.resolutionScale_=t,this.resize_())},z.prototype.setUpdateHandler=function(t){this.updateHandler_=t},z.prototype.onAdd=function(){this.isAdded_||(this.isAdded_=!0,this.setPane_(),this.resizeListener_=google.maps.event.addListener(this.getMap(),"resize",this.resizeFunction_),this.centerListener_=google.maps.event.addListener(this.getMap(),"center_changed",this.repositionFunction_),this.resize_(),this.repositionCanvas_())},z.prototype.onRemove=function(){this.isAdded_&&(this.isAdded_=!1,this.topLeft_=null,this.canvas.parentElement.removeChild(this.canvas),this.centerListener_&&(google.maps.event.removeListener(this.centerListener_),this.centerListener_=null),this.resizeListener_&&(google.maps.event.removeListener(this.resizeListener_),this.resizeListener_=null),this.requestAnimationFrameId_&&(this.cancelAnimFrame_.call(vt,this.requestAnimationFrameId_),this.requestAnimationFrameId_=null))},z.prototype.resize_=function(){var t,e,n,i,o,r,a;this.isAdded_&&(e=(t=this.getMap()).getDiv().offsetWidth,n=t.getDiv().offsetHeight,i=e*this.resolutionScale_,o=n*this.resolutionScale_,r=this.canvas.width,a=this.canvas.height,r===i&&a===o||(this.canvas.width=i,this.canvas.height=o,this.needsResize_=!0,this.scheduleUpdate()),this.canvasCssWidth_===e&&this.canvasCssHeight_===n||(this.canvasCssWidth_=e,this.canvasCssHeight_=n,this.canvas.style.width=e+"px",this.canvas.style.height=n+"px"))},z.prototype.draw=function(){this.repositionCanvas_()},z.prototype.repositionCanvas_=function(){var t=this.getMap(),e=t.getBounds().getNorthEast().lat(),n=t.getCenter(),i=Math.pow(2,t.getZoom()),o=n.lng()-180*this.canvasCssWidth_/(256*i);this.topLeft_=new google.maps.LatLng(e,o);var r=this.getProjection().fromLatLngToDivPixel(n),a=-Math.round(this.canvasCssWidth_/2-r.x),s=-Math.round(this.canvasCssHeight_/2-r.y);this.canvas.style[z.CSS_TRANSFORM_]="translate("+a+"px,"+s+"px)",this.scheduleUpdate()},z.prototype.update_=function(){this.requestAnimationFrameId_=null,this.isAdded_&&(this.isAnimated_&&this.scheduleUpdate(),this.needsResize_&&this.resizeHandler_&&(this.needsResize_=!1,this.resizeHandler_()),this.updateHandler_&&this.updateHandler_())},z.prototype.getTopLeft=function(){return this.topLeft_},z.prototype.scheduleUpdate=function(){this.isAdded_&&!this.requestAnimationFrameId_&&(this.requestAnimationFrameId_=this.requestAnimFrame_.call(vt,this.requestUpdateFunction_))});function bt(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:bt(o,e,n)}if("value"in i)return i.value;var r=i.get;return void 0!==r?r.call(n):void 0}var St=function(t,e,n){return e&&Lt(t.prototype,e),n&&Lt(t,n),t},Mt=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+_typeof(e));t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(At,ct),St(At,[{key:"clickEvent",value:function(t){var e=t.pixel;bt(At.prototype.__proto__||Object.getPrototypeOf(At.prototype),"clickEvent",this).call(this,e,t)}},{key:"mousemoveEvent",value:function(t){var e=t.pixel;bt(At.prototype.__proto__||Object.getPrototypeOf(At.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"bindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&(t.setDefaultCursor("default"),t.addListener("click",this.clickEvent)),this.options.methods.mousemove&&t.addListener("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.removeListener("click",this.clickEvent),this.options.methods.mousemove&&t.removeListener("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(n){if(this.canvasLayer){var t,o,r,a,e,i,s,l,u,h=this,c=h.options.animation,g=this.getContext();if(h.isEnabledTime()){if(void 0===n)return void R(g);"2d"==this.context&&(g.save(),g.globalCompositeOperation="destination-out",g.fillStyle="rgba(0, 0, 0, .1)",g.fillRect(0,0,g.canvas.width,g.canvas.height),g.restore())}else R(g);if("2d"==this.context)for(var p in h.options)g[p]=h.options[p];else g.clear(g.COLOR_BUFFER_BIT);h.options.minZoom&&t.getZoom()<h.options.minZoom||h.options.maxZoom&&t.getZoom()>h.options.maxZoom||(r=1,"2d"!=this.context&&(r=this.canvasLayer.devicePixelRatio),t=this.map,o=t.getProjection(),r=Math.pow(2,t.zoom)*resolutionScale,a=o.fromLatLngToPoint(this.canvasLayer.getTopLeft()),e={transferCoordinate:function(t){var e=new google.maps.LatLng(t[1],t[0]),n=o.fromLatLngToPoint(e),i={x:(n.x-a.x)*r,y:(n.y-a.y)*r};return[i.x,i.y]}},void 0!==n&&(e.filter=function(t){var e=c.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),i=h.dataSet.get(e),this.processData(i),s=new google.maps.LatLng(0,0),u={x:((l=o.fromLatLngToPoint(s)).x-a.x)*r,y:(l.y-a.y)*r},"m"==h.options.unit&&h.options.size?h.options._size=h.options.size/zoomUnit:h.options._size=h.options.size,this.drawContext(g,new O(i),h.options,u),h.options.updateCallback&&h.options.updateCallback(n))}}},{key:"init",value:function(t){this.options=t,this.initDataRange(t),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"addAnimatorEvent",value:function(){this.map.addListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer)}},{key:"hide",value:function(){this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){self.canvasLayer.draw()}}]),At),Pt={getDataSet:function(t){for(var e=[],n=t.features,i=0;i<n.length;i++){var o,r=n[i],a=r.geometry,s=r.properties,l={};for(o in s)l[o]=s[o];l.geometry=a,e.push(l)}return new O(e)}},Ct={CSVToArray:function(t,e){e=e||",";for(var n=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),i=[[]],o=null;o=n.exec(t);){var r,a=o[1];a.length&&a!==e&&i.push([]),r=o[2]?o[2].replace(new RegExp('""',"g"),'"'):o[3],i[i.length-1].push(r)}return i},getDataSet:function(t){for(var e=this.CSVToArray(t,","),n=[],i=e[0],o=1;o<e.length-1;o++){for(var r=e[o],a={},s=0;s<r.length;s++){var l=r[s];"geometry"==i[s]&&(l=JSON.parse(l)),a[i[s]]=l}n.push(a)}return new O(n)}};function At(t,e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,At);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=_typeof(e)&&"function"!=typeof e?t:e}(this,(At.__proto__||Object.getPrototypeOf(At)).call(this,t,e,n)),o=i;n=n||{},o.init(n),o.argCheck(n);var r={map:t,animate:!1,updateHandler:function(){o._canvasUpdate()},resolutionScale:resolutionScale};return i.canvasLayer=new z(r),i.clickEvent=i.clickEvent.bind(i),i.mousemoveEvent=i.mousemoveEvent.bind(i),i.bindEvent(),i}function Lt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t.version="2.0.14",t.canvasClear=R,t.canvasResolutionScale=function(t){var e=window.devicePixelRatio||1;t.canvas.width=t.canvas.width*e,t.canvas.height=t.canvas.height*e,t.canvas.style.width=t.canvas.width/e+"px",t.canvas.style.height=t.canvas.height/e+"px",t.scale(e,e)},t.canvasDrawSimple=T,t.canvasDrawHeatmap=D,t.canvasDrawGrid=U,t.canvasDrawHoneycomb=j,t.webglDrawSimple=Q,t.webglDrawPoint=Y,t.webglDrawLine=H,t.webglDrawPolygon=J,t.utilCityCenter=e,t.utilCurve=K,t.utilForceEdgeBundling=function(){function f(t){return{x:x[t.target].x-x[t.source].x,y:x[t.target].y-x[t.source].y}}function y(t){return Math.sqrt(Math.pow(x[t.source].x-x[t.target].x,2)+Math.pow(x[t.source].y-x[t.target].y,2))}function d(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function a(t,e){var n=Math.sqrt((e.target.x-e.source.x)*(e.target.x-e.source.x)+(e.target.y-e.source.y)*(e.target.y-e.source.y)),i=((e.source.y-t.y)*(e.source.y-e.target.y)-(e.source.x-t.x)*(e.target.x-e.source.x))/(n*n);return{x:e.source.x+i*(e.target.x-e.source.x),y:e.source.y+i*(e.target.y-e.source.y)}}function m(t,e){for(var n,i={x:0,y:0},o=g[t],r=0;r<o.length;r++){var a,s={x:_[o[r]][e].x-_[t][e].x,y:_[o[r]][e].y-_[t][e].y};(Math.abs(s.x)>l||Math.abs(s.y)>l)&&(a=1/Math.pow((n={source:_[o[r]][e],target:_[t][e]},Math.sqrt(Math.pow(n.source.x-n.target.x,2)+Math.pow(n.source.y-n.target.y,2))),1),i.x+=s.x*a,i.y+=s.y*a)}return i}function u(t,e,n){for(var i,o,r,a,s,l,u,h,c=b/(y(w[t])*(e+1)),g=[{x:0,y:0}],p=1;p<e+1;p++){var f={x:0,y:0},d=(o=p,r=c,h=u=l=s=a=void 0,a=_[i=t][o-1],s=_[i][o+1],l=_[i][o],u=a.x-l.x+s.x-l.x,h=a.y-l.y+s.y-l.y,{x:u*=r,y:h*=r}),v=m(t,p);f.x=n*(d.x+v.x),f.y=n*(d.y+v.y),g.push(f)}return g.push({x:0,y:0}),g}function h(t){for(var e,n=0;n<w.length;n++)if(1==t)_[n].push(x[w[n].source]),_[n].push((e=w[n],{x:(x[e.source].x+x[e.target].x)/2,y:(x[e.source].y+x[e.target].y)/2})),_[n].push(x[w[n].target]);else{var i=function(t){for(var e=0,n=1;n<_[t].length;n++){e+=d(_[t][n],_[t][n-1])}return e}(n)/(t+1),o=i,r=[];r.push(x[w[n].source]);for(var a=1;a<_[n].length;a++){for(var s=d(_[n][a],_[n][a-1]);o<s;){var l=o/s,u=_[n][a-1].x,h=_[n][a-1].y;u+=l*(_[n][a].x-_[n][a-1].x),h+=l*(_[n][a].y-_[n][a-1].y),r.push({x:u,y:h}),s-=o,o=i}o-=s}r.push(x[w[n].target]),_[n]=r}}function v(t,e){var n=a(x[e.source],{source:x[t.source],target:x[t.target]}),i=a(x[e.target],{source:x[t.source],target:x[t.target]}),o={x:(n.x+i.x)/2,y:(n.y+i.y)/2},r={x:(x[t.source].x+x[t.target].x)/2,y:(x[t.source].y+x[t.target].y)/2};return Math.max(0,1-2*d(r,o)/d(n,i))}function o(t,e){var n,i,o,r,a,s,l,u,h,c,g,p;return h=t,c=e,Math.abs((g=f(h),p=f(c),(g.x*p.x+g.y*p.y)/(y(h)*y(c))))*(l=e,2/((u=(y(s=t)+y(l))/2)/Math.min(y(s),y(l))+Math.max(y(s),y(l))/u))*(r=e,(a=(y(o=t)+y(r))/2)/(a+d({x:(x[o.source].x+x[o.target].x)/2,y:(x[o.source].y+x[o.target].y)/2},{x:(x[r.source].x+x[r.target].x)/2,y:(x[r.source].y+x[r.target].y)/2})))*(n=t,i=e,Math.min(v(n,i),v(i,n)))}function c(){for(var t,e,n=0;n<w.length-1;n++)for(var i=n+1;i<w.length;i++)n!=i&&(t=w[n],e=w[i],o(t,e)>=r)&&(g[n].push(i),g[i].push(n))}function e(){var t=p,e=M,n=1;(function(){for(var t=0;t<w.length;t++)_[t]=[]})(),function(){for(var t=0;t<w.length;t++)g[t]=[]}(),h(n),c();for(var i=0;i<S;i++){for(var o=0;o<e;o++){for(var r=[],a=0;a<w.length;a++)r[a]=u(a,n,t);for(var s=0;s<w.length;s++)for(var l=0;l<n+1;l++)_[s][l].x+=r[s][l].x,_[s][l].y+=r[s][l].y}t/=2,e*=C,h(n*=2)}return _}var x={},w=[],g=[],_=[],b=.1,p=.1,n=2,S=6,M=70,C=.6666667,r=.6,l=1e-8;return e.nodes=function(t){return 0==arguments.length?x:(x=t,e)},e.edges=function(t){return 0==arguments.length?w:(w=function(t){for(var e=[],n=0;n<t.length;n++)x[t[n].source].x!=x[t[n].target].x&&x[t[n].source].y!=x[t[n].target].y&&e.push(t[n]);return e}(t),e)},e.bundling_stiffness=function(t){return 0==arguments.length?b:(b=t,e)},e.step_size=function(t){return 0==arguments.length?p:(p=t,e)},e.cycles=function(t){return 0==arguments.length?S:(S=t,e)},e.iterations=function(t){return 0==arguments.length?M:(M=t,e)},e.iterations_rate=function(t){return 0==arguments.length?C:(C=t,e)},e.subdivision_points_seed=function(t){return 0==arguments.length?P:(P=t,e)},e.subdivision_rate=function(t){return 0==arguments.length?n:(n=t,e)},e.compatbility_threshold=function(t){return 0==arguments.length?compatbility_threshold:(r=t,e)},e},t.utilDataRangeIntensity=I,t.utilDataRangeCategory=i,t.utilDataRangeChoropleth=o,t.Map=$,t.baiduMapCanvasLayer=k,t.baiduMapAnimationLayer=pt,t.baiduMapLayer=dt,t.googleMapCanvasLayer=z,t.googleMapLayer=Mt,t.DataSet=O,t.geojson=Pt,t.csv=Ct,Object.defineProperty(t,"__esModule",{value:!0})});