如何在iOS应用中使用Google Places API搜索多种类型

han*_*Dev 2 iphone google-maps objective-c ios google-places-api

我需要使用适用于iOS应用的Google API搜索多种类型.

这是我如何搜索一种类型.在这个例子中它是博物馆类型,我想搜索博物馆art_gallery.我将如何做到:

NSURL *googlePlacesURL = [NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/xml?location=34.0522222,-118.2427778&radius=500&types=**museum**&sensor=false&key=APIKEY"];
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助

:)

小智 14

我添加了两个请求参数,我得到的响应既包含atm又包含cafe.您可以参考以下链接来验证响应. https://maps.googleapis.com/maps/api/place/search/xml?location=19.148279,72.993874&rankby=distance&types=cafe|atm&sensor=false&key=


小智 5

您可以通过修改请求参数类型输入多种类型= museum | art_gallery通过|添加更多类型 操作者