https://github.com/stephangeorg/routing-arcgis
Lightweight node.js wrapper for the ESRI ArcGIS Online Routing Services
https://github.com/stephangeorg/routing-arcgis
Last synced: 9 months ago
JSON representation
Lightweight node.js wrapper for the ESRI ArcGIS Online Routing Services
- Host: GitHub
- URL: https://github.com/stephangeorg/routing-arcgis
- Owner: StephanGeorg
- Created: 2016-09-09T14:07:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-14T15:17:14.000Z (almost 10 years ago)
- Last Synced: 2025-06-06T06:20:05.488Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RountingArcGIS
A leightweight promises based node.js wrapper for the [ArcGIS Online Routing Services](https://developers.arcgis.com/features/directions/).
## Installation
Installing using npm:
npm i routing-arcgis --save
## Usage ##
### Initialization ###
```javascript
var RoutingArcGIS = require('routing-arcgis'),
routing = new RoutingArcGIS({
client_id: 'YOUR CLIENT ID',
client_secret: 'YOUR CLIENT SECRET'
});
```
The constructor function also takes an optional configuration object:
* client_id: id for OAuth
* client_secret: secret for OAuth
* endpoint: custom ArcGIS endpoint
### Route ###
```javascript
routing.route('13.428426,52.504102','13.437481,52.493651'],{})
.then(function(response){
console.log(response);
})
.catch(function(error){
console.log(error);
});
```
Optional parameters:
* you can pass all [request parameters](http://resources.arcgis.com/en/help/arcgis-rest-api/#/Route_service_with_synchronous_execution/02r300000036000000/)
### Response ###
All methods return a promise.