Package com.navmii.sdk.positioning
Class PositionManager
- java.lang.Object
-
- com.navmii.sdk.positioning.PositionManager
-
public final class PositionManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PositionManager.PositionListener
-
Constructor Summary
Constructors Constructor Description PositionManager(geolife.android.navigationsystem.NavigationSystem navigationSystem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPositionListener(PositionManager.PositionListener listener)
Adds a listener responding to events described in thePositionManager.PositionListener
interface.Position
getCurrentPosition()
MapCoordinates
getExtrapolatedPosition()
GpsStatus
getGpsStatus()
android.location.Location
getLastKnownPosition()
boolean
isGpsExtrapolationEnabled()
void
removePositionListener(PositionManager.PositionListener listener)
Removes the specified listener from the list.void
setCurrentPosition(android.location.Location location)
Sets the current position.void
setGpsExtrapolationEnabled(boolean gpsExtrapolationEnabled)
Enables/disables extrapolation of GPS position.void
startPositionUpdates()
Starts receiving position updates.void
stopPositionUpdates()
Stops receiving position updates.
-
-
-
Method Detail
-
addPositionListener
public void addPositionListener(PositionManager.PositionListener listener)
Adds a listener responding to events described in thePositionManager.PositionListener
interface. You can add multiple listeners using this method.- Parameters:
listener
- The listener.
-
removePositionListener
public void removePositionListener(PositionManager.PositionListener listener)
Removes the specified listener from the list.- Parameters:
listener
- The listener.
-
getLastKnownPosition
@Nullable public android.location.Location getLastKnownPosition()
- Returns:
- Last known position or null.
-
getCurrentPosition
@Nullable public Position getCurrentPosition()
- Returns:
- Current position or null.
-
setCurrentPosition
public void setCurrentPosition(android.location.Location location)
Sets the current position.You can use this method to provide the SDK with positions instead of using
startPositionUpdates()
.
-
getExtrapolatedPosition
@Nullable public MapCoordinates getExtrapolatedPosition()
- Returns:
- Current extrapolated position or null.
-
getGpsStatus
public GpsStatus getGpsStatus()
-
isGpsExtrapolationEnabled
public boolean isGpsExtrapolationEnabled()
- Returns:
- true if the extrapolation is enabled, false otherwise.
- See Also:
setGpsExtrapolationEnabled(boolean)
-
setGpsExtrapolationEnabled
public void setGpsExtrapolationEnabled(boolean gpsExtrapolationEnabled)
Enables/disables extrapolation of GPS position. If the extrapolation is enabled, the position cursor moves smoothly between consecutive GPS positions. If it is disabled, the cursor will jump to new positions.- Parameters:
gpsExtrapolationEnabled
- true if the extrapolation is enabled, false otherwise.
-
startPositionUpdates
public void startPositionUpdates()
Starts receiving position updates.
-
stopPositionUpdates
public void stopPositionUpdates()
Stops receiving position updates.
-
-