Last active
March 1, 2016 23:44
-
-
Save phsantiago/7c2d940d916c962b0315 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directionsService = new google.maps.DirectionsService(); | |
directionsDisplay = new google.maps.DirectionsRenderer(); | |
directionsDisplay.setMap(map); | |
var request = { | |
origin: lojas[0].location, | |
destination: lojas[1].location, | |
travelMode: google.maps.TravelMode.DRIVING | |
}; | |
directionsService.route(request, function (result, status) { | |
if (status == google.maps.DirectionsStatus.OK) { | |
directionsDisplay.setDirections(result); | |
directionsDisplay.setOptions({ suppressMarkers: true }); | |
} else { | |
alert('error'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment