Skip to content

Instantly share code, notes, and snippets.

@kieran
Created March 8, 2010 20:03
Show Gist options
  • Save kieran/325525 to your computer and use it in GitHub Desktop.
Save kieran/325525 to your computer and use it in GitHub Desktop.
# the 26 Dupont bus route in Toronto, Canada
bus_route = CloudMade.path :points=> [[43.66749, -79.39982], [43.66801, -79.39736], [43.66926, -79.3979], [43.67031, -79.39827], [43.67073, -79.39832], [43.6727, -79.39913], [43.67437, -79.39981], [43.67512, -79.39994], [43.67636, -79.4005], [43.67623, -79.40087], [43.6758, -79.40253], [43.67534, -79.40473], [43.67485, -79.40708], [43.67449, -79.40881], [43.67416, -79.40953], [43.67367, -79.4118], [43.67313, -79.41436], [43.67249, -79.4173], [43.67162, -79.42153], [43.67095, -79.42491], [43.67057, -79.42658], [43.6702, -79.42822], [43.67008, -79.42878], [43.67008, -79.42902], [43.67023, -79.42951], [43.67028, -79.42986], [43.66969, -79.43273], [43.66944, -79.43393], [43.66894, -79.43642], [43.66856, -79.43827], [43.66845, -79.43902], [43.66849, -79.43991], [43.66814, -79.44181], [43.6678, -79.44344], [43.66773, -79.4436], [43.66724, -79.44414], [43.66717, -79.44429], [43.66673, -79.44644], [43.66572, -79.45121], [43.66513, -79.45413], [43.66482, -79.45559], [43.66455, -79.45657], [43.66431, -79.45776], [43.66454, -79.45862], [43.66413, -79.45945], [43.66376, -79.46113], [43.66344, -79.46269], [43.66347, -79.46293], [43.66365, -79.46379], [43.66365, -79.46379], [43.66379, -79.46453], [43.66382, -79.46486], [43.66339, -79.46695], [43.66289, -79.46924], [43.66223, -79.47224], [43.66194, -79.47348], [43.66175, -79.4739], [43.66128, -79.47466], [43.66111, -79.4752], [43.66056, -79.47767], [43.66006, -79.48], [43.65944, -79.48282], [43.65891, -79.48525], [43.65861, -79.48661], [43.65827, -79.48812], [43.65541, -79.48695], [43.65296, -79.48596], [43.65166, -79.48544], [43.64932, -79.4845]]
# St George Station
start_marker = CloudMade.marker :url=>'http://myttc.ca/images/markerS.png', :opacity=>0.3, :lat=>43.66749, :lng=>-79.39982
# Christie Station
end_marker = CloudMade.marker :url=>'http://myttc.ca/images/markerE.png', :opacity=>0.3, :lat=>43.64932, :lng=>-79.4845
# bounding box, with 1/8 padding
bbox = [ 43.6763687134, -79.3973693848, 43.6493263245, -79.4881286621, 0.125 ]
# Map that shit!
CloudMade.static_map(:width=>720, :height=>360, :format=>'jpg', :markers=>[start_marker, end_marker], :paths=>[bus_route], :bbox=>bbox).to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment