X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c47cb299a842a2eb7d022fcf4f0d02c08001f928..95b8297955268874bbc4dc657e96f5bc1f0fabb8:/app/assets/javascripts/index/query.js?ds=sidebyside diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index ee9d3f415..dfe0adfe2 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -68,9 +68,11 @@ OSM.Query = function (map) { 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"); @@ -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")); - 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); });