ArcGIS Server 9.3 Javascript API Impressions

September 30, 2008

no comments

After a long wait, I’ve finally been able to start using the new Javascript API that comes with ArcGIS Server 9.3. And the truth? It’s pretty great.

It was difficult to start with, though. I didn’t realize that the actual API (.js files and images mostly) doesn’t come with the AGS installation discs – you have to request that separately. I have no idea why they won’t just let you download an installation zip, as anyone is free to use the API via this link here. Our internal network doesn’t have an Internet connection, and even if it did, I wouldn’t want to rely on unneeded external resources in my application.

Well, I finally got the bits and “installed” them – and by that I mean followed the readme.html file that comes with the disc and tells you to copy this directory over there, and edit that .js file and that .CSS file. An installation script would have been in order, and now I have to create one myself, which I am too lazy to do, but I will. I promise.

Also, the installation doesn’t come with an esri.debug.js file as is costumed with Javascript API’s. The .js file is a “compiled” one, and is completely obfuscated and unreadable. Gosh, I can’t understand ESRI’s constant need to obfuscate everything they make. The Web ADF DLLs are also obfuscated, and the only ones they’re hurting are the developers who use their product. If you still wish to be able to “step into” the ESRI scripts, I recommend that you use this website here to create your own esri.debug.js. It still won’t be the clearest thing, as all the variables will still be ‘meaningfully’ named, but it is better than nothing.

Well, anyway, enough ranting, eh? Finally there’s an API from ESRI that I rather like! You can produce with this mapping applications with code that is actually readable. Look at this sample (and view source) to see how easy it is to create a map with a toolbar. And the beauty is that it is easy even without a designer. I guess that since they couldn’t rely on anyone using Javascript to use a designer, they had to make the code usable, and they got it right.

The outcome is that the code is a lot more extensible. It took me a few minutes to change this code to use the RadToolbar control. In the Web ADF, on the other hand, the controls are meant to use as-is (preferably with the cool-yet-kinda-silly “application builder” they have inside the manager application. Or at least the VS2005 designer). Therefore they are a lot less extensible. Yes, they give you more out of the box, like a TOC control. But it will cost you dearly to try to do something different. For this current application I have to build a dynamic TOC which can hold up to 200 layers, coming from different map objects, depending on the user. The prospect of making that work with the Web ADF is a bit daunting, but combining the js API and the REST services of ArcGIS 9.3 should make this a lot simpler.

So for now I am rather pleased. Things behave as they should – there aren’t many surprises and heads banging on desks. I am a bit concerned about writing more Javascript – we are still at VS 2005, so no intellisense for us, and a heavy reliance on the documentation (which is pretty good, by the way). Another concern is the usage of another Javascript library – Dojo. We are already using ASP.NET Ajax (the RAD controls use this as well), and now adding Dojo and ESRI’s own .js files, and maybe even JQuery I’ve been hearing a lot about – this is going to make for a big download to our clients. It does seem pretty weird that ESRI is using ASP.NET Ajax for the new .NET ADF controls, and Dojo for the Javascript API. Oh well.

To summarize, I would say ESRI has a winner with the new REST + Javascript combination. I doubt that I would now bother with anything that has ADF in its namespace – I’m guessing I would use the Javascript API for the client side, and open a direct ServerContext if I need to do something on the server. I’ll keep you posted on how this worked for me.

Shana Tova!

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>