This commit is contained in:
Hanson.xyz Dev
2026-01-04 17:50:08 -06:00
parent 7e45ce0756
commit acc8ac87a0
4131 changed files with 232562 additions and 250244 deletions
@@ -249,7 +249,8 @@ class MLS_Cluster {
$table = $this->db->properties_table();
// Build WHERE clause
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL');
// Exclude properties with invalid coordinates from map display
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL', 'coordinates_invalid = 0');
$values = array();
// Add state filter (MN, IA only)
@@ -291,7 +292,7 @@ class MLS_Cluster {
$values[] = (int) $args['min_beds'];
}
// Add bounds filter if provided
// Add bounds filter (BETWEEN is efficient for rectangular viewport queries)
if ($args['bounds'] && is_array($args['bounds']) && count($args['bounds']) === 4) {
list($sw_lat, $sw_lng, $ne_lat, $ne_lng) = $args['bounds'];
$where[] = 'latitude BETWEEN %f AND %f';
@@ -571,7 +572,8 @@ class MLS_Cluster {
global $wpdb;
$table = $this->db->properties_table();
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL');
// Exclude properties with invalid coordinates
$where = array('mlg_can_view = 1', 'latitude IS NOT NULL', 'longitude IS NOT NULL', 'coordinates_invalid = 0');
$values = array();
// Add state filter (MN, IA only)