mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Add simple/structured query selector to HTML search page (#1722)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
|
||||
|
||||
form {
|
||||
.top-bar {
|
||||
width: 100%;
|
||||
padding: 1em 15px;
|
||||
}
|
||||
form #q {
|
||||
min-width: 500px;
|
||||
|
||||
.top-bar #q {
|
||||
max-width: 500px;
|
||||
}
|
||||
@media (max-width: 850px) {
|
||||
form #q {
|
||||
@@ -147,6 +147,17 @@ footer p {
|
||||
width: 100%;
|
||||
}
|
||||
.search-button-group {
|
||||
display: inline
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
.search-button-group {
|
||||
margin-top: 3px;
|
||||
box-sizing: content-box;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,11 +20,27 @@ function parse_and_normalize_geojson_string(raw_string){
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
if ( !$('#search-page,#reverse-page').length ){ return; }
|
||||
|
||||
|
||||
var is_reverse_search = !!( $('#reverse-page').length );
|
||||
|
||||
$('#q').focus();
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input[name='query-selector']").click(function(){
|
||||
var query_val = $("input[name='query-selector']:checked").val() ;
|
||||
if (query_val == "simple") {
|
||||
$("div.form-group-structured").hide();
|
||||
$("div.form-group-simple").show();
|
||||
$('.form-group-structured').find('input:text').val('');
|
||||
}
|
||||
else if (query_val == "structured") {
|
||||
$("div.form-group-simple").hide();
|
||||
$("div.form-group-structured").show();
|
||||
$('.form-group-simple').find('input:text').val('');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
map = new L.map('map', {
|
||||
attributionControl: (nominatim_map_init.tile_attribution && nominatim_map_init.tile_attribution.length),
|
||||
scrollWheelZoom: true, // !L.Browser.touch,
|
||||
@@ -185,7 +201,7 @@ jQuery(document).ready(function(){
|
||||
circle.on('click', function(){
|
||||
highlight_result(position);
|
||||
});
|
||||
layerGroup.addLayer(circle);
|
||||
layerGroup.addLayer(circle);
|
||||
}
|
||||
if (result.aBoundingBox){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user