Answer the question
In order to leave comments, you need to log in
How to prevent clusters from displaying hidden points on the map?
Good afternoon. I have a map with dots. I go through the loop through these points and, by condition, hide certain points, but the cluster displays all points (including hidden ones). How to prevent clusters from displaying hidden points on the map?
for (let i = 0; i < text_markers.length; i++ ) {
let html = "";
myPlacemark[i] = new ymaps.Placemark([text_markers[i].left_c, text_markers[i].right_c], {
balloonContent: '<div class="d-flex baloon-wrap"><img src="'+text_markers[i].img+'" alt=""><div class="baloon-wrap__right">'+html+'</div></div>'
},{
balloonMaxWidth: 700
});
if(text_markers[i].type == type_map){
myPlacemark[i].options.set('visible', true);
} else{
myPlacemark[i].options.set('visible', false);
}
}
Answer the question
In order to leave comments, you need to log in
I solved the problem by removing unnecessary points and drawing the necessary ones again. Perhaps not the most correct solution, but the cluster does not "stupid" with it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question