map-core-func 0.2.23 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -191,4 +191,4 @@ Original MIT license applies
191
191
  * maptalks.animatemarker v0.4.1
192
192
  * LICENSE : MIT
193
193
  * (c) 2016-2017 maptalks.org
194
- */function vQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mQ(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function AQ(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var xQ={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},_Q=function(e){function r(){return vQ(this,r),mQ(this,e.apply(this,arguments))}return AQ(r,e),r.prototype.addGeometry=function(r){return r instanceof t.Geometry&&(r=[r]),r.forEach((function(e,r){if(!(e instanceof t.Marker))throw new Error("The geometry at "+r+" to add is not a maptalks.Marker")})),e.prototype.addGeometry.apply(this,arguments)},r.fromJSON=function(e){if(!e||"AnimateMarkerLayer"!==e.type)return null;for(var n=new r(e.id,e.options),i=e.geometries,o=[],s=0;s<i.length;s++){var a=t.Geometry.fromJSON(i[s]);a&&o.push(a)}return n.addGeometry(o),e.style&&n.setStyle(e.style),n},r}(t.VectorLayer);_Q.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),_Q.registerJSONType("AnimateMarkerLayer"),_Q.registerRenderer("canvas",function(e){function r(){return vQ(this,r),mQ(this,e.apply(this,arguments))}return AQ(r,e),r.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},r.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},r.prototype.needToRedraw=function(){return!!this.layer.options.animation||e.prototype.needToRedraw.call(this)},r.prototype.onCanvasCreate=function(){this._prepare()},r.prototype.onGeometryAdd=function(){this._redraw()},r.prototype.onGeometryRemove=function(){this._redraw()},r.prototype.onGeometrySymbolChange=function(){this._redraw()},r.prototype.onGeometryPositionChange=function(){this._redraw()},r.prototype.onGeometryShow=function(){this._redraw()},r.prototype.onGeometryHide=function(){this._redraw()},r.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},r.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},r.prototype._drawAllMarkers=function(t){var e=this,r=this.getMap(),n=r.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=r._prjToContainerPoint(t.coordinates);n.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=r._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},r.prototype._drawMarker=function(t,e,r,n){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(n-t.start)%i/i,u=r.fade&&a>=.5?2-2*a:1,l=r.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},r.prototype._prepare=function(){var t=this,e=[],r={},n=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?xQ:i._getInternalSymbol(),s=JSON.stringify(o);r[s]||(r[s]=o),e.push({coordinates:n.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(r),this._currentMarkers=e},r.prototype._prepareSprites=function(e){for(var r in this._spriteCache={},e){var n=e[r],i=new t.Marker([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[r]=i}},r.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},r.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},r=this.layer.options.animation?this.layer.options.animation.split(","):[],n=0;n<r.length;n++){var i=(t=r[n]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},r}(t.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var wQ=function(){return f((function t(e,r,i){l(this,t),this.map=i;var o=r.color||[255,0,0],s=r.opacity||.8,a=r.width||20,u=r.height||20,h=r.animationDuration||3e3,c=r.markerDx||0,f=r.markerDy||0,p=n.GeoJSON.toGeometry(e);this.layer=new _Q(n.Util.GUID(),p,{animation:"scale,fade",animationDuration:h,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:c,markerDy:f}}]).addTo(i)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),bQ=function(){return f((function t(e,r,o,s,a){l(this,t),this.lnglats=e,this.debug=(null==a?void 0:a.debug)||!1,this.stepRadianFac=(null==a?void 0:a.stepRadianFac)||10,this.limitUpdateFac=(null==a?void 0:a.limitUpdateFac)||2.5,this.repeatFlag=(null==a?void 0:a.repeatFlag)||!1,this.finishCallBack=null==a?void 0:a.finishCallBack,this.tarlnglats=r.map((function(t){return t})),this.layer=o,this.map=o.map,1==s&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var u=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=o.coordinateToVector3([u[0],u[1]]),this.translation=(new i.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var h=new i.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),c=0;c<e.length-1;c++){var f=e[c],p=this.tarlnglats[c],d=o.coordinateToVector3([f[0],f[1]]).sub(this.centerVector).normalize(),g=h.angleTo(d),y=h.x*d.y-h.y*d.x;y>0&&(g=2*Math.PI-g),this.debug&&console.log(g,g*(180/Math.PI),"子线角度");var v=o.coordinateToVector3([p[0],p[1]]).sub(this.centerVector).normalize(),m=d.angleTo(v),A=d.x*v.y-d.y*v.x;this.debug&&console.log(A,m*(180/Math.PI),"子线到聚类线角度");var x=new n.LineString([[f[0],f[1]],[u[0],u[1]]]).getLength(),_=o.distanceToVector3(x,x).x,w=-g;this.diffs.push(m),this.stepPara.push({stepRadian:Math.abs(m)/this.stepRadianFac,limitUpdate:Math.abs(m)/100*this.limitUpdateFac,startRadian:w,startDegree:w*(180/Math.PI),orientation:A,orientationSelf:y,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:_,coordinate:[0,0,f[2]||0],coord1:[f[0],f[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"tick",value:(t=a(_().mark((function t(e,r){var n,o,s,a,u,l,h,c;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=11;break}for(n=0;n<this.lnglats.length;n++)o=this.diffs[n],(s=this.stepPara[n])&&(Math.abs(o)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*e,s.totalRadian+=s.stepRadian*e):(s.stepTotalRadian+=-s.stepRadian*e,s.totalRadian+=-s.stepRadian*e),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new i.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=this.map.pointAtResToCoord(u,this.map.getGLRes()),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){t.next=11;break}if(this.count+=1,!r){t.next=11;break}return t.next=8,r();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){t.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){t.next=24;break}if(this.count+=1,!this.finishCallBack){t.next=18;break}return t.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){t.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!r){t.next=23;break}return t.next=23,r();case 23:this.count=0;case 24:case"end":return t.stop()}}),t,this)}))),function(e,r){return t.apply(this,arguments)})}]);var t}(),EQ=function(){return f((function t(e,r,n){l(this,t),this.layer=n,this.map=n.map,this.pointsLen=r.pointsLen||20,this.pointsDts=e,this.monitPoint=r.monitPoint}),[{key:"getPoints1",value:function(){var t=[];this.pointsDts.forEach((function(e){t.push(e.coordinate)})),this.monitPoint&&t.push(this.monitPoint);var e=new n.LineString(t),r=e.getLength()/4,o=this.layer.distanceToVector3(r,r).x,s=t[0],a=t[1],u=[(s[0]+a[0])/2,(s[1]+a[1])/2],l=this.layer.coordinateToVector3(e.getCenter()),h=this.layer.coordinateToVector3(s).sub(l),c=this.layer.coordinateToVector3(a).sub(l),f=this.layer.coordinateToVector3(u,o).sub(l),p=new i.CatmullRomCurve3([h,f,c],!1,"catmullrom").getPoints(this.pointsLen),d=[],g=this.layer.distanceToVector3(0,0).x,y=this.layer.coordinateToVector3(e.getCenter(),g);return p.forEach((function(t){d.push(t.x,t.y,t.z)})),{positions:d,pos:y}}},{key:"getPoints",value:function(t){var e=this,r=[];this.pointsDts.forEach((function(t){r.push(t.coordinate)})),this.monitPoint&&r.push(this.monitPoint),t&&r.reverse();var o=new n.LineString(r),s=[],a=this.layer.coordinateToVector3(o.getCenter());r.forEach((function(t){var r=e.layer.coordinateToVector3(t).sub(a);if(t[2]){var n=e.layer.distanceToVector3(t[2],t[2]).x;r.z=n}s.push(r)}));var u=new i.CatmullRomCurve3(s,!1,"catmullrom").getPoints(this.pointsLen),l=[],h=this.layer.distanceToVector3(0,0).x,c=this.layer.coordinateToVector3(o.getCenter(),h);return u.forEach((function(t){l.push(t.x,t.y,t.z)})),{positions:l,pos:c}}}])}(),IQ=function(){return f((function t(e,r,n,i){l(this,t),this.initValue=e,this.stepVlaue=r,this.limitValue=n,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=a(_().mark((function t(e,r){var n;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,n=this.initValue+this.totalValue,n=this.stepVlaue<0?n<this.limitValue?this.limitValue:n:n>this.limitValue?this.limitValue:n,t.next=7,r(n);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,r){return t.apply(this,arguments)})}]);var t}(),CQ=function(){return f((function t(e,r,n){l(this,t),this.threeLayer=e.threeLayer,this.layerClass=r,this.map=n,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var r=this.vector.clone();r.project(this.camera),r.x=Math.round((this.rateX+r.x/2)*(this.canvas.width/window.devicePixelRatio)),r.y=Math.round((this.rateY-r.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(r.y,"px"),this._container.style.left="".concat(r.x,"px")}}},{key:"setContent",value:function(t){if(!this._container){var e=this._container=n.DomUtil.createEl("div",n.Util.GUID());e.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(e),e.style.display="none"}this._container.innerHTML=t}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();exports.Arrow3D=uN,exports.B3DMLoader=bB,exports.B3DMLoaderBase=CM,exports.BaseObject=H,exports.CMPTLoader=NB,exports.CMPTLoaderBase=OB,exports.CUSTOM_COLOR=9,exports.CesiumIonTilesRenderer=VL,exports.CoordinateTransform=gQ,exports.DEPTH=4,exports.DISTANCE=3,exports.DebugCesiumIonTilesRenderer=qL,exports.DebugGoogleTilesRenderer=zL,exports.DebugTilesRenderer=DP,exports.EffectComposer=NN,exports.Ellipsoid=_T,exports.EllipsoidRegion=PT,exports.EllipsoidRegionHelper=MP,exports.EllipsoidRegionLineHelper=SP,exports.EnvironmentControls=AR,exports.FAILED=4,exports.GEOMETRIC_ERROR=2,exports.GLTFCesiumRTCExtension=FB,exports.GLTFExtensionLoader=UB,exports.GLTFMeshFeaturesExtension=RL,exports.GLTFStructuralMetadataExtension=CL,exports.GeoUtils=uT,exports.GlobeControls=NR,exports.GoogleTilesRenderer=GL,exports.I3DMLoader=DB,exports.I3DMLoaderBase=SB,exports.IS_LEAF=6,exports.LOADED=3,exports.LOADING=1,exports.LOAD_ORDER=10,exports.LRUCache=rM,exports.Line2=XO,exports.LineGeometry=YO,exports.LineMaterial=IO,exports.LoaderBase=EM,exports.NONE=0,exports.PARSING=2,exports.PNTSLoader=CB,exports.PNTSLoaderBase=EB,exports.PriorityQueue=nM,exports.RANDOM_COLOR=7,exports.RANDOM_NODE_COLOR=8,exports.RELATIVE_DEPTH=5,exports.RenderPass=AF,exports.SCREEN_ERROR=1,exports.SimpleInfoWindow=CQ,exports.SphereHelper=xP,exports.TextureAnimator=TS,exports.ThreeLayer=Bo,exports.ThreeRenderer=ko,exports.TilesRenderer=vP,exports.TilesRendererBase=AM,exports.UNLOADED=0,exports.WGS84_ELLIPSOID=DL,exports.WGS84_FLATTENING=oM,exports.WGS84_HEIGHT=sM,exports.WGS84_RADIUS=iM,exports.bloomClass=kF,exports.bloomLine=IN,exports.calIntersection=aS,exports.calPointColor=cS,exports.clusterClass=bQ,exports.drawTool=dQ,exports.extrudePolygon=_N,exports.getCenterOfPoints=ZC,exports.getCirGeojson=function(t,e,r,n,o){for(var s=o.map,a=o.coordinateToVector3([t,e],0),u=(new i.Matrix4).makeTranslation(a.x,a.y,0),l=o.distanceToVector3(r,r).x,h=[],c=0;c<=360;c++){var f=new i.Vector3(Math.sin(c*(Math.PI/180))*l,Math.cos(c*(Math.PI/180))*l,0);f=f.applyMatrix4(u);var p=s.pointAtResToCoord(f,s.getGLRes());h.push([p.x,p.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:n.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[h]]}}]}},exports.getCirGeojson1=function(t,e,r,n,o){for(var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=o.map,u=o.coordinateToVector3([t,e],0),l=(new i.Matrix4).makeTranslation(u.x,u.y,0),h=o.distanceToVector3(r,r).x,c=[],f=0;f<=360;f+=s){var p=new i.Vector3(Math.sin(f*(Math.PI/180))*h,Math.cos(f*(Math.PI/180))*h,0);p=p.applyMatrix4(l);var d=a.pointAtResToCoord(p,a.getGLRes());c.push([d.x,d.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:n.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[c]]}}]}},exports.getPsByCircle=function(t,e,r,n,o){for(var s,a,u=[],l=o.map,h=o.coordinateToVector3([t,e],0),c=(new i.Matrix4).makeTranslation(h.x,h.y,0),f=o.distanceToVector3(r,r).x,p=0;p<=360;){var d=(a=void 0,a=0,(s=p)<=90?a=-s:s>90&&s<=180||s>180&&s<=270?a=180-s:s>270&&s<360&&(a=360-s),{rotation:a}),g=iS(p,f,c),y=l.pointAtResToCoord(g,l.getGLRes());u.push({coord:[y.x,y.y],rotation:d.rotation}),p+=n}return u},exports.getUUid=YC,exports.getVPointGeojson=sS,exports.gisCommon=OS,exports.gltfLoadClass=vD,exports.groupClass=mD,exports.imgClass=vS,exports.layerClass=fQ,exports.layerClassNoOverride=pQ,exports.line2Object=sN,exports.line2Polygon=function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=[],s=[],a=0;a<t.length-1;a++){var u=[],l=a+1,h=sS(t[a][0],t[a][1],t[l][0],t[l][1],r,0,e);u.push(h.features[0].geometry.coordinates[0][0][0]),u.push(h.features[0].geometry.coordinates[0][0][1]);var c=sS(t[l][0],t[l][1],t[a][0],t[a][1],r,0,e);u.push(c.features[0].geometry.coordinates[0][0][0]),u.push(c.features[0].geometry.coordinates[0][0][1]),u.push(h.features[0].geometry.coordinates[0][0][0]);var f={type:"FeatureCollection",features:[{type:"Feature",properties:{_draw_type:"line"},geometry:{type:"MultiPolygon",coordinates:[[u]]}}]};o.push(u);var p=new n.MultiPolygon(f.features[0].geometry.coordinates);s.push(p)}var d=[];d.push(o[0][0]),d.push(o[0][1]);for(var g=0;g<o.length-1;g++){var y=s[g],v=s[g+1],m=o[g],A=o[g+1],x=aS(y,v);if(uS(x,0===g?m[2]:A[1])){var _=hS(x,m,A,t,i);d.push(_)}else d.push(m[2]),d.push(A[1])}d.push(o[o.length-1][2]),d.push(o[o.length-1][3]);for(var w=o.length-1;w>0;w--){var b=s[w],E=s[w-1],I=o[w],C=o[w-1],S=aS(b,E);if(uS(S,I[4])){var M=hS(S,I,C,t,i);d.push(M)}else d.push(I[4]),d.push(C[3])}return d.push(o[0][0]),d},exports.line2Polygon1=function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,n=[],i=0;i<t.length-1;i++){var o=[],s=i+1,a=sS(t[i][0],t[i][1],t[s][0],t[s][1],r,0,e);o.push(a.features[0].geometry.coordinates[0][0][0]),o.push(a.features[0].geometry.coordinates[0][0][1]);var u=sS(t[s][0],t[s][1],t[i][0],t[i][1],r,0,e);o.push(u.features[0].geometry.coordinates[0][0][0]),o.push(u.features[0].geometry.coordinates[0][0][1]),o.push(a.features[0].geometry.coordinates[0][0][0]),n.push(o)}return n},exports.lineLength=nS,exports.lineUtilClass=EQ,exports.opcityClass=IQ,exports.outlineBloomClass=PF,exports.overLayer=yQ,exports.planeGifClass=eN,exports.planeHeightClass=OF,exports.planeMark=ZS,exports.planeSectorClass=kS,exports.polygonClass=mN,exports.polylineClass=CO,exports.pyramidClass=sQ,exports.radarClass=xS,exports.rippleWallClass=xO,exports.sectorClass=SS,exports.shockClass=RS,exports.shockMarkerClass=wQ,exports.sleep=XC,exports.tileClass=dD,exports.tripHeight=lN,exports.tripHeight1=hN,exports.tripLineClass=cN,exports.tubeClass=iN,exports.turf=zC,exports.verticalFatLineClass=ZO,exports.wallClass=_O;
194
+ */function vQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mQ(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function AQ(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var r=Object.getOwnPropertyNames(e),n=0;n<r.length;n++){var i=r[n],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var xQ={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},_Q=function(e){function r(){return vQ(this,r),mQ(this,e.apply(this,arguments))}return AQ(r,e),r.prototype.addGeometry=function(r){return r instanceof t.Geometry&&(r=[r]),r.forEach((function(e,r){if(!(e instanceof t.Marker))throw new Error("The geometry at "+r+" to add is not a maptalks.Marker")})),e.prototype.addGeometry.apply(this,arguments)},r.fromJSON=function(e){if(!e||"AnimateMarkerLayer"!==e.type)return null;for(var n=new r(e.id,e.options),i=e.geometries,o=[],s=0;s<i.length;s++){var a=t.Geometry.fromJSON(i[s]);a&&o.push(a)}return n.addGeometry(o),e.style&&n.setStyle(e.style),n},r}(t.VectorLayer);_Q.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),_Q.registerJSONType("AnimateMarkerLayer"),_Q.registerRenderer("canvas",function(e){function r(){return vQ(this,r),mQ(this,e.apply(this,arguments))}return AQ(r,e),r.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},r.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},r.prototype.needToRedraw=function(){return!!this.layer.options.animation||e.prototype.needToRedraw.call(this)},r.prototype.onCanvasCreate=function(){this._prepare()},r.prototype.onGeometryAdd=function(){this._redraw()},r.prototype.onGeometryRemove=function(){this._redraw()},r.prototype.onGeometrySymbolChange=function(){this._redraw()},r.prototype.onGeometryPositionChange=function(){this._redraw()},r.prototype.onGeometryShow=function(){this._redraw()},r.prototype.onGeometryHide=function(){this._redraw()},r.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},r.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},r.prototype._drawAllMarkers=function(t){var e=this,r=this.getMap(),n=r.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=r._prjToContainerPoint(t.coordinates);n.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=r._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},r.prototype._drawMarker=function(t,e,r,n){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(n-t.start)%i/i,u=r.fade&&a>=.5?2-2*a:1,l=r.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},r.prototype._prepare=function(){var t=this,e=[],r={},n=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?xQ:i._getInternalSymbol(),s=JSON.stringify(o);r[s]||(r[s]=o),e.push({coordinates:n.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(r),this._currentMarkers=e},r.prototype._prepareSprites=function(e){for(var r in this._spriteCache={},e){var n=e[r],i=new t.Marker([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[r]=i}},r.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},r.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},r=this.layer.options.animation?this.layer.options.animation.split(","):[],n=0;n<r.length;n++){var i=(t=r[n]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},r}(t.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var wQ=function(){return f((function t(e,r,i){l(this,t),this.map=i;var o=r.color||[255,0,0],s=r.opacity||.8,a=r.width||20,u=r.height||20,h=r.animationDuration||3e3,c=r.markerDx||0,f=r.markerDy||0,p=n.GeoJSON.toGeometry(e);this.layer=new _Q(n.Util.GUID(),p,{animation:"scale,fade",animationDuration:h,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:c,markerDy:f}}]).addTo(i)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),bQ=function(){return f((function t(e,r,o,s,a){l(this,t),this.lnglats=e,this.debug=(null==a?void 0:a.debug)||!1,this.stepRadianFac=(null==a?void 0:a.stepRadianFac)||10,this.limitUpdateFac=(null==a?void 0:a.limitUpdateFac)||2.5,this.repeatFlag=(null==a?void 0:a.repeatFlag)||!1,this.finishCallBack=null==a?void 0:a.finishCallBack,this.tarlnglats=r.map((function(t){return t})),this.layer=o,this.map=o.map,1==s&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var u=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=o.coordinateToVector3([u[0],u[1]]),this.translation=(new i.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var h=new i.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),c=0;c<e.length-1;c++){var f=e[c],p=this.tarlnglats[c],d=o.coordinateToVector3([f[0],f[1]]).sub(this.centerVector).normalize(),g=h.angleTo(d),y=h.x*d.y-h.y*d.x;y>0&&(g=2*Math.PI-g),this.debug&&console.log(g,g*(180/Math.PI),"子线角度");var v=o.coordinateToVector3([p[0],p[1]]).sub(this.centerVector).normalize(),m=d.angleTo(v),A=d.x*v.y-d.y*v.x;this.debug&&console.log(A,m*(180/Math.PI),"子线到聚类线角度");var x=new n.LineString([[f[0],f[1]],[u[0],u[1]]]).getLength(),_=o.distanceToVector3(x,x).x,w=-g;this.diffs.push(m),this.stepPara.push({stepRadian:Math.abs(m)/this.stepRadianFac,limitUpdate:Math.abs(m)/100*this.limitUpdateFac,startRadian:w,startDegree:w*(180/Math.PI),orientation:A,orientationSelf:y,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:_,coordinate:[0,0,f[2]||0],coord1:[f[0],f[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"getGLRes",value:function(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}},{key:"tick",value:(t=a(_().mark((function t(e,r){var n,o,s,a,u,l,h,c;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=11;break}for(n=0;n<this.lnglats.length;n++)o=this.diffs[n],(s=this.stepPara[n])&&(Math.abs(o)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*e,s.totalRadian+=s.stepRadian*e):(s.stepTotalRadian+=-s.stepRadian*e,s.totalRadian+=-s.stepRadian*e),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new i.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=void 0,l=this.map.pointAtResToCoord?this.map.pointAtResToCoord(u,this.getGLRes(this.map)):this.map.pointToCoordinate(u,this.getGLRes(this.map)),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){t.next=11;break}if(this.count+=1,!r){t.next=11;break}return t.next=8,r();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){t.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){t.next=24;break}if(this.count+=1,!this.finishCallBack){t.next=18;break}return t.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){t.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!r){t.next=23;break}return t.next=23,r();case 23:this.count=0;case 24:case"end":return t.stop()}}),t,this)}))),function(e,r){return t.apply(this,arguments)})}]);var t}(),EQ=function(){return f((function t(e,r,n){l(this,t),this.layer=n,this.map=n.map,this.pointsLen=r.pointsLen||20,this.pointsDts=e,this.monitPoint=r.monitPoint}),[{key:"getPoints1",value:function(){var t=[];this.pointsDts.forEach((function(e){t.push(e.coordinate)})),this.monitPoint&&t.push(this.monitPoint);var e=new n.LineString(t),r=e.getLength()/4,o=this.layer.distanceToVector3(r,r).x,s=t[0],a=t[1],u=[(s[0]+a[0])/2,(s[1]+a[1])/2],l=this.layer.coordinateToVector3(e.getCenter()),h=this.layer.coordinateToVector3(s).sub(l),c=this.layer.coordinateToVector3(a).sub(l),f=this.layer.coordinateToVector3(u,o).sub(l),p=new i.CatmullRomCurve3([h,f,c],!1,"catmullrom").getPoints(this.pointsLen),d=[],g=this.layer.distanceToVector3(0,0).x,y=this.layer.coordinateToVector3(e.getCenter(),g);return p.forEach((function(t){d.push(t.x,t.y,t.z)})),{positions:d,pos:y}}},{key:"getPoints",value:function(t){var e=this,r=[];this.pointsDts.forEach((function(t){r.push(t.coordinate)})),this.monitPoint&&r.push(this.monitPoint),t&&r.reverse();var o=new n.LineString(r),s=[],a=this.layer.coordinateToVector3(o.getCenter());r.forEach((function(t){var r=e.layer.coordinateToVector3(t).sub(a);if(t[2]){var n=e.layer.distanceToVector3(t[2],t[2]).x;r.z=n}s.push(r)}));var u=new i.CatmullRomCurve3(s,!1,"catmullrom").getPoints(this.pointsLen),l=[],h=this.layer.distanceToVector3(0,0).x,c=this.layer.coordinateToVector3(o.getCenter(),h);return u.forEach((function(t){l.push(t.x,t.y,t.z)})),{positions:l,pos:c}}}])}(),IQ=function(){return f((function t(e,r,n,i){l(this,t),this.initValue=e,this.stepVlaue=r,this.limitValue=n,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=a(_().mark((function t(e,r){var n;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,n=this.initValue+this.totalValue,n=this.stepVlaue<0?n<this.limitValue?this.limitValue:n:n>this.limitValue?this.limitValue:n,t.next=7,r(n);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,r){return t.apply(this,arguments)})}]);var t}(),CQ=function(){return f((function t(e,r,n){l(this,t),this.threeLayer=e.threeLayer,this.layerClass=r,this.map=n,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var r=this.vector.clone();r.project(this.camera),r.x=Math.round((this.rateX+r.x/2)*(this.canvas.width/window.devicePixelRatio)),r.y=Math.round((this.rateY-r.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(r.y,"px"),this._container.style.left="".concat(r.x,"px")}}},{key:"setContent",value:function(t){if(!this._container){var e=this._container=n.DomUtil.createEl("div",n.Util.GUID());e.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(e),e.style.display="none"}this._container.innerHTML=t}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();exports.Arrow3D=uN,exports.B3DMLoader=bB,exports.B3DMLoaderBase=CM,exports.BaseObject=H,exports.CMPTLoader=NB,exports.CMPTLoaderBase=OB,exports.CUSTOM_COLOR=9,exports.CesiumIonTilesRenderer=VL,exports.CoordinateTransform=gQ,exports.DEPTH=4,exports.DISTANCE=3,exports.DebugCesiumIonTilesRenderer=qL,exports.DebugGoogleTilesRenderer=zL,exports.DebugTilesRenderer=DP,exports.EffectComposer=NN,exports.Ellipsoid=_T,exports.EllipsoidRegion=PT,exports.EllipsoidRegionHelper=MP,exports.EllipsoidRegionLineHelper=SP,exports.EnvironmentControls=AR,exports.FAILED=4,exports.GEOMETRIC_ERROR=2,exports.GLTFCesiumRTCExtension=FB,exports.GLTFExtensionLoader=UB,exports.GLTFMeshFeaturesExtension=RL,exports.GLTFStructuralMetadataExtension=CL,exports.GeoUtils=uT,exports.GlobeControls=NR,exports.GoogleTilesRenderer=GL,exports.I3DMLoader=DB,exports.I3DMLoaderBase=SB,exports.IS_LEAF=6,exports.LOADED=3,exports.LOADING=1,exports.LOAD_ORDER=10,exports.LRUCache=rM,exports.Line2=XO,exports.LineGeometry=YO,exports.LineMaterial=IO,exports.LoaderBase=EM,exports.NONE=0,exports.PARSING=2,exports.PNTSLoader=CB,exports.PNTSLoaderBase=EB,exports.PriorityQueue=nM,exports.RANDOM_COLOR=7,exports.RANDOM_NODE_COLOR=8,exports.RELATIVE_DEPTH=5,exports.RenderPass=AF,exports.SCREEN_ERROR=1,exports.SimpleInfoWindow=CQ,exports.SphereHelper=xP,exports.TextureAnimator=TS,exports.ThreeLayer=Bo,exports.ThreeRenderer=ko,exports.TilesRenderer=vP,exports.TilesRendererBase=AM,exports.UNLOADED=0,exports.WGS84_ELLIPSOID=DL,exports.WGS84_FLATTENING=oM,exports.WGS84_HEIGHT=sM,exports.WGS84_RADIUS=iM,exports.bloomClass=kF,exports.bloomLine=IN,exports.calIntersection=aS,exports.calPointColor=cS,exports.clusterClass=bQ,exports.drawTool=dQ,exports.extrudePolygon=_N,exports.getCenterOfPoints=ZC,exports.getCirGeojson=function(t,e,r,n,o){for(var s=o.map,a=o.coordinateToVector3([t,e],0),u=(new i.Matrix4).makeTranslation(a.x,a.y,0),l=o.distanceToVector3(r,r).x,h=[],c=0;c<=360;c++){var f=new i.Vector3(Math.sin(c*(Math.PI/180))*l,Math.cos(c*(Math.PI/180))*l,0);f=f.applyMatrix4(u);var p=s.pointAtResToCoord(f,s.getGLRes());h.push([p.x,p.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:n.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[h]]}}]}},exports.getCirGeojson1=function(t,e,r,n,o){for(var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=o.map,u=o.coordinateToVector3([t,e],0),l=(new i.Matrix4).makeTranslation(u.x,u.y,0),h=o.distanceToVector3(r,r).x,c=[],f=0;f<=360;f+=s){var p=new i.Vector3(Math.sin(f*(Math.PI/180))*h,Math.cos(f*(Math.PI/180))*h,0);p=p.applyMatrix4(l);var d=a.pointAtResToCoord(p,a.getGLRes());c.push([d.x,d.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:n.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[c]]}}]}},exports.getPsByCircle=function(t,e,r,n,o){for(var s,a,u=[],l=o.map,h=o.coordinateToVector3([t,e],0),c=(new i.Matrix4).makeTranslation(h.x,h.y,0),f=o.distanceToVector3(r,r).x,p=0;p<=360;){var d=(a=void 0,a=0,(s=p)<=90?a=-s:s>90&&s<=180||s>180&&s<=270?a=180-s:s>270&&s<360&&(a=360-s),{rotation:a}),g=iS(p,f,c),y=l.pointAtResToCoord(g,l.getGLRes());u.push({coord:[y.x,y.y],rotation:d.rotation}),p+=n}return u},exports.getUUid=YC,exports.getVPointGeojson=sS,exports.gisCommon=OS,exports.gltfLoadClass=vD,exports.groupClass=mD,exports.imgClass=vS,exports.layerClass=fQ,exports.layerClassNoOverride=pQ,exports.line2Object=sN,exports.line2Polygon=function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=[],s=[],a=0;a<t.length-1;a++){var u=[],l=a+1,h=sS(t[a][0],t[a][1],t[l][0],t[l][1],r,0,e);u.push(h.features[0].geometry.coordinates[0][0][0]),u.push(h.features[0].geometry.coordinates[0][0][1]);var c=sS(t[l][0],t[l][1],t[a][0],t[a][1],r,0,e);u.push(c.features[0].geometry.coordinates[0][0][0]),u.push(c.features[0].geometry.coordinates[0][0][1]),u.push(h.features[0].geometry.coordinates[0][0][0]);var f={type:"FeatureCollection",features:[{type:"Feature",properties:{_draw_type:"line"},geometry:{type:"MultiPolygon",coordinates:[[u]]}}]};o.push(u);var p=new n.MultiPolygon(f.features[0].geometry.coordinates);s.push(p)}var d=[];d.push(o[0][0]),d.push(o[0][1]);for(var g=0;g<o.length-1;g++){var y=s[g],v=s[g+1],m=o[g],A=o[g+1],x=aS(y,v);if(uS(x,0===g?m[2]:A[1])){var _=hS(x,m,A,t,i);d.push(_)}else d.push(m[2]),d.push(A[1])}d.push(o[o.length-1][2]),d.push(o[o.length-1][3]);for(var w=o.length-1;w>0;w--){var b=s[w],E=s[w-1],I=o[w],C=o[w-1],S=aS(b,E);if(uS(S,I[4])){var M=hS(S,I,C,t,i);d.push(M)}else d.push(I[4]),d.push(C[3])}return d.push(o[0][0]),d},exports.line2Polygon1=function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,n=[],i=0;i<t.length-1;i++){var o=[],s=i+1,a=sS(t[i][0],t[i][1],t[s][0],t[s][1],r,0,e);o.push(a.features[0].geometry.coordinates[0][0][0]),o.push(a.features[0].geometry.coordinates[0][0][1]);var u=sS(t[s][0],t[s][1],t[i][0],t[i][1],r,0,e);o.push(u.features[0].geometry.coordinates[0][0][0]),o.push(u.features[0].geometry.coordinates[0][0][1]),o.push(a.features[0].geometry.coordinates[0][0][0]),n.push(o)}return n},exports.lineLength=nS,exports.lineUtilClass=EQ,exports.opcityClass=IQ,exports.outlineBloomClass=PF,exports.overLayer=yQ,exports.planeGifClass=eN,exports.planeHeightClass=OF,exports.planeMark=ZS,exports.planeSectorClass=kS,exports.polygonClass=mN,exports.polylineClass=CO,exports.pyramidClass=sQ,exports.radarClass=xS,exports.rippleWallClass=xO,exports.sectorClass=SS,exports.shockClass=RS,exports.shockMarkerClass=wQ,exports.sleep=XC,exports.tileClass=dD,exports.tripHeight=lN,exports.tripHeight1=hN,exports.tripLineClass=cN,exports.tubeClass=iN,exports.turf=zC,exports.verticalFatLineClass=ZO,exports.wallClass=_O;
@@ -191,4 +191,4 @@ Original MIT license applies
191
191
  * maptalks.animatemarker v0.4.1
192
192
  * LICENSE : MIT
193
193
  * (c) 2016-2017 maptalks.org
194
- */function Mj(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bj(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Tj(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var kj={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},Pj=function(t){function r(){return Mj(this,r),Bj(this,t.apply(this,arguments))}return Tj(r,t),r.prototype.addGeometry=function(r){return r instanceof n&&(r=[r]),r.forEach((function(t,n){if(!(t instanceof e))throw new Error("The geometry at "+n+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},r.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var e=new r(t.id,t.options),i=t.geometries,o=[],s=0;s<i.length;s++){var a=n.fromJSON(i[s]);a&&o.push(a)}return e.addGeometry(o),t.style&&e.setStyle(t.style),e},r}(r);Pj.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),Pj.registerJSONType("AnimateMarkerLayer"),Pj.registerRenderer("canvas",function(t){function n(){return Mj(this,n),Bj(this,t.apply(this,arguments))}return Tj(n,t),n.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},n.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},n.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},n.prototype.onCanvasCreate=function(){this._prepare()},n.prototype.onGeometryAdd=function(){this._redraw()},n.prototype.onGeometryRemove=function(){this._redraw()},n.prototype.onGeometrySymbolChange=function(){this._redraw()},n.prototype.onGeometryPositionChange=function(){this._redraw()},n.prototype.onGeometryShow=function(){this._redraw()},n.prototype.onGeometryHide=function(){this._redraw()},n.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},n.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},n.prototype._drawAllMarkers=function(t){var e=this,n=this.getMap(),r=n.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=n._prjToContainerPoint(t.coordinates);r.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=n._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},n.prototype._drawMarker=function(t,e,n,r){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(r-t.start)%i/i,u=n.fade&&a>=.5?2-2*a:1,l=n.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},n.prototype._prepare=function(){var t=this,e=[],n={},r=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?kj:i._getInternalSymbol(),s=JSON.stringify(o);n[s]||(n[s]=o),e.push({coordinates:r.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(n),this._currentMarkers=e},n.prototype._prepareSprites=function(t){for(var n in this._spriteCache={},t){var r=t[n],i=new e([0,0],{symbol:r})._getSprite(this.resources);this._spriteCache[n]=i}},n.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},n.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},n=this.layer.options.animation?this.layer.options.animation.split(","):[],r=0;r<n.length;r++){var i=(t=n[r]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},n}(i.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var Lj=function(){return rn((function e(n,r,i){tn(this,e),this.map=i;var o=r.color||[255,0,0],s=r.opacity||.8,a=r.width||20,u=r.height||20,l=r.animationDuration||3e3,h=r.markerDx||0,c=r.markerDy||0,f=t.GeoJSON.toGeometry(n);this.layer=new Pj(t.Util.GUID(),f,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:h,markerDy:c}}]).addTo(i)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),Rj=function(){return rn((function e(n,r,i,s,a){tn(this,e),this.lnglats=n,this.debug=(null==a?void 0:a.debug)||!1,this.stepRadianFac=(null==a?void 0:a.stepRadianFac)||10,this.limitUpdateFac=(null==a?void 0:a.limitUpdateFac)||2.5,this.repeatFlag=(null==a?void 0:a.repeatFlag)||!1,this.finishCallBack=null==a?void 0:a.finishCallBack,this.tarlnglats=r.map((function(t){return t})),this.layer=i,this.map=i.map,1==s&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var u=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=i.coordinateToVector3([u[0],u[1]]),this.translation=(new o.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var l=new o.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),h=0;h<n.length-1;h++){var c=n[h],f=this.tarlnglats[h],p=i.coordinateToVector3([c[0],c[1]]).sub(this.centerVector).normalize(),d=l.angleTo(p),g=l.x*p.y-l.y*p.x;g>0&&(d=2*Math.PI-d),this.debug&&console.log(d,d*(180/Math.PI),"子线角度");var y=i.coordinateToVector3([f[0],f[1]]).sub(this.centerVector).normalize(),v=p.angleTo(y),m=p.x*y.y-p.y*y.x;this.debug&&console.log(m,v*(180/Math.PI),"子线到聚类线角度");var A=new t.LineString([[c[0],c[1]],[u[0],u[1]]]).getLength(),_=i.distanceToVector3(A,A).x,x=-d;this.diffs.push(v),this.stepPara.push({stepRadian:Math.abs(v)/this.stepRadianFac,limitUpdate:Math.abs(v)/100*this.limitUpdateFac,startRadian:x,startDegree:x*(180/Math.PI),orientation:m,orientationSelf:g,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:_,coordinate:[0,0,c[2]||0],coord1:[c[0],c[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"tick",value:(e=Ze(pn().mark((function t(e,n){var r,i,s,a,u,l,h,c;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=11;break}for(r=0;r<this.lnglats.length;r++)i=this.diffs[r],(s=this.stepPara[r])&&(Math.abs(i)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*e,s.totalRadian+=s.stepRadian*e):(s.stepTotalRadian+=-s.stepRadian*e,s.totalRadian+=-s.stepRadian*e),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new o.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=this.map.pointAtResToCoord(u,this.map.getGLRes()),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){t.next=11;break}if(this.count+=1,!n){t.next=11;break}return t.next=8,n();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){t.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){t.next=24;break}if(this.count+=1,!this.finishCallBack){t.next=18;break}return t.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){t.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!n){t.next=23;break}return t.next=23,n();case 23:this.count=0;case 24:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e}(),Dj=function(){return rn((function t(e,n,r){tn(this,t),this.layer=r,this.map=r.map,this.pointsLen=n.pointsLen||20,this.pointsDts=e,this.monitPoint=n.monitPoint}),[{key:"getPoints1",value:function(){var e=[];this.pointsDts.forEach((function(t){e.push(t.coordinate)})),this.monitPoint&&e.push(this.monitPoint);var n=new t.LineString(e),r=n.getLength()/4,i=this.layer.distanceToVector3(r,r).x,s=e[0],a=e[1],u=[(s[0]+a[0])/2,(s[1]+a[1])/2],l=this.layer.coordinateToVector3(n.getCenter()),h=this.layer.coordinateToVector3(s).sub(l),c=this.layer.coordinateToVector3(a).sub(l),f=this.layer.coordinateToVector3(u,i).sub(l),p=new o.CatmullRomCurve3([h,f,c],!1,"catmullrom").getPoints(this.pointsLen),d=[],g=this.layer.distanceToVector3(0,0).x,y=this.layer.coordinateToVector3(n.getCenter(),g);return p.forEach((function(t){d.push(t.x,t.y,t.z)})),{positions:d,pos:y}}},{key:"getPoints",value:function(e){var n=this,r=[];this.pointsDts.forEach((function(t){r.push(t.coordinate)})),this.monitPoint&&r.push(this.monitPoint),e&&r.reverse();var i=new t.LineString(r),s=[],a=this.layer.coordinateToVector3(i.getCenter());r.forEach((function(t){var e=n.layer.coordinateToVector3(t).sub(a);if(t[2]){var r=n.layer.distanceToVector3(t[2],t[2]).x;e.z=r}s.push(e)}));var u=new o.CatmullRomCurve3(s,!1,"catmullrom").getPoints(this.pointsLen),l=[],h=this.layer.distanceToVector3(0,0).x,c=this.layer.coordinateToVector3(i.getCenter(),h);return u.forEach((function(t){l.push(t.x,t.y,t.z)})),{positions:l,pos:c}}}])}(),Oj=function(){return rn((function t(e,n,r,i){tn(this,t),this.initValue=e,this.stepVlaue=n,this.limitValue=r,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=Ze(pn().mark((function t(e,n){var r;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,r=this.initValue+this.totalValue,r=this.stepVlaue<0?r<this.limitValue?this.limitValue:r:r>this.limitValue?this.limitValue:r,t.next=7,n(r);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),Nj=function(){return rn((function t(e,n,r){tn(this,t),this.threeLayer=e.threeLayer,this.layerClass=n,this.map=r,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var n=this.vector.clone();n.project(this.camera),n.x=Math.round((this.rateX+n.x/2)*(this.canvas.width/window.devicePixelRatio)),n.y=Math.round((this.rateY-n.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(n.y,"px"),this._container.style.left="".concat(n.x,"px")}}},{key:"setContent",value:function(e){if(!this._container){var n=this._container=t.DomUtil.createEl("div",t.Util.GUID());n.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(n),n.style.display="none"}this._container.innerHTML=e}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();export{AQ as Arrow3D,EP as B3DMLoader,Sk as B3DMLoaderBase,Fn as BaseObject,FP as CMPTLoader,NP as CMPTLoaderBase,VD as CUSTOM_COLOR,eN as CesiumIonTilesRenderer,Cj as CoordinateTransform,UD as DEPTH,FD as DISTANCE,nN as DebugCesiumIonTilesRenderer,$O as DebugGoogleTilesRenderer,WD as DebugTilesRenderer,YQ as EffectComposer,wL as Ellipsoid,LL as EllipsoidRegion,BD as EllipsoidRegionHelper,MD as EllipsoidRegionLineHelper,TN as EnvironmentControls,ik as FAILED,ND as GEOMETRIC_ERROR,UP as GLTFCesiumRTCExtension,QP as GLTFExtensionLoader,qO as GLTFMeshFeaturesExtension,NO as GLTFStructuralMetadataExtension,lL as GeoUtils,YN as GlobeControls,ZO as GoogleTilesRenderer,OP as I3DMLoader,MP as I3DMLoaderBase,GD as IS_LEAF,rk as LOADED,ek as LOADING,qD as LOAD_ORDER,ZT as LRUCache,sQ as Line2,oQ as LineGeometry,OU as LineMaterial,Ik as LoaderBase,DD as NONE,nk as PARSING,SP as PNTSLoader,IP as PNTSLoaderBase,$T as PriorityQueue,zD as RANDOM_COLOR,jD as RANDOM_NODE_COLOR,QD as RELATIVE_DEPTH,TG as RenderPass,OD as SCREEN_ERROR,Nj as SimpleInfoWindow,xD as SphereHelper,CT as TextureAnimator,_u as ThreeLayer,wu as ThreeRenderer,mD as TilesRenderer,_k as TilesRendererBase,tk as UNLOADED,HO as WGS84_ELLIPSOID,sk as WGS84_FLATTENING,ak as WGS84_HEIGHT,ok as WGS84_RADIUS,zG as bloomClass,OQ as bloomLine,eT as calIntersection,aT as calPointColor,Rj as clusterClass,Ij as drawTool,PQ as extrudePolygon,jB as getCenterOfPoints,KB as getCirGeojson,ZB as getCirGeojson1,JB as getPsByCircle,UB as getUUid,tT as getVPointGeojson,PT as gisCommon,MF as gltfLoadClass,BF as groupClass,pT as imgClass,bj as layerClass,Ej as layerClassNoOverride,vQ as line2Object,sT as line2Polygon,oT as line2Polygon1,YB as lineLength,Dj as lineUtilClass,Oj as opcityClass,jG as outlineBloomClass,Sj as overLayer,fQ as planeGifClass,WG as planeHeightClass,YT as planeMark,ST as planeSectorClass,BQ as polygonClass,NU as polylineClass,vj as pyramidClass,yT as radarClass,kU as rippleWallClass,bT as sectorClass,TT as shockClass,Lj as shockMarkerClass,QB as sleep,IF as tileClass,_Q as tripHeight,xQ as tripHeight1,wQ as tripLineClass,gQ as tubeClass,LB as turf,lQ as verticalFatLineClass,PU as wallClass};
194
+ */function Mj(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bj(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Tj(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var kj={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},Pj=function(t){function r(){return Mj(this,r),Bj(this,t.apply(this,arguments))}return Tj(r,t),r.prototype.addGeometry=function(r){return r instanceof n&&(r=[r]),r.forEach((function(t,n){if(!(t instanceof e))throw new Error("The geometry at "+n+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},r.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var e=new r(t.id,t.options),i=t.geometries,o=[],s=0;s<i.length;s++){var a=n.fromJSON(i[s]);a&&o.push(a)}return e.addGeometry(o),t.style&&e.setStyle(t.style),e},r}(r);Pj.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),Pj.registerJSONType("AnimateMarkerLayer"),Pj.registerRenderer("canvas",function(t){function n(){return Mj(this,n),Bj(this,t.apply(this,arguments))}return Tj(n,t),n.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},n.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},n.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},n.prototype.onCanvasCreate=function(){this._prepare()},n.prototype.onGeometryAdd=function(){this._redraw()},n.prototype.onGeometryRemove=function(){this._redraw()},n.prototype.onGeometrySymbolChange=function(){this._redraw()},n.prototype.onGeometryPositionChange=function(){this._redraw()},n.prototype.onGeometryShow=function(){this._redraw()},n.prototype.onGeometryHide=function(){this._redraw()},n.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},n.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},n.prototype._drawAllMarkers=function(t){var e=this,n=this.getMap(),r=n.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=n._prjToContainerPoint(t.coordinates);r.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=n._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},n.prototype._drawMarker=function(t,e,n,r){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(r-t.start)%i/i,u=n.fade&&a>=.5?2-2*a:1,l=n.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},n.prototype._prepare=function(){var t=this,e=[],n={},r=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?kj:i._getInternalSymbol(),s=JSON.stringify(o);n[s]||(n[s]=o),e.push({coordinates:r.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(n),this._currentMarkers=e},n.prototype._prepareSprites=function(t){for(var n in this._spriteCache={},t){var r=t[n],i=new e([0,0],{symbol:r})._getSprite(this.resources);this._spriteCache[n]=i}},n.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},n.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},n=this.layer.options.animation?this.layer.options.animation.split(","):[],r=0;r<n.length;r++){var i=(t=n[r]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},n}(i.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var Lj=function(){return rn((function e(n,r,i){tn(this,e),this.map=i;var o=r.color||[255,0,0],s=r.opacity||.8,a=r.width||20,u=r.height||20,l=r.animationDuration||3e3,h=r.markerDx||0,c=r.markerDy||0,f=t.GeoJSON.toGeometry(n);this.layer=new Pj(t.Util.GUID(),f,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:h,markerDy:c}}]).addTo(i)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),Rj=function(){return rn((function e(n,r,i,s,a){tn(this,e),this.lnglats=n,this.debug=(null==a?void 0:a.debug)||!1,this.stepRadianFac=(null==a?void 0:a.stepRadianFac)||10,this.limitUpdateFac=(null==a?void 0:a.limitUpdateFac)||2.5,this.repeatFlag=(null==a?void 0:a.repeatFlag)||!1,this.finishCallBack=null==a?void 0:a.finishCallBack,this.tarlnglats=r.map((function(t){return t})),this.layer=i,this.map=i.map,1==s&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var u=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=i.coordinateToVector3([u[0],u[1]]),this.translation=(new o.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var l=new o.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),h=0;h<n.length-1;h++){var c=n[h],f=this.tarlnglats[h],p=i.coordinateToVector3([c[0],c[1]]).sub(this.centerVector).normalize(),d=l.angleTo(p),g=l.x*p.y-l.y*p.x;g>0&&(d=2*Math.PI-d),this.debug&&console.log(d,d*(180/Math.PI),"子线角度");var y=i.coordinateToVector3([f[0],f[1]]).sub(this.centerVector).normalize(),v=p.angleTo(y),m=p.x*y.y-p.y*y.x;this.debug&&console.log(m,v*(180/Math.PI),"子线到聚类线角度");var A=new t.LineString([[c[0],c[1]],[u[0],u[1]]]).getLength(),_=i.distanceToVector3(A,A).x,x=-d;this.diffs.push(v),this.stepPara.push({stepRadian:Math.abs(v)/this.stepRadianFac,limitUpdate:Math.abs(v)/100*this.limitUpdateFac,startRadian:x,startDegree:x*(180/Math.PI),orientation:m,orientationSelf:g,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:_,coordinate:[0,0,c[2]||0],coord1:[c[0],c[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"getGLRes",value:function(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}},{key:"tick",value:(e=Ze(pn().mark((function t(e,n){var r,i,s,a,u,l,h,c;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=11;break}for(r=0;r<this.lnglats.length;r++)i=this.diffs[r],(s=this.stepPara[r])&&(Math.abs(i)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*e,s.totalRadian+=s.stepRadian*e):(s.stepTotalRadian+=-s.stepRadian*e,s.totalRadian+=-s.stepRadian*e),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new o.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=void 0,l=this.map.pointAtResToCoord?this.map.pointAtResToCoord(u,this.getGLRes(this.map)):this.map.pointToCoordinate(u,this.getGLRes(this.map)),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){t.next=11;break}if(this.count+=1,!n){t.next=11;break}return t.next=8,n();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){t.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){t.next=24;break}if(this.count+=1,!this.finishCallBack){t.next=18;break}return t.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){t.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!n){t.next=23;break}return t.next=23,n();case 23:this.count=0;case 24:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e}(),Dj=function(){return rn((function t(e,n,r){tn(this,t),this.layer=r,this.map=r.map,this.pointsLen=n.pointsLen||20,this.pointsDts=e,this.monitPoint=n.monitPoint}),[{key:"getPoints1",value:function(){var e=[];this.pointsDts.forEach((function(t){e.push(t.coordinate)})),this.monitPoint&&e.push(this.monitPoint);var n=new t.LineString(e),r=n.getLength()/4,i=this.layer.distanceToVector3(r,r).x,s=e[0],a=e[1],u=[(s[0]+a[0])/2,(s[1]+a[1])/2],l=this.layer.coordinateToVector3(n.getCenter()),h=this.layer.coordinateToVector3(s).sub(l),c=this.layer.coordinateToVector3(a).sub(l),f=this.layer.coordinateToVector3(u,i).sub(l),p=new o.CatmullRomCurve3([h,f,c],!1,"catmullrom").getPoints(this.pointsLen),d=[],g=this.layer.distanceToVector3(0,0).x,y=this.layer.coordinateToVector3(n.getCenter(),g);return p.forEach((function(t){d.push(t.x,t.y,t.z)})),{positions:d,pos:y}}},{key:"getPoints",value:function(e){var n=this,r=[];this.pointsDts.forEach((function(t){r.push(t.coordinate)})),this.monitPoint&&r.push(this.monitPoint),e&&r.reverse();var i=new t.LineString(r),s=[],a=this.layer.coordinateToVector3(i.getCenter());r.forEach((function(t){var e=n.layer.coordinateToVector3(t).sub(a);if(t[2]){var r=n.layer.distanceToVector3(t[2],t[2]).x;e.z=r}s.push(e)}));var u=new o.CatmullRomCurve3(s,!1,"catmullrom").getPoints(this.pointsLen),l=[],h=this.layer.distanceToVector3(0,0).x,c=this.layer.coordinateToVector3(i.getCenter(),h);return u.forEach((function(t){l.push(t.x,t.y,t.z)})),{positions:l,pos:c}}}])}(),Oj=function(){return rn((function t(e,n,r,i){tn(this,t),this.initValue=e,this.stepVlaue=n,this.limitValue=r,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=Ze(pn().mark((function t(e,n){var r;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,r=this.initValue+this.totalValue,r=this.stepVlaue<0?r<this.limitValue?this.limitValue:r:r>this.limitValue?this.limitValue:r,t.next=7,n(r);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),Nj=function(){return rn((function t(e,n,r){tn(this,t),this.threeLayer=e.threeLayer,this.layerClass=n,this.map=r,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var n=this.vector.clone();n.project(this.camera),n.x=Math.round((this.rateX+n.x/2)*(this.canvas.width/window.devicePixelRatio)),n.y=Math.round((this.rateY-n.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(n.y,"px"),this._container.style.left="".concat(n.x,"px")}}},{key:"setContent",value:function(e){if(!this._container){var n=this._container=t.DomUtil.createEl("div",t.Util.GUID());n.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(n),n.style.display="none"}this._container.innerHTML=e}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();export{AQ as Arrow3D,EP as B3DMLoader,Sk as B3DMLoaderBase,Fn as BaseObject,FP as CMPTLoader,NP as CMPTLoaderBase,VD as CUSTOM_COLOR,eN as CesiumIonTilesRenderer,Cj as CoordinateTransform,UD as DEPTH,FD as DISTANCE,nN as DebugCesiumIonTilesRenderer,$O as DebugGoogleTilesRenderer,WD as DebugTilesRenderer,YQ as EffectComposer,wL as Ellipsoid,LL as EllipsoidRegion,BD as EllipsoidRegionHelper,MD as EllipsoidRegionLineHelper,TN as EnvironmentControls,ik as FAILED,ND as GEOMETRIC_ERROR,UP as GLTFCesiumRTCExtension,QP as GLTFExtensionLoader,qO as GLTFMeshFeaturesExtension,NO as GLTFStructuralMetadataExtension,lL as GeoUtils,YN as GlobeControls,ZO as GoogleTilesRenderer,OP as I3DMLoader,MP as I3DMLoaderBase,GD as IS_LEAF,rk as LOADED,ek as LOADING,qD as LOAD_ORDER,ZT as LRUCache,sQ as Line2,oQ as LineGeometry,OU as LineMaterial,Ik as LoaderBase,DD as NONE,nk as PARSING,SP as PNTSLoader,IP as PNTSLoaderBase,$T as PriorityQueue,zD as RANDOM_COLOR,jD as RANDOM_NODE_COLOR,QD as RELATIVE_DEPTH,TG as RenderPass,OD as SCREEN_ERROR,Nj as SimpleInfoWindow,xD as SphereHelper,CT as TextureAnimator,_u as ThreeLayer,wu as ThreeRenderer,mD as TilesRenderer,_k as TilesRendererBase,tk as UNLOADED,HO as WGS84_ELLIPSOID,sk as WGS84_FLATTENING,ak as WGS84_HEIGHT,ok as WGS84_RADIUS,zG as bloomClass,OQ as bloomLine,eT as calIntersection,aT as calPointColor,Rj as clusterClass,Ij as drawTool,PQ as extrudePolygon,jB as getCenterOfPoints,KB as getCirGeojson,ZB as getCirGeojson1,JB as getPsByCircle,UB as getUUid,tT as getVPointGeojson,PT as gisCommon,MF as gltfLoadClass,BF as groupClass,pT as imgClass,bj as layerClass,Ej as layerClassNoOverride,vQ as line2Object,sT as line2Polygon,oT as line2Polygon1,YB as lineLength,Dj as lineUtilClass,Oj as opcityClass,jG as outlineBloomClass,Sj as overLayer,fQ as planeGifClass,WG as planeHeightClass,YT as planeMark,ST as planeSectorClass,BQ as polygonClass,NU as polylineClass,vj as pyramidClass,yT as radarClass,kU as rippleWallClass,bT as sectorClass,TT as shockClass,Lj as shockMarkerClass,QB as sleep,IF as tileClass,_Q as tripHeight,xQ as tripHeight1,wQ as tripLineClass,gQ as tubeClass,LB as turf,lQ as verticalFatLineClass,PU as wallClass};
@@ -191,4 +191,4 @@ function(){return"undefined"==typeof window&&(self.window=self),function(t){var
191
191
  * maptalks.animatemarker v0.4.1
192
192
  * LICENSE : MIT
193
193
  * (c) 2016-2017 maptalks.org
194
- */function mQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AQ(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var xQ={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},bQ=function(t){function n(){return mQ(this,n),AQ(this,t.apply(this,arguments))}return _Q(n,t),n.prototype.addGeometry=function(n){return n instanceof e.Geometry&&(n=[n]),n.forEach((function(t,n){if(!(t instanceof e.Marker))throw new Error("The geometry at "+n+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},n.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var r=new n(t.id,t.options),i=t.geometries,o=[],s=0;s<i.length;s++){var a=e.Geometry.fromJSON(i[s]);a&&o.push(a)}return r.addGeometry(o),t.style&&r.setStyle(t.style),r},n}(e.VectorLayer);bQ.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),bQ.registerJSONType("AnimateMarkerLayer"),bQ.registerRenderer("canvas",function(t){function n(){return mQ(this,n),AQ(this,t.apply(this,arguments))}return _Q(n,t),n.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},n.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},n.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},n.prototype.onCanvasCreate=function(){this._prepare()},n.prototype.onGeometryAdd=function(){this._redraw()},n.prototype.onGeometryRemove=function(){this._redraw()},n.prototype.onGeometrySymbolChange=function(){this._redraw()},n.prototype.onGeometryPositionChange=function(){this._redraw()},n.prototype.onGeometryShow=function(){this._redraw()},n.prototype.onGeometryHide=function(){this._redraw()},n.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},n.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},n.prototype._drawAllMarkers=function(t){var e=this,n=this.getMap(),r=n.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=n._prjToContainerPoint(t.coordinates);r.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=n._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},n.prototype._drawMarker=function(t,e,n,r){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(r-t.start)%i/i,u=n.fade&&a>=.5?2-2*a:1,l=n.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},n.prototype._prepare=function(){var t=this,e=[],n={},r=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?xQ:i._getInternalSymbol(),s=JSON.stringify(o);n[s]||(n[s]=o),e.push({coordinates:r.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(n),this._currentMarkers=e},n.prototype._prepareSprites=function(t){for(var n in this._spriteCache={},t){var r=t[n],i=new e.Marker([0,0],{symbol:r})._getSprite(this.resources);this._spriteCache[n]=i}},n.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},n.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},n=this.layer.options.animation?this.layer.options.animation.split(","):[],r=0;r<n.length;r++){var i=(t=n[r]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},n}(e.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var wQ=function(){return p((function t(e,n,r){h(this,t),this.map=r;var o=n.color||[255,0,0],s=n.opacity||.8,a=n.width||20,u=n.height||20,l=n.animationDuration||3e3,c=n.markerDx||0,f=n.markerDy||0,p=i.GeoJSON.toGeometry(e);this.layer=new bQ(i.Util.GUID(),p,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:c,markerDy:f}}]).addTo(r)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),EQ=function(){return p((function t(e,n,r,s,a){h(this,t),this.lnglats=e,this.debug=(null==a?void 0:a.debug)||!1,this.stepRadianFac=(null==a?void 0:a.stepRadianFac)||10,this.limitUpdateFac=(null==a?void 0:a.limitUpdateFac)||2.5,this.repeatFlag=(null==a?void 0:a.repeatFlag)||!1,this.finishCallBack=null==a?void 0:a.finishCallBack,this.tarlnglats=n.map((function(t){return t})),this.layer=r,this.map=r.map,1==s&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var u=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=r.coordinateToVector3([u[0],u[1]]),this.translation=(new o.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var l=new o.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),c=0;c<e.length-1;c++){var f=e[c],p=this.tarlnglats[c],d=r.coordinateToVector3([f[0],f[1]]).sub(this.centerVector).normalize(),g=l.angleTo(d),y=l.x*d.y-l.y*d.x;y>0&&(g=2*Math.PI-g),this.debug&&console.log(g,g*(180/Math.PI),"子线角度");var v=r.coordinateToVector3([p[0],p[1]]).sub(this.centerVector).normalize(),m=d.angleTo(v),A=d.x*v.y-d.y*v.x;this.debug&&console.log(A,m*(180/Math.PI),"子线到聚类线角度");var _=new i.LineString([[f[0],f[1]],[u[0],u[1]]]).getLength(),x=r.distanceToVector3(_,_).x,b=-g;this.diffs.push(m),this.stepPara.push({stepRadian:Math.abs(m)/this.stepRadianFac,limitUpdate:Math.abs(m)/100*this.limitUpdateFac,startRadian:b,startDegree:b*(180/Math.PI),orientation:A,orientationSelf:y,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:x,coordinate:[0,0,f[2]||0],coord1:[f[0],f[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"tick",value:(t=u(b().mark((function t(e,n){var r,i,s,a,u,l,h,c;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=11;break}for(r=0;r<this.lnglats.length;r++)i=this.diffs[r],(s=this.stepPara[r])&&(Math.abs(i)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*e,s.totalRadian+=s.stepRadian*e):(s.stepTotalRadian+=-s.stepRadian*e,s.totalRadian+=-s.stepRadian*e),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new o.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=this.map.pointAtResToCoord(u,this.map.getGLRes()),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){t.next=11;break}if(this.count+=1,!n){t.next=11;break}return t.next=8,n();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){t.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){t.next=24;break}if(this.count+=1,!this.finishCallBack){t.next=18;break}return t.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){t.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!n){t.next=23;break}return t.next=23,n();case 23:this.count=0;case 24:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),IQ=function(){return p((function t(e,n,r){h(this,t),this.layer=r,this.map=r.map,this.pointsLen=n.pointsLen||20,this.pointsDts=e,this.monitPoint=n.monitPoint}),[{key:"getPoints1",value:function(){var t=[];this.pointsDts.forEach((function(e){t.push(e.coordinate)})),this.monitPoint&&t.push(this.monitPoint);var e=new i.LineString(t),n=e.getLength()/4,r=this.layer.distanceToVector3(n,n).x,s=t[0],a=t[1],u=[(s[0]+a[0])/2,(s[1]+a[1])/2],l=this.layer.coordinateToVector3(e.getCenter()),h=this.layer.coordinateToVector3(s).sub(l),c=this.layer.coordinateToVector3(a).sub(l),f=this.layer.coordinateToVector3(u,r).sub(l),p=new o.CatmullRomCurve3([h,f,c],!1,"catmullrom").getPoints(this.pointsLen),d=[],g=this.layer.distanceToVector3(0,0).x,y=this.layer.coordinateToVector3(e.getCenter(),g);return p.forEach((function(t){d.push(t.x,t.y,t.z)})),{positions:d,pos:y}}},{key:"getPoints",value:function(t){var e=this,n=[];this.pointsDts.forEach((function(t){n.push(t.coordinate)})),this.monitPoint&&n.push(this.monitPoint),t&&n.reverse();var r=new i.LineString(n),s=[],a=this.layer.coordinateToVector3(r.getCenter());n.forEach((function(t){var n=e.layer.coordinateToVector3(t).sub(a);if(t[2]){var r=e.layer.distanceToVector3(t[2],t[2]).x;n.z=r}s.push(n)}));var u=new o.CatmullRomCurve3(s,!1,"catmullrom").getPoints(this.pointsLen),l=[],h=this.layer.distanceToVector3(0,0).x,c=this.layer.coordinateToVector3(r.getCenter(),h);return u.forEach((function(t){l.push(t.x,t.y,t.z)})),{positions:l,pos:c}}}])}(),CQ=function(){return p((function t(e,n,r,i){h(this,t),this.initValue=e,this.stepVlaue=n,this.limitValue=r,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=u(b().mark((function t(e,n){var r;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,r=this.initValue+this.totalValue,r=this.stepVlaue<0?r<this.limitValue?this.limitValue:r:r>this.limitValue?this.limitValue:r,t.next=7,n(r);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),SQ=function(){return p((function t(e,n,r){h(this,t),this.threeLayer=e.threeLayer,this.layerClass=n,this.map=r,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var n=this.vector.clone();n.project(this.camera),n.x=Math.round((this.rateX+n.x/2)*(this.canvas.width/window.devicePixelRatio)),n.y=Math.round((this.rateY-n.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(n.y,"px"),this._container.style.left="".concat(n.x,"px")}}},{key:"setContent",value:function(t){if(!this._container){var e=this._container=i.DomUtil.createEl("div",i.Util.GUID());e.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(e),e.style.display="none"}this._container.innerHTML=t}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();t.Arrow3D=lN,t.B3DMLoader=EB,t.B3DMLoaderBase=SM,t.BaseObject=W,t.CMPTLoader=FB,t.CMPTLoaderBase=NB,t.CUSTOM_COLOR=9,t.CesiumIonTilesRenderer=qL,t.CoordinateTransform=yQ,t.DEPTH=4,t.DISTANCE=3,t.DebugCesiumIonTilesRenderer=HL,t.DebugGoogleTilesRenderer=jL,t.DebugTilesRenderer=OP,t.EffectComposer=FN,t.Ellipsoid=bT,t.EllipsoidRegion=LT,t.EllipsoidRegionHelper=BP,t.EllipsoidRegionLineHelper=MP,t.EnvironmentControls=_R,t.FAILED=4,t.GEOMETRIC_ERROR=2,t.GLTFCesiumRTCExtension=UB,t.GLTFExtensionLoader=QB,t.GLTFMeshFeaturesExtension=DL,t.GLTFStructuralMetadataExtension=SL,t.GeoUtils=lT,t.GlobeControls=FR,t.GoogleTilesRenderer=zL,t.I3DMLoader=OB,t.I3DMLoaderBase=MB,t.IS_LEAF=6,t.LOADED=3,t.LOADING=1,t.LOAD_ORDER=10,t.LRUCache=rM,t.Line2=JO,t.LineGeometry=XO,t.LineMaterial=CO,t.LoaderBase=IM,t.NONE=0,t.PARSING=2,t.PNTSLoader=SB,t.PNTSLoaderBase=IB,t.PriorityQueue=iM,t.RANDOM_COLOR=7,t.RANDOM_NODE_COLOR=8,t.RELATIVE_DEPTH=5,t.RenderPass=_F,t.SCREEN_ERROR=1,t.SimpleInfoWindow=SQ,t.SphereHelper=xP,t.TextureAnimator=kS,t.ThreeLayer=To,t.ThreeRenderer=Po,t.TilesRenderer=mP,t.TilesRendererBase=_M,t.UNLOADED=0,t.WGS84_ELLIPSOID=OL,t.WGS84_FLATTENING=sM,t.WGS84_HEIGHT=aM,t.WGS84_RADIUS=oM,t.bloomClass=PF,t.bloomLine=CN,t.calIntersection=uS,t.calPointColor=fS,t.clusterClass=EQ,t.drawTool=gQ,t.extrudePolygon=bN,t.getCenterOfPoints=$C,t.getCirGeojson=function(t,e,n,r,i){for(var s=i.map,a=i.coordinateToVector3([t,e],0),u=(new o.Matrix4).makeTranslation(a.x,a.y,0),l=i.distanceToVector3(n,n).x,h=[],c=0;c<=360;c++){var f=new o.Vector3(Math.sin(c*(Math.PI/180))*l,Math.cos(c*(Math.PI/180))*l,0);f=f.applyMatrix4(u);var p=s.pointAtResToCoord(f,s.getGLRes());h.push([p.x,p.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:r.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[h]]}}]}},t.getCirGeojson1=function(t,e,n,r,i){for(var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=i.map,u=i.coordinateToVector3([t,e],0),l=(new o.Matrix4).makeTranslation(u.x,u.y,0),h=i.distanceToVector3(n,n).x,c=[],f=0;f<=360;f+=s){var p=new o.Vector3(Math.sin(f*(Math.PI/180))*h,Math.cos(f*(Math.PI/180))*h,0);p=p.applyMatrix4(l);var d=a.pointAtResToCoord(p,a.getGLRes());c.push([d.x,d.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:r.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[c]]}}]}},t.getPsByCircle=function(t,e,n,r,i){for(var s,a,u=[],l=i.map,h=i.coordinateToVector3([t,e],0),c=(new o.Matrix4).makeTranslation(h.x,h.y,0),f=i.distanceToVector3(n,n).x,p=0;p<=360;){var d=(a=void 0,a=0,(s=p)<=90?a=-s:s>90&&s<=180||s>180&&s<=270?a=180-s:s>270&&s<360&&(a=360-s),{rotation:a}),g=oS(p,f,c),y=l.pointAtResToCoord(g,l.getGLRes());u.push({coord:[y.x,y.y],rotation:d.rotation}),p+=r}return u},t.getUUid=XC,t.getVPointGeojson=aS,t.gisCommon=NS,t.gltfLoadClass=mD,t.groupClass=AD,t.imgClass=mS,t.layerClass=pQ,t.layerClassNoOverride=dQ,t.line2Object=aN,t.line2Polygon=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=[],s=[],a=0;a<t.length-1;a++){var u=[],l=a+1,h=aS(t[a][0],t[a][1],t[l][0],t[l][1],n,0,e);u.push(h.features[0].geometry.coordinates[0][0][0]),u.push(h.features[0].geometry.coordinates[0][0][1]);var c=aS(t[l][0],t[l][1],t[a][0],t[a][1],n,0,e);u.push(c.features[0].geometry.coordinates[0][0][0]),u.push(c.features[0].geometry.coordinates[0][0][1]),u.push(h.features[0].geometry.coordinates[0][0][0]);var f={type:"FeatureCollection",features:[{type:"Feature",properties:{_draw_type:"line"},geometry:{type:"MultiPolygon",coordinates:[[u]]}}]};o.push(u);var p=new i.MultiPolygon(f.features[0].geometry.coordinates);s.push(p)}var d=[];d.push(o[0][0]),d.push(o[0][1]);for(var g=0;g<o.length-1;g++){var y=s[g],v=s[g+1],m=o[g],A=o[g+1],_=uS(y,v);if(lS(_,0===g?m[2]:A[1])){var x=cS(_,m,A,t,r);d.push(x)}else d.push(m[2]),d.push(A[1])}d.push(o[o.length-1][2]),d.push(o[o.length-1][3]);for(var b=o.length-1;b>0;b--){var w=s[b],E=s[b-1],I=o[b],C=o[b-1],S=uS(w,E);if(lS(S,I[4])){var M=cS(S,I,C,t,r);d.push(M)}else d.push(I[4]),d.push(C[3])}return d.push(o[0][0]),d},t.line2Polygon1=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=[],i=0;i<t.length-1;i++){var o=[],s=i+1,a=aS(t[i][0],t[i][1],t[s][0],t[s][1],n,0,e);o.push(a.features[0].geometry.coordinates[0][0][0]),o.push(a.features[0].geometry.coordinates[0][0][1]);var u=aS(t[s][0],t[s][1],t[i][0],t[i][1],n,0,e);o.push(u.features[0].geometry.coordinates[0][0][0]),o.push(u.features[0].geometry.coordinates[0][0][1]),o.push(a.features[0].geometry.coordinates[0][0][0]),r.push(o)}return r},t.lineLength=iS,t.lineUtilClass=IQ,t.opcityClass=CQ,t.outlineBloomClass=LF,t.overLayer=vQ,t.planeGifClass=nN,t.planeHeightClass=NF,t.planeMark=$S,t.planeSectorClass=PS,t.polygonClass=AN,t.polylineClass=SO,t.pyramidClass=aQ,t.radarClass=xS,t.rippleWallClass=xO,t.sectorClass=MS,t.shockClass=DS,t.shockMarkerClass=wQ,t.sleep=JC,t.tileClass=gD,t.tripHeight=hN,t.tripHeight1=cN,t.tripLineClass=fN,t.tubeClass=oN,t.turf=jC,t.verticalFatLineClass=$O,t.wallClass=bO}));
194
+ */function mQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AQ(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var xQ={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},bQ=function(t){function n(){return mQ(this,n),AQ(this,t.apply(this,arguments))}return _Q(n,t),n.prototype.addGeometry=function(n){return n instanceof e.Geometry&&(n=[n]),n.forEach((function(t,n){if(!(t instanceof e.Marker))throw new Error("The geometry at "+n+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},n.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var r=new n(t.id,t.options),i=t.geometries,o=[],s=0;s<i.length;s++){var a=e.Geometry.fromJSON(i[s]);a&&o.push(a)}return r.addGeometry(o),t.style&&r.setStyle(t.style),r},n}(e.VectorLayer);bQ.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),bQ.registerJSONType("AnimateMarkerLayer"),bQ.registerRenderer("canvas",function(t){function n(){return mQ(this,n),AQ(this,t.apply(this,arguments))}return _Q(n,t),n.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},n.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},n.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},n.prototype.onCanvasCreate=function(){this._prepare()},n.prototype.onGeometryAdd=function(){this._redraw()},n.prototype.onGeometryRemove=function(){this._redraw()},n.prototype.onGeometrySymbolChange=function(){this._redraw()},n.prototype.onGeometryPositionChange=function(){this._redraw()},n.prototype.onGeometryShow=function(){this._redraw()},n.prototype.onGeometryHide=function(){this._redraw()},n.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},n.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},n.prototype._drawAllMarkers=function(t){var e=this,n=this.getMap(),r=n.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=n._prjToContainerPoint(t.coordinates);r.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=n._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},n.prototype._drawMarker=function(t,e,n,r){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(r-t.start)%i/i,u=n.fade&&a>=.5?2-2*a:1,l=n.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},n.prototype._prepare=function(){var t=this,e=[],n={},r=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?xQ:i._getInternalSymbol(),s=JSON.stringify(o);n[s]||(n[s]=o),e.push({coordinates:r.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(n),this._currentMarkers=e},n.prototype._prepareSprites=function(t){for(var n in this._spriteCache={},t){var r=t[n],i=new e.Marker([0,0],{symbol:r})._getSprite(this.resources);this._spriteCache[n]=i}},n.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},n.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},n=this.layer.options.animation?this.layer.options.animation.split(","):[],r=0;r<n.length;r++){var i=(t=n[r]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},n}(e.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var wQ=function(){return p((function t(e,n,r){h(this,t),this.map=r;var o=n.color||[255,0,0],s=n.opacity||.8,a=n.width||20,u=n.height||20,l=n.animationDuration||3e3,c=n.markerDx||0,f=n.markerDy||0,p=i.GeoJSON.toGeometry(e);this.layer=new bQ(i.Util.GUID(),p,{animation:"scale,fade",animationDuration:l,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(o),markerFillOpacity:s,markerWidth:a,markerHeight:u,markerDx:c,markerDy:f}}]).addTo(r)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),EQ=function(){return p((function t(e,n,r,s,a){h(this,t),this.lnglats=e,this.debug=(null==a?void 0:a.debug)||!1,this.stepRadianFac=(null==a?void 0:a.stepRadianFac)||10,this.limitUpdateFac=(null==a?void 0:a.limitUpdateFac)||2.5,this.repeatFlag=(null==a?void 0:a.repeatFlag)||!1,this.finishCallBack=null==a?void 0:a.finishCallBack,this.tarlnglats=n.map((function(t){return t})),this.layer=r,this.map=r.map,1==s&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var u=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=r.coordinateToVector3([u[0],u[1]]),this.translation=(new o.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var l=new o.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),c=0;c<e.length-1;c++){var f=e[c],p=this.tarlnglats[c],d=r.coordinateToVector3([f[0],f[1]]).sub(this.centerVector).normalize(),g=l.angleTo(d),y=l.x*d.y-l.y*d.x;y>0&&(g=2*Math.PI-g),this.debug&&console.log(g,g*(180/Math.PI),"子线角度");var v=r.coordinateToVector3([p[0],p[1]]).sub(this.centerVector).normalize(),m=d.angleTo(v),A=d.x*v.y-d.y*v.x;this.debug&&console.log(A,m*(180/Math.PI),"子线到聚类线角度");var _=new i.LineString([[f[0],f[1]],[u[0],u[1]]]).getLength(),x=r.distanceToVector3(_,_).x,b=-g;this.diffs.push(m),this.stepPara.push({stepRadian:Math.abs(m)/this.stepRadianFac,limitUpdate:Math.abs(m)/100*this.limitUpdateFac,startRadian:b,startDegree:b*(180/Math.PI),orientation:A,orientationSelf:y,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:x,coordinate:[0,0,f[2]||0],coord1:[f[0],f[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"getGLRes",value:function(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}},{key:"tick",value:(t=u(b().mark((function t(e,n){var r,i,s,a,u,l,h,c;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=11;break}for(r=0;r<this.lnglats.length;r++)i=this.diffs[r],(s=this.stepPara[r])&&(Math.abs(i)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*e,s.totalRadian+=s.stepRadian*e):(s.stepTotalRadian+=-s.stepRadian*e,s.totalRadian+=-s.stepRadian*e),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new o.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=void 0,l=this.map.pointAtResToCoord?this.map.pointAtResToCoord(u,this.getGLRes(this.map)):this.map.pointToCoordinate(u,this.getGLRes(this.map)),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){t.next=11;break}if(this.count+=1,!n){t.next=11;break}return t.next=8,n();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){t.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){t.next=24;break}if(this.count+=1,!this.finishCallBack){t.next=18;break}return t.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){t.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!n){t.next=23;break}return t.next=23,n();case 23:this.count=0;case 24:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),IQ=function(){return p((function t(e,n,r){h(this,t),this.layer=r,this.map=r.map,this.pointsLen=n.pointsLen||20,this.pointsDts=e,this.monitPoint=n.monitPoint}),[{key:"getPoints1",value:function(){var t=[];this.pointsDts.forEach((function(e){t.push(e.coordinate)})),this.monitPoint&&t.push(this.monitPoint);var e=new i.LineString(t),n=e.getLength()/4,r=this.layer.distanceToVector3(n,n).x,s=t[0],a=t[1],u=[(s[0]+a[0])/2,(s[1]+a[1])/2],l=this.layer.coordinateToVector3(e.getCenter()),h=this.layer.coordinateToVector3(s).sub(l),c=this.layer.coordinateToVector3(a).sub(l),f=this.layer.coordinateToVector3(u,r).sub(l),p=new o.CatmullRomCurve3([h,f,c],!1,"catmullrom").getPoints(this.pointsLen),d=[],g=this.layer.distanceToVector3(0,0).x,y=this.layer.coordinateToVector3(e.getCenter(),g);return p.forEach((function(t){d.push(t.x,t.y,t.z)})),{positions:d,pos:y}}},{key:"getPoints",value:function(t){var e=this,n=[];this.pointsDts.forEach((function(t){n.push(t.coordinate)})),this.monitPoint&&n.push(this.monitPoint),t&&n.reverse();var r=new i.LineString(n),s=[],a=this.layer.coordinateToVector3(r.getCenter());n.forEach((function(t){var n=e.layer.coordinateToVector3(t).sub(a);if(t[2]){var r=e.layer.distanceToVector3(t[2],t[2]).x;n.z=r}s.push(n)}));var u=new o.CatmullRomCurve3(s,!1,"catmullrom").getPoints(this.pointsLen),l=[],h=this.layer.distanceToVector3(0,0).x,c=this.layer.coordinateToVector3(r.getCenter(),h);return u.forEach((function(t){l.push(t.x,t.y,t.z)})),{positions:l,pos:c}}}])}(),CQ=function(){return p((function t(e,n,r,i){h(this,t),this.initValue=e,this.stepVlaue=n,this.limitValue=r,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=u(b().mark((function t(e,n){var r;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,r=this.initValue+this.totalValue,r=this.stepVlaue<0?r<this.limitValue?this.limitValue:r:r>this.limitValue?this.limitValue:r,t.next=7,n(r);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),SQ=function(){return p((function t(e,n,r){h(this,t),this.threeLayer=e.threeLayer,this.layerClass=n,this.map=r,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var n=this.vector.clone();n.project(this.camera),n.x=Math.round((this.rateX+n.x/2)*(this.canvas.width/window.devicePixelRatio)),n.y=Math.round((this.rateY-n.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(n.y,"px"),this._container.style.left="".concat(n.x,"px")}}},{key:"setContent",value:function(t){if(!this._container){var e=this._container=i.DomUtil.createEl("div",i.Util.GUID());e.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(e),e.style.display="none"}this._container.innerHTML=t}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();t.Arrow3D=lN,t.B3DMLoader=EB,t.B3DMLoaderBase=SM,t.BaseObject=W,t.CMPTLoader=FB,t.CMPTLoaderBase=NB,t.CUSTOM_COLOR=9,t.CesiumIonTilesRenderer=qL,t.CoordinateTransform=yQ,t.DEPTH=4,t.DISTANCE=3,t.DebugCesiumIonTilesRenderer=HL,t.DebugGoogleTilesRenderer=jL,t.DebugTilesRenderer=OP,t.EffectComposer=FN,t.Ellipsoid=bT,t.EllipsoidRegion=LT,t.EllipsoidRegionHelper=BP,t.EllipsoidRegionLineHelper=MP,t.EnvironmentControls=_R,t.FAILED=4,t.GEOMETRIC_ERROR=2,t.GLTFCesiumRTCExtension=UB,t.GLTFExtensionLoader=QB,t.GLTFMeshFeaturesExtension=DL,t.GLTFStructuralMetadataExtension=SL,t.GeoUtils=lT,t.GlobeControls=FR,t.GoogleTilesRenderer=zL,t.I3DMLoader=OB,t.I3DMLoaderBase=MB,t.IS_LEAF=6,t.LOADED=3,t.LOADING=1,t.LOAD_ORDER=10,t.LRUCache=rM,t.Line2=JO,t.LineGeometry=XO,t.LineMaterial=CO,t.LoaderBase=IM,t.NONE=0,t.PARSING=2,t.PNTSLoader=SB,t.PNTSLoaderBase=IB,t.PriorityQueue=iM,t.RANDOM_COLOR=7,t.RANDOM_NODE_COLOR=8,t.RELATIVE_DEPTH=5,t.RenderPass=_F,t.SCREEN_ERROR=1,t.SimpleInfoWindow=SQ,t.SphereHelper=xP,t.TextureAnimator=kS,t.ThreeLayer=To,t.ThreeRenderer=Po,t.TilesRenderer=mP,t.TilesRendererBase=_M,t.UNLOADED=0,t.WGS84_ELLIPSOID=OL,t.WGS84_FLATTENING=sM,t.WGS84_HEIGHT=aM,t.WGS84_RADIUS=oM,t.bloomClass=PF,t.bloomLine=CN,t.calIntersection=uS,t.calPointColor=fS,t.clusterClass=EQ,t.drawTool=gQ,t.extrudePolygon=bN,t.getCenterOfPoints=$C,t.getCirGeojson=function(t,e,n,r,i){for(var s=i.map,a=i.coordinateToVector3([t,e],0),u=(new o.Matrix4).makeTranslation(a.x,a.y,0),l=i.distanceToVector3(n,n).x,h=[],c=0;c<=360;c++){var f=new o.Vector3(Math.sin(c*(Math.PI/180))*l,Math.cos(c*(Math.PI/180))*l,0);f=f.applyMatrix4(u);var p=s.pointAtResToCoord(f,s.getGLRes());h.push([p.x,p.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:r.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[h]]}}]}},t.getCirGeojson1=function(t,e,n,r,i){for(var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=i.map,u=i.coordinateToVector3([t,e],0),l=(new o.Matrix4).makeTranslation(u.x,u.y,0),h=i.distanceToVector3(n,n).x,c=[],f=0;f<=360;f+=s){var p=new o.Vector3(Math.sin(f*(Math.PI/180))*h,Math.cos(f*(Math.PI/180))*h,0);p=p.applyMatrix4(l);var d=a.pointAtResToCoord(p,a.getGLRes());c.push([d.x,d.y])}return{type:"FeatureCollection",name:"net",crs:{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}},features:[{type:"Feature",properties:{Id:0,color:r.color||"#fff"},geometry:{type:"MultiPolygon",coordinates:[[c]]}}]}},t.getPsByCircle=function(t,e,n,r,i){for(var s,a,u=[],l=i.map,h=i.coordinateToVector3([t,e],0),c=(new o.Matrix4).makeTranslation(h.x,h.y,0),f=i.distanceToVector3(n,n).x,p=0;p<=360;){var d=(a=void 0,a=0,(s=p)<=90?a=-s:s>90&&s<=180||s>180&&s<=270?a=180-s:s>270&&s<360&&(a=360-s),{rotation:a}),g=oS(p,f,c),y=l.pointAtResToCoord(g,l.getGLRes());u.push({coord:[y.x,y.y],rotation:d.rotation}),p+=r}return u},t.getUUid=XC,t.getVPointGeojson=aS,t.gisCommon=NS,t.gltfLoadClass=mD,t.groupClass=AD,t.imgClass=mS,t.layerClass=pQ,t.layerClassNoOverride=dQ,t.line2Object=aN,t.line2Polygon=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=[],s=[],a=0;a<t.length-1;a++){var u=[],l=a+1,h=aS(t[a][0],t[a][1],t[l][0],t[l][1],n,0,e);u.push(h.features[0].geometry.coordinates[0][0][0]),u.push(h.features[0].geometry.coordinates[0][0][1]);var c=aS(t[l][0],t[l][1],t[a][0],t[a][1],n,0,e);u.push(c.features[0].geometry.coordinates[0][0][0]),u.push(c.features[0].geometry.coordinates[0][0][1]),u.push(h.features[0].geometry.coordinates[0][0][0]);var f={type:"FeatureCollection",features:[{type:"Feature",properties:{_draw_type:"line"},geometry:{type:"MultiPolygon",coordinates:[[u]]}}]};o.push(u);var p=new i.MultiPolygon(f.features[0].geometry.coordinates);s.push(p)}var d=[];d.push(o[0][0]),d.push(o[0][1]);for(var g=0;g<o.length-1;g++){var y=s[g],v=s[g+1],m=o[g],A=o[g+1],_=uS(y,v);if(lS(_,0===g?m[2]:A[1])){var x=cS(_,m,A,t,r);d.push(x)}else d.push(m[2]),d.push(A[1])}d.push(o[o.length-1][2]),d.push(o[o.length-1][3]);for(var b=o.length-1;b>0;b--){var w=s[b],E=s[b-1],I=o[b],C=o[b-1],S=uS(w,E);if(lS(S,I[4])){var M=cS(S,I,C,t,r);d.push(M)}else d.push(I[4]),d.push(C[3])}return d.push(o[0][0]),d},t.line2Polygon1=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=[],i=0;i<t.length-1;i++){var o=[],s=i+1,a=aS(t[i][0],t[i][1],t[s][0],t[s][1],n,0,e);o.push(a.features[0].geometry.coordinates[0][0][0]),o.push(a.features[0].geometry.coordinates[0][0][1]);var u=aS(t[s][0],t[s][1],t[i][0],t[i][1],n,0,e);o.push(u.features[0].geometry.coordinates[0][0][0]),o.push(u.features[0].geometry.coordinates[0][0][1]),o.push(a.features[0].geometry.coordinates[0][0][0]),r.push(o)}return r},t.lineLength=iS,t.lineUtilClass=IQ,t.opcityClass=CQ,t.outlineBloomClass=LF,t.overLayer=vQ,t.planeGifClass=nN,t.planeHeightClass=NF,t.planeMark=$S,t.planeSectorClass=PS,t.polygonClass=AN,t.polylineClass=SO,t.pyramidClass=aQ,t.radarClass=xS,t.rippleWallClass=xO,t.sectorClass=MS,t.shockClass=DS,t.shockMarkerClass=wQ,t.sleep=JC,t.tileClass=gD,t.tripHeight=hN,t.tripHeight1=cN,t.tripLineClass=fN,t.tubeClass=oN,t.turf=jC,t.verticalFatLineClass=$O,t.wallClass=bO}));
@@ -195,4 +195,4 @@ Original MIT license applies
195
195
  */
196
196
  /*!
197
197
  * requires maptalks@>=0.25.0
198
- */function fO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pO(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function dO(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var gO={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},yO=function(t){function e(){return fO(this,e),pO(this,t.apply(this,arguments))}return dO(e,t),e.prototype.addGeometry=function(e){return e instanceof maptalks.Geometry&&(e=[e]),e.forEach((function(t,e){if(!(t instanceof maptalks.Marker))throw new Error("The geometry at "+e+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},e.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var n=new e(t.id,t.options),r=t.geometries,i=[],o=0;o<r.length;o++){var s=maptalks.Geometry.fromJSON(r[o]);s&&i.push(s)}return n.addGeometry(i),t.style&&n.setStyle(t.style),n},e}(maptalks.VectorLayer);yO.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),yO.registerJSONType("AnimateMarkerLayer"),yO.registerRenderer("canvas",function(t){function e(){return fO(this,e),pO(this,t.apply(this,arguments))}return dO(e,t),e.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},e.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},e.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},e.prototype.onCanvasCreate=function(){this._prepare()},e.prototype.onGeometryAdd=function(){this._redraw()},e.prototype.onGeometryRemove=function(){this._redraw()},e.prototype.onGeometrySymbolChange=function(){this._redraw()},e.prototype.onGeometryPositionChange=function(){this._redraw()},e.prototype.onGeometryShow=function(){this._redraw()},e.prototype.onGeometryHide=function(){this._redraw()},e.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},e.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},e.prototype._drawAllMarkers=function(t){var e=this,n=this.getMap(),r=n.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=n._prjToContainerPoint(t.coordinates);r.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=n._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},e.prototype._drawMarker=function(t,e,n,r){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(r-t.start)%i/i,u=n.fade&&a>=.5?2-2*a:1,l=n.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},e.prototype._prepare=function(){var t=this,e=[],n={},r=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?gO:i._getInternalSymbol(),s=JSON.stringify(o);n[s]||(n[s]=o),e.push({coordinates:r.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(n),this._currentMarkers=e},e.prototype._prepareSprites=function(t){for(var e in this._spriteCache={},t){var n=t[e],r=new maptalks.Marker([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[e]=r}},e.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},e.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},n=this.layer.options.animation?this.layer.options.animation.split(","):[],r=0;r<n.length;r++){var i=(t=n[r]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},e}(maptalks.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var vO=function(){return Ze((function t(e,n,r){Xe(this,t),this.map=r;var i=n.color||[255,0,0],o=n.opacity||.8,s=n.width||20,a=n.height||20,u=n.animationDuration||3e3,l=n.markerDx||0,h=n.markerDy||0,c=maptalks.GeoJSON.toGeometry(e);this.layer=new yO(maptalks.Util.GUID(),c,{animation:"scale,fade",animationDuration:u,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(i),markerFillOpacity:o,markerWidth:s,markerHeight:a,markerDx:l,markerDy:h}}]).addTo(r)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),mO=function(){return Ze((function e(n,r,i,o,s){Xe(this,e),this.lnglats=n,this.debug=(null==s?void 0:s.debug)||!1,this.stepRadianFac=(null==s?void 0:s.stepRadianFac)||10,this.limitUpdateFac=(null==s?void 0:s.limitUpdateFac)||2.5,this.repeatFlag=(null==s?void 0:s.repeatFlag)||!1,this.finishCallBack=null==s?void 0:s.finishCallBack,this.tarlnglats=r.map((function(t){return t})),this.layer=i,this.map=i.map,1==o&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var a=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=i.coordinateToVector3([a[0],a[1]]),this.translation=(new t.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var u=new t.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),l=0;l<n.length-1;l++){var h=n[l],c=this.tarlnglats[l],f=i.coordinateToVector3([h[0],h[1]]).sub(this.centerVector).normalize(),p=u.angleTo(f),d=u.x*f.y-u.y*f.x;d>0&&(p=2*Math.PI-p),this.debug&&console.log(p,p*(180/Math.PI),"子线角度");var g=i.coordinateToVector3([c[0],c[1]]).sub(this.centerVector).normalize(),y=f.angleTo(g),v=f.x*g.y-f.y*g.x;this.debug&&console.log(v,y*(180/Math.PI),"子线到聚类线角度");var m=new maptalks.LineString([[h[0],h[1]],[a[0],a[1]]]).getLength(),A=i.distanceToVector3(m,m).x,_=-p;this.diffs.push(y),this.stepPara.push({stepRadian:Math.abs(y)/this.stepRadianFac,limitUpdate:Math.abs(y)/100*this.limitUpdateFac,startRadian:_,startDegree:_*(180/Math.PI),orientation:v,orientationSelf:d,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:A,coordinate:[0,0,h[2]||0],coord1:[h[0],h[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"tick",value:(e=We(un().mark((function e(n,r){var i,o,s,a,u,l,h,c;return un().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.count<1)){e.next=11;break}for(i=0;i<this.lnglats.length;i++)o=this.diffs[i],(s=this.stepPara[i])&&(Math.abs(o)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*n,s.totalRadian+=s.stepRadian*n):(s.stepTotalRadian+=-s.stepRadian*n,s.totalRadian+=-s.stepRadian*n),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new t.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=this.map.pointAtResToCoord(u,this.map.getGLRes()),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){e.next=11;break}if(this.count+=1,!r){e.next=11;break}return e.next=8,r();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){e.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){e.next=24;break}if(this.count+=1,!this.finishCallBack){e.next=18;break}return e.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){e.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!r){e.next=23;break}return e.next=23,r();case 23:this.count=0;case 24:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e}(),AO=function(){return Ze((function t(e,n,r){Xe(this,t),this.layer=r,this.map=r.map,this.pointsLen=n.pointsLen||20,this.pointsDts=e,this.monitPoint=n.monitPoint}),[{key:"getPoints1",value:function(){var e=[];this.pointsDts.forEach((function(t){e.push(t.coordinate)})),this.monitPoint&&e.push(this.monitPoint);var n=new maptalks.LineString(e),r=n.getLength()/4,i=this.layer.distanceToVector3(r,r).x,o=e[0],s=e[1],a=[(o[0]+s[0])/2,(o[1]+s[1])/2],u=this.layer.coordinateToVector3(n.getCenter()),l=this.layer.coordinateToVector3(o).sub(u),h=this.layer.coordinateToVector3(s).sub(u),c=this.layer.coordinateToVector3(a,i).sub(u),f=new t.CatmullRomCurve3([l,c,h],!1,"catmullrom").getPoints(this.pointsLen),p=[],d=this.layer.distanceToVector3(0,0).x,g=this.layer.coordinateToVector3(n.getCenter(),d);return f.forEach((function(t){p.push(t.x,t.y,t.z)})),{positions:p,pos:g}}},{key:"getPoints",value:function(e){var n=this,r=[];this.pointsDts.forEach((function(t){r.push(t.coordinate)})),this.monitPoint&&r.push(this.monitPoint),e&&r.reverse();var i=new maptalks.LineString(r),o=[],s=this.layer.coordinateToVector3(i.getCenter());r.forEach((function(t){var e=n.layer.coordinateToVector3(t).sub(s);if(t[2]){var r=n.layer.distanceToVector3(t[2],t[2]).x;e.z=r}o.push(e)}));var a=new t.CatmullRomCurve3(o,!1,"catmullrom").getPoints(this.pointsLen),u=[],l=this.layer.distanceToVector3(0,0).x,h=this.layer.coordinateToVector3(i.getCenter(),l);return a.forEach((function(t){u.push(t.x,t.y,t.z)})),{positions:u,pos:h}}}])}(),_O=function(){return Ze((function t(e,n,r,i){Xe(this,t),this.initValue=e,this.stepVlaue=n,this.limitValue=r,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=We(un().mark((function t(e,n){var r;return un().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,r=this.initValue+this.totalValue,r=this.stepVlaue<0?r<this.limitValue?this.limitValue:r:r>this.limitValue?this.limitValue:r,t.next=7,n(r);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),xO=function(){return Ze((function t(e,n,r){Xe(this,t),this.threeLayer=e.threeLayer,this.layerClass=n,this.map=r,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var n=this.vector.clone();n.project(this.camera),n.x=Math.round((this.rateX+n.x/2)*(this.canvas.width/window.devicePixelRatio)),n.y=Math.round((this.rateY-n.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(n.y,"px"),this._container.style.left="".concat(n.x,"px")}}},{key:"setContent",value:function(t){if(!this._container){var e=this._container=maptalks.DomUtil.createEl("div",maptalks.Util.GUID());e.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(e),e.style.display="none"}this._container.innerHTML=t}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();export{rL as Arrow3D,aI as B3DMLoader,hE as B3DMLoaderBase,Ln as BaseObject,xI as CMPTLoader,_I as CMPTLoaderBase,MM as CUSTOM_COLOR,UB as CesiumIonTilesRenderer,hO as CoordinateTransform,bM as DEPTH,wM as DISTANCE,QB as DebugCesiumIonTilesRenderer,NB as DebugGoogleTilesRenderer,kM as DebugTilesRenderer,PL as EffectComposer,oC as Ellipsoid,yC as EllipsoidRegion,pM as EllipsoidRegionHelper,fM as EllipsoidRegionLineHelper,dT as EnvironmentControls,Gb as FAILED,xM as GEOMETRIC_ERROR,wI as GLTFCesiumRTCExtension,bI as GLTFExtensionLoader,BB as GLTFMeshFeaturesExtension,xB as GLTFStructuralMetadataExtension,HI as GeoUtils,PT as GlobeControls,OB as GoogleTilesRenderer,AI as I3DMLoader,cI as I3DMLoaderBase,IM as IS_LEAF,Qb as LOADED,Fb as LOADING,BM as LOAD_ORDER,Db as LRUCache,VP as Line2,jP as LineGeometry,_P as LineMaterial,uE as LoaderBase,AM as NONE,Ub as PARSING,hI as PNTSLoader,uI as PNTSLoaderBase,Ob as PriorityQueue,CM as RANDOM_COLOR,SM as RANDOM_NODE_COLOR,EM as RELATIVE_DEPTH,dR as RenderPass,_M as SCREEN_ERROR,xO as SimpleInfoWindow,oM as SphereHelper,lb as TextureAnimator,gu as ThreeLayer,vu as ThreeRenderer,nM as TilesRenderer,rE as TilesRendererBase,Nb as UNLOADED,TB as WGS84_ELLIPSOID,jb as WGS84_FLATTENING,Vb as WGS84_HEIGHT,zb as WGS84_RADIUS,CR as bloomClass,_L as bloomLine,Fw as calIntersection,Vw as calPointColor,mO as clusterClass,lO as drawTool,yL as extrudePolygon,Cw as getCenterOfPoints,Rw as getCirGeojson,Dw as getCirGeojson1,Lw as getPsByCircle,ww as getUUid,Nw as getVPointGeojson,gb as gisCommon,fk as gltfLoadClass,pk as groupClass,Jw as imgClass,aO as layerClass,uO as layerClassNoOverride,eL as line2Object,jw as line2Polygon,zw as line2Polygon1,kw as lineLength,AO as lineUtilClass,_O as opcityClass,SR as outlineBloomClass,cO as overLayer,JP as planeGifClass,kR as planeHeightClass,kb as planeMark,hb as planeSectorClass,pL as polygonClass,xP as polylineClass,eO as pyramidClass,$w as radarClass,gP as rippleWallClass,sb as sectorClass,pb as shockClass,vO as shockMarkerClass,bw as sleep,lk as tileClass,iL as tripHeight,oL as tripHeight1,sL as tripLineClass,$P as tubeClass,yw as turf,WP as verticalFatLineClass,yP as wallClass};
198
+ */function fO(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pO(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function dO(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r],o=Object.getOwnPropertyDescriptor(e,i);o&&o.configurable&&void 0===t[i]&&Object.defineProperty(t,i,o)}}(t,e))}var gO={markerType:"ellipse",markerFill:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}([135,196,240]),markerFillOpacity:.8,markerLineWidth:0,markerWidth:16,markerHeight:16},yO=function(t){function e(){return fO(this,e),pO(this,t.apply(this,arguments))}return dO(e,t),e.prototype.addGeometry=function(e){return e instanceof maptalks.Geometry&&(e=[e]),e.forEach((function(t,e){if(!(t instanceof maptalks.Marker))throw new Error("The geometry at "+e+" to add is not a maptalks.Marker")})),t.prototype.addGeometry.apply(this,arguments)},e.fromJSON=function(t){if(!t||"AnimateMarkerLayer"!==t.type)return null;for(var n=new e(t.id,t.options),r=t.geometries,i=[],o=0;o<r.length;o++){var s=maptalks.Geometry.fromJSON(r[o]);s&&i.push(s)}return n.addGeometry(i),t.style&&n.setStyle(t.style),n},e}(maptalks.VectorLayer);yO.mergeOptions({animation:"scale,fade",randomAnimation:!0,animationDuration:3e3}),yO.registerJSONType("AnimateMarkerLayer"),yO.registerRenderer("canvas",function(t){function e(){return fO(this,e),pO(this,t.apply(this,arguments))}return dO(e,t),e.prototype.draw=function(){this._needUpdate&&(this._prepare(),this._needUpdate=!1),this.prepareCanvas();var t=this.getMap(),e=this._currentMarkers;this._drawnExtent&&t.getExtent().equals(this._drawnExtent)&&(e=this._drawnMarkers),this._drawAllMarkers(e),this._drawnExtent=t.getExtent(),this.layer.isLoaded()||this.completeRender()},e.prototype.drawOnInteracting=function(){this._drawnMarkers&&0!==this._drawnMarkers.length&&this._drawAllMarkers(this._drawnMarkers)},e.prototype.needToRedraw=function(){return!!this.layer.options.animation||t.prototype.needToRedraw.call(this)},e.prototype.onCanvasCreate=function(){this._prepare()},e.prototype.onGeometryAdd=function(){this._redraw()},e.prototype.onGeometryRemove=function(){this._redraw()},e.prototype.onGeometrySymbolChange=function(){this._redraw()},e.prototype.onGeometryPositionChange=function(){this._redraw()},e.prototype.onGeometryShow=function(){this._redraw()},e.prototype.onGeometryHide=function(){this._redraw()},e.prototype.onGeometryPropertiesChange=function(t){if(t&&this.layer.getStyle())for(var e=0;e<t.length;e++)this.layer._styleGeometry(t[e])},e.prototype._redraw=function(){delete this._drawnMarkers,delete this._drawnExtent,this._needUpdate=!0},e.prototype._drawAllMarkers=function(t){var e=this,n=this.getMap(),r=n.getContainerExtent(),i=this._drawnTime=Date.now(),o=this._drawnAnim=this._getAnimation(),s=t!==this._drawnMarkers;s&&(this._drawnMarkers=[]),t.forEach((function(t){if(s){if(t.g.isVisible()){var a=n._prjToContainerPoint(t.coordinates);r.contains(a)&&(e._drawMarker(t,a,o,i),e._drawnMarkers.push(t))}}else{var u=n._prjToContainerPoint(t.coordinates);e._drawMarker(t,u,o,i)}}),this)},e.prototype._drawMarker=function(t,e,n,r){var i=this.layer.options.animationDuration,o=this.context,s=o.globalAlpha,a=(r-t.start)%i/i,u=n.fade&&a>=.5?2-2*a:1,l=n.scale?a:1,h=t.cacheKey,c=this._spriteCache[h],f=c.offset,p=c.canvas.width,d=c.canvas.height;c&&u>0&&(o.globalAlpha=s*u,o.drawImage(c.canvas,e.x+f.x-p*l/2,e.y+f.y-d*l/2,p*l,d*l),o.globalAlpha=s)},e.prototype._prepare=function(){var t=this,e=[],n={},r=this.getMap().getProjection();this.layer.forEach((function(i){t._currentGeo=i;var o=i._getInternalSymbol()===i.options.symbol?gO:i._getInternalSymbol(),s=JSON.stringify(o);n[s]||(n[s]=o),e.push({coordinates:r.project(i.getCoordinates()),cacheKey:s,start:t.layer.options.randomAnimation?Math.random()*t.layer.options.animationDuration:0,g:i})})),this._prepareSprites(n),this._currentMarkers=e},e.prototype._prepareSprites=function(t){for(var e in this._spriteCache={},t){var n=t[e],r=new maptalks.Marker([0,0],{symbol:n})._getSprite(this.resources);this._spriteCache[e]=r}},e.prototype.onRemove=function(){delete this._spriteCache,delete this._currentMarkers,delete this._drawnMarkers,delete this._drawnExtent},e.prototype._getAnimation=function(){for(var t,e={fade:!1,scale:!1},n=this.layer.options.animation?this.layer.options.animation.split(","):[],r=0;r<n.length;r++){var i=(t=n[r]).trim?t.trim():t.replace(/^\s+|\s+$/g,"");"fade"===i?e.fade=!0:"scale"===i&&(e.scale=!0)}return e},e}(maptalks.renderer.OverlayLayerCanvasRenderer)),"undefined"!=typeof console&&console.log("maptalks.animatemarker v0.4.1, requires maptalks@>=0.25.0.");var vO=function(){return Ze((function t(e,n,r){Xe(this,t),this.map=r;var i=n.color||[255,0,0],o=n.opacity||.8,s=n.width||20,a=n.height||20,u=n.animationDuration||3e3,l=n.markerDx||0,h=n.markerDy||0,c=maptalks.GeoJSON.toGeometry(e);this.layer=new yO(maptalks.Util.GUID(),c,{animation:"scale,fade",animationDuration:u,randomAnimation:!0,geometryEvents:!1,hitDetect:!1}).setStyle([{symbol:{markerType:"ellipse",markerLineWidth:0,markerFill:this.getGradient(i),markerFillOpacity:o,markerWidth:s,markerHeight:a,markerDx:l,markerDy:h}}]).addTo(r)}),[{key:"getGradient",value:function(t){return{type:"radial",colorStops:[[.7,"rgba("+t.join()+", 0.5)"],[.3,"rgba("+t.join()+", 1)"],[.2,"rgba("+t.join()+", 1)"],[0,"rgba("+t.join()+", 0)"]]}}},{key:"hide",value:function(){var t;null===(t=this.layer)||void 0===t||t.hide()}},{key:"show",value:function(){this.layer.show()}},{key:"setZIndex",value:function(t){this.layer.setZIndex(t)}},{key:"dispose",value:function(){this.map.removeLayer(this.layer),delete this.layer}}])}(),mO=function(){return Ze((function e(n,r,i,o,s){Xe(this,e),this.lnglats=n,this.debug=(null==s?void 0:s.debug)||!1,this.stepRadianFac=(null==s?void 0:s.stepRadianFac)||10,this.limitUpdateFac=(null==s?void 0:s.limitUpdateFac)||2.5,this.repeatFlag=(null==s?void 0:s.repeatFlag)||!1,this.finishCallBack=null==s?void 0:s.finishCallBack,this.tarlnglats=r.map((function(t){return t})),this.layer=i,this.map=i.map,1==o&&(this.lnglats.reverse(),this.tarlnglats.reverse()),this.diffs=[],this.stepPara=[];var a=this.tarlnglats[this.tarlnglats.length-1];this.centerVector=i.coordinateToVector3([a[0],a[1]]),this.translation=(new t.Matrix4).makeTranslation(this.centerVector.x,this.centerVector.y,0);for(var u=new t.Vector3(this.centerVector.x+200,this.centerVector.y,0).sub(this.centerVector).normalize(),l=0;l<n.length-1;l++){var h=n[l],c=this.tarlnglats[l],f=i.coordinateToVector3([h[0],h[1]]).sub(this.centerVector).normalize(),p=u.angleTo(f),d=u.x*f.y-u.y*f.x;d>0&&(p=2*Math.PI-p),this.debug&&console.log(p,p*(180/Math.PI),"子线角度");var g=i.coordinateToVector3([c[0],c[1]]).sub(this.centerVector).normalize(),y=f.angleTo(g),v=f.x*g.y-f.y*g.x;this.debug&&console.log(v,y*(180/Math.PI),"子线到聚类线角度");var m=new maptalks.LineString([[h[0],h[1]],[a[0],a[1]]]).getLength(),A=i.distanceToVector3(m,m).x,_=-p;this.diffs.push(y),this.stepPara.push({stepRadian:Math.abs(y)/this.stepRadianFac,limitUpdate:Math.abs(y)/100*this.limitUpdateFac,startRadian:_,startDegree:_*(180/Math.PI),orientation:v,orientationSelf:d,stepTotalRadian:0,totalRadian:0,breakFlag:!1,r:A,coordinate:[0,0,h[2]||0],coord1:[h[0],h[1]],updateFlag:!1,finishFlag:!1})}this.debug&&console.log(this.diffs,this.stepPara,"参数初始化"),this.count=0}),[{key:"getGLRes",value:function(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}},{key:"tick",value:(e=We(un().mark((function e(n,r){var i,o,s,a,u,l,h,c;return un().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(this.count<1)){e.next=11;break}for(i=0;i<this.lnglats.length;i++)o=this.diffs[i],(s=this.stepPara[i])&&(Math.abs(o)-Math.abs(s.totalRadian)>0?(s.orientation>0?(s.stepTotalRadian+=s.stepRadian*n,s.totalRadian+=s.stepRadian*n):(s.stepTotalRadian+=-s.stepRadian*n,s.totalRadian+=-s.stepRadian*n),Math.abs(s.stepTotalRadian)>s.limitUpdate&&(a=s.startRadian+s.totalRadian,s.stepTotalRadian=0,u=(u=new t.Vector3(Math.cos(a)*s.r,Math.sin(a)*s.r,0)).applyMatrix4(this.translation),l=void 0,l=this.map.pointAtResToCoord?this.map.pointAtResToCoord(u,this.getGLRes(this.map)):this.map.pointToCoordinate(u,this.getGLRes(this.map)),s.coordinate[0]=l.x,s.coordinate[1]=l.y,s.updateFlag=!0)):s.finishFlag=!0);if(0!==this.stepPara.filter((function(t){return 0==t.updateFlag})).length){e.next=11;break}if(this.count+=1,!r){e.next=11;break}return e.next=8,r();case 8:this.stepPara.forEach((function(t){t.updateFlag=!1})),this.stepPara.filter((function(t){return 0==t.finishFlag})).length>0&&(this.count=0);case 11:if(0!==this.count){e.next=24;break}if(0!==this.stepPara.filter((function(t){return 0==t.finishFlag})).length){e.next=24;break}if(this.count+=1,!this.finishCallBack){e.next=18;break}return e.next=18,this.finishCallBack();case 18:if(!this.repeatFlag){e.next=23;break}for(h=0;h<this.stepPara.length;h++)(c=this.stepPara[h]).coordinate[0]=c.coord1[0],c.coordinate[1]=c.coord1[1],c.stepTotalRadian=0,c.totalRadian=0,c.finishFlag=!1;if(!r){e.next=23;break}return e.next=23,r();case 23:this.count=0;case 24:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})}]);var e}(),AO=function(){return Ze((function t(e,n,r){Xe(this,t),this.layer=r,this.map=r.map,this.pointsLen=n.pointsLen||20,this.pointsDts=e,this.monitPoint=n.monitPoint}),[{key:"getPoints1",value:function(){var e=[];this.pointsDts.forEach((function(t){e.push(t.coordinate)})),this.monitPoint&&e.push(this.monitPoint);var n=new maptalks.LineString(e),r=n.getLength()/4,i=this.layer.distanceToVector3(r,r).x,o=e[0],s=e[1],a=[(o[0]+s[0])/2,(o[1]+s[1])/2],u=this.layer.coordinateToVector3(n.getCenter()),l=this.layer.coordinateToVector3(o).sub(u),h=this.layer.coordinateToVector3(s).sub(u),c=this.layer.coordinateToVector3(a,i).sub(u),f=new t.CatmullRomCurve3([l,c,h],!1,"catmullrom").getPoints(this.pointsLen),p=[],d=this.layer.distanceToVector3(0,0).x,g=this.layer.coordinateToVector3(n.getCenter(),d);return f.forEach((function(t){p.push(t.x,t.y,t.z)})),{positions:p,pos:g}}},{key:"getPoints",value:function(e){var n=this,r=[];this.pointsDts.forEach((function(t){r.push(t.coordinate)})),this.monitPoint&&r.push(this.monitPoint),e&&r.reverse();var i=new maptalks.LineString(r),o=[],s=this.layer.coordinateToVector3(i.getCenter());r.forEach((function(t){var e=n.layer.coordinateToVector3(t).sub(s);if(t[2]){var r=n.layer.distanceToVector3(t[2],t[2]).x;e.z=r}o.push(e)}));var a=new t.CatmullRomCurve3(o,!1,"catmullrom").getPoints(this.pointsLen),u=[],l=this.layer.distanceToVector3(0,0).x,h=this.layer.coordinateToVector3(i.getCenter(),l);return a.forEach((function(t){u.push(t.x,t.y,t.z)})),{positions:u,pos:h}}}])}(),_O=function(){return Ze((function t(e,n,r,i){Xe(this,t),this.initValue=e,this.stepVlaue=n,this.limitValue=r,this.totalValue=0,this.count=0}),[{key:"tick",value:(t=We(un().mark((function t(e,n){var r;return un().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.count<1)){t.next=8;break}return this.count+=1,this.totalValue+=this.stepVlaue*e,r=this.initValue+this.totalValue,r=this.stepVlaue<0?r<this.limitValue?this.limitValue:r:r>this.limitValue?this.limitValue:r,t.next=7,n(r);case 7:this.count=0;case 8:case"end":return t.stop()}}),t,this)}))),function(e,n){return t.apply(this,arguments)})}]);var t}(),xO=function(){return Ze((function t(e,n,r){Xe(this,t),this.threeLayer=e.threeLayer,this.layerClass=n,this.map=r,this.x=e.x,this.y=e.y,this.z=e.z,this.rateX=(null==e?void 0:e.rateX)||.5,this.rateY=(null==e?void 0:e.rateY)||.5;var i=this.threeLayer.distanceToVector3(this.z,this.z).x;this.vector=this.threeLayer.coordinateToVector3([this.x,this.y],i),this.camera=this.threeLayer.getCamera(),this.render=this.threeLayer.getRenderer().context,this.canvas=this.render.domElement,this.layerClass.updatables.push(this)}),[{key:"tick",value:function(t){var e;if("none"!==(null===(e=this._container)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.display)){var n=this.vector.clone();n.project(this.camera),n.x=Math.round((this.rateX+n.x/2)*(this.canvas.width/window.devicePixelRatio)),n.y=Math.round((this.rateY-n.y/2)*(this.canvas.height/window.devicePixelRatio)),this._container.style.top="".concat(n.y,"px"),this._container.style.left="".concat(n.x,"px")}}},{key:"setContent",value:function(t){if(!this._container){var e=this._container=maptalks.DomUtil.createEl("div",maptalks.Util.GUID());e.style.cssText="position:absolute;",this.map._panels.frontStatic.appendChild(e),e.style.display="none"}this._container.innerHTML=t}},{key:"changeRate",value:function(t,e){this.rateX=t,this.rateY=e}},{key:"show",value:function(){this._container.style.display=""}},{key:"hide",value:function(){this._container.style.display="none"}},{key:"removeAnimation",value:function(){var t=this.layerClass.updatables.indexOf(this);t>-1&&this.layerClass.updatables.splice(t,1)}},{key:"dispose",value:function(){this.removeAnimation(),this.map._panels.frontStatic.removeChild(this._container)}}])}();export{rL as Arrow3D,aI as B3DMLoader,hE as B3DMLoaderBase,Ln as BaseObject,xI as CMPTLoader,_I as CMPTLoaderBase,MM as CUSTOM_COLOR,UB as CesiumIonTilesRenderer,hO as CoordinateTransform,bM as DEPTH,wM as DISTANCE,QB as DebugCesiumIonTilesRenderer,NB as DebugGoogleTilesRenderer,kM as DebugTilesRenderer,PL as EffectComposer,oC as Ellipsoid,yC as EllipsoidRegion,pM as EllipsoidRegionHelper,fM as EllipsoidRegionLineHelper,dT as EnvironmentControls,Gb as FAILED,xM as GEOMETRIC_ERROR,wI as GLTFCesiumRTCExtension,bI as GLTFExtensionLoader,BB as GLTFMeshFeaturesExtension,xB as GLTFStructuralMetadataExtension,HI as GeoUtils,PT as GlobeControls,OB as GoogleTilesRenderer,AI as I3DMLoader,cI as I3DMLoaderBase,IM as IS_LEAF,Qb as LOADED,Fb as LOADING,BM as LOAD_ORDER,Db as LRUCache,VP as Line2,jP as LineGeometry,_P as LineMaterial,uE as LoaderBase,AM as NONE,Ub as PARSING,hI as PNTSLoader,uI as PNTSLoaderBase,Ob as PriorityQueue,CM as RANDOM_COLOR,SM as RANDOM_NODE_COLOR,EM as RELATIVE_DEPTH,dR as RenderPass,_M as SCREEN_ERROR,xO as SimpleInfoWindow,oM as SphereHelper,lb as TextureAnimator,gu as ThreeLayer,vu as ThreeRenderer,nM as TilesRenderer,rE as TilesRendererBase,Nb as UNLOADED,TB as WGS84_ELLIPSOID,jb as WGS84_FLATTENING,Vb as WGS84_HEIGHT,zb as WGS84_RADIUS,CR as bloomClass,_L as bloomLine,Fw as calIntersection,Vw as calPointColor,mO as clusterClass,lO as drawTool,yL as extrudePolygon,Cw as getCenterOfPoints,Rw as getCirGeojson,Dw as getCirGeojson1,Lw as getPsByCircle,ww as getUUid,Nw as getVPointGeojson,gb as gisCommon,fk as gltfLoadClass,pk as groupClass,Jw as imgClass,aO as layerClass,uO as layerClassNoOverride,eL as line2Object,jw as line2Polygon,zw as line2Polygon1,kw as lineLength,AO as lineUtilClass,_O as opcityClass,SR as outlineBloomClass,cO as overLayer,JP as planeGifClass,kR as planeHeightClass,kb as planeMark,hb as planeSectorClass,pL as polygonClass,xP as polylineClass,eO as pyramidClass,$w as radarClass,gP as rippleWallClass,sb as sectorClass,pb as shockClass,vO as shockMarkerClass,bw as sleep,lk as tileClass,iL as tripHeight,oL as tripHeight1,sL as tripLineClass,$P as tubeClass,yw as turf,WP as verticalFatLineClass,yP as wallClass};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "map-core-func",
3
3
  "umdName": "map-core-func",
4
- "version": "0.2.23",
4
+ "version": "0.2.25",
5
5
  "description": "map-core-func",
6
6
  "files": [
7
7
  "dist"