Skip to main content

isCoordinateText

Whether text is, or may be the start of, a coordinate: text that reads as a position (coordinateSearchResult), is a pair made of figures and coordinate words only, finished or not ("26.2041 south, 28.04"), or is a UTM or MGRS reference that has not been finished. A caller that sends text to a place search service as it is typed skips this text, so a coordinate is never sent to one, even a reference whose letters ("SPA") look like a word. Text longer than MAX_COORDINATE_TEXT_LENGTH is never one.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { isCoordinateText } from "@mapcairn/core";

function isCoordinateText(text: string, messages: MessageCatalogue): boolean;

Parameters​

  • text (string)
  • messages (MessageCatalogue)

Returns​

boolean

See also​

Source: packages/core/src/coordinates/coordinateSearchResult.ts:85