Long-Term International Rental Finder

Long-Term International Rental Finder

Find your next home away from home.

Search Criteria

Required Amenities

Available Rentals

${r.type.charAt(0).toUpperCase() + r.type.slice(1)}

$${r.rent.toLocaleString()}/month

`; resultsList.appendChild(listItem); const marker = L.marker([r.lat, r.lng]).addTo(map) .bindPopup(`${r.name}
$${r.rent}/month`); markers.push(marker); }); } map.setView(cityCoordinates[city], 12); if (markers.length > 0) { const group = new L.featureGroup(markers); setTimeout(() => map.fitBounds(group.getBounds().pad(0.1)), 100); } } function updateTabView() { Object.values(tabButtons).forEach(b => b.classList.remove('active')); Object.values(tabContents).forEach(c => c.classList.remove('active')); tabButtons[currentTab].classList.add('active'); tabContents[currentTab].classList.add('active'); prevBtn.style.visibility = currentTab === 1 ? 'hidden' : 'visible'; nextBtn.textContent = currentTab === 1 ? 'Find Rentals' : 'Next'; nextBtn.style.visibility = currentTab === 2 ? 'hidden' : 'visible'; } function goToTab(tabNumber) { if (tabNumber > currentTab && currentTab === 1) { performSearch(); } currentTab = tabNumber; updateTabView(); } function downloadPdf() { if (currentResults.length === 0) { showCustomMessage('No Data', 'Please perform a search to generate a PDF.', 'warning'); return; } const { jsPDF } = window.jspdf; const doc = new jsPDF(); doc.setFontSize(22); doc.setFont('helvetica', 'bold'); doc.text("Long-Term Rental Search Results", 105, 20, { align: 'center' }); const tableData = currentResults.map(r => [ r.name, r.type.charAt(0).toUpperCase() + r.type.slice(1), `$${r.rent.toLocaleString()}`, r.amenities.join(', ') ]); doc.autoTable({ startY: 30, head: [['Property', 'Type', 'Monthly Rent (USD)', 'Amenities']], body: tableData, theme: 'grid', headStyles: { fillColor: [37, 99, 235] }, columnStyles: { 3: { cellWidth: 60 } } }); doc.save('Rental_Finder_Results.pdf'); } function showCustomMessage(title, body, type) { const box = document.getElementById('message-box'), titleEl = document.getElementById('message-title'), bodyEl = document.getElementById('message-body'), iconContainer = document.getElementById('message-icon-container'); if(!box || !titleEl || !bodyEl || !iconContainer) return; titleEl.textContent = title; bodyEl.textContent = body; let iconSvg = ''; switch (type) { case 'success': iconSvg = ``; break; case 'error': iconSvg = ``; break; case 'warning': iconSvg = ``; break; } iconContainer.innerHTML = iconSvg; box.classList.add('show'); setTimeout(() => { box.classList.remove('show'); }, 4000); } prevBtn.addEventListener('click', () => goToTab(1)); nextBtn.addEventListener('click', () => goToTab(2)); pdfDownloadBtn.addEventListener('click', downloadPdf); populateAmenities(); initMap(); updateTabView(); });
Scroll to Top