Z
Z
Zored2014-12-22 11:10:19
JavaScript
Zored, 2014-12-22 11:10:19

How to remove the scroll from Yandex maps?

In the mobile version of the site, if the map takes up the entire screen, the user cannot scroll down the page. What I did:

map.behaviors.disable('scrollZoom'); // — это отключает зум колёсиком мышки, всё ок.
map.behaviors.disable('multiTouch'); // — это отключает зум щипком, не очень нужно. 
map.behaviors.disable('drag'); // — это отключает прокрутку карты, но есть одно "но": сама страница также не прокручивается.

Here in Google maps everything is much simpler and clearer. :D

Answer the question

In order to leave comments, you need to log in

7 answer(s)
S
shamalex, 2018-01-23
@shamalex

you can override the style
.ymaps-map {
-ms-touch-action: auto !important;
touch-action: auto !important;
}

A
Alexey ZloDeeV, 2014-12-22
@ZloDeeV

Place an empty div on top of the map to fit

V
vordzer, 2015-10-05
@vordzer

Map.disableDragging() still works with no scrolling

D
Dmitry Shalmiev, 2016-10-19
@freeskateonly

Look at this question from the other side. Remove it in the mobile version with CSS and display it next with the help of the maps API, but already in static mode, using CSS classes bootstram (hidden-phone, visible-phone). Implemented like this here: sohoclinic.ru/kontakty

W
whooehoo, 2017-08-07
@whooehoo

ymaps-touch-scroll

D
Dmitry, 2018-06-20
@James-Ford

This article helped
https://sajgak.ru/site/javascript/otkljuchit-na-ja...

D
Denis L., 2019-10-09
@lisogorsky

In principle, here is a good article on the subject. There, using a simple script and a wrapper div, this problem is solved in a few lines of code: https://blog.lisogorsky.ru/ignor-scroll-iframe-maps

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question