Skip to content

Instantly share code, notes, and snippets.

@jueyang
Created December 2, 2012 20:29
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 jueyang/4190914 to your computer and use it in GitHub Desktop.
Save jueyang/4190914 to your computer and use it in GitHub Desktop.
geocoder
$(input).keydown(function (e) {
var value = $(this).val();
if (value.length > 3) {
_.debounce(goGeo(value), 300);
}
var query = $(this).val();
goGeo(query);
});
// $(button).submit(function () {
// var query = $(this).val();
// goGeo(query);
// });
function goGeo(q) {
$.getJson('http://api.tiles.mapbox.com/v3/mapbox.flickr-places/geocode/' + q + '.json', function(res) {
$('.dropdown').html(
)
coordinates = {
lat = res.lat,
}
map.ease()
});
}
@tmcw
Copy link

tmcw commented Dec 2, 2012

kafebohemkode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment