2 // @compilation_level ADVANCED_OPTIMIZATIONS
3 // @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/maps/google_maps_api_v3.js
4 // ==/ClosureCompiler==
7 * @name MarkerClusterer for Google Maps v3
11 * The library creates and manages per-zoom-level clusters for large amounts of
14 * This is a v3 implementation of the
15 * <a href="http://gmaps-utility-library-dev.googlecode.com/svn/tags/markerclusterer/"
16 * >v2 MarkerClusterer</a>.
20 * Licensed under the Apache License, Version 2.0 (the "License");
21 * you may not use this file except in compliance with the License.
22 * You may obtain a copy of the License at
24 * http://www.apache.org/licenses/LICENSE-2.0
26 * Unless required by applicable law or agreed to in writing, software
27 * distributed under the License is distributed on an "AS IS" BASIS,
28 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 * See the License for the specific language governing permissions and
30 * limitations under the License.
35 * A Marker Clusterer that clusters markers.
37 * @param {google.maps.Map} map The Google map to attach to.
38 * @param {Array.<google.maps.Marker>} opt_markers Optional markers to add to
40 * @param {Object} opt_options support the following options:
41 * 'gridSize': (number) The grid size of a cluster in pixels.
42 * 'maxZoom': (number) The maximum zoom level that a marker can be part of a
44 * 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a
45 * cluster is to zoom into it.
46 * 'averageCenter': (boolean) Wether the center of each cluster should be
47 * the average of all markers in the cluster.
48 * 'styles': (object) An object that has style properties:
49 * 'url': (string) The image url.
50 * 'height': (number) The image height.
51 * 'width': (number) The image width.
52 * 'anchor': (Array) The anchor position of the label text.
53 * 'textColor': (string) The text color.
54 * 'textSize': (number) The text size.
56 * @extends google.maps.OverlayView
58 function MarkerClusterer(map, opt_markers, opt_options) {
59 // MarkerClusterer implements google.maps.OverlayView interface. We use the
60 // extend function to extend MarkerClusterer with google.maps.OverlayView
61 // because it might not always be available when the code is defined so we
62 // look for it at the last possible moment. If it doesn't exist now then
63 // there is no point going ahead :)
64 this.extend(MarkerClusterer, google.maps.OverlayView);
68 * @type {Array.<google.maps.Marker>}
74 * @type {Array.<Cluster>}
78 this.sizes = [53, 56, 66, 78, 90];
91 var options = opt_options || {};
97 this.gridSize_ = options['gridSize'] || 60;
103 this.maxZoom_ = options['maxZoom'] || null;
105 this.styles_ = options['styles'] || [];
111 this.imagePath_ = options['imagePath'] ||
112 this.MARKER_CLUSTER_IMAGE_PATH_;
118 this.imageExtension_ = options['imageExtension'] ||
119 this.MARKER_CLUSTER_IMAGE_EXTENSION_;
125 this.zoomOnClick_ = true;
127 if (options['zoomOnClick'] != undefined) {
128 this.zoomOnClick_ = options['zoomOnClick'];
135 this.averageCenter_ = false;
137 if (options['averageCenter'] != undefined) {
138 this.averageCenter_ = options['averageCenter'];
149 this.prevZoom_ = this.map_.getZoom();
151 // Add the map event listeners
153 google.maps.event.addListener(this.map_, 'zoom_changed', function() {
154 var maxZoom = that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom;
155 var zoom = that.map_.getZoom();
156 if (zoom < 0 || zoom > maxZoom) {
160 if (that.prevZoom_ != zoom) {
161 that.prevZoom_ = that.map_.getZoom();
162 that.resetViewport();
166 google.maps.event.addListener(this.map_, 'idle', function() {
170 // Finally, add the markers
171 if (opt_markers && opt_markers.length) {
172 this.addMarkers(opt_markers, false);
178 * The marker cluster image path.
183 MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ =
184 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/' +
189 * The marker cluster image path.
194 MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_ = 'png';
198 * Extends a objects prototype by anothers.
200 * @param {Object} obj1 The object to be extended.
201 * @param {Object} obj2 The object to extend with.
202 * @return {Object} The new extended object.
205 MarkerClusterer.prototype.extend = function(obj1, obj2) {
206 return (function(object) {
207 for (property in object.prototype) {
208 this.prototype[property] = object.prototype[property];
211 }).apply(obj1, [obj2]);
216 * Implementaion of the interface method.
219 MarkerClusterer.prototype.onAdd = function() {
220 this.setReady_(true);
225 * Implementation of the interface.
228 MarkerClusterer.prototype.draw = function() {};
232 * Sets up the styles object.
236 MarkerClusterer.prototype.setupStyles_ = function() {
237 if (this.styles_.length) {
241 for (var i = 0, size; size = this.sizes[i]; i++) {
243 url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_,
254 * @param {Object} styles The style to set.
256 MarkerClusterer.prototype.setStyles = function(styles) {
257 this.styles_ = styles;
264 * @return {Object} The styles object.
266 MarkerClusterer.prototype.getStyles = function() {
272 * Whether zoom on click is set.
274 * @return {boolean} True if zoomOnClick_ is set.
276 MarkerClusterer.prototype.isZoomOnClick = function() {
277 return this.zoomOnClick_;
281 * Whether average center is set.
283 * @return {boolean} True if averageCenter_ is set.
285 MarkerClusterer.prototype.isAverageCenter = function() {
286 return this.averageCenter_;
291 * Returns the array of markers in the clusterer.
293 * @return {Array.<google.maps.Marker>} The markers.
295 MarkerClusterer.prototype.getMarkers = function() {
296 return this.markers_;
301 * Returns the array of markers in the clusterer.
303 * @return {Array.<google.maps.Marker>} The number of markers.
305 MarkerClusterer.prototype.getTotalMarkers = function() {
306 return this.markers_;
311 * Sets the max zoom for the clusterer.
313 * @param {number} maxZoom The max zoom level.
315 MarkerClusterer.prototype.setMaxZoom = function(maxZoom) {
316 this.maxZoom_ = maxZoom;
321 * Gets the max zoom for the clusterer.
323 * @return {number} The max zoom level.
325 MarkerClusterer.prototype.getMaxZoom = function() {
326 return this.maxZoom_ || this.map_.mapTypes[this.map_.getMapTypeId()].maxZoom;
331 * The function for calculating the cluster icon image.
333 * @param {Array.<google.maps.Marker>} markers The markers in the clusterer.
334 * @param {number} numStyles The number of styles available.
335 * @return {Object} A object properties: 'text' (string) and 'index' (number).
338 MarkerClusterer.prototype.calculator_ = function(markers, numStyles) {
340 var count = markers.length;
343 dv = parseInt(dv / 10, 10);
347 index = Math.min(index, numStyles);
356 * Set the calculator function.
358 * @param {function(Array, number)} calculator The function to set as the
359 * calculator. The function should return a object properties:
360 * 'text' (string) and 'index' (number).
363 MarkerClusterer.prototype.setCalculator = function(calculator) {
364 this.calculator_ = calculator;
369 * Get the calculator function.
371 * @return {function(Array, number)} the calculator function.
373 MarkerClusterer.prototype.getCalculator = function() {
374 return this.calculator_;
379 * Add an array of markers to the clusterer.
381 * @param {Array.<google.maps.Marker>} markers The markers to add.
382 * @param {boolean} opt_nodraw Whether to redraw the clusters.
384 MarkerClusterer.prototype.addMarkers = function(markers, opt_nodraw) {
385 for (var i = 0, marker; marker = markers[i]; i++) {
386 this.pushMarkerTo_(marker);
395 * Pushes a marker to the clusterer.
397 * @param {google.maps.Marker} marker The marker to add.
400 MarkerClusterer.prototype.pushMarkerTo_ = function(marker) {
401 marker.setVisible(false);
403 marker.isAdded = false;
404 if (marker['draggable']) {
405 // If the marker is draggable add a listener so we update the clusters on
408 google.maps.event.addListener(marker, 'dragend', function() {
409 marker.isAdded = false;
410 that.resetViewport();
414 this.markers_.push(marker);
419 * Adds a marker to the clusterer and redraws if needed.
421 * @param {google.maps.Marker} marker The marker to add.
422 * @param {boolean} opt_nodraw Whether to redraw the clusters.
424 MarkerClusterer.prototype.addMarker = function(marker, opt_nodraw) {
425 this.pushMarkerTo_(marker);
433 * Remove a marker from the cluster.
435 * @param {google.maps.Marker} marker The marker to remove.
436 * @return {boolean} True if the marker was removed.
438 MarkerClusterer.prototype.removeMarker = function(marker) {
440 if (this.markers_.indexOf) {
441 index = this.markers_.indexOf(marker);
443 for (var i = 0, m; m = this.markers_[i]; i++) {
452 // Marker is not in our list of markers.
456 this.markers_.splice(index, 1);
457 marker.setVisible(false);
460 this.resetViewport();
467 * Sets the clusterer's ready state.
469 * @param {boolean} ready The state.
472 MarkerClusterer.prototype.setReady_ = function(ready) {
475 this.createClusters_();
481 * Returns the number of clusters in the clusterer.
483 * @return {number} The number of clusters.
485 MarkerClusterer.prototype.getTotalClusters = function() {
486 return this.clusters_.length;
491 * Returns the google map that the clusterer is associated with.
493 * @return {google.maps.Map} The map.
495 MarkerClusterer.prototype.getMap = function() {
501 * Sets the google map that the clusterer is associated with.
503 * @param {google.maps.Map} map The map.
505 MarkerClusterer.prototype.setMap = function(map) {
511 * Returns the size of the grid.
513 * @return {number} The grid size.
515 MarkerClusterer.prototype.getGridSize = function() {
516 return this.gridSize_;
521 * Returns the size of the grid.
523 * @param {number} size The grid size.
525 MarkerClusterer.prototype.setGridSize = function(size) {
526 this.gridSize_ = size;
531 * Extends a bounds object by the grid size.
533 * @param {google.maps.LatLngBounds} bounds The bounds to extend.
534 * @return {google.maps.LatLngBounds} The extended bounds.
536 MarkerClusterer.prototype.getExtendedBounds = function(bounds) {
537 var projection = this.getProjection();
539 // Turn the bounds into latlng.
540 var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),
541 bounds.getNorthEast().lng());
542 var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),
543 bounds.getSouthWest().lng());
545 // Convert the points to pixels and the extend out by the grid size.
546 var trPix = projection.fromLatLngToDivPixel(tr);
547 trPix.x += this.gridSize_;
548 trPix.y -= this.gridSize_;
550 var blPix = projection.fromLatLngToDivPixel(bl);
551 blPix.x -= this.gridSize_;
552 blPix.y += this.gridSize_;
554 // Convert the pixel points back to LatLng
555 var ne = projection.fromDivPixelToLatLng(trPix);
556 var sw = projection.fromDivPixelToLatLng(blPix);
558 // Extend the bounds to contain the new bounds.
567 * Determins if a marker is contained in a bounds.
569 * @param {google.maps.Marker} marker The marker to check.
570 * @param {google.maps.LatLngBounds} bounds The bounds to check against.
571 * @return {boolean} True if the marker is in the bounds.
574 MarkerClusterer.prototype.isMarkerInBounds_ = function(marker, bounds) {
575 return bounds.contains(marker.getPosition());
580 * Clears all clusters and markers from the clusterer.
582 MarkerClusterer.prototype.clearMarkers = function() {
583 this.resetViewport();
585 // Set the markers a empty array.
591 * Clears all existing clusters and recreates them.
593 MarkerClusterer.prototype.resetViewport = function() {
594 // Remove all the clusters
595 for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {
599 // Reset the markers to not be added and to be invisible.
600 for (var i = 0, marker; marker = this.markers_[i]; i++) {
601 marker.isAdded = false;
603 marker.setVisible(false);
611 * Redraws the clusters.
613 MarkerClusterer.prototype.redraw = function() {
614 this.createClusters_();
619 * Creates the clusters.
623 MarkerClusterer.prototype.createClusters_ = function() {
628 // Get our current map view bounds.
629 // Create a new bounds object so we don't affect the map.
630 var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),
631 this.map_.getBounds().getNorthEast());
632 var bounds = this.getExtendedBounds(mapBounds);
634 for (var i = 0, marker; marker = this.markers_[i]; i++) {
636 if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {
637 for (var j = 0, cluster; cluster = this.clusters_[j]; j++) {
638 if (!added && cluster.getCenter() &&
639 cluster.isMarkerInClusterBounds(marker)) {
641 cluster.addMarker(marker);
647 // Create a new cluster.
648 var cluster = new Cluster(this);
649 cluster.addMarker(marker);
650 this.clusters_.push(cluster);
658 * A cluster that contains markers.
660 * @param {MarkerClusterer} markerClusterer The markerclusterer that this
661 * cluster is associated with.
665 function Cluster(markerClusterer) {
666 this.markerClusterer_ = markerClusterer;
667 this.map_ = markerClusterer.getMap();
668 this.gridSize_ = markerClusterer.getGridSize();
669 this.averageCenter_ = markerClusterer.isAverageCenter();
673 this.clusterIcon_ = new ClusterIcon(this, markerClusterer.getStyles(),
674 markerClusterer.getGridSize());
678 * Determins if a marker is already added to the cluster.
680 * @param {google.maps.Marker} marker The marker to check.
681 * @return {boolean} True if the marker is already added.
683 Cluster.prototype.isMarkerAlreadyAdded = function(marker) {
684 if (this.markers_.indexOf) {
685 return this.markers_.indexOf(marker) != -1;
687 for (var i = 0, m; m = this.markers_[i]; i++) {
698 * Add a marker the cluster.
700 * @param {google.maps.Marker} marker The marker to add.
701 * @return {boolean} True if the marker was added.
703 Cluster.prototype.addMarker = function(marker) {
704 if (this.isMarkerAlreadyAdded(marker)) {
709 this.center_ = marker.getPosition();
710 this.calculateBounds_();
712 if (this.averageCenter_) {
713 var lat = (this.center_.lat() + marker.getPosition().lat()) / 2;
714 var lng = (this.center_.lng() + marker.getPosition().lng()) / 2;
715 this.center_ = new google.maps.LatLng(lat, lng);
716 this.calculateBounds_();
721 if (this.markers_.length == 0) {
722 // Only 1 marker in this cluster so show the marker.
723 marker.setMap(this.map_);
724 marker.setVisible(true);
725 } else if (this.markers_.length == 1) {
726 // Hide the 1 marker that was showing.
727 this.markers_[0].setMap(null);
728 this.markers_[0].setVisible(false);
731 marker.isAdded = true;
732 this.markers_.push(marker);
740 * Returns the marker clusterer that the cluster is associated with.
742 * @return {MarkerClusterer} The associated marker clusterer.
744 Cluster.prototype.getMarkerClusterer = function() {
745 return this.markerClusterer_;
750 * Returns the bounds of the cluster.
752 * @return {google.maps.LatLngBounds} the cluster bounds.
754 Cluster.prototype.getBounds = function() {
755 this.calculateBounds_();
761 * Removes the cluster
763 Cluster.prototype.remove = function() {
764 this.clusterIcon_.remove();
765 this.markers_.length = 0;
766 delete this.markers_;
771 * Returns the center of the cluster.
773 * @return {number} The cluster center.
775 Cluster.prototype.getSize = function() {
776 return this.markers_.length;
781 * Returns the center of the cluster.
783 * @return {Array.<google.maps.Marker>} The cluster center.
785 Cluster.prototype.getMarkers = function() {
786 return this.markers_;
791 * Returns the center of the cluster.
793 * @return {google.maps.LatLng} The cluster center.
795 Cluster.prototype.getCenter = function() {
801 * Calculated the bounds of the cluster with the grid.
805 Cluster.prototype.calculateBounds_ = function() {
806 var bounds = new google.maps.LatLngBounds(this.center_, this.center_);
807 this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);
812 * Determines if a marker lies in the clusters bounds.
814 * @param {google.maps.Marker} marker The marker to check.
815 * @return {boolean} True if the marker lies in the bounds.
817 Cluster.prototype.isMarkerInClusterBounds = function(marker) {
818 return this.bounds_.contains(marker.getPosition());
823 * Returns the map that the cluster is associated with.
825 * @return {google.maps.Map} The map.
827 Cluster.prototype.getMap = function() {
833 * Updates the cluster icon
835 Cluster.prototype.updateIcon = function() {
836 var zoom = this.map_.getZoom();
837 var mz = this.markerClusterer_.getMaxZoom();
840 // The zoom is greater than our max zoom so show all the markers in cluster.
841 for (var i = 0, marker; marker = this.markers_[i]; i++) {
842 marker.setMap(this.map_);
843 marker.setVisible(true);
848 if (this.markers_.length < 2) {
849 // We have 0 or 1 markers so hide the icon.
850 this.clusterIcon_.hide();
854 var numStyles = this.markerClusterer_.getStyles().length;
855 var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);
856 this.clusterIcon_.setCenter(this.center_);
857 this.clusterIcon_.setSums(sums);
858 this.clusterIcon_.show();
865 * @param {Cluster} cluster The cluster to be associated with.
866 * @param {Object} styles An object that has style properties:
867 * 'url': (string) The image url.
868 * 'height': (number) The image height.
869 * 'width': (number) The image width.
870 * 'anchor': (Array) The anchor position of the label text.
871 * 'textColor': (string) The text color.
872 * 'textSize': (number) The text size.
873 * @param {number} opt_padding Optional padding to apply to the cluster icon.
875 * @extends google.maps.OverlayView
878 function ClusterIcon(cluster, styles, opt_padding) {
879 cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);
881 this.styles_ = styles;
882 this.padding_ = opt_padding || 0;
883 this.cluster_ = cluster;
885 this.map_ = cluster.getMap();
888 this.visible_ = false;
890 this.setMap(this.map_);
895 * Triggers the clusterclick event and zoom's if the option is set.
897 ClusterIcon.prototype.triggerClusterClick = function() {
898 var markerClusterer = this.cluster_.getMarkerClusterer();
900 // Trigger the clusterclick event.
901 google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster_);
903 if (markerClusterer.isZoomOnClick()) {
904 // Center the map on this cluster.
905 this.map_.panTo(this.cluster_.getCenter());
907 // Zoom into the cluster.
908 this.map_.fitBounds(this.cluster_.getBounds());
914 * Adding the cluster icon to the dom.
917 ClusterIcon.prototype.onAdd = function() {
918 this.div_ = document.createElement('DIV');
920 var pos = this.getPosFromLatLng_(this.center_);
921 this.div_.style.cssText = this.createCss(pos);
922 this.div_.innerHTML = this.sums_.text;
925 var panes = this.getPanes();
926 panes.overlayImage.appendChild(this.div_);
929 google.maps.event.addDomListener(this.div_, 'click', function() {
930 that.triggerClusterClick();
936 * Returns the position to place the div dending on the latlng.
938 * @param {google.maps.LatLng} latlng The position in latlng.
939 * @return {google.maps.Point} The position in pixels.
942 ClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {
943 var pos = this.getProjection().fromLatLngToDivPixel(latlng);
944 pos.x -= parseInt(this.width_ / 2, 10);
945 pos.y -= parseInt(this.height_ / 2, 10);
954 ClusterIcon.prototype.draw = function() {
956 var pos = this.getPosFromLatLng_(this.center_);
957 this.div_.style.top = pos.y + 'px';
958 this.div_.style.left = pos.x + 'px';
966 ClusterIcon.prototype.hide = function() {
968 this.div_.style.display = 'none';
970 this.visible_ = false;
975 * Position and show the icon.
977 ClusterIcon.prototype.show = function() {
979 var pos = this.getPosFromLatLng_(this.center_);
980 this.div_.style.cssText = this.createCss(pos);
981 this.div_.style.display = '';
983 this.visible_ = true;
988 * Remove the icon from the map
990 ClusterIcon.prototype.remove = function() {
996 * Implementation of the onRemove interface.
999 ClusterIcon.prototype.onRemove = function() {
1000 if (this.div_ && this.div_.parentNode) {
1002 this.div_.parentNode.removeChild(this.div_);
1009 * Set the sums of the icon.
1011 * @param {Object} sums The sums containing:
1012 * 'text': (string) The text to display in the icon.
1013 * 'index': (number) The style index of the icon.
1015 ClusterIcon.prototype.setSums = function(sums) {
1017 this.text_ = sums.text;
1018 this.index_ = sums.index;
1020 this.div_.innerHTML = sums.text;
1028 * Sets the icon to the the styles.
1030 ClusterIcon.prototype.useStyle = function() {
1031 var index = Math.max(0, this.sums_.index - 1);
1032 index = Math.min(this.styles_.length - 1, index);
1033 var style = this.styles_[index];
1034 this.url_ = style['url'];
1035 this.height_ = style['height'];
1036 this.width_ = style['width'];
1037 this.textColor_ = style['textColor'];
1038 this.anchor = style['anchor'];
1039 this.textSize_ = style['textSize'];
1044 * Sets the center of the icon.
1046 * @param {google.maps.LatLng} center The latlng to set as the center.
1048 ClusterIcon.prototype.setCenter = function(center) {
1049 this.center_ = center;
1054 * Create the css text based on the position of the icon.
1056 * @param {google.maps.Point} pos The position.
1057 * @return {string} The css style text.
1059 ClusterIcon.prototype.createCss = function(pos) {
1062 style.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(' +
1063 'sizingMethod=scale,src="' + this.url_ + '");');
1065 style.push('background:url(' + this.url_ + ');');
1068 if (typeof this.anchor_ === 'object') {
1069 if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 &&
1070 this.anchor_[0] < this.height_) {
1071 style.push('height:' + (this.height_ - this.anchor_[0]) +
1072 'px; padding-top:' + this.anchor_[0] + 'px;');
1074 style.push('height:' + this.height_ + 'px; line-height:' + this.height_ +
1077 if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 &&
1078 this.anchor_[1] < this.width_) {
1079 style.push('width:' + (this.width_ - this.anchor_[1]) +
1080 'px; padding-left:' + this.anchor_[1] + 'px;');
1082 style.push('width:' + this.width_ + 'px; text-align:center;');
1085 style.push('height:' + this.height_ + 'px; line-height:' +
1086 this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;');
1089 var txtColor = this.textColor_ ? this.textColor_ : 'black';
1090 var txtSize = this.textSize_ ? this.textSize_ : 11;
1092 style.push('cursor:pointer; top:' + pos.y + 'px; left:' +
1093 pos.x + 'px; color:' + txtColor + '; position:absolute; font-size:' +
1094 txtSize + 'px; font-family:Arial,sans-serif; font-weight:bold');
1095 return style.join('');
1099 // Export Symbols for Closure
1100 // If you are not going to compile with closure then you can remove the
1102 window['MarkerClusterer'] = MarkerClusterer;
1103 MarkerClusterer.prototype['addMarker'] = MarkerClusterer.prototype.addMarker;
1104 MarkerClusterer.prototype['addMarkers'] = MarkerClusterer.prototype.addMarkers;
1105 MarkerClusterer.prototype['clearMarkers'] =
1106 MarkerClusterer.prototype.clearMarkers;
1107 MarkerClusterer.prototype['getCalculator'] =
1108 MarkerClusterer.prototype.getCalculator;
1109 MarkerClusterer.prototype['getGridSize'] =
1110 MarkerClusterer.prototype.getGridSize;
1111 MarkerClusterer.prototype['getMap'] = MarkerClusterer.prototype.getMap;
1112 MarkerClusterer.prototype['getMarkers'] = MarkerClusterer.prototype.getMarkers;
1113 MarkerClusterer.prototype['getMaxZoom'] = MarkerClusterer.prototype.getMaxZoom;
1114 MarkerClusterer.prototype['getStyles'] = MarkerClusterer.prototype.getStyles;
1115 MarkerClusterer.prototype['getTotalClusters'] =
1116 MarkerClusterer.prototype.getTotalClusters;
1117 MarkerClusterer.prototype['getTotalMarkers'] =
1118 MarkerClusterer.prototype.getTotalMarkers;
1119 MarkerClusterer.prototype['redraw'] = MarkerClusterer.prototype.redraw;
1120 MarkerClusterer.prototype['removeMarker'] =
1121 MarkerClusterer.prototype.removeMarker;
1122 MarkerClusterer.prototype['resetViewport'] =
1123 MarkerClusterer.prototype.resetViewport;
1124 MarkerClusterer.prototype['setCalculator'] =
1125 MarkerClusterer.prototype.setCalculator;
1126 MarkerClusterer.prototype['setGridSize'] =
1127 MarkerClusterer.prototype.setGridSize;
1128 MarkerClusterer.prototype['onAdd'] = MarkerClusterer.prototype.onAdd;
1129 MarkerClusterer.prototype['draw'] = MarkerClusterer.prototype.draw;
1131 Cluster.prototype['getCenter'] = Cluster.prototype.getCenter;
1132 Cluster.prototype['getSize'] = Cluster.prototype.getSize;
1133 Cluster.prototype['getMarkers'] = Cluster.prototype.getMarkers;
1135 ClusterIcon.prototype['onAdd'] = ClusterIcon.prototype.onAdd;
1136 ClusterIcon.prototype['draw'] = ClusterIcon.prototype.draw;
1137 ClusterIcon.prototype['onRemove'] = ClusterIcon.prototype.onRemove;