P
P
Programmir2019-06-30 19:56:32
Yandex maps
Programmir, 2019-06-30 19:56:32

How to change the size of Yandex maps?

Suppose, on a large screen size, Yandex maps have a certain width, but when the screen is reduced, it is necessary that the map be full width. I tried to set ymaps width to 100%, but it did not help, apparently, the javascript code overlaps. How to set the width to 100% at low resolution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-06-30
@deepblack

Use the method fitToViewport()
https://tech.yandex.ru/maps/jsbox/2.1/fillcontainer
jsfiddle.net/Zb48K/4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question