Updating the wfs-states example.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9863 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-12-09 04:04:52 +00:00
parent e10e39b19c
commit e0be3f2e65
2 changed files with 50 additions and 44 deletions

View File

@@ -1,45 +1,27 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>WFS: United States (GeoServer)</title>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map, layer;
function init(){
OpenLayers.ProxyHost="proxy.cgi?url=";
map = new OpenLayers.Map('map', {controls: [ new OpenLayers.Control.PanZoom(), new OpenLayers.Control.Permalink(), new OpenLayers.Control.MouseDefaults() ]} );
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms-c/Basic.py",
{layers: 'basic'} );
map.addLayer(layer);
layer = new OpenLayers.Layer.WFS( "States WFS",
"http://sigma.openplans.org/geoserver/ows",
{ typename: 'topp:states' } );
map.addLayer(layer);
map.zoomToExtent(new OpenLayers.Bounds(-140.444336,25.115234,-44.438477,50.580078));
}
</script>
</head>
<body onload="init()">
<h1 id="title">WFS United States (GeoServer) Example</h1>
<div id="tags">
</div>
<p id="shortdesc">
Shows the use of the WFS United States (GeoServer)
</p>
<div id="map" class="smallmap"></div>
<div id="docs"></div>
</body>
<html>
<head>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" />
<title>WFS: United States (GeoServer)</title>
<script src="../lib/OpenLayers.js"></script>
<script src="wfs-states.js"></script>
</head>
<body onload="init()">
<h1 id="title">WFS United States (GeoServer) Example</h1>
<div id="tags"></div>
<p id="shortdesc">
Shows the use of the WFS United States (GeoServer).
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>
This example shows the basic use of a vector layer with the
WFS protocol.
</p>
<p>
See the <a href="wfs-states.js" target="_blank">wfs-states.js
source</a> to see how this is done.
</p>
</div>
</body>
</html>
</div>

24
examples/wfs-states.js Normal file
View File

@@ -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));
}