In this blog post, you will learn how to create google maps draggable marker using Google Maps Javascript API v3, and when you drag the marker position then get coordinates (latitude and longitude) of that location where you place the marker.

How to make a marker draggable?

To allow users to drag a marker to a different location on the map, set the draggable attribute to true in the marker options.

var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
  zoom: 4,
  center: myLatlng
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
// Place a draggable marker on the map
var marker = new google.maps.Marker({
    position: myLatlng,
    map: map,
    draggable:true,
    title:"Drag me!"
});

#google maps api #javascript #draggable marker google maps v3 example #google maps draggable marker #google maps draggable marker get coordinates

Google Maps Draggable Marker Get Coordinates
26.35 GEEK