diff --git a/js/app.js b/js/app.js
index b46cfb8..52ea89e 100644
--- a/js/app.js
+++ b/js/app.js
@@ -179,7 +179,7 @@ function initSelectors() {
rayonSel.value = found.rayon;
updateVillages();
villageSel.value = found.village;
- map.setView(found.center, 13);
+ map.setView(found.center, 15);
L.popup()
.setLatLng(found.center)
.setContent(`${found.village}
${found.oblast}, ${found.rayon}`)
@@ -200,15 +200,10 @@ function initSelectors() {
villageSel.addEventListener("change", function () {
const name = this.value;
if (!name) return;
- const oblast = KZ_DATA.find((o) => o.oblast === oblastSel.value);
- if (!oblast) return;
- const rayon = oblast.rayons.find((r) => r.rayon === rayonSel.value);
- if (!rayon) return;
- const village = rayon.villages.find((v) => (typeof v === "string" ? v : v.name) === name);
- const center = getVillageCenter(village) || (rayon ? rayon.center : null) || oblast.center;
- if (center) {
- map.setView(center, 14);
- L.popup().setLatLng(center).setContent(`${name}
${oblast.oblast}, ${rayon.rayon}`).openOn(map);
+ const found = findVillageData(name);
+ if (found && found.center) {
+ map.setView(found.center, 15);
+ L.popup().setLatLng(found.center).setContent(`${found.village}
${found.oblast}, ${found.rayon}`).openOn(map);
}
});