Skip to main content

coordinateSearchResult

Turns search text into the one result for the place it names, when the text is a coordinate pair (see parseCoordinates), and null otherwise. The result needs no search service, so a caller can answer it without a request.

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

Signature​

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

function coordinateSearchResult(text: string, messages: MessageCatalogue): SearchResult | null;

Description​

The label names the place in words, such as "Coordinates 26.20410° S, 28.04730° E", using the app's coordinate formatters and the hemisphere letters and wording of messages, and it reads the letters and words of that language in the text too. It reads back through parseCoordinates as the same place to about a metre (the label keeps five decimals), so the box can show it after the person picks it.

Parameters​

  • text (string)
  • messages (MessageCatalogue)

Returns​

SearchResult | null

See also​

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