Add simple/structured query selector to HTML search page (#1722)

This commit is contained in:
galewis2
2020-05-07 19:29:44 -04:00
committed by GitHub
parent fc19ebb218
commit a5e3785843
4 changed files with 90 additions and 20 deletions

View File

@@ -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){