Announcements

ArcGIS API for JavaScript 4.0 beta 3 released

We are excited to announce that beta 3 of the ArcGIS API for JavaScript 4.0 is now available.

The following are some of the highlights of this release.

Developer-friendly widgets

All widgets in version 4.0 of the ArcGIS API for JavaScript are being reengineered to enhance their extensibility and customization. Each widget’s presentation is now separate from its properties, methods and data. This separation of core logic and presentation, makes each widget highly customizable when working with other frameworks and libraries such as Bootstrap, React, and JQuery. It also means developers can use the logic without having to render its UI components.

See the code example below, Search (MapView, SceneView), Home, Locate, BasemapToggle (MapView, SceneView) widget samples, and the Widgets section in the What’s New article for more information.

require([
  "esri/widgets/Search",
  "esri/widgets/Search/SearchViewModel",
  "dojo/domReady!"
], function(Search, SearchVM) {
  ...
  var searchWidget = new Search({
    //Setting widget properties via viewModel is subject to 
    //change for the 4.0 final release    
    viewModel: new SearchVM({
      view: view //instance of MapView
    })
  }, "searchDiv");
  ...
});

Consistent API for working with Renderers

All of the properties of SimpleRenderer, UniqueValueRenderer, and ClassBreaksRenderer can be set directly in the constructor object or directly on an instance of the class.

Create the renderer by constructor:

var renderer = new UniqueValueRenderer({
  defaultSymbol: defaultSym,
  attributeField: "myField"
});

Set properties on the renderer instance:

renderer.attributeField2 = "mySecondField";
renderer.attributeField3 = "myThirdField";

String Templates: new placeholder syntax

Template strings have been supported in the JSAPI for a long time. They provide a convenient way to define strings that contain placeholders – where the placeholders are substituted with actual values at a later time. The code snippet below shows the old versus the new syntax:

// Old syntax (with dollar sign): 
${placeholder}
// New syntax (without dollar sign): 
{placeholder}

Template strings can be found in the title and description of popups, in the URL template for WebTiledLayer, and used when formatting search results and suggestions in the Search widget. For more information see the What’s New article, PopupTemplate, Search widget, and WebTiledLayer.

WebTiledLayer

var tiledLayer = new WebTiledLayer({
  urlTemplate: "http://{subDomain}.tile.stamen.com/toner/{level}/{col}/{row}.png",
  subDomains: ["a", "b", "c", "d"],
  copyright: "Copyright here ..."
});

Popups

var template = new PopupTemplate({
  title: "Households on food stamps in {COUNTY}",
  content: "<b>Average home value:</b> {AVGVAL_CY}",
  fieldInfos: [{
    fieldName: "AVGVAL_CY",
      format: {
        digitSeparator: true,
	places: 0
      }
  }]
});

Support

Esri provides support via the standard Technical Support channels for version 4.0. You may also post and view questions on the GeoNet “4.0 beta” forum. Please tag forum posts with “4.0beta”.

For the complete list of the 4.0 beta 3 release details see the What’s New article in the Guide section.

About the authors

Working daily to elevate user happiness about reading the ArcGIS Maps SDK for JavaScript documentation. Occasionally blogging about the ArcGIS Maps SDK for JavaScript, and technical presenter at the Esri Developer Summit and User's Conferences. A Product Engineer on the Esri ArcGIS Maps SDK for JavaScript team.

Connect:

20+ years of experience with web mapping. Currently lead project engineer for the ArcGIS Maps SDK for JavaScript development team at Esri.

Connect:

Julie Powell is a Principal Product Manager, focusing on Esri's web development technologies. She works to ensure developers can be successful in building state of the art, purposeful solutions using ArcGIS software. Julie brings 20 years of experience working with global leaders such as Hewlett-Packard and Esri, delivering a variety of software solutions for both the enterprise and consumer markets. Julie has worked on a wide range of projects and consulting endeavors, including serving as technical lead for web mapping solutions for strategic customers.

Connect:

Next Article

What's new in ArcGIS Hub first quarter

Read this article