Closed ivan-californias closed 6 years ago
I've added testing to make sure everything is round tripping through the parser correctly, and added to the distancematrix example app to enable testing your request. Everything looks correct in the library to me. What am I missing?
$ go run examples/distancematrix/cmdline/main.go -origins=19.3021022,-99.2298197 -destinations=19.51018,-99.12585 -mode=driving -units=metric -departure_time=now -traffic_model=best_guess -key=AIza...
&maps.DistanceMatrixResponse{
OriginAddresses: {"Cto. Fuentes del Pedregal 555, Los Framboyanes, 14150 Ciudad de México, CDMX, Mexico"},
DestinationAddresses: {"Av Instituto Politécnico Nacional 3600, San Pedro Zacatenco, 07360 Ciudad de México, CDMX, Mexico"},
Rows: {
{
Elements: {
&maps.DistanceMatrixElement{
Status: "OK",
Duration: 3487000000000,
DurationInTraffic: 3280000000000,
Distance: maps.Distance{HumanReadable:"30.0 km", Meters:29987},
},
},
},
},
}
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!
Same problem as https://github.com/googlemaps/google-maps-services-go/issues/150
I'm trying to get
duration_in_traffic
field from Distance Matrix API, which is documented here: https://developers.google.com/maps/documentation/distance-matrix/intro#duration_in_trafficAccording to documentation, I think I'm setting the required parameters for that field to be returned:
Output:
If I test with same api-key with curl, I do get data in that field: