Address Search Using Google Search Autocomplete With Restricted Countries

We can easily search the particular address with Street No,Street,City,State and Country using google search autocomplete, below my code is implement in ruby on rails

Here my java script

<script src=";libraries=places"></script>

<script type="text/javascript">
 // script for address autocomplete search
    var autocomplete;
    var geocoder;
    var input = document.getElementById('advertiser_address');
    var options = {
      componentRestrictions: {'country':'us'}

    autocomplete = new google.maps.places.Autocomplete(input,options);

here componentRestrictions says that we can search only particular country addresses.  

Post a Comment

1 comment:

  1. If you desire to grow your knowledge just keep visiting this web page and be updated with the latest posted here
    12v 100Ah LiFePo4