site/app/examples/chaining-promises.js
function zoomTo(geom) {
                // when the view is ready
                return self.view.when(function() {
                    // zoom to the buffer geometry
                    return self.view.goTo({
                        target: geom,
                        scale: 24000,
                        tilt: 0,
                        heading: 0
                    }).then(function() {
                        // resolve the promises with the input geometry
                        return geom;
                    });
                });
            }
function zoomTo(geom) {
                // when the view is ready
                return self.view.when(function() {
                    // zoom to the buffer geometry
                    return self.view.goTo({
                        target: geom,
                        scale: 24000,
                        tilt: 0,
                        heading: 0
                    }).then(function() {
                        // resolve the promises with the input geometry
                        return geom;
                    });
                });
            }
function zoomTo ( geom ) { // when the view is ready return self . view . when ( function ( ) { // zoom to the buffer geometry return self . view . goTo ( { target : geom , scale : 24000 , tilt : 0 , heading : 0 } ) . then ( function ( ) { // resolve the promises with the input geometry return geom ; } ) ; } ) ; }
zooms to the buffer location
zooms to the buffer location