map-core-func 0.2.21 → 0.2.23
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 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 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,Rj 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,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,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:"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};
|