Options
All
  • Public
  • Public/Protected
  • All
Menu

Format for points. It allows you to format points from/to longitude latitude coordinates.

The formatting of coordinates is determined by the pattern string that is passed to the constructor of this class. The EBNF for the pattern syntax is

  pattern     = lon, separator, lat | lat, separator, lon
  lon         = "lon(", axiscoord, ")"
  lat         = "lat(", axiscoord, ")"
  axiscoord   = axis, signcoord | signcoord, axis, signcoord
  signcoord   = sign, coord | coord
  coord       = degrees | degrees, minutes | degrees, minutes, seconds
  degrees     = ( "d" | "D" ), { digit }
  minutes     = ( "m" | "M" ), { digit }
  seconds     = ( "s" | "S" ), { digit }
  axis        = "a"
  digit       = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;
  separator   = { ? any character ? }

The table below details the meaning of each pattern character

SymbolMeaningExample
dInteger degrees354
d<n>Decimal degrees with <n> fractional digitsd5: 354.25435
DInteger degrees with degrees symbol354°
D<n>Decimal degrees with degrees symbol and <n> fractional digitsD5: 354.25435°
mInteger minutes54
m<n>Decimal minutes with <n> fractional digitsm5: 54.25435
MInteger minutes with minutes symbol54'
M<n>Decimal minutes with minutes symbol and <n> fractional digitsM5: 54.25435'
sInteger seconds54
s<n>Decimal seconds with <n> fractional digitss5: 54.25435
SInteger seconds with seconds symbol54"
S<n>Decimal seconds with seconds symbol and <n> fractional digitsS5: 54.25435"
+Coordinate sign. Results in a '-' if the coordinate is negative-
aHemisphere indicatorN, S, E, W

As an example, the default formatting pattern is "lat(+DMS),lon(+DMS)". This results in a format that generates the latitude coordinate, a comma character and the longitude coordinate. Each coordinate is prefixed with a sign followed by integer degrees, minutes, seconds including their respective unit characters (i.e, °, ' and ").

since

2013.0

Hierarchy

  • LonLatPointFormat

Overview

Constructors

Methods

Constructors

constructor

Methods

format

  • (longitudeOrPoint: number | Point, latitude?: number): string
  • Formats the given longitude/latitude coordinate pair as a String, following the current pattern.

    Parameters

    • longitudeOrPoint: number | Point
    • Optional latitude: number

      the latitude, expressed in degrees (between -90 and 90).

    Returns string

    the formatted String.

formatLat

  • (latitude: number): string
  • Formats the given latitude coordinate as a String, following the current pattern.

    Parameters

    • latitude: number

      the latitude, expressed in degrees (between -90 and 90).

    Returns string

    the formatted String.

formatLon

  • (longitude: number): string
  • Formats the given longitude coordinate as a String, following the current pattern.

    Parameters

    • longitude: number

      the longitude, expressed in degrees.

    Returns string

    the formatted String.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method