Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dvgis/cesium-widget

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dvgis/cesium-widget

Cesium-Widget is mainly used to load common map widgets

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-76.47%
Maintainers
1
Weekly downloads
 
Created
Source

Cesium-Widget

Cesium-Widget is mainly used to load common map widgets

Installation

CDN

<script src="https://cdn.jsdelivr.net/npm/@dvgis/cesium-widget"></script>
<link href="https://cdn.jsdelivr.net/npm/@dvgis/cesium-widget/dist/cesium.widget.min.css" rel="stylesheet">

NPM / YARN

yarn add @dvgis/cesium-widget
------------------------------
npm install @dvgis/cesium-widget
require('dvgis/cesium-widget')
import 'dvgis/cesium-widget/dist/cesium.widget.min.css'

Start

Introduce the Cesium framework before use

viewer.extend(Cesium.CesiumWidgetMixin)

Usage

Compass

viewer.compass.enabled = true

ContextMenu

viewer.contextMenu.enabled = true
// add menu item, params: label, callback, context
viewer.contextMenu.addMenu('测试',()=> { alert('测试') } ) 
// setting default menu,if setting the property, the lib default setting will be overwrite
viewer.contextMenu.DEFAULT_MENU = [{
   label:'',
   callback:(e)=>{},
   context:this
}] 

DistanceLegend

viewer.distanceLegend.enabled = true

HawkeyeMap

viewer.hawkeyeMap.enabled = true
// add imagery, params: ImageryProvider
viewer.hawkeyeMap.addImagery(new Cesium.BaiduImageryProvider())

LoadingMask

viewer.loadingMask.enabled = true

LocationBar

viewer.locationBar.enabled = true

MapSplit

viewer.mapSplit.enabled = true
// add imagery, params: ImageryProvider, ImagerySplitDirection
viewer.mapSplit.addImagery(new Cesium.BaiduImageryProvider(),Cesium.ImagerySplitDirection.RIGHT) 

Popup

// Popup default enabled is true,so no need to setting
// show popup, params: cartesian3, content
viewer.popup.showAt(Cesium.Cartesian3.fromDegrees(120.121,31.121),'test')
// hide popup
viewer.popup.hide()

Tooltip

viewer.tooltip.enabled =  true
// show tooltip, params: cartesian2, content
viewer.tooltip.showAt(new Cesium.Cartesian2(100,20),'test')
// hide tooltip
viewer.tooltip.hide()

ZoomController

viewer.zoomController.enabled = true

Tips

Layout using the default layout, according to the project can set their own css style

Thanks

Keywords

FAQs

Package last updated on 19 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc