There is a map with labels and baluns (Yandex api 2.1), and there is a list of addresses outside the map. by clicking on this list, you need to open the balun, and center the map, everything seems to be done, but for some reason, the clicker does not always open the desired balun, whatβs wrong? I really need help!
// ΠΠΎ ΠΊΠ»ΠΈΠΊΡ Π½Π° Π°Π΄ΡΠ΅Ρ, ΠΎΡΠΊΡΡΠ²Π°Π΅Ρ Π±Π°Π»ΡΠ½ ΠΈ ΡΠ΅Π½ΡΡΠΈΡΡΠ΅Ρ ΠΊΠ°ΡΡΡ $('.filter-result').on('click', '.filter-result__item', function(){ $(".filter-result__item").removeClass('filter-result__item_active'); $(this).addClass('filter-result__item_active'); var pos = $(this).find('.shop-address').text(); var indexObj = $(this).index(); //Π½ΠΎΠΌΠ΅Ρ ΠΌΠ΅ΡΠΊΠΈ var point = myMap.geoObjects.get(indexObj); //ΠΊΠΎΠΎΡΠ΄ΠΈΠ½Π°ΡΡ ΠΌΠ΅ΡΠΊΠΈ var npoint = $.map(point.geometry.getCoordinates(), Number); //ΡΠ΅Π½ΡΡΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΠΊΠ°ΡΡΠ° myMap.setCenter(npoint, 13, {checkZoomRange: true, }).then(function () { //ΠΎΡΠΊΡΡΡΡ Π±Π°Π»ΡΠ½ point.balloon.open(); }, function (err) { }, this); });