Permalink
Browse files

clicking on waypoints shows the cities where we start now...

  • Loading branch information...
1 parent befa055 commit f3536c9138107c610d8d95464681934e8dfe5f63 Jake McGinty committed May 9, 2012
Showing with 37 additions and 14 deletions.
  1. +12 −7 static/js/script.coffee
  2. +20 −6 static/js/script.js
  3. +1 −1 static/js/script.min.js
  4. +4 −0 views/layout.jade
@@ -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"
@@ -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
View
@@ -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 = {
Oops, something went wrong.
View
@@ -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

0 comments on commit f3536c9

Please sign in to comment.