google-places-api

How can I restrict the Google Maps Places Library's Autocomplete to suggestions of only one city's places?

妖精的绣舞 提交于 2019-11-30 13:27:08
I am currently using the given code, but this only restricts suggestions to one country. I have seen one implementation but its using jQuery and I want to do it without using jQuery. var input = document.getElementById('searchTextField'); var options = { //types: ['(cities)'], componentRestrictions: { country: 'pk' } }; var autocomplete = new google.maps.places.Autocomplete( input, options ); Try adding a bounds property to the options object you are passing to the Autocomplete constructor, as shown in this code: var southWest = new google.maps.LatLng( 25.341233, 68.289986 ); var northEast =

Google Places API for Android - PlacePikcer without search option

浪尽此生 提交于 2019-11-30 12:10:38
问题 I am building an application, where the user has to select a Place he wants. For that, I am using the PlacePicker dialog, as the Google Places API for Android is teaching in the API reference site. However, when the user click the button and open the Place Picker Dialog, it does not have any button where the user can type the name of the place he wants to select. So, the user will have to select a place just dragging on the map; this is horrible for the user, specially if he wants to choose a

Adding PlaceAutocompleteFragment to fragment throws error

时间秒杀一切 提交于 2019-11-30 11:11:09
I have implemented PlaceAutocompleteFragment in activity and is working successfuly. But how to implement the same in fragment in android? I have implemented placeautocomplete fragment like this PlaceAutocompleteFragment autocompleteFragment1 = (PlaceAutocompleteFragment) getFragmentManager().findFragmentById(R.id.place_autocomplete_fragment1); Error I am getting is Incovertible types;cannot cast 'android.support.v4.app.Fragment' to com.google.android.gms.location.PlaceAutocompleteFragment '. XML LAYOUT IS <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout

How to customize PlaceAutocomplete widget dialog design to list places

倖福魔咒の 提交于 2019-11-30 10:26:43
问题 I need to show list of places in dropdown using google placeAutocomplete widgets. Here I'm getting dialog to show places according to my query but I need to give custom design for that search result dialog as like in Uber, Ola apps. Here I want design like below image. If anyone done this before please give me your suggestions,thanks in advance. 回答1: You need to customize your adapter. I had implemented this functionality in my project. You can follow this. activity_search.xml <?xml version=

Google Maps Autocomplete WITHOUT Atmosphere Data

核能气质少年 提交于 2019-11-30 09:18:02
I am currently using the Google Maps Places Autocomplete Javascript API to let users select a location by searching for the address or establishment name. Example code: autocomplete = new google.maps.places.Autocomplete(input); google.maps.event.addListener(autocomplete, 'place_changed', function () { console.log(autocomplete.getPlace()); }); This gets the following data. { "address_components":[ { "long_name":"1600", "short_name":"1600", "types":[ "street_number" ] }, { "long_name":"Amphitheatre Parkway", "short_name":"Amphitheatre Pkwy", "types":[ "route" ] }, { "long_name":"Mountain View",

Google places api restaurant types

让人想犯罪 __ 提交于 2019-11-30 08:09:23
When you search for a restaurant in Google places and go to the business profile (i.e.: https://plus.google.com/107507038669791289691/about?hl=en ) the restaurant has a tag (in this case Mexican Restaurant). But when using the Google places api all I can see is a types list "types" : [ "restaurant", "food", "establishment" ] Anyone know if it's possible to get the tag "Mexican Restaurant" somehow? I know about the supported types ( https://developers.google.com/places/documentation/supported_types ). It is not super helpful. I think you would probably have to revert to the text search method

Android studio can not resolve com.google.android.gms.location.places.AutocompleteFilter

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 07:04:19
问题 I am trying to implement a autocomplete places search following this article. http://www.truiton.com/2015/04/android-places-api-autocomplete-getplacebyid/ I have followed all steps, and also added proper dependencies in my build.gradle file. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.google.android.gms:play-services:6.5.87' } Also here are the meta data section in my manifest. <meta-data android:name="com

ApiNotActivatedMapError for simple html page using google-places-api

孤街醉人 提交于 2019-11-30 06:17:49
问题 I'm trying to create a simple html page (I'd later like to add an autocomplete input there) that include google-places-api. I have an api-key (which is enabled) but I still get an error message. Here is my html- <head> <meta charset="utf-8"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MY_KEY&libraries=places"></script> <title>test</title> </head> <body> </body> but I get this error message- and in the console I get - Google Maps API error: Google Maps API

Google Places Autocomplete - Pick first result on Enter key? [duplicate]

若如初见. 提交于 2019-11-30 06:12:40
This question already has an answer here: Google maps Places API V3 autocomplete - select first option on enter 17 answers I'm using a Google Places Autocomplete and I simply want it to select the top item in the results list when the enter key is pressed in the form field and suggestions exist. I know this has been asked before: Google maps Places API V3 autocomplete - select first option on enter Google maps Places API V3 autocomplete - select first option on enter (and have it stay that way) But the answers in those questions don't seem to actually work, or they address specific added

Google API keys - What is server key and browser key

倾然丶 夕夏残阳落幕 提交于 2019-11-30 05:56:54
I ma using google maps in my app, and use the URL as following format without the API key- values, <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=SET_TO_TRUE_OR_FALSE"> </script> Now I need to use the API key to track the requests, according to the examples it needs to add another API key query string parameter, <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE"> </script> But, I received 2 keys, One for servers (IP address restrictions) and one for browser apps (domain level restrictions) are