Giter Site home page Giter Site logo

Comments (8)

isAlmogK avatar isAlmogK commented on June 7, 2024

Basically are you supporting the following

components — A grouping of places to which you would like to restrict your results. Currently, you can use components to filter by country. The country must be passed as a two character, ISO 3166-1 Alpha-2 compatible country code. For example: components=country:fr would restrict your results to places within France.

from react-google-autocomplete.

ErrorPro avatar ErrorPro commented on June 7, 2024

@AlmogRnD Hi, thank you for your issue. I've made some changes regarding your issue. Please check @1.0.9 version and README.md as well.

from react-google-autocomplete.

isAlmogK avatar isAlmogK commented on June 7, 2024

thanks

from react-google-autocomplete.

isAlmogK avatar isAlmogK commented on June 7, 2024

I just tested and it's not working, did the update this is the my code

<Geosuggest
                            onFocus={this.onFocus}
                            onBlur={this.onBlur}
                            onChange={this.onChangeLocation}
                            onSuggestSelect={this.onSuggestSelect}
                            onSuggestNoResults={this.onSuggestNoResults}
                            componentRestrictions={{country: "us"}}
                            location={new google.maps.LatLng(37.09024, -95.712891)}
                            radius="20"  />

from react-google-autocomplete.

ErrorPro avatar ErrorPro commented on June 7, 2024

@AlmogRnD This is the working code i tested out yesterday:

<Autocomplete
    style={{width: '90%'}}
    onPlaceSelected={(place) => {
      console.log(place);
    }}
    types={['(regions)']}
    componentRestrictions={{country: "ru"}}
/>

Did you update the library? The current version is 1.0.9. Also i will provide you the working example(jsbin) later.

from react-google-autocomplete.

isAlmogK avatar isAlmogK commented on June 7, 2024

When I test your code out I get the following error
Uncaught Error: Missing parameter. You must specify location.

You have to set
location={new google.maps.LatLng(37.09024, -95.712891)}
I tested the following out and If I do a search for "sp" spain still shows up

<Geosuggest
                            onFocus={this.onFocus}
                            onBlur={this.onBlur}
                            onChange={this.onChangeLocation}
                            onSuggestSelect={this.onSuggestSelect}
                            onSuggestNoResults={this.onSuggestNoResults}
                            types={['(regions)']}
                            componentRestrictions={{country: "us"}}
                            location={new google.maps.LatLng(37.09024, -95.712891)}
                            radius="20"  />

from react-google-autocomplete.

ErrorPro avatar ErrorPro commented on June 7, 2024

@AlmogRnD Hey, sorry for delay. Check this out pls http://jsbin.com/dowinuzuvi/edit?js,output also i updated the doc. Now you can pass bounds prop to google autocomplete.

The example shows only Russians places cuz im passing 'ru' as country to the component.

from react-google-autocomplete.

ErrorPro avatar ErrorPro commented on June 7, 2024

i'm closing this issue.

from react-google-autocomplete.

Related Issues (20)

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.