Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am drawing a route in Google Maps. I have passed the start point, way points and end points. My route is drawing correctly. I am using Google Maps API 3.

request = {
  origin: originAddress,
  destination: destinationAddress,
  waypoints: waypoints,
  optimizeWaypoints: false,
  travelMode: google.maps.DirectionsTravelMode.DRIVING

directionsService.route(request, function(response, status) {
  if (status == google.maps.DirectionsStatus.OK) {

If I change the route direction, then how to find the changed direction points' latitude and longitude?

Any help will be appreciated.

share|improve this question
use the drag and drop re-calculate… – Mapperz Jun 7 '13 at 13:59

When taking a look at this reference DirectionsRenderer Reference, look for the event


After rendering your directions, introduce an event listener on the DirectionsRenderer object. Something like this:

var directionsDisplay = new google.maps.DirectionsRenderer({draggable: true});
var directionsService = new google.maps.DirectionsService();

var mapOptions = {
 zoom: 7,
 mapTypeId: google.maps.MapTypeId.ROADMAP,
 center: australia

var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);


google.maps.event.addListener(directionsDisplay, "directions_changed", function(){
    //do what you wanna do here i.e. get the modified path of the direction

Very important thing is to make sure you set the draggable attribute of the DirectionsRenderer object to true. Note that the code here is mainly take out from the link Mapperz gave in his comment.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.