Select to view content in your preferred language

Getting started

2091
14
02-08-2011 05:18 AM
BarryGuidry
Regular Contributor
I am looking at the various options for building custom web applications, for a non-programmer.  The javascript api looks interesting, but I cannot find good information for a beginner.  I looked at the "Getting Started" guide, in the ESRI Resources for web applications, but even it is somewhat advanced (http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm).

Can anyone point me to other resources for absolute beginners in using the Javascript API?
0 Kudos
14 Replies
carlyarc
New Contributor
Also, if anyone is willing to share a bit of info. on getting started with regards to editing deployed web applications that would be helpful. Nowhere does ESRI tell one how to get started and where to edit. I agree with bg3075, the API is quite advanced for those looking to edit their own applications deployed on ArcGIS Server, versus starting from the ground up and building your own. Any help is appreciated in advance!
0 Kudos
MatthewLawton
Deactivated User
As a non-programmer myself, I have found that the JavaScript API is the easiest of the APIs out there to get up and running and to be productive with.

I first started working with web mapping applications about 6 years ago in ArcIMS. I had some rudimentary HTML knowledge from my college days back in the 1990s, but my background was primarily as a GIS Analyst. I took a two day ArcIMS class from a training consultant and learned how to build a simple HTML/JavaScript ArcIMS Application. Nearly 4 years later (after developing and maintaining several HTML/JavaScript ArcIMS applications), I first dabbled with the ArcGIS Server JavaScript API in the Spring of 2009. After dealing with the frustrations of ArcIMS and the highly touted ArcGIS Server .NET "Web ADF" (which was way over my head), the JavaScript API and REST technology was a breath of fresh air. I published my first functional JavaScript API application in less than 3 months and now maintain about a dozen live JavaScript API mapping applications.

I am by no means an expert, but I have developed from scratch several sophisticated JavaScript API mapping applications over the past two years. My advice is as follows:

1. Get familiar with HTML. This is not hard to do. You can probably find a community service class or a local college course for beginners. Maybe even a "For Dummies" book will do. Spend a long weekend playing with HTML and web pages. Getting familiar with CSS (cascading style sheets) is helpful too. I highly recommend www.w3schools.com

2. Start learning about JavaScript. Just dabble with simple stuff at first. Learn how you can manipulate the look and feel of web pages by using JavaScript. Over time you will get used to the syntax. I still don't know a lot about JavaScript, but I know it well enough to get it to do what I want, usually.

3. Go to your ArcGIS Server REST index, or go to the ESRI map server (http://services.arcgisonline.com/ArcGIS/rest/services/). Choose a map service, then click on the link to view it in ArcGIS JavaScript. When the sample viewer opens, click on "View Source" in your browser. This is a very simple JavaScript API page, but it is important to know what each line of the page does and how it works. Copy this code to your own HTML file and put it on your web server. Play with it, experiment, try to manipulate the way the map displays.

4. Play with the ESRI samples (http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm). Try adding things to your HTML map. See if you can add a scale bar or change the initial extent of your map. A lot of these samples are designed to be cut and pasted into your application.

I'm not going to say this stuff is easy, but it will get you started. I have ranted before on the Flex forum about the problem of the API technologies losing touch with the layperson GIS Technician/Analyst. A lot of us went to college for geography, not computer applications. But we are forced to adapt and become developers. Some find programming easy to pick up, but it has always been a challege for me. However I have definitely been able to be productive with the JavaScript API and have even impressed myself a few times.

Good Luck!
0 Kudos
Charles__Jamie_Phillips
Occasional Contributor
I think these books would help and it explains how dojo works which is what ESRI's JS API is built upon.

http://www.amazon.com/Practical-Dojo-Projects/dp/1430210664

http://pragprog.com/titles/rgdojo/mastering-dojo

Besides this, I would just start reading code.  That is going to really help.  I would start with a basic sample page from the JS API help and modify it to see what it does.  Also, be really disclipned it keeping some structure as it can get crazy very quickly.

What type of tools are you using?  I would get an editor that you are comfortable with and at least has some syntax highlighting for the html and css.
0 Kudos
BarryGuidry
Regular Contributor
Wow! You guys have provided a lot of good information here!  Thank you very much!
0 Kudos
BarryGuidry
Regular Contributor
I think these books would help and it explains how dojo works which is what ESRI's JS API is built upon.

http://www.amazon.com/Practical-Dojo-Projects/dp/1430210664

http://pragprog.com/titles/rgdojo/mastering-dojo

Besides this, I would just start reading code.  That is going to really help.  I would start with a basic sample page from the JS API help and modify it to see what it does.  Also, be really disclipned it keeping some structure as it can get crazy very quickly.

What type of tools are you using?  I would get an editor that you are comfortable with and at least has some syntax highlighting for the html and css.
Jamie, as for editors, I have only seldomly used Notepad to make edits to code.  What do you recommend as an editor that has some syntax highlighting for the html and css?  (I am clueless)
0 Kudos
MatthewLawton
Deactivated User
For a text editor, I almost exclusively use SciTE, available here:

http://www.scintilla.org/SciTE.html

It is very light weight and can read something like 30 different programming languages. I highly recommend it!
0 Kudos
BarryGuidry
Regular Contributor
Thanks a lot!  Again, great information!
0 Kudos
StephenLead
Honored Contributor
I just read Matthew's advice - I'd say it's spot on, and describes my experiences very well. As a non-Computer Science person I found JavaScript relatively easy to pick up, using similar techniques to Matthew's.

For a good free JavaScript editor I'm really happy with http://www.yaldex.com/Free_JavaScript_Editor.htm

Good luck,
Steve
0 Kudos
BarryGuidry
Regular Contributor
Awesome!  Thanks, Stephen.  We do not yet have ArcGIS Server installed, so I am still just wondering if one could simply edit a web application, originally published with Server Manager, by editing the final .html (or whatever format ArcGIS Server creates thru Manager) with these Javascript editors?
0 Kudos