Restrict Places Autocomplete API to cities of specific country android

前端 未结 4 1871
余生分开走
余生分开走 2021-02-13 12:49

I am using PlaceAutocompleteApi from Play Services, what I want to do is restrict auto-complete to specific country & city only. Eg. All cities from lets say In

4条回答
  •  感情败类
    2021-02-13 13:17

    val sb = StringBuilder(PLACES_API_BASE + TYPE_AUTOCOMPLETE + OUT_JSON)
                sb.append("?key=$API_KEY")
                sb.append("&types=establishment")
                sb.append("&location=$locationLat,$LocationLng")
                sb.append("&radius=50000&strictbounds")
                sb.append("&input=" + URLEncoder.encode(input, "utf8"))
    

    This api will restrict the search to area.

提交回复
热议问题