V
V
Vlad2019-09-21 16:04:47
Yandex maps
Vlad, 2019-09-21 16:04:47

How to change the size of Yandex maps when displayed on different devices, as well as when changing their orientation?

I tried to make two divs with a script, where different srcs, and show depending on the size of the viewport with listening to the orientation change event and subsequent actions like $('.map400px').css('display', 'none'). Does not work.
Do you really have to bother with the Yandex Maps API?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Abr_ya, 2019-09-21
@Abr_ya

Set media queries in css for the map container.
As an option:
- width of the container - 100% of the screen,
- height - 100% of the screen height, but no more than xxx points (for large screens).

W
wja36rus, 2019-09-21
@wja36rus

Here the script is not needed from the word at all. Write media queries for popular screen resolutions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question