From 5093637d7f8622b08c06c36ccf2fc251179306d7 Mon Sep 17 00:00:00 2001 From: Silvio Date: Mon, 24 Nov 2014 14:51:06 -0200 Subject: Initial markercluster support at addMarkers() --- gmap_arcgis.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 75add00..e6e35b5 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -304,7 +304,7 @@ function gmapArcgis(config) { }, // Add makers to the map - addMarkers: function(element) { + addMarkers: function(element, cluster) { var self = this; if (this.config['markers'][element].overlay != undefined) { @@ -379,6 +379,16 @@ function gmapArcgis(config) { self.config['markers'][element].overlay[i].addListener(); } + if (cluster == true) { + var markers = []; + + for (var i = 0; i < self.config['markers'][element].overlay.length; i++) { + markers.push(self.config['markers'][element].overlay[i].marker); + } + + self.config['markers'][element].cluster = new MarkerClusterer(self.map, markers); + } + self.unblockUI('markers_' + element); } }, -- cgit v1.2.3