Skip to content

Instantly share code, notes, and snippets.

@sgruhier
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sgruhier/9273580 to your computer and use it in GitHub Desktop.
Save sgruhier/9273580 to your computer and use it in GitHub Desktop.
// 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