aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2016-01-27 12:46:11 -0200
committerSilvio <silvio@socioambiental.org>2016-01-27 12:46:11 -0200
commit215448a1b8edcfa3c14b30c42b1d28c1a70b2194 (patch)
treeeb40b42562999b5dc639f65e8ca58339614a9e55
parent3bcf7d30f78f88f701cf70ced77917534a3f613a (diff)
downloadgmap_arcgis_js-215448a1b8edcfa3c14b30c42b1d28c1a70b2194.tar.gz
gmap_arcgis_js-215448a1b8edcfa3c14b30c42b1d28c1a70b2194.tar.bz2
toggleLayers: variable checks
-rw-r--r--gmap_arcgis.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index e695e9c..dc26742 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -436,11 +436,11 @@ function gmapArcgis(config) {
// Toggle layer visibility
toggleLayers: function(element) {
- if (this.config['layers'][element].overlay.setVisible != undefined) {
+ if (this.config['layers'][element].overlay != undefined && this.config['layers'][element].overlay.setVisible != undefined) {
var changeTo = !this.config['layers'][element].overlay.getVisible();
this.config['layers'][element].overlay.setVisible(changeTo);
}
- else if (this.config['layers'][element].overlay.setOpacity != undefined) {
+ else if (this.config['layers'][element].overlay != undefined && this.config['layers'][element].overlay.setOpacity != undefined) {
var opacity = this.config['layers'][element].overlay.getOpacity;
if (opacity == 0) {