CurrentLocationSettingsOhos class
Current location information request parameters. 表示当前位置信息请求参数。 参考链接:https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#currentlocationrequest
- Inheritance
-
- Object
- LocationSettings
- CurrentLocationSettingsOhos
Constructors
- CurrentLocationSettingsOhos.new({LocationRequestPriority? priority, LocationRequestScenario? scenario, int? maxAccuracy, int? timeoutMs})
-
const
Properties
- accuracy → LocationAccuracy
-
Defines the desired accuracy that should be used to determine the
location data.
finalinherited
- distanceFilter → int
-
The minimum distance (measured in meters) a device must move
horizontally before an update event is generated.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxAccuracy → int?
-
Indicates accuracy information, in meters.
Only effective in accurate location function scenarios (when both ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.LOCATION permissions are granted), and meaningless in fuzzy location function scenarios (when only ohos.permission.APPROXIMATELY_LOCATION permission is granted).
The default value is 0, and the value range is greater than or equal to 0.
When the scenario is NAVIGATION/TRAJECTORY_TRACKING/CAR_HAILING or the priority is ACCURACY, it is recommended to set maxAccuracy to a value greater than 10.
When the scenario is DAILY_LIFE_SERVICE/NO_POWER or the priority is LOW_POWER/FIRST_FIX, it is recommended to set maxAccuracy to a value greater than 100.
表示精度信息,单位是米。
仅在精确位置功能场景(同时授予了ohos.permission.APPROXIMATELY_LOCATION和ohos.permission.LOCATION 权限)下有效,模糊位置功能生效场景(仅授予了ohos.permission.APPROXIMATELY_LOCATION 权限)下该字段无意义。
默认值为0,取值范围为大于等于0。
当场景为NAVIGATION/TRAJECTORY_TRACKING/CAR_HAILING或者优先级为ACCURACY时,建议将maxAccuracy设置为大于10的值。
当场景为DAILY_LIFE_SERVICE/NO_POWER或者优先级为LOW_POWER/FIRST_FIX时,建议将maxAccuracy设置为大于100的值。
final
- priority → LocationRequestPriority?
-
Indicates priority information. When the scenario is UNSET, the priority parameter takes effect; otherwise, the priority parameter does not take effect.
When both scenario and priority are UNSET, location requests cannot be initiated.
See the definition of LocationRequestPriority for the value range.
表示优先级信息。当场景取值为UNSET时,优先级参数生效;否则,优先级参数不生效。
当场景和优先级均取值为UNSET时,无法发起定位请求。
请参阅LocationRequestPriority的定义获取取值范围。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scenario → LocationRequestScenario?
-
Indicates scenario information. When the scenario is UNSET, the priority parameter takes effect; otherwise, the priority parameter does not take effect.
When both scenario and priority are UNSET, location requests cannot be initiated.
See the definition of LocationRequestScenario for the value range.
表示场景信息。当场景取值为UNSET时,优先级参数生效;否则,优先级参数不生效。
当场景和优先级均取值为UNSET时,无法发起定位请求。
请参阅LocationRequestScenario的定义获取取值范围。
final
- timeLimit → Duration?
-
The timeLimit parameter allows you to specify a timeout interval (by
default no time limit is configured).
finalinherited
- timeoutMs → int?
-
Indicates the timeout duration, in milliseconds, with a minimum value of 1000 milliseconds. The value range is greater than or equal to 1000.
表示超时时间,单位是毫秒,最小为1000毫秒。取值范围为大于等于1000。
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes the
PlatformSpecificSettings
to a map messageinherited -
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited