Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

[jsapi4] wait for every layer to fininsh drawing #36

@terenceng2010

Description

@terenceng2010

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;                                          
                });
              }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions