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

  • @luciad/ria-milsym/text/mgrs/MGRSFormat in the LuciadRIA Military Symbology component formats points as MGRS or UTM/UPS coordinates. It can also parse MGRS or UTM/UPS strings into points.

  • @luciad/ria-milsym/text/gars/GARSFormat in the LuciadRIA Military Symbology component formats points as GARS coordinates. It can also parse GARS strings into points.

Refer to the respective documentation for more information.