]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/query.js
Merge remote-tracking branch 'upstream/pull/5778'
[rails.git] / app / assets / javascripts / index / query.js
index ee9d3f41560c9a6ef9441b9fcac2d36dc1c13154..dfe0adfe2d62fb492309562ec143dfd5fda3bed9 100644 (file)
@@ -68,9 +68,11 @@ OSM.Query = function (map) {
     const tags = feature.tags;
     let prefix = "";
 
     const tags = feature.tags;
     let prefix = "";
 
-    if (tags.boundary === "administrative" && tags.admin_level) {
-      prefix = I18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
-        defaultValue: I18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
+    if (tags.boundary === "administrative" && (tags.border_type || tags.admin_level)) {
+      prefix = I18n.t("geocoder.search_osm_nominatim.border_types." + tags.border_type, {
+        defaultValue: I18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
+          defaultValue: I18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
+        })
       });
     } else {
       const prefixes = I18n.t("geocoder.search_osm_nominatim.prefix");
       });
     } else {
       const prefixes = I18n.t("geocoder.search_osm_nominatim.prefix");
@@ -326,7 +328,7 @@ OSM.Query = function (map) {
     const params = new URLSearchParams(path.substring(path.indexOf("?"))),
           latlng = L.latLng(params.get("lat"), params.get("lon"));
 
     const params = new URLSearchParams(path.substring(path.indexOf("?"))),
           latlng = L.latLng(params.get("lat"), params.get("lon"));
 
-    if (!window.location.hash && !noCentre && !map.getBounds().contains(latlng)) {
+    if (!location.hash && !noCentre && !map.getBounds().contains(latlng)) {
       OSM.router.withoutMoveListener(function () {
         map.setView(latlng, 15);
       });
       OSM.router.withoutMoveListener(function () {
         map.setView(latlng, 15);
       });