Don't do the admin boundary special case unless admin_level is set
authorTom Hughes <tom@compton.nu>
Fri, 7 Nov 2014 15:00:22 +0000 (15:00 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 7 Nov 2014 15:00:22 +0000 (15:00 +0000)
app/assets/javascripts/index/query.js

index d0e9cc299e999058d9c4743aea95cba74f9adc36..d5b9fb2c1bcd962f4263fc395b11e30ad10ddc65 100644 (file)
@@ -83,7 +83,7 @@ OSM.Query = function(map) {
     var tags = feature.tags;
     var prefix = "";
 
-    if (tags.boundary === "administrative") {
+    if (tags.boundary === "administrative" && tags.admin_level) {
       prefix = I18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level)
     } else {
       var prefixes = I18n.t("geocoder.search_osm_nominatim.prefix");