How to sort Google autocomplete results by airport

10 views
Skip to first unread message

Rashedul Alam

unread,
Oct 17, 2016, 7:04:03 AM10/17/16
to Google Maps JavaScript API v3
I am using Google map autocomplete in my applications. I want to sort the results by airport. Suppose if somebody type dfw then Dallas/Fort Worth International Airport will come first. That means if there exists any airport it will appear first. My code is here:

var autocomplete = new google.maps.places.Autocomplete(document.getElementById('PickupAdd')
        );

        autocomplete.bindTo('bounds', map);
        var infowindow = new google.maps.InfoWindow();
        var marker = new google.maps.Marker({
            map: map,
            anchorPoint: new google.maps.Point(0, -29)
        });

A sample expected output is given bellow.


I want to follow exactly this web site.

Can anybody help me?

NB: I am using JavaScript API


Reply all
Reply to author
Forward
0 new messages