[TriLUG] Google Maps Autocomplete help?

Brian McCullough via TriLUG trilug at trilug.org
Wed Sep 5 01:37:35 EDT 2018


On Tue, Sep 04, 2018 at 11:07:38PM -0400, Triangle Linux Users Group discussion list wrote:
> Brian, are you parsing the places or creating places?

Hmmm, Wes.  I _think_ that I am parsing places, in your terms.

I have been using this,
https://google-developers.appspot.com/maps/documentation/javascript/places-autocomplete

among other places that seem to have similar documentation.

Mainly, I have a box ( HTML INPUT tag ) on my page ( form ) that prompts
the user for a Country, and another one that prompts for a City.

I use Autocomplete to "fill in" the values of each field, and then,
using the "place_changed" event, get the Place ID, which I pass back to
the server-side code for processing, just as you demonstrated.

I do like your work with "address_components.type," and may use it.
However, I am trying to only show the user choices that are actually
Countries, as opposed to all of the different types that you are testing
for.


Thank you for the reply.

Brian



More information about the TriLUG mailing list