Last active
January 30, 2016 19:39
-
-
Save sotoz/9df51213df3507849b70 to your computer and use it in GitHub Desktop.
Google map zoom out bug while scrolling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--1. φτιαχνεις εναν holder (gmap-holder) εξω απο το map-canvas που φόρτώνει ο χάρτης. | |
2. Βαζεις καρφωτο pointer-events:none; στο style του map-canvas (ή με αρχείο css). | |
3. Με jquery ελεγχεις το κλικ του holder και αφαιρείς το pointer-events στον χαρτη | |
--> | |
<div class="gmap-holder"> | |
<div id="map-canvas" style="pointer-events:none;height: 650px;width: 100%;"></div> | |
</div> | |
<script> | |
$(document).ready(function(){ | |
$('.gmap-holder').click(function(e) { | |
$('#map-canvas').css('pointer-events', 'all'); | |
}).mouseleave(function(e) { | |
$('#map-canvas').css('pointer-events', 'none'); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment