Last active
August 29, 2015 13:56
-
-
Save sgruhier/9273580 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// instantiate the addressPicker suggestion engine (based on bloodhound) | |
var addressPicker = new AddressPicker({map: {id: '#map'}}); | |
// instantiate the typeahead UI | |
$('#address').typeahead(null, { | |
displayKey: 'description', | |
source: addressPicker.ttAdapter() | |
}); | |
// Bind some event to update map on autocomplete selection | |
$('#address').bind("typeahead:selected", addressPicker.updateMap); | |
$('#address').bind("typeahead:cursorchanged", addressPicker.updateMap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment