Created
December 2, 2012 20:29
-
-
Save jueyang/4190914 to your computer and use it in GitHub Desktop.
geocoder
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
$(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() | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kafebohemkode