From 3cee2d185dcaf3a52986bb5a1dca8514a9c7d251 Mon Sep 17 00:00:00 2001 From: marc tobias Date: Sat, 21 Oct 2017 14:11:46 +0200 Subject: [PATCH] UI: allow copy&pasting lat,lon into the lat search field --- lib/template/address-html.php | 2 +- website/js/nominatim-ui.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/template/address-html.php b/lib/template/address-html.php index db735477..621c9773 100644 --- a/lib/template/address-html.php +++ b/lib/template/address-html.php @@ -15,7 +15,7 @@ lat - <> + lon max zoom diff --git a/website/js/nominatim-ui.js b/website/js/nominatim-ui.js index 0560b45f..956feae6 100644 --- a/website/js/nominatim-ui.js +++ b/website/js/nominatim-ui.js @@ -248,6 +248,14 @@ jQuery(document).on('ready', function(){ highlight_result(0, false); + // common mistake is to copy&paste latitude and longitude into the 'lat' search box + $('form input[name=lat]').on('change', function(){ + var coords = $(this).val().split(','); + if (coords.length == 2) { + $(this).val(coords[0]); + $(this).siblings('input[name=lon]').val(coords[1]); + } + }); }); -- 2.45.1