We were inspired by how the transport industry is trying to find greener solutions to transport, such as using public transport and electric cars. We also know that finances play a large role in how people commute so we added a rough estimate of transportation cost for a trip.
Our site takes in two addresses, a car type, and the MPG the car gets (if applicable). It takes the addresses and uses the Geoapify API to calculate the distance and time for a car drive, bike ride, and public transport (if possible). We use these values and given type and MPG to calculate cost, emissions, and time estimates.
We built it using node.js, html, and css.
We came across an issue with creating a server to host the website. We began by opening the main html file directly as a file in the browser, which led to cross site origin errors due to the script elements in the html file having src attribute links as local files. We resolved this by using Express JS to host a local server instead.
We are proud of being able to overcome the cross site origin error and also being able to get a working graph on our page.
We learned a lot about the struggles of javascript and trying to load local and outside data and importing data into a js file.
Given more time, we would love to add the ability to output the exact routes that would be taken on public transport in order to give an accurate cost for all the buses, trains, and subways used. We also want to add a working map that shows the two points and the path between them.
Built With
- anychart
- css
- express.js
- geoapify
- html
- javascript
- node.js
Log in or sign up for Devpost to join the conversation.