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