Answer the question
In order to leave comments, you need to log in
Responsive YandexMaps in bootstrap modal?
Good afternoon everyone.
Tell me, has someone already implemented an adaptive Yandex map in Bootstrap with display in the width and height of the window?
Are there any ready-made examples?
And are there any nuances in the implementation?
Answer the question
In order to leave comments, you need to log in
https://tech.yandex.ru/maps/jsbox/2.0/hiddendiv
As far as I understand, after opening the modal window, you need to "redraw" the map so that it fits into the desired dimensions. The code will look something like this:
var map = new ymaps.Map(...);
$modal.on('shown.bs.modal', function() {
map.container.fitToViewport();
});
I didn't do that, but I imagine it well ... We immerse the card in sm\md or whatever you need, and in theory everything will work without problems =)
Shl. read the question. I don't know about the modal window... You may have to abandon this idea, there will certainly be nuances.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question