Skip to main content

Class: DmsFormatter

A class to format latitude/longitude to DMS. DmsFormatter

Constructors

constructor

new DmsFormatter(): DmsFormatter

Returns

DmsFormatter

Methods

getLatDmsStr

getLatDmsStr(value, spaceAfterDirection?, minuteApostrophe?, precision?, padMinutesTo?): string

Builds a DMS string out of the given latitude.

Parameters

NameTypeDefault valueDescription
valuenumberundefinedThe latitude.
spaceAfterDirectionbooleantrueWhether to insert a space after the direction letter.
minuteApostrophebooleantrueWhether to insert an apostrophe (') after the string.
precisionnumber2Decimal precision for the minutes part.
padMinutesTonumber3Padding applied to integer part of minutes.

Returns

string

The DMS string.

Defined in

src/sdk/graphics/text/DmsFormatter.ts:42


getLonDmsStr

getLonDmsStr(value, minuteApostrophe?, precision?, padMinutesTo?): string

Builds a DMS string out of the given longitude.

Parameters

NameTypeDefault valueDescription
valuenumberundefinedThe longitude.
minuteApostrophebooleantrueWhether to insert an apostrophe (') after the string.
precisionnumber2Decimal precision for the minutes part.
padMinutesTonumber3Padding applied to integer part of minutes.

Returns

string

The DMS string.

Defined in

src/sdk/graphics/text/DmsFormatter.ts:59


parseLat

parseLat(value): DmsValues

Parses a latitude in to the dms parts.

Parameters

NameTypeDescription
valuenumberThe latitude in degrees.

Returns

DmsValues

The DMS parts.

Defined in

src/sdk/graphics/text/DmsFormatter.ts:73


parseLon

parseLon(value): DmsValues

Parses a longitude in to the dms parts.

Parameters

NameTypeDescription
valuenumberThe longitude in degrees.

Returns

DmsValues

The DMS parts.

Defined in

src/sdk/graphics/text/DmsFormatter.ts:83