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 🙏

© 2025 – Pkg Stats / Ryan Hefner

aerospacetool

v1.0.14

Published

三维可视化封装脚本

Readme

导入依赖

<!-- 引入cesium库(就可在脚本、组件中直接使用Cesium类实例化) -->
<script src="https://cdn.bootcdn.net/ajax/libs/cesium/1.110.0/Cesium.js"></script>
<!-- 引入cesium热力图 -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/CesiumHeatmap.min.js"></script>
<!-- 引入cesium导航栏 -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/CesiumNavigation.umd.min.js"></script>
<!-- 引入cesium库样式 -->
<link
  href="https://cdn.bootcdn.net/ajax/libs/cesium/1.95.0/Widgets/widgets.css"
  rel="stylesheet"
/>

安装

npm i aerospacetool

导入

import aerospacetool from "aerospacetool"

使用

// 初始化场景
aerospacetool.initializationScenario("cesiumContainer");
// 使用离线图片创建太空场景
aerospacetool.createPicturesScenes("cesiumContainer");
// 创建纯色地球太空场景
aerospacetool.createSolidColorEarthScene("cesiumContainer");
// 底图改为天地图影像底图
aerospacetool.imageBaseMapChangedToEarthMap();
// 使用天地图资源添加影像标注
aerospacetool.addImageAge();
// 添加地形数据
aerospacetool.addWorldTerrainAsync();
// 添加局部地区建筑
aerospacetool.addedLocalAreaBuildings();
// 添加全球城市建筑
aerospacetool.addedGlobalCityArchitecture();
// 添加云图
aerospacetool.addCloud(viewer);
// 添加导航栏
aerospacetool.addNavigationBar(viewer);
// 添加鹰眼图
aerospacetool.addHawkEyeMap(viewer);
// 经纬高转空间坐标
aerospacetool.logitudeLatitudeHeightTransformXyz(108.942601, 34.260999, 60000);
// 空间坐标转经纬高
aerospacetool.xyzTransformLogitudeLatitudeHeigh();
// 空间坐标转平面坐标
aerospacetool.xyzTransformXy();
// 添加点实体
aerospacetool.addPointEntity({
  longitude: 108.942601,
  latitude: 34.260999,
});
// 添加多边形实体
aerospacetool.addPolygonEntity({
  viewer: viewer,
  vertices: [-110, 40, -105, 40, -105, 45, -110, 45],
  height: 1000,
  material: Cesium.Color.BLUE.withAlpha(0.5),
  outlineColor: Cesium.Color.WHITE,
  description: "这是一个自定义的多边形",
  name: "customPolygon",
});
// 添加模型实体
aerospacetool.addModelEntity({
  viewer: viewer, // Cesium Viewer 实例
  id: "myModelEntity", // 自定义 ID
  name: "My Model", // 模型实体的名称
  longitude: 108.942601, // 模型的经度
  latitude: 34.260999, // 模型的纬度
  height: 60000, // 模型的高度
  modelUrl: "./models/SAR卫星.gltf", // 模型的 URL
  minimumPixelSize: 100, // 模型的最小像素大小
  maximumScale: 100000, // 模型的最大缩放比例
});
// 添加正方体实体
aerospacetool.addCubeEntity();
// 编写czml实现路径效果
aerospacetool.useCzmlImplementDynamicPath();
// 加载绘制3D瓦片数据
aerospacetool.load3Dtiles();
// 加载GeoJson数据函数
aerospacetool.loadGeoJson("./js/simplestyle.geojson");
// 跳转视角方法
aerospacetool.perspectiveJump(window.viewer, 108.942601, 34.260999, 100000);
// 视角连续飞行跳转方法
aerospacetool.flyToNextPosition(viewer, [
  {
    longitude: 114.38,
    latitude: 36.9,
    height: 351.68,
    heading: 0.0, // 偏航角
    pitch: -28.0, // 俯仰角
    roll: 0.0, // 翻转角
    duration: 10,
  },
  {
    longitude: 114.38,
    latitude: 38,
    height: 351.68,
    heading: 0.0, // 偏航角
    pitch: -28.0, // 俯仰角
    roll: 0.0, // 翻转角
    duration: 10,
  },
  {
    longitude: 114.38,
    latitude: 40,
    height: 351.68,
    heading: 0.0, // 偏航角
    pitch: -28.0, // 俯仰角
    roll: 0.0, // 翻转角
    duration: 10,
  },
]);
// 使用键盘控制相机的函数
aerospacetool.useKeyboardControlCamera();