Emergency Medical Facility Finder

Emergency Medical Facility Finder

Find Help Near You

Select a location to find nearby emergency medical facilities. For demonstration, please select from the pre-populated list of major world cities.

In a real-world application, this tool would use your device's GPS or a search bar to find your precise location.

${facility.address}

${facility.type}
Phone: ${facility.phone} Approx. ${facility.distance} away
`; resultsList.innerHTML += facilityCard; }); } // Switch to the results tab changeTab(2); } // --- PDF GENERATION --- /** * Generates a PDF from the content of the results tab. */ function generatePdf() { const { jsPDF } = window.jspdf; const content = document.getElementById('pdf-content'); html2canvas(content, { scale: 2, backgroundColor: '#ffffff' }).then(canvas => { const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / canvasHeight; const imgHeight = (pdfWidth - 40) / ratio; // Subtract margins from width pdf.addImage(imgData, 'PNG', 20, 20, pdfWidth - 40, imgHeight); pdf.save('Medical-Facilities-List.pdf'); }).catch(err => { console.error("PDF generation failed:", err); }); } // Initial call to set button states updateNavButtons(); });
Scroll to Top