Add server-side clustering for map with 30k+ properties
- Remove 1000 property limit from count display - Add MLS_Cluster class for geohash-based server-side clustering - Add AJAX endpoint for dynamic cluster loading based on viewport/zoom - Update property-results.php and ajax-handlers.php to use efficient counting - Update map JavaScript to fetch clusters dynamically as user pans/zooms - Server returns clusters at low zoom, individual markers at high zoom - Fixes property count showing 1000 instead of actual ~30k properties 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -353,6 +353,31 @@ class MLS_Query {
|
||||
$values[] = $args['city'];
|
||||
}
|
||||
|
||||
if (!empty($args['county'])) {
|
||||
$where[] = 'county = %s';
|
||||
$values[] = $args['county'];
|
||||
}
|
||||
|
||||
if (!empty($args['min_price'])) {
|
||||
$where[] = 'list_price >= %d';
|
||||
$values[] = (int) $args['min_price'];
|
||||
}
|
||||
|
||||
if (!empty($args['max_price'])) {
|
||||
$where[] = 'list_price <= %d';
|
||||
$values[] = (int) $args['max_price'];
|
||||
}
|
||||
|
||||
if (!empty($args['min_beds'])) {
|
||||
$where[] = 'bedrooms_total >= %d';
|
||||
$values[] = (int) $args['min_beds'];
|
||||
}
|
||||
|
||||
if (!empty($args['min_baths'])) {
|
||||
$where[] = 'bathrooms_total >= %d';
|
||||
$values[] = (int) $args['min_baths'];
|
||||
}
|
||||
|
||||
$sql = "SELECT COUNT(*) FROM {$table} WHERE " . implode(' AND ', $where);
|
||||
|
||||
if (!empty($values)) {
|
||||
|
||||
Reference in New Issue
Block a user