UNPKG

cesium-od-vue3

Version:
2 lines (1 loc) 1.5 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("cesium"),d=require("lodash-es");function O(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const t=O(y),m=(e,o,r,n,C)=>{const s=t.Cartesian3.fromDegrees(e.longitude,e.latitude),a=t.Cartesian3.fromDegrees(o.longitude,o.latitude),g=t.Cartesian3.lerp(s,a,C,new t.Cartesian3),i=t.Cartographic.fromCartesian(g);i.height=t.Cartesian3.distance(s,a)*n;const u=t.Cartesian3.fromRadians(i.longitude,i.latitude,i.height),p=[];for(let l=0;l<=r;l++){const c=l/r,w=t.Cartesian3.lerp(s,u,c,new t.Cartesian3),f=t.Cartesian3.lerp(u,a,c,new t.Cartesian3);p.push(t.Cartesian3.lerp(w,f,c,new t.Cartesian3))}return p};function P(e,o){return d.merge({name:e.name,polyline:{positions:e.positions,width:e.width,material:new t.PolylineGlowMaterialProperty({glowPower:.2,color:t.Color.fromCssColorString(e.color),taperPower:.9}),arcType:t.ArcType.NONE}},o)}function h(e,o){return d.merge({position:e.position,polyline:{positions:e.positions,width:e.width,material:new t.PolylineGlowMaterialProperty({glowPower:e.glowPower,color:t.Color.fromCssColorString(e.color),taperPower:e.taperPower}),arcType:t.ArcType.NONE}},o)}exports.createCurvedLine=m;exports.useCreateOdFlyLineOptions=h;exports.useCreateOdLineOptions=P;