Answer the question
In order to leave comments, you need to log in
How to hide/show geo-objects in Yandex Map?
Hello comrades! Please help me figure it out.
I have a task to hide/show markers or polygons when clicking on certain checkboxes. I can't figure out how to hide/show geo-objects in Yandex Map. I tried combining markers into one collection, polygons into another collection. Further, I already used the following code (see below), but nothing happened:
markerCollection.options.set('visible', false);
polygonCollection.options.set('visible', false);
Answer the question
In order to leave comments, you need to log in
I did such a thing recently: I displayed objects on the map by checkboxes depending on the type of object (gas station, school, store, etc.).
I found this code:
So you are doing everything right. It doesn't even have to be in the collection.
Look for an error in the method call code. The checkbox change event may not be handled.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question