diff options
author | Silvio <silvio@socioambiental.org> | 2013-04-24 19:16:04 -0300 |
---|---|---|
committer | Silvio <silvio@socioambiental.org> | 2013-04-24 19:16:04 -0300 |
commit | d9baae41c114446538aac8bc333bb4c321c1c4cb (patch) | |
tree | 261646225d4defb5f056192dbcbac69ecb133784 | |
parent | b72ada312a4ab377035fb09b06419af3ebb84663 (diff) | |
download | gmap_arcgis_js-d9baae41c114446538aac8bc333bb4c321c1c4cb.tar.gz gmap_arcgis_js-d9baae41c114446538aac8bc333bb4c321c1c4cb.tar.bz2 |
Close infoWindow when hidding markers
-rw-r--r-- | gmap_arcgis.js | 9 |
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 |