Giter Club home page Giter Club logo

cesiumpro's Introduction

关于Cesium的二次封装,断断续续写了好几年了,最近两年由于岗位的变化对Cesium使用越来越少,已经无力维护了。

使用说明

  1. 使用script引入
    <script src="/cesium/Cesium/Cesium.js"></script>    
    <script src="/build/CesiumPro.js"></script>
    <link href="/thirdParty/cesium/Cesium/Widgets/widgets.css" rel="stylesheet"/>
    <link href="/build/assets/core.css" rel="stylesheet"/>

建议使用这种方法引入 支持的Cesium最高版本为cesium 1.99

  1. 使用npm引入
npm install [email protected] cesiumpro
import * as Cesium from 'cesium';
import * as CesiumPro from 'cesiumpro';
...

如果使用npm引入,需要配置webpack

module.exports = {
    configureWebpack: {
        plugins: [
            new webpack.DefinePlugin({
                // Define relative base path in cesium for loading assets
                CESIUM_BASE_URL: JSON.stringify(''),
                CESIUMPRO_BASE_URL: JSON.stringify(''),
             }),
            new CopyWebpackPlugin({
                patterns: [
                    { from: 'node_modules/cesium/Build/Cesium/Workers', to: 'Workers' },
                    { from: 'node_modules/cesium/Build/Cesium/ThirdParty', to: 'ThirdParty' },
                    { from: 'node_modules/cesium/Build/Cesium/Assets', to: 'Assets' },
                    { from: 'node_modules/cesium/Build/Cesium/Widgets', to: 'Widgets' },
                ]
            })
        ]
    }
}

开发

安装依赖后执行npm start可以本地运行,查看示例和文档

Alt text

Alt text

cesiumpro's People

Contributors

xtfge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.