Inspiration
We're selfish millennials. We don't like to pay for washrooms, search for electronic drop-offs, or hold my trash and recycling for a long time. But, we also care about making the world a better place. That means no littering or throwing toxic batteries into regular trash bins. This web app helps you organize your life and be a better person, all while being convenient and easy to use.
What it does
Here's our solution: a map that grabs your location data, and returns to you the nearest public washrooms and waste disposal bins. And it tells you the best walking route to get there. Never find yourself a desperate tourist in NYC without a washroom again!
How we built it
We built the website with HTML and JavaScript, using the papa parse library to read the CSV data. The map display and distance tracking were implemented with the Google Maps API.
Challenges we ran into
Dealing with asynchronous functions in JavaScript was a time and a half. We needed to explore setTimeout, callback functions, and promises in order to get our code to run in the order that we wanted. Although we eventually succeeded, the parsing of the CSV file takes longer than we'd like, and if a user tries to get data points before the parsing is done, the markers will not appear. Also, since we are not currently in New York City, we could not use the GPS localization functionality from the Google Maps API, so we generated random coordinated within New York City.
Accomplishments that we're proud of
We were able to properly visualize data by implementing APIs and libraries in order to create a sleek web app with useful, everyday functionality. (We would actually use this if we were in New York.)
What's next for Trash-Free NYC
We would like to improve on some of the issues described above such as speeding up the parsing process or only allowing users to get data once the parser is done. We're also looking to implement a more sophisticated algorithm that would return the recommended points to travel to, based on walking distance. We also want to incorporate a rating system so users can access the cleanliness of the washroom.
Built With
- css
- google-maps
- html
- javascript
- papa-parse
Log in or sign up for Devpost to join the conversation.