I'm trying to create an event listener that turns off a google fusion layer once the map is zoomed in to a certain level. I'm pretty new to javascript and its google maps api, so any help is appreciated. I found some code that seems close to what I need:
google.maps.event.addDomListener(map, 'zoom_changed', function() {
var zoom = map.getZoom();
if (zoom >= 1 && zoom <= 9) {
layer_0.setMap(map);
layer_1.setMap(map);
}
else if (zoom > 9 && zoom <= 11) {
layer_0.setMap(map);
layer_1.setMap(map);
}
else if (zoom > 11) {
layer_0.setMap(null);
layer_1.setMap(map);
}
});