new NumberCoordinates($filter)
Format a couple of numbers as number coordinates.
Example without parameters:
<p>{{[7.1234, 46.9876] | ngeoNumberCoordinates}}</p>
<!-- will Become 7 47 -->
Example with defined fractionDigits and template (en-US localization):
<!-- With en-US localization -->
<p>{{[7.1234, 46.9876] | ngeoNumberCoordinates:2:'co {x} E; {y} N'}}</p>
<!-- will Become co 7.12 E; 46.99 N -->
<br/>
<!-- With en-US localization -->
<p>{{[2600000, 1600000] | ngeoNumberCoordinates:0:'{x}, {y}'}}</p>
<!-- will Become 2,600,000, 1,600,000 -->
<br/>
<!-- With fr-CH localization -->
<p>{{[2600000, 1600000] | ngeoNumberCoordinates:0:'{x}, {y}'}}</p>
<!-- will Become 2'600'000, 1'600'000 -->
Parameters:
Name | Type | Description |
---|---|---|
$filter |
angular.$filter | Angular filter |
Returns:
ngeox.numberCoordinates
A function to format numbers into 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 and "{y}" by the northing one. Note: Use a html entity to use the semicolon symbol into a template. |
Returns:
string
Number formatted coordinates.