Answer the question
In order to leave comments, you need to log in
How to change the marker when hovering Yandex map?
Several markers are used on the map, when hovering the icon changes, if you open the balloon and hover over another marker and move it back, it does not change
objectManager.events
.add(['mouseenter'], function (e) {
objectManager.objects.setObjectOptions(e.get('objectId'), {
preset: 'mark-hover#icon'
});
})
.add(['mouseleave'], function (e) {
if (!myMap.balloon.isOpen(e.get('objectId'))) {
objectManager.objects.setObjectOptions(e.get('objectId'), {
preset: 'mark#icon'
});
}
});
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