Sunday, 15 March 2015

GeoServer not returning correct JSON for WFS using OpenLayers.Protocol.Script -


I am trying to get the Jason feature from GeoServer 2.3.0. I have repeated the code from an example and it works as expected, however, when I set the URL on my GOVERver and the desired layer, the returned format is not the same and the result of this error is: "Unwanted syntax error: unexpected Token: "

The example server returns the JSN feature in this format:

Open Layers. Protocol. Script Registry 1 ({"Type": "Feature Collection", "Feature": [{"Type": "Feature", "ID": "Cities .2", "Geometry": ...

My GeoServer offers JSN feature in this format:

{"type": "Feature Collection", "FEATURES": ["Type": "Feature", "id": "poi.1", "Geometry": ...

My server is not returning to Jason wrapped in the callback function from the geographic server. There may be a server config problem, but as a Geosarver Nob, I can tweak To find the right settings for Unable to find the solution. JSONP is disabled by default in the server.

Environmental Variables ENABLE_JSONP = Setting up the truth and requesting the format "text / javascript" gives expected results. It is still not certain that the example server gives correct jsnp with the requested format of "json".

No comments:

Post a Comment