An IDE with code assist for the ArcGIS JavaScript API

For a multitude of reasons, I want to figure out how to work with the ArcGIS JavaScript API.  It has to do with mobile devices, lack of need for plugins and mostly because this is the direction the web is going long term. After all, HTML5 really is just a combination of html, CSS and JavaScript. Granted there are a few other goodies thrown in, but by and large, HTML5 is little more than an extension of these existing technologies. For these reasons, I want to learn to build web mapping applications using what is going to be the future.

Once deciding on this, another vexing conundrum presents itself. Unlike Flash and Sliverlight, which Esri has web mapping API's for as well, there is not just a single integrated development environment (IDE) with code assist built in. Adobe distributes the Flash Builder IDE and it has some great code assist built in. Microsoft's Visual Studio provides outstanding code assist for developing Silverlight.

The best IDE to use for JavaScript? Simply typing JavaScript IDE into Google brings up a flood of blog postings arguing this exact topic. The first hit however, above all these blog postings, is a direct link to Aptana Studio. Cross referencing to the ArcGIS Resource Center, I managed to unearth a help document with rather simple directions for using the ArcGIS JavaScript API with various editors.

One thing not directly discussed in this document is the only code editor with code assist available is Aptana Studio 2. This is important to note since the current release is Aptana Studio 3. As a result, you have to make sure to download and install Aptana Studio 2 if you want to be able to have code assist available.

With Aptana Studio 2 installed, there still are some steps to getting it set up to perform code assist. The ArcGIS JavaScript API is build on top of the Dojo Toolkit. As a result, support is needed for both Dojo Toolkit and the ArcGIS JavaScript API.

Setting up Dojo code assist can be accomplished by installing the plug-in directly from Aptana Studio. Go to Help > Install Aptana Features. In the dialog, expand the JavaScript Libraries section, check the box next to Dojo and click the Install button at the bottom of the dialog. Aptana will download and install support for Dojo. Code assist is now working for the Dojo Toolkit, but support for the ArcGIS JavaScript API still needs to be installed.

To get code assist working for the ArcGIS JavaScript API, a jar file needs to be downloaded from Esri and installed into Aptana Studio. The download and installation directions can be found on the ArcGIS Resource Center as well. There is only one problem. The directions are for setting up code assist if you have installed Aptana as part of the larger Eclipse IDE. This was not the case for me. I installed it for only myself on the computer. It took a bit of exploration to figure out how to get this installed correctly.

Successfully installing this jar file requires unzipping the zipped archive, copying the jar file into the Aptana plugins folder and enabling it in Aptana. If like myself and installing Aptana for only the current user, the plugin folder can be difficult to locate. Instead of being located in the C:/Programs directory where all other programs installed on a Windows computer are, Aptana is installed in C:/Users/<loginName>/AppData/Local/Aptana Studio 2.0. Inside this folder is located inside the Aptana folder at C:/Users/<loginName>/AppData/Local/Aptana Studio 2.0/plugins. Copy the jar file from the zipped archive downloaded from Esri into this directory.

With the jar file copied into the plugins directory, enable the plugin from within Aptana Studio. Go to Window > Show View > References to open the References dialog. In the References Dialog, open the Global References and check the box next to ArcGIS JSAPI.

This is what it takes to get an IDE with code assist for working with the ArcGIS JavaScript API: download and install Aptana Studio 2, enable the Dojo plugin, download the jar file from Esri, copy the jar file into the plugins directory and enable the JSAPI plugin. Although it takes a bit of tinkering to get it done, the upside is this IDE is completely free and provides code assist for the API I prefer to learn.