forked from TeehanLax/Hyperlapse.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.html
More file actions
60 lines (48 loc) · 1.37 KB
/
simple.html
File metadata and controls
60 lines (48 loc) · 1.37 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Simple Example</title>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false" type="text/javascript"></script>
<script src="js/three.min.js"></script>
<script src="js/GSVPano.js"></script>
<script src="../src/Hyperlapse.js"></script>
<script>
function init() {
var hyperlapse = new Hyperlapse(document.getElementById('pano'), {
lookat: new google.maps.LatLng(37.81409525128964,-122.4775045005249),
zoom: 1,
elevation: 50
});
hyperlapse.onError = function(e) {
console.log(e);
};
hyperlapse.onRouteComplete = function(e) {
hyperlapse.load();
};
hyperlapse.onLoadComplete = function(e) {
hyperlapse.play();
};
// Google Maps API stuff here...
var directions_service = new google.maps.DirectionsService();
var route = {
request:{
origin: new google.maps.LatLng(37.816480000000006,-122.47825,37),
destination: new google.maps.LatLng(37.81195,-122.47773000000001),
travelMode: google.maps.DirectionsTravelMode.DRIVING
}
};
directions_service.route(route.request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
hyperlapse.generate( {route:response} );
} else {
console.log(status);
}
});
}
window.onload = init;
</script>
</head>
<body>
<div id="pano"></div>
</body>
</html>