Git Product home page Git Product logo

vue3-cesium-start's Introduction

vue3-cesium-start

一个基于Vue3的简易Cesium开发模板

效果

demo

项目初始化

npm install

配置

注:以下配置非必须,根据实际情况选择。

补全src/common/js/config.js中的Token信息:

注意事项

第一次npm run serve编译项目时会报错,错误信息如下:

error

报错原因为node_modules中的cesium库并没有导出widget.css文件,导致在引入widget.css时找不到该文件,究其原因为Cesium在模块化导出方面没有做的很完善,解决方法如下:

  1. 在项目目录下的node_modules文件夹中找到cesium文件夹;
  2. node_modules/cesium文件夹下找到package.json文件;
  3. package.json文件中的"exports"字段下添加"./widgets.css": "./Source/Widgets/widgets.css"

具体代码如下:

"exports": {
  "./package.json": "./package.json",
  ".": {
    "require": "./index.cjs",
    "import": "./Source/Cesium.js"
  },
+  "./widgets.css": "./Source/Widgets/widgets.css"
},

编译

npm run serve

打包

npm run build

vue3-cesium-start's People

Contributors

syzdev 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.