E
E
Endru2015-05-26 13:38:59
css
Endru, 2015-05-26 13:38:59

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

3 answer(s)
M
Mikhail Osher, 2015-05-26
@miraage

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();
});

D
Dmitry Shinkar, 2015-05-26
@DeadCowsDontMoo

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.

M
metram, 2017-03-29
@metram

Tell me why on the site granit-ck.in.ua , when a modal window is called (by pressing the handset button), a slider, a menu, a Google map are also displayed (they were inserted into the template separately). How to make the modal window not close the slider?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question