Smart Component 15
Hole spine.
Hole spine simplifies the hole into two straight SVG segments: tee to the protected dogleg point, then dogleg to center green. A straight hole without a dogleg uses one tee-to-green segment. The locked path stays beneath every other Smart Component.
Usage
Add the hole spine to a graphic.
Include the component in the initial mount call, reconcile it through view.setSmartComponents, or append it with view.addSmartComponent. Types may repeat. Give repeated instances stable id values to style, show, hide, move, reset, or remove one instance independently. The selected Smart Component type, instance ID, render receipt, and protected selection options such as yardages, grid spacing, coverage, measured origin, buffer distance, detail, limits, or targets are sent to the overlay service. Marker-image origins, images, presentation styles, supported labels, and movement remain local.
const view = await caddie.mount(container, graphicRequest, [
{
type: "hole-spine",
style: {
strokeColor: "#FFFFFF",
strokeWidth: 3,
strokeStyle: "dashed",
},
},
]);
view.setSmartComponentStyle({
type: "hole-spine",
style: { strokeColor: "#A3FF12", strokeWidth: 5 },
});Defaults
Built-in presentation.
Component options
Configure behavior and presentation.
| Option | Type | Default | Description |
|---|---|---|---|
| type | "hole-spine" | Required | Requests the simplified tee-dogleg-green path for the exact Hole graphic. |
| id | string | Automatic | Optional stable 1–64 character instance ID using letters, numbers, underscores, or hyphens. Use IDs to independently control repeated Smart Components of the same type. |
| style.strokeColor | #RRGGBB | "#FFFFFF" | Visible segment color. |
| style.strokeWidth | number | 3 | Non-scaling line width from 1 through 16 image pixels. |
| style.strokeStyle | "solid" | "dashed" | "dotted" | "dash-dot" | "solid" | Visible SVG stroke pattern. |
Behavior
Important implementation details.
- The SDK draws exactly two straight segments when a protected dogleg exists; it does not follow the measured multi-point centerline.
- A hole without a dogleg remains usable as one straight tee-to-center-green segment.
- Stroke color, width, and style update immediately in the local SVG without rebuilding the graphic.
- The response includes only the three or two final visible image-pixel points. It excludes the source dogleg record, geographic coordinates, transforms, and sidecar.
- The locked SVG uses z-index 0 beneath every marker, ring, label, legend, annotation, and Hole number.