LocationSettingsOhos class
Location information request parameters. 表示位置信息请求参数。 参考链接:https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#locationrequest
- Inheritance
-
- Object
- LocationSettings
- LocationSettingsOhos
Constructors
- LocationSettingsOhos.new({LocationRequestPriority? priority, LocationRequestScenario? scenario, int? timeInterval, int? distanceInterval, int? maxAccuracy})
-
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
- distanceInterval → int?
-
Indicates the distance interval for reporting location information, in meters. The default value is 0, and the value range is greater than or equal to 0. When it is 0, there is no limit on the reporting distance interval for location.
表示上报位置信息的距离间隔。单位是米,默认值为0,取值范围为大于等于0。等于0时对位置上报距离间隔无限制。
final
- 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。
当scenario为NAVIGATION/TRAJECTORY_TRACKING/CAR_HAILING或者priority为ACCURACY时建议设置maxAccuracy为大于10的值。
当scenario为DAILY_LIFE_SERVICE/NO_POWER或者priority为LOW_POWER/FIRST_FIX时建议设置maxAccuracy为大于100的值。
final
- priority → LocationRequestPriority?
-
Indicates priority information.
表示优先级信息。
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scenario → LocationRequestScenario?
-
Indicates scenario information.
表示场景信息
final
- timeInterval → int?
-
Indicates the time interval for reporting location information, in seconds. The default value is 1, and the value range is greater than or equal to 0. When it is 0, there is no limit on the reporting time interval for location.
表示上报位置信息的时间间隔,单位是秒。默认值为1,取值范围为大于等于0。等于0时对位置上报时间间隔无限制。
final
- timeLimit → Duration?
-
The timeLimit parameter allows you to specify a timeout interval (by
default no time limit is configured).
finalinherited
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