Adding a WFS protocol. This allows for creating, reading, updating, and deleting features via WFS. Huge thanks to ahocevar for the test writing and review. r=ahocevar (closes #1648)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@8868 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
48
examples/wfs-protocol.html
Normal file
48
examples/wfs-protocol.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>OpenLayers Vector Behavior Example</title>
|
||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||
<script src="../lib/Firebug/firebug.js"></script>
|
||||
<script src="../lib/OpenLayers.js"></script>
|
||||
<script type="text/javascript">
|
||||
var map;
|
||||
|
||||
function init() {
|
||||
OpenLayers.ProxyHost= "/cgi-bin/proxy.cgi?url=";
|
||||
map = new OpenLayers.Map('map');
|
||||
var wms = new OpenLayers.Layer.WMS(
|
||||
"OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0",
|
||||
{layers: 'basic'}
|
||||
);
|
||||
|
||||
var layer = new OpenLayers.Layer.Vector("WFS", {
|
||||
strategies: [new OpenLayers.Strategy.BBOX()],
|
||||
protocol: new OpenLayers.Protocol.WFS({
|
||||
url: "http://publicus.opengeo.org/geoserver/wfs",
|
||||
featureType: "tasmania_roads",
|
||||
featureNS: "http://www.openplans.org/topp"
|
||||
}),
|
||||
});
|
||||
|
||||
map.addLayers([wms, layer]);
|
||||
map.setCenter(new OpenLayers.LonLat(146.7, -41.8), 6);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<h1 id="title">Vector Behavior Example</h1>
|
||||
<p id="shortdesc">
|
||||
Uses a BBOX strategy, WFS protocol, and GML format.
|
||||
</p>
|
||||
<div id="map" class="smallmap"></div>
|
||||
<div id="docs">
|
||||
<p>The vector layer shown uses the BBOX strategy, the WFS protocol,
|
||||
and the GML format. The BBOX strategy fetches features within a
|
||||
bounding box. When the map bounds invalidate the data bounds,
|
||||
another request is triggered. The WFS protocol gets features
|
||||
through a WFS request. The GML format is used to serialize
|
||||
features.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user