@akuno/vue-cesium
v2.4.4
Published
Vue 2.x components for CesiumJS.
Downloads
8
Readme
VUE CESIUM
Notice
This project will stop maintenance on December 31, 2022. At that time, installing vue-cesium from npm will default to the Vue3 version. Please use the Vue3 version of VueCesium as soon as possible.
Languages
Links
Get Start
VueCesium, a Vue 2.x & Vue 3.x based component library of CesiumJS for GISer.
Support loading official CesiumJS, or third-party platforms based on CesiumJS:
Installation
npm i --save vue-cesium
Usage
// main.js
import Vue from 'vue'
import VueCesium from 'vue-cesium'
import lang from 'vue-cesium/lang/zh-hans'
// import lang from 'vue-cesium/lang/en-us'
Vue.use(VueCesium)
<template>
<div class="viewer">
<vc-viewer></vc-viewer>
</div>
</template>
<style>
.viewer {
width: 100%;
height: 400px;
}
</style>
Configuration
// main.js
import lang from 'vue-cesium/lang/zh-hans'
// import lang from 'vue-cesium/lang/en-us'
Vue.use(VueCesium, {
// cesiumPath is the web service address that guides the use of Cesium.js, which can be a local or CDN address such as
// cesiumPath: /static/Cesium/Cesium.js
// cesiumPath: 'https://unpkg.com/cesium/Build/Cesium/Cesium.js'
// cesiumPath: 'https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Cesium.js'
cesiumPath: 'https://cdn.jsdelivr.net/npm/cesium@latest/Build/Cesium/Cesium.js',
// If you need to use Cesium ion resources, you need to specify it. Go to https://cesium.com/ion/ to apply for an account and get Access Token. If it is not specified, it may cause the loading of CesiumIon's online images and terrain to fail.
accessToken: 'Your Cesium Ion defaultAccessToken',
lang: lang // 2.0.3+ // zh-hans
})
License
Copyright (c) 2018-present, zouyaoji [email protected]
Sponsors
Contributors
This project wouldn't exist without our amazing contributors
QQGroup
Reference
Two good vue components projects: vue-baidu-map and vuelayers.