Rail
const
Rail:object
Rail Service
Type declaration
getStations()
getStations: (
options
:RailStationRequest
) =>Cancelable
The API for locating rail freight station(s) by SPLC code in the database. Up to one station in an array will be returned in this release.
Example
const railStationLocation = TrimbleMaps.Rail.getStations({
splc: '344770000',
callback: function(error, response) {
if (error === null) {
console.log('success', response);
} else {
console.log('failure', error)
}
}
});
Parameters
Parameter | Type |
---|---|
options
| RailStationRequest
|
Returns
postRoutePath()
postRoutePath: (
options
:RailRouteRequest
) =>Cancelable
This API will generate the Lat/Lon route path.
Example
const request = TrimbleMaps.Rail.postRoutePath({
stops: [{
format: TrimbleMaps.Common.RailStationFormat.STATION_STATE,
name: 'Denver CO',
railroad: 'UP'
},
{
format: TrimbleMaps.Common.RailStationFormat.STATION_STATE,
name: 'Oakland CA',
railroad: 'UP'
}],
options: {
routingPreference: TrimbleMaps.Common.RailRoutePreference.PRACTICAL,
terminalSwitching: true,
amtrakRoutes: true,
intermodalOnlyStations: true,
distUnit: TrimbleMaps.Common.RailDistanceUnit.MILES
},
callback: function(error, response) {
if (error === null) {
console.log('success', response);
} else {
console.log('failure', error)
}
}
});
Parameters
Parameter | Type |
---|---|
options
| RailRouteRequest
|