AnsweredAssumed Answered

Mapview's when() event on view giving error?

Question asked by nisar.dev on Jan 10, 2018
Latest reply on Jan 10, 2018 by nisar.dev

I have a view which uses a webmap instance. According to the documentation, MapView can leverage the when() function to indicate that the view is ready to be manipulated. But I'm getting  a "view.when is not a function" error in browser console.

 

The code I'm using is:

var webmap = new WebMap({
    portalItem: {
        id: "<some long id>"
    }
});

var view = new MapView({
   map: webmap,
   container: "esriMap"
});

view.when(function(){ // this line is throwing the error
   
}, function(error){
  alert(error.message);
});

I'm using ESRI Javascript v4.5 API. What am I missing here?

Outcomes