Function withSnappedActiveVertex

  • Return geometry with its active sketch vertex replaced by position.

    The active vertex is the last drawn coordinate: the point itself for Point, the final coordinate for MultiPoint / LineString / MultiLineString, and the final non-closing vertex of the last ring for Polygon / MultiPolygon (ring closure is preserved). Unknown geometry shapes are returned unchanged.

    Parameters

    • geometry: null | Record<string, unknown>
    • position: SnapPosition

    Returns Record<string, unknown> | null