ReverseGeocodeField

Names the position held in two record fields, latSource and lngSource, as an address read from a geocoding provider. format keeps the whole name, or shortens it to its first part with street or to its first two with city. Renders nothing when either field is not a number or a numeric string, a skeleton while the lookup runs, and the coordinates to 4 decimals when the provider knows no place. Needs a provider, from provider or MapsProvider.

Loading preview…

Names the position held in two record fields, latSource and lngSource, as an address read from a geocoding provider. format keeps the whole name, or shortens it to its first part with street or to its first two with city. Renders nothing when either field is not a number or a numeric string, a skeleton while the lookup runs, and the coordinates to 4 decimals when the provider knows no place. Needs a provider, from provider or MapsProvider.

Installation

import { ReverseGeocodeField } from "@chelone/react/maps/osm";

See the maps guide for the subpaths, the optional packages and MapsProvider.

Props

PropTypeDefaultDescription
classNamestring—
format"full" | "street" | "city"—`full` is the whole name, `street` its first part and `city` its first two. Defaults to `full`.
latSourceSourceProp<TRecord>—The record property holding the latitude.
lngSourceSourceProp<TRecord>—The record property holding the longitude.
providerGeocodingProvider—Defaults to the `geocoder` of `MapsProvider`. One of the two is required.
recordTRecord—Defaults to the ambient record.