Answer the question
In order to leave comments, you need to log in
How to trigger a click event in Yandex Map API?
There is a map object (polygon):
I have written a function that sets the data for the balloon and opens it when clicking on this region of the map:
Sample cases that I want to achieve:
var region1 = new ymaps.GeoObject({ ... });
region1.events.add('click', function (e) { ... });
ymaps.SuggestView()
, call the click event on the found coordinates to work out the function (opening the balloon).Answer the question
In order to leave comments, you need to log in
It is necessary not onClick
to call, but to take the desired marker and call itopenBalloon
...add.call(this or whatever scope you need, coordinates). popular ide allow you to view the structure of objects in a convenient way. ymaps use the same js incl. it’s better to spend time not on learning managerial slang, but on js and api ymaps manual.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question