-
Notifications
You must be signed in to change notification settings - Fork 38
/
strategy-bbox.html
72 lines (67 loc) · 3.01 KB
/
strategy-bbox.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers BBOX Strategy 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/OpenLayers.js"></script>
<script type="text/javascript">
var map, photos;
OpenLayers.ProxyHost = (window.location.host == "localhost") ?
"/cgi-bin/proxy.cgi?url=" : "proxy.cgi?url=";
function init() {
map = new OpenLayers.Map('map', {
restrictedExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
});
var base = new OpenLayers.Layer.WMS("Imagery",
["http://t1.hypercube.telascience.org/tiles?",
"http://t2.hypercube.telascience.org/tiles?",
"http://t3.hypercube.telascience.org/tiles?",
"http://t4.hypercube.telascience.org/tiles?"],
{layers: 'landsat7'}
);
var style = new OpenLayers.Style({
externalGraphic: "${img_url}",
pointRadius: 30
});
photos = new OpenLayers.Layer.Vector("Photos", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.HTTP({
url: "http://labs.metacarta.com/flickrbrowse/flickr.py/flickr",
params: {
format: "WFS",
sort: "interestingness-desc",
service: "WFS",
request: "GetFeatures",
srs: "EPSG:4326",
maxfeatures: 10
},
format: new OpenLayers.Format.GML()
}),
styleMap: new OpenLayers.StyleMap(style)
});
map.addLayers([base, photos]);
map.setCenter(new OpenLayers.LonLat(-116.45, 35.42), 5);
}
</script>
</head>
<body onload="init()">
<h1 id="title">BBOX Strategy Example</h1>
<div id="tags">
vector, feature, stylemap, wfs, bbox, strategy, cleanup
</div>
<p id="shortdesc">
Uses a BBOX strategy to request features within a bounding box.
</p>
<div id="map" class="smallmap"></div>
<div id="docs">
<p>The BBOX strategy requests data within a bounding box. When the
previously requested data bounds are invalidated (by browsing to
some area not covered by those bounds), another request for data
is issued.</p>
</div>
</body>
</html>