[OpenLayers-Users] wfs response.features empty
bartvde at osgis.nl
bartvde at osgis.nl
Tue Mar 23 04:46:30 EDT 2010
Hi,
featureNS is a URI, not the prefix like you have defined.
Check examples/wfs-protocol.html.
Best regards,
Bart
> Hi list,
>
> I want to load a wfs layer in my map.
> var wfs = new OpenLayers.Layer.Vector("wfs",
> {styleMap: styleMap,
> strategies: [new OpenLayers.Strategy.Fixed()],
> protocol: new OpenLayers.Protocol.WFS({
> url: "http://myserver:81/geoserver/wfs?",
> featureNS: "gn",
> featureType: "mylayer",
> geometryName: "SHAPE",
> version: "1.1.0",
> srsName: "EPSG:4326"
> }),
> projection: new OpenLayers.Projection("EPSG:4326") //like my map
> });
>
> But I can see a response at firebug but response.features is empty:
> wfs.protocol.read({
> callback: function(response){
> if(response.success(){
> var features = response.features; //is empty
> } else {
> alert("failure!)
> }
> }
> });
> My code is at geoservers www folder (geoserver is at Tomcat 6 on win).
> FeatureInfo works fine.
> Is this a matter of proxyhost?
>
> Thanks.
> best regards
> Sarah
>
>
> __________________________________________________
> Do You Yahoo!?
> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
> gegen Massenmails.
> http://mail.yahoo.com _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
More information about the Users
mailing list