Skip to content

Commit

Permalink
clicking on waypoints shows the cities where we start now...
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake McGinty committed May 9, 2012
1 parent befa055 commit f3536c9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
19 changes: 12 additions & 7 deletions static/js/script.coffee
Expand Up @@ -85,21 +85,27 @@ $(document).ready ->
current = null

setTimeout (->
new google.maps.Marker
title = '<div id="content">Urbana, IL</div>'
marker = new google.maps.Marker
map:map
animation:google.maps.Animation.DROP
position:home
icon:'http://www.google.com/mapfiles/marker_black.png'
title:"Urbana, IL"
icon:"http://www.google.com/mapfiles/marker_black.png"
title:title

google.maps.event.addListener marker, 'click', -> (new google.maps.InfoWindow content:title).open(map,marker)
), 500

setTimeout (->
new google.maps.Marker
title = '<div id="content">Santa Monica, CA</div>'
marker = new google.maps.Marker
map:map
animation:google.maps.Animation.DROP
position:hulu
icon:'http://www.google.com/mapfiles/marker_black.png'
title:"Santa Monica, CA"
icon:"http://www.google.com/mapfiles/marker_black.png"
title:title

google.maps.event.addListener marker, 'click', -> (new google.maps.InfoWindow content:title).open(map,marker)
), 1000
polyOptions =
strokeColor: "#CC2239"
Expand All @@ -113,7 +119,6 @@ $(document).ready ->
socket.emit "message", "Message Sent on " + new Date()

socket.on "location_backfill", (pts) ->
#console.log("Received encoded backfill polyline: #{pts.encodedPoints}")
path = google.maps.geometry.encoding.decodePath pts.encodedPoints
poly.setPath path
current = new google.maps.Marker
Expand Down
26 changes: 20 additions & 6 deletions static/js/script.js
Expand Up @@ -116,21 +116,35 @@
hulu = new google.maps.LatLng(34.031344, -118.456717);
current = null;
setTimeout((function() {
return new google.maps.Marker({
var marker, title;
title = '<div id="content">Urbana, IL</div>';
marker = new google.maps.Marker({
map: map,
animation: google.maps.Animation.DROP,
position: home,
icon: 'http://www.google.com/mapfiles/marker_black.png',
title: "Urbana, IL"
icon: "http://www.google.com/mapfiles/marker_black.png",
title: title
});
return google.maps.event.addListener(marker, 'click', function() {
return (new google.maps.InfoWindow({
content: title
})).open(map, marker);
});
}), 500);
setTimeout((function() {
return new google.maps.Marker({
var marker, title;
title = '<div id="content">Santa Monica, CA</div>';
marker = new google.maps.Marker({
map: map,
animation: google.maps.Animation.DROP,
position: hulu,
icon: 'http://www.google.com/mapfiles/marker_black.png',
title: "Santa Monica, CA"
icon: "http://www.google.com/mapfiles/marker_black.png",
title: title
});
return google.maps.event.addListener(marker, 'click', function() {
return (new google.maps.InfoWindow({
content: title
})).open(map, marker);
});
}), 1000);
polyOptions = {
Expand Down
2 changes: 1 addition & 1 deletion static/js/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions views/layout.jade
Expand Up @@ -28,6 +28,10 @@ html
font: 0.8em Helvetica, sans-serif;
display: inline-block;
}
#content {
margin: 20px;
font: 1.2em Helvetica, sans-serif;
}
body
block content

Expand Down

0 comments on commit f3536c9

Please sign in to comment.