SvgPathBindingHandler

Knockout绑定处理程序,用于为单个SVG路径创建DOM元素。 这个绑定处理程序将被注册为cesiumSvgPath。

该绑定的参数为对象,具有以下属性:

  • path: SVG路径字符串。
  • width:未应用转换的SVG路径的宽度。
  • height:未应用转换的SVG路径的高度。
  • css:可选。包含应用于SVG的附加CSS类的字符串。'cesium-svgPath-svg'总是被应用。
Example:
// Create an SVG as a child of a div
<div data-bind="cesiumSvgPath: { path: 'M 100 100 L 300 100 L 200 300 z', width: 28, height: 28 }"></div>

// parameters can be observable from the view model
<div data-bind="cesiumSvgPath: { path: currentPath, width: currentWidth, height: currentHeight }"></div>

// or the whole object can be observable from the view model
<div data-bind="cesiumSvgPath: svgPathOptions"></div>

Methods

static Cesium.SvgPathBindingHandler.register()

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.