@erikmichelson/open-location-code-ts
    Preparing search index...

    Function encode

    • Encode a location into an Open Location Code.

      Parameters

      • latitude: number

        The latitude in signed decimal degrees. It will be clipped to the range -90 to 90.

      • longitude: number

        The longitude in signed decimal degrees. Will be normalised to the range -180 to 180.

      • OptionalcodeLength: number

        The length of the code to generate. If omitted, the value OpenLocationCode.CODE_PRECISION_NORMAL will be used. For a more precise result, OpenLocationCode.CODE_PRECISION_EXTRA is recommended.

      Returns string

      The code.

      if any of the input values are not numbers.