aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2014-11-24 14:51:06 -0200
committerSilvio <silvio@socioambiental.org>2014-11-24 14:51:06 -0200
commit5093637d7f8622b08c06c36ccf2fc251179306d7 (patch)
tree58cc6f7b2da4ed2fcbd7c7cd096aa91c9242d0dc
parentc6103d54a51f8e6a36fccf9c6970f0c1679613aa (diff)
downloadgmap_arcgis_js-5093637d7f8622b08c06c36ccf2fc251179306d7.tar.gz
gmap_arcgis_js-5093637d7f8622b08c06c36ccf2fc251179306d7.tar.bz2
Initial markercluster support at addMarkers()
-rw-r--r--gmap_arcgis.js12
1 files changed, 11 insertions, 1 deletions
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);
}
},