iag-geo / bootleaf

An open-source version of IAG's Bootleaf fork
https://demo.bootleaf.xyz
MIT License
89 stars 65 forks source link

Handling of application/json WFS #12

Closed hardreddata closed 5 years ago

hardreddata commented 5 years ago

Thanks for making such a useful application available.

As best I can tell the NSW Geoscience WFS below requires one to connect with application/json.

"type": "WFS",
"url": "https://gs.geoscience.nsw.gov.au/geoserver/wfs",
"typeName": "gsnsw:gp_aem",
"outputFormat": "application/json",
"geomField": "geom"

It looks like Geoserver returns a sensible result from the prepared Request URL. This was not the case with the default "text/javascript".

The Firefox debugger then complains about SyntaxError: unexpected token: ':'. I wonder if there is some special handling needed?

Many thanks.

slead commented 5 years ago

hey, sorry I missed this issue over the Xmas break. I'll take a look as soon as time permits - I'm working at a client site at the moment.

Sometimes WFS and WMS services require a reverse-proxy. I put some information on using a reverse-proxy at https://github.com/iag-geo/bootleaf/blob/master/reverseProxy.md - you could try giving those suggestions a go.

hardreddata commented 5 years ago

No worries. Thanks for coming back to me.

This isn't especially critical to any current projects but, inspired by bootleaf I thought I would try and help the community here. For comparison the Geowebcache WMS offered by the same people works ok.

"type": "wmsTiledLayer",
"url": "https://gs.geoscience.nsw.gov.au/geoserver/gwc/service/wms",
"format": "image/png",
"layers": "gsnsw:ge_geology15m",

I will try the non-cached WMS, and reverse proxy when I get a chance.

hardreddata commented 5 years ago

You were right. This looks to be CORS related.

Please close this issue, and thanks for the help.