LuciadRIA can format point locations as strings in a variety of output formats. This can be useful to display the map position of the mouse cursor in the view, for example. The LuciadRIA samples all show mouse locations on the map.
Longitude-latitude coordinate formatting
The shape/format
module offers the class LonLatPointFormat
. You can use it to format points from and to longitude-latitude coordinates.
A pattern string in EBNF notation determines the formatting of the coordinates:
const format = new LonLatPointFormat({pattern: "lat(+D),lon(+D)"});
console.log(format.format(10, 10));
Other coordinate formatting
-
MGRSPointFormat
in theshape/format
module formats points as MGRS or UTM/UPS coordinates. It can also parse MGRS or UTM/UPS strings into points. -
GARSPointFormat
in theshape/format
module formats points as GARS coordinates. It can also parse GARS strings into points.
Refer to the respective documentation for more information.