OK, I've got it close, but the deferred aspect is messing things up. What I'm trying to do, big picture, is open Google street view at the location the user clicks. The problem is now, that the deferred finishes after the new window is opened with an invalid url. The second time the user clicks, the url is now valid (but with the location of the first click!) and street view opens fine. If I put svurl and the window.open call inside the deferred, the url is constructed properly, but the window now opens in a new window (it's treated as a pop-up by webkit, and I have to specifically allow my site to open pop-ups), not a new tab, whereas if I put the window.open call outside of the deferred, it opens in a new tab, and is NOT treated as a pop-up. Is there a better way?function openStreetView(evt) {
//convert the point //make sure we have a geometry server
if (gsvc === null) initializeProjection();
var outSR = new esri.SpatialReference({ wkid: 4326 });
pt = evt.mapPoint;
gsvc.project([pt], outSR, function (projectedPoints) {
newPt = projectedPoints[0];
}, function (e) { console.log(e.message); });
//create the URL
var svurl = "http://maps.google.com/maps?ll=" + newPt.y + "," + newPt.x + "&t=w&z=19&layer=c&cbll=" + newPt.y + "," + newPt.x + "&cbp=13,-85.37630595889367,,0,2.062648062470899";
//open the window
window.open(svurl, "_blank");
}