diff options
-rw-r--r-- | templates/web/base/around/postcode_form.html | 6 | ||||
-rw-r--r-- | web/js/geolocation.js | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/templates/web/base/around/postcode_form.html b/templates/web/base/around/postcode_form.html index da744e1d0..0ffff711e 100644 --- a/templates/web/base/around/postcode_form.html +++ b/templates/web/base/around/postcode_form.html @@ -27,7 +27,11 @@ <input type="hidden" name="filter_category" value="[% c.user.categories_string | html %]"> [% END %] </form> - <a href="[% c.uri_for('/around') %]" id="geolocate_link">… [% loc('or locate me automatically') %]</a> + [%~ SET link_params = {}; + IF c.get_param('filter_category'); link_params.filter_category = c.get_param('filter_category') | uri; END; + IF c.get_param('filter_group'); link_params.filter_group = c.get_param('filter_group') | uri; END; + %] + <a href="[% c.uri_for('/around', link_params) | html %]" id="geolocate_link">… [% loc('or locate me automatically') %]</a> [% UNLESS possible_location_matches %] [% INCLUDE 'around/_postcode_form_post.html' %] diff --git a/web/js/geolocation.js b/web/js/geolocation.js index fbef4d7ea..63599d4c1 100644 --- a/web/js/geolocation.js +++ b/web/js/geolocation.js @@ -34,7 +34,7 @@ fixmystreet.geolocate = function(element, success_callback) { fixmystreet.geolocate(link, function(pos) { var latitude = pos.coords.latitude.toFixed(6); var longitude = pos.coords.longitude.toFixed(6); - var coords = 'latitude=' + latitude + ';longitude=' + longitude; + var coords = 'lat=' + latitude + '&lon=' + longitude; location.href = link.href + (link.href.indexOf('?') > -1 ? ';' : '?') + coords; }); } else { |