Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在iOS应用程序中使用Google Places API搜索多种类型_Iphone_Objective C_Ios_Google Maps_Google Places Api - Fatal编程技术网

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

Iphone 如何在iOS应用程序中使用Google Places API搜索多种类型,iphone,objective-c,ios,google-maps,google-places-api,Iphone,Objective C,Ios,Google Maps,Google Places Api,我需要用谷歌API为iOS应用程序搜索多个类型 下面是我如何搜索一种类型。在这个例子中,它的类型是博物馆我想搜索博物馆和艺术画廊。我将如何在以下情况下做到这一点: NSURL *googlePlacesURL = [NSURL URLWithString:@"https://maps.googleapis.com/maps/api/place/search/xml?location=34.0522222,-118.2427778&radius=500&types=**museum

我需要用谷歌API为iOS应用程序搜索多个类型

下面是我如何搜索一种类型。在这个例子中,它的类型是博物馆我想搜索博物馆艺术画廊。我将如何在以下情况下做到这一点:

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"];
谢谢你的帮助


:)

您可以通过修改请求参数types=museum | art | u gallery添加多个由| operator分隔的类型来输入多个类型

我添加了两个请求参数,我得到的响应既包含atm,也包含cafe。 您可以参考下面的链接来验证响应。

我想到了这一点,并尝试了以下方法,但没有成功:&radius=500&types=museum | art|u gallery&sensor=false&key=这对我来说非常有效,并产生了预期的结果。类型现在已弃用