OpenLayers Klient Beispiel ************************** * http://openlayers.org * http://openlayers.org/dev/examples * `wps.html <_images/wps.html>`_ Editing Tool Bar Example .. highlight:: javascript :linenothreshold: 5 Global Variablen:: var wpsns = "http://www.opengis.net/wps/1.0.0"; var xmlTemplate = ''+ 'exampleBufferProcess'+ ''+ ''+ 'data'+ ''+ 'PYWPS_DATA'+ ''+ ''+ ''+ 'width'+ ''+ 'PYWPS_WIDTH'+ ''+ ''+ ''+ ''+ ''+ ''+ 'buffer'+ ''+ ''+ ''+ ''; .. highlight:: javascript :linenothreshold: 5 WPS Funkzionen:: /******************* * WPS starts here * *******************/ // On ClearButton Clicked - destroy all features within vector // layer var onClearClicked = function() { vlayer.destroyFeatures(); rlayer.destroyFeatures(); }; // On BufferButton Clicked - call the WPS Process var onBufferClicked = function() { var xmlData = OpenLayers.Format.GML.prototype.write(vlayer.features); var width = document.getElementById("width").value; var xml = xmlTemplate.replace("PYWPS_DATA",xmlData).replace('PYWPS_WIDTH',width); console.log(xml); OpenLayers.Request.POST({ url: 'http://localhost/cgi-bin/fossgiswps', data: xml, success: wpsArrived, failure: wpsFailed, scope: this }); }; // WPS Response arrived var wpsArrived = function(resp) { try { map.removeLayer(rlayer); rlayer.destroy(); }catch(e) {} var url = resp.responseXML.getElementsByTagNameNS(wpsns,"Reference")[0].getAttribute("xlink:href"); rlayer = new OpenLayers.Layer.GML("Result",url); map.addLayer(rlayer); }; // WPS Response failed var wpsFailed = function(resp) { rlayer.destroyFeatures(); }; .. highlight:: html :linenothreshold: 5 HTML::
Width: 
.. image:: data/wps.html