From eed01f2e04bd46e929f481f708582e7c7492fbbb Mon Sep 17 00:00:00 2001 From: "Hanson.xyz Dev" Date: Mon, 29 Dec 2025 03:16:16 -0600 Subject: [PATCH] Switch to 100% server-side map clustering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes client-side Leaflet MarkerCluster library in favor of server-side clustering at all zoom levels: - Zoom 1-8: Density dots - Zoom 9-15: Server-generated numbered clusters - Zoom 16+: Individual property markers This prevents the visual issue where server-returned clusters were being re-clustered by the client into a single merged marker. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../includes/class-mls-cluster.php | 7 +- .../themes/homeproz/archive-property.php | 7 +- .../themes/homeproz/dist/assets/main.js | 2 +- .../property/property-filters.js | 71 ++++--------------- 4 files changed, 19 insertions(+), 68 deletions(-) mode change 100644 => 100755 wp-content/plugins/mls-by-hansonxyz/includes/class-mls-cluster.php diff --git a/wp-content/plugins/mls-by-hansonxyz/includes/class-mls-cluster.php b/wp-content/plugins/mls-by-hansonxyz/includes/class-mls-cluster.php old mode 100644 new mode 100755 index 96943976..2a25f1ef --- a/wp-content/plugins/mls-by-hansonxyz/includes/class-mls-cluster.php +++ b/wp-content/plugins/mls-by-hansonxyz/includes/class-mls-cluster.php @@ -336,15 +336,12 @@ class MLS_Cluster { return $this->get_density_data($where_sql, $values, $zoom, $center_lat, $total, self::DENSITY_DOT_SPACING); } - // Zoom 12-15: Numbered clusters (or individual if low count) + // Zoom 9-15: Always use server-side clusters (let server handle grouping) if ($zoom <= self::ZOOM_CLUSTER_MAX) { - if ($total <= self::MAX_INDIVIDUAL_MARKERS) { - return $this->get_individual_markers($where_sql, $values, $total); - } return $this->get_cluster_data($where_sql, $values, $zoom, $center_lat, $total); } - // Zoom 16+: Individual markers + // Zoom 16+: Individual markers (no clustering needed at this zoom) return $this->get_individual_markers($where_sql, $values, $total); } diff --git a/wp-content/themes/homeproz/archive-property.php b/wp-content/themes/homeproz/archive-property.php index 5d1c3026..5b7ff522 100755 --- a/wp-content/themes/homeproz/archive-property.php +++ b/wp-content/themes/homeproz/archive-property.php @@ -120,7 +120,7 @@ $view_class = $show_map ? 'is-map-view' : 'is-grid-view'; $initial_filters = array( 'status' => isset($_GET['property_status']) ? sanitize_text_field($_GET['property_status']) : 'Active', 'property_type' => isset($_GET['property_type']) ? sanitize_text_field($_GET['property_type']) : '', - 'city' => isset($_GET['property_location']) ? sanitize_text_field($_GET['property_location']) : '', + 'city' => isset($_GET['city']) ? sanitize_text_field($_GET['city']) : '', 'min_price' => isset($_GET['min_price']) ? intval($_GET['min_price']) : '', 'max_price' => isset($_GET['max_price']) ? intval($_GET['max_price']) : '', 'min_beds' => isset($_GET['beds']) ? intval($_GET['beds']) : '', @@ -137,13 +137,8 @@ if (function_exists('mls_get_property_count')) { ?> - - - - -