Fixup geocoding. This will need a form.

This commit is contained in:
Tom MacWright
2012-12-05 18:18:28 -05:00
parent 4dee98ea1a
commit 609b481730
2 changed files with 5 additions and 10 deletions

View File

@@ -82,7 +82,7 @@ table th {
left:0;
right:0;
bottom:0;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAI0lEQVQIW2NkYGD4f+/ePSAFAYxAzn84D1lASUmJAaQSQwUAcxYRaXDVJ6QAAAAASUVORK5CYII=);
background:#fff;
}
#about {

View File

@@ -60,11 +60,6 @@ window.iD = function(container) {
.call(bootstrap.tooltip()
.placement('bottom'));
window.grid = function(resp) {
map.center([resp.results[0][0].lon, resp.results[0][0].lat]);
};
this.append('div')
.attr('class', 'user')
.append('div')
@@ -133,10 +128,10 @@ window.iD = function(container) {
.on('keydown', function () {
if (d3.event.keyCode !== 13) return;
d3.event.preventDefault();
var val = this.value;
d3.select(document.body).append('script')
.attr('src', 'http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
encodeURIComponent(val) + '.jsonp?callback=grid');
d3.json('http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
encodeURIComponent(this.value) + '.json', function(err, resp) {
map.center([resp.results[0][0].lon, resp.results[0][0].lat]);
});
});
this.append('div')