| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
- Return value
**Return value**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<boolean> | Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| Promise<boolean> | Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| isConfirmed | boolean | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| isConfirmed | boolean | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return the operation result.|
| callback | AsyncCallback<boolean> | Yes| Callback used to return the operation result.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| type | LocationPrivacyType | Yes| Privacy statement type, for example, privacy statement displayed in the startup wizard or privacy statement displayed when enabling the location service.|
| isConfirmed | boolean | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
| isConfirmed | boolean | Yes| Callback used to return the result, which indicates whether the user agrees with the privacy statement.|
- Return value
**Return value**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<boolean> | Callback used to return the operation result.|
| Promise<boolean> | Callback used to return the operation result.|
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates under what scenario the position simulation function is enabled. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates which scene's position simulation function is enabled. If this parameter is not carried, it means that the position simulation function of all scenes is enabled. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates to disable the position simulation function of a scene. If this parameter is not carried, it means to disable the position simulation function of all scenes. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| scenario | LocationRequestScenario | No | Indicates to disable the position simulation function of a scene. If this parameter is not carried, it means to disable the position simulation function of all scenes. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr, otherwise it will return an error message |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| config | LocationMockConfig | Yes | Indicates the configuration parameters of location simulation, including the time interval of simulation location reporting and the array of simulation locations. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| config | LocationMockConfig | Yes | Indicates the configuration parameters of location simulation, including the time interval of simulation location reporting and the array of simulation locations. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**:
None
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**:
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message |
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**:
None
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
Set the configuration information of the reverse geocoding simulation function, including the corresponding relationship between location and place name. If the location information is in the configuration information during the subsequent reverse geocoding query, the corresponding place name will be returned.
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| mockInfos | Array<ReverseGeocodingMockInfo> | Yes | An array of configuration parameters indicating the inverse geocoding simulation function. The configuration parameters of the inverse geocoding simulation function include a location and a place name. |
| callback | AsyncCallback<void> | Yes | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
Set the configuration information of the reverse geocoding simulation function, including the corresponding relationship between location and place name. If the location information is in the configuration information during the subsequent reverse geocoding query, the corresponding place name will be returned.
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| mockInfos | Array<ReverseGeocodingMockInfo> | Yes | An array of configuration parameters indicating the inverse geocoding simulation function. The configuration parameters of the inverse geocoding simulation function include a location and a place name. |
**Return value**
| Name| Description|
| -------- | -------- |
| Promise<void> | It is used to receive the execution result. If the execution is successful, it will return nullptr. Otherwise, it will return an error message. |
| GEOCODE_ERROR | 103 | Failed to call the geocoding API.|
| REVERSE_GEOCODE_ERROR<sup>7+</sup> | 102 | Failed to call the reverse geocoding API.|
| LOCATOR_ERROR | 104 | Failed to obtain the location.|
| GEOCODE_ERROR<sup>7+</sup> | 103 | Failed to call the geocoding API.|
| LOCATION_SWITCH_ERROR | 105 | Failed to change the location service switch.|
| LOCATOR_ERROR<sup>7+</sup> | 104 | Failed to obtain the location.|
| LAST_KNOWN_LOCATION_ERROR | 106 | Failed to obtain the previous location.|
| LOCATION_SWITCH_ERROR<sup>7+</sup> | 105 | Failed to change the location service switch.|
| LOCATION_REQUEST_TIMEOUT_ERROR | 107 | Failed to obtain the location within the specified time.|
| LAST_KNOWN_LOCATION_ERROR<sup>7+</sup> | 106 | Failed to obtain the previous location.|
| LOCATION_REQUEST_TIMEOUT_ERROR<sup>7+</sup> | 107 | Failed to obtain the location within the specified time.|
| QUERY_COUNTRY_CODE_ERROR<sup>9+</sup> | 108 | Indicates that the country code query failed. |
## ReverseGeoCodeRequest
## ReverseGeoCodeRequest
...
@@ -1279,24 +1897,25 @@ Defines a geographic location.
...
@@ -1279,24 +1897,25 @@ Defines a geographic location.
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| latitude | number | No| Latitude information. A positive value indicates north latitude, and a negative value indicates south latitude.|
| latitude<sup>7+</sup> | number | No| Latitude information. A positive value indicates north latitude, and a negative value indicates south latitude.|
| longitude | number | No| Longitude information. A positive value indicates east longitude , and a negative value indicates west longitude .|
| longitude<sup>7+</sup> | number | No| Longitude information. A positive value indicates east longitude , and a negative value indicates west longitude .|
| locale | string | No| Language used for the location description. **zh** indicates Chinese, and **en** indicates English.|
| locale<sup>7+</sup> | string | No| Language used for the location description. **zh** indicates Chinese, and **en** indicates English.|
| placeName | string | No| Landmark of the location.|
| placeName<sup>7+</sup> | string | No| Landmark of the location.|
| countryCode | string | No| Country code.|
| countryCode<sup>7+</sup> | string | No| Country code.|
| countryName | string | No| Country name.|
| countryName<sup>7+</sup> | string | No| Country name.|
| administrativeArea | string | No| Administrative region name.|
| administrativeArea<sup>7+</sup> | string | No| Administrative region name.|
| subAdministrativeArea | string | No| Sub-administrative region name.|
| subAdministrativeArea<sup>7+</sup> | string | No| Sub-administrative region name.|
| descriptionsSize | number | No| Total number of additional descriptions.|
| descriptionsSize<sup>7+</sup> | number | No| Total number of additional descriptions.|
| isFromMock<sup>9+</sup> | Boolean | No | Indicates whether the geographical name information comes from the reverse geocoding simulation function. |
## LocationRequest
## LocationRequest
...
@@ -1434,13 +2053,68 @@ Defines a location.
...
@@ -1434,13 +2053,68 @@ Defines a location.
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| latitude | number | Yes| Latitude information. A positive value indicates north latitude, and a negative value indicates south latitude.|
| latitude<sup>7+</sup> | number | Yes| Latitude information. A positive value indicates north latitude, and a negative value indicates south latitude.|
| longitude | number | Yes| Longitude information. A positive value indicates east longitude , and a negative value indicates west longitude .|
| longitude<sup>7+</sup> | number | Yes| Longitude information. A positive value indicates east longitude , and a negative value indicates west longitude .|
| altitude | number | Yes| Location altitude, in meters.|
| altitude<sup>7+</sup> | number | Yes| Location altitude, in meters.|
| accuracy | number | Yes| Location accuracy, in meters.|
| accuracy<sup>7+</sup> | number | Yes| Location accuracy, in meters.|
| speed | number | Yes| Speed, in m/s.|
| speed<sup>7+</sup> | number | Yes| Speed, in m/s.|
| timeStamp | number | Yes| Location timestamp in the UTC format.|
| timeStamp<sup>7+</sup> | number | Yes| Location timestamp in the UTC format.|
| direction | number | Yes| Direction information.|
| direction<sup>7+</sup> | number | Yes| Direction information.|
| timeSinceBoot | number | Yes| Location timestamp since boot.|
| timeSinceBoot<sup>7+</sup> | number | Yes| Location timestamp since boot.|
The configuration parameters of the location simulation function include the time interval of the simulation position report and the array of simulation locations.