Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Get wpsResponse with application/json directly #100

Open
Gaetanbrl opened this issue May 6, 2022 · 0 comments
Open

Get wpsResponse with application/json directly #100

Gaetanbrl opened this issue May 6, 2022 · 0 comments

Comments

@Gaetanbrl
Copy link

Hi,

We get a GeoJSON response from WPS as application/json to display on our OpenLayers map.

In this current version, we can only use row or document (textxml output format) but Openlayers can't correctly parsed the XML return by this type or response.

So, we need to allow application/json output format with wps-js lib because it works well with OpenLayers (tested).

For the test, we have change this code :

var ExecuteResponse_v1_xml = ExecuteResponse
.extend({
instantiate : function(wpsResponse) {
if ($(wpsResponse).find("wps\\:ExecuteResponse, ExecuteResponse").length > 0) {

By adding on top something like that :

if (wpsResponse.type && wps.type == "featureCollection") { // get featureCollection json from wps response
	return wpsResponse
}

... and this work better.

Is it correct and how allow application/json format if not ?

@Gaetanbrl Gaetanbrl changed the title Get wpsResponse as JSON directly Get wpsResponse with application/json directly May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant