Georeferencing API
    Preparing search index...

    Function snapToReferences

    • Find the nearest reference vertex (and optionally edge point) within each source's pixel tolerance of a pointer position.

      Parameters

      • pointer: XY

        Pointer position in screen pixels.

      • sources: readonly SnapSource[]

        Candidate reference features with their snapping rules.

      • toScreen: (coordinate: XY) => XY

        Project a data coordinate to screen pixels.

      • OptionalsearchExtent: Extent

        Optional data-coordinate box around the pointer (covering the largest tolerance). Features outside it are skipped without projecting them.

      Returns SnapResult | null

      The nearest candidate, or null when nothing is within tolerance.