I have a few layers in a PostGIS database that I serve through GeoServer and that I try to display in OpenLayers.
When I had the GeoServer installed on localhost, it worked flawlessly. Now that I migrated the GeoServer on a remote server, the WFS is no longer displayed on my OpenLayers map.
Looking at Firebug, the request is sent to the server but no answer is received.
What is even weirder is that I can access the WFS from QGIS without any problem. Also, even the Geoserver examples (WMS though) work perfectly.
The page is here: http://www.henriod.info/khub2/khub2.html
Do you see any problem with this part of the code?
var schools = new OpenLayers.Layer.Vector("Schools", {
styleMap: style_schools,
strategies: [new OpenLayers.Strategy.BBOX()],
projection: new OpenLayers.Projection("EPSG:4326"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
url: "http://thething.disco.unimib.it:12080/geoserver/wfs",
featurePrefix: "humadat",
featureNS: "http://thething.disco.unimib.it:12080/geoserver/khub2",
featureType: "schools",
geometryName: "the_geom"
})
});
Or could the problem be somewhere else?
-
Do you have CORS support? Is that port open on the host firewall (assuming the QGIS access is local)?BradHards– BradHards2014年02月11日 10:28:09 +00:00Commented Feb 11, 2014 at 10:28
-
Sorry I have no idea what CORS is and i don't have full access to the server, only to the Geoserver Web-interface. But yes, Qgis is local on my machine and Geoserver is on a remote serverStéphane Henriod– Stéphane Henriod2014年02月11日 10:33:06 +00:00Commented Feb 11, 2014 at 10:33
2 Answers 2
So here is the answer: the OpenLayers script works correctly and the problem was caused by a proxy on the server not passing the arguments correctly to Geoserver. Some config there solved the issue. Thanks to all who tried to help!
Geoserver has specific details to be taken into account, try these posts:
-
Thx, I had already seen those 2 posts. All seem correct in the config of Geoserver (the workspace URI is the same as the featureNS in the code); hte geometry column is correctly specifiedStéphane Henriod– Stéphane Henriod2014年02月11日 10:37:16 +00:00Commented Feb 11, 2014 at 10:37
-
have you tried ´thething.disco.unimib.it:12080/geoserver/wfs´ in your browser? it gives an error, and afaik it shouldn't.Gery– Gery2014年02月11日 13:39:56 +00:00Commented Feb 11, 2014 at 13:39
-
It indeed returns an exception: Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@fe23fb1 But I still don't see what's wrong here...Stéphane Henriod– Stéphane Henriod2014年02月11日 14:19:52 +00:00Commented Feb 11, 2014 at 14:19
-
Geoserver doesn't have a log error file or something like that where error can be tracked down?Gery– Gery2014年02月11日 15:39:23 +00:00Commented Feb 11, 2014 at 15:39
-
I don't know cause I don't have access to the server itself. I just asked the server admin and will let you know if I find something interestingStéphane Henriod– Stéphane Henriod2014年02月11日 16:33:32 +00:00Commented Feb 11, 2014 at 16:33