0

I'm using leaflet.js and this plugin: https://github.com/perliedman/leaflet-control-geocoder/tree/1.13.0#api and I need a way to get the lat and long from the search address after validation and put them in an input field, or simply to be able to use them...

without result :(

  <script>
    
        const map =  L.map('map').setView([48.866667, 2.333333],10);
        const tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
            maxZoom: 18,
            attribution: '&copy; <a href="https://wws.openstreetmap.org/copyright">OpenStreetMap</a>'
        }
        ).addTo(map)
    
        var controlSearch  = L.Control.geocoder().addTo(map);

        controlSearch.on('search_locationfound', function(e) {
            alert(e.latlng.lat + ' --- ' + e.latlng.lng);

        });
            
    </script>  
Christian
  • 1
  • 1

0 Answers0