0

Am able to get states information of United States by using OpenLayers Protocol.

new OpenLayers.Protocol.WFS({
                   version: "1.1.0",
                   srsName: "EPSG:900913",
                   url:  "http://demo.opengeo.org/geoserver/wfs",
                   featureType: "states",
                   featureNS: "http://www.openplans.org/topp"
               })

I need to get Countries information, tried replacing the fetureType: "countries", but this dint work. Can anybody help me.

1 Answer 1

0

You need to find the correct name for the layer you are trying to load. Try a getcapabilities request to the service like so:

http://demo.opengeo.org/geoserver/wfs?request=getcapabilities

Then search for 'countr' to find whether there are any layers with country geometries for you to use.

Edit:

I made a little JSFiddle for the layer. Depending on your connection it might take a little to load the whole of the WFS layer. In my case about 5 seconds.

Check the fiddle here:

http://jsfiddle.net/goldrydigital/9e2xj18u/

2
  • <Name>ne:ne_10m_admin_0_countries</Name><Title>Countries</Title><Abstract>The 247 countries in the world.</Abstract> this is not working. Commented Dec 12, 2014 at 19:51
  • please check the JSFiddle which I added to my answer. I hope you find this helpful. Commented Dec 12, 2014 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.