The Map Object and Web Map Synergy

The new architecture of ArcGIS API 4.0 for JavaScript mirrors the web map structure. This means you get the same structure—operational layers, basemaps (with reference layers) and map properties such as bookmarks and presentations—that you would expect in a web map.

In 3.x, a basemap layer, reference layer (consisting of boundaries and labels), and an operational layer are represented in the API as three individual layers. In the 4.0 API, a map is represented as a basemap and operational layer so you can easily identify and work with just the operational layers to build out workflows. You can also instantiate maps, basemaps, and layers directly from portal items because the Portal Information model is incorporated into the API.

This map API structure remains the same whether you build the map yourself using code or open the map from a portal item. The 4.0 API adds the concept of a Group layer so that you can turn on/off a set of layers in your map. Having this consistent architecture will enable not only reading but also (eventually) writing web maps and web scenes. Writing web maps and scenes is expected in a subsequent release in 2016. In addition, the entire ArcGIS Portal REST API will be covered by ArcGIS API 4.0 for JavaScript. So rather than having to write direct REST requests for some calls like AddItem, you can simply implement it using the API.