0

I have a map with markers. Every marker is a charging station. I want that the user that want to use the charging station, can book the place for an hour for example and set a time that is shown. When the marker is occupied, it will be red. When it will be free, it will turn green. But i don't know how to do it. When i click on the marker, there is a popup with the information and a menu that can be clicked. When the user will click on that text, he will book the place. Can you help me? Sorry for everything, but i'm new here and don't know how stakcoverflow works

var map = L.map('map').setView([41.902573060808734, 12.496763392765072], 13);
            L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
                attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
            }).addTo(map);            
        var popupContent = `
            <select>
                <option value="prenota">Prenota</option>
            </select>
        `;
            stazioni.map(item => {
                var marker = new L.marker(item.coordinates)
                    .bindPopup(item.text + popupContent)
                    .openPopup();
                    marker.addTo(map);
                    marker.on('click', function(e) {
                    map.flyTo(e.latlng, 17);     
                }); 

0