Answer the question
In order to leave comments, you need to log in
How to pull up the contents of the label on the yandex map?
There is a map with labels. I need that when I click on the label, the alert displays the text of the label, which is specified in the array myCoords in the value text . Now here's what I have https://jsfiddle.net/w2vtmcz1/
Now the coordinates are displayed there, but I need text. I went through the documentation, honestly, but I don’t understand what method is needed to display the text. For coordinates, geometry.getCoordinates() is executed there
Answer the question
In order to leave comments, you need to log in
Your labels have no content, nothing to pull up.
You can get the desired text from the array by the label index:
const index = myCollection.indexOf(e.get('target'));
alert(myCoords[index].text);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question