ref: https://developers.arcgis.com/javascript/latest/sample-code/animation-layer-visibility/index.html
.then(()=>{ return watchUtils.whenFalseOnce(this.mapView,"updating")})
if(genSMS){
this.panAndZoomTo(startLocation.Location.x, startLocation.Location.y)
.then(()=>{ return watchUtils.whenFalseOnce(this.mapView,"updating")})
.then(()=>{
log.log('ss 1')
return this.mapView.takeScreenshot()})
.then((screenshot)=>{
screenshots.push(screenshot.dataUrl);
log.log('pz 2')
return this.panAndZoomTo(endLocation.Location.x, endLocation.Location.y)
})
.then(()=>{ return watchUtils.whenFalseOnce(this.mapView,"updating")})
.then(()=>{
log.log('ss 2')
return this.mapView.takeScreenshot()
}).then((screenshot)=>{
screenshots.push(screenshot.dataUrl);
var win = window.open("", "Title", "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=780,height=200,top="+(screen.height-400)+",left="+(screen.width-840));
var firstHTML = `<img src="${screenshots[0]}"/><br>`;
var fifthHTML = `<img src="${screenshots[1]}"/><br>`;
var html = `
<html>
<head>
<meta charset="UTF-8">
</head>
${firstHTML}
${fifthHTML}
</html>
`;
log.log(html);
win.document.body.innerHTML = html;
});
}
ref: https://developers.arcgis.com/javascript/latest/sample-code/animation-layer-visibility/index.html