Use cases:
Waypoint types:
WaypointLike: Full waypoint with coordinates and optional propertiesnull: Placeholder for unset or removed waypointsshowWaypoints draws no pin for a placeholder, but it keeps its position, so the stops after it
keep their numbers.
// Array of waypoints with some unset
const waypoints: PlanningWaypoint[] = [
{ type: 'Feature', geometry: { type: 'Point', coordinates: [4.9, 52.3] } },
null, // Empty slot for user to add waypoint
{ type: 'Feature', geometry: { type: 'Point', coordinates: [4.5, 51.9] } }
];
// Filter out null waypoints before routing
const validWaypoints = waypoints.filter((waypoint) => waypoint !== null);
Waypoint or placeholder for route planning.
It is a point along a route, either a full waypoint with position and properties, or
nullfor a placeholder like an unset waypoint in a multi-stop route planner UI.