Flash message for no geocoder results

This commit is contained in:
Ansis Brammanis
2013-01-12 18:09:01 -05:00
parent e93f860c4c
commit 7c7121d1ea
+5
View File
@@ -10,6 +10,11 @@ iD.geocoder = function() {
encodeURIComponent(this.value) + '.json', function(err, resp) {
if (err) return hide();
hide();
if (!resp.results.length) {
return iD.flash()
.select('.content')
.text('No location found for "' + resp.query[0] + '"');
}
map.center([resp.results[0][0].lon, resp.results[0][0].lat]);
});
}