Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Google Instant Places Autocomplete

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 380
    Comment on it

    When you type within the input box, google places autocomplete API helps you find similar places quickly by displaying searches that might be similar to the one you're typing. It provides your applications with the type-ahead-search behavior, the Google Places autocomplete is a feature of the Google Places API.

    Here is the implementation of google places autocomplete API.

    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=true"></script>
    $(document).ready(function()  
    {  
        // Google Places Autocomplete  
        var pickUpAddress = document.getElementById('pickUpAddress');
    
        // prevents enter key to submit form//  
        $('#pickUpAddress).keydown(function (e) 
        {
            if (e.which == 13 && $('.pac-container:visible').length) return false;
        }); 
    
        function initialize()
        {
            var options = {
            types: ['geocode'],
            componentRestrictions: {country: "usa"} // For Particular country, please change accordingly
            };
            var autocomplete = new google.maps.places.Autocomplete(pickUpAddress, options);
        }
        google.maps.event.addDomListener(window, 'load', initialize);
    });
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: