1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
---|
5 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
---|
6 | <meta name="apple-mobile-web-app-capable" content="yes"> |
---|
7 | <title>OpenLayers Vector Behavior Example</title> |
---|
8 | <link rel="stylesheet" href="../theme/default/style.css" type="text/css"> |
---|
9 | <link rel="stylesheet" href="style.css" type="text/css"> |
---|
10 | <script src="../lib/OpenLayers.js"></script> |
---|
11 | <script type="text/javascript"> |
---|
12 | var map; |
---|
13 | |
---|
14 | function init(){ |
---|
15 | map = new OpenLayers.Map('map'); |
---|
16 | var wms = new OpenLayers.Layer.WMS( |
---|
17 | "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", |
---|
18 | {layers: 'basic'} |
---|
19 | ); |
---|
20 | |
---|
21 | var layer = new OpenLayers.Layer.Vector("GML", { |
---|
22 | strategies: [new OpenLayers.Strategy.Fixed()], |
---|
23 | protocol: new OpenLayers.Protocol.HTTP({ |
---|
24 | url: "gml/polygon.xml", |
---|
25 | format: new OpenLayers.Format.GML() |
---|
26 | }) |
---|
27 | }); |
---|
28 | |
---|
29 | map.addLayers([wms, layer]); |
---|
30 | map.zoomToExtent(new OpenLayers.Bounds( |
---|
31 | -3.92, 44.34, 4.87, 49.55 |
---|
32 | )); |
---|
33 | } |
---|
34 | </script> |
---|
35 | </head> |
---|
36 | <body onload="init()"> |
---|
37 | <h1 id="title">Vector Behavior Example (Fixed/HTTP/GML)</h1> |
---|
38 | <div id="tags"> |
---|
39 | vector, strategy, strategies, protocoll, advanced, gml, http, fixed |
---|
40 | </div> |
---|
41 | <p id="shortdesc"> |
---|
42 | Vector layer with a Fixed strategy, HTTP protocol, and GML format. |
---|
43 | </p> |
---|
44 | <div id="map" class="smallmap"></div> |
---|
45 | <div id="docs"> |
---|
46 | <p>The vector layer shown uses the Fixed strategy, the HTTP protocol, |
---|
47 | and the GML format. |
---|
48 | The Fixed strategy is a simple strategy that fetches features once |
---|
49 | and never re-requests new data. |
---|
50 | The HTTP protocol makes requests using HTTP verbs. It should be |
---|
51 | constructed with a url that corresponds to a collection of features |
---|
52 | (a resource on some server). |
---|
53 | The GML format is used to serialize features.</p> |
---|
54 | </div> |
---|
55 | </body> |
---|
56 | </html> |
---|