Class: DMSCoordinates filter:ngeoDMSCoordinates

ngeo.misc.filters.DMSCoordinates

new DMSCoordinates()

Format coordinates as DMS coordinates.

Example without parameters:

 <p>{{[7.1234, 46.9876] | ngeoDMSCoordinates}}</p>
 <!-- will Become  7° 07' 24'' E 46° 59' 15'' N-->

Example with defined fractionDigits and a template.

 <p>{{[7.1234, 46.9876] | ngeoDMSCoordinates:2:'[{y}; {x]'}}</p>
 <!-- will Become [46° 59' 15.36'' N; 7° 07' 24.24'' E] -->
Returns:
ngeox.dmsCoordinates

A function to format numbers into a DMS coordinates string.

Methods

(inner) filterFn(coordinates, [opt_fractionDigits]opt, [opt_template]opt)

Parameters:
Name Type Attributes Description
coordinates ol.Coordinate

Array of two numbers.

[opt_fractionDigits] (number|string)= <optional>

Optional number of digit. Default to 0.

[opt_template] string= <optional>

Optional template. Default to '{x} {y}'. Where "{x}" will be replaced by the easting coordinate, {y} by the northing one. Note: Use a html entity to use the semicolon symbol into a template.

Returns:
string

DMS formatted coordinates.