Skip to content
Advertisement

Get zoom size on Google Map API

How can I get the zoom size in google map after changing by mouse wheel or zoom bar ?

I use Google Map API 3 with JavaScript.

I want to show in console.log() with every change.

Advertisement

Answer

Easy. As per docs:

google.maps.event.addListener(map, 'zoom_changed', function() {
    var z = map.getZoom();
    console.log(z);
});

Here’s a great utility that shows all the events as they fire.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement