startLocationUpdating method

Future<void> startLocationUpdating({
  1. bool enableStopFollow = false,
  2. bool disableUserMarkerRotation = false,
  3. Anchor anchor = Anchor.center,
  4. bool useDirectionMarker = false,
})

startLocationUpdating

Starts receiving the user’s current location.

use this method to start only receiving the user location without controlling the map which you can do that manually

Implementation

Future<void> startLocationUpdating({
  bool enableStopFollow = false,
  bool disableUserMarkerRotation = false,
  Anchor anchor = Anchor.center,
  bool useDirectionMarker = false,
}) async {
  // On iOS/macOS the authorization request is handled by the native
  // implementation when tracking starts; on Android it must be requested
  // from Dart through permission_handler first.
  if (kIsWeb ||
      defaultTargetPlatform == TargetPlatform.iOS ||
      defaultTargetPlatform == TargetPlatform.macOS) {
    await osmBaseController.startLocationUpdating();
    return;
  }
  final hasPermission = await _requestLocationPermission();
  if (!hasPermission) {
    return;
  }

  await osmBaseController.startLocationUpdating();
}