Autocomplete for address search??

Hi, let me start of by saying I am complete novice when it comes to code. I have experimented with some of the features and find the tutorials easy enough to use but…I am struggling with one specific feature that i need on my site.

I am trying to create a search bar with a “GO” button next to it on my site that will allow:

  1. Users to start to input their postcode, then autocomplete by bringing up a list of address that match.
  2. Once the User selects their postcode from the list and presses the “GO” button it will then advance to one of two pages, dependent on whether I work in the selected area or not.

My questions are; First, is this even possible using Wix Code? Second, if it is, how do i go about it??

I have had tried to research myself and found that using a google API?? I may be able to draw the autocomplete bit from google maps and they use a predefined area based on latitude/longitude to bring up those results but i have no idea how to get started.

Any advice, hints, tips or links to more research would be a huge help.

Check out Yisrael’s tutorial on how to do that here: https://www.wix.com/code/home/forum/wix-tips-and-updates/example-using-the-places-api-from-google-maps-services

Goodluck!

Thank you so much :slight_smile:

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

Eyal Michael Cohen, why does the Address Input editor element only returns some partial addresses while the autocomplete has the right address definition from Google? Try typing "Nouveau Chemin 12, 5310 Eghezée, Belgium - shows well in the autocomplete box, when clicked, it transforms to “Nouveau Chemin, 5310 Eghezée, Belgium”. Try again with “BP International Building E”, the autocomplete shows the right options, then once clicked, it transforms into “Sunbury-on-Thames, TW16, United Kingdom”. This is problematic. Is there a way to get the full JSON record back from Google Places API rather than a shorten version?

That is where Building E is in the BP International Centre for Business & Technology, that is why it is returning the address of Sunbury etc

BP International Centre for Business & Technology,
Chertsey Road, Sunbury-on-Thames
Middlesex TW16 7LN
United Kingdom

Which is sort of what the Address Input is supposed to do?

AddressInput
An element for entering addresses.
AddressInput lets users type an address and suggests exact locations using Google Maps services.
https://www.wix.com/corvid/reference/$w.AddressInput.html
https://www.wix.com/corvid/reference/$w.AddressInput.html#Address

If you want to do different things with it, then you will need to do what Yisrael has already mentioned in the provided link above.
https://www.wix.com/code/home/forum/wix-tips-and-updates/example-using-the-places-api-from-google-maps-services

…refer to the Google Maps API web services documentation for details on all the options available…

…The example demonstrates various Google Maps API functions which you can learn how to create your own interfaces. However, we are unable to provide support for the Google Maps API.

You might want to check out the WixArena - it’s a hub where you can look for Wix Code (and other) experts for hire…

Also note that this is an old post and being closed, if you need more help with this please add a new forum post thank you.