[OpenLayers-Users] Re: what is Code for wfs layer?

Mustafa646 noorcs22 at gmail.com
Thu Mar 3 07:56:43 EST 2011


thanks for sending wfs layer code. 

The code works fine for "topp:states". But it could not work with
topp:buildings. buildings is my shapefile in topp workspace. WMS layer
displays with topp:states, but WFS could not display with same topp:states.
 
I want to display shapefile layer over google map. Below is the code for
displaying both WMS and WFS 

1.  var wmslayer = new OpenLayers.Layer.WMS("buildings1",
"http://localhost:8080/geoserver/wms", { 'layers': 'topp:buildings',
'format': 'image/png', 'transparent': 'true' }, {'opacity':
1.0,'isBaseLayer': false, 'visibility': true }); 

2.  wfs = new OpenLayers.Layer.Vector("buildings2", { 
                strategies: [new OpenLayers.Strategy.BBOX()], 
                protocol: new OpenLayers.Protocol.WFS({ 
                    url: "http://localhost:8080/geoserver/wfs", 
                    featureType: "buildings", 
                    featureNS: "http://www.openplans.org/topp", 
                    srsName: "EPSG:900913", 
                    version: "1.1.0", 
                    isBaseLayer: false, 
                    visibility:true 
                }) 
            }); 

WMS layer successfully displayed over Google Map, but WFS not. Can you
explain whats wrong with WFS layer or above code?. I have publish the
exactly same shapefile (buildings) under topp workspace in Geoserver. 

I could not understand, what is wrong ? need reply immediately! 

best regards  



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/what-is-Code-for-wfs-layer-tp6056901p6084700.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list