I this can help you, I have something like that to request WFS features
from Geoserver:
pistesLayer = new OpenLayers.Layer.Vector("Geoserver WFS", {
strategies: [new OpenLayers.Strategy.BBOX()],
styleMap: myStyles,
protocol: new OpenLayers.Protocol.WFS.v1_0_0({
url: "http://192.168.1.3:8080/geoserver/wfs",
featureType: "planet_osm_line_nordic", //
name of the geoserver layer
featureNS: "nordic", // name of the geoserver
store
geometryName: "way",
srs: "EPSG:4326"
}),
projection: new OpenLayers.Projection("EPSG:4326"),
minScale: 500000,
});
Yves
On 25. 01. 11 16:30, Charles Galpin wrote:
Does anyone have any idea what the problem is here?
OpenLayers.Protocol.WFS.fromWMSLayer is supposed to pickup the properties from
the WMS layer but is losing the feature prefix in the typeName sent.
<wfs:query typeName="links">
When It should be
<wfs:query typeName="myNS:links">
I have stepped through the constructor and the protocol seems to have the
feature prefix ten. I have tried setting the featurePrefix and typeName a
variety of ways but nothing seems to take.
Can anyone at least confirm this works for them when using a non-default
namespace on the server?
thanks,
charles
On Jan 24, 2011, at 11:15 AM, Charles Galpin wrote:
I have a GetFeature control that is constructed with a protocol created from an
existing WMS layer which is working fine. However where getfeature requests are
being sent the feature namespace is not sent, i.e. 'links' is sent instead of
'myNS:links'. This has been working I think because of my default namespace in
geoserver, but I now want to use another namespace that is not the default, and
I can see the default namespace in the response (which is not correct). I have
tried setting featureNS parameters to both these constructors but it still
doesn't get passed through.
Does anyone know how to do this?
var links = new OpenLayers.Layer.WMS(
"Links", "/geoserver/wms",
{
layers: 'myNS:links',
styles: '',
srs: 'EPSG:4326',
format: 'image/png',
tiled: 'true',
tilesOrigin : map.maxExtent.left + ',' +
map.maxExtent.bottom,
transparent: true
},
{
visibility: false,
buffer: 0,
'opacity': 0.75,
'isBaseLayer': false,
'wrapDateLine': true
}
);
var getFeatureControl = new OpenLayers.Control.GetFeature({
// The request is sending coordinates in EPSG:900913
protocol: OpenLayers.Protocol.WFS.fromWMSLayer(links, {srsName:
"EPSG:900913"}),
box: true,
hover: true,
multipleKey: "shiftKey",
toggleKey: "ctrlKey"
});
thanks,
charles
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users