aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2016-02-29 16:18:23 -0300
committerSilvio <silvio@socioambiental.org>2016-02-29 16:18:23 -0300
commit34039108bdfd212a42b4e8fdca225910581244ad (patch)
tree670573fd677d1e61a33b1120aef1b178939788eb
parent6149723df105fad240d5c20c48330b27b18d9fa6 (diff)
downloadgmap_arcgis_js-34039108bdfd212a42b4e8fdca225910581244ad.tar.gz
gmap_arcgis_js-34039108bdfd212a42b4e8fdca225910581244ad.tar.bz2
addMarkers: openInfoWindow param
-rw-r--r--gmap_arcgis.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index ece5d05..14a21aa 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -321,7 +321,7 @@ function gmapArcgis(config) {
},
// Add makers to the map
- addMarkers: function(element, cluster) {
+ addMarkers: function(element, cluster, openInfoWindow) {
var self = this;
if (cluster == undefined) {
@@ -396,11 +396,20 @@ function gmapArcgis(config) {
var content = self.config['markers'][element].content;
var attributes = feature.attributes;
- google.maps.event.addListener(marker, 'click', function() {
+ // Handle infoWindow
+ function openBubble() {
self.closeInfoWindows();
infowindow.setContent(content(attributes));
infowindow.open(self.map, marker);
- });
+ }
+
+ // Click listener for the infoWindow
+ google.maps.event.addListener(marker, 'click', openBubble);
+
+ // Whether to open the infoWindow automatically
+ if (openInfoWindow == true) {
+ openBubble();
+ }
};
// Execute