@gvol-org/daassdk
v1.0.8
Published
cesium的地名扩展功能
Downloads
8
Keywords
Readme
快速上手
通过 CDN 安装
html部分
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Dass测试</title>
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="./Cesium/Widgets/widgets.css" rel="stylesheet">
<script src="./Cesium/Cesium.js"></script>
<script src="./daassdk.min.js"></script>
<style>
#GvolContainer {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="GvolContainer"></div>
<div id="toolbar"></div>
</body>
js 部分
<script>
//初始化地球
const engine = new daassdk.GvolEngine('GvolContainer')
// 新的矢量样式加载方式是解密一个链接
new daassdk.MapboxPlaceName(engine.viewer, style)
</script>
通过 npm 安装
npm i cesium @gvol-org/daassdk
import 'cesium/Source/Widgets/widgets.css'
import * as Cesium from 'cesium'
//在入口文件或打包配置文件里设置window的全局变量
window['CESIUM_BASE_URL'] ="./node_modules/Cesium/Build/Cesium";
window.Cesium={...Cesium}
import {
GvolEngine,//cesium内核
MapboxPlaceName //创建矢量地名图层
} from '@gvol-org/daassdk'
window.Cesium=Cesium //将Cesium对象赋值到window上
const engine = new GvolEngine('GvolContainer')
let style=xxxx //style是样式配置文件
new MapboxPlaceName(engine.viewer, style)