Location
Container Properties
The first layer of all component configurations supports Container Properties.
Component Properties (componentsProps)
| Name | Type | Default | 是否支持 Variable Pattern | Description |
|---|---|---|---|---|
| className | string | ✔️ | The className of the component. | |
| buttonText | string | Text for the locate button. Uses the default i18n text if not specified. | ||
| enableHighAccuracy | bool | true | Whether to use high-accuracy positioning. | |
| timeout | number | 10000 | Positioning timeout in milliseconds. | |
| maximumAge | number | 0 | Maximum cache age in milliseconds. 0 means no caching. | |
| reverseGeocodeUrl | string | Reverse geocoding API URL. After successful positioning, a POST request with { latitude, longitude } will be sent to this URL. Expected response: { address: "address string" } or a plain address string. If not configured, only coordinates are displayed. |
All other componentsProps will be passed to the component's root element (div).
Value Format
The component value is stored as a JSON string with the following structure:
{
"latitude": 39.9042,
"longitude": 116.4074,
"address": "Some address..."
}
The address field is only present when reverseGeocodeUrl is configured and the address is successfully retrieved.
JS API
The interface obtained through formApi.getFieldApi() is as follows:
| Name | Type | Description |
|---|---|---|
| node | HTML Element | The root DOM element of the component. |