Thursday, June 20, 2013

How to change the maps route to draggable











var rendererOptions = {
  draggable: true
};

This is the code snippet which I tested for my university project on how to drag the current route of Google maps. As you guys can see Google maps it self providing this feature hence I was curious how to do it.. Finally I found this pretty simple code snippet. Add this in the <head> section of your particular web page.

And then this simple code

var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);

then add this variable to where you are declaring the map
directionsDisplay.setMap(map);



No comments:

Post a Comment