qd-changjing/public/leaflet/libs/mapv/mapv.min.js

9 lines
75 KiB
JavaScript

/*!
* Copyright (c) 2016, Baidu, Inc. All rights reserved.
* mapv.(http://mapv.baidu.com)
* github: https://github.com/huiyan-fe/mapv
* license: BSD 3-clause "New" or "Revised"
*/
!function(t,e){"object"==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 e(){this._subscribers={}}function n(t,n){e.bind(this)(),this._options=n||{},this._data=[],t&&this.add(t)}function i(t,e){var n;if("undefined"==typeof document);else{var n=document.createElement("canvas");t&&(n.width=t),e&&(n.height=e)}return n}function o(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 r(t){var e=t/2,n=t+e,o=1e4,r=new i(2*n,2*n),a=r.getContext("2d");return a.shadowBlur=e,a.shadowColor="black",a.shadowOffsetX=a.shadowOffsetY=o,a.beginPath(),a.arc(n-o,n-o,t,0,2*Math.PI,!0),a.closePath(),a.fill(),r}function a(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[i+1],t[r-1]=e[i+2]}function s(t,e,n){var i=n.max||100,a=n.min||0,s=n._size;void 0==s&&(s=n.size,void 0==s&&(s=13));var l=new o({gradient:n.gradient,max:i,min:a}),u=r(s),h=u.width/2,g=u.height/2,c=e,p={};c.forEach(function(t,e){var n=void 0===t.count?1:t.count,o=Math.min(1,n/i).toFixed(2);p[o]=p[o]||[],p[o].push(t)});for(var f in p)if(!isNaN(f)){var v=p[f];t.beginPath(),n.withoutAlpha||(t.globalAlpha=f),t.strokeStyle=l.getColor(f*i),v.forEach(function(e,o){if(e.geometry){var r=e.geometry._coordinates||e.geometry.coordinates,a=e.geometry.type;if("Point"===a){var s=void 0===e.count?1:e.count;t.globalAlpha=s/i,t.drawImage(u,r[0]-h,r[1]-g)}else if("LineString"===a){var s=void 0===e.count?1:e.count;t.globalAlpha=s/i,t.beginPath(),ht.draw(t,e,n),t.stroke()}}})}}function l(t,e,r){var l=r.strength||.3;t.strokeStyle="rgba(0,0,0,"+l+")";var u=new i(t.canvas.width,t.canvas.height),h=u.getContext("2d");h.scale(pt,pt),r=r||{};var g=e instanceof n?e.get():e;t.save();var c=new o({gradient:r.gradient});if(s(h,g,r),!r.absolute){var p=h.getImageData(0,0,t.canvas.width,t.canvas.height);a(p.data,c.getImageData(),r),t.putImageData(p,0,0),t.restore()}c=null,u=null}function u(t,e,n){var i=60*n+30,o=Math.PI/180*i;return[t.x+e*Math.cos(o),t.y+e*Math.sin(o)]}function h(t,e,n){var i=t.createShader(n);return t.shaderSource(i,e),t.compileShader(i),i}function g(t,e,n){var i=h(t,e,t.VERTEX_SHADER),o=h(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 c(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 p(t,e,n){if(e){var i=g(t,yt,mt);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=c(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,p=e.length;h<p;h++){for(var f=e[h].geometry._coordinates,v=[],d=0;d<f.length;d++){var y=f[d],m=(y[0]-o)/o,x=(r-y[1])/r;v.push(m,x)}var w=new Float32Array(v);t.bufferData(t.ARRAY_BUFFER,w,t.STATIC_DRAW),t.drawArrays(t.LINE_STRIP,0,f.length)}}}function f(t,e,n){if(e){var i=g(t,wt,_t),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,p=0;p<e.length;p++){var f=e[p].geometry._coordinates,v=(f[0]-s)/s,d=(l-f[1])/l;v<-1||v>1||d<-1||d>1||(u.push(v,d),h++)}var y=new Float32Array(u),m=h,x=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,x),t.bufferData(t.ARRAY_BUFFER,y,t.STATIC_DRAW),t.vertexAttribPointer(o,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o),t.vertexAttrib1f(r,n._size);var w=c(n.fillStyle||"red");t.uniform4f(a,w[0]/255,w[1]/255,w[2]/255,w[3]/255),t.drawArrays(t.POINTS,0,m)}}function v(t,e,n){n=n||2;var i=e&&e.length,o=i?e[0]*n:t.length,r=d(t,0,o,n,!0),a=[];if(!r)return a;var s,l,u,h,g,c,p;if(i&&(r=S(t,e,r,n)),t.length>80*n){s=u=t[0],l=h=t[1];for(var f=n;f<o;f+=n)g=t[f],c=t[f+1],g<s&&(s=g),c<l&&(l=c),g>u&&(u=g),c>h&&(h=c);p=Math.max(u-s,h-l)}return m(r,a,n,s,l,p),a}function d(t,e,n,i,o){var r,a;if(o===q(t,e,n,i)>0)for(r=e;r<n;r+=i)a=N(r,t[r],t[r+1],a);else for(r=n-i;r>=e;r-=i)a=N(r,t[r],t[r+1],a);return a&&I(a,a.next)&&(j(a),a=a.next),a}function y(t,e){if(!t)return t;e||(e=t);var n,i=t;do if(n=!1,i.steiner||!I(i,i.next)&&0!==T(i.prev,i,i.next))i=i.next;else{if(j(i),i=e=i.prev,i===i.next)return null;n=!0}while(n||i!==e);return e}function m(t,e,n,i,o,r,a){if(t){!a&&r&&C(t,i,o,r);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,r?w(t,i,o,r):x(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),j(t),t=l.next,u=l.next;else if(t=l,t===u){a?1===a?(t=_(t,e,n),m(t,e,n,i,o,r,2)):2===a&&b(t,e,n,i,o,r):m(y(t),e,n,i,o,r,1);break}}}function x(t){var e=t.prev,n=t,i=t.next;if(T(e,n,i)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(F(e.x,e.y,n.x,n.y,i.x,i.y,o.x,o.y)&&T(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function w(t,e,n,i){var o=t.prev,r=t,a=t.next;if(T(o,r,a)>=0)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,g=E(s,l,e,n,i),c=E(u,h,e,n,i),p=t.nextZ;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&F(o.x,o.y,r.x,r.y,a.x,a.y,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=g;){if(p!==t.prev&&p!==t.next&&F(o.x,o.y,r.x,r.y,a.x,a.y,p.x,p.y)&&T(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function _(t,e,n){var i=t;do{var o=i.prev,r=i.next.next;!I(o,r)&&O(o,i,i.next,r)&&D(o,r)&&D(r,o)&&(e.push(o.i/n),e.push(i.i/n),e.push(r.i/n),j(i),j(i.next),i=t=r),i=i.next}while(i!==t);return i}function b(t,e,n,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&R(a,s)){var l=Z(a,s);return a=y(a,a.next),l=y(l,l.next),m(a,e,n,i,o,r),void m(l,e,n,i,o,r)}s=s.next}a=a.next}while(a!==t)}function S(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===l.next&&(l.steiner=!0),u.push(z(l));for(u.sort(M),o=0;o<u.length;o++)A(u[o],n),n=y(n,n.next);return n}function M(t,e){return t.x-e.x}function A(t,e){if(e=L(t,e)){var n=Z(e,t);y(n,n.next)}}function L(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&&s>a){if(a=s,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,g=n.y,c=1/0;for(i=n.next;i!==u;)o>=i.x&&i.x>=h&&F(r<g?o:a,r,h,g,r<g?a:o,r,i.x,i.y)&&(l=Math.abs(r-i.y)/(o-i.x),(l<c||l===c&&i.x>n.x)&&D(i,t)&&(n=i,c=l)),i=i.next;return n}function C(t,e,n,i){var o=t;do null===o.z&&(o.z=E(o.x,o.y,e,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,k(o)}function k(t){var e,n,i,o,r,a,s,l,u=1;do{for(n=t,t=null,r=null,a=0;n;){for(a++,i=n,s=0,e=0;e<u&&(s++,i=i.nextZ,i);e++);for(l=u;s>0||l>0&&i;)0===s?(o=i,i=i.nextZ,l--):0!==l&&i?n.z<=i.z?(o=n,n=n.nextZ,s--):(o=i,i=i.nextZ,l--):(o=n,n=n.nextZ,s--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;n=i}r.nextZ=null,u*=2}while(a>1);return t}function E(t,e,n,i,o){return t=32767*(t-n)/o,e=32767*(e-i)/o,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function z(t){var e=t,n=t;do e.x<n.x&&(n=e),e=e.next;while(e!==t);return n}function F(t,e,n,i,o,r,a,s){return(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)>=0}function R(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!B(t,e)&&D(t,e)&&D(e,t)&&U(t,e)}function T(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function I(t,e){return t.x===e.x&&t.y===e.y}function O(t,e,n,i){return!!(I(t,e)&&I(n,i)||I(t,i)&&I(n,e))||T(t,e,n)>0!=T(t,e,i)>0&&T(n,i,t)>0!=T(n,i,e)>0}function B(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&&O(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function D(t,e){return T(t.prev,t,t.next)<0?T(t,e,t.next)>=0&&T(t,t.prev,e)>=0:T(t,e,t.prev)<0||T(t,t.next,e)<0}function U(t,e){var n=t,i=!1,o=(t.x+e.x)/2,r=(t.y+e.y)/2;do 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;while(n!==t);return i}function Z(t,e){var n=new H(t.i,t.x,t.y),i=new H(e.i,e.x,e.y),o=t.next,r=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function N(t,e,n,i){var o=new H(t,e,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function j(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 H(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 q(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 W(t,e,n){if(e){t.clear(t.COLOR_BUFFER_BIT),t.viewport(0,0,t.canvas.width,t.canvas.height);var i=g(t,St,Mt);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=c(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=[],p=65536,f=0,d=0,y=e.length;d<y;d++){var m=v.flatten(e[d].geometry._coordinates||e[d].geometry.coordinates),x=m.vertices;f=u.length/2;for(var w=0;w<x.length;w+=2)x[w]=(x[w]-o)/o,x[w+1]=(r-x[w+1])/r;(u.length+x.length)/2>p&&(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,h.length=0,f=0);for(var w=0;w<x.length;w++)u.push(x[w]);for(var _=v(x,m.holes,m.dimensions),w=0;w<_.length;w++)h.push(_[w]+f)}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)}}function Y(t){var e=t.split("|");return e[0]=e[0].split(","),{lng:parseFloat(e[0][0]),lat:parseFloat(e[0][1])}}function G(t){for(var e=[],n=0;n<t.length-1;n++){var i=V(t[n],t[n+1]);i&&i.length>0&&(e=e.concat(i))}return e}function V(t,e){if(!t||!e)return null;var n,i,o,r,a,s,l,u=function(t){return 1-2*t+t*t},h=function(t){return 2*t-2*t*t},g=function(t){return t*t},c=[],p=40,f=0,v=0;if("undefined"==typeof e)return void("undefined"!=typeof c&&(c=[]));var d=parseFloat(t.lat),y=parseFloat(e.lat),m=parseFloat(t.lng),x=parseFloat(e.lng);for(x>m&&parseFloat(x-m)>180&&m<0&&(m=parseFloat(360+m)),m>x&&parseFloat(m-x)>180&&x<0&&(x=parseFloat(360+x)),s=0,l=0,y==d?(n=0,i=m-x):x==m?(n=Math.PI/2,i=d-y):(n=Math.atan((y-d)/(x-m)),i=(y-d)/Math.sin(n)),0==l&&(l=n+Math.PI/5),o=i/2,a=o*Math.cos(l)+m,r=o*Math.sin(l)+d,f=0;f<p+1;f++)c.push([m*u(v)+a*h(v)+x*g(v),d*u(v)+r*h(v)+y*g(v)]),v+=1/p;return c}function J(t){this.splitList=t||{other:1}}function Q(t){this.splitList=t||[{start:0,value:"red"}]}function X(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 K(t,e){for(var n=0;n<t.length;n++)if($(t[n],e))return!0;return!1}function $(t,e){var n=Math.min(t.ne.x,e.ne.x),i=Math.min(t.sw.y,e.sw.y),o=Math.max(t.sw.x,e.sw.x),r=Math.max(t.ne.y,e.ne.y);return n>o&&i>r}function tt(t){requestAnimationFrame(tt),Rt.update(t)}function et(t){function e(t,e){return function(){e.apply(t)}}this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=et.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)}var nt="2.0.14",it=function(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)},ot=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)};e.prototype.on=function(t,e){var n=this._subscribers[t];n||(n=[],this._subscribers[t]=n),n.push({callback:e})},e.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--)},e.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)}};var rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},at=function(){function t(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)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),st=function t(e,n,i){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var r=Object.getPrototypeOf(e);return null===r?void 0:t(r,n,i)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(i)},lt=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)},ut=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};n.prototype=e.prototype,n.prototype.add=function(t,e){if(Array.isArray(t))for(var n=0,i=t.length;n<i;n++){if(t[n].time&&14==t[n].time.length&&"20"==t[n].time.substr(0,2)){var 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)}},n.prototype.get=function(t){t=t||{};var e=(new Date,this._data);new Date;if(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},n.prototype.set=function(t){this._set(t),this._trigger("change")},n.prototype._set=function(t){this.clear(),this.add(t)},n.prototype.clear=function(t){this._data=[]},n.prototype.remove=function(t){},n.prototype.update=function(t,e){for(var n=this._data,i=0;i<n.length;i++)if(e){var o=!0;for(var r in e)n[i][r]!=e[r]&&(o=!1);o&&t&&t(n[i])}else t&&t(n[i]);this._trigger("change")},n.prototype.transferCoordinate=function(t,e,n,i){function o(t){for(var n=[],i=0;i<t.length;i++){for(var o=t[i],r=[],a=0;a<o.length;a++)r.push(e(o[a]));n.push(r)}return n}i=i||"_coordinates",n=n||"coordinates";for(var r=0;r<t.length;r++){var a=t[r].geometry,s=a[n];switch(a.type){case"Point":a[i]=e(s);break;case"LineString":for(var l=[],u=0;u<s.length;u++)l.push(e(s[u]));a[i]=l;break;case"Polygon":var l=o(s);a[i]=l;break;case"MultiPolygon":for(var l=[],h=0;h<s.length;h++){var g=s[h],g=o(g);l.push(g)}a[i]=l}}return t},n.prototype.initGeometry=function(t){t?this._data.forEach(function(e){e.geometry=t(e)}):this._data.forEach(function(t){!t.geometry&&t.lng&&t.lat&&(t.geometry={type:"Point",coordinates:[t.lng,t.lat]})})},n.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]);o>n&&(n=o)}return n}},n.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}},n.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 ht={drawDataSet:function(t,e,i){for(var o=e instanceof n?e.get():e,r=0,a=o.length;r<a;r++){var s=o[r];this.draw(t,s,i)}},draw:function(t,e,n){var i=e.geometry.type,o=e.geometry._coordinates||e.geometry.coordinates;n.symbol||"circle";switch(i){case"Point":var r=e._size||e.size||n._size||n.size||5;"rect"===n.symbol?t.rect(o[0]-r/2,o[1]-r/2,r,r):("Point"===n.bigData&&t.moveTo(o[0],o[1]),t.arc(o[0],o[1],r,0,2*Math.PI));break;case"LineString":for(var a=0;a<o.length;a++){var s=o[a][0],l=o[a][1];0==a?t.moveTo(s,l):t.lineTo(s,l)}break;case"Polygon":this.drawPolygon(t,o);break;case"MultiPolygon":for(var u=0;u<o.length;u++){var h=o[u];this.drawPolygon(t,h)}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])}}},gt={draw:function(t,e,i){var o=e instanceof n?e.get():e;t.save();for(var r in i)t[r]=i[r];if(i.bigData){t.save(),t.beginPath();for(var a=0,s=o.length;a<s;a++){var l=o[a];ht.draw(t,l,i)}var u=i.bigData;"Point"==u||"Polygon"==u||"MultiPolygon"==u?(t.fill(),(l.strokeStyle||i.strokeStyle)&&i.lineWidth&&t.stroke()):"LineString"==u&&t.stroke(),t.restore()}else for(var a=0,s=o.length;a<s;a++){var l=o[a];t.save(),(l.fillStyle||l._fillStyle)&&(t.fillStyle=l.fillStyle||l._fillStyle),(l.strokeStyle||l._strokeStyle)&&(t.strokeStyle=l.strokeStyle||l._strokeStyle);var u=l.geometry.type;t.beginPath(),ht.draw(t,l,i),"Point"==u||"Polygon"==u||"MultiPolygon"==u?(t.fill(),(l.strokeStyle||i.strokeStyle)&&i.lineWidth&&t.stroke()):"LineString"==u&&t.stroke(),t.restore()}t.restore()}};o.prototype.setMax=function(t){this.max=t||100},o.prototype.setMin=function(t){this.min=t||0},o.prototype.setMaxSize=function(t){this.maxSize=t||35},o.prototype.setMinSize=function(t){this.minSize=t||0},o.prototype.initPalette=function(){var t=this.gradient,e=new i(256,1),n=this.paletteCtx=e.getContext("2d"),o=n.createLinearGradient(0,0,256,1);for(var r in t)o.addColorStop(parseFloat(r),t[r]);n.fillStyle=o,n.fillRect(0,0,256,1)},o.prototype.getColor=function(t){var e=this.getImageData(t);return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]/256+")"},o.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;t>n&&(t=n),t<i&&(t=i);var o=4*Math.floor((t-i)/(n-i)*255);return[e[o],e[o+1],e[o+2],e[o+3]]},o.prototype.getSize=function(t){var e=0,n=this.max,i=this.min,o=this.maxSize,r=this.minSize;return t>n&&(t=n),t<i&&(t=i),e=r+(t-i)/(n-i)*(o-r)},o.prototype.getLegend=function(t){var e=this.gradient,n=t.width||20,o=t.height||180,r=new i(n,o),a=r.getContext("2d"),s=a.createLinearGradient(0,o,0,0);for(var l in e)s.addColorStop(parseFloat(l),e[l]);return a.fillStyle=s,a.fillRect(0,0,n,o),r};var ct="undefined"==typeof window?{}:window,pt=ct.devicePixelRatio||1,ft={draw:l},vt={draw:function(t,e,i){t.save();for(var r=e instanceof n?e.get():e,a={},s=i._size||i.size||50,l=i.offset||{x:0,y:0},u=0;u<r.length;u++){var h=r[u].geometry._coordinates||r[u].geometry.coordinates,g=Math.floor((h[0]-l.x)/s)+","+Math.floor((h[1]-l.y)/s);a[g]||(a[g]=0),a[g]+=~~(r[u].count||1)}var c=new o({max:i.max||100,gradient:i.gradient});for(var g in a)g=g.split(","),t.beginPath(),t.rect(g[0]*s+.5+l.x,g[1]*s+.5+l.y,s,s),t.fillStyle=c.getColor(a[g]),t.fill(),i.strokeStyle&&i.lineWidth&&t.stroke();if(i.label&&i.label.show!==!1){t.fillStyle=i.label.fillStyle||"white",i.label.font&&(t.font=i.label.font),i.label.shadowColor&&(t.shadowColor=i.label.shadowColor),i.label.shadowBlur&&(t.shadowBlur=i.label.shadowBlur);for(var g in a){g=g.split(",");var p=a[g],f=t.measureText(p).width;t.fillText(p,g[0]*s+.5+l.x+s/2-f/2,g[1]*s+.5+l.y+s/2+5)}}t.restore()}},dt={draw:function(t,e,i){t.save();var r=e instanceof n?e.get():e;for(var a in i)t[a]=i[a];var s=i.offset||{x:10,y:10},l=i._size||i.size||40;l=l/2/Math.sin(Math.PI/3);for(var h=2*l*Math.sin(Math.PI/3),g=1.5*l,c={},p=0;p<r.length;p++){var f=r[p].geometry._coordinates||r[p].geometry.coordinates,v=(f[1]-s.y)/g,d=Math.round(v),y=(f[0]-s.x)/h-(1&d?.5:0),m=Math.round(y),x=v-d;if(3*Math.abs(x)>1){var w=y-m,_=m+(y<m?-1:1)/2,b=d+(v<d?-1:1),S=y-_,M=v-b;w*w+x*x>S*S+M*M&&(m=_+(1&d?1:-1)/2,d=b)}var A=m+"-"+d,L=c[A];L?L.push(r[p]):(L=c[A]=[r[p]],L.i=m,L.j=d,L.x=(m+(1&d?.5:0))*h,L.y=d*g)}var C=new o({max:i.max||100,maxSize:l,gradient:i.gradient});for(var a in c){var P=c[a];t.beginPath();for(var k=0;k<6;k++){var E=l,z=u({x:P.x+s.x,y:P.y+s.y},E,k);t.lineTo(z[0],z[1])}t.closePath();for(var F=0,p=0;p<P.length;p++)F+=P[p].count||1;P.count=F,t.fillStyle=C.getColor(F),t.fill(),i.strokeStyle&&i.lineWidth&&t.stroke()}if(i.label&&i.label.show!==!1){t.fillStyle=i.label.fillStyle||"white",i.label.font&&(t.font=i.label.font),i.label.shadowColor&&(t.shadowColor=i.label.shadowColor),i.label.shadowBlur&&(t.shadowBlur=i.label.shadowBlur);for(var a in c){var P=c[a],R=P.count;R=R<0?R.toFixed(2):~~R;var T=t.measureText(R).width;t.fillText(R,P.x+s.x-T/2,P.y+s.y+5)}}t.restore()}},yt=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),mt=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),xt={draw:p},wt=["attribute vec4 a_Position;","attribute float a_PointSize;","void main() {","gl_Position = a_Position;","gl_PointSize = a_PointSize;","}"].join(""),_t=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),bt={draw:f};v.deviation=function(t,e,n,i){var o=e&&e.length,r=o?e[0]*n:t.length,a=Math.abs(q(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(q(t,u,h,n))}var g=0;for(s=0;s<i.length;s+=3){var c=i[s]*n,p=i[s+1]*n,f=i[s+2]*n;g+=Math.abs((t[c]-t[f])*(t[p+1]-t[c+1])-(t[c]-t[p])*(t[f+1]-t[c+1]))}return 0===a&&0===g?0:Math.abs((g-a)/a)},v.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]);o>0&&(i+=t[o-1].length,n.holes.push(i))}return n};var St=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),Mt=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),At={draw:W},Lt={draw:function(t,e,i){var o=e instanceof n?e.get():e;o.length>0&&("LineString"==o[0].geometry.type?xt.draw(t,o,i):"Polygon"==o[0].geometry.type||"MultiPolygon"==o[0].geometry.type?At.draw(t,o,i):bt.draw(t,o,i))}},Ct={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"}]},Pt={getProvinceNameByCityName:function(t){for(var e=Ct.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<Ct.municipalities.length;e++)if(Ct.municipalities[e].n==t)return Y(Ct.municipalities[e].g);for(var e=0;e<Ct.other.length;e++)if(Ct.other[e].n==t)return Y(Ct.other[e].g);for(var n=Ct.provinces,e=0;e<n.length;e++){if(n[e].n==t)return Y(n[e].g);for(var i=n[e].cities,o=0;o<i.length;o++)if(i[o].n==t)return Y(i[o].g)}return null}},kt={getPoints:G},Et=function(){function t(t,e){return t.x*e.x+t.y*e.y}function e(t){return{x:S[t.target].x-S[t.source].x,y:S[t.target].y-S[t.source].y}}function n(t){return Math.sqrt(Math.pow(S[t.source].x-S[t.target].x,2)+Math.pow(S[t.source].y-S[t.target].y,2))}function i(t){return Math.sqrt(Math.pow(t.source.x-t.target.x,2)+Math.pow(t.source.y-t.target.y,2))}function o(t){var e=(S[t.source].x+S[t.target].x)/2,n=(S[t.source].y+S[t.target].y)/2;return{x:e,y:n}}function r(t){for(var e=0,n=1;n<L[t].length;n++){var i=a(L[t][n],L[t][n-1]);e+=i}return e}function a(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function s(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 l(){for(var t=0;t<M.length;t++)1==E?L[t]=[]:(L[t]=[],L[t].push(S[M[t].source]),L[t].push(S[M[t].target]))}function u(){for(var t=0;t<M.length;t++)A[t]=[]}function h(t){for(var e=[],n=0;n<t.length;n++)S[t[n].source].x!=S[t[n].target].x&&S[t[n].source].y!=S[t[n].target].y&&e.push(t[n]);return e}function g(t,e,n){var i=L[t][e-1],o=L[t][e+1],r=L[t][e],a=i.x-r.x+o.x-r.x,s=i.y-r.y+o.y-r.y;return a*=n,s*=n,{x:a,y:s}}function c(t,e,n){for(var o={x:0,y:0},r=A[t],a=0;a<r.length;a++){var s={x:L[r[a]][e].x-L[t][e].x,y:L[r[a]][e].y-L[t][e].y};if(Math.abs(s.x)>O||Math.abs(s.y)>O){var l=1/Math.pow(i({source:L[r[a]][e],target:L[t][e]}),1);o.x+=s.x*l,o.y+=s.y*l}}return o}function p(t,e,i){for(var o=C/(n(M[t])*(e+1)),r=[{x:0,y:0}],a=1;a<e+1;a++){var s={x:0,y:0},l=g(t,a,o),u=c(t,a,i);s.x=i*(l.x+u.x),s.y=i*(l.y+u.y),r.push(s)}return r.push({x:0,y:0}),r}function f(t){for(var e=0;e<M.length;e++)if(1==t)L[e].push(S[M[e].source]),L[e].push(o(M[e])),L[e].push(S[M[e].target]);else{var n=r(e),i=n/(t+1),s=i,l=[];l.push(S[M[e].source]);for(var u=1;u<L[e].length;u++){for(var h=a(L[e][u],L[e][u-1]);h>s;){var g=s/h,c=L[e][u-1].x,p=L[e][u-1].y;c+=g*(L[e][u].x-L[e][u-1].x),p+=g*(L[e][u].y-L[e][u-1].y),l.push({x:c,y:p}),h-=s,s=i}s-=h}l.push(S[M[e].target]),L[e]=l}}function v(i,o){var r=Math.abs(t(e(i),e(o))/(n(i)*n(o)));return r}function d(t,e){var i=(n(t)+n(e))/2,o=2/(i/Math.min(n(t),n(e))+Math.max(n(t),n(e))/i);return o}function y(t,e){var i=(n(t)+n(e))/2,o={x:(S[t.source].x+S[t.target].x)/2,y:(S[t.source].y+S[t.target].y)/2},r={x:(S[e.source].x+S[e.target].x)/2,y:(S[e.source].y+S[e.target].y)/2},s=i/(i+a(o,r));return s}function m(t,e){var n=s(S[e.source],{source:S[t.source],target:S[t.target]}),i=s(S[e.target],{source:S[t.source],target:S[t.target]}),o={x:(n.x+i.x)/2,y:(n.y+i.y)/2},r={x:(S[t.source].x+S[t.target].x)/2,y:(S[t.source].y+S[t.target].y)/2},l=Math.max(0,1-2*a(r,o)/a(n,i));return l}function x(t,e){return Math.min(m(t,e),m(e,t))}function w(t,e){var n=v(t,e)*d(t,e)*y(t,e)*x(t,e);return n}function _(t,e){return w(t,e)>=I}function b(){for(var t=0;t<M.length-1;t++)for(var e=t+1;e<M.length;e++)t!=e&&_(M[t],M[e])&&(A[t].push(e),A[e].push(t))}var S={},M=[],A=[],L=[],C=.1,k=.1,E=1,z=2,F=6,R=70,T=.6666667,I=.6,O=1e-8,B=function(){var t=k,e=R,n=E;l(),u(),f(n),b();for(var i=0;i<F;i++){for(var o=0;o<e;o++){for(var r=[],a=0;a<M.length;a++)r[a]=p(a,n,t);for(var s=0;s<M.length;s++)for(var h=0;h<n+1;h++)L[s][h].x+=r[s][h].x,L[s][h].y+=r[s][h].y}t/=2,n=2*n,e=T*e,f(n)}return L};return B.nodes=function(t){return 0==arguments.length?S:(S=t,B)},B.edges=function(t){return 0==arguments.length?M:(M=h(t),B)},B.bundling_stiffness=function(t){return 0==arguments.length?C:(C=t,B)},B.step_size=function(t){return 0==arguments.length?k:(k=t,B)},B.cycles=function(t){return 0==arguments.length?F:(F=t,B)},B.iterations=function(t){return 0==arguments.length?R:(R=t,B)},B.iterations_rate=function(t){return 0==arguments.length?T:(T=t,B)},B.subdivision_points_seed=function(t){return 0==arguments.length?P:(P=t,B)},B.subdivision_rate=function(t){return 0==arguments.length?z:(z=t,B)},B.compatbility_threshold=function(t){return 0==arguments.length?compatbility_threshold:(I=t,B)},B};J.prototype.get=function(t){var e=this.splitList,n=e.other;for(var i in e)if(t==i){n=e[i];break}return n},J.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++),!(i>=e.length-1));o++);this.splitList.other=e[e.length-1]},J.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="";for(var o in e)i+='<div style="line-height: 19px;"><span style="vertical-align: -2px; display: inline-block; width: 30px;height: 19px;background:'+e[o]+';"></span><span style="margin-left: 3px;">'+o+"<span></div>";return n.innerHTML=i,n},Q.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},Q.prototype.generateByDataSet=function(t){var e=t.getMin("count"),n=t.getMax("count");this.generateByMinMax(e,n)},Q.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},Q.prototype.getLegend=function(t){this.splitList};var zt=function(){function t(e,n,i){if(rt(this,t),!e||!n)return console.warn("id 和 type 为必填项"),!1;if("baidu"==n){if(!BMap)return console.warn("请先引入百度地图JS API"),!1}else console.warn("暂不支持你的地图类型");this.type=n;var o=i&&i.center?i.center:[106.962497,38.208726],r=i&&i.zoom?i.zoom:5,a=this.map=new BMap.Map(e,{enableMapClick:!1});a.centerAndZoom(new BMap.Point(o[0],o[1]),r),a.enableScrollWheelZoom(!0),a.setMapStyle({style:"light"})}return at(t,[{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}}]),t}(),Ft="undefined"==typeof window?{}:window;Ft.BMap&&(X.prototype=new BMap.Overlay,X.prototype.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},X.prototype.adjustSize=function(){var t=this._map.getSize(),e=this.canvas,n=this.devicePixelRatio=Ft.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"},X.prototype.draw=function(){var t=this;clearTimeout(t.timeoutID),t.timeoutID=setTimeout(function(){t._draw()},15)},X.prototype._draw=function(){var t=this._map,e=t.getSize(),n=t.getCenter();if(n){var i=t.pointToOverlayPixel(n);this.canvas.style.left=i.x-e.width/2+"px",this.canvas.style.top=i.y-e.height/2+"px",this.dispatchEvent("draw"),this.options.update&&this.options.update.call(this)}},X.prototype.getContainer=function(){return this.canvas},X.prototype.show=function(){this.canvas||this._map.addOverlay(this),this.canvas.style.display="block"},X.prototype.hide=function(){this.canvas.style.display="none"},X.prototype.setZIndex=function(t){this.canvas.style.zIndex=t},X.prototype.getZIndex=function(){return this.zIndex});var Rt=Rt||function(){var t=[];return{getAll:function(){return t},removeAll:function(){t=[]},add:function(e){t.push(e)},remove:function(e){var n=t.indexOf(e);n!==-1&&t.splice(n,1)},update:function(e,n){if(0===t.length)return!1;var i=0;for(e=void 0!==e?e:Rt.now();i<t.length;)t[i].update(e)||n?i++:t.splice(i,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 e,n=t,i={},o={},r={},a=1e3,s=0,l=!1,u=!1,h=!1,g=0,c=null,p=Rt.Easing.Linear.None,f=Rt.Interpolation.Linear,v=[],d=null,y=!1,m=null,x=null,w=null;this.to=function(t,e){return o=t,void 0!==e&&(a=e),this},this.start=function(t){Rt.add(this),u=!0,y=!1,c=void 0!==t?t:Rt.now(),c+=g;for(var e in o){if(o[e]instanceof Array){if(0===o[e].length)continue;o[e]=[n[e]].concat(o[e])}void 0!==n[e]&&(i[e]=n[e],i[e]instanceof Array==!1&&(i[e]*=1),r[e]=i[e]||0)}return this},this.stop=function(){return u?(Rt.remove(this),u=!1,null!==w&&w.call(n,n),this.stopChainedTweens(),this):this},this.end=function(){return this.update(c+a),this},this.stopChainedTweens=function(){for(var t=0,e=v.length;t<e;t++)v[t].stop()},this.delay=function(t){return g=t,this},this.repeat=function(t){return s=t,this},this.repeatDelay=function(t){return e=t,this},this.yoyo=function(t){return l=t,this},this.easing=function(t){return p=t,this},this.interpolation=function(t){return f=t,this},this.chain=function(){return v=arguments,this},this.onStart=function(t){return d=t,this},this.onUpdate=function(t){return m=t,this},this.onComplete=function(t){return x=t,this},this.onStop=function(t){return w=t,this},this.update=function(t){var u,w,_;if(t<c)return!0;y===!1&&(null!==d&&d.call(n,n),y=!0),w=(t-c)/a,w=w>1?1:w,_=p(w);for(u in o)if(void 0!==i[u]){var b=i[u]||0,S=o[u];S instanceof Array?n[u]=f(S,_):("string"==typeof S&&(S="+"===S.charAt(0)||"-"===S.charAt(0)?b+parseFloat(S):parseFloat(S)),"number"==typeof S&&(n[u]=b+(S-b)*_))}if(null!==m&&m.call(n,_),1===w){if(s>0){isFinite(s)&&s--;for(u in r){if("string"==typeof o[u]&&(r[u]=r[u]+parseFloat(o[u])),l){var M=r[u];r[u]=o[u],o[u]=M}i[u]=r[u]}return l&&(h=!h),c=void 0!==e?t+e:t+g,!0}null!==x&&x.call(n,n);for(var A=0,L=v.length;A<L;A++)v[A].start(c+a);return!1}return!0}},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*(-Math.pow(2,-10*(t-1))+2)}},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,t<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){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*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):e>1?r(t[n],t[n-1],n-i):r(t[o],t[o+1>n?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]):e>1?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:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,o){var r=.5*(n-t),a=.5*(i-e),s=o*o,l=o*s;return(2*e-2*n+r+a)*l+(-3*e+3*n-2*r-a)*s+r*o+e}}};var Tt={draw:function(t,e,i){var o=e instanceof n?e.get():e;t.save();for(var r in i)t[r]=i[r];var a=i.offset||{x:0,y:0},s=[],l=i._size||i.size;l?t.font="bold "+l+"px Arial":l=12;var u=i.textKey||"text";if(i.textAlign||(t.textAlign="center"),i.textBaseline||(t.textBaseline="middle"),i.avoid)for(var h=0,g=o.length;h<g;h++){var c=o[h].geometry._coordinates||o[h].geometry.coordinates,p=c[0]+a.x,f=c[1]+a.y,v=o[h][u],d=t.measureText(v).width,y=p-d/2,m=f-l/2,x={sw:{x:y,y:m+l},ne:{x:y+d,y:m}};K(s,x)||(s.push(x),y+=d/2,m+=l/2,t.fillText(v,y,m))}else for(var h=0,g=o.length;h<g;h++){var c=o[h].geometry._coordinates||o[h].geometry.coordinates,p=c[0]+a.x,f=c[1]+a.y,v=o[h][u];t.fillText(v,p,f)}t.restore()}},It={draw:function(t,e,i){var o=e instanceof n?e.get():e;t.fillStyle="white",t.textAlign="center",t.textBaseline="middle";for(var r=i.offset||{x:0,y:0},a=0,s=o.length;a<s;a++)if(o[a].geometry){var l=o[a].deg||i.deg,u=o[a].icon||i.icon,h=o[a].geometry._coordinates||o[a].geometry.coordinates,g=h[0],c=h[1];l&&(t.save(),t.translate(g,c),t.rotate(l*Math.PI/180),t.translate(-g,-c));var p=i._width||i.width||u.width,f=i._height||i.height||u.height;g=g-p/2+r.x,c=c-f/2+r.y,i.sx&&i.sy&&i.swidth&&i.sheight&&i.width&&i.height?t.drawImage(u,i.sx,i.sy,i.swidth,i.sheight,g,c,p,f):i.width&&i.height?t.drawImage(u,g,c,p,f):t.drawImage(u,g,c),l&&t.restore()}}};"undefined"!=typeof window&&requestAnimationFrame(tt);var Ot=function(){function t(e,i,o){rt(this,t),i instanceof n||(i=new n(i)),this.dataSet=i,this.map=e}return at(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(t){var e=this;if(e.intensity=new o({maxSize:e.options.maxSize,minSize:e.options.minSize,gradient:e.options.gradient,max:e.options.max||this.dataSet.getMax("count")}),e.category=new J(e.options.splitList),e.choropleth=new Q(e.options.splitList),void 0===e.options.splitList&&e.category.generateByDataSet(this.dataSet),void 0===e.options.splitList){var n=e.options.min||this.dataSet.getMin("count"),i=e.options.max||this.dataSet.getMax("count");e.choropleth.generateByMinMax(n,i)}}},{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,e=t&&!(t.enabled===!1);return e}},{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":ft.draw(t,e,o.options);break;case"grid":case"honeycomb":o.options.offset={x:i.x,y:i.y},"grid"==o.options.draw?vt.draw(t,e,o.options):dt.draw(t,e,o.options);break;case"text":Tt.draw(t,e,o.options);break;case"icon":It.draw(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),gt.draw(t,e,o.options),t.beginPath(),ht.drawDataSet(t,e,o.options),t.clip(),it(t),t.restore();break;default:"webgl"==o.options.context?Lt.draw(o.canvasLayer.canvas.getContext("webgl"),e,o.options):gt.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(),ht.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=this,i=t.options,o=n.options;for(var r in i)o[r]=i[r];n.init(o),e!==!1&&n.draw()}},{key:"setOptions",value:function(t){var e=this;e.init(t),e.draw()}},{key:"set",value:function(t){var e=this,n=this.getContext(),i=this.getDefaultContextConfig();for(var o in i)n[o]=i[o];e.init(t.options),e.draw()}},{key:"destroy",value:function(){this.unbindEvent(),this.hide()}},{key:"initAnimator",value:function(){var t=this,e=t.options.animation;if("time"==t.options.draw||t.isEnabledTime()){e.stepsRange||(e.stepsRange={start:this.dataSet.getMin("time")||0,end:this.dataSet.getMax("time")||0}),this.steps={step:e.stepsRange.start},t.animator=new Rt.Tween(this.steps).onUpdate(function(){t._canvasUpdate(this.step)}).repeat(1/0),this.addAnimatorEvent();var n=1e3*e.duration||5e3;t.animator.to({step:e.stepsRange.end},n),t.animator.start()}else t.animator&&t.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}(),Bt=function(t){function e(t,n,i){rt(this,e);var o=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i));o.map=t,o.options=i||{},o.dataSet=n,o.init(i);var r=new X({map:t,update:o._canvasUpdate.bind(o)});o.canvasLayer=r,o.transferToMercator();var a=o;return n.on("change",function(){a.transferToMercator(),r.draw()}),o.ctx=r.canvas.getContext("2d"),o.start(),o}return lt(e,t),at(e,[{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=this.map.getMapType().getProjection();if("bd09mc"!==this.options.coordType){var e=this.dataSet.get();e=this.dataSet.transferCoordinate(e,function(e){var n=t.lngLatToPoint({lng:e[0],lat:e[1]});return[n.x,n.y]},"coordinates","coordinates_mercator"),this.dataSet._set(e)}}},{key:"_canvasUpdate",value:function(){var t=this.ctx;if(t){var e=this.map,n=Math.pow(2,18-e.getZoom()),i=e.getMapType().getProjection(),o=i.lngLatToPoint(e.getCenter()),r=new BMap.Pixel(o.x-e.getSize().width/2*n,o.y+e.getSize().height/2*n);it(t);var a={fromColumn:"bd09mc"==this.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){if(t){var e=(t[0]-r.x)/n,i=(r.y-t[1])/n;return[e,i]}}};this.data=this.dataSet.get(a),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=this.options,i=0;i<e.length;i++)if("Point"===e[i].geometry.type){t.beginPath();var o=e[i].size||this.options.size,r=e[i].minSize||this.options.minSize||0;void 0===e[i]._size&&(e[i]._size=r),t.arc(e[i].geometry._coordinates[0],e[i].geometry._coordinates[1],e[i]._size,0,2*Math.PI,!0),t.closePath(),e[i]._size++,e[i]._size>o&&(e[i]._size=r),t.lineWidth=1,t.strokeStyle=e[i].strokeStyle||e[i]._strokeStyle||n.strokeStyle||"yellow",t.stroke();var a=e[i].fillStyle||e[i]._fillStyle||n.fillStyle;a&&(t.fillStyle=a,t.fill())}else if("LineString"===e[i].geometry.type){t.beginPath();var s=e[i].size||this.options.size||5,r=e[i].minSize||this.options.minSize||0;void 0===e[i]._index&&(e[i]._index=0);var l=e[i]._index;t.arc(e[i].geometry._coordinates[l][0],e[i].geometry._coordinates[l][1],s,0,2*Math.PI,!0),t.closePath(),e[i]._index++,e[i]._index>=e[i].geometry._coordinates.length&&(e[i]._index=0),t.lineWidth=n.lineWidth||1;var u=e[i].strokeStyle||n.strokeStyle,a=e[i].fillStyle||n.fillStyle||"yellow";t.fillStyle=a,t.fill(),u&&(t.strokeStyle=u,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()}}]),e}(Ot),Dt=function(t){function e(t,n,i){rt(this,e);var o=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i)),r=o;i=i||{},r.init(i),r.argCheck(i),r.transferToMercator();var a=o.canvasLayer=new X({map:t,context:o.context,paneName:i.paneName,mixBlendMode:i.mixBlendMode,enableMassClear:i.enableMassClear,zIndex:i.zIndex,update:function(){r._canvasUpdate()}});return n.on("change",function(){r.transferToMercator(),a.draw()}),o.clickEvent=o.clickEvent.bind(o),o.mousemoveEvent=o.mousemoveEvent.bind(o),o.bindEvent(),o}return lt(e,t),at(e,[{key:"clickEvent",value:function(t){var n=t.pixel;st(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"clickEvent",this).call(this,n,t)}},{key:"mousemoveEvent",value:function(t){var n=t.pixel;st(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mousemoveEvent",this).call(this,n,t)}},{key:"bindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&(e.setDefaultCursor("default"),e.addEventListener("click",this.clickEvent)),this.options.methods.mousemove&&e.addEventListener("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&e.removeEventListener("click",this.clickEvent),this.options.methods.mousemove&&e.removeEventListener("mousemove",this.mousemoveEvent))}},{key:"transferToMercator",value:function(){var t=this.map.getMapType().getProjection();if("bd09mc"!==this.options.coordType){var e=this.dataSet.get();e=this.dataSet.transferCoordinate(e,function(e){var n=t.lngLatToPoint({lng:e[0],lat:e[1]});return[n.x,n.y]},"coordinates","coordinates_mercator"),this.dataSet._set(e)}}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(t){if(this.canvasLayer){var e=this,n=e.options.animation,i=this.canvasLayer._map,o=Math.pow(2,18-i.getZoom()),r=i.getMapType().getProjection(),a=r.lngLatToPoint(i.getCenter()),s=new BMap.Pixel(a.x-i.getSize().width/2*o,a.y+i.getSize().height/2*o),l=this.getContext();
if(e.isEnabledTime()){if(void 0===t)return void it(l);"2d"==this.context&&(l.save(),l.globalCompositeOperation="destination-out",l.fillStyle="rgba(0, 0, 0, .1)",l.fillRect(0,0,l.canvas.width,l.canvas.height),l.restore())}else it(l);if("2d"==this.context)for(var u in e.options)l[u]=e.options[u];else l.clear(l.COLOR_BUFFER_BIT);if(!(e.options.minZoom&&i.getZoom()<e.options.minZoom||e.options.maxZoom&&i.getZoom()>e.options.maxZoom)){var h=1;"2d"!=this.context&&(h=this.canvasLayer.devicePixelRatio);var g={fromColumn:"bd09mc"==e.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){var e=(t[0]-s.x)/o*h,n=(s.y-t[1])/o*h;return[e,n]}};void 0!==t&&(g.filter=function(e){var i=n.trails||10;return!!(t&&e.time>t-i&&e.time<t)});var c=e.dataSet.get(g);this.processData(c);var p=i.pointToPixel(new BMap.Point(0,0));"m"==e.options.unit?(e.options.size&&(e.options._size=e.options.size/o),e.options.width&&(e.options._width=e.options.width/o),e.options.height&&(e.options._height=e.options.height/o)):(e.options._size=e.options.size,e.options._height=e.options.height,e.options._width=e.options.width),this.drawContext(l,c,e.options,p),e.options.updateCallback&&e.options.updateCallback(t)}}}},{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()}}]),e}(Ot),Ut="undefined"==typeof window?{}:window;Ut.google&&Ut.google.maps&&(et.prototype=new google.maps.OverlayView,et.DEFAULT_PANE_NAME_="overlayLayer",et.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]}(),et.prototype.requestAnimFrame_=Ut.requestAnimationFrame||Ut.webkitRequestAnimationFrame||Ut.mozRequestAnimationFrame||Ut.oRequestAnimationFrame||Ut.msRequestAnimationFrame||function(t){return Ut.setTimeout(t,1e3/60)},et.prototype.cancelAnimFrame_=Ut.cancelAnimationFrame||Ut.webkitCancelAnimationFrame||Ut.mozCancelAnimationFrame||Ut.oCancelAnimationFrame||Ut.msCancelAnimationFrame||function(t){},et.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)},et.prototype.setAnimate=function(t){this.isAnimated_=!!t,this.isAnimated_&&this.scheduleUpdate()},et.prototype.isAnimated=function(){return this.isAnimated_},et.prototype.setPaneName=function(t){this.paneName_=t,this.setPane_()},et.prototype.getPaneName=function(){return this.paneName_},et.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)}},et.prototype.setResizeHandler=function(t){this.resizeHandler_=t},et.prototype.setResolutionScale=function(t){"number"==typeof t&&(this.resolutionScale_=t,this.resize_())},et.prototype.setUpdateHandler=function(t){this.updateHandler_=t},et.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_())},et.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(Ut,this.requestAnimationFrameId_),this.requestAnimationFrameId_=null))},et.prototype.resize_=function(){if(this.isAdded_){var t=this.getMap(),e=t.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")}},et.prototype.draw=function(){this.repositionCanvas_()},et.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(),a=r.fromLatLngToDivPixel(n),s=-Math.round(this.canvasCssWidth_/2-a.x),l=-Math.round(this.canvasCssHeight_/2-a.y);this.canvas.style[et.CSS_TRANSFORM_]="translate("+s+"px,"+l+"px)",this.scheduleUpdate()},et.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_())},et.prototype.getTopLeft=function(){return this.topLeft_},et.prototype.scheduleUpdate=function(){this.isAdded_&&!this.requestAnimationFrameId_&&(this.requestAnimationFrameId_=this.requestAnimFrame_.call(Ut,this.requestUpdateFunction_))});var Zt=function(t){function e(t,n,i){rt(this,e);var o=ut(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,i)),r=o;i=i||{},r.init(i),r.argCheck(i);var a={map:t,animate:!1,updateHandler:function(){r._canvasUpdate()},resolutionScale:resolutionScale};o.canvasLayer=new et(a);return o.clickEvent=o.clickEvent.bind(o),o.mousemoveEvent=o.mousemoveEvent.bind(o),o.bindEvent(),o}return lt(e,t),at(e,[{key:"clickEvent",value:function(t){var n=t.pixel;st(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"clickEvent",this).call(this,n,t)}},{key:"mousemoveEvent",value:function(t){var n=t.pixel;st(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"mousemoveEvent",this).call(this,n,t)}},{key:"bindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&(e.setDefaultCursor("default"),e.addListener("click",this.clickEvent)),this.options.methods.mousemove&&e.addListener("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&e.removeListener("click",this.clickEvent),this.options.methods.mousemove&&e.removeListener("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(t){if(this.canvasLayer){var e=this,i=e.options.animation,o=this.getContext();if(e.isEnabledTime()){if(void 0===t)return void it(o);"2d"==this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else it(o);if("2d"==this.context)for(var r in e.options)o[r]=e.options[r];else o.clear(o.COLOR_BUFFER_BIT);if(!(e.options.minZoom&&s.getZoom()<e.options.minZoom||e.options.maxZoom&&s.getZoom()>e.options.maxZoom)){var a=1;"2d"!=this.context&&(a=this.canvasLayer.devicePixelRatio);var s=this.map,l=s.getProjection(),a=Math.pow(2,s.zoom)*resolutionScale,u=l.fromLatLngToPoint(this.canvasLayer.getTopLeft()),h={transferCoordinate:function(t){var e=new google.maps.LatLng(t[1],t[0]),n=l.fromLatLngToPoint(e),i={x:(n.x-u.x)*a,y:(n.y-u.y)*a};return[i.x,i.y]}};void 0!==t&&(h.filter=function(e){var n=i.trails||10;return!!(t&&e.time>t-n&&e.time<t)});var g=e.dataSet.get(h);this.processData(g);var c=new google.maps.LatLng(0,0),p=l.fromLatLngToPoint(c),f={x:(p.x-u.x)*a,y:(p.y-u.y)*a};"m"==e.options.unit&&e.options.size?e.options._size=e.options.size/zoomUnit:e.options._size=e.options.size,this.drawContext(o,new n(g),e.options,f),e.options.updateCallback&&e.options.updateCallback(t)}}}},{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),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()}}]),e}(Ot),Nt={getDataSet:function(t){for(var e=[],i=t.features,o=0;o<i.length;o++){var r=i[o],a=r.geometry,s=r.properties,l={};for(var u in s)l[u]=s[u];l.geometry=a,e.push(l)}return new n(e)}},jt={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=o[1];r.length&&r!==e&&i.push([]);var a;a=o[2]?o[2].replace(new RegExp('""',"g"),'"'):o[3],i[i.length-1].push(a)}return i},getDataSet:function(t){for(var e=this.CSVToArray(t,","),i=[],o=e[0],r=1;r<e.length-1;r++){for(var a=e[r],s={},l=0;l<a.length;l++){var u=a[l];"geometry"==o[l]&&(u=JSON.parse(u)),s[o[l]]=u}i.push(s)}return new n(i)}};t.version=nt,t.canvasClear=it,t.canvasResolutionScale=ot,t.canvasDrawSimple=gt,t.canvasDrawHeatmap=ft,t.canvasDrawGrid=vt,t.canvasDrawHoneycomb=dt,t.webglDrawSimple=Lt,t.webglDrawPoint=bt,t.webglDrawLine=xt,t.webglDrawPolygon=At,t.utilCityCenter=Pt,t.utilCurve=kt,t.utilForceEdgeBundling=Et,t.utilDataRangeIntensity=o,t.utilDataRangeCategory=J,t.utilDataRangeChoropleth=Q,t.Map=zt,t.baiduMapCanvasLayer=X,t.baiduMapAnimationLayer=Bt,t.baiduMapLayer=Dt,t.googleMapCanvasLayer=et,t.googleMapLayer=Zt,t.DataSet=n,t.geojson=Nt,t.csv=jt,Object.defineProperty(t,"__esModule",{value:!0})});