Repository navigation
Expand file tree
/
Copy pathdata_controller.js
More file actions
76 lines (72 loc) · 3.34 KB
/
Copy pathdata_controller.js
File metadata and controls
76 lines (72 loc) · 3.34 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// initilization
var index = 0;
var schoolIndex ;
$( document ).ready(function() {
schoolIndex = window.location.href.split("=")[1];
for(var i = 0; i < allData[schoolIndex]["buildings"].length; i++) {
$("#menu_bar").append('<a class="dropdown-item" onclick="goToNextPlaceWithIndex(' + i + ')">' + allData[schoolIndex]["buildings"][i].title + '</a>');
}
$("#title").text(allData[schoolIndex]["buildings"][index].title);
$("#description1").text(allData[schoolIndex]["buildings"][index].description1);
$("#description2").text(allData[schoolIndex]["buildings"][index].description2);
$("#heading").text('Virtourgo | ' + allData[schoolIndex]["buildings"][index].title);
// $("#description2").attr("src", allData[schoolIndex]["buildings"][0].img);
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'), {
position: {lat: allData[schoolIndex]["buildings"][index].lat, lng: allData[schoolIndex]["buildings"][index].lng},
pov: {
heading: allData[schoolIndex]["buildings"][index].heading,
pitch: allData[schoolIndex]["buildings"][index].pitch,
}
});
map.setStreetView(panorama);
});
function goToNextPlace() {
index++;
if (index < allData[schoolIndex]["buildings"].length) {
$("#title").text(allData[schoolIndex]["buildings"][index].title);
$("#description1").text(allData[schoolIndex]["buildings"][index].description1);
$("#description2").text(allData[schoolIndex]["buildings"][index].description2);
$("#heading").text('Virtourgo | ' + allData[schoolIndex]["buildings"][index].title);
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'), {
position: {lat: allData[schoolIndex]["buildings"][index].lat, lng: allData[schoolIndex]["buildings"][index].lng},
pov: {
heading: allData[schoolIndex]["buildings"][index].heading,
pitch: allData[schoolIndex]["buildings"][index].pitch,
}
});
map.setStreetView(panorama);
} else {
window.location.href = "index.html";
}
}
function initialize() {
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'), {
position: {lat: allData[schoolIndex]["buildings"][index].lat, lng: allData[schoolIndex]["buildings"][index].lng},
pov: {
heading: allData[schoolIndex]["buildings"][index].heading,
pitch: allData[schoolIndex]["buildings"][index].pitch,
}
});
map.setStreetView(panorama);
}
function goToNextPlaceWithIndex(gotoIndex) {
if (index < allData[schoolIndex]["buildings"].length) {
index = gotoIndex;
$("#title").text(allData[schoolIndex]["buildings"][index].title);
$("#description1").text(allData[schoolIndex]["buildings"][index].description1);
$("#description2").text(allData[schoolIndex]["buildings"][index].description2);
$("#heading").text('Virtourgo | ' + allData[schoolIndex]["buildings"][index].title);
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'), {
position: {lat: allData[schoolIndex]["buildings"][index].lat, lng: allData[schoolIndex]["buildings"][index].lng},
pov: {
heading: allData[schoolIndex]["buildings"][index].heading,
pitch: allData[schoolIndex]["buildings"][index].pitch,
}
});
map.setStreetView(panorama);
}
}