Use the correct name of the result, not just hard-coded 'result'.
This commit is contained in:
@@ -212,9 +212,10 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
* provided, the first output will be parsed.
|
||||
* success - {Function} Callback to call when the process is complete.
|
||||
* This function is called with an outputs object as argument, which
|
||||
* will have a 'result' property. For processes that generate spatial
|
||||
* output, this will either be a single <OpenLayers.Feature.Vector> or
|
||||
* an array of features.
|
||||
* will have a property with the name of the requested output (e.g.
|
||||
* 'result'). For processes that generate spatial output, the value
|
||||
* will either be a single <OpenLayers.Feature.Vector> or an array of
|
||||
* features.
|
||||
* scope - {Object} Optional scope for the success callback.
|
||||
*/
|
||||
execute: function(options) {
|
||||
@@ -223,10 +224,10 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
callback: function() {
|
||||
var me = this;
|
||||
//TODO For now we only deal with a single output
|
||||
var output = this.getOutputIndex(
|
||||
var outputIndex = this.getOutputIndex(
|
||||
me.description.processOutputs, options.output
|
||||
);
|
||||
me.setResponseForm({outputIndex: output});
|
||||
me.setResponseForm({outputIndex: outputIndex});
|
||||
(function callback() {
|
||||
OpenLayers.Util.removeItem(me.executeCallbacks, callback);
|
||||
if (me.chained !== 0) {
|
||||
@@ -241,15 +242,16 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
url: me.client.servers[me.server].url,
|
||||
data: new OpenLayers.Format.WPSExecute().write(me.description),
|
||||
success: function(response) {
|
||||
var output = me.description.processOutputs[outputIndex];
|
||||
var mimeType = me.findMimeType(
|
||||
me.description.processOutputs[output].complexOutput.supported.formats
|
||||
output.complexOutput.supported.formats
|
||||
);
|
||||
//TODO For now we assume a spatial output
|
||||
var features = me.formats[mimeType].read(response.responseText);
|
||||
if (options.success) {
|
||||
options.success.call(options.scope, {
|
||||
result: features
|
||||
});
|
||||
var outputs = {};
|
||||
outputs[output.identifier] = features;
|
||||
options.success.call(options.scope, outputs);
|
||||
}
|
||||
},
|
||||
scope: me
|
||||
|
||||
Reference in New Issue
Block a user