Click-and-drag the marker and notice the values in the form fields changing
marker.on("drag", function(e) { var marker = e.target; var position = marker.getLatLng(); document.getElementById("frm_lat").value = position.lat; document.getElementById("frm_long").value = position.lng; });
View the source of this page to see how the map is created. Notice:
Next Example Previous