Cesium-Widget
Cesium-Widget is mainly used to load common map widgets
Installation
CDN
<script src="libs/dc-sdk/plugins/dc.plugins.min.js"></script>
NPM / YARN
yarn add @dvgis/cesium-widget
npm install @dvgis/cesium-widget
import CesiumWidget from 'dvgis/cesium-widget'
import 'dvgis/cesium-widget/dist/cesium.widget.min.css'
Start
viewer.extend(CesiumWidget)
Usage
Compass
viewer.compass.enabled = true
viewer.contextMenu.enabled = true
viewer.contextMenu.addMenu('测试',()=> { alert('测试') } )
DistanceLegend
viewer.distanceLegend.enabled = true
HawkeyeMap
viewer.hawkeyeMap.enabled = true
viewer.hawkeyeMap.addImagery(new Cesium.BaiduImageryProvider())
LoadingMask
viewer.loadingMask.enabled = true
LocationBar
viewer.locationBar.enabled = true
MapSplit
viewer.mapSplit.enabled = true
viewer.mapSplit.addImagery(new Cesium.BaiduImageryProvider(),Cesium.ImagerySplitDirection.RIGHT)
viewer.popup.showAt(Cesium.Cartesian3.fromDegrees(120.121,31.121),'test')
viewer.popup.hide()
Tooltip
viewer.tooltip.enabled = true
viewer.tooltip.showAt(new Cesium.Cartesian2(100,20),'test')
viewer.tooltip.hide()
ZoomController
viewer.zoomController.enable= true
Tips
Layout using the default layout, according to the project can set their own css style
Thanks