Loading...
Searching...
No Matches
LocationManager Class Referenceabstract

Class is used for downloading and working with Location. More...

Inherits Finalizable.

Public Member Functions

void addLocationListener (LocationListener listener)
 Method is used to add LocationListener element which will notify about newly downloaded and set location.
 
void removeLocationListener (LocationListener listener)
 Method is used for removing previously added LocationListener class element.
 
void setLocationId (int locationId)
 Method is used for setting current location, which will be downloaded from server or from storage, if it was downloaded before. Result will be handled by LocationListener.
 
int getLocationId ()
 Method returns current location unique identifier.
 
void setLocationUpdateInterval (int interval)
 Method is used to change interval in seconds check for new version from server Default: 300s.
 

Detailed Description

Class is used for downloading and working with Location.

Referenced from NavigineSdk.

Definition at line 19 of file location_manager.dart.

Member Function Documentation

◆ addLocationListener()

void LocationManager.addLocationListener ( LocationListener listener)

Method is used to add LocationListener element which will notify about newly downloaded and set location.

Note
Do not forget to remove listener if it is no longer needed!
Parameters
listenerСorresponding LocationListener class.

Dart code snippet:

// Add location listener
_locationManager!.addLocationListener(this);

◆ getLocationId()

int LocationManager.getLocationId ( )

Method returns current location unique identifier.

Returns
current location unique identifier

Dart code snippet:

// Get current location ID
int currentLocationId = _locationManager!.getLocationId();
print('Current location ID: $currentLocationId');

◆ removeLocationListener()

void LocationManager.removeLocationListener ( LocationListener listener)

Method is used for removing previously added LocationListener class element.

Parameters
listenerСorresponding LocationListener class to remove.

Dart code snippet:

// Remove location listener
_locationManager!.removeLocationListener(this);

◆ setLocationId()

void LocationManager.setLocationId ( int locationId)

Method is used for setting current location, which will be downloaded from server or from storage, if it was downloaded before. Result will be handled by LocationListener.

Parameters
locationIdlocation id from CMS

Dart code snippet:

// Set location ID to load
_locationManager!.setLocationId(12345);

◆ setLocationUpdateInterval()

void LocationManager.setLocationUpdateInterval ( int interval)

Method is used to change interval in seconds check for new version from server Default: 300s.

Parameters
intervalupdate interval in seconds

Dart code snippet:

// Set location update interval (in seconds)
_locationManager!.setLocationUpdateInterval(600); // 10 minutes

The documentation for this class was generated from the following file: