-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrial.html
76 lines (63 loc) · 2.34 KB
/
trial.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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"type="text/css">
<style>
img{
border: 0px;
box-shadow: 0 0 0px;
}
#header_wrap{
height: 100px;
}
.inner{
padding: 0;
}
#project_title{
margin-top: -30px;
}
</style>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script src="SliderControl.js"></script>
<body>
<div id="map" style="width: 100%; height: 1500px"></div>
<script type="text/javascript">
map = L.map('map').setView([48.107296, -1.682348],7);
L.tileLayer('http://{s}.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/997/256/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
}).addTo(map);
function getData() {
var features = [];
$.get("http://bigdata04t.bbo1t.local:8080/api/marker", function(data) {
$.each(data.requete, function(i, item) {
features.push({
"type" : "Feature",
"properties" : {
"time": item.date_ts },
"geometry" : {
"type" : "Point",
"coordinates" : [ item.longitude, item.latitude, 1 ] }
});
});
console.log(features);
//return { "type" : "FeatureCollection", "features": features };
var testlayer = L.geoJson({ "type" : "FeatureCollection", "features": features });
var sliderControl = L.control.sliderControl({position: "topright", layer: testlayer});
//Make sure to add the slider to the map ;-)
map.addControl(sliderControl);
//An initialize the slider
sliderControl.startSlider();
}, "json" );
}
</script>
<script>
//setInterval(getPoints, 1000);
$(document).ready(getData());
</script>
</body>
</html>