cesium-utils-provider
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Cesium utils - Provider

This is a utils of Cesium.js.

The utils provide the commonly used ImageryProvider and TerrainProvider for easy use in every project developed based on Cesium.js.

Demo

Content

Including the following map services:

  • TianDiTu

    • TianDiTu.satellite.map
    • TianDiTu.satellite.annotation
    • TianDiTu.streets.map
    • TianDiTu.streets.annotation
  • Google

    • Google.satellite.map
    • Google.streets.mapWithAnnotation
    • Google.streets.annotation
  • OpenStreetMap

    • OSM.streets.mapWithAnnotation

Bundle

The following bundles are provided:

types/
build/
├── bundle.js
├── bundle.min.js
├── bundle.esm.js
├── bundle.esm.min.js
├── bundle.cjs.js
├── bundle.cjs.min.js
├── bundle.umd.js
└── bundle.umd.min.js

It also provides the corresponding sourcemap file.

Usage

Browser

In the browser, referenced by the <script> tag:

<script src="https://cesium.com/downloads/cesiumjs/releases/1.70.1/Build/Cesium/Cesium.js"></script>
<!-- Reference the utils library -->
<script src="/path/to/bundle.min.js"></script>

It is mounted at Cesium._utils.Provider, so you can use it like this:

const { TianDiTu, Google } = Cesium._utils.Provider

If you can't get the bundle file, you can try to build it yourself.

Node.js

Install via npm:

npm install cesium-utils-provider

Use it like this:

// ES Module
import { TianDiTu, Google } from 'cesium-utils-provider'

// CommonJS
const utilsProvider = require('cesium-utils-provider')

Build

If you cannot get the bundle file, or you want to add additional map service resources and other reasons, you can build your own.

First, clone to local

git clone https://github.com/wang1212/cesium-utils-provider.git <dir>
cd <dir>/
npm install

Then you can modify the files in src/ by yourself, and run the following command when finished:

npm run build

The bundle file will be generated in the build/ folder, include sourcemap file.

License

MIT.

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i cesium-utils-provider

    Weekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    149 kB

    Total Files

    28

    Last publish

    Collaborators

    • wang1212