No se encontraron distribuidores.
Intente con otro término de búsqueda o estado.
' + dealer.city + ', ' + dealer.state + ' ' + dealer.zip + '
' + '' + dealer.phone + '
'; card.addEventListener('click', function() { map.setView([dealer.lat, dealer.lng], 12); markers[idx].openPopup(); highlightDealer(idx); }); list.appendChild(card); }); } function highlightDealer(index) { document.querySelectorAll('.dealer-card').forEach(function(card) { card.classList.remove('active'); if (parseInt(card.getAttribute('data-index')) === index) { card.classList.add('active'); card.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); } }); // Reset all markers then highlight the active one markers.forEach(function(m, i) { if (i === index) { m.setStyle({ radius: 14, fillColor: '#8B0000', weight: 3 }); } else { m.setStyle({ radius: 10, fillColor: '#C41E3A', weight: 2 }); } }); } // Initial render renderDealers(dealers.map(function(d, i) { return { dealer: d, index: i }; })); // Clear any prior search origin marker + reset sort function clearSearchOrigin() { if (searchMarker) { map.removeLayer(searchMarker); searchMarker = null; } searchOrigin = null; } // Render results sorted by distance from a given lat/lng function renderByDistance(origin, stateFilter) { var results = dealers.map(function(d, i) { return { dealer: d, index: i, distance: haversineMiles(origin.lat, origin.lng, d.lat, d.lng) }; }).filter(function(item) { return !stateFilter || item.dealer.state === stateFilter; }).sort(function(a, b) { return a.distance - b.distance; }); renderDealers(results); if (results.length > 0) { // Show search origin marker if (searchMarker) map.removeLayer(searchMarker); searchMarker = L.marker([origin.lat, origin.lng], { icon: L.divIcon({ className: 'search-origin-marker', html: '