-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
142 lines (130 loc) · 4.85 KB
/
index.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Airbnb-0222 by will-ryu</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
<script src="https://code.jquery.com/jquery-git2.min.js"></script>
</head>
<script>
var map;
function initMap() {
var airbnb = {lat: 37.7717415, lng: -122.4074766};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 3,
center: airbnb
});
var imagePath = "images/profile/64x64/";
var markers = [];
var infoWindow = [];
$.ajax({
url: "resources/data.json",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.length; i++) {
var profile = imagePath + data[i].Name + ".png";
var place = "images/place/" + data[i].Name + ".jpg"
var pos = {lat: data[i].Lat, lng: data[i].Lng};
markers[i] = new google.maps.Marker({
position: pos,
map: map,
icon: profile,
id: i
});
markers[i].addListener('click', function () {
var marker = markers[this.id];
marker.setAnimation(google.maps.Animation.BOUNCE);
if (map.zoom < 6) {
map.setZoom(6);
}
setTimeout(function () {
marker.setAnimation(null);
}, 2250);
});
var content = '<div class="travel">' +
'<div>' +
'<img src="' + place + '" style="width: 100%"' +
'</div>' +
'<div id="name_headline" style="color: #82888a;">' +
'<a href="https://one.airbnb.com/people/' + data[i].Name.replace(" ", "_") + '">' +
data[i].Name +
"</a></div>" +
'<div id="location" style="color: #ff5a5f" >' +
data[i].Location +
"</div>" +
'<div id="description" style="color: #565a5c;">' +
data[i].Description +
"</div>" +
"</div>";
infoWindow[i] = new google.maps.InfoWindow({
content: content,
maxWidth: 280,
maxHeight: 243,
});
$("#contents").append(content);
google.maps.event.addListener(markers[i], 'click', function () {
// Close all info windows before opening a new one.
for (var idx = 0; idx < infoWindow.length; idx++) {
infoWindow[idx].close();
}
infoWindow[this.id].open(map, markers[this.id]);
});
}
}
});
}
$(document).ready(function () {
// you want to enable the pointer events only on click;
$('#map').addClass('scrolloff'); // set the pointer events to none on doc ready
$('.container').on('click', function () {
$('#map').removeClass('scrolloff'); // set the pointer events true on click
});
// you want to disable pointer events when the mouse leave the canvas area;
$("#map").mouseleave(function () {
$('#map').addClass('scrolloff'); // set the pointer events to none when mouse leaves the map area
});
});
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyABG80SflOUni_QkK41Yxqd0p43BQKmNXE&callback=initMap">
</script>
<body>
<section class="page-header">
<h1 class="project-name">
<img class="belo" src="images/airbnb_vertical_lockup_white.png">
Belong Anywhere...
</h1>
<BR>
<img src="images/group_photo.jpg" width="80%" style="max-width: 700px"><BR>
<h2 class="project-tagline">The 42 new hires of 2.22.16 share the places where they most belong.</h2>
</section>
<div class="container" style="margin:0px 0px;">
<div id="map" style="height:700px;"></div>
<div id="contents"></div>
</div>
<section class="site-footer">
<div class="site-footer-credits">
<B>2/22 New-hire Challenge Team</B><BR>
<a href="https://one.airbnb.com/people/Amanda_Vawter">Amanda Vawter</a>
|
<a href="https://one.airbnb.com/people/ankit_agarwal">Ankit Agarwal</a>
|
<a href="https://one.airbnb.com/people/Chase_Munson">Chase Munson</a>
|
<a href="https://one.airbnb.com/people/Jeremy_Huang">Jeremy Huang</a>
|
<a href="https://one.airbnb.com/people/John_Bodley">John Bodley</a>
|
<a href="https://one.airbnb.com/people/Logan_ury">Logan Ury</a>
|
<a href="https://one.airbnb.com/people/Phil_Nachum">Phil Nachum</a>
|
<a href="https://one.airbnb.com/people/will_ryu">Will Ryu</a>
</div>
</section>
</body>
</html>