]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/js/nominatim-ui.js
UI: allow copy&pasting lat,lon into the lat search field
[nominatim.git] / website / js / nominatim-ui.js
index 0560b45ff3b4625930e2baa94cc54738af0dacab..956feae699f03dfc19e71a004211965030d30f69 100644 (file)
@@ -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]);
+        }
+    });
 
 });