Johnny1500, здравствуйте.
Сообщение от Johnny1500
|
Хотя я подключил Google Maps Directions API в консоли
|
это как?
Ваш код работает:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
function determineRoutsef() {
var directionsService = new google.maps.DirectionsService();
var request = {
origin:"Москва",
destination:"Екатеринбург",
travelMode: google.maps.TravelMode.DRIVING
};
directionsService.route(request, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
var routes = result.routes;
var leg = routes[0].legs;
var lenght = leg[0].distance.text;
//Logger.log(lenght);
var duration = leg[0].duration.text;
//Logger.log(duration);
alert(lenght + "\n" + duration);
}
})
}
determineRoutsef()
</script>