Skip to content

Commit

Permalink
Reverted to the first map version
Browse files Browse the repository at this point in the history
  • Loading branch information
shunwen committed Jan 9, 2014
1 parent f088892 commit c34de95
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions map.coffee
Expand Up @@ -9,24 +9,14 @@ module.exports = (robot) ->
robot.respond /(?:(satellite|terrain|hybrid)[- ])?map me (.+)/i, (msg) -> robot.respond /(?:(satellite|terrain|hybrid)[- ])?map me (.+)/i, (msg) ->
mapType = msg.match[1] or "roadmap" mapType = msg.match[1] or "roadmap"
location = msg.match[2] location = msg.match[2]
query = { mapUrl = "http://maps.google.com/maps/api/staticmap?markers=" +
markers: escape(location), +
size: '400x400', "&size=400x400&maptype=" +
maptype: mapType, mapType +
sensor: false, "&sensor=false" +
format: 'png' "&format=png" # So campfire knows it's an image
}
msg
.http("http://maps.google.com/maps/api/staticmap")
.query(query)
.get() (err, res, body) ->
msg.send body

url = "http://maps.google.com/maps?q=" + url = "http://maps.google.com/maps?q=" +
escape(location) + escape(location) +
"&hl=en&sll=37.0625,-95.677068&sspn=73.579623,100.371094&vpsrc=0&hnear=" + "&hl=en&sll=37.0625,-95.677068&sspn=73.579623,100.371094&vpsrc=0&hnear=" +
escape(location) + escape(location) +
"&t=m&z=11" "&t=m&z=11"

#msg.send mapUrl
#msg.send url

0 comments on commit c34de95

Please sign in to comment.