2016-04-01 38 views
2

iOSプロジェクトでは、GoogleマップSDKを使用して自動完成アドレスを取得しています。したがって、私は結果を特定の国に限定したいGoogle文書によると、国名はGMSAutocompleteFilterクラスでなければなりません。 Googleのドキュメントでは、実際にはGoogle地図のSDKの ".h"ファイルに "country"というプロパティがあります。GoogleマップのGMSAutocompleteFilterに「国」プロパティがありません。iOS SDK

ドキュメントへのリンク:https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_autocomplete_filter.html#properties

GMSAutocompleteFilter.hファイル:

// 
// GMSAutocompleteFilter.h 
// Google Maps SDK for iOS 
// 
// Copyright 2014 Google Inc. 
// 
// Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of 
// Service: https://developers.google.com/maps/terms 
// 

/** 
* The type filters that may be applied to an autocomplete request to restrict results to different 
* types. 
*/ 
typedef NS_ENUM(NSInteger, GMSPlacesAutocompleteTypeFilter) { 
    /** 
    * All results. 
    */ 
    kGMSPlacesAutocompleteTypeFilterNoFilter, 
    /** 
    * Geeocoding results, as opposed to business results. 
    */ 
    kGMSPlacesAutocompleteTypeFilterGeocode, 
    /** 
    * Geocoding results with a precise address. 
    */ 
    kGMSPlacesAutocompleteTypeFilterAddress, 
    /** 
    * Business results. 
    */ 
    kGMSPlacesAutocompleteTypeFilterEstablishment, 
    /** 
    * Results that match the following types: 
    * "locality", 
    * "sublocality" 
    * "postal_code", 
    * "country", 
    * "administrative_area_level_1", 
    * "administrative_area_level_2" 
    */ 
    kGMSPlacesAutocompleteTypeFilterRegion, 
    /** 
    * Results that match the following types: 
    * "locality", 
    * "administrative_area_level_3" 
    */ 
    kGMSPlacesAutocompleteTypeFilterCity, 
}; 

/** 
* This class represents a set of restrictions that may be applied to autocomplete requests. This 
* allows customization of autocomplete suggestions to only those places that are of interest. 
*/ 
@interface GMSAutocompleteFilter : NSObject 

/** 
* The type filter applied to an autocomplete request to restrict results to different types. 
* Default value is kGMSPlacesAutocompleteTypeFilterNoFilter. 
*/ 
@property(nonatomic, assign) GMSPlacesAutocompleteTypeFilter type; 

@end 

任意のヘルプは感謝だろう。

答えて

1

最後に、Googleマップの古いバージョンのiOS SDKが原因であることが確認されました。私は1.10バージョンのように私に与えたpodfileにバージョン番号を指定せずにGoogle SDKを取得していました。そこでGoogle SDKのポッドをバージョン1.12.3で更新しました。GMSAutocompleteFilterというクラスに「country」フィールドがあります。

+0

あなたの素晴らしい答えをありがとう。 –

関連する問題