GeolocatorOhos class

An implementation of GeolocatorPlatform that uses method channels.

Inheritance
Mixed-in types

Constructors

GeolocatorOhos.new()

Properties

forcedLocationManager bool
On Android devices you can set forcedLocationManager to true to force the plugin to use the LocationManager to determine the position instead of the FusedLocationProviderClient. On iOS this is ignored.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bearingBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) double
Calculates the initial bearing between two points
inherited
checkPermission({List<String> permissions = GeolocatorOhos.approximatelyPermission}) Future<LocationPermission>
Returns a Future indicating if the user allows the App to access the device's location.
inherited
distanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) double
Calculates the distance between the supplied coordinates in meters.
inherited
getAddressesFromLocation(ReverseGeoCodeRequest request) Future<List<GeoAddress>>
Obtain address info from location. 调用逆地理编码服务,将坐标转换为地理描述。 See also: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocation
inherited
getAddressesFromLocationName(GeoCodeRequest request) Future<List<GeoAddress>>
Obtain latitude and longitude info from location address. 调用地理编码服务,将地理描述转换为具体坐标 https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocationname
inherited
getCountryCode() Future<CountryCode?>
Obtain the current country code. 查询当前的国家码 See also: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#geolocationmanagergetcountrycode
inherited
getCurrentPosition({LocationSettings? locationSettings, String? requestId}) Future<Position>
Returns the current position.
inherited
getLastKnownPosition({bool forceLocationManager = false}) Future<Position?>
Returns the last known position stored on the users device.
inherited
getLocationAccuracy() Future<LocationAccuracyStatus>
Returns a Future containing a LocationAccuracyStatus.
inherited
getPositionStream({LocationSettings? locationSettings}) Stream<Position>
Fires whenever the location changes inside the bounds of the desiredAccuracy.
inherited
getServiceStatusStream() Stream<ServiceStatus>
Fires when the location Service is manually disabled or enabled.
inherited
isGeocoderAvailable() Future<bool>
Obtain current location switch status. 判断地理编码与逆地理编码服务状态。 See also: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-location-kit/js-apis-geoLocationManager.md#geolocationmanagerisgeocoderavailable
inherited
isLocationServiceEnabled() Future<bool>
Returns a Future containing a bool value indicating whether location services are enabled on the device.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAppSettings() Future<bool>
Opens the App settings page.
inherited
openLocationSettings() Future<bool>
Opens the location settings page.
inherited
requestPermission({List<String> permissions = GeolocatorOhos.approximatelyPermission}) Future<LocationPermission>
Request permission to access the location of the device.
inherited
requestTemporaryFullAccuracy({required String purposeKey}) Future<LocationAccuracyStatus>
Asks the user for Temporary Precise location access (iOS 14 or above).
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

registerWith() → void
Registers this class as the default instance of GeolocatorPlatform.

Constants

accuracyPermissions → const List<String>
Obtained precise location with accuracy at the meter level. 获取到精准位置,精准度在米级别。 See also: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/device/location/location-guidelines.md#%E7%94%B3%E8%AF%B7%E4%BD%8D%E7%BD%AE%E6%9D%83%E9%99%90%E5%BC%80%E5%8F%91%E6%8C%87%E5%AF%BC
approximatelyPermission → const List<String>
Obtained approximate location with an accuracy of 5 kilometers. 获取到模糊位置,精确度为5公里。 See also: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/device/location/location-guidelines.md#%E7%94%B3%E8%AF%B7%E4%BD%8D%E7%BD%AE%E6%9D%83%E9%99%90%E5%BC%80%E5%8F%91%E6%8C%87%E5%AF%BC
inBackgroundPermission → const List<String>
Allow background running. When the user clicks on the popup to grant foreground location permission, the application informs the user through popups, prompts, or other means to go to the settings interface to grant background location permission. The user should select "Allow all the time" for the application to access location information permission in the settings interface, completing the manual granting process. 允许后台运行 当用户点击弹窗授予前台位置权限后,应用通过弹窗、提示窗等形式告知用户前往设置界面授予后台位置权限。 用户在设置界面中的选择“始终允许”应用访问位置信息权限,完成手动授予。 See also: https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/device/location/location-guidelines.md#%E7%94%B3%E8%AF%B7%E4%BD%8D%E7%BD%AE%E6%9D%83%E9%99%90%E5%BC%80%E5%8F%91%E6%8C%87%E5%AF%BC