diff --git a/lib/template/address-html.php b/lib/template/address-html.php
index 4a9f6325..b4c7533e 100644
--- a/lib/template/address-html.php
+++ b/lib/template/address-html.php
@@ -14,6 +14,7 @@
+ <>
max zoom
diff --git a/lib/template/search-html.php b/lib/template/search-html.php
index 02c338cd..14ebacc8 100644
--- a/lib/template/search-html.php
+++ b/lib/template/search-html.php
@@ -27,7 +27,7 @@
diff --git a/website/css/search.css b/website/css/search.css
index d018ab94..eb0d06d7 100644
--- a/website/css/search.css
+++ b/website/css/search.css
@@ -26,6 +26,12 @@ form label {
right: 0
}
+#switch-coords {
+ font-size: 0.8em;
+ font-weight: bold;
+ cursor: pointer;
+}
+
.sidebar {
width: 25%;
padding: 15px;
diff --git a/website/js/nominatim-ui.js b/website/js/nominatim-ui.js
index 7c19b17a..c5e91cf7 100644
--- a/website/js/nominatim-ui.js
+++ b/website/js/nominatim-ui.js
@@ -72,6 +72,15 @@ jQuery(document).on('ready', function(){
html_viewbox = "viewbox: " + map_viewbox_as_string();
$('#map-position-inner').html([html_center,html_zoom,html_viewbox,html_click,html_mouse].join('
'));
+
+ var reverse_params = {
+ lat: map.getCenter().lat.toFixed(5),
+ lon: map.getCenter().lng.toFixed(5),
+ zoom: map.getZoom(),
+ format: 'html'
+ }
+ $('#switch-to-reverse').attr('href', 'reverse.php?' + $.param(reverse_params));
+
$('input#use_viewbox').trigger('change');
}
@@ -202,6 +211,14 @@ jQuery(document).on('ready', function(){
$('form input[name=lon]').val( e.latlng.lng);
$('form').submit();
});
+
+ $('#switch-coords').on('click', function(e){
+ var lat = $('form input[name=lat]').val();
+ var lon = $('form input[name=lon]').val();
+ $('form input[name=lat]').val(lon);
+ $('form input[name=lon]').val(lat);
+ $('form').submit();
+ });
}
highlight_result(0, false);