aroranidh

How to get the layer extent from getResultImageLayer as a result of Geoprocessing tas

Discussion created by aroranidh on Jul 25, 2011
Hi
I have created a GP service with result map service.

I get the result in the form of the GPFeatureRecordSetLayer. I am able to see the map image from rest end point. Also I m able to consume this layer in the java script Api .

function completeUploadCallback(jobInfo){

if(jobInfo.jobStatus !== "esriJobFailed"){
var imageParameters = new esri.layers.ImageParameters();
imageParameters.imageSpatialReference=map.spatialReference;



gpUpload.getResultImageLayer(jobInfo.jobId, "lat_lon",imageParameters, function(gpLayer){
alert('url is '+ gpLayer.url);
//var lyrInfo=gpLayer.layerInfos;
alert('dec class '+ gpLayer.declaredClass);

gpLayer.setOpacity(0.5);
map.addLayer(gpLayer);
});




}
}

How can I get the extent of this layer in JavaScript so that map extent can be modified to show this layer?

The output of GP service through Rest end point looks like
Data Type: GPFeatureRecordSetLayer
Width: 400
Height: 400
Extent:
XMin: -85.40331654
YMin: 27.58004286
XMax: -73.46241746
YMax: 39.52094194
Spatial Reference: 102100 (3857)

Any help in this direction will be really appreciated.

regards,
Nidhi Arora.

Outcomes