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/Firebug/firebug.js"></script> |
---|
11 | <script src="../lib/OpenLayers.js"></script> |
---|
12 | <script type="text/javascript"> |
---|
13 | var map; |
---|
14 | |
---|
15 | function init() { |
---|
16 | OpenLayers.ProxyHost= "proxy.cgi?url="; |
---|
17 | map = new OpenLayers.Map('map'); |
---|
18 | var wms = new OpenLayers.Layer.WMS( |
---|
19 | "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0", |
---|
20 | {layers: 'basic'} |
---|
21 | ); |
---|
22 | |
---|
23 | var layer = new OpenLayers.Layer.Vector("WFS", { |
---|
24 | strategies: [new OpenLayers.Strategy.BBOX()], |
---|
25 | protocol: new OpenLayers.Protocol.WFS({ |
---|
26 | url: "http://demo.opengeo.org/geoserver/wfs", |
---|
27 | featureType: "tasmania_roads", |
---|
28 | featureNS: "http://www.openplans.org/topp" |
---|
29 | }) |
---|
30 | }); |
---|
31 | |
---|
32 | map.addLayers([wms, layer]); |
---|
33 | map.setCenter(new OpenLayers.LonLat(146.7, -41.8), 6); |
---|
34 | } |
---|
35 | </script> |
---|
36 | </head> |
---|
37 | <body onload="init()"> |
---|
38 | <h1 id="title">Vector Behavior Example</h1> |
---|
39 | <div id="tags"> |
---|
40 | wfs, vector |
---|
41 | </div> |
---|
42 | <p id="shortdesc"> |
---|
43 | Uses a BBOX strategy, WFS protocol, and GML format. |
---|
44 | </p> |
---|
45 | <div id="map" class="smallmap"></div> |
---|
46 | <div id="docs"> |
---|
47 | <p>The vector layer shown uses the BBOX strategy, the WFS protocol, |
---|
48 | and the GML format. The BBOX strategy fetches features within a |
---|
49 | bounding box. When the map bounds invalidate the data bounds, |
---|
50 | another request is triggered. The WFS protocol gets features |
---|
51 | through a WFS request. The GML format is used to serialize |
---|
52 | features.</p> |
---|
53 | </div> |
---|
54 | </body> |
---|
55 | </html> |
---|