@vesium/shared 1.0.1-beta.44 → 1.0.1-beta.57
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.
- package/README.md +1 -8
- package/dist/index.cjs +34098 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +367 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +367 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.iife.js +34200 -407
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +2 -2
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.min.cjs +46 -2
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.mjs +2 -2
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +34099 -343
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/dist/index.d.ts +0 -410
package/dist/index.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=index.min.mjs.map
|
|
1
|
+
import{CallbackProperty as e,Cartesian3 as t,Cartographic as n,ConstantProperty as r,Ellipsoid as i,Material as a,Math as o,defined as s}from"cesium";Object.create,Object.defineProperty,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.prototype.hasOwnProperty;function c(e,t){let n=new Set(t),r=e.filter(e=>!n.has(e)),i=new Set(e);return{added:r,removed:t?.filter(e=>!i.has(e))??[]}}function l(e,t,n=`auto`){if(n===`pickPosition`)return t.pickPosition(e);if(n===`globePick`){let n=t.camera.getPickRay(e);return n&&t.globe.pick(n,t)}else{if(t.globe.depthTestAgainstTerrain)return t.pickPosition(e);let n=t.pickPosition(e),r=t.camera.getPickRay(e),a=r&&t.globe.pick(r,t);return n&&((n&&i.WGS84.cartesianToCartographic(n).height)??0)<((a&&i.WGS84.cartesianToCartographic(a).height)??0)?n:a}}function u(e,t){return t.cartesianToCanvasCoordinates(e)}const d=Object.prototype.toString;function f(e){return e!==void 0}function p(e){return typeof e==`boolean`}function m(e){return typeof e==`function`}function h(e){return typeof e==`number`}function g(e){return typeof e==`string`}function _(e){return d.call(e)===`[object Object]`}function v(e){return typeof window<`u`&&d.call(e)===`[object Window]`}function y(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`}function b(e){return!!(e&&e.nodeName&&e.nodeType===1)}const x=Array.isArray;function S(e){return/^\s*data:([a-z]+\/[\d+.a-z-]+(;[a-z-]+=[\da-z-]+)?)?(;base64)?,([\s\w!$%&'()*+,./:;=?@~-]*?)\s*$/i.test(e)}function C(e,t){if(e)throw Error(t)}function w(e,t){return e===t||m(e?.equals)&&e.equals(t)||m(t?.equals)&&t.equals(e)}function T(e,r={}){if(!e)return;let{type:a=`Array`,alt:s=!1}=r,c,l,u;if(e instanceof t){let t=i.WGS84.cartesianToCartographic(e);c=o.toDegrees(t.longitude),l=o.toDegrees(t.latitude),u=t.height}else if(e instanceof n){let t=e;c=o.toDegrees(t.longitude),l=o.toDegrees(t.latitude),u=t.height}else Array.isArray(e)?(c=o.toDegrees(e[0]),l=o.toDegrees(e[1]),u=e[2]):(c=e.longitude,l=e.latitude,u=e.height);return a===`Array`?s?[c,l,u]:[c,l]:s?{longitude:c,latitude:l,height:u}:{longitude:c,latitude:l}}function E(e,t=3){let n=`${e}`,r=n.indexOf(`.`),i=r<0?n:n.slice(0,Math.max(0,r)),a=`0`,o=`0`;return r>0&&(a=`0${n.slice(Math.max(0,r))}`,a=`${a*60}`,r=a.indexOf(`.`),r>0&&(o=`0${a.slice(Math.max(0,r))}`,a=a.slice(0,Math.max(0,r)),o=`${o*60}`,r=o.indexOf(`.`),o=o.slice(0,Math.max(0,r+4)),o=(+o).toFixed(t))),`${Math.abs(+i)}°${+a}′${+o}″`}function D(e){let[t,n]=e.split(`°`)??[],[r,i]=n?.split(`′`)??[],a=i?.split(`″`)[0],o=Number(t)||0,s=(Number(r)||0)/60,c=(Number(a)||0)/60/60,l=o+s+c;if(l===0)return 0;{let t=l;return[`W`,`w`,`S`,`s`].includes(e[e.length-1])&&(t=-t),t}}function O(e,t=3){let n=T(e,{alt:!0});if(!n)return;let[r,i,a]=n,o=E(r,t),s=E(i,t);return[`${o}${r>0?`E`:`W`}`,`${s}${i>0?`N`:`S`}`,a]}function k(e){let[t,n,r]=e;return[D(t),D(n),Number(r)||0]}function A(e){return!s(e)||!!e.isConstant}var j=class extends a{constructor(e){super(e)}};function M(e){return a._materialCache.getMaterial(e)}function N(e,t){return a._materialCache.addMaterial(e,t)}function P(e={}){let{primitive:t,id:n,primitiveCollection:r,collection:i}=e,a=n&&n.entityCollection||null,o=a&&a.owner||null;return[...Array.isArray(n)?n:[n].filter(Boolean),t,r,i,a,o].filter(e=>!!e)}function F(e,t){if(!Array.isArray(t)||!t.length)return!1;let n=P(e);return n.length?n.some(e=>t.includes(e)):!1}function I(e){return e&&m(e.getValue)}function L(e,t){return I(e)?e.getValue(t):e}function R(t,n=!1){return I(t)?t:m(t)?new e(t,n):new r(t)}function z(e,t,n,r){let i,a=n=>{i?.(),s(n?.definitionChanged)&&(i=n?.definitionChanged?.addEventListener(()=>{e.definitionChanged.raiseEvent(e,t,n,n)}))},o=`_${t}`,c=R(n);e[o]=c,a(c),r?Object.defineProperty(e,t,{get(){return e[o]}}):Object.defineProperty(e,t,{get(){return e[o]},set(n){let r=e[o];e[o]!==n&&(e[o]=n,a(n),s(e.definitionChanged)&&e.definitionChanged.raiseEvent(e,t,n,r))}})}function B(e,t,n,r={}){let i=!!r.toProperty,a=!!r.shallowClone,o=r.changedEventKey||`definitionChanged`,s=Reflect.get(e,o),c=`_${String(t)}`,l=i?R(n):n;Reflect.set(e,c,l);let u={get(){let t=Reflect.get(e,c);return a?Array.isArray(t)?[...t]:{...t}:t}},d,f=(n,r)=>{d?.(),d=n?.definitionChanged?.addEventListener(()=>{s?.raiseEvent.bind(s)(e,t,n,r)})};r.readonly||(i&&I(n)&&f(n),u.set=n=>{if(i&&!I(n))throw Error(`The value of ${String(t)} must be a Cesium.Property object`);let r=Reflect.get(e,c);r!==n&&(Reflect.set(e,c,n),s?.raiseEvent.bind(s)(e,t,n,r),i&&f(n))}),Object.defineProperty(e,t,u)}function V(e,t,n,r={}){return B(e,t,n,{...r,toProperty:!0})}typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function H(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(()=>i(n),e):setTimeout(r,e)})}function U(e,t=100,n=!0,r=!1){let i=[],a=!1,o=async()=>{if(await H(t),a=!1,r)try{e(...i[0])}catch(e){console.error(e)}if(n&&(!r||i.length>1))try{e(...i[i.length-1])}catch(e){console.error(e)}i.length=0};return(...e)=>{i.length<2?i.push(e):i[1]=e,a||(a=!0,o())}}function W(e){if(e)return e instanceof t?e.clone():e instanceof n?i.WGS84.cartographicToCartesian(e):Array.isArray(e)?t.fromDegrees(e[0],e[1],e[2]):t.fromDegrees(e.longitude,e.latitude,e.height)}function G(e){if(e)return e instanceof t?i.WGS84.cartesianToCartographic(e):e instanceof n?e.clone():Array.isArray(e)?n.fromDegrees(e[0],e[1],e[2]):n.fromDegrees(e.longitude,e.latitude,e.height)}function K(e){return((...t)=>{try{return e?.(...t)}catch(e){console.error(e)}})}export{j as CesiumMaterial,N as addMaterialCache,c as arrayDiff,C as assertError,l as canvasCoordToCartesian,u as cartesianToCanvasCoord,w as cesiumEquals,B as createCesiumAttribute,V as createCesiumProperty,z as createPropertyField,O as degreesToDms,D as dmsDecode,E as dmsEncode,k as dmsToDegrees,M as getMaterialCache,x as isArray,S as isBase64,p as isBoolean,A as isCesiumConstant,f as isDef,b as isElement,m as isFunction,h as isNumber,_ as isObject,y as isPromise,I as isProperty,g as isString,v as isWindow,F as pickHitGraphic,P as resolvePick,U as throttle,W as toCartesian3,G as toCartographic,T as toCoord,R as toProperty,L as toPropertyValue,K as tryRun};
|
|
2
|
+
//# sourceMappingURL=index.min.mjs.map
|