startContinuousLocation method
- TencentLocationRequest request
开始连续定位。结果通过 onLocationChanged 获取。
重复调用会抛出 TencentLocationError(错误码 alreadyStarted)。
Platforms:
- 🅰️ Android:支持
- 🍏 iOS:支持
- 🔶 Harmony:支持
Parameters:
request:连续定位请求参数。
Implementation
Future<void> startContinuousLocation(TencentLocationRequest request) =>
_after(() async {
if (_continuousStarted) {
throw const TencentLocationError(
code: TencentLocationErrorCode.alreadyStarted,
message: 'startContinuousLocation already called on this manager.',
);
}
await _platform.startContinuousLocation(_id, request);
_continuousStarted = true;
});