public PlacesAutocompleteAdapter(Context context, GoogleApiClient googleApiClient,
                                  LatLngBounds bounds, AutocompleteFilter filter)
 {
     this.context            = context;
     this.googleApiClient    = googleApiClient;
     this.bounds             = bounds;
     this.autoCompleteFilter = filter;
 }
示例#2
0
        public static void ShowPlaceAutocomplete(
            [NotNull] Action <Place> onPlacePicked,
            [NotNull] Action <string> onFailure,
            [GoogleMapsAndroidOnly] Mode mode = Mode.Fullscreen, AutocompleteFilter filter = AutocompleteFilter.None,
            string countryCode = null, LatLngBounds boundsBias = null)
        {
            if (onPlacePicked == null)
            {
                throw new ArgumentNullException("onPlacePicked");
            }
            if (onFailure == null)
            {
                throw new ArgumentNullException("onFailure");
            }

            if (GoogleMapUtils.IsPlatformNotSupported)
            {
                return;
            }

            _onPlacePicked = onPlacePicked;
            _onFailure     = onFailure;

            GooglePlacesSceneHelper.Init();

            if (GoogleMapUtils.IsAndroid)
            {
                PlacePickerActivityUtils.LaunchPlaceAutocomplete(mode, filter, countryCode, boundsBias);
            }

#if UNITY_IOS && !DISABLE_IOS_GOOGLE_MAPS
            string bounds = null;
            if (boundsBias != null)
            {
                bounds = Json.Serialize(boundsBias.ToDictionary());
            }

            _googleMapsShowPlaceAutocomplete((int)mode, (int)filter, countryCode, bounds);
#endif
        }
 public static async Task <Android.Gms.Location.Places.AutocompletePredictionBuffer> GetAutocompletePredictionsAsync(this IGeoDataApi api, GoogleApiClient client, string query, Android.Gms.Maps.Model.LatLngBounds bounds, AutocompleteFilter filter)
 {
     return((await api.GetAutocompletePredictions(client, query, bounds, filter)).JavaCast <AutocompletePredictionBuffer> ());
 }
示例#4
0
 public Task <AutocompletePredictionBufferResponse> GetAutocompletePredictionsAsync(String query, Maps.Model.LatLngBounds bounds, AutocompleteFilter filter)
 {
     return(GetAutocompletePredictions(query, bounds, filter).AsAsync <AutocompletePredictionBufferResponse> ());
 }