google-places-api

how to create google autocomplete in bootstrap modal in angular 2+?

蓝咒 提交于 2019-12-05 02:14:30
I am using angular google maps (agm) i created google autocomplete by below way. in html <input type="text" #pick id="address" class="form-control" [(ngModel)]="pickAddress" name="pickAddress" (ngModelChange)="pickAdd()" placeholder="Pick Up Address" onclick="return false" style="padding-left: 30px;border-radius: 25px;border: 1px solid #31708f;" in Ts File: pickAdd() { var autocomplete:any; var options = { componentRestrictions: {country: "IN"} }; this. inputAddress = document.getElementById('address'); autocomplete = new google.maps.places.Autocomplete(this.inputAddress,options) google.maps

Android PlaceFilter usage with Google Places API

眉间皱痕 提交于 2019-12-05 02:13:33
I am trying to use the Google Places API and I would like to filter my search to only gym types. I am using the code given at https://developers.google.com/places/ public void onPickButtonClick(View v) { // Construct an intent for the place picker try { PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder(); Intent intent = intentBuilder.build(this); // Start the intent by requesting a result, // identified by a request code. startActivityForResult(intent, REQUEST_PLACE_PICKER); } catch (GooglePlayServicesRepairableException e) { // ... } catch

How to enable CORS for Google Places API

别来无恙 提交于 2019-12-05 02:03:38
I have tried everything possible to make my app work without the need for the "Enable CORS extension for Chrome". I followed the steps on Google's official website which talks of authtokens, tried using every different key, but nothing works. I get the following error: XMLHttpRequest cannot load https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=MyKey&location=33.854546,-84.35870369999999&types=restaurant&rankby=distance. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin http://localhost:8100 is therefore not allowed access. Is it even possible

Is the Map Api Key and Google Places Api the same?

送分小仙女□ 提交于 2019-12-05 01:46:45
I hope I don't get a down vote, English is not my first language that is why I get confused by api documentations. I am confused if I need to generate different api keys for "Google Maps Android API" and "Google Places API for Android" I am asking because I am sucessfully rendering maps from my android app using google maps android api but when I try the using the code of the official google android places api example (PLACE PICKER) it is failing without throwing any errors. It renders the activity properly but when I click the find places button it just returns me to my previous activity with

Google Places Autocomplete suggestions with Unit No/Subpremise is not coming in the response array

余生长醉 提交于 2019-12-04 23:51:30
I am using Google places API to auto-complete addresses using javascript When I type the unit number and street number of address in the input box it shows the results in suggestion drop-down but when I select the address the listener for action 'place_changed' event don't have any address with address_component with type 'subpremise' even the formatted_address property don't have the unit number in it.Though it does contain other details from 'street number','city','country' etc For example : If I type "1403/648 Bourke Street" with a country restriction to Australia. It shows me 5 results in

Change default text “Enter a Location” In Google Maps Places API

房东的猫 提交于 2019-12-04 23:40:19
I've looked all over the internet trying to find an answer to my problem, and the closest thing I've found to an answer is another Stack Overflow question, here: How do i change the default text in Google Maps API Places Autocomplete The problem is that either the OP did not have quite the same requirements as myself, or they didn't quite make it clear if they do. I'm looking for a way to take the default "Enter a Location" in the text input field, and replace it with something else while keeping the same functionality . i.e. have the text disappear on focus, and reappear when it loses focus

Google Maps Android API v2, Marker title/snippet wrong display

爱⌒轻易说出口 提交于 2019-12-04 22:24:29
问题 I use Google Maps Android API v2 with Android to show current position with nearby markers. Nearby places locations and titles are received using Google Places API. The problem is that non-english names at title/snippet are shown in fail way. For the instance, Hebrew names. The sreenshot is attached. ) 回答1: Since Arabic and Hebrew are causing problems, and English and Russian are not, I am going to guess that something is broken in the default info window implementation with respect to right

Google Places API place_id field length

淺唱寂寞╮ 提交于 2019-12-04 22:15:52
Google has marked the reference and id fields as deprecated as of June 24th 2014, and replaced it with a single place_id . I've so far only seen place_id lengths of exactly 27 characters, but wonder if there is any documentation for this length? I have been unable to find this documented anywhere. Obviously knowing the length of the place_id is significant for choosing an optimal database field, and therefore something I'd like to know. From the Google Places API docs site: The id and reference fields are deprecated as of June 24, 2014. They are replaced by the new place ID, a unique

React Native - How can I display an image returned by Google Place Photos API?

流过昼夜 提交于 2019-12-04 22:01:12
I have developed a backend API which given the latitude and longitude of a location it returns an image for the city using Google Places Photos API My React Native app calls the endpoint to try and load the image into an Image view. This is how the app calls the endpoint and receives the response... try { let imageResponse = await fetch( `https://budgettrip.herokuapp.com/locationimage/${latitude}/${longitude}` ); let response = await imageResponse; this.setState({ locationImage: response }); } catch (error) { console.error('location image error', error); } The backend code for getting an image

Unable to use the table #2 types with Google Places API

我的梦境 提交于 2019-12-04 20:27:26
I am unable to get any results with the Places API when I use a types=transit_station|neighborhood (or any other type included in the table 2 here: http://code.google.com/apis/maps/documentation/places/supported_types.html#table2 Apparently, this is not related to a specific location (I've tried both Milan, Italy and London, GB), so I'm wondering if I'm doing something wrong or if the API is not currently working as expected. If the above has no solution, I'd be very happy if there was another way of finding the neighborhood of a building (for instance, in this map: http://g.co/maps/hfdke I'd