google-places-api

Google Places Autocomplete Vue.js

白昼怎懂夜的黑 提交于 2019-12-12 18:49:37
问题 I am trying to implement Google Places Autocomplete in Vue.js. The API states that the Autocomplete class first takes an inputField:HTMLInputElement , as used in their example: autocomplete = new google.maps.places.Autocomplete( /** @type {!HTMLInputElement} */(document.getElementById('autocomplete')), {types: ['geocode']}); Since we cannot pass elements around by their ID's in Vue.js? How would this be achieved, and what kind of construct would we pass? e.g. the following code fails

Getting JSON file from Google Places API

本秂侑毒 提交于 2019-12-12 17:40:27
问题 I am trying to use the Places API and I was initially trying to use $.ajax from jQuery but I kept getting an unexpected token error on the first element of the file. But I realized then that you can't get JSONP from the Places API. So below is a sample of what it returns, I can't for the life of me get it to print id into console (for starters)...Could someone maybe point me in the right direction? JSON returned from Places: { "html_attributions" : [], "results" : [ { "geometry" : { "location

Passing google event data in addListener

大憨熊 提交于 2019-12-12 17:01:20
问题 I have a variable number of text fields to which I am initialising Google Maps Autocomplete dynamically. The problem is that every time the place_changed event is fired, I need to know exactly which input box it was fired on. How can I pass this data to my saveLocation function? Currently, event evaluates to undefined. initAutocomplete = function (element) { autocomplete = new google.maps.places.Autocomplete( /** @type {!HTMLInputElement} */(element), {}); autocomplete.addListener('place

Google Places api for android network error

巧了我就是萌 提交于 2019-12-12 16:21:56
问题 I'm using the google places autocomplete fragment to search for places. It has been working for a few weeks now and all of a sudden today, I'm getting the following error: E/AsyncOperation: serviceID=65, operation=AddPlace OperationException[Status{statusCode=NETWORK_ERROR, resolution=null}] at amsa.b(:com.google.android.gms:266) at amro.a(:com.google.android.gms:60) at lin.run(:com.google.android.gms:111) at llt.run(:com.google.android.gms:450) at java.util.concurrent.ThreadPoolExecutor

Place Picker closes after launching

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 15:13:01
问题 I am not able to launch Google Place Picker from my fragment. Followed all the steps and forums for the root cause but not able to resolve my issue. Links Google Place Picker Already checked following without any success Android Place Picker closes immediately after launch Place Picker Automatically close after launch I have created Google Places API for Android key and added to manifest I have even tried a release build. Only error message I receive is 03-18 12:02:32.524 1679-1900/? E

How to pause a FOR loop in Javascript in a function?

丶灬走出姿态 提交于 2019-12-12 14:51:39
问题 There's a query per second limit in Google Places API, so I need to slow down my loop which sends requests: function callback(results, status) { if (status != google.maps.places.PlacesServiceStatus.OK) { alert(status); return; } for (var i = 0, result; result = results[i]; i++) { RequestInfo(result); } } Any idea how I can do that? I'm a bit of a newb. 回答1: Recursive solution, function requestInfoWrapper(results, i) { i = i + 1; if (i >= results.length) {return}; requestInfo(results[i]);

How to invoke setCountry() to AutocompleteFilter Google place API?

社会主义新天地 提交于 2019-12-12 12:35:25
问题 I am implementing PlaceAutocompleteFragment for auto complete of location. I want to restrict my search to specific country ( like earlier we use component=UK in url). How can I achieve this in my below code. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment) getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment);

Place API for Android

ε祈祈猫儿з 提交于 2019-12-12 12:25:32
问题 I'm trying to use the Google Places API in my application. For that I need to generate Server Key. I used my device IP address to generate a Server Key. My app works only in my device. If I use some other device I get an error: { "error_message" : "This IP, site or mobile application is not authorized to use this API key.", "predictions" : [], "status" : "REQUEST_DENIED" } Could you please help me in this regards. How to generate Server key which works for all devices. 回答1: To generate the

Google Places API: Are “place_id” or “id” unique to any city in the world?

我怕爱的太早我们不能终老 提交于 2019-12-12 11:27:59
问题 When doing a autocomplete API call for a location, I request a JSON response from google. What is the difference between the "id" and "place_id" string? Are these two id's unique to any city in the world? Does google places assign every city in the world an id? For example, does Somers, NY, USA have the same id as Somers, New York, United States? Is there an easy way to get an id for a city? (from a google maps url or something?) Here is the JSON response from a autocomplete api call of

Places API not enabled for iOS even if it's already enabled

余生颓废 提交于 2019-12-12 09:53:44
问题 I have integrated Places Autocomplete or Places API along with Maps, Google Login and Firebase RealtimeDatabase. But when I run the app, the error says: "The operation couldn’t be completed. The Places API for iOS is not enabled. See the developer's guide (https://developers.google.com/places/ios-api/start) for how to enable the Google Places API for iOS." Places was working fine until: Last week, I had to ditch my Firebase project and create a new one. Did what was required: -changed the