Skip to content

Instantly share code, notes, and snippets.

@pontusab
Created July 4, 2013 20:59
Show Gist options
  • Save pontusab/5930197 to your computer and use it in GitHub Desktop.
Save pontusab/5930197 to your computer and use it in GitHub Desktop.
Control Google Maps Zoom by your own html thru jQuery.
$('.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