Hi,
good personal afternoon, I take a lot of help from you,
my problem
The directionsService.route - has no information about the route as,
distance and duration,
The service.getDistanceMatrix have the information I need, but you can not
set more than one point, waypoints
I need to sun the time and distance of all route?
I think, it is more difficult to sum the data, because it is made separate
requests
jQuery.each(resp.all, function(i, val) {
console.log('ponto numero:'+i);
//executar o DistanceMatrixService
service.getDistanceMatrix(
{
//Origem
origins: [val.ini],
//Destino
destinations: [val.fim],
//Modo (DRIVING | WALKING | BICYCLING)
travelMode: google.maps.TravelMode.DRIVING,
//Sistema de medida (METRIC | IMPERIAL)
unitSystem: google.maps.UnitSystem.METRIC,
//Vai chamar o callback
avoidHighways: false,
avoidTolls: false
}, function (response, status){
data[] = {'distancia_t':
response.rows[0].elements[0].distance.text,
'distancia':
response.rows[0].elements[0].distance.value,
'duracao_t':
response.rows[0].elements[0].duration.text,
'duracao':
response.rows[0].elements[0].duration.value,
'cepOrigem':
response.originAddresses,
'cepDestino':
response.desinationAddresses}
});
});
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-maps-js-api-v3.
For more options, visit https://groups.google.com/d/optout.