From 34039108bdfd212a42b4e8fdca225910581244ad Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 29 Feb 2016 16:18:23 -0300 Subject: addMarkers: openInfoWindow param --- gmap_arcgis.js | 15 ++++++++++++--- 1 file 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 -- cgit v1.2.3