Example: Using the Places API from Google Maps services

@yisrael-wix Is there a known restriction with using the autocomplete widget on wix? If I understand it correctly, it just needs the input id and options. Its supposed to create the autocomplete functionality on the supplied input. I’m definitely getting requests through my API Key, but no list of predictions on the input I supplied.

The Live example currently has an invalid API key. You can load the template and use your own API key and it will work fine.

If I want to update this to do a address autocomplete do I just need to change out the type from “cities” to “address”? Is there any other code that would need to be modified?

The autocomplete can be adapted to your own needs. Refer to the Google Maps API documentation for the details.

Hello @yisrael-wix I’m sorry I’m a (french) noob but I would like to implement the Place Autocomplete adress google in my Wix Form (in order to be sure of the right . Could you please explain me simply the different steps ? I have the API key but I don’t understand were I can put it in my Wix editor… Sorry for that :slight_smile:

Hi @yisrael-wix . I copied your example code exactly, made sure the item names all matched, and I still can’t get this to work. In the console I get the following error on my live website:


Any assistance would be greatly appreciated!

Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

@yisrael-wix here you go:

https://editor.wix.com/html/editor/web/renderer/edit/05c4dec3-e97c-4691-b1e0-1af29da25e13?metaSiteId=87440d96-0037-4104-ae15-dab24b3dcfc5&editorSessionId=d54a35cd-c450-412c-9521-9f953f820d18&referralInfo=dashboard

Page = Google 2

@jonathandcochrane You need to make sure that your API key is configured correctly in your Google account:

@yisrael-wix That fixed it! Thank you so much. Your guidance is truly appreciated and your examples that you have posted throughout the membership community are top notch.

@yisrael-wix the final step i’m trying to do is get this add the search results to my database. Right now, even though #input1 shows the results of my search, it will only add in the actual values I type in the search bar before the suggested autocomplete fields populate #input1.

(ex: I start my searching for a location in Washington, DC … I type in “Wash”, and the autocomplete results show Washington, DC in #input1. If I add a button to submit that data to my database, all that is submitted is what I typed before the autocomplete function showed the results. My database will show “Wash” instead of Washington, DC).

Is there a function i’m missing which i’ll need to add to accomplish this final step? Thank you again for all your help.

@jonathandcochrane See the function setDetails() which is where the details of the selected location are retrieved. The final results as displayed in this function is what you want.

@ Yisrael (Wix)
Hi mate. How can you change your code to get the STREET ADDRESS autocomplete. ive gone through the google places API documentation but have failed miserably and am stuck. Could you please help?

The Google Places code is not a part of the Corvid product (which is what this forum is about). The example illustrates common usage and can be customized. You should try Google tech support for help. Or maybe StackOverflow.

hello,. how can i create cab rental quote source and destination with google map
is there anyone to help me out!!!

taxi fare calculator with google map

For anybody who’s interested in this feature: the Address Input Editor Element has been released .