AnsweredAssumed Answered

#goTo() MapView cannot be used before it is ready

Question asked by michaellodes on Nov 1, 2017
Latest reply on Nov 1, 2017 by TSolow-esristaff

Hello together,

 

I tried to zoom on a layer (containing 1 single point) in my MapView and got an error in the web console:

#goTo() MapView cannot be used before it is ready

See a code snippet below. Where's the problem?

 

var zoomLayer = new FeatureLayer({...});

var view = new MapView({...});

view.then(goToLayer(zoomLayer));

function goToLayer(zoomLayer) { 
view.goTo(zoomLayer.graphics); 
}

 

Thank you,

 

Best Regards

Michael

Outcomes