function updateExtentStatePlaneNevadaWest(updatedExtent) { geometryService.project([updatedExtent], new esri.SpatialReference({ wkid: 102709}), function(featVar) { newExtent = featVar[0]; //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); }); }
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); }); }
GET http://services.arcgisonline.com/ArcGIS/rest/info?f=json undefined (undefined)
function updateExtentStatePlaneNevadaWest(updatedExtent) { var inputExtent = new esri.geometry.Extent([updatedExtent], new esri.SpatialReference({ wkid: 102113} )); gsvc.project([inputExtent], [{"wkid":102709}], function(geometries) { newExtent = geometries[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); }, onError); }
function updateExtentStatePlaneNevadaWest(updatedExtent) { var inputExtent = new esri.geometry.Extent({"xmin":updatedExtent.xmin,"ymin":updatedExtent.ymin,"xmax":updatedExtent.xmax,"ymax":updatedExtent.ymax, "spatialReference":{"wkid":102113}}); gsvc.project([inputExtent], [{"wkid":102709}], function(geometries) { newExtent = geometries[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); }, onError); }
function updateExtentStatePlaneNevadaWest(updatedExtent) { var inputExtent = new esri.geometry.Extent([updatedExtent], new esri.SpatialReference({ wkid: 102113} )); var outSR = new esri.SpatialReference({wkid: 102709}); gsvc.project(inputExtent, outSR, function(geometries) { newExtent = geometries[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); }, onError); }
This helped me 3+ years later. Thanks for posting.