[OpenLayers-Users] WFS Layer / Vector Layer

bartvde at osgis.nl bartvde at osgis.nl
Wed Mar 10 05:29:45 EST 2010


Hi,

don't use the namespace prefix in the featuretype.

    {
        url:  "/MyApp/Proxy.ashx",
        featureType: "boundary",
        featurePrefix: "mystore",
        version: "1.1.0"
    })

If this does not work, try specifying the featureNS (so the corresponding
URI) explicityl.

Best regards,
Bart

> All,
>
> I'm relatively new to OpenLayers and I have downloaded version 2.8 from
> the
> website (Revision 9492) and I am attempting to use it with GeoServer
> 2.0.1.
>
> I have successfully added an OpenLayers.Layer.WFS layer using the
> following:
>
> var wfsLayer = new OpenLayers.Layer.WFS( "WFS", "/MyApp/Proxy.ashx",
> { typeName: "mystore:boundary" },
> {projection: new OpenLayers.Projection("EPSG:27700"), maxExtent: new
> OpenLayers.Bounds(0, 0, 13000000, 13000000)}
> );
>
>
> However, I understand that OpenLayers.Layer.WFS is depreciated (from the
> documentation) and that I should use a vector layer, as such I have
> written
> the following to add as a vector layer:
>
> var wfsLayer = new OpenLayers.Layer.Vector( "WFS", {
>   strategies: [new OpenLayers.Strategy.BBOX()],
>   projection: new OpenLayers.Projection("EPSG:27700"),
>   maxExtent: new OpenLayers.Bounds(0, 0, 13000000, 13000000),
>   protocol: new OpenLayers.Protocol.WFS(
>    {
>        url:  "/MyApp/Proxy.ashx",
>        featureType: "mystore:boundary",
>        version: "1.1.0"
>    })
> });
>
> My problem is that the first method works fine but the second method
> doesn't
> seem to do anything. I have tested using IE7 and Firefox and fiddler
> doesn't
> report any traffic or requests to the Proxy URL.
>
> Any ideas?
>
> Thanks
>
> Andrew
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>





More information about the Users mailing list