-
Widget
is a base class that you can extend to create your own widgets. You can import it into your project: -
DomUtil
is a utility class that provides some DOM manipulation methods. 中文 Readme
npm install --save @cesium-extends/common
import { Widget, DomUtil } from "@cesium-extends/common";
Widget
is a base class for widgets based on Cesium applications. It provides some common widget manipulation methods and properties.
Creates a new instance of the Widget
class and attaches it to the specified Cesium Viewer.
-
viewer
: The Cesium Viewer instance to attach the widget to. -
wrapper
: The DOM element to mount the widget to.
A boolean property that controls whether the widget is enabled or not.
A boolean property indicating whether the widget is ready or not.
A method for setting the content of the widget.
-
content
: A string or DOM element representing the content to set.
A method for hiding the widget.
A method for showing the widget.
A method for destroying the widget.
DomUtil
is a utility class that provides some DOM manipulation methods.
Creates an HTML element with the specified tagName
, sets its class to className
, and optionally appends it to the container
element.
-
tagName
: The HTML tag name to create. -
className
: The class name to set on the HTML element. -
container
(optional): The container element to append the new element to.
Parses a string into a DOM element and returns a DIV element containing the element.
-
domStr
: The string to parse. -
className
: The class name to set on the DIV element.