一个 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>
