1

I'm having issues rendering WFS layers with OpenLayers 3. If I follow the example here and zoom out zoom out zoom out, my pc will soon freeze as the amount of data is huge. Don't even want to try on a phone.

If I set MaxFeatures to e.g. 500, the example works well. However I then alter the code to run with MY GeoServer, and I receive:

Assertion failed. See https://openlayers.org/en/v4.6.4/doc/errors/#36 for details.

The text for error #36 is:

Unknown SRS type. Expected "name" or "EPSG"

My GeoServer is returning JSON as requested. I check the JSON sent from my GeoServer:

... "type": "FeatureCollection", "totalFeatures": 0,
    "features": [{"type": "Feature", "id": "plats.66", "geometry": {
        "type": "Polygon",…}, 
    ],
    "crs":{"type":"EPSG","properties":{"code":"3857"}}}

So, my GeoServer returns "type": "EPSG", however the OL WFS request parser seems to only accept "type":"name", this in spite of the error message.

My GeoServer is v2.5.3, the WFS request is v1.1.0 as per the OL example.

Is this a bug, if so is there a workaround?

closed as off-topic by nmtoken, Vince, Midavalo Dec 24 '17 at 19:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – nmtoken, Vince, Midavalo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Technically GeoJSON can only be in epsg:4326 now, you might want to use a better standard like GML if you need other projections. – Ian Turton Dec 22 '17 at 20:37
  • If you just want to view data, why not use a WMS? – nmtoken Dec 22 '17 at 21:46
  • Yes, using a ol.format.GML and removing the outputFormat=application/json does enable this script to work. Thanks @Ian Turton – minisaurus Dec 23 '17 at 9:44