diff options
Diffstat (limited to 'gmap_arcgis.js')
-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 |