为我的地图上输入的每只鸟添加一个标记传单

问题描述 投票:0回答:0

我是一名学生,我必须为每个重新入学通知创建一个标记。我已经创建了这个。但我必须使用 for 循环,但我是 python 的初学者。

谢谢你的回答。 (对不起我的英语)

    <script>

        var mymap = L.map('mapid').setView([45.192, 5.768], 14);

        var osmLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
            attribution: '© OpenStreetMap contributors',
            maxZoom: 19
        });

        mymap.addLayer(osmLayer);

        const marker = L.marker([45.192, 5.768]).addTo(mymap)
        .bindPopup('<b>Place centrale</b><br />Université Grenoble Alpes').openPopup();


        const popup = L.popup()
            .setLatLng([45.192, 5.768])
            .setContent('I am a standalone popup.')
            .openOn(mymap);

        function onMapClick(e) {
            popup
                .setLatLng(e.latlng)
                .setContent(`Vous avez cliqué sur la carte à ${e.latlng.toString()}`)
                .openOn(mymap);
                document.getElementById('inputLong').value = e.latlng.lng
                document.getElementById('inputLat').value = e.latlng.lat
        }

        mymap.on('click', onMapClick);
        
        
        </script>

javascript python leaflet jinja2
© www.soinside.com 2019 - 2024. All rights reserved.