Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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) { 

  else if (zoom >9 && zoom <=11) {

  else if (zoom >11) {

share|improve this question

Here is some code I'm successfully using to toggle a Fusion Tables layer in one of my maps:

google.maps.event.addListener(map, 'zoom_changed', function() {
    zoomLevel = map.getZoom();
    if (zoomLevel >= minFTZoomLevel) {
    } else {

it looks almost identical to your code, apart from addListener vs addDomListener. Can you try adding a breakpoint inside your function to make sure it's actually running?

share|improve this answer
Thanks for your help. I'm definitely a novice when in comes to Google Maps and Javascript, so I'm still working on it. – b-rad-b Aug 20 '13 at 17:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.