This pull-request adds LocationIndicator to display current user location in the org.envirocar.map module, in a provider independent manner. Several new classes have been introduced:
The LocationIndicator may be used to display the current location on the map. It internally creates an instance of LocationManager from Android API, to listen to the location updates from the device.
The LocationIndicator inherits from another class called BaseLocationIndicator, which can be used to display the supplied location on the map, through the notifyLocation method. The LocationManager inside the LocationIndicator requests the location updates from the device, causing onLocationChanged callback to be invoked, which internally calls notifyLocation from BaseLocationIndicator to draw the current location. Inside the enviroCar application, it makes more sense to use BaseLocationIndicator directly, since location updates are already sent through the event bus & creating another LocationManager will be redundant.
This pull-request adds
LocationIndicator
to display current user location in theorg.envirocar.map
module, in a provider independent manner. Several new classes have been introduced:BaseLocationIndicator
LocationIndicator
LocationIndicatorCameraMode
A video for reference is attached below:
https://github.com/user-attachments/assets/81c0a474-8a64-400c-b287-2238218f9f5d
Implementation
The
LocationIndicator
may be used to display the current location on the map. It internally creates an instance ofLocationManager
from Android API, to listen to the location updates from the device.The
LocationIndicator
inherits from another class calledBaseLocationIndicator
, which can be used to display the supplied location on the map, through thenotifyLocation
method. TheLocationManager
inside theLocationIndicator
requests the location updates from the device, causingonLocationChanged
callback to be invoked, which internally callsnotifyLocation
fromBaseLocationIndicator
to draw the current location. Inside the enviroCar application, it makes more sense to useBaseLocationIndicator
directly, since location updates are already sent through the event bus & creating anotherLocationManager
will be redundant.