diff options
-rw-r--r-- | gmap_arcgis.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 810d04a..e9e4070 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -434,10 +434,23 @@ function gmapArcgis(config) { this.config['layers'][element].overlay.setOpacity(opacity); } - else if (this.config['layers'][element].overlay[0] != undefined) { - for (i=0; i < this.config['layers'][element].overlay.length; i++) { - var changeTo = !this.config['layers'][element].overlay[i].getVisible(); - this.config['layers'][element].overlay[i].setVisible(changeTo); + else if (jQuery.isArray(this.config['layers'][element].overlay)) { + for (var i in this.config['layers'][element].overlay) { + + if (this.config['layers'][element].overlay[i].getVisible != undefined) { + var changeTo = !this.config['layers'][element].overlay[i].getVisible(); + this.config['layers'][element].overlay[i].setVisible(changeTo); + } + + // Nested layers from showPolygonFromQueryMultiple + if (jQuery.isArray(this.config['layers'][element].overlay[i])) { + for (var j in this.config['layers'][element].overlay[i]) { + if (this.config['layers'][element].overlay[i][j].getVisible != undefined) { + var changeTo = !this.config['layers'][element].overlay[i][j].getVisible(); + this.config['layers'][element].overlay[i][j].setVisible(changeTo); + } + } + } } } |