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();
+ $("div.form-group-structured .form-control").prop('disabled', true);
+ $("div.form-group-simple .form-control").prop('disabled', false);
+ $('.form-group-structured').find('input:text').val('');
+ }
+ else if (query_val == "structured") {
+ $("div.form-group-simple").hide();
+ $("div.form-group-structured").show();
+ $("div.form-group-structured .form-control").prop('disabled', false);
+ $("div.form-group-simple .form-control").prop('disabled', true);
+ $('.form-group-simple').find('input:text').val('');
+ }
+ });
+
+ if (nominatim_structured_query) {
+ $('input#structured').prop('checked', true).trigger('click');
+ } else {
+ $('input#simple').prop('checked', true).trigger('click');
+ }
+ });
+
map = new L.map('map', {
attributionControl: (nominatim_map_init.tile_attribution && nominatim_map_init.tile_attribution.length),
scrollWheelZoom: true, // !L.Browser.touch,
circle.on('click', function(){
highlight_result(position);
});
- layerGroup.addLayer(circle);
+ layerGroup.addLayer(circle);
}
if (result.aBoundingBox){