Adding support for chaining processes.

This commit is contained in:
ahocevar
2012-08-09 18:28:53 +02:00
parent c64621f510
commit ec9ab8129e
2 changed files with 280 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
OpenLayers.ProxyHost = 'proxy.cgi?url=';
var map, client, process;
var map, client, intersect, buffer;
function init() {
@@ -23,18 +23,27 @@ function init() {
client = new OpenLayers.WPSClient({
servers: {
local: "http://demo.opengeo.org/geoserver/wps"
opengeo: 'http://demo.opengeo.org/geoserver/wps'
}
});
// Create a process and execute it
process = client.getProcess("local", "JTS:intersection");
process.execute({
// Create a process and configure it
intersect = client.getProcess('opengeo', 'JTS:intersection');
intersect.configure({
// spatial input can be a feature or a geometry or an array of
// features or geometries
inputs: {
a: features,
b: geometry
}
});
// Create another process which chains the previous one and execute it
buffer = client.getProcess('opengeo', 'JTS:buffer');
buffer.execute({
inputs: {
geom: intersect.output(),
distance: 1
},
success: function(outputs) {
// outputs.result is a feature or an array of features for spatial