googlemaps / googlemaps/google-maps-services-python

Multiple avoid problems

未关闭
#382 1 条评论 0 个 reaction 已指派 1 人 已被 @wangela 认领 在 GitHub 查看
help wanted priority: p3 type: bug
主要语言
Python
星标
5k
派生
1.4k
PR 合并指标
30 天内没有已合并 PR

描述

## Problem
When I passed the `avoid` parameters in the `distance_matrix` method, it told me that it is an invalid restriction. However, I wonder if it's possible to allow multiple avoid options like `avoid=tolls|highways|ferries`.
Thank you!

## Environment details
1. API: Distance_Matrix
2. Win 10 v2004
3. lib version: 4.4.2, Jupyter Notebook

#### Steps to reproduce

1. Simply add multiple avoids in the `distance_matrix` parameter
#### Code example

```python
# example
gmaps = googlemaps.Client(key=YOUR_KEY)
gmaps.distance_matrix(origins=SOMEPLACE,destinations=SOMEPLACE, mode='driving', avoid='tolls|highways|ferries')
```

#### Stack trace
```
# example
D:\Program_Files\Anaconda3\lib\site-packages\googlemaps\distance_matrix.py in distance_matrix(client, origins, destinations, mode, language, avoid, units, departure_time, arrival_time, transit_mode, transit_routing_preference, traffic_model, region)
107 if avoid:
108 if avoid not in ["tolls", "highways", "ferries"]:
--> 109 raise ValueError("Invalid route restriction.")
110 params["avoid"] = avoid
111

ValueError: Invalid route restriction.
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。