What’s New in ArcGIS JavaScript API version Pi (3.14)

ArcGIS JavaScript API v. 3.14
The ArcGIS JavaScript API turns goes to version Pi (v. 3.14)

I was looking up something in the ArcGIS JavaScript API documentation for another blog post, when I noticed that the API moved up from version 3.13 to 3.14. Yep, the JSAPI became version Pi today.

I picked through the What’s New page to see the changes. They advertised a lot of things that I may never get around to using. There were also a few hidden gems in there. Here’s my take on what’s inside.

Additions to SmartMapping

SmartMapping, for those who don’t know, is ESRI’s way to help you visualize your data points, lines, and polygons using renderers that calculate class breakpoints and stuff like that for you. In version 3.14, they’ve given you the tools to create heat maps, as well as renderers that change by size, color, and opacity. ESRI makes these features readily available through ArcGIS Online, so you never have to implement them on your own, if you so desire.

One of the interesting things I noticed about the SmartMapping was that the renderers return type was listed as a Promise instead of the usual Deferred object. Before you freak out, or scratch your head in confusion, let me tell you that Dojo’s Promises and Deferred are practically the same thing. A Promise is an abstract JavaScript pattern approved for ES6/ES2015 for handling asynchronous code, while Deferred was a specific implementation of a promise. The Deferred object inherits from the Promise class. Correct me if I’m wrong, but they should be implemented the same way, with .then() statements.

By the way, in my slight paranoia regarding changes, I looked back through other common API elements that use Deferreds (like QueryTask). None of the ones I looked at made the switch to Promises. But it’s good to see they’re trying new things.

New BlendRenderer

ESRI has added a new BlendRenderer in version 3.14 that mixes two colors according to some percentage mix. You can now look at Presidential Election Data and recreate your own Purple Map of the United States. But seriously, I’ve been waiting for this since I accidentally stumbled across the esri/Color module and its cool color blending tricks.

A Table of Contents Widget

After years of waiting, it has finally arrived. It is the LayerList dijit, a layer visibility control widget. You now have the power to turn layers off and on by clicking checkboxes. No more having to hand code or custom generate the HTML for this baby. It is finally here.

Now, I’m sure there’s 101 different things you wish this LayerList would do as you turn layers off and on. Don’t worry if it doesn’t make popups, control your light switches, or perform some other great side effect right away. The LayerList is still in beta in version 3.14, so there’s a chance it can do something you want.

Elevation Profile Widget

With a simple polyline and a connection to ESRI’s elevation service, you can get an elevation profile graph. This widget will show you all the high points and valleys along the path you submit. This tool is perfect if you’re trying to be a cool cyclist like the employees at ESRI or Mapbox. You’ll know precisely where you’ll be when you’re too tired to walk your bike up the steep hills, and you can coordinate with your girlfriend to pick you up there.

Other Changes in Version 3.14

Here’s a quick list of other changes that may apply to you more than they apply to me.

  • New OGC compliant WFSLayer – because some people chose the free open source route to publish data
  • Image Server stuff was added
  • Operations Dashboard stuff, if you’re into that
  • New dojoConfig locale support for Taiwan and Hong Kong
  • Lots of bug fixes

Hidden Gem

For me, the hidden gem lay at the very bottom of the What’s New page. Buried in the list of Dojo libraries available, one stood out: dstore. It’s a data storage object that works with dgrid, which is produced by SitePen. I totally enjoy working with dgrid, but there are some features that require dstore to work. Now, I can finally recreate the examples and go through all the tutorials on the dgrid website!

Okay, now that you know what you have to work with, get out there and get coding!

Leave a Reply

Your email address will not be published. Required fields are marked *