[TriLUG] Google Maps Autocomplete help?

Wes Garrison via TriLUG trilug at trilug.org
Wed Sep 5 11:51:55 EDT 2018


According to the doc I linked, you can't search the autocomplete API based
on country or city, but you can autocomplete the street address and use the
parsing routine I wrote to get the country and city from the results of the
autocomplete.

I would have the text input be for the street address, then use hidden form
fields for country and city that you submit when you get the value returned
from the autocomplete.

Otherwise you may need to use a different API.
_________________________________
Wesley S. Garrison
Network Engineer
Xitech Communications, Inc.
phone:  (919) 260-0803
fax:       (919) 932-5051
__________________________________
"Lead us not into temptation, but deliver us from email."


On Wed, Sep 5, 2018 at 1:44 AM Brian McCullough via TriLUG <
trilug at trilug.org> wrote:

> 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
>
> --
> This message was sent to: Wes <wes at xitechusa.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  :
> https://www.trilug.org/mailman/options/trilug/wes%40xitechusa.com
> Welcome to TriLUG: https://trilug.org/welcome


More information about the TriLUG mailing list