4 lines
205 KiB
JavaScript
4 lines
205 KiB
JavaScript
_jsload_('AMap.MoveAnimation', '!function(){"use strict";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function unwrapExports(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}var d1,d2,r,eventemitter=createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor};function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _uid=-1;var EventEmitter=function(){function EventEmitter(){if(!(this instanceof EventEmitter))throw new TypeError("Cannot call a class as a function");this.__events__={},this.__id__=++_uid}return _createClass(EventEmitter,[{key:"on",value:function(type,listener,context){for(var events=this.__events__,listeners=events[type]=events[type]||[],i=(context===this&&(context=void 0),-1),len=listeners;++i<len;){var _listeners$i=listeners[i],fn=_listeners$i.fn,_listeners$i=_listeners$i.ctx;if(fn===listener&&_listeners$i===context)return this}return listeners.push({fn:listener,ctx:context}),this}},{key:"once",value:function(type,listener,context){function onceCallback(ev){this.off(type,onceCallback),listener.call(this,ev)}return onceCallback.listener=listener,this.on(type,onceCallback,context)}},{key:"off",value:function(type,listener,context){var events=this.__events__;if(type)if(listener){var listeners=events[type];if(listeners)for(var i=listeners.length;0<=--i;){var _listeners$i2=listeners[i],fn=_listeners$i2.fn;_listeners$i2.ctx!==context||fn!==listener&&fn!==fn.listener||(listeners.splice(i,1),0)}}else delete events[type];else this.__events__={};return this}},{key:"emit",value:function(type,data){var listeners=this.__events__[type];if(listeners)for(var event=function(dest){for(var j=-1,len=arguments.length<=1?0:arguments.length-1;++j<len;){var i,src=arguments.length<=j+1?void 0:arguments[j+1];for(i in src)src.hasOwnProperty(i)&&(dest[i]=src[i])}return dest}({},data,{target:this,type:type}),i=-1,len=listeners.length;++i<len;){var _listeners$i3=listeners[i],fn=_listeners$i3.fn,_listeners$i3=_listeners$i3.ctx;fn.call(_listeners$i3||this,event)}return this}},{key:"events",get:function(){return this.__events__}},{key:"id",get:function(){return this.__id__}}]),EventEmitter}();exports.default=EventEmitter}),util=(unwrapExports(eventemitter),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};exports.default={remove:function(array,predicate){var result=[];if(array&&array.length&&"function"==typeof predicate){for(var index=-1,indexes=[],length=array.length;++index<length;){var value=array[index];predicate(value,index,array)&&(result.push(value),indexes.push(index))}!function(array,indexes){for(var length=array?indexes.length:0;0<length--;){var index=indexes[length];array.splice(index,1)}}(array,indexes)}return result},normalize:function normalize(arr){var options=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(arr))return arr;for(var _options$type=options.type,type=void 0===_options$type?"":_options$type,_options$type=options.range,_options$type=void 0===_options$type?[0,1]:_options$type,_options$min=options.min,min=void 0===_options$min?Math.min.apply(Math,arr):_options$min,_options$min=options.max,max=void 0===_options$min?Math.max.apply(Math,arr):_options$min,type=type.toLowerCase(),normalizationArr=[],diff=max-min,i=-1,len=arr.length;++i<len;){var v=arr[i],v2=void((v=max<v?max:v)<min&&(v=min)),v2="log"!==type?(v-min)/diff:Math.log10(v);normalizationArr.push(v2)}"log"===type&&(normalizationArr=normalize(normalizationArr));var options=_slicedToArray(_options$type,2),rMin=options[0],_options$min=options[1];if(0!==rMin||1!==_options$min){for(var _i=-1,_len=normalizationArr.length,_diff=_options$min-rMin,norArr=[];++_i<_len;){var _v=normalizationArr[_i];norArr.push(_diff*_v+rMin)}normalizationArr=norArr}return normalizationArr},forInMap:function(obj,callback){for(var key in obj)obj.hasOwnProperty(key)&&callback(obj[key],key,obj)}}})),animationframe=(unwrapExports(util),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),"performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1&&(offset=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now(),window.performance.now=function(){return Date.now()-offset});var offset,requestAnimationFrame="undefined"!=typeof window&&(window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(callback){setTimeout(callback,16)},cancelAnimationFrame="undefined"!=typeof window&&(window.cancelAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame)||function(timer){clearTimeout(timer)};exports.requestAnimationFrame=requestAnimationFrame,exports.cancelAnimationFrame=cancelAnimationFrame})),define=(unwrapExports(animationframe),animationframe.requestAnimationFrame,animationframe.cancelAnimationFrame,createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.Ev={UPDATE:"update",START:"start",REPEAT:"repeat",REPEAT_COMPLETE:"repeatComplete",AFTER_UPDATE:"afterUpdate",COMPLETE:"complete",PAUSE:"pause",STOP:"stop",RESET:"reset"},exports.Attr={DURATION:"duration",REPEAT:"repeat",DELAY:"delay",EASING:"easing",INTERVAL:"interval",YOYO:"yoyo",START:"startAt"},exports.Easing={LINEAR:"Linear",QUADRATIC_IN:"QuadraticIn",QUADRATIC_OUT:"QuadraticOut",QUADRATIC_IN_OUT:"QuadraticInOut",CUBIC_IN:"CubicIn",CUBIC_OUT:"CubicOut",CUBIC_IN_OUT:"CubicInOut",QUARTIC_IN:"QuarticIn",QUARTIC_OUT:"QuarticOut",QUARTIC_IN_OUT:"QuarticInOut",QUINTIC_IN:"QuinticIn",QUINTIC_OUT:"QuinticOut",QUINTIC_IN_OUT:"QuinticInOut",SINUSOIDAL_IN:"SinusoidalIn",SINUSOIDAL_OUT:"SinusoidalOut",SINUSOIDAL_IN_OUT:"SinusoidalInOut",EXPONENTIAL_IN:"ExponentialIn",EXPONENTIAL_OUT:"ExponentialOut",EXPONENTIAL_IN_OUT:"ExponentialInOut",CIRCULAR_IN:"CircularIn",CIRCULAR_OUT:"CircularOut",CIRCULAR_IN_OUT:"CircularInOut",ELASTIC_IN:"ElasticIn",ELASTIC_OUT:"ElasticOut",ELASTIC_IN_OUT:"ElasticInOut",BACK_IN:"BackIn",BACK_OUT:"BackOut",BACK_IN_OUT:"BackInOut",BOUNCE_IN:"BounceIn",BOUNCE_OUT:"BounceOut",BOUNCE_IN_OUT:"BounceInOut"}})),animation=(unwrapExports(define),define.Ev,define.Attr,define.Easing,createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor};function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _eventemitter2=_interopRequireDefault(eventemitter),_util2=_interopRequireDefault(util);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var remove=_util2.default.remove,forInMap=_util2.default.forInMap,_util2=function(_EventEmitter){var subClass=Animation;if("function"!=typeof _EventEmitter&&null!==_EventEmitter)throw new TypeError("Super expression must either be null or a function, not "+typeof _EventEmitter);function Animation(options){var _this;if(this instanceof Animation)return(_this=function(self,call){if(self)return!call||"object"!=typeof call&&"function"!=typeof call?self:call;throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called")}(this,(Animation.__proto__||Object.getPrototypeOf(Animation)).call(this)))._options={},_this._savedClipMap={},_this._clips=[],_this._clipMap={},_this._options=options||{},_this;throw new TypeError("Cannot call a class as a function")}return subClass.prototype=Object.create(_EventEmitter&&_EventEmitter.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),_EventEmitter&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,_EventEmitter):subClass.__proto__=_EventEmitter),_createClass(Animation,[{key:"_startAni",value:function(){var _this2=this;this._timer=(0,animationframe.requestAnimationFrame)(function update(timestamp){_this2._timer=(0,animationframe.requestAnimationFrame)(update),_this2._update(timestamp)})}},{key:"_stopAni",value:function(){var timer=this._timer;return!(!timer||((0,animationframe.cancelAnimationFrame)(timer),this._timer=null))}},{key:"_update",value:function(timestamp){for(var clips=this._clips,i=(this.emit(define.Ev.UPDATE,{timestamp:timestamp}),0);i<clips.length;){var clip=clips[i];clip.update(timestamp)?i++:this._rmClip(clip)}this._clips=clips,this.emit(define.Ev.AFTER_UPDATE),0===clips.length&&(this._stopAni(),this.emit(define.Ev.COMPLETE))}},{key:"start",value:function(){var clips=this._clips,len=clips.length;if(!this._timer&&0!==len){this.emit(define.Ev.START);for(var i=-1;++i<len;)clips[i].start();this._startAni()}return this}},{key:"stop",value:function(){return this._stop(!1),this}},{key:"pause",value:function(){return this._stop(!0),this}},{key:"reset",value:function(){this._stop(!1,!0,!1);var savedMap=this._savedClipMap,list=[];return forInMap(savedMap,function(value){value.stop(!0),list.push(value)}),this._clips=list,this.emit(define.Ev.RESET),this}},{key:"_stop",value:function(pause,reset){var emit=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],clips=(this._stopAni(),this._clips),len=clips.length;if(len){for(var i=-1;++i<len;){var clip=clips[i];pause?clip.pause():clip.stop(reset)}emit&&this.emit(pause?define.Ev.PAUSE:define.Ev.STOP)}}},{key:"addClip",value:function(clips){for(var startClip=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i=-1,len=(clips=Array.isArray(clips)?clips:[clips]).length;++i<len;){var clip=clips[i];this._hasSavedClip(clip)||(this._addClip(clip),this._addSavedClip(clip),this._timer&&startClip&&clip.start())}return this}},{key:"_addClip",value:function(clip){var _c=this._clips;-1===_c.indexOf(clip)&&(_c.push(clip),clip._animation=this)}},{key:"_addSavedClip",value:function(clip){var clipMap=this._savedClipMap,id=clip.id;clipMap[id]!==clip&&((clipMap[id]=clip)._animation=this)}},{key:"removeClip",value:function(clip){var savedMap=this._savedClipMap;return clip?(this._rmClip(clip),this._rmSavedClip(clip),clip._animation=null):(forInMap(savedMap,function(value){value._animation=null}),this._clips=[],this._savedClipMap={}),this}},{key:"_rmClip",value:function(clip){remove(this._clips,function(c){return c===clip})}},{key:"_rmSavedClip",value:function(clip){this._hasSavedClip(clip)&&delete this._savedClipMap[clip.id]}},{key:"getClips",value:function(){return this._clips}},{key:"_hasSavedClip",value:function(clip){var id=clip.id,id=this._savedClipMap[id];return id&&id===clip}},{key:"_hasClip",value:function(clip){return-1!==this._clips.indexOf(clip)}},{key:"destroy",value:function(){this.off(),this._stopAni(),this.removeClip()}}]),Animation}(_eventemitter2.default);_util2.Event=define.Ev,exports.default=_util2})),easing=(unwrapExports(animation),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var Easing={Linear:function(k){return k},QuadraticIn:function(k){return k*k},QuadraticOut:function(k){return k*(2-k)},QuadraticInOut:function(k){return(k*=2)<1?.5*k*k:-.5*(--k*(k-2)-1)},CubicIn:function(k){return k*k*k},CubicOut:function(k){return--k*k*k+1},CubicInOut:function(k){return(k*=2)<1?.5*k*k*k:.5*((k-=2)*k*k+2)},QuarticIn:function(k){return k*k*k*k},QuarticOut:function(k){return 1- --k*k*k*k},QuarticInOut:function(k){return(k*=2)<1?.5*k*k*k*k:-.5*((k-=2)*k*k*k-2)},QuinticIn:function(k){return k*k*k*k*k},QuinticOut:function(k){return--k*k*k*k*k+1},QuinticInOut:function(k){return(k*=2)<1?.5*k*k*k*k*k:.5*((k-=2)*k*k*k*k+2)},SinusoidalIn:function(k){return 1-Math.cos(k*Math.PI/2)},SinusoidalOut:function(k){return Math.sin(k*Math.PI/2)},SinusoidalInOut:function(k){return.5*(1-Math.cos(Math.PI*k))},ExponentialIn:function(k){return 0===k?0:Math.pow(1024,k-1)},ExponentialOut:function(k){return 1===k?1:1-Math.pow(2,-10*k)},ExponentialInOut:function(k){return 0===k?0:1===k?1:(k*=2)<1?.5*Math.pow(1024,k-1):.5*(2-Math.pow(2,-10*(k-1)))},CircularIn:function(k){return 1-Math.sqrt(1-k*k)},CircularOut:function(k){return Math.sqrt(1- --k*k)},CircularInOut:function(k){return(k*=2)<1?-.5*(Math.sqrt(1-k*k)-1):.5*(Math.sqrt(1-(k-=2)*k)+1)},ElasticIn:function(k){var s,a=.1;return 0===k?0:1===k?1:(s=!a||a<1?(a=1,.1):.4*Math.asin(1/a)/(2*Math.PI),-(a*Math.pow(2,10*--k)*Math.sin((k-s)*(2*Math.PI)/.4)))},ElasticOut:function(k){var s,a=.1;return 0===k?0:1===k?1:(s=!a||a<1?(a=1,.1):.4*Math.asin(1/a)/(2*Math.PI),a*Math.pow(2,-10*k)*Math.sin((k-s)*(2*Math.PI)/.4)+1)},ElasticInOut:function(k){var s,a=.1;return 0===k?0:1===k?1:(s=!a||a<1?(a=1,.1):.4*Math.asin(1/a)/(2*Math.PI),(k*=2)<1?a*Math.pow(2,10*--k)*Math.sin((k-s)*(2*Math.PI)/.4)*-.5:a*Math.pow(2,-10*--k)*Math.sin((k-s)*(2*Math.PI)/.4)*.5+1)},BackIn:function(k){var s=1.70158;return k*k*((1+s)*k-s)},BackOut:function(k){var s=1.70158;return--k*k*((1+s)*k+s)+1},BackInOut:function(k){var s=2.5949095;return(k*=2)<1?k*k*((1+s)*k-s)*.5:.5*((k-=2)*k*((1+s)*k+s)+2)},BounceIn:function(k){return 1-Easing.BounceOut(1-k)},BounceOut:function(k){return k<1/2.75?7.5625*k*k:k<2/2.75?7.5625*(k-=1.5/2.75)*k+.75:k<2.5/2.75?7.5625*(k-=2.25/2.75)*k+.9375:7.5625*(k-=2.625/2.75)*k+.984375},BounceInOut:function(k){return k<.5?.5*Easing.BounceIn(2*k):.5*Easing.BounceOut(2*k-1)+.5}};exports.default=Easing})),Interpolation_1=(unwrapExports(easing),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var a,Interpolation={Linear:function(v,k){var m=v.length-1,f=m*k,i=Math.floor(f),fn=Interpolation.Utils.Linear;return k<0?fn(v[0],v[1],f):1<k?fn(v[m],v[m-1],m-f):fn(v[i],v[m<i+1?m:i+1],f-i)},Bezier:function(v,k){for(var b=0,n=v.length-1,pw=Math.pow,bn=Interpolation.Utils.Bernstein,i=0;i<=n;i++)b+=pw(1-k,n-i)*pw(k,i)*v[i]*bn(n,i);return b},CatmullRom:function(v,k){var m=v.length-1,f=m*k,i=Math.floor(f),fn=Interpolation.Utils.CatmullRom;return v[0]===v[m]?fn(v[((i=k<0?Math.floor(f=m*(1+k)):i)-1+m)%m],v[i],v[(i+1)%m],v[(i+2)%m],f-i):k<0?v[0]-(fn(v[0],v[0],v[1],v[1],-f)-v[0]):1<k?v[m]-(fn(v[m],v[m],v[m-1],v[m-1],f-m)-v[m]):fn(v[i?i-1:0],v[i],v[m<i+1?m:i+1],v[m<i+2?m:i+2],f-i)},Utils:{Linear:function(p0,p1,t){return(p1-p0)*t+p0},Bernstein:function(n,i){var fc=Interpolation.Utils.Factorial;return fc(n)/fc(i)/fc(n-i)},Factorial:(a=[1],function(n){var s=1;if(a[n])return a[n];for(var i=n;1<i;i--)s*=i;return a[n]=s}),CatmullRom:function(p0,p1,p2,p3,t){var p0=.5*(p2-p0),p3=.5*(p3-p1),t2=t*t;return(2*p1-2*p2+p0+p3)*(t*t2)+(-3*p1+3*p2-2*p0-p3)*t2+p0*t+p1}}};exports.default=Interpolation})),clip=(unwrapExports(Interpolation_1),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor};function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}var _eventemitter2=_interopRequireDefault(eventemitter),_easing2=_interopRequireDefault(easing),_Interpolation2=_interopRequireDefault(Interpolation_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}_eventemitter2=function(_EventEmitter){var subClass=Clip;if("function"!=typeof _EventEmitter&&null!==_EventEmitter)throw new TypeError("Super expression must either be null or a function, not "+typeof _EventEmitter);function Clip(options,attr){var _this;if(this instanceof Clip)return(_this=function(self,call){if(self)return!call||"object"!=typeof call&&"function"!=typeof call?self:call;throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called")}(this,(Clip.__proto__||Object.getPrototypeOf(Clip)).call(this)))._options={},_this._attr={},_this._startAt=0,_this._stopped=!0,_this._paused=!1,_this._startTime=0,_this._pauseStart=0,_this._pauseTime=0,_this._reversed=!1,_this._chainClips=[],_this._tracks=[],_this._interpolation=_Interpolation2.default.Linear,_this._options=options||{},_this._attr=attr,_this._initOption(options),_this._tracks=_this._transform(attr),_this;throw new TypeError("Cannot call a class as a function")}return subClass.prototype=Object.create(_EventEmitter&&_EventEmitter.prototype,{constructor:{value:subClass,enumerable:!1,writable:!0,configurable:!0}}),_EventEmitter&&(Object.setPrototypeOf?Object.setPrototypeOf(subClass,_EventEmitter):subClass.__proto__=_EventEmitter),_createClass(Clip,null,[{key:"registerPlugin",value:function(plugin){var type=plugin.type,plugins=this._plugins;plugins&&plugins[type]||(this._plugins=plugins||{},this._plugins[type]=plugin)}}]),_createClass(Clip,[{key:"_initOption",value:function(options){var easing=options[define.Attr.EASING]||define.Easing.LINEAR,easing=(this._easing=_easing2.default[easing]||easing,this._delay=options[define.Attr.DELAY]||0,options[define.Attr.DURATION]);this._duration=void 0===easing?1e3:easing,this._repeat_0=this._repeat=options[define.Attr.REPEAT]||1,this._interval=options[define.Attr.INTERVAL]||0,this._yoyo=options[define.Attr.YOYO]||!1,this._startAt=options[define.Attr.START]||0}},{key:"_transform",value:function(attr){var key,_plugins=this.constructor._plugins,_attrList=[];for(key in attr)if(attr.hasOwnProperty(key)){var type,value=attr[key];for(type in _plugins){var plugin=_plugins[type];if(plugin.test(value,key)){(value=plugin.parse(value,key)).__type__=plugin.type;break}}_attrList.push({key:key,value:value})}return _attrList}},{key:"start",value:function(force){var now=window.performance.now(),onceRepeat=!1;if(this._paused)this._pauseTime+=now-this._pauseStart,this._paused=!1;else{if(!force&&!this._stopped)return this;this._stopped=!(onceRepeat=!0),this._startTime=now+this._delay}this.emit(define.Ev.START);force=this._repeat;return 1<force&&force===this._repeat_0&&onceRepeat&&this.emit(define.Ev.REPEAT,{remain:0}),this}},{key:"stop",value:function(reset){return this._stopped||(this._stopped=!0,this._paused=!1,this._pauseTime=0,this._pauseStart=0,this.emit(define.Ev.STOP),this.stopChain()),reset&&(this._repeat=this._repeat_0),this}},{key:"pause",value:function(){return this._stopped||this._paused||(this._paused=!0,this._pauseStart=window.performance.now(),this.emit(define.Ev.PAUSE)),this}},{key:"update",value:function(time){var progress,_getProgress2,keyframe;return!!this._stopped||!!(this._paused||time&&time<this._startTime)||(time=time-this._pauseTime,progress=(_getProgress2=this._getProgress(time)).progress,_getProgress2=_getProgress2.elapsed,keyframe=this._updateAttr(progress,_getProgress2),this.emit(define.Ev.UPDATE,{progress:progress,keyframe:keyframe,elapsed:_getProgress2}),this._afterUpdate(time,_getProgress2))}},{key:"_getProgress",value:function(time){time=(time-this._startTime)/this._duration;return time+=this._startAt,time=Math.min(time,1),{progress:this._easing(this._reversed?1-time:time),elapsed:time}}},{key:"_updateAttr",value:function(progress,elapsed){for(var tracks=this._tracks,keyframe={},i=0,len=tracks.length;i<len;){var item=tracks[i++],key=item.key,item=item.value,type=item.__type__;item=type?this.constructor._plugins[type].valueOf(item,progress,elapsed,key):this._interpolation(item,progress),keyframe[key]=item}return keyframe}},{key:"_afterUpdate",value:function(time,elapsed){if(1!==elapsed)return!0;var elapsed=this._repeat,repeat_0=this._repeat_0;if(1<elapsed)return isFinite(elapsed)&&elapsed--,this._startTime=time+this._interval,this._startAt=0,this._yoyo&&(this._reversed=!this._reversed),this._repeat=elapsed,this.emit(define.Ev.REPEAT_COMPLETE,{repeat:elapsed}),this.emit(define.Ev.REPEAT,{remain:repeat_0-elapsed}),!0;this._stopped=!0,this._pauseTime=0,this._pauseStart=0,1<(this._repeat=repeat_0)&&this.emit(define.Ev.REPEAT_COMPLETE,{repeat:0}),this.emit(define.Ev.COMPLETE);for(var i=-1,chains=this._chainClips,len=chains.length,ani=this._animation;++i<len;){var clip=chains[i];ani&&ani._addClip(clip),clip.start()}return!1}},{key:"chain",value:function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return this._chainClips=args,this}},{key:"stopChain",value:function(){for(var i=-1,clips=this._chainClips,len=clips.length;++i<len;)clips[i].stop();return this}},{key:"destroy",value:function(){this.off(),this._stopped=!0,this._paused=!1,this._startTime=0,this._pauseTime=0,this._pauseStart=0,this._chainClips=[];var ani=this._animation;ani&&ani.removeClip(this),this._animation=null}}]),Clip}(_eventemitter2.default);_eventemitter2.Event=define.Ev,_eventemitter2.Attr=define.Attr,_eventemitter2.Easing=define.Easing,exports.default=_eventemitter2})),core=(unwrapExports(clip),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0}),exports.Clip=exports.Animation=void 0;var _animation2=_interopRequireDefault(animation),_clip2=_interopRequireDefault(clip);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={Animation:_animation2.default,Clip:_clip2.default},exports.Animation=_animation2.default,exports.Clip=_clip2.default})),csscolorparser=(unwrapExports(core),core.Clip,core.Animation,createCommonjsModule(function(module,exports){var kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function clamp_css_byte(i){return(i=Math.round(i))<0?0:255<i?255:i}function clamp_css_float(f){return f<0?0:1<f?1:f}function parse_css_int(str){return"%"===str[str.length-1]?clamp_css_byte(parseFloat(str)/100*255):clamp_css_byte(parseInt(str))}function parse_css_float(str){return"%"===str[str.length-1]?clamp_css_float(parseFloat(str)/100):clamp_css_float(parseFloat(str))}function css_hue_to_rgb(m1,m2,h){return h<0?h+=1:1<h&&--h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(2/3-h)*6:m1}try{exports.parseCSSColor=function(css_str){if((css_str=css_str.replace(/ /g,"").toLowerCase())in kCSSColorTable)return kCSSColorTable[css_str].slice();if("#"===css_str[0])return 4===css_str.length?0<=(iv=parseInt(css_str.substr(1),16))&&iv<=4095?[(3840&iv)>>4|(3840&iv)>>8,240&iv|(240&iv)>>4,15&iv|(15&iv)<<4,1]:null:7===css_str.length&&0<=(iv=parseInt(css_str.substr(1),16))&&iv<=16777215?[(16711680&iv)>>16,(65280&iv)>>8,255&iv,1]:null;var iv=css_str.indexOf("("),ep=css_str.indexOf(")");if(-1!==iv&&ep+1===css_str.length){var h,l,s,fname=css_str.substr(0,iv),params=css_str.substr(iv+1,ep-(iv+1)).split(","),alpha=1;switch(fname){case"rgba":if(4!==params.length)return null;alpha=parse_css_float(params.pop());case"rgb":return 3!==params.length?null:[parse_css_int(params[0]),parse_css_int(params[1]),parse_css_int(params[2]),alpha];case"hsla":if(4!==params.length)return null;alpha=parse_css_float(params.pop());case"hsl":return 3!==params.length?null:(h=(parseFloat(params[0])%360+360)%360/360,s=parse_css_float(params[1]),[clamp_css_byte(255*css_hue_to_rgb(s=2*(l=parse_css_float(params[2]))-(l=l<=.5?l*(s+1):l+s-l*s),l,h+1/3)),clamp_css_byte(255*css_hue_to_rgb(s,l,h)),clamp_css_byte(255*css_hue_to_rgb(s,l,h-1/3)),alpha]);default:return null}}return null}}catch(e){}})),colorhelper=(csscolorparser.parseCSSColor,createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var obj,_slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")},_csscolorparser2=(obj=csscolorparser)&&obj.__esModule?obj:{default:obj};var parseCSSColor=_csscolorparser2.default.parseCSSColor;function _clamp_css_byte(i){return(i=Math.round(i))<0?0:255<i?255:i}function _clamp_css_float(f){return f<0?0:1<f?1:f}var ColorHelper={isColor:function(color){if("string"==typeof color)return!!(0,_csscolorparser2.default)(color);if(Array.isArray(color)){for(var i=0,len=color.length;i<len;){var c=color[i++];if("string"!=typeof c)return!1;if(!parseCSSColor(c))return!1}return!0}return!1},toColorIncrease:function(inc){return[inc[0]||0,inc[1]||0,inc[2]||0,inc[3]||0]},toNormal:function(color){if(Array.isArray(color)){for(var colorArr=[],i=0,len=color.length;i<len;){var c=color[i++];if("string"!=typeof c)return null;c=parseCSSColor(c);if(!c)return null;colorArr.push(c)}return colorArr}return"string"==typeof color?parseCSSColor(color):null},toNormalArray:function(color){if(Array.isArray(color)){for(var colorArr=[],i=0,len=color.length;i<len;){var c=color[i++];if("string"!=typeof c)return null;c=parseCSSColor(c);if(!c)return null;colorArr.push(c)}return colorArr}return"string"==typeof color?[parseCSSColor(color)]:null},linearGradient:function(steps){var progress=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,interpolation=2<arguments.length&&void 0!==arguments[2]?arguments[2]:ColorHelper.Utils.Linear,m=steps.length-1,progress=m*progress,i=progress>>0,fn=interpolation;return function(p0,p1,t){var p0=_slicedToArray(p0,4),r0=p0[0],g0=p0[1],b0=p0[2],p0=p0[3],p1=_slicedToArray(p1,4),r1=p1[0],g1=p1[1],b1=p1[2],p1=p1[3];return[fn(r0,r1,t)>>0,fn(g0,g1,t)>>0,fn(b0,b1,t)>>0,fn(p0,p1,t)]}(steps[i],steps[m<1+i?m:1+i],progress-i)},mixColors:function(color,increase){var c=this.toNormal(color);return Array.isArray(increase)&&c?"rgba("+[(c=[_clamp_css_byte(c[0]+increase[0]||0),_clamp_css_byte(c[1]+increase[1]||0),_clamp_css_byte(c[2]+increase[2]||0),_clamp_css_float(c[3]+increase[3]||0)])[0],c[1],c[2],c[3]].join(",")+")":color},toRGBA:function(color){var alpha;return color&&3<=color.length?(alpha=void 0===color[3]?1:color[3],"rgba("+_clamp_css_byte(color[0])+","+_clamp_css_byte(color[1])+","+_clamp_css_byte(color[2])+","+_clamp_css_float(alpha)+")"):"transparent"},Utils:{Linear:function(p0,p1,t){return(p1-p0)*t+p0}}};exports.default=ColorHelper})),color=(unwrapExports(colorhelper),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var _clip2=_interopRequireDefault(clip),_colorhelper2=_interopRequireDefault(colorhelper);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var plugin={type:"color",test:function(value,key){return _colorhelper2.default.isColor(value)},parse:function(value,key){return _colorhelper2.default.toNormalArray(value)},valueOf:function(parsedValue,progress,elapsed,key){parsedValue=_colorhelper2.default.linearGradient(parsedValue,progress);return _colorhelper2.default.toRGBA(parsedValue)}};_clip2.default.registerPlugin(plugin),exports.default=plugin})),vector_1=(unwrapExports(color),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var ArrayCons="undefined"==typeof Float32Array?Array:Float32Array,vector={create:function(){var x=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,y=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,out=new ArrayCons(2);return out[0]=x,out[1]=y,out},copy:function(out,v){return out[0]=v[0],out[1]=v[1],out},clone:function(v){var out=new ArrayCons(2);return out[0]=v[0],out[1]=v[1],out},set:function(out,x,y){return out[0]=x,out[1]=y,out},add:function(out,v1,v2){return out[0]=v1[0]+v2[0],out[1]=v1[1]+v2[1],out},scaleAndAdd:function(out,v1,v2,scale){return out[0]=v1[0]+v2[0]*scale,out[1]=v1[1]+v2[1]*scale,out},sub:function(out,v1,v2){return out[0]=v1[0]-v2[0],out[1]=v1[1]-v2[1],out},length:function(v){return Math.sqrt(this.lengthSquare(v))},lengthSquare:function(v){return v[0]*v[0]+v[1]*v[1]},multiply:function(out,v1,v2){return out[0]=v1[0]*v2[0],out[1]=v1[1]*v2[1],out},divide:function(out,v1,v2){return out[0]=v1[0]/v2[0],out[1]=v1[1]/v2[1],out},dot:function(v1,v2){return v1[0]*v2[0]+v1[1]*v2[1]},scale:function(out,v,s){return out[0]=v[0]*s,out[1]=v[1]*s,out},normalize:function(out,v){var d=this.len(v);return 0===d?(out[0]=0,out[1]=0):(out[0]=v[0]/d,out[1]=v[1]/d),out},distance:function(v1,v2){return Math.sqrt(this.distanceSquare(v1,v2))},distanceSquare:function(v1,v2){return(v1[0]-v2[0])*(v1[0]-v2[0])+(v1[1]-v2[1])*(v1[1]-v2[1])},negate:function(out,v){return out[0]=-v[0],out[1]=-v[1],out},lerp:function(out,v1,v2,t){return out[0]=v1[0]+t*(v2[0]-v1[0]),out[1]=v1[1]+t*(v2[1]-v1[1]),out},applyTransform:function(out,v,m){var x=v[0],v=v[1];return out[0]=m[0]*x+m[2]*v+m[4],out[1]=m[1]*x+m[3]*v+m[5],out},min:function(out,v1,v2){return out[0]=Math.min(v1[0],v2[0]),out[1]=Math.min(v1[1],v2[1]),out},max:function(out,v1,v2){return out[0]=Math.max(v1[0],v2[0]),out[1]=Math.max(v1[1],v2[1]),out},getAngle:function(v1,v2){var angle=0;return angle=0!=v1[0]-v2[0]?Math.atan2(v1[1]-v2[1],v1[0]-v2[0]):angle}};vector.len=vector.length,vector.lenSquare=vector.lengthSquare,vector.dist=vector.distance,vector.distSquare=vector.distanceSquare,exports.default=vector})),color=(unwrapExports(vector_1),createCommonjsModule(function(module,exports){Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")},_clip2=_interopRequireDefault(clip),_vector2=_interopRequireDefault(vector_1);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var plugin={type:"coordinate-2d",test:function(value,key){var res=!1;if(Array.isArray(value))for(var i=-1,len=value.length;++i<len;){var _ref,item=value[i];Array.isArray(item)&&(item=(_ref=[+(item=_slicedToArray(item,2))[0],+(item=item[1])])[1],res="number"==typeof(_ref=_ref[0])&&"number"==typeof item&&isFinite(_ref)&&isFinite(item))}return res},parse:function(value,key){for(var path=[],i=-1,len=value.length;++i<len;){var item=value[i],item=_slicedToArray(item,2),item=[+item[0],+item[1]];path.push([item[0],item[1]])}return function(path){for(var angle,i=0,len=path.length,length=0,_path=[],steps=[];i<len-1;){var p0=path[i],p1=path[i+1],segmentLength=_vector2.default.distance(p0,p1);length+=segmentLength,angle=_vector2.default.getAngle(p1,p0),_path.push(p0),steps.push({length:length,segmentLength:segmentLength,segment:[p0.slice(),p1.slice()],path:_path.slice(),angle:angle}),i++}return steps.sum=length,steps}(path)},valueOf:function(steps,progress,elapsed,key){for(var current=steps.sum*progress,i=-1,len=steps.length,step=steps[0];++i<len;){var s=steps[i];if(current<=s.length){step=s;break}}var progress=_slicedToArray(step.segment,2),p0=progress[0],progress=progress[1],scale=(0==i?current:current-steps[i-1].length)/step.segmentLength,out=_vector2.default.create(),position=_vector2.default.create();return _vector2.default.sub(out,progress,p0),_vector2.default.scaleAndAdd(position,p0,out,scale),position.step=step,position}};_clip2.default.registerPlugin(plugin),exports.default=plugin})),color=(unwrapExports(color),createCommonjsModule(function(module){var Animation=core.Animation,Clip=core.Clip;module.exports.default={Animation:Animation,Clip:Clip},module.exports.Animation=Animation,module.exports.Clip=Clip})),chito_1=color.Animation,chito_2=color.Clip,projections={},color=function(){function Projection(id,project,unproject,getResolution){this.project=project,this.unproject=unproject,this.getResolution=getResolution,projections[id]=this}return Projection.prototype.moveWithPixel=function(lnglat,offsetPixel,zoom){var zoom=this.getResolution(zoom),offsetX=offsetPixel[0]*zoom,offsetPixel=offsetPixel[1]*zoom,zoom=this.project(lnglat[0],lnglat[1]);return this.unproject(zoom[0]+offsetX,zoom[1]+offsetPixel)},Projection.prototype.moveWithPos=function(lnglat,offsetPos){lnglat=this.project(lnglat[0],lnglat[1]),lnglat=[lnglat[0]+offsetPos[0],lnglat[1]+offsetPos[1]];return this.unproject(lnglat[0],lnglat[1])},Projection}(),ProjectionManager={getProjection:function(id){return projections[id]}};new color("EPSG:4326",function(lng,lat){return[lng,lat]},function(x,y){return[x,y]},function(zoom){return.703125/Math.pow(2,zoom)}),d1=Math.PI/180,d2=180/Math.PI,r=6378137,new color("EPSG:3857",function(lng,lat){lat=Math.max(Math.min(85.0511287798,lat),-85.0511287798);lng*=d1,lat*=d1,lat=Math.log(Math.tan(Math.PI/4+lat/2));return[lng*r,lat*r]},function(x,y){return[x/r*d2,(2*Math.atan(Math.exp(y/r))-Math.PI/2)*d2]},function(zoom){return 156543.03392804097/Math.pow(2,zoom)});var color="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,freeSelf=color||freeSelf||Function("return this")(),Symbol$1=freeSelf.Symbol,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeObjectToString=objectProto.toString,symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;var nativeObjectToString$1=Object.prototype.toString;var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(value){return null==value?void 0===value?undefinedTag:nullTag:(symToStringTag$1&&symToStringTag$1 in Object(value)?function(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{var unmasked=!(value[symToStringTag]=void 0)}catch(e){}var result=nativeObjectToString.call(value);return unmasked&&(isOwn?value[symToStringTag]=tag:delete value[symToStringTag]),result}:function(value){return nativeObjectToString$1.call(value)})(value)}function isObjectLike(value){return null!=value&&"object"==typeof value}var isArray=Array.isArray;function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function identity(value){return value}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(value){if(isObject(value))return(value=baseGetTag(value))==funcTag||value==genTag||value==asyncTag||value==proxyTag}var objectProto=freeSelf["__core-js_shared__"],maskSrcKey=(objectProto=/[^.]+$/.exec(objectProto&&objectProto.keys&&objectProto.keys.IE_PROTO||""))?"Symbol(src)_1."+objectProto:"";var funcToString=Function.prototype.toString;function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}var reIsHostCtor=/^\\[object .+?Constructor\\]$/,objectProto=Function.prototype,objectProto$2=Object.prototype,objectProto=objectProto.toString,objectProto$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+objectProto.call(objectProto$2).replace(/[\\\\^$.*+?()[\\]{}|]/g,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$");function baseIsNative(value){var func;return isObject(value)&&(func=value,!(maskSrcKey&&maskSrcKey in func))&&(isFunction(value)?reIsNative:reIsHostCtor).test(toSource(value))}function getNative(object,key){object=function(object,key){return null==object?void 0:object[key]}(object,key);return baseIsNative(object)?object:void 0}objectProto=getNative(freeSelf,"WeakMap");var nativeNow=Date.now;var func,count,lastCalled,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),setToString=(func=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:(value=string,function(){return value}),writable:!0});var value}:identity,lastCalled=count=0,function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,0<remaining){if(800<=++count)return arguments[0]}else count=0;return func.apply(void 0,arguments)}),MAX_SAFE_INTEGER=9007199254740991,reIsUint=/^(?:0|[1-9]\\d*)$/;function isIndex(value,length){var type=typeof value;return(length=null==length?MAX_SAFE_INTEGER:length)&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&-1<value&&value%1==0&&value<length}function baseAssignValue(object,key,value){"__proto__"==key&&defineProperty?defineProperty(object,key,{configurable:!0,enumerable:!0,value:value,writable:!0}):object[key]=value}function eq(value,other){return value===other||value!=value&&other!=other}var hasOwnProperty$2=Object.prototype.hasOwnProperty;function assignValue(object,key,value){var objValue=object[key];hasOwnProperty$2.call(object,key)&&eq(objValue,value)&&(void 0!==value||key in object)||baseAssignValue(object,key,value)}var nativeMax=Math.max;function overRest(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];for(var index=-1,otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),function(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}(func,this,otherArgs)}}var MAX_SAFE_INTEGER$1=9007199254740991;function isLength(value){return"number"==typeof value&&-1<value&&value%1==0&&value<=MAX_SAFE_INTEGER$1}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}var objectProto$4=Object.prototype;function isPrototype(value){var Ctor=value&&value.constructor;return value===("function"==typeof Ctor&&Ctor.prototype||objectProto$4)}function baseIsArguments(value){return isObjectLike(value)&&"[object Arguments]"==baseGetTag(value)}var objectProto$2=Object.prototype,hasOwnProperty$3=objectProto$2.hasOwnProperty,propertyIsEnumerable=objectProto$2.propertyIsEnumerable,isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty$3.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")};var objectProto$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=objectProto$2&&"object"==typeof module&&module&&!module.nodeType&&module,freeModule=freeModule&&freeModule.exports===objectProto$2?freeSelf.Buffer:void 0,isBuffer=(freeModule?freeModule.isBuffer:void 0)||function(){return!1},typedArrayTags={};typedArrayTags["[object Float32Array]"]=typedArrayTags["[object Float64Array]"]=typedArrayTags["[object Int8Array]"]=typedArrayTags["[object Int16Array]"]=typedArrayTags["[object Int32Array]"]=typedArrayTags["[object Uint8Array]"]=typedArrayTags["[object Uint8ClampedArray]"]=typedArrayTags["[object Uint16Array]"]=typedArrayTags["[object Uint32Array]"]=!0,typedArrayTags["[object Arguments]"]=typedArrayTags["[object Array]"]=typedArrayTags["[object ArrayBuffer]"]=typedArrayTags["[object Boolean]"]=typedArrayTags["[object DataView]"]=typedArrayTags["[object Date]"]=typedArrayTags["[object Error]"]=typedArrayTags["[object Function]"]=typedArrayTags["[object Map]"]=typedArrayTags["[object Number]"]=typedArrayTags["[object Object]"]=typedArrayTags["[object RegExp]"]=typedArrayTags["[object Set]"]=typedArrayTags["[object String]"]=typedArrayTags["[object WeakMap]"]=!1;var objectProto$2="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule$1=objectProto$2&&"object"==typeof module&&module&&!module.nodeType&&module,freeProcess=freeModule$1&&freeModule$1.exports===objectProto$2&&color.process,freeModule=function(){try{var types=freeModule$1&&freeModule$1.require&&freeModule$1.require("util").types;return types?types:freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),objectProto$2=freeModule&&freeModule.isTypedArray,isTypedArray=objectProto$2?function(func){return function(value){return func(value)}}(objectProto$2):function(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)]},hasOwnProperty$4=Object.prototype.hasOwnProperty;function arrayLikeKeys(value,inherited){var key,isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?function(n,iteratee){for(var index=-1,result=Array(n);++index<n;)result[index]=iteratee(index);return result}(value.length,String):[],length=result.length;for(key in value)!inherited&&!hasOwnProperty$4.call(value,key)||skipIndexes&&("length"==key||isBuff&&("offset"==key||"parent"==key)||isType&&("buffer"==key||"byteLength"==key||"byteOffset"==key)||isIndex(key,length))||result.push(key);return result}var nativeKeys=function(func,transform){return function(arg){return func(transform(arg))}}(Object.keys,Object),hasOwnProperty$5=Object.prototype.hasOwnProperty;function keys(object){return(isArrayLike(object)?arrayLikeKeys:function(object){if(!isPrototype(object))return nativeKeys(object);var key,result=[];for(key in Object(object))hasOwnProperty$5.call(object,key)&&"constructor"!=key&&result.push(key);return result})(object)}var hasOwnProperty$6=Object.prototype.hasOwnProperty,assign=function(assigner){return setToString(overRest(func=function(object,sources){var index=-1,length=sources.length,customizer=1<length?sources[length-1]:void 0,guard=2<length?sources[2]:void 0,customizer=3<assigner.length&&"function"==typeof customizer?(length--,customizer):void 0;for(guard&&function(value,index,object){var type;if(isObject(object))return("number"==(type=typeof index)?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)}(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object},start,identity),func+"");var func,start}(function(object,source){if(isPrototype(source)||isArrayLike(source))!function(source,props,object,customizer){for(var isNew=!object,index=(object=object||{},-1),length=props.length;++index<length;){var key=props[index],newValue=customizer?customizer(object[key],source[key],key,object,source):void 0;(isNew?baseAssignValue:assignValue)(object,key,newValue=void 0===newValue?source[key]:newValue)}}(source,keys(source),object);else for(var key in source)hasOwnProperty$6.call(source,key)&&assignValue(object,key,source[key])}),nativeCreate=getNative(Object,"create");var hasOwnProperty$7=Object.prototype.hasOwnProperty;var hasOwnProperty$8=Object.prototype.hasOwnProperty;function Hash(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}function assocIndexOf(array,key){for(var length=array.length;length--;)if(eq(array[length][0],key))return length;return-1}Hash.prototype.clear=function(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0},Hash.prototype.delete=function(key){return key=this.has(key)&&delete this.__data__[key],this.size-=key?1:0,key},Hash.prototype.get=function(key){var result,data=this.__data__;return nativeCreate?"__lodash_hash_undefined__"===(result=data[key])?void 0:result:hasOwnProperty$7.call(data,key)?data[key]:void 0},Hash.prototype.has=function(key){var data=this.__data__;return nativeCreate?void 0!==data[key]:hasOwnProperty$8.call(data,key)},Hash.prototype.set=function(key,value){var data=this.__data__;return this.size+=this.has(key)?0:1,data[key]=nativeCreate&&void 0===value?"__lodash_hash_undefined__":value,this};var splice=Array.prototype.splice;function ListCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}ListCache.prototype.clear=function(){this.__data__=[],this.size=0},ListCache.prototype.delete=function(key){var data=this.__data__;return!((key=assocIndexOf(data,key))<0||(key==data.length-1?data.pop():splice.call(data,key,1),--this.size,0))},ListCache.prototype.get=function(key){var data=this.__data__;return(key=assocIndexOf(data,key))<0?void 0:data[key][1]},ListCache.prototype.has=function(key){return-1<assocIndexOf(this.__data__,key)},ListCache.prototype.set=function(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this};var Map=getNative(freeSelf,"Map");function getMapData(map,key){var value,type,map=map.__data__;return("string"==(type=typeof(value=key))||"number"==type||"symbol"==type||"boolean"==type?"__proto__"!==value:null===value)?map["string"==typeof key?"string":"hash"]:map.map}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index<length;){var entry=entries[index];this.set(entry[0],entry[1])}}MapCache.prototype.clear=function(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}},MapCache.prototype.delete=function(key){return key=getMapData(this,key).delete(key),this.size-=key?1:0,key},MapCache.prototype.get=function(key){return getMapData(this,key).get(key)},MapCache.prototype.has=function(key){return getMapData(this,key).has(key)},MapCache.prototype.set=function(key,value){var data=getMapData(this,key),size=data.size;return data.set(key,value),this.size+=data.size==size?0:1,this};function Stack(entries){entries=this.__data__=new ListCache(entries);this.size=entries.size}Stack.prototype.clear=function(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function(key){var data=this.__data__,key=data.delete(key);return this.size=data.size,key},Stack.prototype.get=function(key){return this.__data__.get(key)},Stack.prototype.has=function(key){return this.__data__.has(key)},Stack.prototype.set=function(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<199)return pairs.push([key,value]),this.size=++data.size,this;data=this.__data__=new MapCache(pairs)}return data.set(key,value),this.size=data.size,this};var propertyIsEnumerable$1=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){if(null==object)return[];object=Object(object);for(var array=nativeGetSymbols(object),predicate=function(symbol){return propertyIsEnumerable$1.call(object,symbol)},index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}:function(){return[]};function getAllKeys(object){return function(object,keysFunc,symbolsFunc){if(keysFunc=keysFunc(object),isArray(object))return keysFunc;for(var array=keysFunc,values=symbolsFunc(object),index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}(object,keys,getSymbols)}var color=getNative(freeSelf,"DataView"),freeModule=getNative(freeSelf,"Promise"),objectProto$2=getNative(freeSelf,"Set"),dataViewCtorString=toSource(color),mapCtorString=toSource(Map),promiseCtorString=toSource(freeModule),setCtorString=toSource(objectProto$2),weakMapCtorString=toSource(objectProto),getTag=baseGetTag,getTag$1=getTag=color&&"[object DataView]"!=getTag(new color(new ArrayBuffer(1)))||Map&&"[object Map]"!=getTag(new Map)||freeModule&&"[object Promise]"!=getTag(freeModule.resolve())||objectProto$2&&"[object Set]"!=getTag(new objectProto$2)||objectProto&&"[object WeakMap]"!=getTag(new objectProto)?function(value){var result=baseGetTag(value),value="[object Object]"==result?value.constructor:void 0,value=value?toSource(value):"";if(value)switch(value){case dataViewCtorString:return"[object DataView]";case mapCtorString:return"[object Map]";case promiseCtorString:return"[object Promise]";case setCtorString:return"[object Set]";case weakMapCtorString:return"[object WeakMap]"}return result}:getTag,Uint8Array$1=freeSelf.Uint8Array;function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&arrLength<othLength))return!1;var othLength=stack.get(array),othStacked=stack.get(other);if(othLength&&othStacked)return othLength==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var compared,arrValue=array[index],othValue=other[index];if(void 0!==(compared=customizer?isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack):compared)){if(compared)continue;result=!1;break}if(seen){if(!function(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return 1}(other,function(othValue,othIndex){return!seen.has(othIndex)&&(arrValue===othValue||equalFunc(arrValue,othValue,bitmask,customizer,stack))&&seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var color=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=color?color.valueOf:void 0;var hasOwnProperty$9=Object.prototype.hasOwnProperty;var COMPARE_PARTIAL_FLAG$3=1,argsTag$2="[object Arguments]",arrayTag$1="[object Array]",objectTag$2="[object Object]",hasOwnProperty$a=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?arrayTag$1:getTag$1(object),othIsArr=othIsArr?arrayTag$1:getTag$1(other),objIsObj=(objTag=objTag==argsTag$2?objectTag$2:objTag)==objectTag$2,othIsObj=(othIsArr=othIsArr==argsTag$2?objectTag$2:othIsArr)==objectTag$2,othIsArr=objTag==othIsArr;if(othIsArr&&isBuffer(object)){if(!isBuffer(other))return!1;objIsObj=!(objIsArr=!0)}if(othIsArr&&!objIsObj)return stack=stack||new Stack,objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return object.byteLength==other.byteLength&&equalFunc(new Uint8Array$1(object),new Uint8Array$1(other))?!0:!1;case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":convert=convert||setToArray;if(object.size!=other.size&&!(1&bitmask))return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);stacked=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),stacked;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(bitmask&COMPARE_PARTIAL_FLAG$3)){objIsArr=objIsObj&&hasOwnProperty$a.call(object,"__wrapped__"),objTag=othIsObj&&hasOwnProperty$a.call(other,"__wrapped__");if(objIsArr||objTag)return equalFunc(objIsArr?object.value():object,objTag?other.value():other,bitmask,customizer,stack=stack||new Stack)}return othIsArr&&function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$9.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;for(var result=!0,skipCtor=(stack.set(object,other),stack.set(other,object),isPartial);++index<objLength;){var compared,objValue=object[key=objProps[index]],othValue=other[key];if(!(void 0===(compared=customizer?isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack):compared)?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor=skipCtor||"constructor"==key}return result&&!skipCtor&&(objStacked=object.constructor)!=(othStacked=other.constructor)&&"constructor"in object&&"constructor"in other&&!("function"==typeof objStacked&&objStacked instanceof objStacked&&"function"==typeof othStacked&&othStacked instanceof othStacked)&&(result=!1),stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack=stack||new Stack)}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function isEqual(value,other){return baseIsEqual(value,other)}var Coordinate_closestOnSegment=function(coordinate,segment){var x,x0=coordinate[0],coordinate=coordinate[1],start=segment[0],segment=segment[1],x1=start[0],start=start[1],x2=segment[0],segment=segment[1],dx=x2-x1,dy=segment-start,x0=0==dx&&0==dy?0:(dx*(x0-x1)+dy*(coordinate-start))/(dx*dx+dy*dy||0),coordinate=x0<=0?(x=x1,start):1<=x0?(x=x2,segment):(x=x1+x0*dx,start+x0*dy);return[x,coordinate]},Coordinate_containsCoordinate=function(coordinate,vertices,containBounds){for(var x=coordinate[0],y=coordinate[1],inside=!1,numVertices=vertices.length,i=0,j=numVertices-1;i<numVertices;j=i,i+=1){var intersect=!1,xi=vertices[i][0],yi=vertices[i][1],xj=vertices[j][0],yj=vertices[j][1];if(xi===x&&yi===y||xj===x&&yj===y)return!!containBounds;if(yi<y==y<=yj){xj=(xj-xi)*(y-yi)/(yj-yi)+xi;if(x===xj)return!!containBounds;intersect=x<xj}intersect&&(inside=!inside)}return inside},Pixel=function(){function Pixel(x,y,isRound){if(void 0===isRound&&(isRound=!1),this.className="AMap.Pixel",isNaN(x)||isNaN(y))throw new Error("Invalid Object: Pixel("+x+", "+y+")");this.x=isRound?Math.round(x):Number(x),this.y=isRound?Math.round(y):Number(y)}return Pixel.prototype.getX=function(){return this.x},Pixel.prototype.round=function(){return new Pixel(Math.round(this.x),Math.round(this.y))},Pixel.prototype.getY=function(){return this.y},Pixel.prototype.toString=function(){return this.x+","+this.y},Pixel.prototype.equals=function(point){return point instanceof Pixel&&Math.max(Math.abs(this.x-point.x),Math.abs(this.y-point.y))<=1e-9},Pixel.prototype.toArray=function(){return[this.x,this.y]},Pixel.prototype.subtract=function(other,isRound){return new Pixel(this.x-other.x,this.y-other.y,isRound)},Pixel.prototype.multiplyBy=function(num,noWrap){return new Pixel(this.x*num,this.y*num,noWrap)},Pixel.prototype.direction=function(){var angle,x=this.x,y=this.y;return 0===x&&0===y?null:0===x?0<y?90:270:(angle=180*Math.atan(y/x)/Math.PI,x<0&&0<y||x<0&&y<0?180+angle:0<x&&y<0?360+angle:angle)},Pixel.prototype.toJSON=function(){return[this.x,this.y]},Pixel}(),martinez=unwrapExports(createCommonjsModule(function(module,exports){!function(exports){function DEFAULT_COMPARE(a,b){return a>b?1:a<b?-1:0}var SplayTree=function SplayTree(compare,noDuplicates){if(compare===void 0)compare=DEFAULT_COMPARE;if(noDuplicates===void 0)noDuplicates=false;this._compare=compare;this._root=null;this._size=0;this._noDuplicates=!!noDuplicates},prototypeAccessors={size:{configurable:true}};function loadRecursive(parent,keys,values,start,end){var size=end-start;if(size>0){var middle=start+Math.floor(size/2);var key=keys[middle];var data=values[middle];var node={key:key,data:data,parent:parent};node.left=loadRecursive(node,keys,values,start,middle);node.right=loadRecursive(node,keys,values,middle+1,end);return node}return null}function sort(keys,values,left,right,compare){if(left>=right)return;var pivot=keys[left+right>>1];var i=left-1;var j=right+1;while(true){do{i++}while(compare(keys[i],pivot)<0);do{j--}while(compare(keys[j],pivot)>0);if(i>=j)break;var tmp=keys[i];keys[i]=keys[j];keys[j]=tmp;tmp=values[i];values[i]=values[j];values[j]=tmp}sort(keys,values,left,j,compare);sort(keys,values,j+1,right,compare)}SplayTree.prototype.rotateLeft=function rotateLeft(x){var y=x.right;if(y){x.right=y.left;if(y.left)y.left.parent=x;y.parent=x.parent}if(!x.parent)this._root=y;else if(x===x.parent.left)x.parent.left=y;else x.parent.right=y;if(y)y.left=x;x.parent=y},SplayTree.prototype.rotateRight=function rotateRight(x){var y=x.left;if(y){x.left=y.right;if(y.right)y.right.parent=x;y.parent=x.parent}if(!x.parent)this._root=y;else if(x===x.parent.left)x.parent.left=y;else x.parent.right=y;if(y)y.right=x;x.parent=y},SplayTree.prototype._splay=function _splay(x){while(x.parent){var p=x.parent;if(!p.parent)if(p.left===x)this.rotateRight(p);else this.rotateLeft(p);else if(p.left===x&&p.parent.left===p){this.rotateRight(p.parent);this.rotateRight(p)}else if(p.right===x&&p.parent.right===p){this.rotateLeft(p.parent);this.rotateLeft(p)}else if(p.left===x&&p.parent.right===p){this.rotateRight(p);this.rotateLeft(p)}else{this.rotateLeft(p);this.rotateRight(p)}}},SplayTree.prototype.splay=function splay(x){var p,gp,ggp,l,r;while(x.parent){p=x.parent;gp=p.parent;if(gp&&gp.parent){ggp=gp.parent;if(ggp.left===gp)ggp.left=x;else ggp.right=x;x.parent=ggp}else{x.parent=null;this._root=x}l=x.left;r=x.right;if(x===p.left){if(gp)if(gp.left===p){if(p.right){gp.left=p.right;gp.left.parent=gp}else gp.left=null;p.right=gp;gp.parent=p}else{if(l){gp.right=l;l.parent=gp}else gp.right=null;x.left=gp;gp.parent=x}if(r){p.left=r;r.parent=p}else p.left=null;x.right=p;p.parent=x}else{if(gp)if(gp.right===p){if(p.left){gp.right=p.left;gp.right.parent=gp}else gp.right=null;p.left=gp;gp.parent=p}else{if(r){gp.left=r;r.parent=gp}else gp.left=null;x.right=gp;gp.parent=x}if(l){p.right=l;l.parent=p}else p.right=null;x.left=p;p.parent=x}}},SplayTree.prototype.replace=function replace(u,v){if(!u.parent)this._root=v;else if(u===u.parent.left)u.parent.left=v;else u.parent.right=v;if(v)v.parent=u.parent},SplayTree.prototype.minNode=function minNode(u){if(u===void 0)u=this._root;if(u)while(u.left)u=u.left;return u},SplayTree.prototype.maxNode=function maxNode(u){if(u===void 0)u=this._root;if(u)while(u.right)u=u.right;return u},SplayTree.prototype.insert=function insert(key,data){var z=this._root;var p=null;var comp=this._compare;var cmp;if(this._noDuplicates)while(z){p=z;cmp=comp(z.key,key);if(cmp===0)return;else if(comp(z.key,key)<0)z=z.right;else z=z.left}else while(z){p=z;if(comp(z.key,key)<0)z=z.right;else z=z.left}z={key:key,data:data,left:null,right:null,parent:p};if(!p)this._root=z;else if(comp(p.key,z.key)<0)p.right=z;else p.left=z;this.splay(z);this._size++;return z},SplayTree.prototype.find=function find(key){var z=this._root;var comp=this._compare;while(z){var cmp=comp(z.key,key);if(cmp<0)z=z.right;else if(cmp>0)z=z.left;else return z}return null},SplayTree.prototype.contains=function contains(key){var node=this._root;var comparator=this._compare;while(node){var cmp=comparator(key,node.key);if(cmp===0)return true;else if(cmp<0)node=node.left;else node=node.right}return false},SplayTree.prototype.remove=function remove(key){var z=this.find(key);if(!z)return false;this.splay(z);if(!z.left)this.replace(z,z.right);else if(!z.right)this.replace(z,z.left);else{var y=this.minNode(z.right);if(y.parent!==z){this.replace(y,y.right);y.right=z.right;y.right.parent=y}this.replace(z,y);y.left=z.left;y.left.parent=y}this._size--;return true},SplayTree.prototype.removeNode=function removeNode(z){if(!z)return false;this.splay(z);if(!z.left)this.replace(z,z.right);else if(!z.right)this.replace(z,z.left);else{var y=this.minNode(z.right);if(y.parent!==z){this.replace(y,y.right);y.right=z.right;y.right.parent=y}this.replace(z,y);y.left=z.left;y.left.parent=y}this._size--;return true},SplayTree.prototype.erase=function erase(key){var z=this.find(key);if(!z)return;this.splay(z);var s=z.left;var t=z.right;var sMax=null;if(s){s.parent=null;sMax=this.maxNode(s);this.splay(sMax);this._root=sMax}if(t){if(s)sMax.right=t;else this._root=t;t.parent=sMax}this._size--},SplayTree.prototype.pop=function pop(){var node=this._root,returnValue=null;if(node){while(node.left)node=node.left;returnValue={key:node.key,data:node.data};this.remove(node.key)}return returnValue},SplayTree.prototype.next=function next(node){var successor=node;if(successor)if(successor.right){successor=successor.right;while(successor&&successor.left)successor=successor.left}else{successor=node.parent;while(successor&&successor.right===node){node=successor;successor=successor.parent}}return successor},SplayTree.prototype.prev=function prev(node){var predecessor=node;if(predecessor)if(predecessor.left){predecessor=predecessor.left;while(predecessor&&predecessor.right)predecessor=predecessor.right}else{predecessor=node.parent;while(predecessor&&predecessor.left===node){node=predecessor;predecessor=predecessor.parent}}return predecessor},SplayTree.prototype.forEach=function forEach(callback){var current=this._root;var s=[],done=false,i=0;while(!done)if(current){s.push(current);current=current.left}else if(s.length>0){current=s.pop();callback(current,i++);current=current.right}else done=true;return this},SplayTree.prototype.range=function range(low,high,fn,ctx){var Q=[];var compare=this._compare;var node=this._root,cmp;while(Q.length!==0||node)if(node){Q.push(node);node=node.left}else{node=Q.pop();cmp=compare(node.key,high);if(cmp>0)break;else if(compare(node.key,low)>=0)if(fn.call(ctx,node))return this;node=node.right}return this},SplayTree.prototype.keys=function keys(){var current=this._root;var s=[],r=[],done=false;while(!done)if(current){s.push(current);current=current.left}else if(s.length>0){current=s.pop();r.push(current.key);current=current.right}else done=true;return r},SplayTree.prototype.values=function values(){var current=this._root;var s=[],r=[],done=false;while(!done)if(current){s.push(current);current=current.left}else if(s.length>0){current=s.pop();r.push(current.data);current=current.right}else done=true;return r},SplayTree.prototype.at=function at(index){var current=this._root;var s=[],done=false,i=0;while(!done)if(current){s.push(current);current=current.left}else if(s.length>0){current=s.pop();if(i===index)return current;i++;current=current.right}else done=true;return null},SplayTree.prototype.load=function load(keys,values,presort){if(keys===void 0)keys=[];if(values===void 0)values=[];if(presort===void 0)presort=false;if(this._size!==0)throw new Error("bulk-load: tree is not empty");var size=keys.length;if(presort)sort(keys,values,0,size-1,this._compare);this._root=loadRecursive(null,keys,values,0,size);this._size=size;return this},SplayTree.prototype.min=function min(){var node=this.minNode(this._root);if(node)return node.key;else return null},SplayTree.prototype.max=function max(){var node=this.maxNode(this._root);if(node)return node.key;else return null},SplayTree.prototype.isEmpty=function isEmpty(){return this._root===null},prototypeAccessors.size.get=function(){return this._size},SplayTree.createTree=function createTree(keys,values,comparator,presort,noDuplicates){return new SplayTree(comparator,noDuplicates).load(keys,values,presort)},Object.defineProperties(SplayTree.prototype,prototypeAccessors);var NORMAL=0,NON_CONTRIBUTING=1,SAME_TRANSITION=2,DIFFERENT_TRANSITION=3,INTERSECTION=0,UNION=1,DIFFERENCE=2,XOR=3;function computeFields(event,prev,operation){if(prev===null){event.inOut=false;event.otherInOut=true}else{if(event.isSubject===prev.isSubject){event.inOut=!prev.inOut;event.otherInOut=prev.otherInOut}else{event.inOut=!prev.otherInOut;event.otherInOut=prev.isVertical()?!prev.inOut:prev.inOut}if(prev)event.prevInResult=!inResult(prev,operation)||prev.isVertical()?prev.prevInResult:prev}var isInResult=inResult(event,operation);if(isInResult)event.resultTransition=determineResultTransition(event,operation);else event.resultTransition=0}function inResult(event,operation){switch(event.type){case NORMAL:switch(operation){case INTERSECTION:return!event.otherInOut;case UNION:return event.otherInOut;case DIFFERENCE:return event.isSubject&&event.otherInOut||!event.isSubject&&!event.otherInOut;case XOR:return true}break;case SAME_TRANSITION:return operation===INTERSECTION||operation===UNION;case DIFFERENT_TRANSITION:return operation===DIFFERENCE;case NON_CONTRIBUTING:return false}return false}function determineResultTransition(event,operation){var thisIn=!event.inOut;var thatIn=!event.otherInOut;var isIn;switch(operation){case INTERSECTION:isIn=thisIn&&thatIn;break;case UNION:isIn=thisIn||thatIn;break;case XOR:isIn=thisIn^thatIn;break;case DIFFERENCE:if(event.isSubject)isIn=thisIn&&!thatIn;else isIn=thatIn&&!thisIn;break}return isIn?+1:-1}var SweepEvent=function SweepEvent(point,left,otherEvent,isSubject,edgeType){this.left=left;this.point=point;this.otherEvent=otherEvent;this.isSubject=isSubject;this.type=edgeType||NORMAL;this.inOut=false;this.otherInOut=false;this.prevInResult=null;this.resultTransition=0;this.otherPos=-1;this.outputContourId=-1;this.isExteriorRing=true},prototypeAccessors$1={inResult:{configurable:true}};function equals(p1,p2){if(p1[0]===p2[0])if(p1[1]===p2[1])return true;else return false;return false}SweepEvent.prototype.isBelow=function isBelow(p){var p0=this.point,p1=this.otherEvent.point;return this.left?(p0[0]-p[0])*(p1[1]-p[1])-(p1[0]-p[0])*(p0[1]-p[1])>0:(p1[0]-p[0])*(p0[1]-p[1])-(p0[0]-p[0])*(p1[1]-p[1])>0},SweepEvent.prototype.isAbove=function isAbove(p){return!this.isBelow(p)},SweepEvent.prototype.isVertical=function isVertical(){return this.point[0]===this.otherEvent.point[0]},prototypeAccessors$1.inResult.get=function(){return this.resultTransition!==0},SweepEvent.prototype.clone=function clone(){var copy=new SweepEvent(this.point,this.left,this.otherEvent,this.isSubject,this.type);copy.contourId=this.contourId;copy.resultTransition=this.resultTransition;copy.prevInResult=this.prevInResult;copy.isExteriorRing=this.isExteriorRing;copy.inOut=this.inOut;copy.otherInOut=this.otherInOut;return copy},Object.defineProperties(SweepEvent.prototype,prototypeAccessors$1);var epsilon=11102230246251565e-32,splitter=134217729,resulterrbound=(3+8*epsilon)*epsilon;function sum(elen,e,flen,f,h){var Q,Qnew,hh,bvirt;var enow=e[0];var fnow=f[0];var eindex=0;var findex=0;if(fnow>enow===fnow>-enow){Q=enow;enow=e[++eindex]}else{Q=fnow;fnow=f[++findex]}var hindex=0;if(eindex<elen&&findex<flen){if(fnow>enow===fnow>-enow){Qnew=enow+Q;hh=Q-(Qnew-enow);enow=e[++eindex]}else{Qnew=fnow+Q;hh=Q-(Qnew-fnow);fnow=f[++findex]}Q=Qnew;if(hh!==0)h[hindex++]=hh;while(eindex<elen&&findex<flen){if(fnow>enow===fnow>-enow){Qnew=Q+enow;bvirt=Qnew-Q;hh=Q-(Qnew-bvirt)+(enow-bvirt);enow=e[++eindex]}else{Qnew=Q+fnow;bvirt=Qnew-Q;hh=Q-(Qnew-bvirt)+(fnow-bvirt);fnow=f[++findex]}Q=Qnew;if(hh!==0)h[hindex++]=hh}}while(eindex<elen){Qnew=Q+enow;bvirt=Qnew-Q;hh=Q-(Qnew-bvirt)+(enow-bvirt);enow=e[++eindex];Q=Qnew;if(hh!==0)h[hindex++]=hh}while(findex<flen){Qnew=Q+fnow;bvirt=Qnew-Q;hh=Q-(Qnew-bvirt)+(fnow-bvirt);fnow=f[++findex];Q=Qnew;if(hh!==0)h[hindex++]=hh}if(Q!==0||hindex===0)h[hindex++]=Q;return hindex}function estimate(elen,e){var Q=e[0];for(var i=1;i<elen;i++)Q+=e[i];return Q}function vec(n){return commonjsGlobal.Float64Array?new Float64Array(n):new Array(n)}var ccwerrboundA=(3+16*epsilon)*epsilon,ccwerrboundB=(2+12*epsilon)*epsilon,ccwerrboundC=(9+64*epsilon)*epsilon*epsilon,B=vec(4),C1=vec(8),C2=vec(12),D=vec(16),u=vec(4);function orient2dadapt(ax,ay,bx,by,cx,cy,detsum){var acxtail,acytail,bcxtail,bcytail;var bvirt,c,ahi,alo,bhi,blo,_i,_j,_0,s1,s0,t1,t0,u3;var acx=ax-cx;var bcx=bx-cx;var acy=ay-cy;var bcy=by-cy;s1=acx*bcy;c=splitter*acx;ahi=c-(c-acx);alo=acx-ahi;c=splitter*bcy;bhi=c-(c-bcy);blo=bcy-bhi;s0=alo*blo-(s1-ahi*bhi-alo*bhi-ahi*blo);t1=acy*bcx;c=splitter*acy;ahi=c-(c-acy);alo=acy-ahi;c=splitter*bcx;bhi=c-(c-bcx);blo=bcx-bhi;t0=alo*blo-(t1-ahi*bhi-alo*bhi-ahi*blo);_i=s0-t0;bvirt=s0-_i;B[0]=s0-(_i+bvirt)+(bvirt-t0);_j=s1+_i;bvirt=_j-s1;_0=s1-(_j-bvirt)+(_i-bvirt);_i=_0-t1;bvirt=_0-_i;B[1]=_0-(_i+bvirt)+(bvirt-t1);u3=_j+_i;bvirt=u3-_j;B[2]=_j-(u3-bvirt)+(_i-bvirt);B[3]=u3;var det=estimate(4,B);var errbound=ccwerrboundB*detsum;if(det>=errbound||-det>=errbound)return det;bvirt=ax-acx;acxtail=ax-(acx+bvirt)+(bvirt-cx);bvirt=bx-bcx;bcxtail=bx-(bcx+bvirt)+(bvirt-cx);bvirt=ay-acy;acytail=ay-(acy+bvirt)+(bvirt-cy);bvirt=by-bcy;bcytail=by-(bcy+bvirt)+(bvirt-cy);if(acxtail===0&&acytail===0&&bcxtail===0&&bcytail===0)return det;errbound=ccwerrboundC*detsum+resulterrbound*Math.abs(det);det+=acx*bcytail+bcy*acxtail-(acy*bcxtail+bcx*acytail);if(det>=errbound||-det>=errbound)return det;s1=acxtail*bcy;c=splitter*acxtail;ahi=c-(c-acxtail);alo=acxtail-ahi;c=splitter*bcy;bhi=c-(c-bcy);blo=bcy-bhi;s0=alo*blo-(s1-ahi*bhi-alo*bhi-ahi*blo);t1=acytail*bcx;c=splitter*acytail;ahi=c-(c-acytail);alo=acytail-ahi;c=splitter*bcx;bhi=c-(c-bcx);blo=bcx-bhi;t0=alo*blo-(t1-ahi*bhi-alo*bhi-ahi*blo);_i=s0-t0;bvirt=s0-_i;u[0]=s0-(_i+bvirt)+(bvirt-t0);_j=s1+_i;bvirt=_j-s1;_0=s1-(_j-bvirt)+(_i-bvirt);_i=_0-t1;bvirt=_0-_i;u[1]=_0-(_i+bvirt)+(bvirt-t1);u3=_j+_i;bvirt=u3-_j;u[2]=_j-(u3-bvirt)+(_i-bvirt);u[3]=u3;var C1len=sum(4,B,4,u,C1);s1=acx*bcytail;c=splitter*acx;ahi=c-(c-acx);alo=acx-ahi;c=splitter*bcytail;bhi=c-(c-bcytail);blo=bcytail-bhi;s0=alo*blo-(s1-ahi*bhi-alo*bhi-ahi*blo);t1=acy*bcxtail;c=splitter*acy;ahi=c-(c-acy);alo=acy-ahi;c=splitter*bcxtail;bhi=c-(c-bcxtail);blo=bcxtail-bhi;t0=alo*blo-(t1-ahi*bhi-alo*bhi-ahi*blo);_i=s0-t0;bvirt=s0-_i;u[0]=s0-(_i+bvirt)+(bvirt-t0);_j=s1+_i;bvirt=_j-s1;_0=s1-(_j-bvirt)+(_i-bvirt);_i=_0-t1;bvirt=_0-_i;u[1]=_0-(_i+bvirt)+(bvirt-t1);u3=_j+_i;bvirt=u3-_j;u[2]=_j-(u3-bvirt)+(_i-bvirt);u[3]=u3;var C2len=sum(C1len,C1,4,u,C2);s1=acxtail*bcytail;c=splitter*acxtail;ahi=c-(c-acxtail);alo=acxtail-ahi;c=splitter*bcytail;bhi=c-(c-bcytail);blo=bcytail-bhi;s0=alo*blo-(s1-ahi*bhi-alo*bhi-ahi*blo);t1=acytail*bcxtail;c=splitter*acytail;ahi=c-(c-acytail);alo=acytail-ahi;c=splitter*bcxtail;bhi=c-(c-bcxtail);blo=bcxtail-bhi;t0=alo*blo-(t1-ahi*bhi-alo*bhi-ahi*blo);_i=s0-t0;bvirt=s0-_i;u[0]=s0-(_i+bvirt)+(bvirt-t0);_j=s1+_i;bvirt=_j-s1;_0=s1-(_j-bvirt)+(_i-bvirt);_i=_0-t1;bvirt=_0-_i;u[1]=_0-(_i+bvirt)+(bvirt-t1);u3=_j+_i;bvirt=u3-_j;u[2]=_j-(u3-bvirt)+(_i-bvirt);u[3]=u3;var Dlen=sum(C2len,C2,4,u,D);return D[Dlen-1]}function orient2d(ax,ay,bx,by,cx,cy){var detleft=(ay-cy)*(bx-cx);var detright=(ax-cx)*(by-cy);var det=detleft-detright;if(detleft===0||detright===0||detleft>0!==detright>0)return det;var detsum=Math.abs(detleft+detright);if(Math.abs(det)>=ccwerrboundA*detsum)return det;return-orient2dadapt(ax,ay,bx,by,cx,cy,detsum)}function signedArea(p0,p1,p2){var res=orient2d(p0[0],p0[1],p1[0],p1[1],p2[0],p2[1]);if(res>0)return-1;if(res<0)return 1;return 0}function compareEvents(e1,e2){var p1=e1.point;var p2=e2.point;if(p1[0]>p2[0])return 1;if(p1[0]<p2[0])return-1;if(p1[1]!==p2[1])return p1[1]>p2[1]?1:-1;return specialCases(e1,e2,p1)}function specialCases(e1,e2,p1,p2){if(e1.left!==e2.left)return e1.left?1:-1;if(signedArea(p1,e1.otherEvent.point,e2.otherEvent.point)!==0)return!e1.isBelow(e2.otherEvent.point)?1:-1;return!e1.isSubject&&e2.isSubject?1:-1}function divideSegment(se,p,queue){var r=new SweepEvent(p,false,se,se.isSubject);var l=new SweepEvent(p,true,se.otherEvent,se.isSubject);if(equals(se.point,se.otherEvent.point))console.warn("what is that, a collapsed segment?",se);r.contourId=l.contourId=se.contourId;if(compareEvents(l,se.otherEvent)>0){se.otherEvent.left=true;l.left=false}se.otherEvent.otherEvent=l;se.otherEvent=r;queue.push(l);queue.push(r);return queue}function crossProduct(a,b){return a[0]*b[1]-a[1]*b[0]}function dotProduct(a,b){return a[0]*b[0]+a[1]*b[1]}function intersection(a1,a2,b1,b2,noEndpointTouch){var va=[a2[0]-a1[0],a2[1]-a1[1]];var vb=[b2[0]-b1[0],b2[1]-b1[1]];function toPoint(p,s,d){return[p[0]+s*d[0],p[1]+s*d[1]]}var e=[b1[0]-a1[0],b1[1]-a1[1]];var kross=crossProduct(va,vb);var sqrKross=kross*kross;var sqrLenA=dotProduct(va,va);if(sqrKross>0){var s=crossProduct(e,vb)/kross;if(s<0||s>1)return null;var t=crossProduct(e,va)/kross;if(t<0||t>1)return null;if(s===0||s===1)return noEndpointTouch?null:[toPoint(a1,s,va)];if(t===0||t===1)return noEndpointTouch?null:[toPoint(b1,t,vb)];return[toPoint(a1,s,va)]}kross=crossProduct(e,va);sqrKross=kross*kross;if(sqrKross>0)return null;var sa=dotProduct(va,e)/sqrLenA;var sb=sa+dotProduct(va,vb)/sqrLenA;var smin=Math.min(sa,sb);var smax=Math.max(sa,sb);if(smin<=1&&smax>=0){if(smin===1)return noEndpointTouch?null:[toPoint(a1,smin>0?smin:0,va)];if(smax===0)return noEndpointTouch?null:[toPoint(a1,smax<1?smax:1,va)];if(noEndpointTouch&&smin===0&&smax===1)return null;return[toPoint(a1,smin>0?smin:0,va),toPoint(a1,smax<1?smax:1,va)]}return null}function possibleIntersection(se1,se2,queue){var inter=intersection(se1.point,se1.otherEvent.point,se2.point,se2.otherEvent.point);var nintersections=inter?inter.length:0;if(nintersections===0)return 0;if(nintersections===1&&(equals(se1.point,se2.point)||equals(se1.otherEvent.point,se2.otherEvent.point)))return 0;if(nintersections===2&&se1.isSubject===se2.isSubject)return 0;if(nintersections===1){if(!equals(se1.point,inter[0])&&!equals(se1.otherEvent.point,inter[0]))divideSegment(se1,inter[0],queue);if(!equals(se2.point,inter[0])&&!equals(se2.otherEvent.point,inter[0]))divideSegment(se2,inter[0],queue);return 1}var events=[];var leftCoincide=false;var rightCoincide=false;if(equals(se1.point,se2.point))leftCoincide=true;else if(compareEvents(se1,se2)===1)events.push(se2,se1);else events.push(se1,se2);if(equals(se1.otherEvent.point,se2.otherEvent.point))rightCoincide=true;else if(compareEvents(se1.otherEvent,se2.otherEvent)===1)events.push(se2.otherEvent,se1.otherEvent);else events.push(se1.otherEvent,se2.otherEvent);if(leftCoincide&&rightCoincide||leftCoincide){se2.type=NON_CONTRIBUTING;se1.type=se2.inOut===se1.inOut?SAME_TRANSITION:DIFFERENT_TRANSITION;if(leftCoincide&&!rightCoincide)divideSegment(events[1].otherEvent,events[0].point,queue);return 2}if(rightCoincide){divideSegment(events[0],events[1].point,queue);return 3}if(events[0]!==events[3].otherEvent){divideSegment(events[0],events[1].point,queue);divideSegment(events[1],events[2].point,queue);return 3}divideSegment(events[0],events[1].point,queue);divideSegment(events[3].otherEvent,events[2].point,queue);return 3}function compareSegments(le1,le2){if(le1===le2)return 0;if(signedArea(le1.point,le1.otherEvent.point,le2.point)!==0||signedArea(le1.point,le1.otherEvent.point,le2.otherEvent.point)!==0){if(equals(le1.point,le2.point))return le1.isBelow(le2.otherEvent.point)?-1:1;if(le1.point[0]===le2.point[0])return le1.point[1]<le2.point[1]?-1:1;if(compareEvents(le1,le2)===1)return le2.isAbove(le1.point)?-1:1;return le1.isBelow(le2.point)?-1:1}if(le1.isSubject===le2.isSubject){var p1=le1.point,p2=le2.point;if(p1[0]===p2[0]&&p1[1]===p2[1]){p1=le1.otherEvent.point;p2=le2.otherEvent.point;if(p1[0]===p2[0]&&p1[1]===p2[1])return 0;else return le1.contourId>le2.contourId?1:-1}}else return le1.isSubject?-1:1;return compareEvents(le1,le2)===1?1:-1}function subdivide(eventQueue,subject,clipping,sbbox,cbbox,operation){var sweepLine=new SplayTree(compareSegments);var sortedEvents=[];var rightbound=Math.min(sbbox[2],cbbox[2]);var prev,next,begin;while(eventQueue.length!==0){var event=eventQueue.pop();sortedEvents.push(event);if(operation===INTERSECTION&&event.point[0]>rightbound||operation===DIFFERENCE&&event.point[0]>sbbox[2])break;if(event.left){next=prev=sweepLine.insert(event);begin=sweepLine.minNode();if(prev!==begin)prev=sweepLine.prev(prev);else prev=null;next=sweepLine.next(next);var prevEvent=prev?prev.key:null;var prevprevEvent=void 0;computeFields(event,prevEvent,operation);if(next)if(possibleIntersection(event,next.key,eventQueue)===2){computeFields(event,prevEvent,operation);computeFields(event,next.key,operation)}if(prev)if(possibleIntersection(prev.key,event,eventQueue)===2){var prevprev=prev;if(prevprev!==begin)prevprev=sweepLine.prev(prevprev);else prevprev=null;prevprevEvent=prevprev?prevprev.key:null;computeFields(prevEvent,prevprevEvent,operation);computeFields(event,prevEvent,operation)}}else{event=event.otherEvent;next=prev=sweepLine.find(event);if(prev&&next){if(prev!==begin)prev=sweepLine.prev(prev);else prev=null;next=sweepLine.next(next);sweepLine.remove(event);if(next&&prev)possibleIntersection(prev.key,next.key,eventQueue)}}}return sortedEvents}var Contour=function Contour(){this.points=[];this.holeIds=[];this.holeOf=null;this.depth=null};function orderEvents(sortedEvents){var event,i,len,tmp;var resultEvents=[];for(i=0,len=sortedEvents.length;i<len;i++){event=sortedEvents[i];if(event.left&&event.inResult||!event.left&&event.otherEvent.inResult)resultEvents.push(event)}var sorted=false;while(!sorted){sorted=true;for(i=0,len=resultEvents.length;i<len;i++)if(i+1<len&&compareEvents(resultEvents[i],resultEvents[i+1])===1){tmp=resultEvents[i];resultEvents[i]=resultEvents[i+1];resultEvents[i+1]=tmp;sorted=false}}for(i=0,len=resultEvents.length;i<len;i++){event=resultEvents[i];event.otherPos=i}for(i=0,len=resultEvents.length;i<len;i++){event=resultEvents[i];if(!event.left){tmp=event.otherPos;event.otherPos=event.otherEvent.otherPos;event.otherEvent.otherPos=tmp}}return resultEvents}function nextPos(pos,resultEvents,processed,origPos){var newPos=pos+1,p=resultEvents[pos].point,p1;var length=resultEvents.length;if(newPos<length)p1=resultEvents[newPos].point;while(newPos<length&&p1[0]===p[0]&&p1[1]===p[1]){if(!processed[newPos])return newPos;else newPos++;p1=resultEvents[newPos].point}newPos=pos-1;while(processed[newPos]&&newPos>origPos)newPos--;return newPos}function initializeContourFromContext(event,contours,contourId){var contour=new Contour;if(event.prevInResult!=null){var prevInResult=event.prevInResult;var lowerContourId=prevInResult.outputContourId;var lowerResultTransition=prevInResult.resultTransition;if(lowerResultTransition>0){var lowerContour=contours[lowerContourId];if(lowerContour.holeOf!=null){var parentContourId=lowerContour.holeOf;contours[parentContourId].holeIds.push(contourId);contour.holeOf=parentContourId;contour.depth=contours[lowerContourId].depth}else{contours[lowerContourId].holeIds.push(contourId);contour.holeOf=lowerContourId;contour.depth=contours[lowerContourId].depth+1}}else{contour.holeOf=null;contour.depth=contours[lowerContourId].depth}}else{contour.holeOf=null;contour.depth=0}return contour}function connectEdges(sortedEvents){var i,len;var resultEvents=orderEvents(sortedEvents);var processed={};var contours=[];var loop=function(){if(processed[i])return;var contourId=contours.length;var contour=initializeContourFromContext(resultEvents[i],contours,contourId);var markAsProcessed=function(pos){processed[pos]=true;resultEvents[pos].outputContourId=contourId};var pos=i;var origPos=i;var initial=resultEvents[i].point;contour.points.push(initial);while(true){markAsProcessed(pos);pos=resultEvents[pos].otherPos;markAsProcessed(pos);contour.points.push(resultEvents[pos].point);pos=nextPos(pos,resultEvents,processed,origPos);if(pos==origPos)break}contours.push(contour)};for(i=0,len=resultEvents.length;i<len;i++)loop();return contours}Contour.prototype.isExterior=function isExterior(){return this.holeOf==null};var tinyqueue=TinyQueue,default_1=TinyQueue;function TinyQueue(data,compare){if(!(this instanceof TinyQueue))return new TinyQueue(data,compare);this.data=data||[];this.length=this.data.length;this.compare=compare||defaultCompare;if(this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function defaultCompare(a,b){return a<b?-1:a>b?1:0}TinyQueue.prototype={push:function(item){this.data.push(item);this.length++;this._up(this.length-1)},pop:function(){if(this.length===0)return undefined;var top=this.data[0];this.length--;if(this.length>0){this.data[0]=this.data[this.length];this._down(0)}this.data.pop();return top},peek:function(){return this.data[0]},_up:function(pos){var data=this.data;var compare=this.compare;var item=data[pos];while(pos>0){var parent=pos-1>>1;var current=data[parent];if(compare(item,current)>=0)break;data[pos]=current;pos=parent}data[pos]=item},_down:function(pos){var data=this.data;var compare=this.compare;var halfLength=this.length>>1;var item=data[pos];while(pos<halfLength){var left=(pos<<1)+1;var right=left+1;var best=data[left];if(right<this.length&&compare(data[right],best)<0){left=right;best=data[right]}if(compare(best,item)>=0)break;data[pos]=best;pos=left}data[pos]=item}},tinyqueue.default=default_1;var max=Math.max,min=Math.min,contourId=0;function processPolygon(contourOrHole,isSubject,depth,Q,bbox,isExteriorRing){var i,len,s1,s2,e1,e2;for(i=0,len=contourOrHole.length-1;i<len;i++){s1=contourOrHole[i];s2=contourOrHole[i+1];e1=new SweepEvent(s1,false,undefined,isSubject);e2=new SweepEvent(s2,false,e1,isSubject);e1.otherEvent=e2;if(s1[0]===s2[0]&&s1[1]===s2[1])continue;e1.contourId=e2.contourId=depth;if(!isExteriorRing){e1.isExteriorRing=false;e2.isExteriorRing=false}if(compareEvents(e1,e2)>0)e2.left=true;else e1.left=true;var x=s1[0],y=s1[1];bbox[0]=min(bbox[0],x);bbox[1]=min(bbox[1],y);bbox[2]=max(bbox[2],x);bbox[3]=max(bbox[3],y);Q.push(e1);Q.push(e2)}}function fillQueue(subject,clipping,sbbox,cbbox,operation){var eventQueue=new tinyqueue(null,compareEvents);var polygonSet,isExteriorRing,i,ii,j,jj;for(i=0,ii=subject.length;i<ii;i++){polygonSet=subject[i];for(j=0,jj=polygonSet.length;j<jj;j++){isExteriorRing=j===0;if(isExteriorRing)contourId++;processPolygon(polygonSet[j],true,contourId,eventQueue,sbbox,isExteriorRing)}}for(i=0,ii=clipping.length;i<ii;i++){polygonSet=clipping[i];for(j=0,jj=polygonSet.length;j<jj;j++){isExteriorRing=j===0;if(operation===DIFFERENCE)isExteriorRing=false;if(isExteriorRing)contourId++;processPolygon(polygonSet[j],false,contourId,eventQueue,cbbox,isExteriorRing)}}return eventQueue}var EMPTY=[];function trivialOperation(subject,clipping,operation){var result=null;if(subject.length*clipping.length===0)if(operation===INTERSECTION)result=EMPTY;else if(operation===DIFFERENCE)result=subject;else if(operation===UNION||operation===XOR)result=subject.length===0?clipping:subject;return result}function compareBBoxes(subject,clipping,sbbox,cbbox,operation){var result=null;if(sbbox[0]>cbbox[2]||cbbox[0]>sbbox[2]||sbbox[1]>cbbox[3]||cbbox[1]>sbbox[3])if(operation===INTERSECTION)result=EMPTY;else if(operation===DIFFERENCE)result=subject;else if(operation===UNION||operation===XOR)result=subject.concat(clipping);return result}function boolean(subject,clipping,operation){if(typeof subject[0][0][0]==="number")subject=[subject];if(typeof clipping[0][0][0]==="number")clipping=[clipping];var trivial=trivialOperation(subject,clipping,operation);if(trivial)return trivial===EMPTY?null:trivial;var sbbox=[Infinity,Infinity,-Infinity,-Infinity];var cbbox=[Infinity,Infinity,-Infinity,-Infinity];var eventQueue=fillQueue(subject,clipping,sbbox,cbbox,operation);trivial=compareBBoxes(subject,clipping,sbbox,cbbox,operation);if(trivial)return trivial===EMPTY?null:trivial;var sortedEvents=subdivide(eventQueue,subject,clipping,sbbox,cbbox,operation);var contours=connectEdges(sortedEvents);var polygons=[];for(var i=0;i<contours.length;i++){var contour=contours[i];if(contour.isExterior()){var rings=[contour.points];for(var j=0;j<contour.holeIds.length;j++){var holeId=contour.holeIds[j];rings.push(contours[holeId].points)}polygons.push(rings)}}return polygons}function union(subject,clipping){return boolean(subject,clipping,UNION)}function diff(subject,clipping){return boolean(subject,clipping,DIFFERENCE)}function xor(subject,clipping){return boolean(subject,clipping,XOR)}function intersection$1(subject,clipping){return boolean(subject,clipping,INTERSECTION)}var operations={UNION:UNION,DIFFERENCE:DIFFERENCE,INTERSECTION:INTERSECTION,XOR:XOR};exports.diff=diff,exports.intersection=intersection$1,exports.operations=operations,exports.union=union,exports.xor=xor,Object.defineProperty(exports,"__esModule",{value:true})}(exports)})),zoomRange=[2,26],Const={deg2rad:Math.PI/180,rad2deg:180/Math.PI,earthRadius:6378137};function isClockwise(poly){for(var sum=0,len=poly.length,i=0;i<len-1;i++){var next,cur=poly[i];sum+=((next=poly[i+1])[0]-cur[0])*(next[1]+cur[1])}return poly[len-1][0]===poly[0][0]&&poly[len-1][1]===poly[0][1]||(cur=poly[len-1],sum+=((next=poly[0])[0]-cur[0])*(next[1]+cur[1])),0<sum}function extend(dest){for(var _i=1;_i<arguments.length;_i++)_i-1,0;for(var src,target,sources=Array.prototype.slice.call(arguments,1),j=0,len=sources.length;j<len;j+=1)for(var key in src=sources[j]||{})src.hasOwnProperty(key)&&("function"==typeof(target=src[key])&&dest.prototype?dest.prototype[key]=target:dest[key]=target)}var freeModule=function(){function GeometryUtilCls(opts){this.CLASS_NAME="AMap.GeometryUtil",this._opts=assign({onSegmentTolerance:5,crs:"EPSG3857",maxZoom:zoomRange[1]},opts),this.setCrs(this._opts.crs)}return GeometryUtilCls.prototype.clone=function(opts){return new GeometryUtilCls(assign({},this._opts,opts))},GeometryUtilCls.prototype.isPoint=function(a){return a&&(a instanceof LngLat$1||Util.isArray(a)&&!isNaN(a[0]))},GeometryUtilCls.prototype.normalizePoint=function(a){return a},GeometryUtilCls.prototype.normalizeLine=function(p){for(var items=[],i=0,len=p.length;i<len;i++)items.push(this.normalizePoint(p[i]));return items},GeometryUtilCls.prototype.normalizeMultiLines=function(p){for(var items=[],i=0,len=(p=Util.isArray(p)&&this.isPoint(p[0])?[p]:p).length;i<len;i++)items.push(this.normalizeLine(p[i]));return items},GeometryUtilCls.prototype.setCrs=function(pro){pro=pro&&pro.project&&pro.unproject?pro:"plane"===pro?{normalizePoint:function(a){return a&&a.x&&a.y?[a.x,a.y]:a},distance:function(a,b){var dX=a[0]-b[0],a=a[1]-b[1];return Math.sqrt(dX*dX+a*a)},project:function(a){return a},unproject:function(a){return a},ringArea:function(a){for(var e0=[0,0],e1=[0,0],area=0,first=a[0],l=a.length,i=2;i<l;i++){var p=a[i-1],c=a[i];e0[0]=first[0]-c[0],e0[1]=first[1]-c[1],e1[0]=first[0]-p[0],e1[1]=first[1]-p[1],area+=e0[0]*e1[1]-e0[1]*e1[0]}return area/2}}:function(pro){var crs=function(pro){switch(pro){case"EPSG3857":return ProjectionManager.getProjection("EPSG:3857");case"EPSG4326":return ProjectionManager.getProjection("EPSG:4326")}return ProjectionManager.getProjection("EPSG3857")}(pro);return{project:function(a){return Util.isArray(a)&&(a=new LngLat$1(a[0],a[1])),crs.project(a.lng,a.lat)},unproject:function(a){return Util.isArray(a)&&(a=new Pixel(a[0],a[1])),crs.unproject(a.x,a.y)},normalizePoint:function(a){return Util.parseLngLatData(a)},distance:function(p1,p2){if(p2=this.normalizePoint(p2),Util.isArray(p2))return this.distanceToLine(p1,p2);p1=this.normalizePoint(p1);var deg2rad=Const.deg2rad,cos=Math.cos,lat1=p1.lat*deg2rad,p1=p1.lng*deg2rad,lat2=p2.lat*deg2rad,p2=p2.lng*deg2rad,deg2rad=2*Const.earthRadius,p2=p2-p1,p1=(1-cos(lat2-lat1)+(1-cos(p2))*cos(lat1)*cos(lat2))/2;return deg2rad*Math.asin(Math.sqrt(p1))},ringArea:function(ring){ring=this.normalizeLine(ring);var metrePerDegree=Const.earthRadius*Const.deg2rad,sum=0,arr=ring,len=arr.length;if(len<3)return 0;for(var i=0;i<len-1;i+=1){var m=arr[i],n=arr[i+1],x1=m.lng*metrePerDegree*Math.cos(m.lat*Const.deg2rad),m=m.lat*metrePerDegree,x2=n.lng*metrePerDegree*Math.cos(n.lat*Const.deg2rad);sum+=x1*(n.lat*metrePerDegree)-x2*m}var ring=arr[i],p=arr[0],xn=ring.lng*metrePerDegree*Math.cos(ring.lat*Const.deg2rad),ring=ring.lat*metrePerDegree,xf=p.lng*metrePerDegree*Math.cos(p.lat*Const.deg2rad);return sum+=xn*(p.lat*metrePerDegree)-xf*ring,.5*Math.abs(sum)},sphericalCalotteArea:function(cr){var r=Const.earthRadius,cr=r-r*Math.cos(cr/r);return 2*Math.PI*r*cr}}}(pro,this._opts.maxZoom);assign(this,pro)},GeometryUtilCls.prototype.distance=function(p1,p2){throw new Error("distance Not implemented!")},GeometryUtilCls.prototype._lineToRawCoords=function(line,makeClockwise){line=this.normalizeLine(line);for(var items=[],i=0,len=(line=this.isPoint(line[0])?line:line[0]).length;i<len;i++)items.push(this.project(line[i]));return!0===makeClockwise?items=this.makesureClockwise(items):!1===makeClockwise&&(items=this.makesureClockwise(items)).reverse(),items},GeometryUtilCls.prototype._rawCoordsToLine=function(items){for(var results=[],i=0,len=items.length;i<len;i++)results.push(this.unproject(items[i]));return results},GeometryUtilCls.prototype.closestOnSegment=function(a,p1,p2){a=Coordinate_closestOnSegment(this.project(a),this._lineToRawCoords([p1,p2]));return this.unproject(a)},GeometryUtilCls.prototype.closestOnLine=function(a,line){for(var p,minDist=1/0,i=0,len=(line=this.normalizeLine(line)).length;i<len-1;i++){var closest=this.closestOnSegment(a,line[i],line[i+1]),dist=this.distance(a,closest);dist<minDist&&(minDist=dist,p=closest)}return p},GeometryUtilCls.prototype.distanceToSegment=function(a,p1,p2){return this.distanceToLine(a,[p1,p2])},GeometryUtilCls.prototype.distanceToLine=function(a,line){line=this.normalizeLine(line);for(var dist2=1/0,i=0,len=(line=this.isPoint(line[0])?line:line[0]).length;i<len-1;i++)var closest=this.closestOnSegment(a,line[i],line[i+1]),dist2=Math.min(dist2,this.distance(a,closest));return dist2},GeometryUtilCls.prototype.distanceToPolygon=function(a,polygon){return this.isPointInRing(a,polygon)?0:this.distanceToLine(a,polygon)},GeometryUtilCls.prototype.isPointOnSegment=function(p,p1,p2,tolerance){return(!tolerance&&0!==tolerance||tolerance<0)&&(tolerance=this._opts.onSegmentTolerance),this.distanceToSegment(p,p1,p2)<=tolerance},GeometryUtilCls.prototype.isPointOnLine=function(a,line,tolerance){for(var i=0,len=(line=this.normalizeLine(line)).length;i<len-1;i++)if(this.isPointOnSegment(a,line[i],line[i+1],tolerance))return!0;return!1},GeometryUtilCls.prototype.isPointOnRing=function(a,ring,tolerance){for(var i=0,len=(ring=this.normalizeLine(ring)).length;i<len;i++)if(this.isPointOnSegment(a,ring[i],ring[i===len-1?0:i+1],tolerance))return!0;return!1},GeometryUtilCls.prototype.isPointOnPolygon=function(a,rings,tolerance){for(var i=0,len=(rings=this.normalizeMultiLines(rings)).length;i<len;i++)if(this.isPointOnRing(a,rings[i],tolerance))return!0;return!1},GeometryUtilCls.prototype.makesureClockwise=function(coords){return isClockwise(coords)||(coords=[].concat(coords)).reverse(),coords},GeometryUtilCls.prototype.makesureAntiClockwise=function(coords){return isClockwise(coords)&&(coords=[].concat(coords)).reverse(),coords},GeometryUtilCls.prototype.pointInRing=function(pt,polys,ignoreBoundary){for(var insidePoly=!1,i=0;i<polys.length&&!insidePoly;i++)if(inRing(pt,polys[i][0],ignoreBoundary)){for(var inHole=!1,k=1;k<polys[i].length&&!inHole;)inRing(pt,polys[i][k],!ignoreBoundary)&&(inHole=!0),k++;inHole||(insidePoly=!0)}function inRing(pt,ring,ignoreBoundary){for(var isInside=!1,i=0,j=(ring=ring[0][0]===ring[ring.length-1][0]&&ring[0][1]===ring[ring.length-1][1]?ring.slice(0,ring.length-1):ring).length-1;i<ring.length;j=i++){var xi=ring[i][0],yi=ring[i][1],xj=ring[j][0],yj=ring[j][1];if(pt[1]*(xi-xj)+yi*(xj-pt[0])+yj*(pt[0]-xi)==0&&(xi-pt[0])*(xj-pt[0])<=0&&(yi-pt[1])*(yj-pt[1])<=0)return!ignoreBoundary;yi>pt[1]!=yj>pt[1]&&pt[0]<(xj-xi)*(pt[1]-yi)/(yj-yi)+xi&&(isInside=!isInside)}return isInside}return insidePoly},GeometryUtilCls.prototype.isPointInBbox=function(pt,bbox){for(var minX=1/0,minY=1/0,maxX=-1/0,maxY=-1/0,i=0;i<bbox.length;i++)var b=bbox[i],minX=Math.min(minX,b[0]),maxX=Math.max(maxX,b[0]),minY=Math.min(minY,b[1]),maxY=Math.max(maxY,b[1]);return pt[0]>minX&&pt[0]<maxX&&pt[1]>minY&&pt[1]<maxY},GeometryUtilCls.prototype.isPointInRing=function(a,ring){ring=this.normalizeLine(ring);ring=this._lineToRawCoords(ring,!0);return Coordinate_containsCoordinate(this.project(a),ring,!1)},GeometryUtilCls.prototype.isRingInRing=function(r1,r2){for(var i=0,len=r1.length;i<len;i++)if(!this.isPointInRing(r1[i],r2))return!1;return!0},GeometryUtilCls.prototype.isRingInRingByOutsea=function(r1,r2){for(var i=0,len=r1.length;i<len;i++)if(this.isPointInRing(r1[i],r2))return!0;for(i=0,len=r2.length;i<len;i++)if(this.isPointInRing(r2[i],r1))return!0;return!1},GeometryUtilCls.prototype.isRingInRingByMapbox=function(r1,r2){for(var i=0,len=r1.length;i<len;i++)if(!this.isPointInRing(r1[i],r2))return!1;return!0},GeometryUtilCls.prototype.isRingInRingByMapboxB=function(r1,r2){for(var i=0,len=r1.length;i<len;i++)if(this.isPointInRing(r1[i],r2))return!0;return!1},GeometryUtilCls.prototype.isPixelRingInRing=function(r1,r2){for(var i=0,len=r1.length;i<len;i++)if(Coordinate_containsCoordinate(r1[i],r2,!1))return!0;return!1},GeometryUtilCls.prototype.isPointInPolygon=function(a,rings){for(var containsCoordinate,i=0,len=(rings=this.normalizeMultiLines(rings)).length;i<len&&(containsCoordinate=this.isPointInRing(a,rings[i]),containsCoordinate=0<i?!containsCoordinate:containsCoordinate);i+=1);return Boolean(containsCoordinate)},GeometryUtilCls.prototype.isPointInPolygons=function(a,polys){for(var c=0;c<polys.length;c++){for(var rings=polys[c],containsCoordinate=void 0,i=0,len=(rings=this.normalizeMultiLines(rings)).length;i<len&&(containsCoordinate=this.isPointInRing(a,rings[i]),containsCoordinate=0<i?!containsCoordinate:containsCoordinate);i+=1);if(containsCoordinate)return!0}return!1},GeometryUtilCls.prototype.doesSegmentsIntersect=function(a1,a2,b1,b2){var pairs=this._lineToRawCoords([a1,a2,b1,b2]),result=(a1=pairs[0],a2=pairs[1],b1=pairs[2],!1),pairs=((b2=pairs[3])[0]-b1[0])*(a1[1]-b1[1])-(b2[1]-b1[1])*(a1[0]-b1[0]),ub_t=(a2[0]-a1[0])*(a1[1]-b1[1])-(a2[1]-a1[1])*(a1[0]-b1[0]),b2=(b2[1]-b1[1])*(a2[0]-a1[0])-(b2[0]-b1[0])*(a2[1]-a1[1]);return result=0!=b2&&(b1=ub_t/b2,0<=(a2=pairs/b2))&&a2<=1&&0<=b1&&b1<=1?!0:result},GeometryUtilCls.prototype.doesSegmentLineIntersect=function(p1,p2,line){for(var i=0,len=(line=this.normalizeLine(line)).length;i<len-1;i++)if(this.doesSegmentsIntersect(p1,p2,line[i],line[i+1]))return!0;return!1},GeometryUtilCls.prototype.doesSegmentRingIntersect=function(p1,p2,ring){for(var i=0,len=(ring=this.normalizeLine(ring)).length;i<len;i++)if(this.doesSegmentsIntersect(p1,p2,ring[i],ring[i===len-1?0:i+1]))return!0;return!1},GeometryUtilCls.prototype.doesSegmentPolygonIntersect=function(p1,p2,rings){for(var i=0,len=(rings=this.normalizeMultiLines(rings)).length;i<len;i++)if(this.doesSegmentRingIntersect(p1,p2,rings[i]))return!0;return!1},GeometryUtilCls.prototype.doesLineLineIntersect=function(l1,l2){for(var i=0,len=(l1=this.normalizeLine(l1)).length;i<len-1;i++)if(this.doesSegmentLineIntersect(l1[i],l1[i+1],l2))return!0;return!1},GeometryUtilCls.prototype.doesLineRingIntersect=function(l1,ring){for(var i=0,len=(l1=this.normalizeLine(l1)).length;i<len-1;i++)if(this.doesSegmentRingIntersect(l1[i],l1[i+1],ring))return!0;return!1},GeometryUtilCls.prototype.doesPolygonPolygonIntersect=function(polygon1,polygon2){return!!(this.doesRingRingIntersect(polygon2,polygon1)||this.isRingInRing(polygon1,polygon2)||this.isRingInRing(polygon2,polygon1))},GeometryUtilCls.prototype.doesRingRingIntersect=function(r1,r2){for(var i=0,len=(r1=this.normalizeLine(r1)).length;i<len;i++)if(this.doesSegmentRingIntersect(r1[i],r1[i===len-1?0:i+1],r2))return!0;return!1},GeometryUtilCls.prototype.along=function(path,distance){for(var dis=0,i=0;i<path.length-1;i+=1){var s,ppdis=this.distance(path[i],path[i+1]);if(!(ppdis+dis<distance))return[path[i][0]+(s=(distance-dis)/ppdis)*(path[i+1][0]-path[i][0]),path[i][1]+s*(path[i+1][1]-path[i][1]),i];dis+=ppdis}return null},GeometryUtilCls.prototype._clip=function(subjectPolygon,clipPolygon){for(var e,inside=function(p){return(cp2[0]-cp1[0])*(p[1]-cp1[1])>(cp2[1]-cp1[1])*(p[0]-cp1[0])},intersection=function(){var dc=[cp1[0]-cp2[0],cp1[1]-cp2[1]],dp=[s[0]-e[0],s[1]-e[1]],n1=cp1[0]*cp2[1]-cp1[1]*cp2[0],n2=s[0]*e[1]-s[1]*e[0],n3=1/(dc[0]*dp[1]-dc[1]*dp[0]);return[(n1*dp[0]-n2*dc[0])*n3,(n1*dp[1]-n2*dc[1])*n3]},outputList=subjectPolygon=this.makesureAntiClockwise(subjectPolygon),cp1=(clipPolygon=this.makesureClockwise(clipPolygon))[clipPolygon.length-1],j=0,jlen=clipPolygon.length;j<jlen;j++){for(var cp2=clipPolygon[j],inputList=outputList,outputList=[],s=inputList[inputList.length-1],i=0,len=inputList.length;i<len;i++)inside(e=inputList[i])?(inside(s)||outputList.push(intersection()),outputList.push(e)):inside(s)&&outputList.push(intersection()),s=e;cp1=cp2}return outputList},GeometryUtilCls.prototype.ringRingClip=function(r1,r2){r1=this._lineToRawCoords(r1),r2=this._lineToRawCoords(r2),isEqual(r1[0],r1[r1.length-1])||r1.push(r1[0].slice()),isEqual(r2[0],r2[r2.length-1])||r2.push(r2[0].slice());r1=martinez.intersection([r1],[r2]);return r1&&r1[0]&&r1[0][0]?this._rawCoordsToLine(r1[0][0]):[]},GeometryUtilCls.prototype.ringArea=function(r){throw new Error("distance Not implemented!")},GeometryUtilCls.prototype.distanceOfLine=function(line){for(var distance=0,i=0,len=(line=this.normalizeLine(line)).length;i<len-1;i++)distance+=this.distance(line[i],line[i+1]);return distance},GeometryUtilCls.prototype.isClockwise=function(line){return isClockwise(line=this._lineToRawCoords(line))},GeometryUtilCls.prototype.typePolygon=function(polygon){return isArray(polygon)&&isArray(polygon[0])?2===polygon[0][0].length||polygon[0][0]instanceof LngLat$1?"Polygon":2<polygon[0][0].length&&(2===polygon[0][0][0].length||polygon[0][0][0]instanceof LngLat$1)?"MultiPolygon":"never":"never"},GeometryUtilCls}(),objectProto$2=new freeModule({}),objectProto=new freeModule({}),GeometryUtil=(objectProto.setCrs("plane"),{distance:objectProto$2.distance.bind(objectProto$2),ringArea:objectProto$2.ringArea.bind(objectProto$2),isClockwise:objectProto$2.isClockwise.bind(objectProto$2),typePolygon:objectProto$2.typePolygon.bind(objectProto$2),makesureClockwise:objectProto$2.makesureClockwise.bind(objectProto$2),makesureAntiClockwise:objectProto$2.makesureAntiClockwise.bind(objectProto$2),distanceOfLine:objectProto$2.distanceOfLine.bind(objectProto$2),ringRingClip:objectProto$2.ringRingClip.bind(objectProto$2),doesSegmentsIntersect:objectProto$2.doesSegmentsIntersect.bind(objectProto$2),doesSegmentLineIntersect:objectProto$2.doesSegmentLineIntersect.bind(objectProto$2),doesSegmentRingIntersect:objectProto$2.doesSegmentRingIntersect.bind(objectProto$2),doesSegmentPolygonIntersect:objectProto$2.doesSegmentPolygonIntersect.bind(objectProto$2),doesLineLineIntersect:objectProto$2.doesLineLineIntersect.bind(objectProto$2),doesLineRingIntersect:objectProto$2.doesLineRingIntersect.bind(objectProto$2),doesRingRingIntersect:objectProto$2.doesRingRingIntersect.bind(objectProto$2),pointInRing:objectProto$2.pointInRing.bind(objectProto$2),isPointInRing:objectProto$2.isPointInRing.bind(objectProto$2),isPointInBbox:objectProto$2.isPointInBbox.bind(objectProto$2),isRingInRing:objectProto$2.isRingInRing.bind(objectProto$2),isPointInPolygon:objectProto$2.isPointInPolygon.bind(objectProto$2),isPointInPolygons:objectProto$2.isPointInPolygons.bind(objectProto$2),isPointOnSegment:objectProto$2.isPointOnSegment.bind(objectProto$2),isPointOnLine:objectProto$2.isPointOnLine.bind(objectProto$2),isPointOnRing:objectProto$2.isPointOnRing.bind(objectProto$2),isPointOnPolygon:objectProto$2.isPointOnPolygon.bind(objectProto$2),closestOnSegment:objectProto$2.closestOnSegment.bind(objectProto$2),closestOnLine:objectProto$2.closestOnLine.bind(objectProto$2),distanceToSegment:objectProto$2.distanceToSegment.bind(objectProto$2),distanceToLine:objectProto$2.distanceToLine.bind(objectProto$2)}),LngLat$1=(objectProto.distance.bind(objectProto),objectProto.ringArea.bind(objectProto),objectProto.isClockwise.bind(objectProto),objectProto.typePolygon.bind(objectProto),objectProto.makesureClockwise.bind(objectProto),objectProto.makesureAntiClockwise.bind(objectProto),objectProto.distanceOfLine.bind(objectProto),objectProto.ringRingClip.bind(objectProto),objectProto.doesSegmentsIntersect.bind(objectProto),objectProto.doesSegmentLineIntersect.bind(objectProto),objectProto.doesSegmentRingIntersect.bind(objectProto),objectProto.doesSegmentPolygonIntersect.bind(objectProto),objectProto.doesLineLineIntersect.bind(objectProto),objectProto.doesLineRingIntersect.bind(objectProto),objectProto.doesRingRingIntersect.bind(objectProto),objectProto.pointInRing.bind(objectProto),objectProto.isPointInRing.bind(objectProto),objectProto.isPointInBbox.bind(objectProto),objectProto.isRingInRing.bind(objectProto),objectProto.isPointInPolygon.bind(objectProto),objectProto.isPointInPolygons.bind(objectProto),objectProto.isPointOnSegment.bind(objectProto),objectProto.isPointOnLine.bind(objectProto),objectProto.isPointOnRing.bind(objectProto),objectProto.isPointOnPolygon.bind(objectProto),objectProto.closestOnSegment.bind(objectProto),objectProto.closestOnLine.bind(objectProto),objectProto.distanceToSegment.bind(objectProto),objectProto.distanceToLine.bind(objectProto),function(){function LngLat(lng,lat,noWrap){var obj;if(void 0===noWrap&&(noWrap=!1),this.className="AMap.LngLat",obj=lng,Array.isArray(obj)&&function(obj){obj=+obj;return"number"==typeof obj&&!isNaN(obj)}(obj[0])?(lng=parseFloat(lng[0]),lat=parseFloat(lng[1])):(lat=parseFloat(lat),lng=parseFloat(lng)),isNaN(lng)||isNaN(lat))throw Error("Invalid Object: LngLat("+lng+", "+lat+")");!0!==noWrap&&(lat=Math.max(Math.min(lat,90),-90),lng=(lng+180)%360+(lng<-180||180===lng?180:-180)),this._highLat=lat,this._highLng=lng,this.lng=Math.round(1e6*lng)/1e6,this.lat=Math.round(1e6*lat)/1e6,this.pos=ProjectionManager.getProjection("EPSG:3857").project(lng,lat)}return LngLat.from=function(point){return isLngLat(point)?new LngLat(point._highLng,point._highLat):new LngLat(point[0],point[1])},LngLat.prototype.setLng=function(lng){return this._highLng=lng,this.lng=Math.round(1e6*lng)/1e6,this},LngLat.prototype.setLat=function(lat){return this._highLat=lat,this.lat=Math.round(1e6*lat)/1e6,this},LngLat.prototype.getLng=function(){return this.lng},LngLat.prototype.getLat=function(){return this.lat},LngLat.prototype.equals=function(another){return(another=function parseLngLatData(data){if(Array.isArray(data)){var type;if(!Array.isArray(data[0]))return"string"==(type=typeof data[0])||"number"==type?new LngLat$1(data[0],data[1]):data;for(var i=0;i<data.length;i+=1)data[i]=parseLngLatData(data[i])}return data}(another))instanceof LngLat&&Math.max(Math.abs(this._highLat-another._highLat),Math.abs(this._highLng-another._highLng))<=1e-9},LngLat.prototype.add=function(another,noWrap){return new LngLat(this._highLng+another._highLng,this._highLat+another._highLat,noWrap)},LngLat.prototype.subtract=function(another,noWrap){return new LngLat(this._highLng-another._highLng,this._highLat-another._highLat,noWrap)},LngLat.prototype.divideBy=function(num,noWrap){return new LngLat(this._highLng/num,this._highLat/num,noWrap)},LngLat.prototype.multiplyBy=function(num,noWrap){return new LngLat(this._highLng*num,this._highLat*num,noWrap)},LngLat.prototype.offset=function(E,N){if(isNaN(E)||isNaN(N))throw Error("valid offset args, require number");E=2*Math.asin(Math.sin(Math.round(E)/12756274)/Math.cos(this._highLat*Math.PI/180)),E=this._highLng+180*E/Math.PI,N=2*Math.asin(Math.round(N)/12756274);return new LngLat(E,this._highLat+180*N/Math.PI)},LngLat.prototype.toString=function(){return this.lng+","+this.lat},LngLat.prototype.toArray=function(){return[this.lng,this.lat]},LngLat.prototype.toJSON=function(){return[this.lng,this.lat]},LngLat.prototype.distanceTo=function(another){return GeometryUtil.distance(this,another)},LngLat.prototype.distance=function(another){return GeometryUtil.distance(this,another)},LngLat}()),Size=function(){function Size(width,height,isRound){if(void 0===isRound&&(isRound=!1),this.className="AMap.Size",isNaN(width)||isNaN(height))throw new Error("Invalid Object: Pixel("+width+", "+height+")");this.width=isRound?Math.round(width):Number(width),this.height=isRound?Math.round(height):Number(height)}return Size.prototype.getWidth=function(){return this.width},Size.prototype.getHeight=function(){return this.height},Size.prototype.toString=function(){return this.width+","+this.height},Size.prototype.toArray=function(){return[this.width,this.height]},Size}();var records,NEWTON_ITERATIONS,SUBDIVISION_PRECISION,SUBDIVISION_MAX_ITERATIONS,float32ArraySupported,Browser=function(config){function uaHas(key){return-1!==ua.indexOf(key)}var callback,webP,amapRunTime={runSupport:(new Date).getTime()},wasm=function(){try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate&&TextDecoder&&TextEncoder){var module=new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0]));if(module instanceof WebAssembly.Module)return new WebAssembly.Instance(module)instanceof WebAssembly.Instance}}catch(e){}return!1}(),ua=navigator.userAgent.toLowerCase(),hardwareAccEnabled=!0,mac=uaHas("macintosh"),iPad=uaHas("ipad;")||uaHas("ipad "),iTouch=uaHas("ipod touch;"),iPhone=uaHas("iphone;")||uaHas("iphone "),iTouch=iPhone||iPad||iTouch,safari=(mac||iTouch)&&uaHas("safari")&&uaHas("version/"),macWechat=uaHas("macwechat"),windowsWechat=uaHas("windowswechat"),Browser={touch:!1,mac:mac,isRetina:!1,webkit:!1,isMobile:!1,scale:1,android:!1,isWorkerEnv:function(){try{document;return!1}catch(e){return!0}}(),wasm:wasm,safari:safari,macWechat:macWechat,windowsWechat:windowsWechat,amapRunTime:amapRunTime};if("undefined"!=typeof window&&"undefined"!=typeof document){var win_1=window,macWechat=document,windowsWechat=macWechat.documentElement,numberRegex_1=/([a-z0-9]*\\d+[a-z0-9]*)/,blackGraphicCard_1="google swiftshader;microsoft basic render driver;vmware svga 3d;Intel 965GM;Intel B43;Intel G41;Intel G45;Intel G965;Intel GMA 3600;Intel Mobile 4;Intel Mobile 45;Intel Mobile 965".split(";"),ie="ActiveXObject"in win_1,retina=0!=window.detectRetina&&("devicePixelRatio"in win_1&&1<win_1.devicePixelRatio||ie&&"matchMedia"in win_1&&win_1.matchMedia("(min-resolution:144dpi)")&&win_1.matchMedia("(min-resolution:144dpi)").matches),windows=uaHas("windows nt"),winPhone=(ua.search(/windows nt [1-5]\\./),ua.search(/windows nt 5\\.[12]/),uaHas("windows nt 10"),uaHas("windows phone")),mb2345Browser=uaHas("Mb2345Browser"),ios10=(iTouch&&ua.search(/ os [456]_/),iTouch&&ua.search(/ os [4-8]_/),iTouch&&ua.search(/ os [78]_/),iTouch&&uaHas("os 8_"),iTouch&&uaHas("os 10_")),android_1=uaHas("android"),androidVersion=0,android23=(android_1&&(androidVersion=parseInt(ua.split("android")[1])||0),android_1&&androidVersion<4),plat_1=(android_1&&5<=androidVersion||ua.search(/android 4.4/),android_1?"android":iTouch?"ios":windows?"windows":mac?"mac":"other"),androidVersion=ie&&!win_1.XMLHttpRequest,ie7=ie&&!macWechat.querySelector,ielt9=ie&&!macWechat.addEventListener,ie9=ie&&uaHas("msie 9"),ie10=ie&&uaHas("msie 10"),ie11=ie&&uaHas("rv:11"),ielt10=ielt9||ie9,edge=uaHas("edge"),uc=(uaHas("qtweb"),uaHas("ucbrowser")),gaodeCoords=uaHas("alipay")||android_1&&uc,wechat=(uaHas("miuibrowser"),uaHas("micromessenger")),dingding=uaHas("dingtalk"),qq=uaHas("mqqbrowser"),baidu=uaHas("baidubrowser"),crios=uaHas("crios/"),chrome=uaHas("chrome/"),crios=!((chrome||crios)&&uaHas("chromium"))&&(chrome&&30<parseInt(ua.split("chrome/")[1])||crios&&30<parseInt(ua.split("crios/")[1])),firefox=uaHas("firefox"),firefox27plus=firefox&&27<parseInt(ua.split("firefox/")[1]),safari7plus=safari&&7<parseInt(ua.split("version/")[1]),mobile_1=(iTouch&&uaHas("aliapp"),android_1||iTouch||winPhone||uaHas("mobile")),winPhone="ontouchstart"in macWechat,msPointer=win_1.navigator&&win_1.navigator.msPointerEnabled&&!!win_1.navigator.msMaxTouchPoints,pointer=win_1.navigator&&!!win_1.navigator.maxTouchPoints,pointerDev=!winPhone&&(pointer||msPointer),winPhone=winPhone||pointerDev,viewportScale=function(){if(!mobile_1)return win_1.devicePixelRatio||1;var metas=document.getElementsByTagName("meta");if(window.parent&&window.parent!==window)try{if(window.parent.location.origin!==window.location.origin)return 1;metas=window.parent.document.getElementsByTagName("meta")}catch(e){return 1}for(var content,initial_scale,minimum_scale,maximum_scale,i=metas.length-1;0<=i;--i)if("viewport"===metas[i].name)return maximum_scale=minimum_scale=initial_scale=void 0,-1!==(content=metas[i].content).indexOf("initial-scale")&&(initial_scale=parseFloat(content.split("initial-scale=")[1])),minimum_scale=-1!==content.indexOf("minimum-scale")?parseFloat(content.split("minimum-scale=")[1]):0,maximum_scale=-1!==content.indexOf("maximum-scale")?parseFloat(content.split("maximum-scale=")[1]):1/0,initial_scale?minimum_scale<=maximum_scale?maximum_scale<initial_scale?maximum_scale:initial_scale<minimum_scale?minimum_scale:initial_scale:(console&&console.log&&console.log("viewport参数不合法"),null):minimum_scale<=maximum_scale?1<=minimum_scale?1:Math.min(maximum_scale,1):(console&&console.log&&console.log("viewport参数不合法"),null)}(),needFitRetina_1=retina&&(!mobile_1||!!viewportScale&&1<=viewportScale),ie3d=ie&&"transition"in windowsWechat.style,isSvg=!!macWechat.createElementNS&&!!macWechat.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,canvas_1=macWechat.createElement("canvas"),isCanvas_1=!(!canvas_1||!canvas_1.getContext),macWechat=window.URL||window.webkitURL,isWorker_1=!0!==window.disableWorker&&!ie&&!(uc&&android_1&&!crios)&&window.Worker&&macWechat&&macWechat.createObjectURL&&window.Blob,webglContextName_1="",graphicCard_1="",maxRenderSize_1=0,macWechat=0!=window.higtQualityRender||!retina,movingDraw=window.movingDraw,webglParams_1=(window.forceWebGL,{alpha:!0,antialias:macWechat,depth:!0,stencil:!0}),macWechat=function(){if(isCanvas_1&&isWorker_1)for(var graphicVersion,number,contextName=["webgl","experimental-webgl","moz-webgl"],gl=null,i=0;i<contextName.length;i+=1){try{gl=canvas_1.getContext(contextName[i],webglParams_1)}catch(err){}if(gl){if(gl.drawingBufferWidth!==canvas_1.width||gl.drawingBufferHeight!==canvas_1.height)return!1;if(!gl.getShaderPrecisionFormat||!gl.getParameter||!gl.getExtension)return!1;maxRenderSize_1=gl.getParameter(gl.MAX_RENDERBUFFER_SIZE);var maxViewPortSize=gl.getParameter(gl.MAX_VIEWPORT_DIMS);if(!maxViewPortSize)return!1;maxRenderSize_1=Math.min(maxRenderSize_1,maxViewPortSize[0],maxViewPortSize[1]),safari&&"mac"==plat_1&&(maxRenderSize_1=Math.min(maxRenderSize_1,4096));var maxViewPortSize=Math.max(screen.width,screen.height);if(needFitRetina_1&&(maxViewPortSize*=Math.min(2,window.devicePixelRatio||1)),maxRenderSize_1<maxViewPortSize)return!1;if(gl.getShaderPrecisionFormat(35632,36338).precision<23||gl.getShaderPrecisionFormat(35633,36338).precision<23)return!1;graphicCard_1=gl.getExtension("WEBGL_debug_renderer_info")?gl.getParameter(37446):null;number=b=maxViewPortSize=void 0;var b=(graphicVersion=graphicCard_1)?(maxViewPortSize=null,0<=(graphicVersion=(graphicVersion=(b=(graphicVersion=graphicVersion.toLowerCase()).match(/angle \\((.*)\\)/))?(graphicVersion=b[1]).replace(/\\s*direct3d.*$/,""):graphicVersion).replace(/\\s*\\([^\\)]*wddm[^\\)]*\\)/,"")).indexOf("intel")?(maxViewPortSize=["Intel"],0<=graphicVersion.indexOf("mobile")&&maxViewPortSize.push("Mobile"),(0<=graphicVersion.indexOf("gma")||0<=graphicVersion.indexOf("graphics media accelerator"))&&maxViewPortSize.push("GMA"),0<=graphicVersion.indexOf("haswell")?maxViewPortSize.push("Haswell"):0<=graphicVersion.indexOf("ivy")?maxViewPortSize.push("HD 4000"):0<=graphicVersion.indexOf("sandy")?maxViewPortSize.push("HD 3000"):0<=graphicVersion.indexOf("ironlake")?maxViewPortSize.push("HD"):(0<=graphicVersion.indexOf("hd")&&maxViewPortSize.push("HD"),(number=graphicVersion.match(numberRegex_1))&&maxViewPortSize.push(number[1].toUpperCase())),maxViewPortSize.join(" ")):0<=graphicVersion.indexOf("nvidia")||0<=graphicVersion.indexOf("quadro")||0<=graphicVersion.indexOf("geforce")||0<=graphicVersion.indexOf("nvs")?(maxViewPortSize=["nVidia"],0<=graphicVersion.indexOf("geforce")&&maxViewPortSize.push("geForce"),0<=graphicVersion.indexOf("quadro")&&maxViewPortSize.push("Quadro"),0<=graphicVersion.indexOf("nvs")&&maxViewPortSize.push("NVS"),graphicVersion.match(/\\bion\\b/)&&maxViewPortSize.push("ION"),graphicVersion.match(/gtx\\b/)?maxViewPortSize.push("GTX"):graphicVersion.match(/gts\\b/)?maxViewPortSize.push("GTS"):graphicVersion.match(/gt\\b/)?maxViewPortSize.push("GT"):graphicVersion.match(/gs\\b/)?maxViewPortSize.push("GS"):graphicVersion.match(/ge\\b/)?maxViewPortSize.push("GE"):graphicVersion.match(/fx\\b/)&&maxViewPortSize.push("FX"),(number=graphicVersion.match(numberRegex_1))&&maxViewPortSize.push(number[1].toUpperCase().replace("GS","")),0<=graphicVersion.indexOf("titan")?maxViewPortSize.push("TITAN"):0<=graphicVersion.indexOf("ti")&&maxViewPortSize.push("Ti"),maxViewPortSize.join(" ")):0<=graphicVersion.indexOf("amd")||0<=graphicVersion.indexOf("ati")||0<=graphicVersion.indexOf("radeon")||0<=graphicVersion.indexOf("firegl")||0<=graphicVersion.indexOf("firepro")?(maxViewPortSize=["AMD"],0<=graphicVersion.indexOf("mobil")&&maxViewPortSize.push("Mobility"),0<=(b=graphicVersion.indexOf("radeon"))&&maxViewPortSize.push("Radeon"),0<=graphicVersion.indexOf("firepro")?maxViewPortSize.push("FirePro"):0<=graphicVersion.indexOf("firegl")&&maxViewPortSize.push("FireGL"),0<=graphicVersion.indexOf("hd")&&maxViewPortSize.push("HD"),(number=(graphicVersion=0<=b?graphicVersion.substring(b):graphicVersion).match(numberRegex_1))&&maxViewPortSize.push(number[1].toUpperCase().replace("HD","")),maxViewPortSize.join(" ")):graphicVersion.substring(0,100)):null;if(b){if(-1<b.indexOf("google swiftshader"))return hardwareAccEnabled=!1;if(-1!==blackGraphicCard_1.indexOf(b))return!1}return webglContextName_1=contextName[i],!0}}return!1},canWebGL=macWechat(),enableVector=void 0===config[8]||config[8],canWebGL=window.Uint8Array&&enableVector&&!window.forbidenWebGL&&canWebGL&&(window.forceWebGL||(crios||firefox27plus||safari7plus||edge||wechat||dingding)&&"other"!=plat_1),crios=window.forceWebGLBaseRender||canWebGL?"w":"d",firefox27plus=uaHas("webkit"),safari7plus="WebKitCSSMatrix"in win_1&&"m11"in new window.WebKitCSSMatrix,dingding="MozPerspective"in windowsWechat.style,windowsWechat="OTransition"in windowsWechat.style,any3d=ie3d||safari7plus||dingding||windowsWechat,config=void 0!==config[12]?config[12]:null,localStore=!0;try{void 0===win_1.localStorage?localStore=!1:(tmpData=(new Date).getTime()+"",win_1.localStorage.setItem("_test",tmpData),win_1.localStorage.getItem("_test")!==tmpData&&(localStore=!1),win_1.localStorage.removeItem("_test"))}catch(e){localStore=!1}var tmpData=parseInt(ua.split("chrome/")[1]),Browser={iPad:iPad,iPhone:iPhone,size:iPhone?100:android_1?200:500,mac:mac,windows:windows,ios:iTouch,ios10:ios10,android:android_1,android23:android23,gaodeCoords:gaodeCoords,plat:plat_1,baidu:baidu,qq:qq,safari:safari,wechat:wechat,ie:ie,ie6:androidVersion,ie7:ie7,ie9:ie9,ie10:ie10,ielt9:ielt9,ielt10:ielt10,ie11:ie11,edge:edge,ielt11:ie&&!ie11,mb2345Browser:mb2345Browser,localStore:localStore,vdataVersion:config,geolocation:mobile_1||ie&&!ielt9||edge,uc_:uc,uc:uc&&!chrome,chrome:chrome,drawTextDir:!0,firefox:firefox,hardwareAccEnabled:hardwareAccEnabled,isMobile:mobile_1,mobileWebkit:mobile_1&&firefox27plus,mobileWebkit3d:mobile_1&&safari7plus,mobileOpera:mobile_1&&win_1.opera,isRetina:retina,viewportScale:viewportScale,needFitRetina:needFitRetina_1,touch:winPhone,msPointer:msPointer,pointer:pointer,pointerDev:pointerDev,chrome57:chrome&&57<=tmpData,chrome64:!mobile_1&&chrome&&64<=tmpData,webkit:firefox27plus,ie3d:ie3d,webkit3d:safari7plus,gecko3d:dingding,opera3d:windowsWechat,any3d:any3d,isSvg:isSvg,isCanvas:isCanvas_1,isWorker:isWorker_1,useLabelImage:!1,isWebGL:canWebGL,webglContextName:webglContextName_1,webglParams:webglParams_1,graphicCard:graphicCard_1,maxRenderSize:maxRenderSize_1,DataUrl2Blob:!1,movingDraw:movingDraw,baseRender:enableVector?crios:"d",scale:retina?2:1,getContext:function(canvas,opt){var params={};return extend(params,webglParams_1),extend(params,opt),canvas.getContext(webglContextName_1,params)},isWebp:!1,wasm:wasm,amapRunTime:amapRunTime,checkWebgl:macWechat};callback=function(isWebp){Browser.isWebp=isWebp},(webP=new Image).src="data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA",webP.onload=webP.onerror=function(){callback(2===webP.height)}}return Browser}("undefined"==typeof config?[]:config),getTag=("undefined"!=typeof createImageBitmap&&"undefined"!=typeof ImageBitmap&&(Browser.imageBitmap=!0),Boolean(Browser.isWorkerEnv?!Browser.safari&&!Browser.macWechat&&!Browser.windowsWechat&&self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"):!Browser.safari&&!Browser.macWechat&&!Browser.windowsWechat&&window.fetch&&window.Request&&window.AbortController&&window.Request.prototype.hasOwnProperty("signal")));function A(aA1,aA2){return 1-3*aA2+3*aA1}function B(aA1,aA2){return 3*aA2-6*aA1}function calcBezier(aT,aA1,aA2){return((A(aA1,aA2)*aT+B(aA1,aA2))*aT+3*aA1)*aT}function getSlope(aT,aA1,aA2){return 3*A(aA1,aA2)*aT*aT+2*B(aA1,aA2)*aT+3*aA1}function LinearEasing(x){return x}function getQuadBezierValue(t,p1,p2,p3){var iT;return 1<=t?p3:(iT=1-t)*iT*p1+2*iT*t*p2+t*t*p3}function cubic(t,p0,p1,p2,p3){var cX,bX,cY,aX;return 1<=t?p3:(cX=3*(p1.pos[0]-p0.pos[0]),bX=3*(p2.pos[0]-p1.pos[0])-cX,aX=p3.pos[0]-p0.pos[0]-cX-bX,cY=3*(p1.pos[1]-p0.pos[1]),p2=3*(p2.pos[1]-p1.pos[1])-cY,p1=p3.pos[1]-p0.pos[1]-cY-p2,p3=aX*Math.pow(t,3)+bX*Math.pow(t,2)+cX*t+p0.pos[0],aX=p1*Math.pow(t,3)+p2*Math.pow(t,2)+cY*t+p0.pos[1],ProjectionManager.getProjection("EPSG:3857").unproject(p3,aX))}function quad(t,p0,p1,p2){return ProjectionManager.getProjection("EPSG:3857").unproject(getQuadBezierValue(t,p0.pos[0],p1.pos[0],p2.pos[0]),getQuadBezierValue(t,p0.pos[1],p1.pos[1],p2.pos[1]))}function getCoordsWithControlPoints(prev,next,cpList,scaleFactor){var result=null;return prev&&cpList&&cpList.length&&((prev=[prev]).push.apply(prev,cpList),prev.push(next),result=function(num,pList){var func=null;switch(pList.length){case 3:func=quad;break;case 4:func=cubic;break;default:return null}for(var coords=[],params=[0].concat(pList),i=1;i<num-2;i++)params[0]=i/num,coords.push(func.apply(null,params));return coords.push(pList[pList.length-1]),coords}(function(pList,scaleFactor){for(var tolerance=4,interpolateLimit=[3,300],tolerance=Math.max(2,tolerance),xLen=0,yLen=0,i=0,len=pList.length;i<len-1;i++){var p1=pList[i],p2=pList[i+1];xLen+=Math.abs(p2.pos[0]-p1.pos[0]),yLen+=Math.abs(p2.pos[1]-p1.pos[1])}return Math.min(interpolateLimit[1],Math.max(interpolateLimit[0],Math.round(Math.max(xLen,yLen)/scaleFactor/tolerance)))}(prev,scaleFactor),prev)),result||[next]}Browser.canceledWorkerFetch=getTag,Browser.amapRunTime={workerTime:{}},records={},NEWTON_ITERATIONS=4,SUBDIVISION_PRECISION=1e-7,SUBDIVISION_MAX_ITERATIONS=10,float32ArraySupported="function"==typeof Float32Array;var NebulaTagType,BezierUtil={quad:quad,cubic:cubic,easing:function(mX1,mY1,mX2,mY2){if(!(0<=mX1&&mX1<=1&&0<=mX2&&mX2<=1))throw new Error("bezier x values must be in [0, 1] range");var easingKey=arguments.toString();if(records[easingKey])return records[easingKey];if(mX1===mY1&&mX2===mY2)return LinearEasing;for(var sampleValues=new(float32ArraySupported?Float32Array:Array)(11),i=0;i<11;++i)sampleValues[i]=calcBezier(.1*i,mX1,mX2);function getTForX(aX){for(var intervalStart=0,currentSample=1;10!==currentSample&&sampleValues[currentSample]<=aX;++currentSample)intervalStart+=.1;var guessForT=intervalStart+.1*((aX-sampleValues[--currentSample])/(sampleValues[currentSample+1]-sampleValues[currentSample])),initialSlope=getSlope(guessForT,mX1,mX2);return.001<=initialSlope?function(aX,aGuessT,mX1,mX2){for(var i=0;i<NEWTON_ITERATIONS;++i){var currentSlope=getSlope(aGuessT,mX1,mX2);if(0===currentSlope)return aGuessT;aGuessT-=(calcBezier(aGuessT,mX1,mX2)-aX)/currentSlope}return aGuessT}(aX,guessForT,mX1,mX2):0===initialSlope?guessForT:function(aX,aA,aB,mX1,mX2){for(var currentX,currentT,i=0;0<(currentX=calcBezier(currentT=aA+(aB-aA)/2,mX1,mX2)-aX)?aB=currentT:aA=currentT,Math.abs(currentX)>SUBDIVISION_PRECISION&&++i<SUBDIVISION_MAX_ITERATIONS;);return currentT}(aX,intervalStart,intervalStart+.1,mX1,mX2)}function easingFunction(x){return 0===x?0:1===x?1:calcBezier(getTForX(x),mY1,mY2)}return records[easingKey]=easingFunction},getInterpolateCoords:function(lngLats,scaleFactor){for(var coords=[],i=0,len=lngLats.length;i<len;i+=1)coords.push.apply(coords,getCoordsWithControlPoints(lngLats[i-1],lngLats[i],lngLats[i].controlPoints,scaleFactor));return coords},getInterpolateLngLats:function(lngLats,crs,scaleFactor,opts){for(var coords=this.getInterpolateCoords(lngLats,crs,scaleFactor,opts),results=[],i=0,len=coords.length;i<len;i++)results.push(function(crs,a){return Array.isArray(a)&&(a=new Pixel(a[0],a[1])),crs.containerTolnglat(a,20)}(crs,coords[i]));return results}},lcs=new(function(){function LCS(){this._wordCoord=[-20037508.342789244,-20037508.342789244,20037508.342789244,20037508.342789244],this._widthNum=128,this._heightNum=128,this._widthSize=(this._wordCoord[2]-this._wordCoord[0])/this._widthNum,this._heightSize=(this._wordCoord[3]-this._wordCoord[1])/this._heightNum}return LCS.prototype.setMap=function(map){this.map=map},LCS.prototype.getSize=function(){return[this._widthSize,this._heightSize]},LCS.prototype.getNum=function(){return[this._widthNum,this._heightNum]},LCS.prototype.getLocalByLnglat=function(lnglat){var _a=(_a=ProjectionManager.getProjection("EPSG:3857")).project.apply(_a,lnglat);return this.getLocalByCoord(_a)},LCS.prototype.getLocalByCoord=function(coord){var x=Math.floor(coord[0]/this._widthSize),y=Math.floor(coord[1]/this._heightSize),local=this.getLocalCenterByXY(x,y);return{deltaCenter:[coord[0]-local.center[0],coord[1]-local.center[1]],x:x,y:y,center:local.center,bbox:local.bbox}},LCS.prototype.getLocalCenterByXY=function(x,y){var center={x:x,y:y,center:[0,0],bbox:[0,0,0,0]};return center.center=[(x+.5)*this._widthSize,(y+.5)*this._heightSize],center.bbox=[x*this._widthSize,y*this._heightSize,(x+1)*this._widthSize,(y+1)*this._heightSize],center},LCS.prototype.getDeltaCoord=function(coord){var centerObj=this.getLocalByCoord(coord);return[coord[0]-centerObj.center[0],coord[1]-centerObj.center[1]]},LCS}()),globalInstance=self,TagMap=(!function(NebulaTagType){NebulaTagType.LITE="lite",NebulaTagType.LEFT="left",NebulaTagType.ALL="all",NebulaTagType.NONE=""}(NebulaTagType=NebulaTagType||{}),{2:"all",3:"all",4:"all",5:"all",6:"lite",7:"all",8:"lite",9:"all",10:"lite",11:"lite",12:"all",13:"all",14:"all",15:"lite",16:"lite",17:"all",18:"all",19:"all",20:"all"}),colorNameDist={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",grey:"#808080",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Util=function(){var supportNativeBind,CHARS,isWorker,lastId,lastTime,requestFn_1,cancelFn_1,requestFn,cancelFn,originUtil={CLASS_NAME:"AMap.Util",WorldAxesCenter:{x:0,y:0},Single:{},stamp:(isWorker=!0===Browser.isWorkerEnv,lastId=1e5,function(obj){return obj._amap_id=isWorker?++lastId:--lastId,obj._amap_id}),singlton:function(singltonClass){return Util.Single[singltonClass]||new singltonClass},getOptimalZoom:function(z){return z<Math.floor(z)+.8?Math.floor(z):Math.ceil(z)},join:function(object,sp){if(object.join)return object.join(sp);var i,r=[];for(i in object)object.hasOwnProperty(i)&&r.push(i+"="+(object[i]||""));return r.join(sp)},getGuid:function(pre,median){return void 0===median&&(median=10),(pre||"")+Math.round(Math.random()*Math.pow(10,median))+"_"+(new Date).getTime()},uuid:(CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),function(len,radix){var i,chars=CHARS,uuid=[];if(radix=(radix=void 0===radix?62:radix)||chars.length,len=void 0===len?0:len)for(i=0;i<len;i++)uuid[i]=chars[0|Math.random()*radix];else{var r;for(uuid[8]=uuid[13]=uuid[18]=uuid[23]="-",uuid[14]="4",i=0;i<36;i++)uuid[i]||(r=0|16*Math.random(),uuid[i]=chars[19===i?3&r|8:r])}return uuid.join("")}),endsWith:function(longStr,shortStr){return longStr.endsWith?longStr.endsWith(shortStr):!(longStr.length<shortStr.length)&&longStr.substr(longStr.length-shortStr.length)===shortStr},suspendedServices:[],globalPan:268435456,p20Center:[215440491,106744817],fps:{start:function(instance){instance.startTime=new Date,instance.times=[];function animate(){var now_=(new Date).getTime();instance.times.push(now_-lastTime),lastTime=now_,instance.id=Util.requestAnimFrame(animate)}var lastTime=(new Date).getTime();instance.id=Util.requestAnimFrame(animate)},cancel:function(instance){instance.id&&Util.cancelAnimFrame(instance.id)},stop:function(instance){instance.costTime=Date.now()-instance.startTime,this.cancel(instance),instance.fps=Math.round(1e3/(instance.costTime/(instance.times.length+1)))}},getTransitionalVal:function(preValue,nextValue,percent,easeFunction,isRound){if(void 0===isRound&&(isRound=!1),preValue===nextValue)return nextValue;switch(easeFunction=void 0===easeFunction?"linear":easeFunction){case"ease":percent=BezierUtil.easing(.25,.1,.25,1)(percent);break;case"ease-in":percent=BezierUtil.easing(.42,0,1,1)(percent);break;case"ease-out":percent=BezierUtil.easing(0,0,.58,1)(percent);break;case"ease-in-out":percent=BezierUtil.easing(.42,0,.58,1)(percent)}easeFunction=preValue+(nextValue-preValue)*percent;return isRound&&(easeFunction>>=0),easeFunction},createObjectURL:function(code,contentType){void 0===contentType&&(contentType="text/javascript; charset=utf-8");var url=null;try{url=(globalInstance.URL||globalInstance.webkitURL).createObjectURL(new Blob([code],{type:contentType}))}catch(e){url=null}return url},revokeObjectURL:function(url){try{(globalInstance.URL||globalInstance.webkitURL).revokeObjectURL(url)}catch(e){}},arrayToVIObj:function(array){for(var obj={},i=0,l=array.length;i<l;i++)obj[array[i]]=i;return obj},lnglatToCoords:function(lnglat,z){var z=Math.pow(2,z),dlat=180/z;return[Math.floor(lnglat[0]/(360/z))+z/2,z/2-Math.ceil(lnglat[1]/dlat)]},computeTileRange:function(bounds,z,isPure){void 0===isPure&&(isPure=!1);var minlnglat=[bounds[0],bounds[3]],bounds=[bounds[2],bounds[1]],minlnglat=this.lnglatToCoords(minlnglat,z),bounds=this.lnglatToCoords(bounds,z),minX=minlnglat[0],minY=minlnglat[1],maxX=bounds[0],maxY=bounds[1];if(isPure)return{minX:minX,minY:minY,maxX:maxX,maxY:maxY,z:z};this._optimalTileRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY,z:z};for(var tileRange=[],i=minX;i<=maxX;i+=1)for(var j=minY;j<=maxY;j+=1)tileRange.push([z,i,j]);return tileRange},getMappingKey:function(conf){var obj={};if(Util.is(conf,"object"))for(var key in conf)conf.hasOwnProperty(key)&&(obj[conf[key]]=key);return obj},merge:function(array1,array2){if(array2.length<5e4)array1.push.apply(array1,array2);else for(var ii=0,iilen=array2.length;ii<iilen;ii+=1)array1.push(array2[ii])},clone:function(a){if("object"!=typeof a||null===a)return a;if(a.noDeepClone||this.is(a,"Float32Array")||this.is(a,"Uint16Array"))return a;var i,b=this.isArray(a)?[]:{};for(i in a)a.hasOwnProperty(i)&&(b[i]=Util.clone(a[i]));return b},isInteger:function(num){return(0|num)===num},isNumber:function(num){return!isNaN(num)},setPrototypeOf:"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:function(obj,_prototype){for(var key in _prototype)obj[key]=_prototype[key]},isFunction:function(value){return"function"==typeof value},argbToArray:function(argb,format){if(void 0===format&&(format="webgl"),!argb)return argb;for(var array=[],i=0,l=argb.length;i<l;i+=2){var val=parseInt(argb.substr(i,2),16);("webgl"===format||"rgba"===format&&0===i)&&(val=this.format(val/255,3)),array.push(val)}return array.push(array.shift()),array},noop:function(){},keys:"function"==typeof Object.keys?Object.keys:function(obj){var key,keys=[];for(key in obj)obj.hasOwnProperty(key)&&keys.push(key);return keys},map:function(collection,fun,context){void 0===context&&(context=null);var newCollection=[];return collection&&collection.length?(Util.each(collection,function(){for(var args=[],_a=0;_a<arguments.length;_a++)args[_a]=arguments[_a];newCollection[args[1]]=fun.apply(context||collection,args)}),newCollection):collection},forEach:function(collection,fun){if(collection&&collection.length){var l=collection.length;if(0<l&&(fun(collection[0],0),1<l)){fun(collection[1],1);for(var i=2;i<l;i++)fun(collection[i],i)}}},each:function(collection,fun,context){if(void 0===context&&(context=null),collection&&collection.length)for(var i=0,l=collection.length;i<l&&!1!==fun.call(context,collection[i],i,collection);i++);},find:function(collection,fn,context){void 0===context&&(context=null);for(var i=0,l=collection.length;i<l;i++)if("function"==typeof fn){if(fn.call(context,collection[i],i,collection))return collection[i]}else if(collection[i]===fn)return collection[i];return null},isDOM:function(obj){return"object"==typeof HTMLElement?obj instanceof HTMLElement:obj&&"object"==typeof obj&&1===obj.nodeType&&"string"==typeof obj.nodeName},uncodeCoords:function(ori,version){for(var charactersLength,d,characters="ASDFGHJKLQWERTYUIO!sdfghjkleiu3~yr5-P&mq9`%zCN*b=8@^xpVM",offset="v5"<(version=version||"v5")?(charactersLength=characters.length,512):(characters=characters.substr(0,charactersLength=27),333),res=[],temp=NaN,_i=0,_len=ori.length;_i<_len;_i++)d=ori[_i],d=characters.indexOf(d),temp=isNaN(temp)?d*charactersLength:(res.push(temp+d-offset),NaN);return res},separateDoForLoop:function(func,array){for(var unit=1,unit=512<array.length?Math.round(Math.pow(array.length,.5)):array.length,groups=Math.ceil(array.length/unit),i=0;i<groups;i+=1){var s=unit*i,e=s+unit;e>array.length&&(e=array.length);for(var j=s;j<e;j+=1)func(array[j])}},colorToArray:function(color){var rgbaColor;return/^rgba\\(/.test(color)?this.rgbaStrToArray(color):("#"===(rgbaColor=color=this.colorNameToHex(color))[0]&&(3===(color=color.substring(1)).length&&(color=color.replace(/./g,function(str){return str+str})),rgbaColor=this.argbHex2Rgba(8===color.length?color:"ff"+color)),this.rgbaStrToArray(rgbaColor))},colorNameToHex:function(colorName){return"string"==typeof(colorName=(colorName=void 0===colorName?"":colorName).toLowerCase())&&colorNameDist[colorName]||colorName},enCodeTileCoord:function(x,y,z){var r=Math.floor(z/2),q=z-r,r=(1<<r)-1<<q,q=(1<<q)-1;return[z,x&r|y&q,y&r|x&q]},encodeURICom:function(keyword){return keyword?encodeURIComponent(keyword):""},getStyle:function(styles,styletype,styleid,level){var styleMap=styles[styletype].i[styleid];if(void 0===styleMap)return null;if(styleid=styles[styletype].s,"number"==typeof styleMap)return styleid[styleMap];for(;void 0===styleMap[level.toString()]&&!(--level<3););return"number"==typeof(styles=styleMap[level.toString()])?styleid[styles]:null},rgbaStrToArray:function(rgba){rgba=rgba.split(",");return rgba[0]=parseFloat(rgba[0].split("rgba(")[1])/255,rgba[1]=parseFloat(rgba[1])/255,rgba[2]=parseFloat(rgba[2])/255,rgba[3]=parseFloat(rgba[3]),rgba},rgbStrToArray:function(rgb){rgb=rgb.split(",");return rgb[0]=parseFloat(rgb[0].split("rgb(")[1])/255,rgb[1]=parseFloat(rgb[1])/255,rgb[2]=parseFloat(rgb[2])/255,rgb},rgbaArray2rgba:function(array){return"rgba("+255*array[0]+","+255*array[1]+","+255*array[2]+","+array[3]+")"},color2Rgba:function(color){return this.rgbaArray2rgba(this.color2RgbaArray(color))},color2RgbaArray:function(color){var hexOrRgbOrRgba,r,oc,h,s,l,hex;return color instanceof Array?(3==color.length&&color.push(1),color):0==(hexOrRgbOrRgba=this.colorNameToHex(color)).indexOf("rgb(")?((r=this.rgbStrToArray(hexOrRgbOrRgba)).push(1),r):0==hexOrRgbOrRgba.indexOf("rgba(")?this.rgbaStrToArray(hexOrRgbOrRgba):0==hexOrRgbOrRgba.indexOf("#")?4===hexOrRgbOrRgba.length?(hex=hexOrRgbOrRgba.substr(1).replace(/./g,function(str){return str+str}),this.rgbHex2RgbaArray(hex)):7==hexOrRgbOrRgba.length?this.rgbHex2RgbaArray(hexOrRgbOrRgba.substr(1)):9==hexOrRgbOrRgba.length?(r=hexOrRgbOrRgba.substr(1),this.argbHex2RgbaArray(r)):void 0:0===hexOrRgbOrRgba.indexOf("hsla")?(oc=color.substr(5).split(","),h=parseInt(oc[0],10)/360,s=parseInt(oc[1],10)/100,l=parseInt(oc[2],10)/100,r=parseFloat(oc[3]),this.HSLA2RGBA(h,s,l,r)):0===hexOrRgbOrRgba.indexOf("hsl")?(oc=color.substr(4).split(","),h=parseInt(oc[0],10)/360,s=parseInt(oc[1],10)/100,l=parseInt(oc[2],10)/100,this.HSLA2RGBA(h,s,l,1)):3===hexOrRgbOrRgba.length?(hex=hexOrRgbOrRgba.replace(/./g,function(str){return str+str}),this.rgbHex2RgbaArray(hex)):6==hexOrRgbOrRgba.length?this.rgbHex2RgbaArray(hexOrRgbOrRgba):8==hexOrRgbOrRgba.length?this.argbHex2RgbaArray(hexOrRgbOrRgba):void 0},HSLA2RGBA:function(h,s,l,a){var r,g,b;return 0===s?r=g=b=l:(r=this.hue2rgb(s=2*l-(l=l<.5?l*(1+s):l+s-l*s),l,h+1/3),g=this.hue2rgb(s,l,h),b=this.hue2rgb(s,l,h-1/3)),[r,g,b,a]},hue2rgb:function(p,q,t){return t<0&&(t+=1),1<t&&--t,t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+(q-p)*(2/3-t)*6:p},rgbHex2Rgba:function(hex){return hex.startsWith("#")&&(hex=hex.slice(1)),Util.argbHex2Rgba("ff"+hex)},argbHex2Rgba:function(hex){for(var parts=[],i=0,len=(hex=hex.startsWith("#")?hex.slice(1):hex).length;i<len;i+=2)parts.push(parseInt(hex.substr(i,2),16));return parts.push((parts.shift()/255).toFixed(2)),"rgba("+parts.join(",")+")"},Opacity2Rgba:function(opacity,color){var newColor=color;return color&&color[3]&&opacity&&(color[3]=Math.floor(255*opacity)),newColor},Hex2Rgba:function(hex){if("string"!=typeof hex)return!1;for(var parts=[],i=0,len=hex.length;i<len;i+=2)parts.push(parseInt(hex.substr(i,2),16));return parts.push(parseInt(parts.shift())),parts},rgbHex2RgbaArray:function(hex){return this.rgbaHex2RgbaArray(hex+"ff")},argbHex2RgbaArray:function(hex){for(var parts=[],i=0,len=hex.length;i<len;i+=2)parts.push(parseInt(hex.substr(i,2),16)/255);return parts.push(parts.shift()),parts},rgbaHex2RgbaArray:function(hex){hex=parseInt(hex,16);return[(hex>>24&255)/255,(hex>>16&255)/255,(hex>>8&255)/255,(255&hex)/255]},isEmpty:function(obj){for(var i in obj)if(obj.hasOwnProperty(i))return!1;return!0},delArrayItem:function(array,n){return 0<=n&&array.splice(n,1),array},startsWith:function(_long,_short){return _long.startsWith?_long.startsWith(_short):_long.substr(0,_short.length)===_short},deleteItemFromArray:function(array,item){item=Util.indexOf(array,item);return Util.delArrayItem(array,item)},deleteItemFromArrayByIndex:function(array,index){return Util.delArrayItem(array,index)},filter:function(array,fun,context){var ret=[];return Util.each(array,function(item,i){fun.call(context,item,i)&&ret.push(item)}),ret},indexOf:function(array,item){if(array&&array.length){if(array.indexOf)return array.indexOf(item);for(var i=0;i<array.length;i+=1)if(array[i]===item)return i}return-1},endsWith_:function(longStr,shortStr){return longStr.endsWith?longStr.endsWith(shortStr):!(longStr.length<shortStr.length)&&longStr.substr(longStr.length-shortStr.length)==shortStr},bind:(supportNativeBind=!1,Boolean(Function.prototype.bind)&&(supportNativeBind=!0),function(fn,context){var args=2<arguments.length?Array.prototype.slice.call(arguments,2):null;return supportNativeBind?args?(args.unshift(context),fn.bind.apply(fn,args)):fn.bind(context):function(){return fn.apply(context,args||arguments)}}),setOptions:function(obj,opts){return obj.opts=assign({},obj.opts,opts=opts||{}),obj.opts},cloneDeep:function(value,customizer,thisArg){return"function"==typeof customizer?this.baseClone(value,!0,this.bindCallback(customizer,thisArg,1)):this.baseClone(value,!0)},baseClone:function(value,isDeep,customizer,key,object,stackA,stackB){var result;if(void 0===(result=customizer?object?customizer(value,key,object):customizer(value):result)){if(!this.isObject(value))return value;key=this.isArray(value);if(key){if(result=this.initCloneArray(value),!isDeep)return this.arrayCopy(value,result)}else{var tag=Object.prototype.toString.call(value),isFunc="[object Function]"==tag;if("[object Object]"!=tag&&"[object Arguments]"!=tag&&(!isFunc||object))return object?value:{};if(result=this.initCloneObject(isFunc?{}:value),!isDeep)return this.baseAssign(result,value)}stackB=stackB||[];for(var length=(stackA=stackA||[]).length;length--;)if(stackA[length]==value)return stackB[length];stackA.push(value),stackB.push(result),(key?this.arrayEach:this.baseForOwn)(value,function(subValue,key){result[key]=Util.baseClone(subValue,isDeep,customizer,key,value,stackA,stackB)})}return result},baseAssign:function(object,source){return null==source?object:this.baseCopy(source,Object.keys(source),object)},isObject:function(value){var type=typeof value;return!!value&&("object"==type||"function"==type)},isObjectLike:function(value){return!!value&&"object"==typeof value},isLength:function(value){return"number"==typeof value&&-1<value&&value%1==0&&value<=9007199254740991},initCloneArray:function(array){var length=array.length,result=new Array(length);return length&&"string"==typeof array[0]&&Object.hasOwnProperty.call(array,"index")&&(result.index=array.index,result.input=array.input),result},arrayCopy:function(source,array){var index=-1,length=source.length;for(array=array||Array(length);++index<length;)array[index]=source[index];return array},initCloneObject:function(object){object=object.constructor;return new(object="function"==typeof object&&object instanceof object?object:Object)},bindCallback:function(func,thisArg,argCount){if("function"!=typeof func)return this.identity;if(void 0===thisArg)return func;switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)};case 5:return function(value,other,key,object,source){return func.call(thisArg,value,other,key,object,source)}}return function(){return func.apply(thisArg,arguments)}},arrayEach:function(array,iteratee){for(var index=-1,length=array.length;++index<length&&!1!==iteratee(array[index],index,array););return array},identity:function(value){return value},createBaseFor:function(fromRight){return function(object,iteratee,keysFunc){for(var iterable=Util.toObject(object),props=keysFunc(object),length=props.length,index=fromRight?length:-1;fromRight?index--:++index<length;){var key=props[index];if(!1===iteratee(iterable[key],key,iterable))break}return object}},baseForOwn:function(object,iteratee){return Util.createBaseFor()(object,iteratee,Object.keys)},toObject:function(value){return Util.isObject(value)?value:Object(value)},baseCopy:function(source,props,object){object=object||{};for(var index=-1,length=props.length;++index<length;){var key=props[index];object[key]=source[key]}return object},falseFn:function(){return!1},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",getTimestamp:Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},limitExecByInterval:function(fn,time,context,ignoreWhenLock){var lastRunTime_1,curTime_1,fnGetTime_1,wrapperFn,lock_1,args_1,later_1;return wrapperFn=ignoreWhenLock?(lastRunTime_1=0,fnGetTime_1=this.getTimestamp,function(){if((curTime_1=fnGetTime_1())-lastRunTime_1<time)return!1;lastRunTime_1=curTime_1,fn.apply(context,arguments)}):(later_1=function(){lock_1=!1,args_1&&(wrapperFn.apply(context,args_1),args_1=!1)},function(){lock_1?args_1=arguments:(lock_1=!0,fn.apply(context,arguments),setTimeout(later_1,time))})},format:function(num,digits){return num===num<<0?num:+parseFloat(num+"").toFixed(digits||0)},isArray:Array.isArray||function(array){return this.is(array,"array")},is:function(obj,type){return Object.prototype.toString.call(obj).split(" ")[1].slice(0,-1).toLowerCase()===type.toLowerCase()},includes:"function"==typeof Array.prototype.includes?function(arr,val){return arr.includes(val)}:function(arr,val){return-1!==this.indexOf(arr,val)},strHashCode:function(str){var hash=0;if(0!==str.length)for(var i=0,len=str.length;i<len;i+=1)hash=(hash<<5)-hash+str.charCodeAt(i),hash&=hash;return hash},decode_:function(str,key){key=key?Math.ceil(parseInt(key.substr(6))/24):1;for(var result="",i=0,strlen=str.length;i<strlen;i++)result+=String.fromCharCode((str.charCodeAt(i)-256-key+65535)%65535);return result},decodeLngLat:function(lng,lat){var lngKey=(lng+"").slice(-2),latKey=(lat+"").slice(-2),ms=(lng=lng.slice(0,-2),lat=lat.slice(0,-2),parseInt((latKey+lngKey).slice(1))),lngDir=Math.ceil(ms/250)%2?1:-1,ms=1<ms/500?1:-1;return lng-=parseInt("1"+lngKey)/3e3*lngDir,lat-=parseInt("1"+latKey)/3e3*ms,new LngLat$1(parseFloat(lng).toFixed(5),parseFloat(lat).toFixed(5))},objHashCode:function(obj){return"undefined"!=typeof JSON&&JSON.stringify?Util.strHashCode(JSON.stringify(obj)):null},stampHashCode:function(obj,refresh){var key="_amap_hash";return!refresh&&obj.hasOwnProperty(key)||(refresh=Util.objHashCode(obj))&&(obj[key]=refresh),obj[key]},parseLngLatData:function(data){if(Util.isArray(data)){var type;if(!Util.isArray(data[0]))return"string"==(type=typeof data[0])||"number"==type?new LngLat$1(data[0],data[1]):data;for(var i=0;i<data.length;i+=1)data[i]=Util.parseLngLatData(data[i])}return data},xy2arr:function(xys){for(var r=[],i=0,len=xys.length;i<len;i+=1)r[i]=[xys[i].x,xys[i].y];return r},parseSize:function(data){return Util.isArray(data)?new Size(data[0],data[1]):data},getDeltaCenter:function(localCenter,frameState){var deltaX,localDeltaCenter=[0,0],zoom=Util.getOptimalZoom(frameState.viewState.zoom);return localCenter&&13<=zoom?(zoom=lcs.getSize(),frameState=frameState.viewState.centerCoord,frameState=lcs.getLocalByCoord([frameState[0],frameState[1]]),deltaX=localCenter.x-frameState.x,frameState=localCenter.y-frameState.y,0!=deltaX&&(deltaX*=zoom[0],localDeltaCenter[0]=deltaX),0!=frameState&&(frameState*=zoom[1],localDeltaCenter[1]=frameState)):localCenter&&(localDeltaCenter[0]+=localCenter.center[0],localDeltaCenter[1]+=localCenter.center[1]),localDeltaCenter},checkInZooms:function(zoom,zooms){return zoom>=zooms[0]&&zoom<=zooms[1]},getTileTagByZoom:function(key,optimalZoom,forceAll){void 0===forceAll&&(forceAll=!1);key=(key=void 0===key?"":key).split(",")[0]||"";return!forceAll&&key&&optimalZoom&&TagMap[optimalZoom]||"all"},getTileTagByZ:function(z,optimalZoom,forceAll){return!(forceAll=void 0!==forceAll&&forceAll)&&z&&optimalZoom&&TagMap[optimalZoom]||"all"},containTag:function(tag1,tag2){return!(!tag1||!tag2)&&(tag1=this.getNumberByTag(tag1),this.getNumberByTag(tag2)<=tag1)},getNumberTag:function(tag){var numberTag;switch(tag=void 0===tag?"all":tag){case"lite":numberTag=0;break;case"left":numberTag=1;break;default:numberTag=2}return numberTag},getStringTag:function(tag){var numberTag;switch(tag=void 0===tag?2:tag){case 0:numberTag=NebulaTagType.LITE;break;case 1:numberTag=NebulaTagType.LEFT;break;default:numberTag=NebulaTagType.ALL}return numberTag},getNumberByTag:function(tag){var tagNumber=0;switch(tag){case"lite":tagNumber=0;break;case"left":tagNumber=1;break;case"all":tagNumber=2}return tagNumber}};function timeoutDefer(fn){var time=+new Date,timeToCall=Math.max(0,(Browser.android?50:20)-(time-lastTime));return lastTime=time+timeToCall,globalInstance.setTimeout(fn,50)}function timeoutClear(id){globalInstance.clearTimeout(id)}function getPrefixed(name){for(var fn,prefixes=["webkit","moz","o","ms"],i=0;i<prefixes.length&&!fn;i+=1)fn=globalInstance[prefixes[i]+name];return fn}lastTime=0,Browser.isWorkerEnv?(requestFn_1=timeoutDefer,cancelFn_1=timeoutClear,originUtil.requestAnimFrame=function(fn,context,immediate,element){if(!immediate)return requestFn_1(function(){context?Util.bind(fn,context).call(context,element):fn()});context?Util.bind(fn,context).call(context,element):fn()},originUtil.cancelAnimFrame=function(id){id&&cancelFn_1.call(globalInstance,id)}):(requestFn=globalInstance.requestAnimationFrame||getPrefixed("RequestAnimationFrame")||timeoutDefer,cancelFn=globalInstance.cancelAnimationFrame||getPrefixed("CancelAnimationFrame")||getPrefixed("CancelRequestAnimationFrame")||timeoutClear,originUtil.requestAnimFrame=function(fn,context,immediate,element){if(!immediate)return requestFn(function(){context?Util.bind(fn,context).call(context,element):fn()});context?Util.bind(fn,context).call(context,element):fn()},originUtil.cancelAnimFrame=function(id){id&&cancelFn.call(globalInstance,id)}),Browser.isWorkerEnv||(originUtil.requestIdleCallback=globalInstance.requestIdleCallback?function(callback,options){return globalInstance.requestIdleCallback(callback,options)}:function(cb,options){void 0===options&&(options={});var start=Util.getTimestamp();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,70-(Util.getTimestamp()-start))}})},options.timeout||0)},originUtil.cancelIdleCallback=globalInstance.cancelIdleCallback?function(handler){return globalInstance.cancelIdleCallback(handler)}:function(id){clearTimeout(id)});var Util=originUtil;return Util}();function isLngLat(obj){return obj&&"AMap.LngLat"===obj.className}var CONSTS_Events={MOVE_START:"movestart",MOVING:"moving",MOVE_END:"moveend",MOVE_ALONG:"movealong"},freeSelf={clip:null,clips:[],markerAnimation:null,moveTo:function(targetPosition,params){var markerAnimation,position,targetPositionArr,duration,speed,easing,autoRotation,clip,path,eventType,lastStep,currentStep,_this=this;if(this._map||(this._map=this._parent&&this._parent.map),this._map&&targetPosition)return this._initAnimation(),this._map,markerAnimation=this.markerAnimation,position=isLngLat(position=this.getPosition())?position.toJSON():position,targetPositionArr=isLngLat(targetPosition)?targetPosition.toJSON():targetPosition,duration=(params=params||{}).duration,speed=params.speed,easing=params.easing,params=params.autoRotation,autoRotation=void 0===params||params,params=duration||(speed?this._getDuration(speed,position,targetPosition):0),clip=this._getClip({duration:params,easing:easing||"Linear"},{x:[position[0],targetPositionArr[0]],y:[position[1],targetPositionArr[1]]}),path=[new AMap.LngLat(position[0],position[1]),new AMap.LngLat(targetPositionArr[0],targetPositionArr[1])],eventType=CONSTS_Events.MOVING,lastStep=path[0],clip.on("start",function(e){var type=CONSTS_Events.MOVE_START,e=_this._getMoveStartEvent(type,e,path);_this.emit(type,e)}),clip.on("update",function(e){var e=_this._getMovingEvent(eventType,e,path,0),index=e.index;autoRotation&&!clip._hasSetRotation&&"AMap.Marker"===_this.CLASS_NAME&&(clip._hasSetRotation=!0,currentStep=path[index+1],lastStep=path[index])&¤tStep&&(!1===(index=_this._getOrientationByLngLats(lastStep,currentStep))?index=_this.lastAngle||0:_this.lastAngle=index,_this.setOrientation(index)),_this.emit(eventType,e)}),clip.on("complete",function(e){var type=CONSTS_Events.MOVE_END,e=_this._getMoveEndEvent(type,e,path);_this.emit(type,e)}),markerAnimation.addClip(clip),markerAnimation.start(),this},startMove:function(){this.markerAnimation&&(this._destroyClip(),this.markerAnimation.reset(),this.markerAnimation.start())},stopMove:function(){this.markerAnimation&&this.markerAnimation.stop()},pauseMove:function(){this.markerAnimation&&this.markerAnimation.pause()},resumeMove:function(){this.markerAnimation&&this.markerAnimation.start()},moveAlong:function(path,params){var _this=this;if(this._map||(this._map=this._parent&&this._parent.map),this._map&&path){this._initAnimation();this._map;for(var beforeClip,lastStep,currentStep,markerAnimation=this.markerAnimation,params=params||{},speed=params.speed,easing=params.easing,circlable=params.circlable,_b=params.delay,delay=void 0===_b?0:_b,_b=params.aniInterval,aniInterval=void 0===_b?0:_b,duration=params.duration,_b=params.totalDuration,params=params.autoRotation,autoRotation=void 0===params||params,clips=[],pathLen=path.length,isDurationAFunction="function"==typeof duration,duration2=duration||(_b?_b/(pathLen-1):0),isSpeedAFunction="function"==typeof speed,isDelayAFunction="function"==typeof delay,originPath=this._getOriginPath(path),firstPosition=originPath[0],this_1=(this.setPosition(firstPosition),this),i=0;i<pathLen-1;i++)!function(i){var curPath=path[i],targetPath=path[i+1],position=void 0,targetPosition=void 0,curSpeed=void 0,curDelay=void 0,curDuration=void 0;if(isLngLat(curPath)&&isLngLat(targetPath)?(position=curPath.toJSON(),targetPosition=targetPath.toJSON()):curPath.position&&targetPath.position?(position=curPath.position,targetPosition=targetPath.position,isLngLat(position)&&(position=position.toJSON()),isLngLat(targetPosition)&&(targetPosition=targetPosition.toJSON()),curSpeed=targetPath.speed,curDuration=targetPath.duration,curDelay=targetPath.delay,!curDuration&&curSpeed&&(curDuration=this_1._getDuration(curSpeed,position,targetPosition))):(position=curPath,targetPosition=targetPath),!position||!targetPosition)return;i||(lastStep=position),curSpeed=curSpeed||(isSpeedAFunction?speed(i,position):speed),curDelay=curDelay||(isDelayAFunction?delay(i,position):delay),!(curDuration=curDuration||(isDurationAFunction?duration(i,position):duration2))&&curSpeed&&(curDuration=this_1._getDuration(curSpeed,position,targetPosition));var index,clip=this_1._getClip({delay:curDelay||0,duration:curDuration,easing:easing||"Linear"},{x:[position[0],targetPosition[0]],y:[position[1],targetPosition[1]]});i||clip.on("start",function(e){var type=CONSTS_Events.MOVE_START,e=_this._getMoveStartEvent(type,e,originPath);_this.emit(type,e)}),clip.on("update",function(e){var type=CONSTS_Events.MOVING,e=_this._getMovingEvent(type,e,originPath,i),index=e.index;autoRotation&&!clip._hasSetRotation&&"AMap.Marker"===_this.CLASS_NAME&&(clip._hasSetRotation=!0,lastStep=originPath[index],currentStep=originPath[index+1],lastStep)&¤tStep&&(!1===(index=_this._getOrientationByLngLats(lastStep,currentStep))?index=_this.lastAngle||0:_this.lastAngle=index,_this.setOrientation(index)),_this.emit(type,e)}),i===pathLen-2?clip.on("complete",(index=i+2,function(e){var moveEndEvent=_this._getMoveEndEvent(CONSTS_Events.MOVE_END,e,originPath.slice(0,index)),moveEndEvent=(_this.emit(CONSTS_Events.MOVE_END,moveEndEvent),_this._getMoveEndEvent(CONSTS_Events.MOVE_ALONG,e,originPath.slice(0,index)));_this.emit(CONSTS_Events.MOVE_ALONG,moveEndEvent)})):clip.on("complete",function(){var index=i+2;return function(e){e=_this._getMoveEndEvent(CONSTS_Events.MOVE_END,e,originPath.slice(0,index));_this.emit(CONSTS_Events.MOVE_END,e)}}()),beforeClip&&beforeClip.chain(clip),beforeClip=clip,clips.push(clip)}(i);this.clips=clips,circlable&&markerAnimation.on("complete",function(){_this.setPosition(firstPosition),markerAnimation.reset();for(var _i=0,clips_1=clips;_i<clips_1.length;_i++)clips_1[_i]._hasSetRotation=!1;setTimeout(function(){markerAnimation.start()},aniInterval)}),markerAnimation&&(markerAnimation.addClip(clips[0]),this.clip=clips[0],markerAnimation.start())}},_getDuration:function(speed,pos1,pos2){return(AMap.GeometryUtil.distance(pos1,pos2)||0)/(speed=speed||1)*60*60},_getClip:function(options,keyFrame){var _this=this,options=this.clip=new chito_2(options,keyFrame);return options.on("update",function(e){var e=e.keyframe,x=e.x,e=e.y;_this.setPosition([x,e])}),options},_destroyClip:function(){var clip=this.clip,clips=this.clips;if(this.markerAnimation&&(this.markerAnimation.removeClip(clip),clip.chain()),clips)for(var _i=0,clips_2=clips;_i<clips_2.length;_i++)clips_2[_i].destroy(),0;clip.destroy(),this.clip=null,this.clips=[]},_initAnimation:function(){this.markerAnimation?this.markerAnimation&&(this._destroyClip(),this.markerAnimation.reset()):this.markerAnimation=new chito_1},_getMoveStartEvent:function(type,e,path){return{index:0,type:type,progress:0,pos:path[0],target:this,passedPos:path[0],passedPath:path.slice(0,1)}},_getMoveEndEvent:function(type,e,path){var lastIndex=path.length-1;return{index:lastIndex,type:type,progress:1,pos:path[lastIndex],target:this,passedPos:path[lastIndex],passedPath:path}},_getMovingEvent:function(type,e,path,i){var curPosition=new AMap.LngLat(e.keyframe.x,e.keyframe.y),passedPath=path.slice(0,i+1).concat(curPosition);return{index:i,type:type,progress:e.progress,pos:curPosition,target:this,passedPos:path[i],passedPath:passedPath}},_getOrientationByLngLats:function(lnglat1,lnglat2){return isLngLat(lnglat1)||(lnglat1=new AMap.LngLat(lnglat1[0],lnglat1[1])),isLngLat(lnglat2)||(lnglat2=new AMap.LngLat(lnglat2[0],lnglat2[1])),this._getRotationByLngLats(lnglat1,lnglat2)},_getOriginPath:function(path){for(var originPath=[],_i=0,path_1=path;_i<path_1.length;_i++){var curPosition=path_1[_i];isLngLat(curPosition)||Array.isArray(curPosition)?originPath.push(curPosition):curPosition.position&&originPath.push(curPosition.position)}return originPath}};AMap.extend(AMap.Marker,freeSelf),AMap.extend(AMap.Text,freeSelf),AMap.extend(AMap.LabelMarker,freeSelf)}(); ');
|
|
_cssload_('AMap.Driving', '.amap-lib-driving{margin:0;padding:0;color:#565656;font-family:Microsoft Yahei,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:12px;line-height:1.5;word-wrap:break-word;background-color:#fff;border:1px solid silver}.amap-lib-driving ol,.amap-lib-driving ul{list-style:outside none none;margin:0;padding:0}.amap-call{font-size:12px;color:#fafafa;cursor:pointer;background-color:#bbb;text-align:right;padding:3px 8px 1px 3px}.amap-call,.amap-lib-driving .planTitle .clearfix a{text-decoration:underline}.amap-lib-driving .blue{color:#3d93fd}.amap-lib-driving p{margin:0}.amap-lib-driving b,.amap-lib-driving strong{font-weight:700}.amap-lib-driving dt{cursor:pointer}.amap-lib-driving .planTitle{position:relative;padding:2px 8px;border-top:1px solid #e6e6e6;border-bottom:1px solid #e6e6e6;background:#fafafa;font-size:14px;cursor:pointer}.amap-lib-driving .planTitle:hover{background:#fff}.amap-lib-driving .planTitle.current .sidebar,.amap-lib-driving .planTitle:hover .sidebar{display:block}.amap-lib-driving .planTitle span.red{color:#ff4546}.amap-lib-driving .planTitle h3{margin-top:0;font-size:13px;margin-bottom:1px}.amap-lib-driving .planTitle p{font-size:12px;margin-bottom:1px;color:#666}.amap-lib-driving .planTitle ul{display:none;margin-top:3px}.amap-lib-driving .planTitle ul li{float:left}.amap-lib-driving .planTitle ul li:last-child{border-right:none}.amap-lib-driving .planTitle ul li a{background-repeat:no-repeat;color:#00f;font-size:12px;height:16px;line-height:16px;padding-right:8px;text-indent:20px}.amap-lib-driving .planTitle ul li a.icon-share{padding-left:0;background-position:0}.amap-lib-driving .icon-arrow-up{background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/icon/arrow-up.png)}.amap-lib-driving .planTitle .sidebar{display:none;position:absolute;width:30px;height:30px;top:50%;right:0;pointer-events:none;margin-top:-15px}.amap-lib-driving .planTitle .sidebar div{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%;transition:all .3s ease-in 0s;-webkit-transition:all .3s ease-in 0s;-moz-transition:all .3s ease-in 0s;background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/icon/arrow-down.png)}.amap-lib-driving .planTitle .sidebar div.expand{background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/icon/arrow-up.png)}.amap-lib-driving .plan{display:none;font-size:12px;margin:0}.amap-lib-driving .plan .grey{color:#999}.amap-lib-driving .plan .blue{color:#3baeca}.amap-lib-driving .plan dt{position:relative;margin-left:35px;line-height:20px;border-bottom:1px solid #f0f0f0;padding-bottom:3px;padding-top:3px}.amap-lib-driving .plan dt:hover{background:#fafafa}.amap-lib-driving .plan dt span.grey{font-weight:400}.amap-lib-driving .plan dt span.line{padding-left:5px;padding-right:5px;display:inline-block;line-height:22px;color:#fff;background:#3baeca;text-indent:0}.amap-lib-driving .plan dt:first-child{border-top:1px solid #f0f0f0}.amap-lib-driving .plan dt .beforedt{left:-30px;border-radius:50%;background-color:#fff;background-position:50%;background-repeat:no-repeat;text-indent:0;text-align:center;font-size:12px;z-index:10}.amap-lib-driving .beforedt{top:15px;left:-22px;height:100%;width:4px;z-index:-1;position:absolute;background-color:#e5e7e8}.amap-lib-driving .afterdt{position:absolute}.amap-lib-driving .plan dt.end,.amap-lib-driving .plan dt.start,.amap-lib-driving .plan dt.via{font-size:14px}.amap-lib-driving .plan dt.end .beforedt,.amap-lib-driving .plan dt.start .beforedt,.amap-lib-driving .plan dt.via .beforedt{margin-top:-10px;width:20px;height:20px;line-height:20px;color:#fff;background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/diricon.png)}.amap-lib-driving .plan dt.start .beforedt{background-position:-47px -104px}.amap-lib-driving .plan dt.via .beforedt{background-position:-85px -104px}.amap-lib-driving .plan dt.end .beforedt{background-position:-126px -104px}.amap-lib-driving .plan dt.end .afterdt{height:0%}.amap-lib-driving .afterdt{background-color:#e5e7e8;left:-22px;top:20px;height:500px;width:4px;z-index:9}.amap-lib-driving>.plan dt>.afterdt{height:100%}.amap-lib-driving .plan dt.walk .beforedt{left:-27px;width:10px;height:10px;margin-top:-6px;border:2px solid #ddd}.amap-lib-driving .plan dt.bus .beforedt,.amap-lib-driving .plan dt.subway .beforedt{left:-31px;width:24px;height:24px;margin-top:-12px;background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/diricon.png)}.amap-lib-driving .plan dt.bus .afterdt{background-color:#33a7ff}.amap-lib-driving .plan dt.subway .afterdt{background-color:#3baeca}.amap-lib-driving .plan dt.bus .beforedt{background-position:-164px -102px}.amap-lib-driving .plan dt.subway .beforedt{background-position:-243px -101px}.amap-lib-driving .plan-nobus{margin:0}.amap-lib-driving .plan-nobus dt span{display:block;line-height:18px}.amap-lib-driving .plan-nobus dt .beforedt{left:-31px;width:21px;height:21px;margin-top:-12px;border:1px solid #ddd;background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/diricon.png)}.amap-lib-driving .plan-nobus dt.end .beforedt,.amap-lib-driving .plan-nobus dt.start .beforedt,.amap-lib-driving .plan-nobus dt.via .beforedt{border:none}.amap-lib-driving .plan-nobus dt.turn-go .beforedt{background-image:url(https://webapi.amap.com/theme/v1.3/images/newpc/icon/turn-go.png)}.amap-lib-driving .plan-nobus dt.turn-advance .beforedt{background-position:-46px -23px}.amap-lib-driving .plan-nobus dt.turn-left .beforedt{background-position:-87px -23px}.amap-lib-driving .plan-nobus dt.turn-right .beforedt{background-position:-124px -23px}.amap-lib-driving .plan-nobus dt.turn-keepleft .beforedt{background-position:-406px -23px}.amap-lib-driving .plan-nobus dt.turn-keepright .beforedt{background-position:-445px -23px}.amap-lib-driving .plan-nobus dt.turn-leftup .beforedt{background-position:-165px -23px}.amap-lib-driving .plan-nobus dt.turn-leftdown .beforedt{background-position:-246px -23px}.amap-lib-driving .plan-nobus dt.turn-rightup .beforedt{background-position:-206px -23px}.amap-lib-driving .plan-nobus dt.turn-rightdown .beforedt{background-position:-284px -23px}.amap-lib-driving .plan-nobus dt.turn-leftback .beforedt{background-position:-327px -23px}.amap-lib-driving .plan-nobus dt.turn-rightback .beforedt{background-position:-365px -23px}.amap-lib-driving .plan-nobus dt.turn-enterRing .beforedt{background-position:-561px -23px}.amap-lib-driving .plan-nobus dt.turn-leaveRing .beforedt{background-position:-602px -23px}.amap-lib-driving .plan-nobus dt.turn-slow .beforedt{background-position:-524px -23px}.amap-lib-driving .plan-nobus dt.turn-crosswalk .beforedt{background-position:-126px -184px}.amap-lib-driving .plan-nobus dt.turn-overpass .beforedt{background-position:-164px -184px}.amap-lib-driving .plan-nobus dt.turn-underpass .beforedt{background-position:-85px -184px}.amap-lib-driving .plan-nobus dt.turn-squarepass .beforedt{background-position:-204px -184px}.amap-lib-marker-from,.amap-lib-marker-mid,.amap-lib-marker-to{position:absolute;width:25px;height:30px;color:#e90000;background-size:100% 100%}.amap-lib-marker-from{background-image:url(https://a.amap.com/jsapi/static/image/plugin/marker/start.png);cursor:pointer}.amap-lib-marker-to{background-image:url(https://a.amap.com/jsapi/static/image/plugin/marker/end.png);cursor:pointer}.amap-lib-marker-mid{background-image:url(https://a.amap.com/jsapi/static/image/plugin/marker/mid.png)}.amap-combo-close{position:absolute;top:11px;right:10px;background:url(https://webapi.amap.com/theme/v1.3/images/amap-info.png) no-repeat -1px -151px;width:12px;height:12px;cursor:pointer}.amap-content-body{min-width:200px;max-width:240px;font-family:Helvetica,Hiragino Sans GB,Microsoft Yahei,微软雅黑,Arial,sans-serif;box-shadow:0 0 .5px rgba(0,0,100,.6);background:none repeat scroll 0 0 #fff;border-radius:2px;text-align:left;border:1px solid silver}.amap-combo-sharp{margin:0 auto;bottom:1px;position:relative;background:url(https://webapi.amap.com/theme/v1.3/images/amap-info.png) no-repeat -5px -564px;width:18px;height:9px}.amap-lib-infowindow{padding:0;position:relative;background-color:#fff;margin:8px}.amap-lib-infowindow-title{line-height:22px;font-size:14px;border-bottom:1px solid #99adce;padding-right:15px}.amap-lib-infowindow-content{padding-top:5px;overflow:hidden;font-size:12px;zoom:1}');
|
|
_jsload_('AMap.Driving', '!function(AMap){"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass)}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(e){return false}}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called")}return self}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined")}return _assertThisInitialized(self)}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else{result=Super.apply(this,arguments)}return _possibleConstructorReturn(this,result)}}var markerOffset=[-12,-30];function forOf(arr,cb){for(var i=0,len=arr.length;i<len;i++){cb(arr[i])}}var DrivingRender=function DrivingRender(initOpts){this["CLASS_NAME"]="AMap.DrivingRender";var me=this;initOpts=initOpts||{};me._styleOpts={};me._styleOpts["zIndex"]=typeof initOpts["zIndex"]==="number"?initOpts["zIndex"]:50;me._showTraffic=initOpts["showTraffic"];me._eventSelf=initOpts["eventSelf"];me.showDir=!!(initOpts?initOpts.showDir:true);me._currentRouteTitle=null;me._currentRouteOptenitem=null;me.autoRender=function(options,drivingObject){me.clear(1);if(!options||!options.data||!options.panel&&!options.map){return}this.options=options;this.hideMarkers=options["hideMarkers"]||false;if(options.map){this._infoWindow=new AMap.InfoWindow({size:new AMap.Size(0,0),isCustom:true,offset:new AMap.Pixel(0,-30)});this._overlays=[];this._route=[];this._highlightOverlay=null;if(!options.panel){this.drawRouteOverlays(0)}}if(options.panel){if(Object.prototype.toString.call(options.panel)==="[object String]"){options.panel=document.getElementById(options.panel)}if(drivingObject&&options.data.waypoints.length===0){me.listener.gotoAMap=function(){drivingObject.searchOnAMAP(options.data)};var a=document.createElement("div");a.className="amap-call";a.href="javascript:void(0)";a.innerHTML="前往高德地图查看";a.addEventListener("click",me.listener.gotoAMap);options.panel.appendChild(a)}options.panel.appendChild(this.view.createPanel(options.data));this.enableListeners()}};me.clear=function(reserve){this.clearPanel();this.clearOverlays(reserve)};me.drawRoute=function(index){var data=this.options.data,route=data.routes[index];var distance=route.distance,steps=route.steps;var walkPaths=[],drivingPaths=[];walkPaths.push([data.start.location,steps[0].path[0]]);var lastStepPath=steps[steps.length-1].path;walkPaths.push([lastStepPath[lastStepPath.length-1],data.end.location]);for(var i=0,step;i<steps.length;i++){step=steps[i];drivingPaths=drivingPaths.concat(step.path)}if(drivingPaths.length>0){drivingPaths=[drivingPaths]}drivingPaths.steps=steps;this.clearRoute();this._route=this.addOverlays([],walkPaths,drivingPaths,{strokeOpacity:.4})};me.clearRoute=function(){if(this._route){for(var i=0;i<this._route.length;i++){this._route[i].setMap(null)}this._route=[]}};me.drawRouteOverlays=function(index){var data=this.options.data,route=data.routes[index];var distance=route.distance,steps=route.steps;var walkPaths=[],drivingPaths=[],points=[];points.push(data.start);if(data.waypoints){var waypoints=data.waypoints;for(var i=0,len=waypoints.length;i<len;i++){points.push(waypoints[i])}}points.push(data.end);walkPaths.push([data.start.location,steps[0].path[0]]);var lastStepPath=steps[steps.length-1].path;walkPaths.push([lastStepPath[lastStepPath.length-1],data.end.location]);for(var _i=0,step;_i<steps.length;_i++){step=steps[_i];drivingPaths=drivingPaths.concat(step.path)}if(drivingPaths.length>0){drivingPaths=[drivingPaths]}drivingPaths.steps=steps;this.clearOverlays(1);this._overlays=this.addOverlays(points,walkPaths,drivingPaths);if(me.options["autoFitView"]){me.options.map.setFitView(this._overlays)}};me.addOverlays=function(points,walkPaths,drivingPaths,styleOptions){var _this=this;var map=this.options.map;styleOptions=styleOptions||{strokeOpacity:1};var _overlays=[];if(!this.hideMarkers){if(points[0]){if(!this.startMarker){this.startMarker=new AMap.Marker({offset:markerOffset,map:map,content:\'<div class="amap-lib-marker-from"></div>\',innerOverlay:true});this.startMarker.isOfficial=true}var start=this.startMarker;start.setPosition(points[0].location);start.setMap(map);start._data=points[0];start.on("click",this.listener.markerClick);AMap.Event.addListener(start,"click",this.listener.markerClick);_overlays.push(start)}if(points.length>1){if(!this.endMarker){this.endMarker=new AMap.Marker({offset:markerOffset,map:map,content:\'<div class="amap-lib-marker-to"></div>\',innerOverlay:true});this.endMarker.isOfficial=true}var end=this.endMarker;end.setPosition(points[points.length-1].location);end.setMap(map);end._data=points[points.length-1];end.on("click",this.listener.markerClick);AMap.Event.addListener(end,"click",this.listener.markerClick);_overlays.push(end)}for(var i=1,point;i<points.length-1;i++){if(points[i].isWaypoint){point=new AMap.Marker({map:map,offset:markerOffset,position:points[i].location,content:\'<div class="amap-lib-marker-mid"></div>\',innerOverlay:true});point._data=points[i];AMap.Event.addListener(point,"click",this.listener.markerClick)}point.isOfficial=true;_overlays.push(point)}}styleOptions=me.util.extend({},me._styleOpts,styleOptions);for(var _i2=0,drivingPath;_i2<drivingPaths.length;_i2++){var trafficGradient=undefined;if(me._showTraffic&&drivingPaths.steps){(function(){var trafficGradientValues=[];var totalDistance=0;forOf(drivingPaths.steps,function(step){if(step.tmcsPaths){forOf(step.tmcsPaths,function(tmcsPath){totalDistance+=tmcsPath.distance})}else{totalDistance+=100}});var currentDistance=0;forOf(drivingPaths.steps,function(step){if(step.tmcsPaths){forOf(step.tmcsPaths,function(tmcsPath){currentDistance+=tmcsPath.distance;trafficGradientValues.push([currentDistance/totalDistance,_this.getColorByTmcsStatus(tmcsPath.status)])})}else{currentDistance+=100;trafficGradientValues.push([currentDistance/totalDistance,_this.getColorByTmcsStatus("")])}});trafficGradient={values:trafficGradientValues}})()}drivingPath=new AMap.Polyline(me.util.extend({},styleOptions,{map:map,path:drivingPaths[_i2],lineJoin:"round",strokeColor:"#0091ff",isOutline:me.options["isOutline"],outlineColor:me.options["outlineColor"],borderWeight:2,lineGradient:trafficGradient,strokeOpacity:1,showDir:me.showDir,strokeWeight:6,innerOverlay:true}));drivingPath.isOfficial=true;_overlays.push(drivingPath);me._drivingPolyline=drivingPath}for(var _i3=0,walkPath;_i3<walkPaths.length;_i3++){walkPath=new AMap.Polyline(me.util.extend({},styleOptions,{map:map,path:walkPaths[_i3],strokeColor:"grey",strokeStyle:"dashed",strokeWeight:6,lineJoin:"bevel",innerOverlay:true}));walkPath.isOfficial=true;_overlays.push(walkPath)}if(me.showDir);return _overlays};me.getColorByTmcsStatus=function(status){var color;switch(status){case"畅通":color="#1BAC2E";break;case"缓行":color="#FFA700";break;case"拥堵":color="#E94B37";break;case"严重拥堵":color="#A81212";break;default:color="#adadad";break}return color};me.clearPanel=function(){if(this.options&&this.options.panel){var a=me.util.getElementsByClassName("amap-call","div",this.options.panel)[0];if(a){a.removeEventListener("click",me.listener.gotoAMap)}this.options.panel.innerHTML=""}};me.clearOverlays=function(reserve){if(!reserve){if(this.startMarker){this.startMarker.setMap();this.startMarker=null}if(this.endMarker){this.endMarker.setMap();this.endMarker=null}}if(this._overlays){for(var i=0,overlay;i<this._overlays.length;i++){overlay=this._overlays[i];overlay.setMap(null)}this._overlays=[]}if(this._infoWindow){this._infoWindow.close()}if(this._highlightOverlay){this._highlightOverlay.setMap(null);this._highlightOverlay=null}this.clearRoute()};me.getTitle=function(route){var policy=route.policy?" | <span class=\'blue\'>"+route.policy+"</span>":"";var result=me.util.getTime(route.time)+"("+me.util.getDistance(route.distance)+")"+policy;return result};me.util={};me.util.extend=function(dest){var sources=Array.prototype.slice.call(arguments,1),i,j,len,src;for(j=0,len=sources.length;j<len;j=j+1){src=sources[j]||{};for(i in src){if(Object.prototype.hasOwnProperty.call(src,i)){if(typeof src[i]==="function"&&typeof dest[i]==="function"){src[i].__super=dest[i]}dest[i]=src[i]}}}return dest};me.util.getDistance=function(len){if(len<=1e3){var s=len;return s+"米"}else{var _s=Math.round(len/10);return""+_s/100+"公里"}};me.util.getTime=function(second){var minute=+(second/60).toFixed(0);if(minute<60){return""+minute+"分钟"}else{return""+Math.floor(minute/60)+"小时"+minute%60+"分钟"}};me.util.domstr2dom=function(arg){var objE=document.createElement("div");objE.innerHTML=arg;return objE};me.util.getElementsByClassName=function(className,tag,parent){var testClass=new RegExp("(^|\\\\s)"+className+"(\\\\s|$)");tag=tag||"*";parent=parent||document;var elements=parent.getElementsByTagName(tag);var returnElements=[];for(var i=0,current;i<elements.length;i++){current=elements[i];if(testClass.test(current.className)){returnElements.push(current)}}return returnElements};me.enableListeners=function(){var unfocusTitles=me.util.getElementsByClassName("planTitle","div",me.options.panel);for(var i=0,unfocusTitle;i<unfocusTitles.length;i++){unfocusTitle=unfocusTitles[i];AMap.Event.addDomListener(unfocusTitle,"click",this.listener.unfocusTitleClick);AMap.Event.addDomListener(unfocusTitle,"mouseenter",this.listener.unfocusTitleMouseenter);AMap.Event.addDomListener(unfocusTitle,"mouseleave",this.listener.unfocusTitleMouseleave)}var c_divs=this.util.getElementsByClassName("*","dt",me.options.panel);for(var _i4=0,c_div;_i4<c_divs.length;_i4++){c_div=c_divs[_i4];AMap.Event.addDomListener(c_div,"click",this.listener.routeStepItem)}if(unfocusTitles.length>0){me.listener.unfocusTitleClick.call(unfocusTitles[0])}};me.listener={};me.listener.markerClick=function(){var data=this._data;if(data.type==="start"||data.type==="end"){me._infoWindow.setOffset(new AMap.Pixel(0,-30))}else{me._infoWindow.setOffset(new AMap.Pixel(0,0))}if(data.name==="起点"||data.name==="终点"||data.name==="途经点");else{me._infoWindow.setContent(me.view.createInfowindowContent(data));me._infoWindow.open(me.options.map,this.getPosition())}me.options.map.setCenter(this.getPosition())};me.listener.routeStepItem=function(){if(!me.options.map){var _p=this.parentNode;var _children=_p.children;var _stepIndex;for(var i=0,child;i<_children.length;i++){child=_children[i];if(child===this){_stepIndex=i;break}}me._eventSelf.emit("panelClick",{stepIndex:_stepIndex});return}if(me._highlightOverlay){me._highlightOverlay.setMap(null)}this.style.backgroundColor="rgb(240, 240, 240)";if(me.listener.routeStepItem.last){me.listener.routeStepItem.last.style.backgroundColor=""}me.listener.routeStepItem.last=this;var p=this.parentNode;var children=p.children;var stepIndex;for(var _i5=0,_child;_i5<children.length;_i5++){_child=children[_i5];if(_child===this){stepIndex=_i5;break}}if(stepIndex===0){me.listener.markerClick.call({_data:me.options.data.start,getPosition:function getPosition(){return me.options.data.start.location}});return}if(stepIndex===children.length-1){me.listener.markerClick.call({_data:me.options.data.end,getPosition:function getPosition(){return me.options.data.end.location}});return}me._infoWindow.close();stepIndex=stepIndex-1;var step=me.options.data.routes[me._currentRouteIndex].steps[stepIndex];var highlight;highlight=new AMap.Polyline({map:me.options.map,path:step.path,strokeColor:"red",strokeOpacity:.8,strokeWeight:8,lineJoin:"round",draggable:true,innerOverlay:true});highlight.isOfficial=true;me._highlightOverlay=highlight;me.options.map.setBounds(highlight.getBounds())};me.listener.driveTitleClick=function(){me._currentRouteTitle.style.display="block";me._currentRouteOptenitem.style.display="none";me.clearOverlays()};me.listener.unfocusTitleClick=function(){var target=arguments[0]&&(arguments[0].target||arguments[0].srcElement);if(target&&target.tagName==="A"){return}if(me._currentRouteTitleStatus==="open"&&me._currentRouteTitle===this){me.view.closeCurrentPlanDiv();me.clearOverlays()}else if(me._currentRouteTitleStatus==="open"){me.view.closeCurrentPlanDiv();me.view.openPlanDiv(this)}else{me.view.openPlanDiv(this)}};me.listener.unfocusTitleMouseenter=function(e){var index=this.getAttribute("index");me.drawRoute(index);me.listener.unfocusTitleMouseenter.last=this};me.listener.unfocusTitleMouseleave=function(e){me.clearRoute()};me.view={};me.view.openPlanDiv=function(planDiv){me._currentRouteTitle=planDiv;me._currentRouteOptenitem=planDiv.nextSibling;me.util.getElementsByClassName("icon-arrow-up","div",me._currentRouteTitle)[0].className="icon-arrow-up expand";if(me.util.getElementsByClassName("clearfix","ul",me._currentRouteTitle)[0]){me.util.getElementsByClassName("clearfix","ul",me._currentRouteTitle)[0].style.display="inline-block"}me._currentRouteOptenitem.style.display="block";me._currentRouteTitleStatus="open";var index=me._currentRouteTitle.getAttribute("index");me._currentRouteIndex=index;if(me.options.map){me.drawRouteOverlays(me._currentRouteIndex)}};me.view.closeCurrentPlanDiv=function(){var title=me.util.getElementsByClassName("icon-arrow-up expand","div",me._currentRouteTitle)[0];var fix=me.util.getElementsByClassName("clearfix","ul",me._currentRouteTitle)[0];if(title){title.className="icon-arrow-up"}if(fix){fix.style.display="none"}me._currentRouteOptenitem.style.display="none";me._currentRouteTitleStatus="close"};me.view.createInfowindowContent=function(data){var c=[data.name];return c.join("")};me.view.createInfowindowContent=function(data){var content=document.createElement("div");var div=document.createElement("div");div.className="amap-content-body";var c=[];c.push(\'<div class="amap-lib-infowindow">\');c.push(\' <div class="amap-lib-infowindow-title">\'+data.name+\' <a href="http://detail.amap.com/detail/\'+data.id+"?spm=0.0.0.0.sWhSmy&citycode="+data.citycode+\'" target="_blank">详情»</a></div>\');c.push(\' <div class="amap-lib-infowindow-content">\');c.push(\' <div class="amap-lib-infowindow-content-wrap">\');c.push(" <div>地址:"+data.address+"</div>");if(data.tel){c.push(" <div>电话:"+data.tel+"</div>")}c.push(" </div>");c.push(" </div>");c.push("</div>");div.innerHTML=c.join("");var sharp=document.createElement("div");sharp.className="amap-combo-sharp";div.appendChild(sharp);var close=document.createElement("div");close.className="amap-combo-close";div.appendChild(close);close.href="javascript: void(0)";AMap.Event.addDomListener(close,"touchend",function(e){me._infoWindow["close"]()});AMap.Event.addDomListener(close,"click",function(e){me._infoWindow["close"]()});content.appendChild(div);content.appendChild(close);content.appendChild(sharp);return content};me.view.createPanel=function(data){var div=document.createElement("div");div.className="amap-lib-driving";if(!data.routes){div.innerHTML="抱歉,没有合适的路线。";return div}var result=[];for(var i=0,route;i<data.routes.length;i++){route=data.routes[i];var isDisplay=false,title=me.getTitle(route);result=result.concat(me.view.createTitleDiv(i,title,route,!isDisplay));result=result.concat(me.view.createOpenitemDiv(i,title,data,isDisplay))}div.innerHTML=result.join("");return div};me.view.createTitleDiv=function(index,title,route,isDisplay){var steps=route.steps,roadNameArray=[],roadNames="",roadNames2="";var temp="";for(var i=0,road;i<steps.length;i++){road=steps[i].road;if(road&&road!==temp){roadNameArray.push(road);temp=road}}roadNames=roadNameArray.join(">");if(roadNameArray.length>4){roadNameArray.splice(2,roadNameArray.length-4,"......");roadNames2=roadNameArray.join(">")}else{roadNames2=roadNames}var r=[];r.push(\'<div class="planTitle" index="\'+index+\'">\');r.push(" <h3 class=\'planTitle_route\' title=\\""+roadNames+\'">\');r.push(" <b>"+roadNames2+"</b>");r.push(" </h3>");r.push(" <p>"+title+"</p>");var d=me.options.data;r.push(\' <div class="sidebar">\');r.push(\' <div class="icon-arrow-up" href="javascript:void(0)"></div>\');r.push(" </div> ");r.push("</div>");return r};me.view.createOpenitemDiv=function(index,title,data,isDisplay){var route=data.routes[index],steps=route.steps;var r=[];r.push(\'<dl class="plan plan-nobus">\');r.push(" <dt class=\\"start\\"><div class=\'beforedt\'></div><div class=\'afterdt\'></div><b>"+data.start.name+"</b></dt>");for(var i=0,step;i<steps.length;i++){step=steps[i];r.push(\' <dt class="route turn-\'+me.getSigns(step.action)+\'" index="\'+index+\'"> \');r.push(" <div class=\'beforedt\'></div><div class=\'afterdt\'></div> "+step.instruction);r.push(" </dt>")}r.push(" <dt class=\\"end\\"><div class=\'beforedt\'></div><b>"+data.end.name+"</b></dt>");r.push("</dl>");return r};me.getSigns=function(action){var signs="";var routeSign={"左转":"left","右转":"right","靠左":"keepleft","靠右":"keepright","向左前方行驶":"leftup","向左后方行驶":"leftdown","向右前方行驶":"rightup","向右后方行驶":"rightdown","左转调头":"leftback","右转调头":"rightback","进入环岛":"enterRing","离开环岛":"leaveRing","减速行驶":"slow","向左前方行走":"leftup","向左后方行走":"leftdown","向右前方行走":"rightup","向右后方行走":"rightdown","通过人行横道":"crosswalk","通过过街天桥":"overpass","通过地下通道":"underpass","通过广场":"squarepass"};signs=routeSign[action];if(!signs){signs="advance"}return signs}};var GetLL=function(){function GetLL(city){_classCallCheck(this,GetLL);this.city=city||"";this.CLASS_NAME="AMap.GetLL"}_createClass(GetLL,[{key:"getCity",value:function getCity(cbk){var url=AMap.getConfig().protocol+"://webapi.amap.com/maps/ipCity";AMap.WebService.get(url,{},function(status,data){if(status==="complete"){cbk(data)}else{cbk({})}})}},{key:"get",value:function get(keywordsList,defaultCity,cbk){var psearch=new PlaceSearch({extensions:"all"});var result=[];var getOne=function getOne(){if(keywordsList.length){var keyAndcity=keywordsList.shift();var keyword=keyAndcity["keyword"];var city=keyAndcity["city"]||defaultCity;if(!city){city=""}psearch["setCity"](city);psearch.search(keyword,function(status,data){if(status==="error"){cbk("error",data)}else if(status==="complete"){if(data["poiList"]&&data["poiList"]["pois"].length){result.push(data["poiList"]["pois"][0]);if(keywordsList.length){getOne()}else{cbk("complete",result)}}else{if(!city){cbk("no_city",keyAndcity)}else{cbk("no_poi",keyAndcity)}}}else if(status==="no_data"){if(!city){cbk("no_city",keyAndcity)}else{cbk("no_poi",keyAndcity)}}})}};getOne()}}]);return GetLL}();var PlaceSearch=function(_AMap$Event){_inherits(PlaceSearch,_AMap$Event);var _super=_createSuper(PlaceSearch);function PlaceSearch(opt){var _this;_classCallCheck(this,PlaceSearch);_this=_super.call(this);_this.closed=false;_this.opt=AMap.extend({showCover:true,autoFitView:true},opt||{});_this.opt["pageIndex"]=_this.opt["pageIndex"]||1;_this.opt["pageSize"]=typeof _this.opt["pageSize"]!=="number"||_this.opt["pageSize"]<0?10:_this.opt["pageSize"]>50?50:_this.opt["pageSize"];_this.url=AMap.getConfig().server+"/v3/place";return _this}_createClass(PlaceSearch,[{key:"search",value:function search(keyword,cbk){var params={s:"rsv3",children:+(this.opt["children"]?"1":"")};var map={city:"city",rankBy:"sortrule",type:"types",pageIndex:"page",pageSize:"offset",extensions:"extensions",citylimit:"citylimit"};this._mergeParams(this.opt,map,params);this._query(this.url+"/text",params,cbk,{keywords:keyword||""},"KEYWORD",arguments)}},{key:"setCity",value:function setCity(city){AMap.BuryPoint.add(this,"setCity");this.opt["city"]=city}},{key:"_mergeParams",value:function _mergeParams(data,map,params){for(var i in data){if(typeof data[i]!=="undefined"&&typeof map[i]!=="undefined"){params[map[i]]=data[i]}}return params}},{key:"_query",value:function _query(url,params,cbk,encodeURICom,type,args){var _this2=this;url=url+(params.length>0?"?"+params.join("&"):"");AMap.WebService.get(url,AMap.extend({type_:type,antiCrab:true},params,encodeURICom),function(status,data){if(status==="complete"){_this2._onComplete(data,cbk,type,args)}else{_this2._onError(data,cbk)}})}},{key:"_onComplete",value:function _onComplete(data,cbk,type,args){if(this.closed){return}var result;if(!parseInt(data.status,10)){result={info:data["info"]};AMap.Event.trigger(this,"error",result);if(cbk&&typeof cbk==="function"){cbk("error",data["info"])}}else{result={info:data["info"],poiList:{}};result["poiList"]={pois:[],count:parseInt(data["count"],10),pageIndex:this.opt["pageIndex"],pageSize:this.opt["pageSize"]};if(data["pois"]){for(var i=0;i<data["pois"].length;i+=1){var tmp=data["pois"][i];result["poiList"]["pois"][i]=this._parsePOI(tmp)}}if(data["suggestion"]&&data["suggestion"]["keywords"].length){result["keywordList"]=data["suggestion"]["keywords"];result["info"]="TIP_KEYWORDS"}if(data["suggestion"]&&data["suggestion"]["cities"].length){var cities=data["suggestion"]["cities"],citiesnew=[];for(var j=0;j<cities.length;j+=1){var city=cities[j];for(var pro in city){if(city.hasOwnProperty(pro)&&pro==="num"){city["count"]=city[pro];delete city[pro]}}city["count"]=parseInt(city["count"]);citiesnew.push(city)}result["info"]="TIP_CITIES";result["cityList"]=citiesnew}if((!data["count"]||parseInt(data["count"],10)===0)&&!result["cityList"]&&!result["keywordList"]){result["info"]=data["info"].toLowerCase()==="ok"?"NO_DATA":data["info"];AMap.Event.trigger(this,"complete",result);if(cbk&&typeof cbk==="function"){if(result["cityList"]||result["keywordList"]){cbk("complete",result)}else{cbk("no_data",{})}}}else{AMap.Event.trigger(this,"complete",result);if(cbk&&typeof cbk==="function"){cbk("complete",result)}}}}},{key:"_parsePOI",value:function _parsePOI(poi){this._formatFields(poi);function getLngLat(location){if(location){var lngLat=location.split(",");return new AMap.LngLat(+lngLat[0],+lngLat[1])}else{return null}}var poiBaseInfo={id:poi["id"],name:poi["name"],type:poi["type"],location:getLngLat(poi["location"]),address:poi["address"],tel:poi["tel"],distance:parseFloat(poi["distance"]),shopinfo:poi["shopinfo"]};if(poi["shopinfo"]&&poi["shopinfo"].length){poiBaseInfo["shopinfo"]=poi["shopinfo"]}else{poiBaseInfo["shopinfo"]=""}if(poi["children"]){var children=poi["children"];for(var i=0,len=children.length;i<len;i++){children[i]["location"]=getLngLat(children[i]["location"])}poiBaseInfo["children"]=children}var poiDetailInfo={website:poi["website"],pcode:poi["pcode"],citycode:poi["citycode"],adcode:poi["adcode"],postcode:poi["postcode"+""],pname:poi["pname"],cityname:poi["cityname"],adname:poi["adname"],email:poi["email"],photos:poi["photos"],entr_location:getLngLat(poi["entr_location"]),exit_location:getLngLat(poi["exit_location"]),groupbuy:poi["groupbuy_num"]!=="0",discount:poi["discount_num"]!=="0"};if(poi["indoor_map"]==="1"){poiDetailInfo["indoor_map"]=true;poiDetailInfo["indoor_data"]={cpid:this._parseString(poi["indoor_data"]["cpid"]),floor:this._parseString(poi["indoor_data"]["floor"]),truefloor:this._parseString(poi["indoor_data"]["truefloor"])}}else{poiDetailInfo["indoor_map"]=false}var poiDeepInfo={groupbuys:"",discounts:"",deep_type:"",dining:"",hotel:"",cinema:"",scenic:""};if(poi["rich_content"]){if(poiDetailInfo["groupbuy"]){var groupBuyTemp=poi["rich_content"]["groupbuys"],groupBuyNum=groupBuyTemp.length;if(groupBuyNum>0){poiDeepInfo["groupbuys"]=[]}for(var n=0;n<groupBuyNum;n+=1){var groupBuy={title:groupBuyTemp[n]["title"],type_code:groupBuyTemp[n]["typecode"],type:groupBuyTemp[n]["type"],detail:groupBuyTemp[n]["detail"],stime:groupBuyTemp[n]["start_time"],etime:groupBuyTemp[n]["end_time"],count:groupBuyTemp[n]["num"],sold_num:parseInt(groupBuyTemp[n]["sold_num"]),original_price:parseFloat(groupBuyTemp[n]["original_price"]),groupbuy_price:parseFloat(groupBuyTemp[n]["groupbuy_price"]),discount:parseFloat(groupBuyTemp[n]["discount"]),ticket_address:groupBuyTemp[n]["ticket_address"],ticket_tel:groupBuyTemp[n]["ticket_tel"],photos:groupBuyTemp[n]["photos"],url:groupBuyTemp[n]["url"],provider:""};poiDeepInfo["groupbuys"].push(groupBuy)}}if(poiDetailInfo["discount"]){var discountTemp=poi["rich_content"]["discounts"],disNum=discountTemp.length;if(disNum>0){poiDeepInfo["discounts"]=[]}for(var dis=0;dis<disNum;dis+=1){var discount={title:discountTemp[dis]["title"],detail:discountTemp[dis]["detail"],start_time:discountTemp[dis]["start_time"],end_time:discountTemp[dis]["end_time"],sold_num:parseInt(discountTemp[dis]["sold_num"]),photos:discountTemp[dis]["photos"],url:discountTemp[dis]["url"],provider:""};poiDeepInfo["discounts"].push(discount)}}}if(poi["deep_info"]){poiDeepInfo["deep_type"]=poi["deep_info"]["type"];var poiDeep=poi["deep_info"];switch(poiDeepInfo["deep_type"]){case"cinema":var cinema={intro:poiDeep["intro"],rating:poiDeep["rating"],deep_src:"",parking:poiDeep["parking"],opentime_GDF:poiDeep["opentime_GDF"],opentime:poiDeep["opentime"],photos:poiDeep["photos"]};poiDeepInfo["cinema"]=cinema;poiDeepInfo["deep_type"]="CINEMA";break;case"dining":var dining={cuisines:poiDeep["cuisines"],tag:poiDeep["tag"],intro:poiDeep["intro"],rating:poiDeep["rating"],cp_rating:poiDeep["cp_rating"],deep_src:"",taste_rating:poiDeep["taste_rating"],environment_rating:poiDeep["environment_rating"],service_rating:poiDeep["service_rating"],cost:poiDeep["cost"],recommend:poiDeep["recommend"],atmosphere:poiDeep["atmosphere"],ordering_wap_url:poiDeep["ordering_wap_url"],ordering_web_url:poiDeep["ordering_web_url"],ordering_app_url:poiDeep["ordering_app_url"],opentime_GDF:poiDeep["opentime_GDF"],opentime:poiDeep["opentime"],addition:poiDeep["addition"],photos:poiDeep["photos"]};poiDeepInfo["dining"]=dining;poiDeepInfo["deep_type"]="DINING";break;case"scenic":var scenic={intro:poiDeep["intro"],rating:poiDeep["rating"],deep_src:"",level:poiDeep["level"],price:poiDeep["price"],season:poiDeep["season"],recommend:poiDeep["recommend"],theme:poiDeep["theme"],ordering_wap_url:poiDeep["ordering_wap_url"],ordering_web_url:poiDeep["ordering_web_url"],opentime_GDF:poiDeep["opentime_GDF"],opentime:poiDeep["opentime"],photos:poiDeep["photos"]};poiDeepInfo["scenic"]=scenic;poiDeepInfo["deep_type"]="SCENIC";break;case"hotel":var hotel={rating:poiDeep["rating"],star:poiDeep["star"],intro:poiDeep["intro"],lowest_price:poiDeep["lowest_price"],faci_rating:poiDeep["faci_rating"],health_rating:poiDeep["health_rating"],environment_rating:poiDeep["environment_rating"],service_rating:poiDeep["service_rating"],traffic:poiDeep["traffic"],addition:poiDeep["addition"],deep_src:"",photos:poiDeep["photos"]};poiDeepInfo["hotel"]=hotel;poiDeepInfo["deep_type"]="HOTEL";break}}var rePoi={};for(var baseK in poiBaseInfo){if(poiBaseInfo.hasOwnProperty(baseK)){rePoi[baseK]=poiBaseInfo[baseK]}}if(this.opt["extensions"]&&this.opt["extensions"]!=="base"){for(var deepK in poiDeepInfo){if(poiDeepInfo.hasOwnProperty(deepK)){if(poiDeepInfo[deepK]){rePoi[deepK]=poiDeepInfo[deepK]}}}for(var detailK in poiDetailInfo){if(poiDetailInfo.hasOwnProperty(detailK)){rePoi[detailK]=poiDetailInfo[detailK]}}if(poi.biz_ext){for(var key in poi.biz_ext){if(poi.biz_ext.hasOwnProperty(key)&&poi.biz_ext[key].length&&rePoi[key]===undefined){rePoi[key]=poi.biz_ext[key]}}}}return rePoi}},{key:"_parseString",value:function _parseString(v){var n=v instanceof Array&&v.length===0||typeof v==="undefined"?"":v;return n}},{key:"_formatFields",value:function _formatFields(obj){for(var j in obj){if(obj.hasOwnProperty(j)){obj[j]=this._parseString(obj[j]);if(_typeof(obj[j])==="object"){this._formatFields(obj[j])}}}}},{key:"_onError",value:function _onError(e,cbk){AMap.Event.trigger(this,"error",e);if(cbk&&typeof cbk==="function"){cbk("error",e["info"])}}}]);return PlaceSearch}(AMap.Event);var DrivingPolicy=AMap.DrivingPolicy?AMap.DrivingPolicy:{LEAST_TIME:0,LEAST_FEE:1,LEAST_DISTANCE:2,REAL_TRAFFIC:4,MULTI_POLICIES:5,HIGHWAY:6,FEE_HIGHWAY:7,FEE_TRAFFIC:8,TRAFFIC_HIGHWAY:9};var Driving=function(_AMap$Event){_inherits(Driving,_AMap$Event);var _super=_createSuper(Driving);function Driving(opt){var _this2;_classCallCheck(this,Driving);_this2=_super.call(this);_this2.closed=false;_this2["CLASS_NAME"]="AMap.Driving";_this2.stampId=AMap.Util.stamp(_assertThisInitialized(_this2));_this2.opt=AMap.extend({showTraffic:true,showDir:true,policy:0,outlineColor:"#ffe",isOutline:true,autoFitView:true},opt);_this2.url=_this2.opt.serviceUrl?_this2.opt.serviceUrl:AMap.getConfig().server+"/v3/direction/driving";_this2._dodgeAreas=[];if(_this2.opt["map"]||_this2.opt["panel"]);return _this2}_createClass(Driving,[{key:"_guid",value:function _guid(){return Math.round(1e5*Math.random())}},{key:"search",value:function search(){var args=arguments;if(args.length>0){args[0]=AMap.Util.parseLngLatData(args[0]);args[1]=AMap.Util.parseLngLatData(args[1]);if(args[0].lng&&args[0].lat){this.search_.apply(this,args)}else if(args[0]instanceof Array){var this_=this;var cbk=args[1];if(!this_.getLL){this_.getLL=new GetLL}this_.getLL.getCity(function(data){var city=data["citycode"]||"";this_.getLL.get(args[0],city,function(status,result){if(status==="error"){if(cbk&&typeof cbk==="function"){cbk("error",result)}}else if(status==="complete"){var start=result[0]["exit_location"]||result[0].location;var end=result[result.length-1]["entr_location"]||result[result.length-1].location;var wps=result.slice(1,result.length-1),ps=[];for(var i=0;i<wps.length;i+=1){ps.push(wps[i]["entr_location"]||wps[i].location)}this_.search_(start,end,{waypoints:ps},args[1]||undefined,result)}else if(status==="no_poi"){args[1]&&args[1]("error",{info:"在城市"+result["city"]+"无法找到"+result["keyword"]})}else if(status==="no_city"){args[1]&&args[1]("error",{info:"请设置"+result["keyword"]+"的城市信息"})}})})}}}},{key:"clear",value:function clear(){if(this.render){this.render["clear"]()}}},{key:"setAvoidPolygons",value:function setAvoidPolygons(areas){areas=AMap.Util.parseLngLatData(areas);this._dodgeAreas=areas}},{key:"clearAvoidPolygons",value:function clearAvoidPolygons(){this._dodgeAreas=[]}},{key:"getAvoidPolygons",value:function getAvoidPolygons(){return this._dodgeAreas}},{key:"setAvoidRoad",value:function setAvoidRoad(value){this._dodgeRoad=value}},{key:"clearAvoidRoad",value:function clearAvoidRoad(){this._dodgeRoad=""}},{key:"getAvoidRoad",value:function getAvoidRoad(){return this._dodgeRoad}},{key:"searchOnAMAP",value:function searchOnAMAP(p){var pp={};pp["t"]=0;pp["m"]=typeof p["m"]!=="undefined"?p["m"]:this.opt["policy"];var o=AMap.Util.parseLngLatData(p["origin"]);var d=AMap.Util.parseLngLatData(p["destination"]);pp["sy"]=o.lat;pp["sx"]=o.lng;pp["sname"]=p["originName"]||"";pp["dy"]=d.lat;pp["dx"]=d.lng;pp["dname"]=p["destinationName"]||""}},{key:"setProvinceAndNumber",value:function setProvinceAndNumber(province,number){if(province&&number){this.opt["province"]=province;this.opt["number"]=number}}},{key:"search_",value:function search_(origin,destination,opts,cbk,poiresult){var _this3=this;if(arguments.length===2){opts={}}if(arguments.length===3){if(typeof opts==="function"){cbk=opts;opts={}}}if(!(origin instanceof AMap.LngLat)||!(destination instanceof AMap.LngLat)){if(cbk&&typeof cbk==="function"){cbk("error","NO_PARAMS")}return}var params={origin:origin.toString(),destination:destination.toString(),extensions:this._parseString(this.opt["extensions"]),s:"rsv3"};if(this.opt["province"]&&this.opt["number"]){params["province"]=this.opt["province"];params["number"]=this.opt["number"].toUpperCase()}params["strategy"]=this._parseString(this.opt["policy"]);params["ferry"]=this._parseInt(this.opt["ferry"]+0);if(opts["waypoints"]&&opts["waypoints"].slice){opts["waypoints"]=opts["waypoints"].slice(0,16);params["waypoints"]=opts["waypoints"].join(";")}if(this._dodgeAreas.length){var avoid=[];for(var i=0;i<this._dodgeAreas.length;i+=1){avoid.push(this._dodgeAreas[i].join(";"))}params["avoidpolygons"]=avoid.join("|")}if(this._dodgeRoad){params["avoidroad"]=this._dodgeRoad}AMap.WebService.get(this.url,params,function(status,data){if(status==="complete"){_this3._onComplete(data,cbk,poiresult,{waypoints:AMap.Util.parseLngLatData(opts["waypoints"])})}else{_this3._onError(data,cbk)}})}},{key:"setPolicy",value:function setPolicy(policy){this.opt["policy"]=policy}},{key:"setLocation",value:function setLocation(city){this.opt["city"]=city}},{key:"_onError",value:function _onError(e,cbk){this.emit("error",e);if(cbk&&typeof cbk==="function"){cbk("error",e["info"])}}},{key:"_str2LngLat",value:function _str2LngLat(str){var arr=str.split(",");return new AMap.LngLat(+arr[0],+arr[1])}},{key:"_multi2Lnglat",value:function _multi2Lnglat(str){var result=[];var arr=str.split(";");for(var i=0;i<arr.length;i+=1){result[i]=this._str2LngLat(arr[i])}return result}},{key:"_parseString",value:function _parseString(v){var n=_typeof(v)==="object"||typeof v==="undefined"?"":v;return n}},{key:"_parseInt",value:function _parseInt(v){var n=parseInt(v,10);return isNaN(n)?0:n}},{key:"_parseRoutes",value:function _parseRoutes(data){var r=[];data=data["path"]?[data["path"]]:data;for(var i=0;i<data.length;i+=1){var t=data[i];r[i]={steps:this._parseStep(t["steps"]),restriction:this._parseInt(t["restriction"]),distance:this._parseInt(t["distance"]),time:this._parseInt(t["duration"]),policy:t["strategy"],tolls:this._parseInt(t["tolls"]),tolls_distance:this._parseInt(t["toll_distance"])}}return r}},{key:"_parseStep",value:function _parseStep(data){var _this4=this;var r=[];var that=this;for(var i=0;i<data.length;i+=1){var driveStep=data[i];var path=this._multi2Lnglat(driveStep["polyline"]);r[i]={start_location:path[0],end_location:path[path.length-1],instruction:this._parseString(driveStep["instruction"]),orientation:this._parseString(driveStep["orientation"]),road:this._parseString(driveStep["road"]),distance:this._parseInt(driveStep["distance"]),tolls:this._parseInt(driveStep["tolls"]),toll_distance:this._parseInt(driveStep["toll_distance"]),toll_road:this._parseString(driveStep["toll_road"]),time:this._parseInt(driveStep["duration"]),path:path,action:this._parseString(driveStep["action"]),assistant_action:this._parseString(driveStep["assistant_action"])};if(this._isArray(driveStep["cities"])){r[i]["cities"]=this._parseArray(driveStep["cities"],function(data,pro){var result;switch(pro){case"districts":result=that._parseArray(data);break;default:result=data}return result})}if(this._isArray(driveStep["tmcs"])){r[i]["tmcs"]=this._parseArray(driveStep["tmcs"],function(data,pro,arrItem){var result;switch(pro){case"distance":result=+data;break;case"polyline":arrItem["path"]=_this4._multi2Lnglat(data);result=data;break;default:result=data}return result});r[i]["tmcsPaths"]=this._mergeTmcs(r[i]["tmcs"])}}return r}},{key:"_mergeTmcs",value:function _mergeTmcs(tmcs){var paths=[],lastTail=null,i,len;var tmcsPathDistance=0;for(i=0,len=tmcs.length;i<len;i++){var path=tmcs[i]["path"];var status=tmcs[i]["status"];var tmcsStepDistance=tmcs[i]["distance"];if(!path||!path.length){return}var lastTailEndPos=lastTail&&lastTail.path[lastTail["path"].length-1];if(lastTail&&status===lastTail["status"]&&path[0].equals(lastTailEndPos)){lastTail["path"].push.apply(lastTail["path"],path);tmcsPathDistance+=tmcsStepDistance;lastTail.distance=tmcsPathDistance}else{paths.push({path:[].concat(path),status:status,distance:0});tmcsPathDistance=tmcsStepDistance;lastTail=paths[paths.length-1];lastTail.distance=tmcsPathDistance}}return paths}},{key:"_parseArray",value:function _parseArray(data,filter){var results=[];for(var i=0;i<data.length;i+=1){var result={};for(var pro in data[i]){if(data[i].hasOwnProperty(pro)){if(typeof filter==="function"&&(!data[i][pro]||data[i][pro].length>0)){result[pro]=filter.call(this,data[i][pro],pro,result)}else{result[pro]=data[i][pro]}}}results.push(result)}return results.length?results:null}},{key:"_isArray",value:function _isArray(array){if(Object.prototype.toString.call(array)==="[object Array]"){return true}return false}},{key:"close",value:function close(){this.closed=true}},{key:"open",value:function open(){this.closed=false}},{key:"_onComplete",value:function _onComplete(data,cbk,poiresult,extraOpts){if(this.closed){return}var result;var that=this;if(!parseInt(data["status"],10)){result={info:data["info"]};this.emit("error",result);if(cbk&&typeof cbk==="function"){cbk("error",data["info"])}}else{if(data["route"]){result={info:data["info"],origin:this._str2LngLat(data["route"]["origin"]),destination:this._str2LngLat(data["route"]["destination"]),routes:this._parseRoutes(data["route"]["paths"])};if(this.opt["extensions"]==="all"){result["taxi_cost"]=Math.ceil(data["route"]["taxi_cost"])}if(poiresult){result["start"]=poiresult[0];result["end"]=poiresult[poiresult.length-1];result["originName"]=result["start"].name;result["destinationName"]=result["end"].name;result["waypoints"]=poiresult.slice(1,poiresult.length-1);for(var i=0,len=result["waypoints"].length;i<len;i++){result["waypoints"][i]["isWaypoint"]=true}}else if(extraOpts){result["start"]={location:result["origin"],name:"起点"};result["end"]={location:result["destination"],name:"终点"};result["start"].type="start";result["end"].type="end";result["waypoints"]=[];if(extraOpts&&extraOpts["waypoints"]){var waypoints=extraOpts["waypoints"];for(var _i=0,_len=waypoints.length;_i<_len;_i++){result["waypoints"].push({isWaypoint:true,location:waypoints[_i],name:"途经点",type:"waypoint"})}}}if(that.opt["map"]||that.opt["panel"]){if(!that.render){that.render=new DrivingRender({showTraffic:that.opt["showTraffic"],showDir:that.opt["showDir"],zIndex:that.opt["zIndex"],eventSelf:that})}that.render["autoRender"]({data:result,panel:that.opt["panel"],map:that.opt["map"],hideMarkers:that.opt["hideMarkers"]||false,isOutline:that.opt["isOutline"],outlineColor:that.opt["outlineColor"],autoFitView:that.opt["autoFitView"]},that)}this.emit("complete",result);if(cbk&&typeof cbk==="function"){cbk("complete",result)}}else{result={info:data["info"].toLowerCase()==="ok"?"NO_DATA":data["info"]};this.emit("complete",result);if(cbk&&typeof cbk==="function"){cbk("no_data",{})}}}}}]);return Driving}(AMap.Event);AMap.Driving=Driving;AMap.DrivingPolicy=DrivingPolicy}(window.AMap); ')
|