From c34de9571c1db71f64396625a473fcb54100a9d8 Mon Sep 17 00:00:00 2001 From: shunwen Date: Fri, 10 Jan 2014 02:37:07 +0900 Subject: [PATCH] Reverted to the first map version --- map.coffee | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/map.coffee b/map.coffee index e30cde2..59cb046 100644 --- a/map.coffee +++ b/map.coffee @@ -9,24 +9,14 @@ module.exports = (robot) -> robot.respond /(?:(satellite|terrain|hybrid)[- ])?map me (.+)/i, (msg) -> mapType = msg.match[1] or "roadmap" location = msg.match[2] - query = { - markers: escape(location), - size: '400x400', - maptype: mapType, - sensor: false, - format: 'png' - } - msg - .http("http://maps.google.com/maps/api/staticmap") - .query(query) - .get() (err, res, body) -> - msg.send body - + mapUrl = "http://maps.google.com/maps/api/staticmap?markers=" + + + + "&size=400x400&maptype=" + + mapType + + "&sensor=false" + + "&format=png" # So campfire knows it's an image url = "http://maps.google.com/maps?q=" + escape(location) + "&hl=en&sll=37.0625,-95.677068&sspn=73.579623,100.371094&vpsrc=0&hnear=" + escape(location) + "&t=m&z=11" - - #msg.send mapUrl - #msg.send url