[OpenLayers-Users] vector layers not shown with geoserver

Gilberto Ramos sdjbm17 at gmail.com
Mon Jul 19 11:01:37 EDT 2010



rakesh.modi1585 wrote:
> 
> Hi Gilberto, 
> Thanks for your reply. now i am using
>   var wfs = new OpenLayers.Layer.Vector("wfs", { 
>         strategies: [new OpenLayers.Strategy.BBOX()],
>         projection: new OpenLayers.Projection("EPSG:4326"),
>         protocol: new OpenLayers.Protocol.WFS({
>             version: "1.1.0",
>             srsName: "EPSG:4326",
>             url: "http://192.168.224.128:8080/geoserver/wfs", 
>             featureType: "geoserver:khasra", 
>             featureNS: "http://192.168.224.128:8080/geoserver", 
>             schema:
> "http://192.168.224.128:8080/geoserver/wfs?service=wfs&version=1.1.0&request=DescribeFeatureType&typename=geoserver:khasra",
>             featurePrefix: "geoserver:khasra"
>         }) 
>     }); 
> 
> 
> but still facing problem.. there is no error and not showing layer...
> 

Are you sure your featurePrefix is geoserver? Check your Workspace name in
GeoSever Admin; go to Layer Preview and see the corresponding Name for your
feature. Well, assuming the data you provide is ok you should change your
code to something like this: 

    var wfs = new OpenLayers.Layer.Vector("wfs", { 
        strategies: [new OpenLayers.Strategy.BBOX()],
        projection: new OpenLayers.Projection("EPSG:4326"),
        protocol: new OpenLayers.Protocol.WFS({
            version: "1.1.0",
            srsName: "EPSG:4326",
            url: "http://192.168.224.128:8080/geoserver/wfs", 
            featureType: "khasra", 
            featureNS: "http://192.168.224.128:8080/geoserver", 
            schema:
"http://192.168.224.128:8080/geoserver/wfs?service=wfs&version=1.1.0&request=DescribeFeatureType&typename=geoserver:khasra",
            featurePrefix: "geoserver"
        }) 
    }); 


-----
"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life.
For God sent not his Son into the world to condemn the world; but that the
world through him might be saved.
He that believeth on him is not condemned: but he that believeth not is
condemned already, because he hath not believed in the name of the only
begotten Son of God." John 3:16-18
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/vector-layers-not-shown-with-geoserver-tp5301640p5312402.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list