google-places-api

get Lat Lang from a place_id returned by autocomplete place api

纵然是瞬间 提交于 2019-12-03 18:59:49
问题 I am searching the place in my apps using the google autocomplete place api and now I want to get latitude and longitude of the place that i have searched. How to get latitude and longitude from the result returned by autocomplete place api by google in android? 回答1: The following code snippet which uses Google Places API for android worked for me Places.GeoDataApi.getPlaceById(mGoogleApiClient, placeId) .setResultCallback(new ResultCallback<PlaceBuffer>() { @Override public void onResult

Travel destinations API [closed]

廉价感情. 提交于 2019-12-03 17:13:50
When you google a country's name , the results page displays a section called "travel guide", which includes travel info about that country and a little list of destinations as shown in the image below. Is there a way to fetch this kind of data (eg, country name, description, things to do (as an array with title, description, image), popular trips, when to visit, etc...) via the Google Places API ? I've been researching it for a while now and haven't been able to get anywhere near. If it isn't possible, is there another api that could get me somewhere near to this data? There are multiple

Only list the cities name Geocomplete.js or Google Location Autocomplete

╄→尐↘猪︶ㄣ 提交于 2019-12-03 16:37:54
I want to only show the cities name using Geocomplete.js. I have restrict the search to only show the cities. But it is still showing the Country name "United State" at the end, i want to get rid from it. Any Suggestions please Thanks PC. Glad that I finally found solution for geocomplete.js! Hope it will be useful to someone. Solution: Send options with restrictions required to geocomplete function: var options = { types: ['(cities)'], componentRestrictions: {} }; $("#source").geocomplete(options); You can also send country-based restrictions. with Options like var options = { types: ['

Google places autocomplete not working in Windows mobile IE Browser

僤鯓⒐⒋嵵緔 提交于 2019-12-03 13:51:33
问题 We are building a mobile site for our product ridingo. We use the google places autocomplete feature extensively on our site. This is used to provide suggestions to users as they type. We tested this across multiple browsers and on devices. This is working fine in Android devices and IOS. But, on Windows mobile (OS Version 8, IE browser), the autocomplete/autopopulate list is almost unusable Problems: We are unable to touch the desired item on the autopopulate list. When touching it, it

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

不问归期 提交于 2019-12-03 13:14:22
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); This is currently not supported, for supported request parameters please see the reference documentation . If you think this would be a useful feature please

Fail to obtain specific Place from PlaceBuffer

泪湿孤枕 提交于 2019-12-03 12:58:06
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 AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view,

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

血红的双手。 提交于 2019-12-03 12:36:12
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.Map(document.getElementById('map-canvas'), { mapTypeId: google.maps.MapTypeId.ROADMAP }); var

Change foreground and background color of Place Autocomplete Fragment

感情迁移 提交于 2019-12-03 12:21:55
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. 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 all autonomous API instead of creating your own layout and integrating, it comes up by default which will

Google places API returning only 5 results

淺唱寂寞╮ 提交于 2019-12-03 10:54:46
问题 I am consuming Google places API, It returns only top 5 search results. Is there any way to increase the count . e.g. URL i searched for keyword "new" https://maps.googleapis.com/maps/api/place/autocomplete/json?input=new&types=%28regions%29&sensor=false&key=API_KEY 回答1: From the documentation: A JSON response contains two root elements: "status" contains metadata on the request. See Status Codes below. "predictions" contains an array of places, with information about the place. The Places

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

ε祈祈猫儿з 提交于 2019-12-03 09:53:07
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 autocomplete = new google.maps.places.Autocomplete(inputDiv[0], options); google.maps.event.addListener