Google maps iframe disable scrolling touch on mobile

半城伤御伤魂 提交于 2019-12-12 08:42:47

问题


Can I deactivate the google maps iframe when i'm on a mobile device?

Settings are already with scrolling=no, but when I scroll on mobile the map is activated and become active.

Is there a solution?

Thanks


回答1:


I had a similar problem and used something like this:

<style>
  .overlay {
    background:transparent; 
    position:relative; 
    width:640px
    height:480px; 
    top:480px; 
    margin-top:-480px;}
</style>

<html>
  <div class="overlay" onClick="style.pointerEvents='none'"></div>
  <iframe src="https://mapsengine.google.com/map/embed?mid=some_map_id" width="640" height="480"></iframe>
</html>

The div covers the map, preventing pointer events from getting to it. If you click on the div, it becomes transparent to pointer events, activating the map.



来源:https://stackoverflow.com/questions/19874289/google-maps-iframe-disable-scrolling-touch-on-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!