标签: google-maps google-maps-direction-api
我正在运行以下Google Maps Directions API请求:
Default height APIKEY
这很好用,并且可以得到旅行时间结果,但是,当我添加traffic_model参数以获取悲观的旅行时间时,如下所示:
https://maps.googleapis.com/maps/api/directions/json?origin=53.8495996301,-1.46446203532&destination=53.9236806771,-1.38606898017&waypoints=via:53.8662581183,-1.44997238789%7Cvia:53.8840009077,-1.44013139071%7Cvia:53.8998229922,-1.42836848226%7Cvia:53.9095909181,-1.40235219041&DEPARTURE_TIME=1559541600&key= APIKEY
我收到以下错误:
“无效的请求。缺少'departure_time'参数。”
我尝试将此参数放置在多个位置,但是它们似乎都不起作用,并且都提供与上述相同的错误。
任何帮助将不胜感激。
答案 0 :(得分:2)
departure_time参数应小写:
departure_time
https://maps.googleapis.com/maps/api/directions/json?origin=53.8495996301,-1.46446203532&destination=53.9236806771,-1.38606898017&waypoints=via:53.8662581183,-1.44997238789%7Cvia:53.8840009077,-1.44013139071%7Cvia:53.8998229922,-1.42836848226%7Cvia:53.9095909181,-1.40235219041&departure_time=1559541600&traffic_model=pessimistic&key=YOUR_API_KEY