Addressing final review comments.
This commit is contained in:
@@ -50,7 +50,9 @@
|
||||
<p>This example shows WPS in action by using the WPSCapabilities,
|
||||
WPSDescribeProcess and WPSExecute formats. See
|
||||
<a target="_blank" href="wps.js">wps.js</a> for the
|
||||
source code.</p>
|
||||
source code. <b>Note: For applications using WPS, the high level
|
||||
approach shown in the <a href="wps-client.html">wps-client</a> example
|
||||
is recommended instead.</b></p>
|
||||
<ol>
|
||||
<li>Select a process from the list below the map. The list is
|
||||
populated with the result of a WPS GetCapabilities request, parsed
|
||||
|
||||
@@ -198,7 +198,7 @@ OpenLayers.WPSClient = OpenLayers.Class({
|
||||
this.events.register('describeprocess', this, function describe(evt) {
|
||||
if (evt.identifier === processID) {
|
||||
this.events.unregister('describeprocess', this, describe);
|
||||
callback.call(scope, evt);
|
||||
callback.call(scope, evt.raw);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -209,6 +209,15 @@ OpenLayers.WPSClient = OpenLayers.Class({
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
this.events.destroy();
|
||||
this.events = null;
|
||||
this.servers = null;
|
||||
},
|
||||
|
||||
CLASS_NAME: 'OpenLayers.WPSClient'
|
||||
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* Method: describe
|
||||
* Makes the client ssues a DescribeProcess request asynchronously.
|
||||
* Makes the client issue a DescribeProcess request asynchronously.
|
||||
*
|
||||
* Parameters:
|
||||
* options - {Object} Configuration for the method call
|
||||
@@ -144,6 +144,9 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
* Parameters:
|
||||
* options - {Object}
|
||||
*
|
||||
* Returns:
|
||||
* {<OpenLayers.WPSProcess>} this process.
|
||||
*
|
||||
* Available options:
|
||||
* inputs - {Object} The inputs for the process, keyed by input identifier.
|
||||
* For spatial data inputs, the value of an input is usually an
|
||||
@@ -184,8 +187,8 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
* For spatial data inputs, the value of an input is usually an
|
||||
* <OpenLayers.Geometry>, an <OpenLayers.Feature.Vector> or an array of
|
||||
* geometries or features.
|
||||
* output - {String} The identifier of an output to parse. Optional. If not
|
||||
* provided, the first output will be parsed.
|
||||
* output - {String} The identifier of the output to request and parse.
|
||||
* Optional. If not provided, the first output will be requested.
|
||||
* success - {Function} Callback to call when the process is complete.
|
||||
* This function is called with an outputs object as argument, which
|
||||
* will have a property with the identifier of the requested output
|
||||
@@ -254,7 +257,7 @@ OpenLayers.WPSProcess = OpenLayers.Class({
|
||||
* buffer = client.getProcess('opengeo', 'JTS:buffer');
|
||||
* buffer.execute({
|
||||
* inputs: {
|
||||
* geom: intersect.output(), // <-- here we're chaining
|
||||
* geom: intersect.output('result'), // <-- here we're chaining
|
||||
* distance: 1
|
||||
* },
|
||||
* // ...
|
||||
|
||||
@@ -87,6 +87,19 @@
|
||||
client.execute({inputs: 'a', success: 'b', scope: 'c'});
|
||||
t.eq(log[0], {inputs: 'a', success: 'b', scope: 'c'}, "process executed with correct options");
|
||||
}
|
||||
|
||||
function test_destroy(t) {
|
||||
t.plan(2);
|
||||
client = new OpenLayers.WPSClient({
|
||||
servers: {
|
||||
local: "/geoserver/wps"
|
||||
},
|
||||
lazy: true
|
||||
});
|
||||
client.destroy();
|
||||
t.eq(client.events, null, "Events nullified");
|
||||
t.eq(client.servers, null, "Servers nullified");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user