Fix city/zip filtering and improve map hover behavior

MLS Query Changes:
- Use exact city/postal_code matching instead of radius search
- Fixes city filter returning 1700+ results instead of 97 for Ramsey

Cluster Endpoint:
- Parse "City, SS" format to extract city name before querying
- Fixes pins not showing when city filter applied

Property Filters JS:
- Always fit map bounds when filter changes (not just on no intersection)
- Fit bounds on initial page load when URL has filters
- Show temporary hover pin when marker is clustered or outside viewport
- Uses markerCluster.getVisibleParent() to detect clustered markers

Property Results:
- Add zip code parameter handling for URL filters

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Hanson.xyz Dev
2025-12-29 02:27:54 -06:00
parent 5ca2e29c72
commit f2a9b28ac2
5 changed files with 92 additions and 150 deletions
+4
View File
@@ -256,6 +256,10 @@ final class MLS_Plugin {
$status = isset($_REQUEST['status']) ? sanitize_text_field($_REQUEST['status']) : 'Active';
$property_type = isset($_REQUEST['property_type']) ? sanitize_text_field($_REQUEST['property_type']) : null;
$city = isset($_REQUEST['city']) ? sanitize_text_field($_REQUEST['city']) : null;
// Parse "City, SS" format - extract just the city name
if ($city && preg_match('/^(.+),\s*([A-Z]{2})$/', $city, $matches)) {
$city = $matches[1];
}
$min_price = isset($_REQUEST['min_price']) ? (int) $_REQUEST['min_price'] : null;
$max_price = isset($_REQUEST['max_price']) ? (int) $_REQUEST['max_price'] : null;
$min_beds = isset($_REQUEST['min_beds']) ? (int) $_REQUEST['min_beds'] : null;