Answer the question
In order to leave comments, you need to log in
How to link a Yandex map marker and an element outside the map?
I use Yandex maps. On the map, let's say 10 markers - points of restaurants. Below the map is a list of these restaurants (they have unique id or data attributes). How to assign the class active to the required list element by clicking on the map marker. The question is exactly how to connect a marker on the map and some element on the page outside the map. There was an idea to somehow set a unique id + serial number for the marker, for example myid1 and the same ids for the list elements, but it doesn't work. Mb there is an easier option.
Answer the question
In order to leave comments, you need to log in
Identifiers are added to markers - a property with a unique value, and "elements outside the map" are added the corresponding data-attribute. When clicking, the value of the identifier is obtained, the value of the data-attribute determines the element to which the class should be added. Everything .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question