diff options
Diffstat (limited to 'gmap_arcgis.js')
-rw-r--r-- | gmap_arcgis.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js index f5783d3..7fe4fca 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -227,8 +227,16 @@ function gmapArcgis(config) { this.config['layers'][element].opacity = this.defaultOpacity(element); if (typeof this.config['layers'][element].overlay != 'undefined') { - this.config['layers'][element].overlay.setOpacity(this.config['layers'][element].opacity); - this.identifyPolygon(this.config['layers'][element]); + if (this.config['layers'][element].overlay.setOpacity != undefined) { + this.config['layers'][element].overlay.setOpacity(this.config['layers'][element].opacity); + this.identifyPolygon(this.config['layers'][element]); + } + else if (this.config['layers'][element].overlay[0] != undefined) { + for (i=0; i < this.config['layers'][element].overlay.length; i++) { + this.config['layers'][element].overlay[i].setVisible(true); + } + } + this.unblockUI(); return; } @@ -354,8 +362,16 @@ function gmapArcgis(config) { }, // Toggle layer visibility + // TODO: it should really toggle and not just hide layers toggleLayers: function(element) { - this.config['layers'][element].overlay.setOpacity(0); + if (this.config['layers'][element].overlay.setOpacity != undefined) { + this.config['layers'][element].overlay.setOpacity(0); + } + else if (this.config['layers'][element].overlay[0] != undefined) { + for (i=0; i < this.config['layers'][element].overlay.length; i++) { + this.config['layers'][element].overlay[i].setVisible(false); + } + } if (this.config['layers'][element].identifyListener != undefined) { google.maps.event.removeListener(this.config['layers'][element].identifyListener); |