Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
108 lines (94 sloc) 3.42 KB

ArcGIS JavaScript Development Environment in Node

This is a development environment I've put together to use Node.js to develop ArcGIS JavaScript applications.


You can view a demo of the application here. Easily deployed to Nodejitsu via command line.


This is all experimental, as I have not tried to use this in production yet. But I'm excited to try it. I have some ideas on node modules I can try and use with this.

I still need to get my mocha tests implemented, which would be easy to run.

How to Use

To install, clone the repository, navigate to the folder.

Install required modules

npm install

Run the application

node app

Edit config.json Ideally this would come from a db source

  "appName": "AGS Node App",
  "layers": [
    "type": "dynamic",
      "url": "",
      "id": "censusLayer",
      "title": "Census",
      "visible": true,
      "opacity": 0.5,
      "visibleLayers": [1,2,3,4,5],
      "operational": true,
      "identifyCapability": {
        "canIdentify": true,
        "identifyLayers": [1]

    "widgets": [
      "name": "legend",
      "path": "widgets/legendtoc/LegendMenuWidget",
      "requireOperational": true

      "name": "geocoder",
      "options": {
        "arcgisGeocoder": {
          "name":"Esri World Search",
          "suffix":" Redlands, CA"

    "mapOptions": {
      "basemap": "gray",
      "autoResize": true,
      "center": [-118.20959546463835,34.28548773859569],
      "zoom": 10

You can configure external css and the version of the API in routes/index.js

exports.index = function(req, res){
    var version = '3.3'; // just update the latest version of API here.
    res.render('index', { 
        title: 'ArcGIS Developer Application',
        styles: ['//' + version + '/js/dojo/dijit/themes/nihilo/nihilo.css',
                '//' + version + '/js/esri/css/esri.css',
                '//' + version + '/js/dojo/dojo/resources/dojo.css',
                '//' + version + '/js/dgrid/css/dgrid.css',
                '//' + version + '/js/esri/dijit/css/Popup.css',
        scripts: ['//' + version + 'compact',

Working Proxy

I made an attempt to try and use http-proxy for my proxy. In testing, I had some success. Will it work in all cases? I don't know, but would love some input if you are better at this than I am. The proxy appears to now be working. Needs further options for tokens and white lists, but happy so far.


Included is a "legend" that you can add to the widgets array in the config.json file. The "legend" widget demonstrates how to make a widget work in the widget factory style. This means you can add non-Dojo widgets.

Jump to Line
Something went wrong with that request. Please try again.