0.0.3 • Published 8 years ago

routing-arcgis v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

RountingArcGIS

A leightweight promises based node.js wrapper for the ArcGIS Online Routing Services.

Installation

Installing using npm:

npm i routing-arcgis --save

Usage

Initialization

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

  routing.route('13.428426,52.504102','13.437481,52.493651'],{})
  .then(function(response){
    console.log(response);
  })
  .catch(function(error){
    console.log(error);
  });

Optional parameters:

Response

All methods return a promise.