map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface CoordinateSegment

    A coordinate segment within a SegmentedFormat.

    interface CoordinateSegment {
        example?: string;
        id: string;
        label: string;
        prefix?: string;
        suffix?: string;
        validate(input: string): boolean | ParseError;
    }
    Index

    Properties

    example?: string

    Example for this segment, like '51° 57' 40"N'

    id: string

    Id of this segment.

    This should be unique within the context of its format.

    label: string

    Human readable label for this coordinate segment (e.g. "Latitude").

    prefix?: string

    A prefix value that will be shown as part of the input field for this coordinate segment.

    This is a display-only field for strings that do not need to be typed by the user (such as "°").

    suffix?: string

    A suffix value that will be shown as part of the input field for this coordinate segment.

    This is a display-only field for strings that do not need to be typed by the user (such as "°").

    Methods

    • Validates an input string for this coordinate segment. input is the (trimmed) text typed by the user.

      This function should return true if the input is valid, or an error message otherwise.

      validate() usually only performs text based validation (e.g. regular expressions). Parsing the actual input string (using SegmentedFormat.segmentsToPoint) can return additional errors.

      Only valid inputs will be passed to SegmentedFormat.segmentsToPoint.

      Parameters

      • input: string

      Returns boolean | ParseError