Trouble Projecting Extent in 3.0 API

394
0
07-26-2012 03:48 PM
MatthewLawton
Occasional Contributor
I am trying to update my extent reproject function from 2.8 to 3.0, but I keep getting an undefined variable error (newExtent). The variable inputExtent is valid. I even added the Spatial Reference for good measure. I have the outSR in the params variable. I'm not sure why the callback isn't populating the outputExtent variable. Ideas?

  function updateExtentStatePlaneNevadaWest(updatedExtent) {
   var inputExtent = new esri.geometry.Extent(updatedExtent.xmin,updatedExtent.ymin,updatedExtent.xmax,updatedExtent.ymax, new esri.SpatialReference({ wkid: 102113} ));
   var params = new esri.tasks.ProjectParameters();
   params.geometries = [inputExtent];
   params.outSR = new esri.SpatialReference({ wkid: 102709});
   geometryService.project(params, function(outputExtent) {
    newExtent = outputExtent[0]; //<-- comes out as undefined
    //after reprojected, connect to listen to mouse move and drag events
    var onMouseMoveHandler = dojo.connect(map, "onMouseMove", showCoordinates);
    var onMouseDragHandler = dojo.connect(map, "onMouseDrag", showCoordinates);
   });
  }
0 Kudos
0 Replies