AnsweredAssumed Answered

Cannot access items array property of MapView.allLayerViews (ArcJS API 4.4)

Question asked by devonc1301 on Sep 25, 2017
Latest reply on Sep 26, 2017 by devonc1301

See below:

 

require(["esri/Map","esri/views/MapView"], function(Map, MapView) {    
   
var map = new Map({ basemap: "streets" });    
   
var view = new MapView({       
      container
: "viewDiv",       
      map
: map,       
      center
: [-97.744483, 30.272705],       
      zoom
: 15,   
});

console
.log(view.allLayerViews.items);

console.log(view.allLayerViews.items[0]);

console.log(view.allLayerViews.length);

I suppose the array calls are accessing the Array prototype, but I don't know how to make it not do that. I would like to be able to loop through the layerViews with forEach().

Outcomes