[OpenLayers-Users] WFS and PostGIS
Juan Arévalo
arevaco90 at yahoo.es
Sun Aug 16 18:56:57 EDT 2009
Hi all!
I am working on a WFS-T using Geoserver 1.7.6, OpenLayers 2.8 and PostgreSQL
with PostGIS. I am able to display the WFS examples from Geoserver such as
Tasmania roads, however I am not able to do the same for one of my layers
stored in the PostGIS DB (One layer with 385 points). I can display the
layer using gvSIG but not in my Openlayers map.
Here is my code that doesn´t show any error:
var wfs2 = new OpenLayers.Layer.Vector("Water Point Same", {
displayOutsideMaxExtent: true,
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://localhost:8080/geoserver/wfs",
style: "point",
featureType: "water_points_same",
featureNS : 'http://www.openplans.org/topp',
featurePrefix: 'topp',
//srsName: "urn:x-ogc:def:crs:EPSG:4326",
srsName: "EPSG:4326",
version: "1.1.0",
geometryName: 'the_geom',
schema:
"http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=water_points_same&outputformat=text/xml;%20subtype=gml/3.1.1"
})
});
map.addLayer(wfs2);
I added this piece of code to see if Openlayers can get the extent:
map.zoomToExtent(wfs2.getDataExtent(), true);
and I got the following error: "bounds is null" in Map.js
Any ideas on how to solve the problem?
Thanks for your help!
Juan
--
View this message in context: http://n2.nabble.com/WFS-and-PostGIS-tp3455383p3455383.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list