new IWCoordinateHistory(options)
Creates a new coordinate history
Parameters:
Name | Type | Description |
---|---|---|
options |
object | an object with properties as defined above |
Methods
-
add(coordinate)
-
Adds another coordinate to the list, removing the oldest coordinate if the maximal length is exceeded. If the new coordinate is very close to the last one this will be replaced to correct the position.
Parameters:
Name Type Description coordinate
the new position Returns:
- Type
- void
-
calculateCourse()
-
Calculates the course in degrees.
Returns:
- Type
- Number
-
calculateSpeed(numLocations)
-
Returns the average speed for the last numLocations GPS locations in meters per second.
Parameters:
Name Type Description numLocations
Number the number of GPS locations to take into account Returns:
speed in m/s- Type
- Number
-
getLatest()
-
Returns the latest coordinate, or null if there are no coordinates yet.
Returns:
- Type
- IWCoordinate