mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Fixup geocoding. This will need a form.
This commit is contained in:
@@ -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 {
|
||||
|
||||
13
js/id/id.js
13
js/id/id.js
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user