Created
July 4, 2013 20:59
-
-
Save pontusab/5930197 to your computer and use it in GitHub Desktop.
Control Google Maps Zoom by your own html thru jQuery.
This file contains 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
$('.control a').click( function() | |
{ | |
var currentZoom = map.getZoom(); | |
if( $(this).text() == '+') | |
{ | |
if( currentZoom < 4 ) | |
{ | |
var currentZoom = parseFloat( currentZoom ) + 1; | |
} | |
} | |
else | |
{ | |
if( currentZoom > 2 ) | |
{ | |
var currentZoom = parseFloat( currentZoom ) - 1; | |
} | |
} | |
map.setZoom( currentZoom ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment