This project was developed in Jonas Schmedtmann's JavaScript course, where OOP, Geolocalization API, leaflet js and localStorage were used.
The user can add the workouts after selecting the workout location on the map. Only running and cycling workouts are allowed
-
USER STORIES - Description of the application's functionality from the user's perspective.
-
FEATURES - The features that I will implement according to user stories
-
FLOWCHART - Flowchart of what will be implemented in the project
- In this project I used OOP to organize my code structure, with classes, objects, inheritance and methods according to architecture.
- to find user's location
...
navigator.geolocation.getCurrentPosition(this._loadMap.bind(this), () => {
alert('Could not get your position');
});
this.#map = L.map('map').setView(coords, this.#mapZoomLevel);
L.tileLayer('https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', {
attribution:
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}).addTo(this.#map);
localStorage.setItem('workouts', JSON.stringify(this.#workout));