diff --git a/code/search.js b/code/search.js
index 800adbc5..ac6359f1 100644
--- a/code/search.js
+++ b/code/search.js
@@ -50,7 +50,7 @@ window.search.Query.prototype.init = function() {
this.list = $('
')
.appendTo(this.container)
- .append($('- ').text('No results'));
+ .append($('
- ').text(this.confirmed ? 'No local results, searching online...' : 'No local results.'));
this.container.accordion({
collapsible: true,
@@ -272,6 +272,15 @@ addHook('search', function(query) {
if(!query.confirmed) return;
$.getJSON(NOMINATIM + encodeURIComponent(query.term), function(data) {
+ if(data.length == 0) {
+ query.addResult({
+ title: 'No results on OpenStreetMap',
+ icon: '//www.openstreetmap.org/favicon.ico',
+ onSelected: function() {return true;},
+ });
+ return;
+ }
+
data.forEach(function(item) {
var result = {
title: item.display_name,