Select to view content in your preferred language

Access geoprocessing result with a custom widget

418
1
04-26-2019 08:03 AM
GrantHaynes
Regular Contributor

Hi All,

I've been trying to figure out if it's possible to point a custom widget back to the results of a GP service that are associated with that task, but I'm having trouble finding information on it. I need to build a better graphing widget than the pre-built ones, has anyone here ever accessed GP results with a custom widget?

Tags (1)
0 Kudos
1 Reply
JamalWest2
Regular Contributor

var xmlhttp = new XMLHttpRequest();

xmlhttp.onreadystatechange = function() {
   if (this.readyState == 4 && this.status == 200) {
      var obj = JSON.parse(this.responseText);
      console.log("OBJ", obj);
      console.log(obj.results[0].value);

   }

};


xmlhttp.open("GET", "SOMUEURL/GPServer/Script /execute?xmin="+xmin+"&ymin="+ymin+"&xmax="+xmax+"&ymax="+ymax+"&f=pjson", true);//parameters to send to GP service
xmlhttp.send();
},

0 Kudos