]> dev.renevier.net Git - syp.git/blob - openlayers/examples/behavior-fixed-http-gml.html
initial commit
[syp.git] / openlayers / examples / behavior-fixed-http-gml.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2     <head>
3         <title>OpenLayers Vector Behavior Example</title>
4         <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5         <link rel="stylesheet" href="style.css" type="text/css" />
6         <script src="../lib/OpenLayers.js"></script>
7         <script type="text/javascript">
8             var map;
9         
10             function init(){
11                 map = new OpenLayers.Map('map');
12                 var wms = new OpenLayers.Layer.WMS(
13                     "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0",
14                     {layers: 'basic'}
15                 );
16
17                 var layer = new OpenLayers.Layer.Vector("GML", {
18                     strategies: [new OpenLayers.Strategy.Fixed()],
19                     protocol: new OpenLayers.Protocol.HTTP({
20                         url: "gml/polygon.xml",
21                         format: new OpenLayers.Format.GML()
22                     })
23                 });
24
25                 map.addLayers([wms, layer]);
26                 map.zoomToExtent(new OpenLayers.Bounds(
27                     -3.92, 44.34, 4.87, 49.55
28                 ));
29             }
30         </script>
31     </head>
32     <body onload="init()">
33         <h1 id="title">Vector Behavior Example (Fixed/HTTP/GML)</h1>
34         <p id="shortdesc">
35             Vector layer with a Fixed strategy, HTTP protocol, and GML format.
36         </p>
37         <div id="map" class="smallmap"></div>
38         <div id="docs">
39             The vector layer shown uses the Fixed strategy, the HTTP protocol,
40             and the GML format.
41             The Fixed strategy is a simple strategy that fetches features once
42             and never re-requests new data.
43             The HTTP protocol makes requests using HTTP verbs.  It should be
44             constructed with a url that corresponds to a collection of features
45             (a resource on some server).
46             The GML format is used to serialize features.
47         </div>
48     </body>
49 </html>