A flaw in Javascript API

663
2
11-24-2012 05:34 AM
SmaranHarihar
New Contributor III
I have been building a Model builder which is hosted on the ArcServer to execute a geoprocessing task which then returns the result as a Map Layer which is overlaid over the basemap. I have been using this blog to create the toolbox.

The flaw that I found was that, when the geoprocessing tool was setup with the parameters as A Map, I receive the result layer but no attribute data associated with it. I am receiving the layer using the,

gp.getResultImageLayer(jobInfo.jobId,"final_shp", imageParams, function(gpLayer) {
            map.addLayer(gpLayer);
          });


But this does not return the LayerInfo or any of the attribute details. This is the output image on ArcServer.

I also tried changing the parameters to A toolbox but even that does not return any feature attribute values and it also does not return any Map Layer. The code I am using to fetch the results is,

gp.getResultData(jobInfo.jobId,"final_shp", addResults, errResults);
function addResults(results) {
console.log(results);
var features = results.value.features;
}
function errResults(err) {
console.log(err);
} 


Is this a flaw in the JavaScript API that it needs a associate MapServer to display the Map Layer. In the Flex API, we can use A toolbox and still receive the output results and the result Map Layer? In all the API examples of Geoprocessing tool, I have seen that the GPServer has a associated MapServer. Is it not possible to fetch the result Map Layer along with result attribute Info?

I am using ArcServer 10.03 and JavaScript API for my project. Pls provide a solution.
0 Kudos
2 Replies
nicogis
MVP Frequent Contributor
here you can see an example http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/gp_resultmapservice.html : map from result map and query on gp
0 Kudos
SmaranHarihar
New Contributor III
here you can see an example http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/gp_resultmapservice.html : map from result map and query on gp


But is it also possible to do the same on ArcServer 10.03? The example is for ArcServer 10.1
0 Kudos