From fa44970fd1f975a2c8c9b676911ced651987926d Mon Sep 17 00:00:00 2001 From: Tim Head Date: Tue, 18 Nov 2014 14:37:48 +0100 Subject: [PATCH] Rudimentary smart box on the landing page --- app.py | 9 +++++++++ views/index.html | 31 ++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index cab4b75..1b011a6 100755 --- a/app.py +++ b/app.py @@ -30,6 +30,15 @@ def showMap(threewords): return template('index', err="Could not find location {}".format(threewords)) +@get('/latlng/,') +def showMapFromLatLng(lat, lng): + try: + threewords = these.three_words((lat, lng)) + return template('map', lat=lat, lng=lng, threewords=threewords) + except: + return template('index', + err="Could not find location {}".format(threewords)) + # API @get('/api/,') diff --git a/views/index.html b/views/index.html index 931c71a..bd5a8f7 100644 --- a/views/index.html +++ b/views/index.html @@ -8,8 +8,33 @@ + + - +
% if err: @@ -30,7 +55,7 @@ - -->