npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cesium-atom

v0.1.8

Published

提供 Cesium 三维可视化场景的常用工具函数集合,支持 TypeScript/JavaScript 开发

Readme

Cesium 3D 可视化工具库

提供 Cesium 三维可视化场景的常用工具函数集合,支持 TypeScript/JavaScript 开发

功能特性

  • 📍 多种标记类型创建(GLTF 模型/图片/标签/线框等)
  • 🌐 地理坐标与笛卡尔坐标互转
  • 🎮 相机模式切换与控制
  • 🧭 三维空间数学计算工具
  • 🖱️ 交互式拖拽支持
  • 📐 视锥体与轮廓绘制
  • 💡 场景光照设置

安装

npm install cesium cesium-atom

快速开始

typescript
import { Viewer } from 'cesium';
import { 
  setLight,
  createGltfModelMarker,
  transformWGS84ToCartesian
} from 'cesium-atom';

// 初始化场景
const viewer = new Viewer('cesiumContainer');

// 设置场景光照
setLight(viewer);

// 创建飞机模型标记
const position = transformWGS84ToCartesian({
  lon: 116.3974, 
  lat: 39.9093,
  alt: 1000
});

const aircraft = createGltfModelMarker(position, {
  uri: '/models/aircraft.glb',
  heading: 45
});
viewer.entities.add(aircraft);

API 文档

场景控制
setLight(viewer: Viewer)

设置场景光照系统
toggleCameraMode(viewer: Viewer)
标记创建
createGltfModelMarker()

createGltfModelMarker(
  position: Cartesian3,
  options: {
    uri: string,
    heading?: number
  },
  properties?: Record<string, any>
): Entity

createImageMarker()

createImageMarker(
  position: Cartesian3, 
  image: string
): Entity
坐标转换
transformWGS84ToCartesian()
typescript
interface GeoPosition {
  lon: number;
  lat: number;
  alt: number;
}

transformWGS84ToCartesian(
  position: GeoPosition, 
  alt?: number
): Cartesian3
空间计算
calculateNextPosition()
typescript
calculateNextPosition(
  position: Cartesian3,
  heading: number,
  vector: number,
  direction: 'a' | 's' | 'd' | 'w'
): Cartesian3
交互工具
dragPlane()
dragPlane(
  viewer: Viewer,
  movement: { endPosition: Cartesian2 },
  startPosition: Cartesian3
): Cartesian3 | undefined
数学工具
getModelMatrix()
typescript
getModelMatrix(
  pointA: Cartesian3,
  pointB: Cartesian3
): Matrix4

功能示意图

graph TD
    A[场景控制] --> B[光照设置]
    A --> C[相机模式]
    
    D[标记系统] --> E[3D模型]
    D --> F[图像标记]
    D --> G[线框绘制]
    
    H[坐标系统] --> I[WGS84转换]
    H --> J[笛卡尔运算]
    
    K[交互系统] --> L[平面拖拽]
    K --> M[垂直拖拽]
    
    N[数学工具] --> O[矩阵计算]
    N --> P[方位角计算]