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

e-ngx-cesium

v6.3.2

Published

基于Angular的三维地球组件,依赖三维框架cesium

Readme

e-ngx-cesium

基于Angular的三维地球组件,依赖三维框架:cesium

示例图

如果该组件出现typescript编译错误,有可能是cesium-typings不是最新的,你可以执行npm uninstall e-ngx-cesium --save之后再执行npm install e-ngx-cesium --save

Usage

  1. Install

    npm install --save e-ngx-cesium@latest
  2. Set in the .angular-cli.json(@angular/cli)

    "assets": [
        {
            "glob": "**/*",
            "input": "../node_modules/cesium/Build/Cesium",
            "output": "./assets/scripts/cesium"
        }
    ],
    "styles": [
        "../node_modules/cesium/Build/Cesium/Widgets/widgets.css"
    ],
    "scripts": [
        "../node_modules/cesium/Build/Cesium/Cesium.js",
        "../node_modules/e-ngx-cesium/dist/components/navigation/viewerCesiumNavigationMixin.js"
    ]
  3. Add cesium-typings to typings.d.ts

    /// <reference path="../node_modules/cesium-typings/index.d.ts" />
  4. Set CESIUM_BASE_URL in main.ts

    window['CESIUM_BASE_URL'] = './assets/scripts/cesium'; // 设置cesium请求资源的基本路径
    // window['CESIUM_BASE_URL']需在应用启动之前设置
    platformBrowserDynamic().bootstrapModule(AppModule);
  5. Add the ENgxCesiumModule

    import { ENgxCesiumModule } from "e-ngx-cesium";
    @NgModule({
        imports: [
            ENgxCesiumModule
        ]
    })
  6. Use in Template

    <e-ngx-cesium [viewerOptions]="viewerOptions" (viewerReady)="onViewerReady($event)"></e-ngx-cesium>
  7. Use in Component

    viewerOptions: ViewerOptions;
    viewer: Viewer;
    
    constructor() {
        this.viewerOptions = {
            scene3DOnly: true,
            selectionIndicator: false,
            baseLayerPicker: false
        };
    }
    
    onViewerReady(evt: any) {
        this.viewer = evt.viewer;
    }

API

Inputs

  • viewerOptionsany) - 创建Cesium.Viewer的属性配置,默认配置:

    private defaultViewerOptions: ViewerOptions = {
    	timeline: false,
    	animation: false,
    	baseLayerPicker: false,
    	geocoder: false,
    	homeButton: false,
    	navigationHelpButton: false,
    	sceneModePicker: false,
    	fullscreenButton: false,
    	fullscreenElement: this.globeContainer // 设置viewer所在元素为全屏的元素
    };
  • accessTokenstring) - cesium ion 令牌。要访问 cesium 提供的影像或地形服务,需要去 cesium ion 注册申请

  • proxystring) - 设置代理路径,可使用esri提供的几个平台的代理文件

  • rectangleRectangle) - 初始范围,默认中国

  • enablePositionboolean?=false) - 启用位置信息部件

  • enableSettingboolean?=false) - 启用效果设置部件

  • enableCompassboolean?=true) - 启用罗盘部件

  • enableZoomControlsboolean?=true) - 启用缩放部件

  • enableDistanceLegendboolean?=false) - 启用比例尺部件

  • enableRollerShuttersboolean?=false) - 启用卷帘对比

  • contrastImageryLayersImageryProvider[]) - 卷帘对比的图层。图层显示顺序:左-右-左-右

Outputs

  • viewerReady - Cesium.Viewer创建完成后会触发该事件,参数$event为{viewer: Cesium.Viewer, scene: Cesium.Scene, globe: Cesium.Globe, ellipsoid: Cesium.Ellipsoid}

  • sliderChange - 卷帘对比滑块位置变化事件,参数$event为当前ImageryLayer.splitDirection的值

Custom ImageryProvider

  • GoogleMapsImageryProvider(谷歌)

  • GaodeMapsImageryProvider(高德)

  • TiandituMapsImageryProvider(天地图)

Develop

```shell
npm install // 安装依赖包

npm start // 启动项目
```

License

MIT License