title: How to get the LatLng of a "dragend" event in Leaflet?
body: <p>I'm trying to get the lat and long of a dragged and dropped marker on the Leaflet map.</p>
  
  <p>However, I'm constantly getting <code>TypeError: event.latlng is undefined</code> error.</p>
  
  <p>This is my entire code:</p>
  
  <pre><code>var map = L.map('map');
  
  googleStreets = L.tileLayer('http://{s}.google.com/vt/lyrs=m&amp;x={x}&amp;y={y}&amp;z={z}',{
    maxZoom: 20,
    subdomains:['mt0','mt1','mt2','mt3']
  }).addTo(map);
  
  map.locate({
    setView: true, 
    maxZoom: 16, 
    watch:false, 
    timeout: 60000,
    enableHighAccuracy: true
  });
  var marker; 
  var circles;
  
  function onLocationFound(e) {
    var radius = e.accuracy / 2;
  
    if(map.hasLayer(circles) &amp;&amp; map.hasLayer(marker)) {
      map.removeLayer(circles);
      map.removeLayer(marker);
    } 
  
    marker = new L.Marker(e.latlng, {draggable:true});
    circles = new L.circle(e.latlng, radius);
    circles.bindPopup("You are within " + radius + " meters from this point").openPopup();;
  
    map.addLayer(marker);
    map.addLayer(circles);
  
    marker.on('dragend', function(event) {
      var mylat = event.latlng.lat
      var result = marker.getLatLng(); 
      console.log(mylat);
    });
  }
  </code></pre>
  
  <p>when I see inside the console, I see that error.</p>
  
  <p>But when i change this <code>console.log(mylat);</code> to this <code>console.log(result);</code>, I see the lat and long in the console but the format of them is not what I am looking for. </p>
  
  <p>This is what I get in the console when i drag and drop the marker the code with this  <code>console.log(result);</code>:</p>
  
  <pre><code> Object { lat=51.564025924107554,  lng=0.7077598571777344,  equals=function(),  more...}
  </code></pre>
  
  <p>Could someone please advise on this?</p>
  
  <p>Thanks in advance.</p>