aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gmap_arcgis.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index 07b573b..1efbaf3 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -312,15 +312,22 @@ function gmapArcgis(config) {
// Toggle marker visibility
toggleMarkers: function(element, raw) {
- var markers = (raw == true) ? element : this.config['markers'][element].overlay;
+ var markers = (raw == true) ? element : this.config['markers'][element].overlay;
+ var closeInfoWindow = false;
for (i=0; i < markers.length; i++) {
if (markers[i].marker.getVisible()) {
+ closeInfoWindow = true;
markers[i].marker.setVisible(false);
} else {
markers[i].marker.setVisible(true);
}
}
+
+ // Close the infoWindow
+ if (closeInfoWindow == true && this.config['markers'][element].infowindow != undefined) {
+ this.config['markers'][element].infowindow.close();
+ }
},
// Block the UI and show an overlay