A workout tracking application built while learning modern JavaScript concepts, Object-Oriented Programming, and application architecture.
Users can log running and cycling workouts directly on an interactive map using geolocation. The app stores workouts in local storage and displays them both on the map and in a workout list.
Visit the live app here: tagore-mapty.vercel.app
- π Get current location using Geolocation API
- πΊοΈ Interactive map using Leaflet.js
- π Add Running workouts
- π΄ Add Cycling workouts
- π Display workout markers on the map
- π Render workout list in sidebar
- πΎ Save workouts in Local Storage
- π Restore workouts after page reload
- π― Move map to workout location on click
- π§ Built using Object-Oriented Programming (OOP)
This project helped me understand:
- Modern JavaScript ES6+ features
- Object-Oriented Programming (Classes, Inheritance, Encapsulation)
- Application planning and architecture
- Working with third-party libraries
- Geolocation API
- Local Storage API
- Event handling and DOM manipulation
- Private class fields (
#) - Asynchronous JavaScript concepts
- Structuring real-world frontend applications
The application is built using class-based architecture.
Base class containing shared workout properties.
Extends Workout
Additional properties:
- cadence
- pace
Extends Workout
Additional properties:
- elevationGain
- speed
Main controller class responsible for:
- Map rendering
- Event handling
- Creating workouts
- Rendering UI
- Local storage management
- User allows location access
- Map loads using current location
- User clicks on the map
- Workout form appears
- User submits workout details
- Workout is:
- Rendered on map
- Added to sidebar list
- Saved to local storage
- Clicking a workout moves map to its location
- HTML5
- CSS3
- JavaScript (ES6+)
- Leaflet.js
- OpenStreetMap
- Geolocation API
- Local Storage API
mapty/
β .prettierrc
β index.html
β README.md
β script.js
β style.css
β
ββββimages
β icon.png
β logo.png
β
ββββProject Plan
β Mapty-architecture-final.png
β Mapty-architecture-part-1.png
β Mapty-flowchart.png
β next-features.png
β
ββββproject preview
image.pnggit clone https://github.com/Tagore9930/mapty.gitcd maptySimply open index.html in your browser.
- Allow location access
- Click anywhere on the map
- Fill in workout details
- Submit the form by pressing Enter in any input field.
- Thw workout will appear:
- On the map
- In the sidebar list
- Click a workout in the list to move to its location
- βοΈ Edit workouts
- ποΈ Delete workouts
- π§Ή Delete all workouts
- π Sort workouts
- π Show all workouts on map
- βοΈ Weather integration
- π Workout statistics
- π£οΈ Draw routes and paths
- π Geocoding locations
class Running extends Workout {}
class Cycling extends Workout {}#map;
#workouts = [];localStorage.setItem('maptyWorkouts', JSON.stringify(this.#workouts));navigator.geolocation.getCurrentPosition();This project was built while learning from:
- Jonas Schmedtmann
- Leaflet.js
- OpenStreetMap
This project is for learning purposes and portfolio showcase.
Tagore Banda
β If you like this project, consider giving it a star on GitHub!




