| 190 | | if (select.features.length == 0 || hover.features.length == 0) |
| 191 | | return alert("No feature created!"); |
| 192 | | var url = '/zoo/'; |
| 193 | | var xlink = control.protocol.url +"?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0"; |
| 194 | | xlink += '&typename='+control.protocol.featurePrefix; |
| 195 | | xlink += ':'+control.protocol.featureType; |
| 196 | | xlink += '&SRS='+control.protocol.srsName; |
| 197 | | xlink += '&FeatureID='+select.features[0].fid; |
| 198 | | var GeoJSON = new OpenLayers.Format.GeoJSON(); |
| 199 | | try { |
| | 190 | if (select.features.length == 0 || hover.features.length == 0) |
| | 191 | return alert("No feature created!"); |
| | 192 | var url = '/cgi-bin/zoo_loader.cgi'; |
| | 193 | var xlink = control.protocol.url +"&SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0"; |
| | 194 | xlink += '&typename='+control.protocol.featurePrefix; |
| | 195 | xlink += ':'+control.protocol.featureType; |
| | 196 | xlink += '&SRS='+control.protocol.srsName; |
| | 197 | xlink += '&FeatureID='+parseMapServerId(select.features[0].fid); |
| | 198 | var GeoJSON = new OpenLayers.Format.GeoJSON(); |
| | 199 | try { |
| 201 | | params += ' <ows:Identifier>'+aProcess+'</ows:Identifier>'; |
| 202 | | params += ' <wps:DataInputs>'; |
| 203 | | params += ' <wps:Input>'; |
| 204 | | params += ' <ows:Identifier>InputEntity1</ows:Identifier>'; |
| 205 | | params += ' <wps:Reference xlink:href="'+xlink.replace(/&/gi,'&')+'"/>'; |
| 206 | | params += ' </wps:Input>'; |
| 207 | | params += ' <wps:Input>'; |
| 208 | | params += ' <ows:Identifier>InputEntity2</ows:Identifier>'; |
| 209 | | params += ' <wps:Data>'; |
| 210 | | params += ' <wps:ComplexData mimeType="application/json"> '+GeoJSON.write(hover.features[0].geometry)+' </wps:ComplexData>'; |
| 211 | | params += ' </wps:Data>'; |
| 212 | | params += ' </wps:Input>'; |
| 213 | | params += ' </wps:DataInputs>'; |
| 214 | | params += ' <wps:ResponseForm>'; |
| 215 | | params += ' <wps:RawDataOutput>'; |
| 216 | | params += ' <ows:Identifier>Result</ows:Identifier>'; |
| 217 | | params += ' </wps:RawDataOutput>'; |
| 218 | | params += ' </wps:ResponseForm>'; |
| 219 | | params += ' </wps:Execute>'; |
| 220 | | } catch(e) { |
| | 201 | params += '<ows:Identifier>'+aProcess+'</ows:Identifier>'; |
| | 202 | params += '<wps:DataInputs>'; |
| | 203 | params += '<wps:Input>'; |
| | 204 | params += '<ows:Identifier>InputEntity1</ows:Identifier>'; |
| | 205 | params += '<wps:Reference xlink:href="'+xlink.replace(/&/gi,'&')+'"/>'; |
| | 206 | params += '</wps:Input>'; |
| | 207 | params += '<wps:Input>'; |
| | 208 | params += '<ows:Identifier>InputEntity2</ows:Identifier>'; |
| | 209 | params += '<wps:Data>'; |
| | 210 | params += '<wps:ComplexData mimeType="application/json"> '+GeoJSON.write(hover.features[0].geometry)+' </wps:ComplexData>'; |
| | 211 | params += '</wps:Data>'; |
| | 212 | params += '</wps:Input>'; |
| | 213 | params += '</wps:DataInputs>'; |
| | 214 | params += '<wps:ResponseForm>'; |
| | 215 | params += '<wps:RawDataOutput>'; |
| | 216 | params += '<ows:Identifier>Result</ows:Identifier>'; |
| | 217 | params += '</wps:RawDataOutput>'; |
| | 218 | params += '</wps:ResponseForm>'; |
| | 219 | params += '</wps:Execute>'; |
| | 220 | } catch(e) { |
| 223 | | } |
| 224 | | var request = new OpenLayers.Request.XMLHttpRequest(); |
| 225 | | request.open('POST',url,true); |
| 226 | | request.setRequestHeader('Content-Type','text/xml'); |
| 227 | | request.onreadystatechange = function() { |
| 228 | | if(request.readyState == OpenLayers.Request.XMLHttpRequest.DONE) { |
| 229 | | var GeoJSON = new OpenLayers.Format.GeoJSON(); |
| 230 | | var features = GeoJSON.read(request.responseText); |
| 231 | | multi.removeFeatures(multi.features); |
| 232 | | multi.addFeatures(features); |
| 233 | | } |
| 234 | | } |
| 235 | | request.send(params); |
| | 223 | } |
| | 224 | var request = new OpenLayers.Request.XMLHttpRequest(); |
| | 225 | request.open('POST',url,true); |
| | 226 | request.setRequestHeader('Content-Type','text/xml'); |
| | 227 | request.onreadystatechange = function() { |
| | 228 | if(request.readyState == OpenLayers.Request.XMLHttpRequest.DONE) { |
| | 229 | var GeoJSON = new OpenLayers.Format.GeoJSON(); |
| | 230 | var features = GeoJSON.read(request.responseText); |
| | 231 | multi.removeFeatures(multi.features); |
| | 232 | multi.addFeatures(features); |
| | 233 | } |
| | 234 | } |
| | 235 | request.send(params); |