new PFTransport(id, longitude, latitude, status, capacity, pathfinder)
Pathfinder transport constructor. Do not call this constructor it is for the Pathfinder object to use.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | Id of the transport |
longitude |
number | The longitude of the transport |
latitude |
number | The latitude of the transport |
status |
string | The status of the transport |
capacity |
number | The capacity of the transport |
pathfinder |
Pathfinder | Pathfinder object that creates this transport |
- Source:
Methods
routeSubscribe(onSubscribeCallback, updateCallback)
Subscribe for route updates to the transport.
Parameters:
Name | Type | Description |
---|---|---|
onSubscribeCallback |
PFTransport~routeOnSubscribeCallback | The callback used when the route subscribe request is successful |
updateCallback |
PFTransport~routeUpdateCallback | The callback used when the transport's route is updated |
- Source:
routeUnsubscribe()
Unsubscribes the transport to route updates.
- Source:
subscribe(onSubscribeCallback, updateCallback)
Subscribe for updates to the transport.
Parameters:
Name | Type | Description |
---|---|---|
onSubscribeCallback |
PFTransport~subscribeOnSubscribeCallback | The callback used when the subscribe request is successful |
updateCallback |
PFTransport~subscribeUpdateCallback | The callback used when updates to the transport are received |
- Source:
unsubscribe()
Unsubscribes the transport to updates.
- Source:
Type Definitions
routeOnSubscribeCallback(id)
This callback is called after the route subscribe function receives a response.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | Id of the transport's route subscribed to |
- Source:
routeUpdateCallback(transport, route)
This callback is called when the route subscribe function receives an receives update response.
Parameters:
Name | Type | Description |
---|---|---|
transport |
PFTransport | The transport subscribed to |
route |
object | The updated route information |
- Source:
subscribeOnSubscribeCallback(id)
This callback is called after the subscribe function receives a response.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | Id of the transport subscribed to |
- Source:
subscribeUpdateCallback(transport, updatedTransport)
This callback is called when the subscribe function receives an receives update response.
Parameters:
Name | Type | Description |
---|---|---|
transport |
PFTransport | The transport subscribed to |
updatedTransport |
PFTransport | The updated transport received |
- Source: