A
A
ASiD2016-12-13 21:33:29
JavaScript
ASiD, 2016-12-13 21:33:29

How to change the properties of a label applied to a Yandex Map via the API?

Using the API, I add a lot of Placemarks to the map:
myMap.geoObjects.add(myPlacemark);
I need to change the property of one of these marks. Tell me how to access the label, knowing its coordinates?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ASiD, 2016-12-14
@ASiD

I decided. In short:
1. Added all the tags to the collection, when adding, writing to a separate array which element corresponds to which ID (start from 0, increase by 1)
2. Add it to the map
3. When editing tags in the collection (referring to the collection variable, and not to the map variable), the changes are immediately reflected in the map.
For example:
where map_orgs is the name of the collection.
Here we take the collection element with id=5 and change the preset option.

F
freeExec, 2016-12-14
@freeExec

Go through all the labels and find with the desired coordinates. But in general, this is a bad method, it's better to search by ID.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question