[OpenLayers-Users] wfs json layer from geoserver
Andreas Hocevar
ahocevar at opengeo.org
Sat Jan 14 16:47:29 EST 2012
Hi,
OpenLayers.Layer.WFS is deprecated, and what you tried will only work
f you have a proxy configured. My suggestion would be to use
OpenLayers.Layer with a Protocol.Script to get the layer contents. See
http://openlayers.org/dev/examples/cross-origin.html.
Andreas.
On Wed, Jan 11, 2012 at 1:35 PM, Imran Rajjad <rajjad at gmail.com> wrote:
> hi list,
>
> I am trying to load a WFS layer with json format
>
> var wfs = new OpenLayers.Layer.WFS("wfs_layer",
> "http://server:port/geoserver/wfs",
> {typename: 'topp:test_layer', maxfeatures: 200,
> outputformat: "json"},
> {
> featureClass: OpenLayers.Feature.WFS,
> format: "GeoJSON",
> extractAttributes:true,
> styleMap:style
> }
> );
>
> and the geoserver log shows the below request, but there are no results as
> per FireBug
>
>
> 11 Jan 17:31:35 INFO [geoserver.wfs] -
> Request: getFeature
> handle = null
> service = WFS
> version = 1.0.0
> baseUrl = http://host:port/geoserver/
> providedVersion = 1.0.0
> query = [net.opengis.wfs.impl.QueryTypeImpl at b0df53 (group: null,
> propertyName: null, function: null, filter: [ bbox POLYGON
> ((68.849301577111 30.391413707024, 68.849301577111 30.5524350196,
> 69.048093321031 30.5524350196, 69.048093321031 30.391413707024,
> 68.849301577111 30.391413707024)) ], sortBy: null, featureVersion: null,
> handle: null, srsName: null, typeName:
> [{http://www.openplans.org/topp}test_layer])]
> maxFeatures = 200
> outputFormat = json
> resultType = results
> traverseXlinkDepth = null
> traverseXlinkExpiry = null
> formatOptions = {}
>
>
> I am not using the Proxy because I think you do not need it incase of JSON.
> but it seems I am missing something
>
> regards,--
> I.R
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list