I create tags like this

addressPointsCollection = new ymaps.GeoObjectCollection() addedAddressesCount = 0 for address in addresses geoObject = new ymaps.GeoObject geometry: type: 'Point' coordinates: [address.latitude, address.longitude] properties: # iconContent: address.service.name hintContent: address.location id: address.id , preset: 'islands#darkGreenCircleDotIcon' addressPointsCollection.add geoObject addedAddressesCount += 1 searchMap.geoObjects.add addressPointsCollection searchMap.setBounds(addressPointsCollection.getBounds(), { checkZoomRange: true }); 

Can I now know the id (id: address.id) refer to the label, for example, to change the icon?

In general, I want the following: the user clicks, hovers the cursor on the list item, in which there is a parameter with id, for this id the label is searched and something changes, for example the color of the icon.

    1 answer 1

    The fact that you set id: address.id in the properties will not give effect.

    I recommend storing the id: geoObject in a separate object accessible in the scope of the click handler and selecting the desired object by id from this dictionary. Since all references to the created object ( geoObject ) are equivalent, actions with them will have the same result. That is, you can change the color and other parameters such as

     addressDict[id].options.set('preset', 'islands#darkRedCircleDotIcon'); 

    Where addressDict is the aforementioned dictionary