java.lang.Object | |
↳ | com.steerpath.sdk.location.GeoJsonPointLocationProvider |
Publishes Locations from given FeatureCollection. FeatureCollection must contain Points. Useful for testing.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeoJsonPointLocationProvider(FeatureCollection featureCollection, int intervalInMillis, boolean isLooping)
Constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Location |
getLastLocation()
Retrieve the last location that the FusedLocationProvider is aware of.
| ||||||||||
String |
getName()
Returns the name of this LocationProvider.
| ||||||||||
Location |
getUserLocation()
Retrieve the current location that the FusedLocationProvider is aware of.
| ||||||||||
boolean |
hasUserLocation()
Check if Location of the user is currently known.
| ||||||||||
void |
removeLocationUpdates(LocationListener listener)
Stop listening location updates.
| ||||||||||
void |
requestLocationUpdates(LocationListener listener)
Start receiving location updates on the listener.
| ||||||||||
void |
requestLocationUpdates(LocationRequest request, LocationListener listener)
Start receiving location updates on the listener.
| ||||||||||
boolean |
requiresBluetooth()
Returns true if this LocationProvider depends on Bluetooth.
| ||||||||||
boolean |
requiresGps()
Returns true if this LocationProvider depends on GPS (Location services enabled).
| ||||||||||
static FeatureCollection |
toFeatureCollection(List<Location> locations)
Creates FeatureCollection from list of Locations.
| ||||||||||
static FeatureCollection |
toFeatureCollection(String geoJson)
Creates FeatureCollection from geojson String.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructor.
intervalInMillis | update interval |
---|---|
isLooping | true if should start from the beginning after reaching the final Feature. |
Retrieve the last location that the FusedLocationProvider is aware of. Returns non-null object even if location has actually been lost.
This method depends on requestLocationUpdates(LocationListener)
.
If no listener is registered, positioning engine is actually stopped and getUserLocation() returns null.
Returns the name of this LocationProvider.
Retrieve the current location that the FusedLocationProvider is aware of. Returns null if location has actually been lost.
This method depends on requestLocationUpdates(LocationListener)
.
If no listener is registered, positioning engine is actually stopped and getUserLocation() returns null.
Check if Location of the user is currently known.
Start receiving location updates on the listener. This will use the default settings for a
location request.
When app is done listening location updates, removeLocationUpdates(LocationListener)
should be called to avoid memory leaks. Positioning thread stays alive until pairing removeLocationUpdates() is called.
Ideally, requestLocationUpdates() - removeLocationUpdates() should follow Activity/Fragment onStart() - onStop() lifecycle.
If location updates are not removed, positioning stays alive when app is backgrounded potentially draining the battery.
listener | the listener which will receive the location updates. |
---|
Start receiving location updates on the listener. This will automatically enable the required
location providers if possible.
When app is done listening location updates, removeLocationUpdates(LocationListener)
should be called to avoid memory leaks. Positioning thread stays alive until pairing removeLocationUpdates() is called.
Ideally, requestLocationUpdates() - removeLocationUpdates() should follow Activity/Fragment onStart() - onStop() lifecycle.
If location updates are not removed, positioning stays alive when app is backgrounded potentially draining the battery.
request | the update request specifying which providers to enable |
---|---|
listener | the listener which will receive the location updates. |
Returns true if this LocationProvider depends on Bluetooth.
Returns true if this LocationProvider depends on GPS (Location services enabled).
Creates FeatureCollection from list of Locations.
Creates FeatureCollection from geojson String. Sample: {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[24.8124109,60.220988]},"properties":{"layerIndex":2,"buildingRef":"431"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.8124427,60.22095]},"properties":{"layerIndex":2,"buildingRef":"431"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[24.8124234,60.2209286]},"properties":{"layerIndex":2,"buildingRef":"431"}}]}