map-core-func 0.2.21 → 0.2.22

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.
@@ -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 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,mO 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,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,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:"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};
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.21",
4
+ "version": "0.2.22",
5
5
  "description": "map-core-func",
6
6
  "files": [
7
7
  "dist"