-
Notifications
You must be signed in to change notification settings - Fork 11
/
georss.html
81 lines (75 loc) · 3.38 KB
/
georss.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
73
74
75
76
77
78
79
80
<!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">
<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.13.custom.css" type="text/css" />
<link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<script src="lib/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="lib/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
<script src="http://openlayers.org/api/OpenLayers.js" type="text/javascript"></script>
<script src="lib/OpenLayers.Format.GeoRSSTimeline.js" type="text/javascript"></script>
<script src="timeline.js" type="text/javascript"></script>
<script type="text/javascript">
var map, timeline;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'}, {numZoomLevels: 5});
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(0, 0), 2);
var ts_funct = function(d) {
return ((new Date(d)).getTime() / 1000);
}
timeline = new OpenLayers.Timeline({map: map,
timeline: "#timeline",
name_key: "title",
date_key: "published",
date_funct: ts_funct,
format: OpenLayers.Format.GeoRSSTimeline});
$.ajax({
type: "GET",
url: "data/flickr.xml",
dataType: "xml",
success: function(data) {
$("#status").text("Data loaded");
timeline.initTimeline(data);
}
});
}
function toggleCumulative() {
if ($("#cumulative").attr("checked")) {
timeline.cumulative = true;
}
else {
timeline.cumulative = false;
}
timeline.update();
}
$(document).ready(function() {
init();
timeline.cumulative = true;
$("#cumulative").attr("checked", "checked");
});
</script>
</head>
<body>
<h1 id="title">OpenLayers Timeline GeoRSS Demo</h1>
<div id="container">
<p>You're are seeing the timeline of <a href="data/flickr.xml">this GeoRSS</a> taken from the GeoTagging group on Flickr</p>
<p id="status">Loading...</p>
<div id="controls">
<input type="button" onclick="timeline.togglePlay();" value="Play/Pause" />
<input type="button" onclick="timeline.fasterAnimation();" value="Faster" />
<input type="button" onclick="timeline.slowerAnimation();" value="Slower" />
<label for="cumulative">Cumulative</label>
<input id="cumulative" type="checkbox" onChange="toggleCumulative();" />
</div>
<div id="timeline"></div>
<div id="map" class="smallmap"></div>
</div>
</body>
</html>