PageSourceSearch

https://totlrealty.com/wp-content/themes/wpresidence/js/geolocation_search_radius.js?ver=5.3.2.1

js totlrealty.com collected 2026-10-07 15:19:47 UTC 6,699 bytes, 182 lines download raw bytes

1jQuery(document).ready(function ($) {
2    "use strict";
3    wpestate_enable_slider_radius('.wpestate_slider_radius_search',geolocation_search_radius_vars.min_geo_radius, geolocation_search_radius_vars.max_geo_radius, geolocation_search_radius_vars.initial_radius);
4    wpestate_enable_geolocation_field('.wpestate_slider_radius_search',geolocation_search_radius_vars.min_geo_radius, geolocation_search_radius_vars.max_geo_radius, geolocation_search_radius_vars.initial_radius);
5});
6
7
8
9
10
11
12
13
14function wpestate_enable_slider_radius(slider_name,low_val, max_val, now_val){
15
16    var parent,geolocation_radius ,radius_value;
17    
18    jQuery('.wpestate_slider_radius_search').each(function(event){
19        selected_slider     =   jQuery(this);
20        var  parent              =   selected_slider.parent();
21        var geolocation_radius  =   parent.find('.geolocation_radius');
22        var radius_value        =   parent.find('.radius_value');
23        
24        wpestate_enable_slider_radius_action(selected_slider,low_val, max_val, now_val,radius_value,geolocation_radius)  
25    });
26
27    jQuery('.wpestate_slider_radius_global').each(function(event){
28        selected_slider     =   jQuery(this);
29        var  parent              =   selected_slider.parent().parent();
30        var geolocation_radius  =   parent.find('.geolocation_radius');
31        var radius_value        =   parent.find('.radius_value');
32        
33        wpestate_enable_slider_radius_action(selected_slider,low_val, max_val, now_val,radius_value,geolocation_radius)  
34    });
35}
36
37/*
38*
39*
40*
41*
42*/
43
44
45function wpestate_enable_slider_radius_action(selected_slider,low_val, max_val, now_val,radius_value,geolocation_radius){
46    jQuery(selected_slider).slider({
47        range: true,
48        min: parseFloat(low_val),
49        max: parseFloat(max_val),
50        value: parseFloat(now_val),
51        range: "max",
52        slide: function (event, ui) {
53        
54            geolocation_radius.val( ui.value);
55            if(geolocation_search_radius_vars.geo_radius_measure==='miles'){
56                radius_value.text(ui.value+" "+geolocation_search_radius_vars.miles);
57            }else{
58                radius_value.text(ui.value+" "+geolocation_search_radius_vars.km);
59            }
60
61        },
62        stop: function (event, ui) {
63            if(placeCircle!=''){
64                if(geolocation_search_radius_vars.geo_radius_measure==='miles'){
65                    placeCircle.setRadius(ui.value*1609.34);
66                }else{
67                    placeCircle.setRadius(ui.value*1000);
68                }
69
70 
71            if (typeof (wpestate_show_pins) !== "undefined") {
72                first_time_wpestate_show_inpage_ajax_half=1;
73                wpestate_show_pins();
74            }
75                        
76
77            }
78        }
79    });
80}
81
82
83/*
84*
85*
86*
87*
88*/
89
90function wpestate_enable_geolocation_field(slider_name,low_val, max_val, now_val){
91
92    var geolocation_lat         =   parent.find('.geolocation_lat');
93    var geolocation_long        =   parent.find('.geolocation_long');
94
95    jQuery('.geolocation_search_item').each(function(event){
96 
97        var geolocation_search_item =   jQuery(this);
98        var input_id                =   geolocation_search_item.attr('id');
99        var input                   =   document.getElementById(input_id);
100        var parent                  =   jQuery(this).parent();
101        var defaultBounds, autocomplete_normal;
102
103        var geolocation_lat         =   parent.find('.geolocation_lat');
104        var geolocation_long        =   parent.find('.geolocation_long');
105    
106        geolocation_search_item.on('change', function(){
107
108            if( jQuery(this).val()==='' ){
109                geolocation_lat.val('');
110                geolocation_long.val('');
111                if(placeCircle!=''){
112                    placeCircle.setMap(null);
113                    placeCircle='';
114                }
115            }
116        });
117    
118        var iconSVG='<svg width="20px" height="20px" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000"><path d="M12 27.2C12 46.4 32 56 32 56s20-9.6 20-28.8C52 16.6 43.05 8 32 8s-20 8.6-20 19.2z"/><circle cx="32" cy="26.88" r="6.88"/></svg>';
119
120        geolocation_search_item.autocomplete( {
121                source: function ( request, response ) {
122                        
123                        var search_parameters={
124                            format: 'json',
125                            q: request.term,//was q                      
126                            //addressdetails:'1',
127                        };
128
129                      
130                        if(geolocation_search_radius_vars.limit_country==='yes'){
131                            search_parameters.countrycodes=geolocation_search_radius_vars.limit_country_select;
132                        }
133
134
135                        jQuery.get( 'https://nominatim.openstreetmap.org/search',search_parameters, function( result ) {
136
137                          
138                                if ( !result.length ) {
139                                    response( [ {
140                                        value: '',
141                                        label: control_vars.geo_no_results
142                                    } ] );
143                                    return;
144                                }
145                                response( result.map( function ( place ) {
146                                        return {
147                                                label:place.display_name,
148                                                latitude: place.lat,
149                                                longitude: place.lon,
150                                                value: place.display_name,
151
152                                        };
153                                } ) );
154                        }, 'json' );
155                },
156                select: function ( event, ui ) {
157                    initialGeop=0;
158                    geolocation_lat.val(ui.item.latitude);
159                    geolocation_long.val(ui.item.longitude);
160                    geolocation_search_used=1;
161      
162                    if (typeof (wpestate_show_pins) !== "undefined") {
163                        first_time_wpestate_show_inpage_ajax_half=1;                  
164                        wpestate_show_pins();
165                    }
166
167                }
168        }).autocomplete("instance")._renderItem = function (ul, item) {
169            return jQuery("<li>")
170                 .append('<div class="wpresidence-geolocatiomarker">' + item.label + '</div>')
171
172                .appendTo(ul);
173        };
174
175
176        geolocation_search_item.attr('autocomplete','on');
177
178
179    
180    });
181
182}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.