ArcNode
Node module to work with ArcGIS Online and ArcGIS Server.
How to install it
Just write this in your prompt:
npm install --save arc-node
And you are ready to go, just instantiate the object like this:
var ArcNode = service = <config object>;
Check here the description of the <config object> parameter.
Documentation
When you have instantiate the service you will have available methods to:
- Get a new token
- Check if a feature service exists
- Create an empty feature service
- Add layers to a feature service
- Add features to a layer
- Find address candidates
- Export a webmap
Get a new token
Description: Gets a new valid token.
Return: a deferred object. When it's resolved: it returns the ArcGIS REST API response.
Example: See full example
Name | getToken(options) | ||||||||||||||||
Options (JSON object) |
|
How to use it
//Get a token valid for 60 minutesservice;
Check if a feature service exists
Description: Check if a feature service with a given name exists.
Return: a deferred object. When it's resolved: it returns the ArcGIS REST API response.
Example: See full example
Name | checkIfFSExists(options?) | ||||||||
Options (JSON object) |
|
How to use it
service;
Create an empty feature service
Description: it creates a feature service with no layers in it
Return: a deferred object. When it's resolved: it returns the ArcGIS REST API response.
Example: See full example
Name | createFeatureService(options?) | ||||||||
Options (JSON object) |
|
How to use it
service;
Add layers to a feature service
Description: it add layers to a service based on the definition of each layer.
Return: a deferred object. When it's resolved: it returns the ArcGIS API REST response.
Example: See full example
Name | addLayersToFS(options?) | ||||||||||||
Options (JSON object) |
|
How to use it
service;
Add features to a layer
Description: add features to a feature layer
Return: a deferred object. When it's resolved: it return de ArcGIS API REST response.
Example: See full example
Name | addFeatures(options?) | ||||||||||||||||
Options (JSON object) |
|
How to use it
var data = "attributes": "name": "Feature name" "geometry": "x": -3 "y": 40 "spatialReference": "wkid" : 4326 // Add as many features as you want; service;
Find address candidates
Description: find xy locations for an address
Return: a deferred object. When it's resolved: it return de ArcGIS API REST response.
Example: See full example
Name | findAddressCandidates(options?) | ||||||||
Options (JSON object) |
|
How to use it
service;
Export a webmap
Description: generate a static image from a webmap object
Return: a deferred object. When it's resolved: it return de ArcGIS API REST response.
Example: See full example
Name | ExportWebMapTask(options?) | ||||||||
Options (JSON object) |
|
How to use it
var webmap = ArcJSON; service;