diff options
author | Silvio <silvio@socioambiental.org> | 2015-07-06 19:11:05 -0300 |
---|---|---|
committer | Silvio <silvio@socioambiental.org> | 2015-07-06 19:11:05 -0300 |
commit | 778b89e3ce65a1d329b7a7298416e11c11f944e4 (patch) | |
tree | e65fb8ec3edefeb87c5b52ea16a804243471b94e | |
parent | c9b831a7ac9f7a8e448e642059e5dcc0ba36042b (diff) | |
download | gmap_arcgis_js-778b89e3ce65a1d329b7a7298416e11c11f944e4.tar.gz gmap_arcgis_js-778b89e3ce65a1d329b7a7298416e11c11f944e4.tar.bz2 |
Use correct marker entry at toggleMarkers (2)
-rw-r--r-- | gmap_arcgis.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 7d89422..b3816ca 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -472,15 +472,25 @@ function gmapArcgis(config) { toggleMarkers: function(element, raw, cluster) { var markers = (raw == true) ? element : this.config['markers'][element].overlay; var isVisible = false; + var mark; // Hide/show each marker for (i=0; i < markers.length; i++) { - if (markers[i].marker.getVisible()) { + // Determine where exactly our marker is + if (markers[i].marker != undefined) { + mark = markers[i].marker; + } + else { + mark = markers[i]; + } + + if (mark.getVisible()) { isVisible = true; - markers[i].marker.setVisible(false); + mark.setVisible(false); } else { - markers[i].marker.setVisible(true); + mark.setVisible(true); } + } // Process clusters |