Answer the question
In order to leave comments, you need to log in
Yandex.Maps: Opening a balloon on a map with a specified template. How to do?
Essence: When you click on the map, you need to display a balloon with a form. For this, there is, in fact, the template itself (templateLayoutFactory).
To open the balloon, we use: map.balloon.open(coords, {...});
In the documentation, I found an example of adding my own template:
map.balloon.open(coords, {
myBodyContent: '<b>body content</b>',
myFooterContent: 'footer content'
}, {
contentBodyLayout: ymaps.templateLayoutFactory.createClass('<p>$[myBodyContent]</p>'),
contentFooterLayout: ymaps.templateLayoutFactory.createClass('<i>$[myFooterContent]</i>')
});
Answer the question
In order to leave comments, you need to log in
Probably the problem is that the options need to be passed as the third parameter, not the second.
If this is not the case, collect an example on jsfiddle
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question