mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
UI: allow copy&pasting lat,lon into the lat search field
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
<input name="format" type="hidden" value="html">
|
<input name="format" type="hidden" value="html">
|
||||||
lat
|
lat
|
||||||
<input name="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo $fLat; ?>" >
|
<input name="lat" type="text" class="form-control input-sm" placeholder="latitude" value="<?php echo $fLat; ?>" >
|
||||||
<span id="switch-coords" title="switch lat and lon"><></span>
|
<button class="btn btn-default btn-xs" id="switch-coords" title="switch lat and lon"><></button>
|
||||||
lon
|
lon
|
||||||
<input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo $fLon; ?>" >
|
<input name="lon" type="text" class="form-control input-sm" placeholder="longitude" value="<?php echo $fLon; ?>" >
|
||||||
max zoom
|
max zoom
|
||||||
|
|||||||
@@ -248,6 +248,14 @@ jQuery(document).on('ready', function(){
|
|||||||
|
|
||||||
highlight_result(0, false);
|
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]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user