Skip to content

Instantly share code, notes, and snippets.

@sotoz
Last active January 30, 2016 19:39
Show Gist options
  • Save sotoz/9df51213df3507849b70 to your computer and use it in GitHub Desktop.
Save sotoz/9df51213df3507849b70 to your computer and use it in GitHub Desktop.
Google map zoom out bug while scrolling
<!--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