使用Google Place API无法获得多个位置

时间:2017-01-07 12:01:24

标签: swift google-places-api

我使用google place api,它适用于单一类型的地方。

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=23.0319597194644,72.5616482580887&radius=10000&type=atm&key=API_KEY

但是,当设置多个地方类型时,会收到错误。我使用Alamofire类。

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=23.0319597194644,72.5616482580887&radius=10000&type=atm|cafe&key=API_KEY

代码:

Alamofire.request("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=23.032166019274,72.5615383539303&radius=10000&type=atm|hospital&key=API_KEY", method: .get, parameters: NSDictionary(), encoding: URLEncoding.httpBody, headers: [:]).responseJSON { (response) in
 print(response)
}

错误: FAILURE:invalidURL(“https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=23.032166019274,72.5615383539303&radius=10000&type=atm|hospital&key=API_KEY”)

0 个答案:

没有答案