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