Git Product home page Git Product logo

google-address-autocomplete's People

Contributors

braunson avatar dericcain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

google-address-autocomplete's Issues

Update documentation to show that multiple instances can be created

If you look at #1 you will see that this library now has the ability to handle multiple instances of the autocomplete. Essentially, you can do this:

new AddressAutocomplete('.shipping-address', result => console.log(result));
new AddressAutocomplete('.billing-address', result => console.log(result));

And it will work just fine. The docs need to be updated to show that this can be accomplished.

International Addresses

I'm having an issue with non US addresses. Just testing it out, I used 10 Downing Street, but no city or localities are returned.

Here are the results:

{
    cityName: "",
    coordinates: Object { lat: 51.5033635, lng: -0.1276248 },
    country: "United Kingdom",
    countryAbbr: "GB",
    formattedAddress: "10 Downing St, Westminster, London SW1A 2AB, UK",
    state: "England",
    stateAbbr: "England",
    streetName: "Downing Street",
    streetNumber: "10",
    zipCode: "SW1A 2AB"
}

Both Westminster and London are in the formattedAddress, but missing from cityName.

Are there options to enable the localities that I'm missing?

Issue initializing ajax loaded inputs

I'm looking to initialize a second input that's ajax loaded on a page.

First the page loads with one input which get's initiated no problem.
Once the page is finished loading, it will make an Ajax call to include another input that should be initiated and says it is but it doesn't work as expected, nothing happens.

Ideas?

Broken link in documentation (super easy fix)

If you look at the contributing link at the bottom of the readme, the link is broken because it has .ms instead of .md as an extension. You should just be able to change the one letter from s to d to fix it.

Add options to Autocomplete

Hello,

Thank you for your tool.
Is it possible to make possible to add options to Autocomplete? For example I would like to restrict the area to a country. The code is the following:

 this.autocomplete = new google.maps.places.Autocomplete(this.element, {
    types: ["geocode"],
    componentRestrictions: {country: "fr"} // This option to restrict to France
}), this.autocomplete.addListener("place_changed", this.extractAddress)

Can you add the possibility to add options, for example like this:

var options= {
 componentRestrictions: {country: "fr"}
}
new AddressAutocomplete("#address-search", options, results => {...})

It will be necessary to merge with default option types: ["geocode"]

Thanks for your help!

Pass additional data to response

It would be nice to access other data in the response such as

  • geometry
    • latitude
    • longitude
  • id
  • place_id
  • url
  • vicinity
  • utc_offset
  • address_components > neightbourhood

Add event listener(s) to suggestion item

Hello,
Is there any option to add an event listener to suggestions? I would like to submit the parent form of the input element when an item is on the list of addresses is clicked.

Needs to be able to handle multiple fields

For instance, we should be able to do this:

new AddressAutocomplete('.shipping-address', result => console.log(result));
new AddressAutocomplete('.billing-address', result => console.log(result));

As it is right now, when you instantiate the second input, it will overwrite the first one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.