# cesium-utils-provider **Repository Path**: i_wang1212/cesium-utils-provider ## Basic Information - **Project Name**: cesium-utils-provider - **Description**: :earth_asia: Cesium.js - commonly used ImageryProvider and TerrainProvider. | 经常使用的地图服务. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-05-20 - **Last Updated**: 2023-12-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Cesium utils - Provider 这是 [Cesium.js](https://cesium.com/cesiumjs/) 的一个工具库。 该工具库提供了日常使用的 [ImageryProvider](https://cesium.com/docs/cesiumjs-ref-doc/ImageryProvider.html) 和 [TerrainProvider](https://cesium.com/docs/cesiumjs-ref-doc/TerrainProvider.html), 以方便在每个基于 Cesium.js 开发的项目中使用。 [Demo](./test/index.html) ## 地图资源 包含以下的地图服务资源: - 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 ## 打包文件 提供了以下捆绑包文件: 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 同时也提供了对应的 **sourcemap** 文件。 ## 用法 ### 浏览器 在浏览器中,通过 ` ``` 该工具库挂载在 `Cesium._utils.Provider` 位置,所以你可以这样使用: ```js const { TianDiTu, Google } = Cesium._utils.Provider ``` **_如果你无法获取捆绑包文件, 你可以尝试 [自己构建](#build)._** ### Node.js 通过 npm 安装: ```bash npm install cesium-utils-provider ``` 这样使用: ```js // ES Module import { TianDiTu, Google } from 'cesium-utils-provider' // CommonJS const utilsProvider = require('cesium-utils-provider') ``` ## 构建 出于你无法获取到 bundle 文件,或者想自己添加额外的地图服务资源等其它原因,你可以自己构建。 首先, `clone` 到本地 ```bash git clone https://github.com/wang1212/cesium-utils-provider.git cd / npm install ``` 然后,您可以自己修改 **src/** 中的文件,并在完成后运行以下命令: ```bash npm run build ``` 捆绑包文件将在 **build/** 文件夹中生成,包括 **sourcemap** 文件。 ## 许可 [MIT](./LICENSE).