I have an ObjectManager in which I add objects.
function createStation(coordinates, nameOfMyPolygon, background, id) { objectManager.add({ type: 'Feature', id: id, geometry: { type: 'Polygon', coordinates: coordinates }, properties: { name: nameOfMyPolygon }, options: { fillColor: background, labelDefaults: 'light', labelLayout: '{{properties.name}}' } }); } and I use this function 100 times and create and add 100 objects. Here is the code I use to hang on all objects in the object manager click event
objectManager.events.add('click', () => { popupSectionInfo.classList.add('active'); priceSectionPopup.classList.remove('top'); popupSectionInfo.classList.add('top'); }); And now the fact that I can not understand. How can I hang on two different objects, two different click events? I would be glad if you can give an example.
Ps I read the documentation and I found the filters, but I figured out only how to display this or that object, but I did not understand how to attach the event to different objects ... Here is the link https://tech.yandex.ru/maps/doc/jsapi/ 2.1 / ref / reference / ObjectManager-docpage