AMapLocation class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
addGeoFenceArea(String keyword, String customId)
→ Future<void>
-
创建行政区划围栏
-
addGeoFenceDiy(LatLng point, String radius, String customId)
→ Future<void>
-
创建自定义围栏
-
addGeoFenceKeyword(String keyword, String poiType, String city, String customId)
→ Future<void>
-
根据关键字创建围栏
-
addGeoFencePoint(String keyword, String poiType, LatLng point, double aroundRadius, String customId)
→ Future<void>
-
根据周边POI创建围栏
-
addGeoFencePolygon(List<LatLng> points, String customId)
→ Future<void>
-
创建自定义围栏
-
disableBackground()
→ Future<void>
-
关闭后台服务
-
enableBackground({required String title, required String label, required String assetName, bool? vibrate})
→ Future<void>
-
启动后台服务
-
fetch({AMapLocationMode androidMode = AMapLocationMode.HIGHT_ACCURACY, AMapLocationAccuracy iosAccuracy = AMapLocationAccuracy.THREE_KILOMETERS})
→ Future<Location>
-
单次定位
-
setApiKey(String androidKey, String iosKey)
→ Future<void>
-
设置Android和iOS的apiKey,建议在Widget初始化时设置
apiKey的申请请参考高德开放平台官网
Android端: https://lbs.amap.com/api/android-location-sdk/guide/create-project/get-key
iOS端: https://lbs.amap.com/api/ios-location-sdk/guide/create-project/get-key
androidKey
Android平台的key
iosKey
ios平台的key
-
start({AMapLocationListen? listen, AMapLocationMode mode = AMapLocationMode.HIGHT_ACCURACY, int? time, AMapLocationAccuracy accuracy = AMapLocationAccuracy.THREE_KILOMETERS})
→ Future<Future<Null> Function()>
-
持续定位
-
updatePrivacyAgree(bool hasAgree)
→ Future<void>
-
确保调用SDK任何接口前先调用更新隐私合规updatePrivacyShow、updatePrivacyAgree两个接口并且参数值都为true,若未正确设置有崩溃风险
-
updatePrivacyShow(bool hasContains, bool hasShow)
→ Future<void>
-
确保调用SDK任何接口前先调用更新隐私合规updatePrivacyShow、updatePrivacyAgree两个接口并且参数值都为true,若未正确设置有崩溃风险