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 = OSM.i18n.t("geocoder.search_osm_nominatim.border_types." + tags.border_type, {
+ defaultValue: OSM.i18n.t("geocoder.search_osm_nominatim.admin_levels.level" + tags.admin_level, {
+ defaultValue: OSM.i18n.t("geocoder.search_osm_nominatim.prefix.boundary.administrative")
+ })
});
} else {
- const prefixes = I18n.t("geocoder.search_osm_nominatim.prefix");
+ const prefixes = OSM.i18n.t("geocoder.search_osm_nominatim.prefix");
for (const key in tags) {
const value = tags[key];
}
if (!prefix) {
- prefix = I18n.t("javascripts.query." + feature.type);
+ prefix = OSM.i18n.t("javascripts.query." + feature.type);
}
return prefix;
if (results.remark) {
$("<li>")
.addClass("list-group-item")
- .text(I18n.t("javascripts.query.error", { server: url, error: results.remark }))
+ .text(OSM.i18n.t("javascripts.query.error", { server: url, error: results.remark }))
.appendTo($ul);
}
if ($ul.find("li").length === 0) {
$("<li>")
.addClass("list-group-item")
- .text(I18n.t("javascripts.query.nothing_found"))
+ .text(OSM.i18n.t("javascripts.query.nothing_found"))
.appendTo($ul);
}
})
$("<li>")
.addClass("list-group-item")
- .text(I18n.t("javascripts.query.error", { server: url, error: error.message }))
+ .text(OSM.i18n.t("javascripts.query.error", { server: url, error: error.message }))
.appendTo($ul);
});
}
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);
});