diff --git a/app.py b/app.py index d6b360a..fe44171 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)) + @get('/latlng/,') def showMapFromLatLng(lat, lng): diff --git a/views/index.html b/views/index.html index 4b96b8a..1e6fd61 100644 --- a/views/index.html +++ b/views/index.html @@ -11,7 +11,7 @@ - +
% if err: