I have a vectorLayer with WFS protocol, and BBOX strategy. Which loads initially the data as it should.
But if i drag the map the geoserver log just say: {curr date} INFO [geoserver.wfs] – Request: getServiceInfo instead of getFeature (like it does during the initial request).
My problem is that on the map nothing happens. If I set a “refresh” eventHandler on the layer, it won’t fire…
Do I have to refresh the map/layer somewhere else?
var map;
function init(){
..
map = new OpenLayers.Map('map', options);
var gsat = new OpenLayers.Layer.Google(...);
map.addLayer(gsat);
var lonlat = new OpenLayers.LonLat(...);
map.setCenter(lonlat, 18);
loadLayer();
..
}
function loadLayer(){
loadLayerFunc();
...
}
function loadLayerFunc(){
var wfsLayer = loadLayerFunc();
wfsLayer.events.on({...});
map.addLayer(wfsLayer);
...
}
function loadLayerFunc(){
var bboxStrategy = new OpenLayers.Strategy.BBOX({ratio: 0.8});
wfsLayer = new OpenLayers.Layer.Vector("wfsLayer", {
strategies: [bboxStrategy],
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:4326",
url: wfs_url,
featureType: "positions_test",
featurePrefix: "feature",
geometryName: "the_geom",
schema: "http://localhost:8080/geoserver/wfs?request=DescribeFeatureType&service=WFS&typeName=ws:positions",
maxFeatures: 1000
}),
projection: geoProjection
});
return wfsLayer;
}
If i run the same script on another server, firefox webconsole tells me already at the initial request “Unable to display responses of type (null)”…..?
It doesn’t even show anything, although i just changed the url.
EDIT: the null response seem to be caused by the tomcat apache server without proxy configuration. Is possible to run it without proxy, if the js files are in the similar apache folder like on geoserver? Finally i need to run it on the tomcat.
Is “proxy.cgi file not well formed” error better than null response? I would like to solve it without a proxy if possible, but it looks like that including the proxy brings me closer to where i want.
your WFS endpoint (GeoServer) should be located relative to your page otherwise the same origin policy kicks in.
You could try fixing it using apache and mod_proxy or mod_jk. With those libraries you can mount geoserver, as deployed in tomcat, relative to your application.
If this is not possible with your application, you should use the supplied proxy script.
And yes, geoserver displays getServiceInfo when making WFS requests in its log files. I noticed the same behaviour with geoserver 2.1.1