diff --git a/docs/dist/react-bmap.min.js b/docs/dist/react-bmap.min.js index 7966124..ce578ee 100644 --- a/docs/dist/react-bmap.min.js +++ b/docs/dist/react-bmap.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.ReactBMap=e(require("react"),require("react-dom")):t.ReactBMap=e(t.React,t.ReactDOM)}(this,function(t,e){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=6)}([function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;no&&(t[r]=256*o),t[r-3]=e[i],t[r-2]=e[i+1],t[r-1]=e[i+2]}function p(t,e,n){var i=n.max||100,o=n.min||0,r=n._size;void 0==r&&void 0==(r=n.size)&&(r=13);var a=new l({gradient:n.gradient,max:i,min:o}),s=u(r),c=s.width/2,p=s.height/2,f=e,h={};f.forEach(function(t,e){var n=void 0===t.count?1:t.count,o=Math.min(1,n/i).toFixed(2);h[o]=h[o]||[],h[o].push(t)});for(var d in h)if(!isNaN(d)){var g=h[d];t.beginPath(),n.withoutAlpha||(t.globalAlpha=d),t.strokeStyle=a.getColor(d*i),g.forEach(function(e,o){if(e.geometry){var r=e.geometry._coordinates||e.geometry.coordinates,a=e.geometry.type;if("Point"===a){var l=void 0===e.count?1:e.count;t.globalAlpha=l/i,t.drawImage(s,r[0]-c,r[1]-p)}else if("LineString"===a){var l=void 0===e.count?1:e.count;t.globalAlpha=l/i,t.beginPath(),wt.draw(t,e,n),t.stroke()}}})}}function f(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var i=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+i+")";var r=new s(t.canvas.width,t.canvas.height),a=r.getContext("2d");a.scale(Pt,Pt),n=n||{};var u=e instanceof o?e.get():e;t.save();var f=new l({gradient:n.gradient});if(p(a,u,n),!n.absolute){var h=a.getImageData(0,0,t.canvas.width,t.canvas.height);c(h.data,f.getImageData(),n),t.putImageData(h,0,0),t.restore()}f=null,r=null}}function h(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 d(t,e,n){var i=t.createShader(n);return t.shaderSource(i,e),t.compileShader(i),i}function g(t,e,n){var i=d(t,e,t.VERTEX_SHADER),o=d(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 y(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 v(t,e,n){if(e){var i=g(t,St,Ct);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=y(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 c=0,p=e.length;c1||d<-1||d>1||(u.push(h,d),c++)}var v=new Float32Array(u),m=c,b=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,b),t.bufferData(t.ARRAY_BUFFER,v,t.STATIC_DRAW),t.vertexAttribPointer(o,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o),t.vertexAttrib1f(r,n._size);var w=y(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 b(t,e,n){n=n||2;var i=e&&e.length,o=i?e[0]*n:t.length,r=w(t,0,o,n,!0),a=[];if(!r)return a;var s,l,u,c,p,f,h;if(i&&(r=C(t,e,r,n)),t.length>80*n){s=u=t[0],l=c=t[1];for(var d=n;du&&(u=p),f>c&&(c=f);h=Math.max(u-s,c-l)}return x(r,a,n,s,l,h),a}function w(t,e,n,i,o){var r,a;if(o===G(t,e,n,i)>0)for(r=e;r=e;r-=i)a=H(r,t[r],t[r+1],a);return a&&F(a,a.next)&&(V(a),a=a.next),a}function _(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!F(i,i.next)&&0!==I(i.prev,i,i.next))i=i.next;else{if(V(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function x(t,e,n,i,o,r,a){if(t){!a&&r&&T(t,i,o,r);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,r?O(t,i,o,r):M(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),V(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?(t=k(t,e,n),x(t,e,n,i,o,r,2)):2===a&&S(t,e,n,i,o,r):x(_(t),e,n,i,o,r,1);break}}}function M(t){var e=t.prev,n=t,i=t.next;if(I(e,n,i)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(B(e.x,e.y,n.x,n.y,i.x,i.y,o.x,o.y)&&I(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function O(t,e,n,i){var o=t.prev,r=t,a=t.next;if(I(o,r,a)>=0)return!1;for(var s=o.xr.x?o.x>a.x?o.x:a.x:r.x>a.x?r.x:a.x,c=o.y>r.y?o.y>a.y?o.y:a.y:r.y>a.y?r.y:a.y,p=A(s,l,e,n,i),f=A(u,c,e,n,i),h=t.nextZ;h&&h.z<=f;){if(h!==t.prev&&h!==t.next&&B(o.x,o.y,r.x,r.y,a.x,a.y,h.x,h.y)&&I(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=t.prevZ;h&&h.z>=p;){if(h!==t.prev&&h!==t.next&&B(o.x,o.y,r.x,r.y,a.x,a.y,h.x,h.y)&&I(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function k(t,e,n){var i=t;do{var o=i.prev,r=i.next.next;!F(o,r)&&U(o,i,i.next,r)&&W(o,r)&&W(r,o)&&(e.push(o.i/n),e.push(i.i/n),e.push(r.i/n),V(i),V(i.next),i=t=r),i=i.next}while(i!==t);return i}function S(t,e,n,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&D(a,s)){var l=q(a,s);return a=_(a,a.next),l=_(l,l.next),x(a,e,n,i,o,r),void x(l,e,n,i,o,r)}s=s.next}a=a.next}while(a!==t)}function C(t,e,n,i){var o,r,a,s,l,u=[];for(o=0,r=e.length;o=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.x&&i.x>=c&&B(rn.x)&&W(i,t)&&(n=i,f=l),i=i.next;return n}function T(t,e,n,i){var o=t;do{null===o.z&&(o.z=A(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,j(o)}function j(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;e0||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 A(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 R(t){var e=t,n=t;do{e.x=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(r-s)-(o-a)*(i-s)>=0}function D(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!N(t,e)&&W(t,e)&&W(e,t)&&Z(t,e)}function I(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function F(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,n,i){return!!(F(t,e)&&F(n,i)||F(t,i)&&F(n,e))||I(t,e,n)>0!=I(t,e,i)>0&&I(n,i,t)>0!=I(n,i,e)>0}function N(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&&U(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function W(t,e){return I(t.prev,t,t.next)<0?I(t,e,t.next)>=0&&I(t,t.prev,e)>=0:I(t,e,t.prev)<0||I(t,t.next,e)<0}function Z(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 q(t,e){var n=new Y(t.i,t.x,t.y),i=new Y(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 H(t,e,n,i){var o=new Y(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 V(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 Y(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 G(t,e,n,i){for(var o=0,r=e,a=n-i;r65536&&(t.bufferData(t.ARRAY_BUFFER,new Float32Array(u),t.STATIC_DRAW),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(c),t.STATIC_DRAW),t.drawElements(t.TRIANGLES,c.length,t.UNSIGNED_SHORT,0),u.length=0,c.length=0,p=0);for(var m=0;m0&&(n=n.concat(o))}return n}function K(t,e,n){if(!t||!e)return null;var i,o,r,a,s,l,u=function(t){return 1-2*t+t*t},c=function(t){return 2*t-2*t*t},p=function(t){return t*t},f=[],n=n||40,h=0,d=0;if(void 0===e)return void(void 0!==f&&(f=[]));var g=parseFloat(t.lat),y=parseFloat(e.lat),v=parseFloat(t.lng),m=parseFloat(e.lng);for(m>v&&parseFloat(m-v)>180&&v<0&&(v=parseFloat(360+v)),v>m&&parseFloat(v-m)>180&&m<0&&(m=parseFloat(360+m)),0,l=0,y==g?(i=0,o=v-m):m==v?(i=Math.PI/2,o=g-y):(i=Math.atan((y-g)/(m-v)),o=(y-g)/Math.sin(i)),0==l&&(l=i+Math.PI/5),r=o/2,s=r*Math.cos(l)+v,a=r*Math.sin(l)+g,h=0;ho&&i>r}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rt(t){requestAnimationFrame(rt),Wt.update(t)}function at(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function st(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}function lt(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)}function ut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ct(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}function pt(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)}function ft(t){function e(t,e){return function(){e.apply(t)}}this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=ft.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 ht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dt(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}function gt(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)}var yt=function(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)},vt=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)};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;in&&(n=o)}return n}},o.prototype.getSum=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=0,i=0;in&&(t=n),te&&(t=e),t1){var w=v-m,_=m+(vP*P+M*M&&(m=_+(1&y?1:-1)/2,y=x)}var O=m+"-"+y,k=p[O];k?k.push(i[f]):(k=p[O]=[i[f]],k.i=m,k.j=y,k.x=(m+(1&y?.5:0))*u,k.y=y*c)}var S=new l({max:n.max||100,maxSize:s,gradient:n.gradient});for(var r in p){var C=p[r];t.beginPath();for(var L=0;L<6;L++){var E=h({x:C.x+a.x,y:C.y+a.y},s,L);t.lineTo(E[0],E[1])}t.closePath();for(var z=0,f=0;f0&&(i+=t[o-1].length,n.holes.push(i))}return n};var jt=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),At=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),Rt={draw:X},Bt={draw:function(t,e,n){var i=e instanceof o?e.get():e;i.length>0&&("LineString"==i[0].geometry.type?Lt.draw(t,i,n):"Polygon"==i[0].geometry.type||"MultiPolygon"==i[0].geometry.type?Rt.draw(t,i,n):Tt.draw(t,i,n))}},Dt={getPoints:J},It=function(){function t(t,e){return t.x*e.x+t.y*e.y}function e(t){return{x:M[t.target].x-M[t.source].x,y:M[t.target].y-M[t.source].y}}function n(t){return Math.sqrt(Math.pow(M[t.source].x-M[t.target].x,2)+Math.pow(M[t.source].y-M[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){return{x:(M[t.source].x+M[t.target].x)/2,y:(M[t.source].y+M[t.target].y)/2}}function r(t){for(var e=0,n=1;nB||Math.abs(s.y)>B){var l=1/Math.pow(i({source:S[r[a]][e],target:S[t][e]}),1);o.x+=s.x*l,o.y+=s.y*l}}return o}function h(t,e,i){for(var o=C/(n(O[t])*(e+1)),r=[{x:0,y:0}],a=1;as;){var p=s/c,f=S[e][u-1].x,h=S[e][u-1].y;f+=p*(S[e][u].x-S[e][u-1].x),h+=p*(S[e][u].y-S[e][u-1].y),l.push({x:f,y:h}),c-=s,s=i}s-=c}l.push(M[O[e].target]),S[e]=l}}function g(i,o){return Math.abs(t(e(i),e(o))/(n(i)*n(o)))}function y(t,e){var i=(n(t)+n(e))/2;return 2/(i/Math.min(n(t),n(e))+Math.max(n(t),n(e))/i)}function v(t,e){var i=(n(t)+n(e))/2;return i/(i+a({x:(M[t.source].x+M[t.target].x)/2,y:(M[t.source].y+M[t.target].y)/2},{x:(M[e.source].x+M[e.target].x)/2,y:(M[e.source].y+M[e.target].y)/2}))}function m(t,e){var n=s(M[e.source],{source:M[t.source],target:M[t.target]}),i=s(M[e.target],{source:M[t.source],target:M[t.target]}),o={x:(n.x+i.x)/2,y:(n.y+i.y)/2},r={x:(M[t.source].x+M[t.target].x)/2,y:(M[t.source].y+M[t.target].y)/2};return Math.max(0,1-2*a(r,o)/a(n,i))}function b(t,e){return Math.min(m(t,e),m(e,t))}function w(t,e){return g(t,e)*y(t,e)*v(t,e)*b(t,e)}function _(t,e){return w(t,e)>=R}function x(){for(var t=0;t=n.length-1));r++);this.splitList.other=n[n.length-1]},Q.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+='
'+o+"
";return n.innerHTML=i,n},$.prototype.get=function(t){for(var e=this.splitList,n=!1,i=0;i=e[i].start)&&(void 0===e[i].end||void 0!==e[i].end&&t1?1:w,_=h(w);for(u in o)if(void 0!==i[u]){var x=i[u]||0,P=o[u];P instanceof Array?n[u]=d(P,_):("string"==typeof P&&(P="+"===P.charAt(0)||"-"===P.charAt(0)?x+parseFloat(P):parseFloat(P)),"number"==typeof P&&(n[u]=x+(P-x)*_))}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&&(c=!c),f=void 0!==e?t+e:t+p,!0}null!==b&&b.call(n,n);for(var O=0,k=g.length;O1?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=Wt.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=Wt.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[n1;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;return(2*e-2*n+r+a)*(o*s)+(-3*e+3*n-2*r-a)*s+r*o+e}}};var Zt={draw:function(t,e,n){var i=e instanceof o?e.get():e;t.save();for(var r in n)t[r]=n[r];var a=n.offset||{x:0,y:0},s=[],l=n._size||n.size;l?t.font="bold "+l+"px Arial":l=12;var u=n.textKey||"text";if(n.textAlign||(t.textAlign="center"),n.textBaseline||(t.textBaseline="middle"),n.avoid)for(var c=0,p=i.length;co&&(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}(Vt),Xt=function(){function t(t,e){for(var n=0;ne.options.maxZoom)){var c=1;"2d"!=this.context&&(c=this.canvasLayer.devicePixelRatio);var p={fromColumn:"bd09mc"==e.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){return[(t[0]-s.x)/o*c,(s.y-t[1])/o*c]}};void 0!==t&&(p.filter=function(e){var i=n.trails||10;return!!(t&&e.time>t-i&&e.timee.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()),c={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&&(c.filter=function(e){var i=n.trails||10;return!!(t&&e.time>t-i&&e.time0&&!0===this.props.autoViewport&&t.setViewport(e,this.props.viewportOptions)}}},{key:"getOverlay",value:function(){return null}},{key:"options",get:function(){return["strokeColor","fillColor","strokeWeight","strokeOpacity","fillOpacity","strokeStyle","enableMassClear","enableEditing","enableClicking"]}},{key:"events",get:function(){return["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"]}}]),e}(l.default);e.default=u},function(t,n){t.exports=e},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(7);Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return i(o).default}});var r=n(9);Object.defineProperty(e,"Marker",{enumerable:!0,get:function(){return i(r).default}});var a=n(11);Object.defineProperty(e,"InfoWindow",{enumerable:!0,get:function(){return i(a).default}});var s=n(12);Object.defineProperty(e,"NavigationControl",{enumerable:!0,get:function(){return i(s).default}});var l=n(13);Object.defineProperty(e,"OverviewMapControl",{enumerable:!0,get:function(){return i(l).default}});var u=n(14);Object.defineProperty(e,"ScaleControl",{enumerable:!0,get:function(){return i(u).default}});var c=n(15);Object.defineProperty(e,"MapTypeControl",{enumerable:!0,get:function(){return i(c).default}});var p=n(16);Object.defineProperty(e,"Circle",{enumerable:!0,get:function(){return i(p).default}});var f=n(17);Object.defineProperty(e,"Polyline",{enumerable:!0,get:function(){return i(f).default}});var h=n(18);Object.defineProperty(e,"Polygon",{enumerable:!0,get:function(){return i(h).default}});var d=n(19);Object.defineProperty(e,"Road",{enumerable:!0,get:function(){return i(d).default}});var g=n(23);Object.defineProperty(e,"Boundary",{enumerable:!0,get:function(){return i(g).default}});var y=n(24);Object.defineProperty(e,"MarkerList",{enumerable:!0,get:function(){return i(y).default}});var v=n(26);Object.defineProperty(e,"MapvMarkerList",{enumerable:!0,get:function(){return i(v).default}});var m=n(27);Object.defineProperty(e,"TrafficLayer",{enumerable:!0,get:function(){return i(m).default}});var b=n(28);Object.defineProperty(e,"Merge",{enumerable:!0,get:function(){return i(b).default}});var w=n(29);Object.defineProperty(e,"MapvLayer",{enumerable:!0,get:function(){return i(w).default}});var _=n(30);Object.defineProperty(e,"DrivingRoute",{enumerable:!0,get:function(){return i(_).default}});var x=n(31);Object.defineProperty(e,"PointLabel",{enumerable:!0,get:function(){return i(x).default}})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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}function a(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)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n0&&!1!==this.props.autoViewport&&this.props.map.setViewport(e,this.props.viewportOptions)}},{key:"getRoadGroup",value:function(t,e,n){var t=t,e=e,n=n,i={},o=[];if(e)for(var r=0;r1)for(var n=1;n3&&void 0!==arguments[3]?arguments[3]:{},r=t.getZoom(),a=o.lineWidth||5,s=void 0===o.level?1:o.level,l=null,u=0,c=0,p=[],f=[],h=[],d=0,g=0;return e.beginPath(),n.forEach(function(n,i){var r=null;l=null;for(var a=n.split(","),s=0;s=50&&(h.push(m),d%=50))}l=v,0===s?(r=r||v,e.moveTo(v.x,v.y)):(c>15||s>=a.length-2)&&(c=0,e.lineTo(v.x,v.y))}if(o.arrow&&i===n.length-1&&g<100){var _=p[Math.ceil(p.length/2)];for(var x in p)if(p[x].totalDepth>=g/2){_=p[x+1]?p[x+1]:p[x];break}var P=p[p.length-1];_.end=P.end,h=[],h.push(_)}}),o.line&&(e.lineCap=o.lineCap||"round",e.lineJoin="round",o.border&&(e.strokeStyle=o.border.color||"white",e.lineWidth=(r<=13?a-2:a)+(2*o.border.lineWidth||4),e.stroke()),e.strokeStyle=o.color||i[s]||"#fc2c2b",e.lineWidth=r<=13?a-2:a,e.stroke()),o.arrow&&this.drawArrow(e,h,o),f},drawArrow:function(t,e,n){t.beginPath(),e.forEach(function(i){var o=i.start.x,r=i.start.y,a=i.end.x,s=i.end.y,l=a-o,u=s-r,c=[0,-1],p=[i.end.x-i.start.x,i.end.y-i.start.y],f=c[0]*p[0]+c[1]*p[1],h=Math.sqrt(c[0]*c[0]+c[1]*c[1]),d=Math.sqrt(p[0]*p[0]+p[1]*p[1]),g=Math.acos(f/(h*d));p[0]<0&&(g=2*Math.PI-g);for(var y=n.arrow.width/2||2,v=n.arrow.height||y,m=0;i.offset+50*m<=i.depth;){var b=i.offset+50*m,w=b/i.depth;t.save(),t.translate(o+l*w,r+u*w),t.rotate(g),t.moveTo(1.618*-y,v),t.lineTo(0,0),t.lineTo(1.618*y,v),t.restore(),m+=1}1===e.length&&i.offset>i.depth&&(t.save(),t.translate(o,r),t.rotate(g),t.moveTo(1.618*-y,v),t.lineTo(0,0),t.lineTo(1.618*y,v),t.restore())}),t.strokeStyle="#fff",t.lineWidth=3,t.stroke()}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={mergeRoadPath:function(t,e){for(var n=[],i=0;i=Math.min(o.lng,r.lng)&&t.lng<=Math.max(o.lng,r.lng)&&t.lat>=Math.min(o.lat,r.lat)&&t.lat<=Math.max(o.lat,r.lat)){var a=(o.lng-t.lng)*(r.lat-t.lat)-(r.lng-t.lng)*(o.lat-t.lat),s=2e-10;if(s=2e-9,a-s)return!0}}return!1}};e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0&&!1!==i.props.autoViewport&&n.setViewport(o,i.props.viewportOptions)}}var e=this.props.data,n=this.props.map;if(e){this._request={};var i=this,o=new BMap.Boundary,r=[];e.forEach(function(t,e){i._request[t.name]=!1,i._backData[t.name]&&(r=r.concat(i._backData[t.name]),i._request[t.name]=!0)}),t(),e.forEach(function(e,n){i._request[e.name]||i._allRequest[e.name]||(i._allRequest[e.name]=!0,o.get(e.name,function(n){for(var o=[],a=0;a=10&&(n.isShowNumber=!1,n.size=10,n.strokeStyle=h,n.lineWidth=3,n.strokeOpacity=.4));var d=new f.default(n);d.addEventListener("click",function(e,n){t.props.onClick&&t.props.onClick(n-1)}),d.addEventListener("mouseover",function(e,n){t.props.onMouseOver&&t.props.onMouseOver(n-1)}),d.addEventListener("mouseout",function(e,n){t.props.onMouseOut&&t.props.onMouseOut(n-1)}),d.index=l,this.markers.push(d),s.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:a[l].count,text:a[l].text})}for(var g=this.markers.length;g--;)e.addOverlay(this.markers[g]);this.dataSet.set(s.splice(0,10)),this.setViewport()}}},{key:"setViewport",value:function(){var t=this.props.map;if(t){for(var e=this.props.data,n=t.getMapType().getProjection(),i=[],o=0;o0&&!1!==this.props.autoViewport&&t.setViewport(i,this.props.viewportOptions)}}}],[{key:"defaultProps",get:function(){return{autoViewport:!0}}}]),e}(u.default);e.default=h},function(t,e,n){"use strict";function i(t){this.options=t||{},this._point=t.point,this._fillColor=t.fillStyle||"#1495ff",this._size=t.size||30,this._lineWidth=void 0===t.lineWidth?2:t.lineWidth,this._strokeStyle=t.strokeStyle||"#ffffff",t.strokeOpacity&&(this._strokeStyle=o(this._strokeStyle,.4))}function o(t,e){var n=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,i=t.toLowerCase();if(i&&n.test(i)){if(4===i.length){for(var o="#",r=1;r<4;r+=1)o+=i.slice(r,r+1).concat(i.slice(r,r+1));i=o}for(var a=[],r=1;r<7;r+=2)a.push(parseInt("0x"+i.slice(r,r+2)));return e?(a.push(e),"rgba("+a.join(",")+")"):"rgb("+a.join(",")+")"}return i}Object.defineProperty(e,"__esModule",{value:!0}),i.prototype=new BMap.Overlay,i.prototype.initialize=function(t){this._map=t;var e=this._div=document.createElement("div"),n=e.style;n.position="absolute",n.backgroundClip="padding-box",n.zIndex=this.options.zIndex||BMap.Overlay.getZIndex(this._point.lat),n.backgroundColor=this._fillColor,!1!==this.options.isShowShadow&&(n.boxShadow="0 0 5px rgba(0, 0, 0, 0.5)"),n.border=this._lineWidth+"px solid "+this._strokeStyle,n.color="white",n.textShadow="0px 0px 5px #fff",n.width=this._size+"px",n.boxSizing="content-box",n.borderRadius="30px",n.height=this._size+"px",n.lineHeight=this._size+"px",n.fontSize="12px",n.cursor="pointer",n.textAlign="center",n.MozUserSelect="none",this.options.number&&!1!==this.options.isShowNumber&&(e.innerHTML=this.options.number);var i=this;return e.addEventListener("mouseover",function(){i.dispatchEvent("mouseover",i.options.number),n.backgroundColor="#1495ff"}),e.addEventListener("mouseout",function(){i.dispatchEvent("mouseout",i.options.number),n.backgroundColor=i._fillColor}),e.addEventListener("click",function(){i.dispatchEvent("click",i.options.number)}),t.getPanes().markerPane.appendChild(e),e},i.prototype.draw=function(){var t=this._map,e=t.pointToOverlayPixel(this._point);this._div.style.left=e.x-(this._size+this._lineWidth)/2+1+"px",this._div.style.top=e.y-(this._size+this._lineWidth)/2+"px"},e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0&&(t.forEach(function(t,l){var u=t.location.split(","),c=e.project.pointToLngLat(new BMap.Pixel(u[0],u[1]));s.push(c),l<10?(n.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:parseInt(t.count)}),i.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},id:l,count:parseInt(t.count),text:parseInt(l)+1}),o.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:parseInt(t.count),text:t.text})):(r.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},id:l,count:parseInt(t.count)}),a.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:parseInt(t.count)}))}),this.shadowSet.set(n),this.circleSet.set(i),this.textSet.set(o),this.numSet.set(i),this.otherSet.set(r),this.otherShadowSet.set(a),s.length>0&&!1!==this.props.autoViewport&&map.setViewport(s,self.props.viewportOptions))}},{key:"createLayers",value:function(){this._createLayer=!0;var t=this.map;this.project=t.getMapType().getProjection();var e=this,n=this.shadowSet=new u.DataSet([]),i=this.circleSet=new u.DataSet([]),o=this.textSet=new u.DataSet([]),r=this.numSet=new u.DataSet([]),a=this.otherSet=new u.DataSet([]),s=this.otherShadowSet=new u.DataSet([]);this.layers=[];var l={coordType:"bd09mc",splitList:{4:"#d53938",3:"#fe6261",2:"#ffb02d",other:"#80db69"},shadowBlur:10,size:5,max:30,methods:{click:function(t){t&&e.handleClick(t.id)},mousemove:function(t){a.update(function(t){t.fillStyle=null}),t?(e.isSmallPath=!0,e.props.map.setDefaultCursor("pointer"),a.update(function(t){t.fillStyle="#1495ff"},{id:t.id})):(e.isSmallPath=!1,e.isSmallPath||e.isBigPath||e.props.map.setDefaultCursor("auto"))}},draw:"category"},c={splitList:{4:"#d53938",3:"#fe6261",2:"#ffb02d",1:"#80db69"},styleType:"fill",globalAlpha:.4,coordType:"bd09mc",size:8,minSize:5,draw:"category"};if(this.layers.push(new u.baiduMapLayer(t,s,c)),this.layers.push(new u.baiduMapLayer(t,a,l)),!0===this.props.animation){var p={splitList:{4:"#d53938",3:"#fe6261",2:"#ffb02d",1:"#80db69"},styleType:"stroke",globalAlpha:.4,coordType:"bd09mc",size:20,minSize:10,draw:"category"};this.layers.push(new u.baiduMapAnimationLayer(t,n,p))}var f={splitList:{1:"#80db69",4:"#d53938",3:"#fe6261",2:"#ffb02d"},fillStyle:"red",coordType:"bd09mc",size:10,draw:"category",methods:{click:function(t){t&&e.handleClick(t.id)},mousemove:function(t){i.update(function(t){t.fillStyle=null}),t?(e.isBigPath=!0,e.map.setDefaultCursor("pointer"),i.update(function(t){t.fillStyle="#1495ff"},{id:t.id})):(e.isBigPath=!1,e.isBigPath||e.isSmallPath||e.map.setDefaultCursor("auto"))}}};this.layers.push(new u.baiduMapLayer(t,i,f));var h={coordType:"bd09mc",draw:"text",font:"13px Arial",fillStyle:"#ffffff",shadowColor:"#ffffff",shadowBlur:10};this.layers.push(new u.baiduMapLayer(t,r,h));var d={coordType:"bd09mc",font:"13px Arial",fillStyle:"#666",shadowColor:"#ffffff",shadowBlur:10,draw:"text",avoid:!0,textAlign:"left",offset:{x:10,y:0}};this.layers.push(new u.baiduMapLayer(t,o,d))}},{key:"render",value:function(){return null}}],[{key:"defaultProps",get:function(){return{autoViewport:!0}}}]),e}(l.default);e.default=c},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;nthis.minX&&t.lat>this.minY&&t.lngthis.minX&&t.minY>this.minY&&t.maxX=Math.min(o.lng,r.lng)&&t.lng<=Math.max(o.lng,r.lng)&&t.lat>=Math.min(o.lat,r.lat)&&t.lat<=Math.max(o.lat,r.lat)){var a=(o.lng-t.lng)*(r.lat-t.lat)-(r.lng-t.lng)*(o.lat-t.lat),s=2e-10;if(s=2e-9,a-s)return!0}}return!1},e.default=o},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;no&&(t[r]=256*o),t[r-3]=e[i],t[r-2]=e[i+1],t[r-1]=e[i+2]}function p(t,e,n){var i=n.max||100,o=n.min||0,r=n._size;void 0==r&&void 0==(r=n.size)&&(r=13);var a=new l({gradient:n.gradient,max:i,min:o}),s=u(r),c=s.width/2,p=s.height/2,f=e,h={};f.forEach(function(t,e){var n=void 0===t.count?1:t.count,o=Math.min(1,n/i).toFixed(2);h[o]=h[o]||[],h[o].push(t)});for(var d in h)if(!isNaN(d)){var g=h[d];t.beginPath(),n.withoutAlpha||(t.globalAlpha=d),t.strokeStyle=a.getColor(d*i),g.forEach(function(e,o){if(e.geometry){var r=e.geometry._coordinates||e.geometry.coordinates,a=e.geometry.type;if("Point"===a){var l=void 0===e.count?1:e.count;t.globalAlpha=l/i,t.drawImage(s,r[0]-c,r[1]-p)}else if("LineString"===a){var l=void 0===e.count?1:e.count;t.globalAlpha=l/i,t.beginPath(),wt.draw(t,e,n),t.stroke()}}})}}function f(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var i=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+i+")";var r=new s(t.canvas.width,t.canvas.height),a=r.getContext("2d");a.scale(Pt,Pt),n=n||{};var u=e instanceof o?e.get():e;t.save();var f=new l({gradient:n.gradient});if(p(a,u,n),!n.absolute){var h=a.getImageData(0,0,t.canvas.width,t.canvas.height);c(h.data,f.getImageData(),n),t.putImageData(h,0,0),t.restore()}f=null,r=null}}function h(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 d(t,e,n){var i=t.createShader(n);return t.shaderSource(i,e),t.compileShader(i),i}function g(t,e,n){var i=d(t,e,t.VERTEX_SHADER),o=d(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 y(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 v(t,e,n){if(e){var i=g(t,St,Ct);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=y(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 c=0,p=e.length;c1||d<-1||d>1||(u.push(h,d),c++)}var v=new Float32Array(u),m=c,b=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,b),t.bufferData(t.ARRAY_BUFFER,v,t.STATIC_DRAW),t.vertexAttribPointer(o,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o),t.vertexAttrib1f(r,n._size);var w=y(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 b(t,e,n){n=n||2;var i=e&&e.length,o=i?e[0]*n:t.length,r=w(t,0,o,n,!0),a=[];if(!r)return a;var s,l,u,c,p,f,h;if(i&&(r=C(t,e,r,n)),t.length>80*n){s=u=t[0],l=c=t[1];for(var d=n;du&&(u=p),f>c&&(c=f);h=Math.max(u-s,c-l)}return x(r,a,n,s,l,h),a}function w(t,e,n,i,o){var r,a;if(o===G(t,e,n,i)>0)for(r=e;r=e;r-=i)a=H(r,t[r],t[r+1],a);return a&&F(a,a.next)&&(V(a),a=a.next),a}function _(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!F(i,i.next)&&0!==I(i.prev,i,i.next))i=i.next;else{if(V(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function x(t,e,n,i,o,r,a){if(t){!a&&r&&T(t,i,o,r);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,r?O(t,i,o,r):M(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),V(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?(t=k(t,e,n),x(t,e,n,i,o,r,2)):2===a&&S(t,e,n,i,o,r):x(_(t),e,n,i,o,r,1);break}}}function M(t){var e=t.prev,n=t,i=t.next;if(I(e,n,i)>=0)return!1;for(var o=t.next.next;o!==t.prev;){if(B(e.x,e.y,n.x,n.y,i.x,i.y,o.x,o.y)&&I(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function O(t,e,n,i){var o=t.prev,r=t,a=t.next;if(I(o,r,a)>=0)return!1;for(var s=o.xr.x?o.x>a.x?o.x:a.x:r.x>a.x?r.x:a.x,c=o.y>r.y?o.y>a.y?o.y:a.y:r.y>a.y?r.y:a.y,p=A(s,l,e,n,i),f=A(u,c,e,n,i),h=t.nextZ;h&&h.z<=f;){if(h!==t.prev&&h!==t.next&&B(o.x,o.y,r.x,r.y,a.x,a.y,h.x,h.y)&&I(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=t.prevZ;h&&h.z>=p;){if(h!==t.prev&&h!==t.next&&B(o.x,o.y,r.x,r.y,a.x,a.y,h.x,h.y)&&I(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function k(t,e,n){var i=t;do{var o=i.prev,r=i.next.next;!F(o,r)&&U(o,i,i.next,r)&&W(o,r)&&W(r,o)&&(e.push(o.i/n),e.push(i.i/n),e.push(r.i/n),V(i),V(i.next),i=t=r),i=i.next}while(i!==t);return i}function S(t,e,n,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&D(a,s)){var l=q(a,s);return a=_(a,a.next),l=_(l,l.next),x(a,e,n,i,o,r),void x(l,e,n,i,o,r)}s=s.next}a=a.next}while(a!==t)}function C(t,e,n,i){var o,r,a,s,l,u=[];for(o=0,r=e.length;o=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.x&&i.x>=c&&B(rn.x)&&W(i,t)&&(n=i,f=l),i=i.next;return n}function T(t,e,n,i){var o=t;do{null===o.z&&(o.z=A(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,j(o)}function j(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;e0||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 A(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 R(t){var e=t,n=t;do{e.x=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(r-s)-(o-a)*(i-s)>=0}function D(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!N(t,e)&&W(t,e)&&W(e,t)&&Z(t,e)}function I(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function F(t,e){return t.x===e.x&&t.y===e.y}function U(t,e,n,i){return!!(F(t,e)&&F(n,i)||F(t,i)&&F(n,e))||I(t,e,n)>0!=I(t,e,i)>0&&I(n,i,t)>0!=I(n,i,e)>0}function N(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&&U(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function W(t,e){return I(t.prev,t,t.next)<0?I(t,e,t.next)>=0&&I(t,t.prev,e)>=0:I(t,e,t.prev)<0||I(t,t.next,e)<0}function Z(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 q(t,e){var n=new Y(t.i,t.x,t.y),i=new Y(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 H(t,e,n,i){var o=new Y(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 V(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 Y(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 G(t,e,n,i){for(var o=0,r=e,a=n-i;r65536&&(t.bufferData(t.ARRAY_BUFFER,new Float32Array(u),t.STATIC_DRAW),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(c),t.STATIC_DRAW),t.drawElements(t.TRIANGLES,c.length,t.UNSIGNED_SHORT,0),u.length=0,c.length=0,p=0);for(var m=0;m0&&(n=n.concat(o))}return n}function K(t,e,n){if(!t||!e)return null;var i,o,r,a,s,l,u=function(t){return 1-2*t+t*t},c=function(t){return 2*t-2*t*t},p=function(t){return t*t},f=[],n=n||40,h=0,d=0;if(void 0===e)return void(void 0!==f&&(f=[]));var g=parseFloat(t.lat),y=parseFloat(e.lat),v=parseFloat(t.lng),m=parseFloat(e.lng);for(m>v&&parseFloat(m-v)>180&&v<0&&(v=parseFloat(360+v)),v>m&&parseFloat(v-m)>180&&m<0&&(m=parseFloat(360+m)),0,l=0,y==g?(i=0,o=v-m):m==v?(i=Math.PI/2,o=g-y):(i=Math.atan((y-g)/(m-v)),o=(y-g)/Math.sin(i)),0==l&&(l=i+Math.PI/5),r=o/2,s=r*Math.cos(l)+v,a=r*Math.sin(l)+g,h=0;ho&&i>r}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rt(t){requestAnimationFrame(rt),Wt.update(t)}function at(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function st(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}function lt(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)}function ut(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ct(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}function pt(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)}function ft(t){function e(t,e){return function(){e.apply(t)}}this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=ft.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 ht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dt(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}function gt(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)}var yt=function(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)},vt=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)};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;in&&(n=o)}return n}},o.prototype.getSum=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=0,i=0;in&&(t=n),te&&(t=e),t1){var w=v-m,_=m+(vP*P+M*M&&(m=_+(1&y?1:-1)/2,y=x)}var O=m+"-"+y,k=p[O];k?k.push(i[f]):(k=p[O]=[i[f]],k.i=m,k.j=y,k.x=(m+(1&y?.5:0))*u,k.y=y*c)}var S=new l({max:n.max||100,maxSize:s,gradient:n.gradient});for(var r in p){var C=p[r];t.beginPath();for(var L=0;L<6;L++){var E=h({x:C.x+a.x,y:C.y+a.y},s,L);t.lineTo(E[0],E[1])}t.closePath();for(var z=0,f=0;f0&&(i+=t[o-1].length,n.holes.push(i))}return n};var jt=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),At=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join(""),Rt={draw:X},Bt={draw:function(t,e,n){var i=e instanceof o?e.get():e;i.length>0&&("LineString"==i[0].geometry.type?Lt.draw(t,i,n):"Polygon"==i[0].geometry.type||"MultiPolygon"==i[0].geometry.type?Rt.draw(t,i,n):Tt.draw(t,i,n))}},Dt={getPoints:J},It=function(){function t(t,e){return t.x*e.x+t.y*e.y}function e(t){return{x:M[t.target].x-M[t.source].x,y:M[t.target].y-M[t.source].y}}function n(t){return Math.sqrt(Math.pow(M[t.source].x-M[t.target].x,2)+Math.pow(M[t.source].y-M[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){return{x:(M[t.source].x+M[t.target].x)/2,y:(M[t.source].y+M[t.target].y)/2}}function r(t){for(var e=0,n=1;nB||Math.abs(s.y)>B){var l=1/Math.pow(i({source:S[r[a]][e],target:S[t][e]}),1);o.x+=s.x*l,o.y+=s.y*l}}return o}function h(t,e,i){for(var o=C/(n(O[t])*(e+1)),r=[{x:0,y:0}],a=1;as;){var p=s/c,f=S[e][u-1].x,h=S[e][u-1].y;f+=p*(S[e][u].x-S[e][u-1].x),h+=p*(S[e][u].y-S[e][u-1].y),l.push({x:f,y:h}),c-=s,s=i}s-=c}l.push(M[O[e].target]),S[e]=l}}function g(i,o){return Math.abs(t(e(i),e(o))/(n(i)*n(o)))}function y(t,e){var i=(n(t)+n(e))/2;return 2/(i/Math.min(n(t),n(e))+Math.max(n(t),n(e))/i)}function v(t,e){var i=(n(t)+n(e))/2;return i/(i+a({x:(M[t.source].x+M[t.target].x)/2,y:(M[t.source].y+M[t.target].y)/2},{x:(M[e.source].x+M[e.target].x)/2,y:(M[e.source].y+M[e.target].y)/2}))}function m(t,e){var n=s(M[e.source],{source:M[t.source],target:M[t.target]}),i=s(M[e.target],{source:M[t.source],target:M[t.target]}),o={x:(n.x+i.x)/2,y:(n.y+i.y)/2},r={x:(M[t.source].x+M[t.target].x)/2,y:(M[t.source].y+M[t.target].y)/2};return Math.max(0,1-2*a(r,o)/a(n,i))}function b(t,e){return Math.min(m(t,e),m(e,t))}function w(t,e){return g(t,e)*y(t,e)*v(t,e)*b(t,e)}function _(t,e){return w(t,e)>=R}function x(){for(var t=0;t=n.length-1));r++);this.splitList.other=n[n.length-1]},Q.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+='
'+o+"
";return n.innerHTML=i,n},$.prototype.get=function(t){for(var e=this.splitList,n=!1,i=0;i=e[i].start)&&(void 0===e[i].end||void 0!==e[i].end&&t1?1:w,_=h(w);for(u in o)if(void 0!==i[u]){var x=i[u]||0,P=o[u];P instanceof Array?n[u]=d(P,_):("string"==typeof P&&(P="+"===P.charAt(0)||"-"===P.charAt(0)?x+parseFloat(P):parseFloat(P)),"number"==typeof P&&(n[u]=x+(P-x)*_))}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&&(c=!c),f=void 0!==e?t+e:t+p,!0}null!==b&&b.call(n,n);for(var O=0,k=g.length;O1?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=Wt.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=Wt.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[n1;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;return(2*e-2*n+r+a)*(o*s)+(-3*e+3*n-2*r-a)*s+r*o+e}}};var Zt={draw:function(t,e,n){var i=e instanceof o?e.get():e;t.save();for(var r in n)t[r]=n[r];var a=n.offset||{x:0,y:0},s=[],l=n._size||n.size;l?t.font="bold "+l+"px Arial":l=12;var u=n.textKey||"text";if(n.textAlign||(t.textAlign="center"),n.textBaseline||(t.textBaseline="middle"),n.avoid)for(var c=0,p=i.length;co&&(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}(Vt),Xt=function(){function t(t,e){for(var n=0;ne.options.maxZoom)){var c=1;"2d"!=this.context&&(c=this.canvasLayer.devicePixelRatio);var p={fromColumn:"bd09mc"==e.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){return[(t[0]-s.x)/o*c,(s.y-t[1])/o*c]}};void 0!==t&&(p.filter=function(e){var i=n.trails||10;return!!(t&&e.time>t-i&&e.timee.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()),c={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&&(c.filter=function(e){var i=n.trails||10;return!!(t&&e.time>t-i&&e.time0&&!0===this.props.autoViewport&&t.setViewport(e,this.props.viewportOptions)}}},{key:"getOverlay",value:function(){return null}},{key:"options",get:function(){return["strokeColor","fillColor","strokeWeight","strokeOpacity","fillOpacity","strokeStyle","enableMassClear","enableEditing","enableClicking"]}},{key:"events",get:function(){return["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"]}}]),e}(l.default);e.default=u},function(t,n){t.exports=e},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(7);Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return i(o).default}});var r=n(9);Object.defineProperty(e,"Marker",{enumerable:!0,get:function(){return i(r).default}});var a=n(11);Object.defineProperty(e,"InfoWindow",{enumerable:!0,get:function(){return i(a).default}});var s=n(12);Object.defineProperty(e,"NavigationControl",{enumerable:!0,get:function(){return i(s).default}});var l=n(13);Object.defineProperty(e,"OverviewMapControl",{enumerable:!0,get:function(){return i(l).default}});var u=n(14);Object.defineProperty(e,"ScaleControl",{enumerable:!0,get:function(){return i(u).default}});var c=n(15);Object.defineProperty(e,"MapTypeControl",{enumerable:!0,get:function(){return i(c).default}});var p=n(16);Object.defineProperty(e,"Circle",{enumerable:!0,get:function(){return i(p).default}});var f=n(17);Object.defineProperty(e,"Polyline",{enumerable:!0,get:function(){return i(f).default}});var h=n(18);Object.defineProperty(e,"Polygon",{enumerable:!0,get:function(){return i(h).default}});var d=n(19);Object.defineProperty(e,"Road",{enumerable:!0,get:function(){return i(d).default}});var g=n(23);Object.defineProperty(e,"Boundary",{enumerable:!0,get:function(){return i(g).default}});var y=n(24);Object.defineProperty(e,"MarkerList",{enumerable:!0,get:function(){return i(y).default}});var v=n(26);Object.defineProperty(e,"MapvMarkerList",{enumerable:!0,get:function(){return i(v).default}});var m=n(27);Object.defineProperty(e,"TrafficLayer",{enumerable:!0,get:function(){return i(m).default}});var b=n(28);Object.defineProperty(e,"Merge",{enumerable:!0,get:function(){return i(b).default}});var w=n(29);Object.defineProperty(e,"MapvLayer",{enumerable:!0,get:function(){return i(w).default}});var _=n(30);Object.defineProperty(e,"DrivingRoute",{enumerable:!0,get:function(){return i(_).default}});var x=n(31);Object.defineProperty(e,"PointLabel",{enumerable:!0,get:function(){return i(x).default}})},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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}function a(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)}Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t,e){for(var n=0;n0&&!1!==this.props.autoViewport&&this.props.map.setViewport(e,this.props.viewportOptions)}},{key:"getRoadGroup",value:function(t,e,n){var t=t,e=e,n=n,i={},o=[];if(e)for(var r=0;r1)for(var n=1;n3&&void 0!==arguments[3]?arguments[3]:{},r=t.getZoom(),a=o.lineWidth||5,s=void 0===o.level?1:o.level,l=null,u=0,c=0,p=[],f=[],h=[],d=0,g=0;return e.beginPath(),n.forEach(function(n,i){var r=null;l=null;for(var a=n.split(","),s=0;s=50&&(h.push(m),d%=50))}l=v,0===s?(r=r||v,e.moveTo(v.x,v.y)):(c>15||s>=a.length-2)&&(c=0,e.lineTo(v.x,v.y))}if(o.arrow&&i===n.length-1&&g<100){var _=p[Math.ceil(p.length/2)];for(var x in p)if(p[x].totalDepth>=g/2){_=p[x+1]?p[x+1]:p[x];break}var P=p[p.length-1];_.end=P.end,h=[],h.push(_)}}),o.line&&(e.lineCap=o.lineCap||"round",e.lineJoin="round",o.border&&(e.strokeStyle=o.border.color||"white",e.lineWidth=(r<=13?a-2:a)+(2*o.border.lineWidth||4),e.stroke()),e.strokeStyle=o.color||i[s]||"#fc2c2b",e.lineWidth=r<=13?a-2:a,e.stroke()),o.arrow&&this.drawArrow(e,h,o),f},drawArrow:function(t,e,n){t.beginPath(),e.forEach(function(i){var o=i.start.x,r=i.start.y,a=i.end.x,s=i.end.y,l=a-o,u=s-r,c=[0,-1],p=[i.end.x-i.start.x,i.end.y-i.start.y],f=c[0]*p[0]+c[1]*p[1],h=Math.sqrt(c[0]*c[0]+c[1]*c[1]),d=Math.sqrt(p[0]*p[0]+p[1]*p[1]),g=Math.acos(f/(h*d));p[0]<0&&(g=2*Math.PI-g);for(var y=n.arrow.width/2||2,v=n.arrow.height||y,m=0;i.offset+50*m<=i.depth;){var b=i.offset+50*m,w=b/i.depth;t.save(),t.translate(o+l*w,r+u*w),t.rotate(g),t.moveTo(1.618*-y,v),t.lineTo(0,0),t.lineTo(1.618*y,v),t.restore(),m+=1}1===e.length&&i.offset>i.depth&&(t.save(),t.translate(o,r),t.rotate(g),t.moveTo(1.618*-y,v),t.lineTo(0,0),t.lineTo(1.618*y,v),t.restore())}),t.strokeStyle="#fff",t.lineWidth=3,t.stroke()}};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={mergeRoadPath:function(t,e){for(var n=[],i=0;i=Math.min(o.lng,r.lng)&&t.lng<=Math.max(o.lng,r.lng)&&t.lat>=Math.min(o.lat,r.lat)&&t.lat<=Math.max(o.lat,r.lat)){var a=(o.lng-t.lng)*(r.lat-t.lat)-(r.lng-t.lng)*(o.lat-t.lat),s=2e-10;if(s=2e-9,a-s)return!0}}return!1}};e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0&&!1!==i.props.autoViewport&&n.setViewport(o,i.props.viewportOptions)}}var e=this.props.data,n=this.props.map;if(e){this._request={};var i=this,o=new BMap.Boundary,r=[];e.forEach(function(t,e){i._request[t.name]=!1,i._backData[t.name]&&(r=r.concat(i._backData[t.name]),i._request[t.name]=!0)}),t(),e.forEach(function(e,n){i._request[e.name]||i._allRequest[e.name]||(i._allRequest[e.name]=!0,o.get(e.name,function(n){for(var o=[],a=0;a=10&&(n.isShowNumber=!1,n.size=10,n.strokeStyle=h,n.lineWidth=3,n.strokeOpacity=.4));var d=new f.default(n);d.addEventListener("click",function(e,n){t.props.onClick&&t.props.onClick(n-1)}),d.addEventListener("mouseover",function(e,n){t.props.onMouseOver&&t.props.onMouseOver(n-1)}),d.addEventListener("mouseout",function(e,n){t.props.onMouseOut&&t.props.onMouseOut(n-1)}),d.index=l,this.markers.push(d),s.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:a[l].count,text:a[l].text})}for(var g=this.markers.length;g--;)e.addOverlay(this.markers[g]);this.dataSet.set(s.splice(0,10)),this.setViewport()}}},{key:"setViewport",value:function(){var t=this.props.map;if(t){for(var e=this.props.data,n=t.getMapType().getProjection(),i=[],o=0;o0&&!1!==this.props.autoViewport&&t.setViewport(i,this.props.viewportOptions)}}}],[{key:"defaultProps",get:function(){return{autoViewport:!0}}}]),e}(u.default);e.default=h},function(t,e,n){"use strict";function i(t){this.options=t||{},this._point=t.point,this._fillColor=t.fillStyle||"#1495ff",this._size=t.size||30,this._lineWidth=void 0===t.lineWidth?2:t.lineWidth,this._strokeStyle=t.strokeStyle||"#ffffff",t.strokeOpacity&&(this._strokeStyle=o(this._strokeStyle,.4))}function o(t,e){var n=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,i=t.toLowerCase();if(i&&n.test(i)){if(4===i.length){for(var o="#",r=1;r<4;r+=1)o+=i.slice(r,r+1).concat(i.slice(r,r+1));i=o}for(var a=[],r=1;r<7;r+=2)a.push(parseInt("0x"+i.slice(r,r+2)));return e?(a.push(e),"rgba("+a.join(",")+")"):"rgb("+a.join(",")+")"}return i}Object.defineProperty(e,"__esModule",{value:!0}),i.prototype=new BMap.Overlay,i.prototype.initialize=function(t){this._map=t;var e=this._div=document.createElement("div"),n=e.style;n.position="absolute",n.backgroundClip="padding-box",n.zIndex=this.options.zIndex||BMap.Overlay.getZIndex(this._point.lat),n.backgroundColor=this._fillColor,!1!==this.options.isShowShadow&&(n.boxShadow="0 0 5px rgba(0, 0, 0, 0.5)"),n.border=this._lineWidth+"px solid "+this._strokeStyle,n.color="white",n.textShadow="0px 0px 5px #fff",n.width=this._size+"px",n.boxSizing="content-box",n.borderRadius="30px",n.height=this._size+"px",n.lineHeight=this._size+"px",n.fontSize="12px",n.cursor="pointer",n.textAlign="center",n.MozUserSelect="none",this.options.number&&!1!==this.options.isShowNumber&&(e.innerHTML=this.options.number);var i=this;return e.addEventListener("mouseover",function(){i.dispatchEvent("mouseover",i.options.number),n.backgroundColor="#1495ff"}),e.addEventListener("mouseout",function(){i.dispatchEvent("mouseout",i.options.number),n.backgroundColor=i._fillColor}),e.addEventListener("click",function(){i.dispatchEvent("click",i.options.number)}),t.getPanes().markerPane.appendChild(e),e},i.prototype.draw=function(){var t=this._map,e=t.pointToOverlayPixel(this._point);this._div.style.left=e.x-(this._size+this._lineWidth)/2+1+"px",this._div.style.top=e.y-(this._size+this._lineWidth)/2+"px"},e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n0&&(t.forEach(function(t,l){var u=t.location.split(","),c=e.project.pointToLngLat(new BMap.Pixel(u[0],u[1]));s.push(c),l<10?(n.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:parseInt(t.count)}),i.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},id:l,count:parseInt(t.count),text:parseInt(l)+1}),o.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:parseInt(t.count),text:t.text})):(r.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},id:l,count:parseInt(t.count)}),a.push({geometry:{type:"Point",coordinates:[u[0],u[1]]},count:parseInt(t.count)}))}),this.shadowSet.set(n),this.circleSet.set(i),this.textSet.set(o),this.numSet.set(i),this.otherSet.set(r),this.otherShadowSet.set(a),s.length>0&&!1!==this.props.autoViewport&&map.setViewport(s,self.props.viewportOptions))}},{key:"createLayers",value:function(){this._createLayer=!0;var t=this.map;this.project=t.getMapType().getProjection();var e=this,n=this.shadowSet=new u.DataSet([]),i=this.circleSet=new u.DataSet([]),o=this.textSet=new u.DataSet([]),r=this.numSet=new u.DataSet([]),a=this.otherSet=new u.DataSet([]),s=this.otherShadowSet=new u.DataSet([]);this.layers=[];var l={coordType:"bd09mc",splitList:{4:"#d53938",3:"#fe6261",2:"#ffb02d",other:"#80db69"},shadowBlur:10,size:5,max:30,methods:{click:function(t){t&&e.handleClick(t.id)},mousemove:function(t){a.update(function(t){t.fillStyle=null}),t?(e.isSmallPath=!0,e.props.map.setDefaultCursor("pointer"),a.update(function(t){t.fillStyle="#1495ff"},{id:t.id})):(e.isSmallPath=!1,e.isSmallPath||e.isBigPath||e.props.map.setDefaultCursor("auto"))}},draw:"category"},c={splitList:{4:"#d53938",3:"#fe6261",2:"#ffb02d",1:"#80db69"},styleType:"fill",globalAlpha:.4,coordType:"bd09mc",size:8,minSize:5,draw:"category"};if(this.layers.push(new u.baiduMapLayer(t,s,c)),this.layers.push(new u.baiduMapLayer(t,a,l)),!0===this.props.animation){var p={splitList:{4:"#d53938",3:"#fe6261",2:"#ffb02d",1:"#80db69"},styleType:"stroke",globalAlpha:.4,coordType:"bd09mc",size:20,minSize:10,draw:"category"};this.layers.push(new u.baiduMapAnimationLayer(t,n,p))}var f={splitList:{1:"#80db69",4:"#d53938",3:"#fe6261",2:"#ffb02d"},fillStyle:"red",coordType:"bd09mc",size:10,draw:"category",methods:{click:function(t){t&&e.handleClick(t.id)},mousemove:function(t){i.update(function(t){t.fillStyle=null}),t?(e.isBigPath=!0,e.map.setDefaultCursor("pointer"),i.update(function(t){t.fillStyle="#1495ff"},{id:t.id})):(e.isBigPath=!1,e.isBigPath||e.isSmallPath||e.map.setDefaultCursor("auto"))}}};this.layers.push(new u.baiduMapLayer(t,i,f));var h={coordType:"bd09mc",draw:"text",font:"13px Arial",fillStyle:"#ffffff",shadowColor:"#ffffff",shadowBlur:10};this.layers.push(new u.baiduMapLayer(t,r,h));var d={coordType:"bd09mc",font:"13px Arial",fillStyle:"#666",shadowColor:"#ffffff",shadowBlur:10,draw:"text",avoid:!0,textAlign:"left",offset:{x:10,y:0}};this.layers.push(new u.baiduMapLayer(t,o,d))}},{key:"render",value:function(){return null}}],[{key:"defaultProps",get:function(){return{autoViewport:!0}}}]),e}(l.default);e.default=c},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;nthis.minX&&t.lat>this.minY&&t.lngthis.minX&&t.minY>this.minY&&t.maxX=Math.min(o.lng,r.lng)&&t.lng<=Math.max(o.lng,r.lng)&&t.lat>=Math.min(o.lat,r.lat)&&t.lat<=Math.max(o.lat,r.lat)){var a=(o.lng-t.lng)*(r.lat-t.lat)-(r.lng-t.lng)*(o.lat-t.lat),s=2e-10;if(s=2e-9,a-s)return!0}}return!1},e.default=o},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(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}function r(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n + ]} + changePosition={(point, index) => { + console.log(point, index); + }} + /> } } diff --git a/package.json b/package.json index f837698..4201aea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-bmap", - "version": "1.0.53", + "version": "1.0.54", "description": "react-bmap", "main": "lib/index.js", "contributors": [ diff --git a/src/components/point-label.js b/src/components/point-label.js index b11f0ba..fa8e309 100644 --- a/src/components/point-label.js +++ b/src/components/point-label.js @@ -64,6 +64,9 @@ export default class App extends Component { this.props.data.forEach((item, index) => { var tip = new DraggingTip({ isShowTipArrow: true, + changePosition: (point) => { + this.props.changePosition && this.props.changePosition(point, index); + }, map: map, numberDirection: item.numberDirection, isShowNumber: item.isShowNumber, diff --git a/src/overlay/DraggingTip.js b/src/overlay/DraggingTip.js index 78df245..710f01a 100644 --- a/src/overlay/DraggingTip.js +++ b/src/overlay/DraggingTip.js @@ -21,6 +21,9 @@ function DraggingTip(options) { tip.setPosition(marker.point) options.change && options.change(); }); + marker.addEventListener('dragend', function () { + options.changePosition && options.changePosition(self.point); + }); marker.enableDragging(); }