transformLocation(params: Object)
Requires:
MapKit≥3.2.2@ray-js/ray≥1.4.38
Platforms:
iOSAndroid
Description
Convert latitude/longitude or address
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
type | string | Yes | wgs84 returns GPS coordinates; gcj02 returns coordinates usable with openLocation |
latitude | number | Yes | Latitude, range -90 to 90; negative values indicate south |
longitude | number | Yes | Longitude, range -180 to 180; negative values indicate west |
complete | () => void | No | Completion callback (executed on both success and failure) |
success | (params: Object) => void | No | Callback on successful API call |
fail | (params: Object) => void | No | Failure callback |
success callback parameters
| Property | Type | Description | MapKit Since |
|---|---|---|---|
latitude | number | Latitude, range -90 to 90; negative values indicate south | - |
longitude | number | Longitude, range -180 to 180; negative values indicate west | - |
cityName | string | City name | - |
streetName | string | Street name | - |
address | string | Location name. Historically, iOS returned an Array; use the formatAddress field instead | - |
formatAddress | string | Formatted address | v3.6.0 |
countryCode | string | Country code | - |
postalCode | string | Postal code | - |
countryName | string | Country name | - |
province | string | Province name | - |
district | string | District/county name (second-level administrative region) | - |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None