Skip to content

Commit dea658e

Browse files
added google map div to homepage. javascript parses city list for map data but does not yet render a map.
1 parent 89b64a5 commit dea658e

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

_layouts/default.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<link rel="stylesheet" href="/stylesheets/reset.css" />
1313
<link rel="stylesheet" href="/stylesheets/index.css" />
1414
<link rel="stylesheet" href="/stylesheets/bootstrap-responsive.min.css" />
15+
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
16+
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key={{ site.google_api_key }}&sensor=false"></script>
17+
<script type="text/javascript" src="/javascripts/google_map.js"></script>
1518
</head>
1619

1720
<body>

assets/index.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ $text-indent: 25px;
6767
}
6868
}
6969

70+
#google_map.js {
71+
height: 350px;
72+
margin-bottom: $margin-big;
73+
}
74+
7075
.wrapper {
7176
padding: $margin-small $margin-flex $margin-big $margin-flex;
7277
border-top: solid 1px $white;

index.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ OpenHack is a meetup with a simple purpose: Code together, on anything.
99

1010
OpenHack works by hosting a meetup in your city that gets programmers of any experience level together to code.
1111

12+
<div id="google_map"> </div>
13+
1214
### The Basics
1315

1416
* You can hack on anything! Any language, framework, public/open-source, personal, etc.

javascripts/google_map.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$(function(){
2+
3+
4+
$("#google_map").addClass("js");
5+
6+
7+
var cities = [];
8+
$("ul#cities li").each(function(){
9+
var a, li;
10+
li = $(this);
11+
a = $(this).find("a");
12+
cities.push({
13+
name: a.text(),
14+
id: li.attr("id"),
15+
url: a.attr("href"),
16+
lat: li.attr("data-latitude"),
17+
lng: li.attr("data-longitude")
18+
});
19+
})
20+
21+
22+
});

stylesheets/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ a {
4343
height: 70px;
4444
padding-top: 40px; } }
4545

46+
#google_map.js {
47+
height: 350px;
48+
margin-bottom: 20px; }
49+
4650
.wrapper {
4751
padding: 10px 5% 20px 5%;
4852
border-top: solid 1px white;

0 commit comments

Comments
 (0)