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.
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
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — | |
| format | "full" | "street" | "city" | — | `full` is the whole name, `street` its first part and `city` its first two. Defaults to `full`. |
| latSource | SourceProp<TRecord> | — | The record property holding the latitude. |
| lngSource | SourceProp<TRecord> | — | The record property holding the longitude. |
| provider | GeocodingProvider | — | Defaults to the `geocoder` of `MapsProvider`. One of the two is required. |
| record | TRecord | — | Defaults to the ambient record. |