Answer the question
In order to leave comments, you need to log in
How to get marker id?
There are several markers on the map, each marker has an ID property.
Everything is displayed like this
var shops = [
{
id: 12345,
city: 42,
coordinates: [55.74,37.61],
name: 'Название объекта',
desc: 'Адрес объекта в текстовом виде'
},
{
id: 54321,
city: 42,
coordinates: [55.47,37.16],
name: 'Название объекта',
desc: 'Адрес объекта в текстовом виде'
}
]
$.each(shops, function (index, value) {
if (value.city == city) {
points.push(new ymaps.Placemark(value.coordinates, {
balloonHeader: value.name,
balloonContent: "<div class='my_ballon'><h2>" + value.name + "</h2><p>" + value.desc + '</p></div>'
}, {
preset: "twirl#blueStretchyIcon",
balloonShadow: false,
balloonPanelMaxMapArea: 0,
// iconColor: '#',
}));
//Тут добавим айдишник и дату с айдишником неким элементам, при взаимодействии с которыми должно быть взаимодействие с нужным маркером
$('#art_' + value.id).attr('data-num', value.id);
}
});
$.each(points, function (index, value) {
myMap.geoObjects.add(value);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question