Members
(constant) AIS_API_URL
URL used by the API; this might change if the version changes or at any time, since it's experimental
(constant) globals
Exported global socket, mainly for testing purposes
Methods
AIStrack(apiKey, shipName, boundingBoxes, callback)
Track a specific ship in a specific zone. The ship is referred to by name; the zone is by default a single bounding box.
Please check the README and documentation for message formats.
Parameters:
Name | Type | Description |
---|---|---|
apiKey |
String | AISStream API key |
shipName |
String | The ship name in ALL CAPS, which is how they are stored |
boundingBoxes |
Array | This is an array of bounding boxes, that is, a set of two corners where latitude goes first, longitude next. You can check out these in your favorite map application. Ships only within those bounding boxes will be tracked. By default, the bounding box includes all latitudes and longitudes |
callback |
function | Function called every time an AIS message for that ship is found. This function takes the message as an argument. |
AIStrackAll(apiKey, boundingBoxes, callback)
Track all ships in a specific zone. The zone is by default a single bounding box.
Parameters:
Name | Type | Description |
---|---|---|
apiKey |
String | AISStream API key |
boundingBoxes |
Array | This is an array of bounding boxes, that is, a set of two corners where latitude goes first, longitude next. You can check out these in your favorite map application. Ships only within those bounding boxes will be tracked. By default, the bounding box includes all latitudes and longitudes |
callback |
function | Function called every time an AIS message for that ship is found. This function takes the message as an argument. |