Currently, I am utilizing the ArcGIS API for Javascript which can be found at this URL:
The JavaScript code snippet I'm working with appears to be running asynchronously. Is there a way to convert it to run synchronously or potentially transform it into synchronous Ajax?
I have been struggling to locate detailed information on the .execute command.
It is imperative that the code runs synchronously so that PHP can scrape the final result (the output will ultimately be either 'true' or 'false,' alert is currently being used for debugging purposes)
var identifyTask = new esri.tasks.IdentifyTask("http://website.here");
var identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 0;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [layerID];
identifyParams.width = map.width;
identifyParams.height = map.height;
identifyParams.geometry = geom;
identifyParams.mapExtent = map.extent;
identifyTask.execute(identifyParams, function(results) {
if (results.length == 0) {
alert('true');
} else {
alert('false');
}
});