From e0be3f2e658273b5bd9bace5211c841a4ad36f84 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 9 Dec 2009 04:04:52 +0000 Subject: [PATCH] Updating the wfs-states example. git-svn-id: http://svn.openlayers.org/trunk/openlayers@9863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wfs-states.html | 70 +++++++++++++++------------------------- examples/wfs-states.js | 24 ++++++++++++++ 2 files changed, 50 insertions(+), 44 deletions(-) create mode 100644 examples/wfs-states.js diff --git a/examples/wfs-states.html b/examples/wfs-states.html index 9a3f1a4d1e..768e7946eb 100644 --- a/examples/wfs-states.html +++ b/examples/wfs-states.html @@ -1,45 +1,27 @@ - - - - - WFS: United States (GeoServer) - - - - -

WFS United States (GeoServer) Example

- -
-
- -

- Shows the use of the WFS United States (GeoServer) -

- -
- -
- + + + + + WFS: United States (GeoServer) + + + + +

WFS United States (GeoServer) Example

+
+

+ Shows the use of the WFS United States (GeoServer). +

+
+
+

+ This example shows the basic use of a vector layer with the + WFS protocol. +

+

+ See the wfs-states.js + source to see how this is done. +

+
+ - - - - diff --git a/examples/wfs-states.js b/examples/wfs-states.js new file mode 100644 index 0000000000..f349bd41a8 --- /dev/null +++ b/examples/wfs-states.js @@ -0,0 +1,24 @@ +var map; +OpenLayers.ProxyHost = "/proxy/?url="; + +function init() { + map = new OpenLayers.Map("map"); + + var base = new OpenLayers.Layer.WMS("OpenLayers WMS", + "http://labs.metacarta.com/wms-c/Basic.py", + {layers: "basic"} + ); + map.addLayer(base); + + var wfs = new OpenLayers.Layer.Vector("States", { + strategies: [new OpenLayers.Strategy.BBOX()], + protocol: new OpenLayers.Protocol.WFS({ + url: "http://demo.opengeo.org/geoserver/wfs", + featureType: "states", + featureNS: "http://www.openplans.org/topp" + }) + }); + map.addLayer(wfs); + + map.zoomToExtent(new OpenLayers.Bounds(-140.4, 25.1, -44.4, 50.5)); +}