- var params = Qs.parse(path.substring(path.indexOf("?") + 1));
- $(".search_form input[name=query]").val(params.query);
- $(".describe_location").hide();
+ const params = new URLSearchParams(path.substring(path.indexOf("?")));
+ if (params.has("query")) {
+ $(".search_form input[name=query]").val(params.get("query"));
+ $(".describe_location").hide();
+ } else if (params.has("lat") && params.has("lon")) {
+ $(".search_form input[name=query]").val(params.get("lat") + ", " + params.get("lon"));
+ $(".describe_location").hide();
+ }