-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathinstagram-map.html
More file actions
59 lines (43 loc) · 1.46 KB
/
instagram-map.html
File metadata and controls
59 lines (43 loc) · 1.46 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
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyDD3o_vzkcWmw4-yDtuFZ0F4lioqWn8eU8"></script>
<script src="http://cooper-union-maps-proxy.herokuapp.com/js/draw.js"></script>
<script>
$.getJSON("http://cooper-union-instagram-proxy.herokuapp.com/search/tag/nyc?count=33", function(response){
console.log(response);
var howMany = 0;
var positionsOfPhotos = [];
for(var i=0; i<response.length; i++) {
// $("body").append("<img src="+response[i].images.thumbnail.url+" />");
if((response[i].location) && (response[i].location.latitude !== null)) {
howMany++;
var position = {
"title":response[i].caption.text,
"map": new google.maps.LatLng(response[i].location.latitude,response[i].location.longitude),
"link":response[i].link
}
positionsOfPhotos.push(position);
}
}
console.log(howMany)
console.log(positionsOfPhotos)
var mapOptions = {
zoom: 10,
center: new google.maps.LatLng(40.7293827,-73.9894186)
};
draw('map', mapOptions, positionsOfPhotos);
});
</script>
<style>
#map {
height:500px;
width:800px;
}
</style>
</head>
<body>
<div id="map"></div>
</body>
</html>