Inspiration

For my first hackathon project, I aimed to create something useful that could be used as a framework for building more advanced tools in the future. I knew that two days would not be enough to develop anything groundbreaking, so I decided to create a web application that could help people find medical assistance in unfamiliar areas. I wanted to provide people with a resource that would enable them to locate the nearest medical center. While limited in functionality at present, my plan is to expand this application to make it more helpful and wide-ranging.

What it Does

This web application locates the closest medical centers to your current location and provides you with relevant information about each center to help you decide if it is suitable for your needs. It plots your location and the locations of hospitals near you, allowing you to interactively choose the hospital you want to go to. Hovering over a marker will provide you with information about the corresponding hospital, and clicking on it will show more information at the bottom of the screen. This information remains visible even after you move away from the marker.

How I built it

Initially, I planned to use the Google Maps API, but I discovered that it was paid (thanks google), luckily I found a great alternative in OpenStreetMaps and OpenLayers, which was also open source (yay). When the application is opened, it first draws a map of the world. It then requests permission from the user to access their location. Once the location is received, it zooms in on that location on the world map. It then searches for all locations tagged with "hospital" within incremental radii of the user's location until at least five hospitals are found. It then sorts all the hospitals based on their distance from the user's location using the Haversine formula. Finally, it plots the locations of the hospitals on the map.

Share this project:

Updates