SvgPathBindingHandler

为单个 SVG 路径创建 DOM 元素的 Knockout 绑定处理程序。此绑定处理程序将注册为 cesiumSvgPath。

此绑定的参数是具有以下属性的对象:

  • path:SVG 路径作为字符串。
  • width:未应用转换的 SVG 路径的宽度。
  • height:未应用任何转换的 SVG 路径的高度。
  • css:可选。包含附加 CSS 类以应用于 SVG 的字符串。 '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 ()