Here is my vector layer definition which is well displayed for me:

        var vectorlayer = new OpenLayers.Layer.Vector(
                "My vector layer",
                     {strategies: new OpenLayers.Strategy.BBOX(),
                        protocol: new OpenLayers.Protocol.WFS({
                                srsName: "EPSG:2154",
                                url: "http://youradress:yourport/geoserver/wfs";,
                                featureNS :  "http://youradress:yourport/wfs";,
                                featureType: "layername",
                                outputFormat: "json",
                                readFormat: new OpenLayers.Format.GeoJSON()
                        })
                     }
        );

Then, you add your layer like this: map.addLayer(vectorlayer). You don't compulsorily need anything more to display a WFS layer.

In your code, you have a property that I don't know ("renderers") that seems to concern the layer display. Maybe the problem could come from here? Otherwise, I know that I had problem with the address for the "url" and the "featureNS" property. Actually, in my case, the "url" property is defined with an network address (like "192.168.168.x") and the "featureNS" is defined with the server localhost address (so 127.0.0.x). So your problem could also come from here!

Bye

Geoffrey


On Wed, 27 Jul 2011 19:12:45 +0200, Danjun <[email protected]> wrote:

When is the features array in my wfslayer loaded? After some events or just
after wfslayer is created?

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/render-geometry-data-from-geoserver-tp6626253p6626983.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


--
Using Opera's revolutionary email client: http://www.opera.com/mail/
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to