aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-04-24 19:16:04 -0300
committerSilvio <silvio@socioambiental.org>2013-04-24 19:16:04 -0300
commitd9baae41c114446538aac8bc333bb4c321c1c4cb (patch)
tree261646225d4defb5f056192dbcbac69ecb133784
parentb72ada312a4ab377035fb09b06419af3ebb84663 (diff)
downloadgmap_arcgis_js-d9baae41c114446538aac8bc333bb4c321c1c4cb.tar.gz
gmap_arcgis_js-d9baae41c114446538aac8bc333bb4c321c1c4cb.tar.bz2
Close infoWindow when hidding markers
-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