google-places-api

Google Places API : next_page_token error

六月ゝ 毕业季﹏ 提交于 2019-12-21 07:14:13
问题 I'm gathering information on the location of stores. The search is: <?php ... $url='https://maps.googleapis.com/maps/api/place/search/json?key=[my_key]&location=40.420989,-3.706812&radius=1000030&=&sensor=false'; $body=file_get_contents($url); ... ?> I return a Json without problems, and indicates that there is another page of results. I'll be back to make another call as follows <?php ... $url2='https://maps.googleapis.com/maps/api/place/search/json?key=[my_key]&pagetoken

How to implement google places autocomplete programmatically

99封情书 提交于 2019-12-21 05:23:17
问题 Autocomplete predictions don't show up in my MapsActivity when i type text in AutoCompleteTextView (mSearchText). I tried following the tutorial at the following link: https://www.youtube.com/watch?v=6Trdd9EnmqY&list=PLgCYzUzKIBE-vInwQhGSdnbyJ62nixHCt&index=8. Some methods used in it recently became deprecated, so I checked the documentation at https://developers.google.com/places/android-sdk/autocomplete, especially "Get place predictions programmatically" and "Migrating to the New Places

Google Places API - getQueryPredictions Restrict by Country/City/State?

余生长醉 提交于 2019-12-21 04:03:30
问题 Below is the getQueryPredictions example given by google service.getQueryPredictions({input: 'pizza near'}, callback); Is there a way to restrict results for a specific country/city/state? The other function/component has ability to do this var input = document.getElementById('searchTextField'); var options = { types: ['(cities)'], componentRestrictions: {country: 'fr'}}; autocomplete = new google.maps.places.Autocomplete(input, options); 回答1: This is currently not supported, for supported

Using Google Places Search Box. How to initiate a search by clicking a button?

浪子不回头ぞ 提交于 2019-12-21 04:03:10
问题 Either I am an idiot or this was an egregious oversight on the part of the Google Maps team. I am attempting to trigger a places search request on a button click event in conjunction with the standard enter keypress event (which is currently working fine). I have combed through the documentation related to the Google Places search box and have found no sutiable solution. Because of confidentiality reasons I am using the example from the demo. function initialize() { var map = new google.maps

Fail to obtain specific Place from PlaceBuffer

允我心安 提交于 2019-12-21 03:58:16
问题 I have strange problem with one specific place. Any idea ? This code is working fine, but for one place (accidentally choosen because of starts with aaa - just for test) it fails to obtain Place object from buffer. Even a query was successfull (log: PlaceAutocompleteAdapt﹕ Query completed. Received 5 predictions.) Unfortunatelly, it crash application. It make this API very dangerous, what else should be handled in try catch block for sure? addressAutocompleteText.setOnItemClickListener(new

Google places details API call return NOT_FOUND for an existing autocomplete reference

一世执手 提交于 2019-12-21 03:41:12
问题 I have a problem maybe someone had the same issue. I am calling google places autocomplete api call. Then i am presenting the user with the results and he can select the place. Base on the selection i am making places details call and retrieve the details of the place. My problem is that some cases the details service return NOT_FOUND. the full response looks something like this {\n \"debug_info\" : [],\n \"html_attributions\" : [],\n \"status\" : \"NOT_FOUND\"\n}\n Based on google api

Restrict Places Autocomplete API to cities of specific country android

杀马特。学长 韩版系。学妹 提交于 2019-12-21 03:37:11
问题 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 India only. I am using AutocompleteFilter to do so but I don't know where to specify country that I want to restrict. Here is my code List<Integer> autocompleteFilter = new ArrayList<>(); // autocompleteFilter.add(Place.TYPE_COUNTRY); // autocompleteFilter.add(Place.TYPE_LOCALITY); mAdapter = new PlaceAutocompleteAdapter(mContext,R

Change foreground and background color of Place Autocomplete Fragment

淺唱寂寞╮ 提交于 2019-12-21 03:37:07
问题 I've used Google Place API and integrated Place Autocomplete Fragment . Can i change its Foreground or background color. It seems bit dull in my device. And I also want to know that can I set " powered by Google " sentence to at the bottom part of the screen. I have seen some application which have it on bottom. 回答1: If you place that fragment in another layout you are able to modify as you want. Make nested such: <...CardView...> <..Your Fragment...> The logo issue, since you decided to use

How to clear the input bound to the Google Places Autocomplete?

一世执手 提交于 2019-12-21 03:17:13
问题 Here is my issue: I am using Google Places Autocomplete to gather information about places from the user. On the event "place_changed", I save this information. However I want to give the user the possibility to add multiple places. So after this place has been save I want to clear the input. However Google Autocomplete automatically replace the last entry in the input field. Anyway to get rid of that? The details : var inputDiv = $('#myinput'); var options = { types: ['(cities)'] }; var

Google Places Autocomplete Remove State and Country from Result

筅森魡賤 提交于 2019-12-21 02:34:09
问题 https://google-developers.appspot.com/maps/documentation/javascript/examples/places-autocomplete I have a page similar to the above google places autocomplete demo url whereby if i type Buckingham Palace. It will return results of Buckingham Palace Road, London, United Kingdom Buckingham Palace Shop, Buckingham Palace Road, Victoria, London, United Kingdom and etc. How do i remove London, United Kingdom from the results? 回答1: This is not possible without manually processing the results. If