The GPS class allows hardware configuration, fake GPS, Log the current Signal or Record a track for FollowMeRoute
More...
|
| static ApiError | addActionToLog (final FmrActionType eventType, final String eventString) |
| |
| static ApiError | addEventToLog (final int eventType, final String eventString) |
| |
| static void | addGpsListener (GpsListener listener) |
| |
| static ApiError | continueLogging (final int loggerid) |
| |
| static native boolean | isUsingLogForSimulation () |
| |
| static ApiError | pauseLogging (final int loggerid) |
| |
| static void | removeAllGpsListeners () |
| |
| static void | removeGpsListener (GpsListener listener) |
| |
| static ApiError | setGPSSimulationSpeed (final double simulationSpeed) |
| |
| static ApiError | setOdometry (final double meters, final boolean relativeToLastCall, final boolean setNewPosition) |
| |
| static ApiError | setPosition (final double latitude, final double longitude, final double altitude, final double speedMetersPerSecond, final double course, final double horizontalAccuracy, final long gpstime) |
| |
| static int | startLogging (final String fileName, final GpsFileType type) |
| |
| static ApiError | stopLogging (final int loggerid) |
| |
| static ApiError | useLogForSimulation (final String filename) |
| |
A GPS input is important regarding all location based functions as Navigation, Poi search and map updates.
With this class the user can configure the GPS input to the MapTrip SDK either by a Hardware GPS receiver or by reading GPS data from a gps log respectively nmea file. Further it allows to record incoming gps positions and generate a gps-track from it and configure the behavior of the mapviewer on new gps updates
◆ addActionToLog()
Adds an action at the current position to the currently recorded NMEA GPS Log. These actions will be triggered later at the same position, if you use this log for a FollowMeRoute. The semantics of an action during a followMe navigation is described in FollowMeRoute
- Parameters
-
| eventType | - User specific numeric Value. |
| eventString | - User specific string. |
- Returns
- Errorcode
◆ addEventToLog()
| static ApiError addEventToLog |
( |
final int |
eventType, |
|
|
final String |
eventString |
|
) |
| |
|
static |
Adds an event at the current position to the currently recorded NMEA GPS Log. These events will be triggered later at the same position, if you use this log for a follow me route.
- Parameters
-
| eventType | - User specific numeric Value. |
| eventString | - User specific string. |
- Returns
- Errorcode
◆ addGpsListener()
◆ continueLogging()
| static ApiError continueLogging |
( |
final int |
loggerid | ) |
|
|
static |
Continue the recording of GPS positions of a specific recorder.
- Parameters
-
- Returns
- Errorcode
◆ isUsingLogForSimulation()
| static native boolean isUsingLogForSimulation |
( |
| ) |
|
|
static |
- Returns
- true if a logfile is playing
◆ pauseLogging()
| static ApiError pauseLogging |
( |
final int |
loggerid | ) |
|
|
static |
Pause the recording of GPS positions of a specific recorder.
- Parameters
-
- Returns
- Errorcode
◆ removeAllGpsListeners()
| static void removeAllGpsListeners |
( |
| ) |
|
|
static |
◆ removeGpsListener()
◆ setGPSSimulationSpeed()
| static ApiError setGPSSimulationSpeed |
( |
final double |
simulationSpeed | ) |
|
|
static |
Set speed of gps simulation as a factor of "real time" (1.0 == real time)
- Parameters
-
| simulationSpeed | - factor applied to the logged GPS signals |
- Returns
- Errorcode
◆ setOdometry()
| static ApiError setOdometry |
( |
final double |
meters, |
|
|
final boolean |
relativeToLastCall, |
|
|
final boolean |
setNewPosition |
|
) |
| |
|
static |
Sets the current odometry of a vehicle. It is set in absolute meters or in relative meters, traveled since the previous call. If setNewPosition is true and if there is a current route guidance, a new position is generated by the odometry.
- Returns
- Errorcode
◆ setPosition()
| static ApiError setPosition |
( |
final double |
latitude, |
|
|
final double |
longitude, |
|
|
final double |
altitude, |
|
|
final double |
speedMetersPerSecond, |
|
|
final double |
course, |
|
|
final double |
horizontalAccuracy, |
|
|
final long |
gpstime |
|
) |
| |
|
static |
Sets a GPS position manually
- Parameters
-
| latitude | - in degree |
| longitude | - in degree |
| altitude | - in meters |
| speedMetersPerSecond | - in m/s |
| course | - 0-360 degree; 0 = north. This value may be corrected by by the location processing of the SDK. |
| horizontalAccuracy | - Is the horizontal error in meters |
| gpstime | - Time in gpstime standard (in seconds since the start of the Unix epoch 00:00:00 January 1, 1970 UTC). |
- Returns
- Errorcode
◆ startLogging()
| static int startLogging |
( |
final String |
fileName, |
|
|
final GpsFileType |
type |
|
) |
| |
|
static |
Records the incoming GPS positions. They can be saved as
- A Shape for displaying them in the map (after the recording has finished)
- A gpx file for a later processing with external tools or for a follow me route
- A NMEA file for a later GPS simulation
You can write different formats simultaneously. Therefore you may not add an extension at the fileName. This will be done by the SDK itself.
- Parameters
-
| fileName | - Contains the absolute path without the extension of the file(s). |
| type | - see GpsFileType |
- Returns
- If > 0 unique identifier of the GPS logger. You can use this identifier to stop the GPS logging, see Gps.stopLogging().
- If < 0 error code.
◆ stopLogging()
| static ApiError stopLogging |
( |
final int |
loggerid | ) |
|
|
static |
Stops the recording of GPS positions of a specific recorder.
- Parameters
-
- Returns
- Errorcode
◆ useLogForSimulation()
| static ApiError useLogForSimulation |
( |
final String |
filename | ) |
|
|
static |
If called with a valid logfile, the real GPS receiver will be ignored and specified GPS-Log will be used as location input
To deactivate the log-file based GPS, the SDK has to be uninitialized and initialized again.
- Parameters
-
| filename | - nmea-file pass an absolute path including file name resp. extension |
- Returns
- Errorcode
The documentation for this class was generated from the following file: