aboutsummaryrefslogtreecommitdiff
path: root/gmap_arcgis.js
diff options
context:
space:
mode:
Diffstat (limited to 'gmap_arcgis.js')
-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