New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WFS Layers Not Exporting (same issue than #773) #993
Comments
I am not very familiar with WFS layers and have never used them in a map. Do you really need WFS? Why not try to get the WFS layer in shapefile format and see if you are able to export to a proper web map using the shapefile? I would first try it without WFS. |
Are you able to share the WFS server info so I can test it on my end? |
Thanks for the reply. If the WFS layers are transformed into JSON files ('Encore in JSON' checked), I have a proper web map, but I'm trying to have all my layers online and stored in a server for work purpose. I'm just not sure how to change the coding for it to reference my WFS layers instead of some JSON layers that aren't created ('Encode in JSON' not checked). Here the WFS server info : http://yxlfj798.hostpapavps.net:8181/geoserver/ows?service=wfs&version=2.0.0&request=GetCapabilities. If you need access to it, a temporary account can be created. |
Is the WFS server available over HTTPS, rather than HTTP? Most browsers these days, if you are looking at a local file, will block HTTP traffic. You'll have the same issue if you put the exported webmap online and try to view it over HTTPS - you can't mix secure and insecure content. You can check this by pressing F12 in your browser, and looking for error messages. Let us know if you find anything. |
I don't think I have an issue with that. I'm not sure how the plugin processed the WFS layers. |
I have exactly the same problem. In the attached project I have 3 different WFS layers from 3 different sources and none of them can be shown in Leaflet except if I tick them to save as json. In the generated index.html they are coded like this when NOT ticked save as json: ` <script src='http://vmgeoserver.vd.dk/geoserver/VD/ows?version=1.1.0?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=VD:MASTRA_NOEGLETAL_GEO&SRSNAME=EPSG:4326&outputFormat=text%2Fjavascript&format_options=callback%3AgetMastrangletal_1Json'></script>
|
@magerlin Look at the browser console. You can see an error which comes from a network request. Look at the network tab, and find the request to your WFS. The reponse is this:
I don't know for sure, but it's possible that you haven't configured your server to support JSONP which is what qgis2web uses. |
@sophiatran-obvyamaska Can you do the same? Export the map, and then look for errors in the browser console? I see that you have configured JSONP, so it must be a different issue. |
I am only having it locally on my PC right now. Looking at the browser console it says:
The generated folder is here: |
All 3 examples are from public map services in either Denmark or Iceland and I do not know more than what can be read from the source links. But sibe two of them have the text "geoserver" in the link address I would assume it was geoserver? For one of the examples the link is: ` <script src='http://vmgeoserver.vd.dk/geoserver/VD/ows?version=1.1.0?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=VD:MASTRA_NOEGLETAL_GEO&SRSNAME=EPSG:4326&outputFormat=text%2Fjavascript&format_options=callback%3AgetMastrangletal_1Json'></script>
|
If it's not your source, then it's going to be a problem. The issue, as I understand it, is that JSONP has very much fallen out of favour. When I first wrote the WFS code back in the qgis2leaf days, it was best practice. I think it is less and less used these days. This proably means that qgis2web development is required, making JSONP optional via a checkbox for each WFS layer. It might also be worth contacting the WFS server providers, and ask them if they would consider enabling JSONP support. |
I am about to update an old web map presenting this source: I am updating because background map sources were not functioning anymore but I am actually pretty sure that the source above was functioning. Unfortunately I have overwritten the old index.html in the process but I will se if I can make our IT department restore the old version. |
It is apparently not about the server but how QGIS write the code to the WFS and probably it is about WFS versions I happened to find an old QGIS project linking to exactly same data source and it works when exporting in QGIS2WEB. By deleting the entry to the data source in my QGIS browser window and recreating it without any information on WFS version I made QGIS load the WFS layer like this: And now it works in QGIS2WEB :-) I feel the QGIS WFS is somewhat unreliable - I often get all features shown twice on top of each other in the map canvas. And making changes inside the QGIS browser does not always work - it is better to delete and recreate.... |
Ah! Interesting, amnd I have no real explanation, I'm afraid. Glad you got it sorted, though. I don't know if any of this helps you, @sophiatran-obvyamaska? |
unfortunately this problem is still relevant. |
Hi,
I have the same problem than issue #773 (the codes in index.html and layers.js are refering to JSON even though I haven't checked 'Encode in JSON').
My WFS layers don't show up in the preview nor when are exported.
The WMS layers of the same server work.
The JSONP in GeoServer in enabled, but nothing changed.
Is there anything else we can do to make it work?
Thanks.
The text was updated successfully, but these errors were encountered: