{"version":3,"sources":["google-map-cluster.js"],"names":["MarkerClusterer","map","opt_markers","opt_options","this","extend","google","maps","OverlayView","map_","markers_","clusters_","sizes","styles_","ready_","options","gridSize_","minClusterSize_","maxZoom_","imagePath_","MARKER_CLUSTER_IMAGE_PATH_","imageExtension_","MARKER_CLUSTER_IMAGE_EXTENSION_","zoomOnClick_","undefined","averageCenter_","setupStyles_","setMap","prevZoom_","getZoom","that","event","addListener","zoom","minZoom","maxZoom","Math","min","mapTypes","getMapTypeId","max","resetViewport","redraw","length","Object","keys","addMarkers","Cluster","markerClusterer","markerClusterer_","getMap","getGridSize","getMinClusterSize","isAverageCenter","center_","bounds_","clusterIcon_","ClusterIcon","getStyles","cluster","styles","opt_padding","getMarkerClusterer","padding_","cluster_","div_","sums_","visible_","prototype","obj1","obj2","object","property","apply","onAdd","setReady_","draw","size","i","push","url","height","width","fitMapToMarkers","marker","markers","getMarkers","bounds","LatLngBounds","getPosition","fitBounds","setStyles","isZoomOnClick","getTotalMarkers","setMaxZoom","getMaxZoom","calculator_","numStyles","index","count","dv","parseInt","text","setCalculator","calculator","getCalculator","opt_nodraw","pushMarkerTo_","isAdded","repaint","addMarker","removeMarker_","indexOf","m","splice","removeMarker","removed","removeMarkers","markersCopy","slice","r","ready","createClusters_","getTotalClusters","setGridSize","setMinClusterSize","getExtendedBounds","projection","getProjection","tr","LatLng","getNorthEast","lat","lng","bl","getSouthWest","trPix","fromLatLngToDivPixel","x","y","blPix","ne","fromDivPixelToLatLng","sw","isMarkerInBounds_","contains","clearMarkers","opt_hide","remove","oldClusters","window","setTimeout","distanceBetweenPoints_","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","addToClosestCluster_","distance","clusterToAddTo","center","getCenter","d","isMarkerInClusterBounds","mapBounds","getBounds","isMarkerAlreadyAdded","l","calculateBounds_","len","updateIcon","getSize","mz","hide","sums","setCenter","setSums","show","triggerClusterClick","trigger","document","createElement","pos","getPosFromLatLng_","style","cssText","createCss","innerHTML","getPanes","overlayMouseTarget","appendChild","addDomListener","latlng","width_","height_","top","left","zIndex","Marker","MAX_ZINDEX","display","onRemove","parentNode","removeChild","text_","index_","useStyle","url_","textColor_","anchor_","textSize_","backgroundPosition_","backgroundPosition","txtColor","txtSize","join","o","result","name","hasOwnProperty","module","exports"],"mappings":";;;;;;;;;;;;;;AAiEA,SAASA,gBAAgBC,EAAKC,EAAaC,GAMzCC,KAAKC,OAAOL,gBAAiBM,OAAOC,KAAKC,aACzCJ,KAAKK,KAAOR,EAMZG,KAAKM,SAAW,GAKhBN,KAAKO,UAAY,GAEjBP,KAAKQ,MAAQ,CAAC,GAAI,GAAI,GAAI,GAAI,IAK9BR,KAAKS,QAAU,GAMfT,KAAKU,QAAS,EAEd,IAAIC,EAAUZ,GAAe,GAM7BC,KAAKY,UAAYD,EAAkB,UAAK,GAKxCX,KAAKa,gBAAkBF,EAA4B,oBAAK,EAOxDX,KAAKc,SAAWH,EAAiB,SAAK,KAEtCX,KAAKS,QAAUE,EAAgB,QAAK,GAMpCX,KAAKe,WAAaJ,EAAmB,WACnCX,KAAKgB,2BAMPhB,KAAKiB,gBAAkBN,EAAwB,gBAC7CX,KAAKkB,gCAMPlB,KAAKmB,cAAe,EAEUC,MAA1BT,EAAqB,cACvBX,KAAKmB,aAAeR,EAAqB,aAO3CX,KAAKqB,gBAAiB,EAEUD,MAA5BT,EAAuB,gBACzBX,KAAKqB,eAAiBV,EAAuB,eAG/CX,KAAKsB,eAELtB,KAAKuB,OAAO1B,GAMZG,KAAKwB,UAAYxB,KAAKK,KAAKoB,UAG3B,IAAIC,EAAO1B,KACXE,OAAOC,KAAKwB,MAAMC,YAAY5B,KAAKK,KAAM,gBAAgB,WAEvD,IAAIwB,EAAOH,EAAKrB,KAAKoB,UACjBK,EAAUJ,EAAKrB,KAAKyB,SAAW,EAC/BC,EAAUC,KAAKC,IAAIP,EAAKrB,KAAK0B,SAAW,IAC1CL,EAAKrB,KAAK6B,SAASR,EAAKrB,KAAK8B,gBAA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B,YAAYW,UAAoB,SAAIX,YAAYW,UAAU2I,SAE1DnK,OAAOC,KAAOD,OAAOC,MAAQ,SAAUiL,GACrC,IAAIC,EAAS,GACb,IAAK,IAAIC,KAAQF,EACXA,EAAEG,eAAeD,IACnBD,EAAOhJ,KAAKiJ,GAEhB,OAAOD,GAGY,iBAAVG,SACTA,OAAOC,QAAUnO","file":"../google-map-cluster.min.js","sourcesContent":["// ==ClosureCompiler==\r\n// @compilation_level ADVANCED_OPTIMIZATIONS\r\n// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/maps/google_maps_api_v3_3.js\r\n// ==/ClosureCompiler==\r\n\r\n/**\r\n * @name MarkerClusterer for Google Maps v3\r\n * @version version 1.0.3\r\n * @author Luke Mahe\r\n * @fileoverview\r\n * The library creates and manages per-zoom-level clusters for large amounts of\r\n * markers.\r\n */\r\n\r\n/**\r\n * @license\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n/**\r\n * A Marker Clusterer that clusters markers.\r\n *\r\n * @param {google.maps.Map} map The Google map to attach to.\r\n * @param {Array.=} opt_markers Optional markers to add to\r\n * the cluster.\r\n * @param {Object=} opt_options support the following options:\r\n * 'gridSize': (number) The grid size of a cluster in pixels.\r\n * 'maxZoom': (number) The maximum zoom level that a marker can be part of a\r\n * cluster.\r\n * 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a\r\n * cluster is to zoom into it.\r\n * 'imagePath': (string) The base URL where the images representing\r\n * clusters will be found. The full URL will be:\r\n * {imagePath}[1-5].{imageExtension}\r\n * Default: '../images/m'.\r\n * 'imageExtension': (string) The suffix for images URL representing\r\n * clusters will be found. See _imagePath_ for details.\r\n * Default: 'png'.\r\n * 'averageCenter': (boolean) Whether the center of each cluster should be\r\n * the average of all markers in the cluster.\r\n * 'minimumClusterSize': (number) The minimum number of markers to be in a\r\n * cluster before the markers are hidden and a count\r\n * is shown.\r\n * 'styles': (object) An object that has style properties:\r\n * 'url': (string) The image url.\r\n * 'height': (number) The image height.\r\n * 'width': (number) The image width.\r\n * 'anchor': (Array) The anchor position of the label text.\r\n * 'textColor': (string) The text color.\r\n * 'textSize': (number) The text size.\r\n * 'backgroundPosition': (string) The position of the backgound x, y.\r\n * @constructor\r\n * @extends google.maps.OverlayView\r\n */\r\nfunction MarkerClusterer(map, opt_markers, opt_options) {\r\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\r\n // extend function to extend MarkerClusterer with google.maps.OverlayView\r\n // because it might not always be available when the code is defined so we\r\n // look for it at the last possible moment. If it doesn't exist now then\r\n // there is no point going ahead :)\r\n this.extend(MarkerClusterer, google.maps.OverlayView);\r\n this.map_ = map;\r\n\r\n /**\r\n * @type {Array.}\r\n * @private\r\n */\r\n this.markers_ = [];\r\n\r\n /**\r\n * @type {Array.}\r\n */\r\n this.clusters_ = [];\r\n\r\n this.sizes = [53, 56, 66, 78, 90];\r\n\r\n /**\r\n * @private\r\n */\r\n this.styles_ = [];\r\n\r\n /**\r\n * @type {boolean}\r\n * @private\r\n */\r\n this.ready_ = false;\r\n\r\n var options = opt_options || {};\r\n\r\n /**\r\n * @type {number}\r\n * @private\r\n */\r\n this.gridSize_ = options['gridSize'] || 60;\r\n\r\n /**\r\n * @private\r\n */\r\n this.minClusterSize_ = options['minimumClusterSize'] || 2;\r\n\r\n\r\n /**\r\n * @type {?number}\r\n * @private\r\n */\r\n this.maxZoom_ = options['maxZoom'] || null;\r\n\r\n this.styles_ = options['styles'] || [];\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this.imagePath_ = options['imagePath'] ||\r\n this.MARKER_CLUSTER_IMAGE_PATH_;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this.imageExtension_ = options['imageExtension'] ||\r\n this.MARKER_CLUSTER_IMAGE_EXTENSION_;\r\n\r\n /**\r\n * @type {boolean}\r\n * @private\r\n */\r\n this.zoomOnClick_ = true;\r\n\r\n if (options['zoomOnClick'] != undefined) {\r\n this.zoomOnClick_ = options['zoomOnClick'];\r\n }\r\n\r\n /**\r\n * @type {boolean}\r\n * @private\r\n */\r\n this.averageCenter_ = false;\r\n\r\n if (options['averageCenter'] != undefined) {\r\n this.averageCenter_ = options['averageCenter'];\r\n }\r\n\r\n this.setupStyles_();\r\n\r\n this.setMap(map);\r\n\r\n /**\r\n * @type {number}\r\n * @private\r\n */\r\n this.prevZoom_ = this.map_.getZoom();\r\n\r\n // Add the map event listeners\r\n var that = this;\r\n google.maps.event.addListener(this.map_, 'zoom_changed', function () {\r\n // Determines map type and prevent illegal zoom levels\r\n var zoom = that.map_.getZoom();\r\n var minZoom = that.map_.minZoom || 0;\r\n var maxZoom = Math.min(that.map_.maxZoom || 100,\r\n that.map_.mapTypes[that.map_.getMapTypeId()].maxZoom);\r\n zoom = Math.min(Math.max(zoom, minZoom), maxZoom);\r\n\r\n if (that.prevZoom_ != zoom) {\r\n that.prevZoom_ = zoom;\r\n that.resetViewport();\r\n }\r\n });\r\n\r\n google.maps.event.addListener(this.map_, 'idle', function () {\r\n that.redraw();\r\n });\r\n\r\n // Finally, add the markers\r\n if (opt_markers && (opt_markers.length || Object.keys(opt_markers).length)) {\r\n this.addMarkers(opt_markers, false);\r\n }\r\n}\r\n\r\n\r\n/**\r\n * The marker cluster image path.\r\n *\r\n * @type {string}\r\n * @private\r\n */\r\nMarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ = '../images/m';\r\n\r\n\r\n/**\r\n * The marker cluster image path.\r\n *\r\n * @type {string}\r\n * @private\r\n */\r\nMarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_ = 'png';\r\n\r\n\r\n/**\r\n * Extends a objects prototype by anothers.\r\n *\r\n * @param {Object} obj1 The object to be extended.\r\n * @param {Object} obj2 The object to extend with.\r\n * @return {Object} The new extended object.\r\n * @ignore\r\n */\r\nMarkerClusterer.prototype.extend = function (obj1, obj2) {\r\n return (function (object) {\r\n for (var property in object.prototype) {\r\n this.prototype[property] = object.prototype[property];\r\n }\r\n return this;\r\n }).apply(obj1, [obj2]);\r\n};\r\n\r\n\r\n/**\r\n * Implementaion of the interface method.\r\n * @ignore\r\n */\r\nMarkerClusterer.prototype.onAdd = function () {\r\n this.setReady_(true);\r\n};\r\n\r\n/**\r\n * Implementaion of the interface method.\r\n * @ignore\r\n */\r\nMarkerClusterer.prototype.draw = function () { };\r\n\r\n/**\r\n * Sets up the styles object.\r\n *\r\n * @private\r\n */\r\nMarkerClusterer.prototype.setupStyles_ = function () {\r\n if (this.styles_.length) {\r\n return;\r\n }\r\n\r\n for (var i = 0, size; size = this.sizes[i]; i++) {\r\n this.styles_.push({\r\n url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_,\r\n height: size,\r\n width: size\r\n });\r\n }\r\n};\r\n\r\n/**\r\n * Fit the map to the bounds of the markers in the clusterer.\r\n */\r\nMarkerClusterer.prototype.fitMapToMarkers = function () {\r\n var markers = this.getMarkers();\r\n var bounds = new google.maps.LatLngBounds();\r\n for (var i = 0, marker; marker = markers[i]; i++) {\r\n bounds.extend(marker.getPosition());\r\n }\r\n\r\n this.map_.fitBounds(bounds);\r\n};\r\n\r\n\r\n/**\r\n * Sets the styles.\r\n *\r\n * @param {Object} styles The style to set.\r\n */\r\nMarkerClusterer.prototype.setStyles = function (styles) {\r\n this.styles_ = styles;\r\n};\r\n\r\n\r\n/**\r\n * Gets the styles.\r\n *\r\n * @return {Object} The styles object.\r\n */\r\nMarkerClusterer.prototype.getStyles = function () {\r\n return this.styles_;\r\n};\r\n\r\n\r\n/**\r\n * Whether zoom on click is set.\r\n *\r\n * @return {boolean} True if zoomOnClick_ is set.\r\n */\r\nMarkerClusterer.prototype.isZoomOnClick = function () {\r\n return this.zoomOnClick_;\r\n};\r\n\r\n/**\r\n * Whether average center is set.\r\n *\r\n * @return {boolean} True if averageCenter_ is set.\r\n */\r\nMarkerClusterer.prototype.isAverageCenter = function () {\r\n return this.averageCenter_;\r\n};\r\n\r\n\r\n/**\r\n * Returns the array of markers in the clusterer.\r\n *\r\n * @return {Array.} The markers.\r\n */\r\nMarkerClusterer.prototype.getMarkers = function () {\r\n return this.markers_;\r\n};\r\n\r\n\r\n/**\r\n * Returns the number of markers in the clusterer\r\n *\r\n * @return {Number} The number of markers.\r\n */\r\nMarkerClusterer.prototype.getTotalMarkers = function () {\r\n return this.markers_.length;\r\n};\r\n\r\n\r\n/**\r\n * Sets the max zoom for the clusterer.\r\n *\r\n * @param {number} maxZoom The max zoom level.\r\n */\r\nMarkerClusterer.prototype.setMaxZoom = function (maxZoom) {\r\n this.maxZoom_ = maxZoom;\r\n};\r\n\r\n\r\n/**\r\n * Gets the max zoom for the clusterer.\r\n *\r\n * @return {number} The max zoom level.\r\n */\r\nMarkerClusterer.prototype.getMaxZoom = function () {\r\n return this.maxZoom_;\r\n};\r\n\r\n\r\n/**\r\n * The function for calculating the cluster icon image.\r\n *\r\n * @param {Array.} markers The markers in the clusterer.\r\n * @param {number} numStyles The number of styles available.\r\n * @return {Object} A object properties: 'text' (string) and 'index' (number).\r\n * @private\r\n */\r\nMarkerClusterer.prototype.calculator_ = function (markers, numStyles) {\r\n var index = 0;\r\n var count = markers.length;\r\n var dv = count;\r\n while (dv !== 0) {\r\n dv = parseInt(dv / 10, 10);\r\n index++;\r\n }\r\n\r\n index = Math.min(index, numStyles);\r\n return {\r\n text: count,\r\n index: index\r\n };\r\n};\r\n\r\n\r\n/**\r\n * Set the calculator function.\r\n *\r\n * @param {function(Array, number)} calculator The function to set as the\r\n * calculator. The function should return a object properties:\r\n * 'text' (string) and 'index' (number).\r\n *\r\n */\r\nMarkerClusterer.prototype.setCalculator = function (calculator) {\r\n this.calculator_ = calculator;\r\n};\r\n\r\n\r\n/**\r\n * Get the calculator function.\r\n *\r\n * @return {function(Array, number)} the calculator function.\r\n */\r\nMarkerClusterer.prototype.getCalculator = function () {\r\n return this.calculator_;\r\n};\r\n\r\n\r\n/**\r\n * Add an array of markers to the clusterer.\r\n *\r\n * @param {Array.} markers The markers to add.\r\n * @param {boolean=} opt_nodraw Whether to redraw the clusters.\r\n */\r\nMarkerClusterer.prototype.addMarkers = function (markers, opt_nodraw) {\r\n if (markers.length) {\r\n for (var i = 0, marker; marker = markers[i]; i++) {\r\n this.pushMarkerTo_(marker);\r\n }\r\n } else if (Object.keys(markers).length) {\r\n for (var marker in markers) {\r\n this.pushMarkerTo_(markers[marker]);\r\n }\r\n }\r\n if (!opt_nodraw) {\r\n this.redraw();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Pushes a marker to the clusterer.\r\n *\r\n * @param {google.maps.Marker} marker The marker to add.\r\n * @private\r\n */\r\nMarkerClusterer.prototype.pushMarkerTo_ = function (marker) {\r\n marker.isAdded = false;\r\n if (marker['draggable']) {\r\n // If the marker is draggable add a listener so we update the clusters on\r\n // the drag end.\r\n var that = this;\r\n google.maps.event.addListener(marker, 'dragend', function () {\r\n marker.isAdded = false;\r\n that.repaint();\r\n });\r\n }\r\n this.markers_.push(marker);\r\n};\r\n\r\n\r\n/**\r\n * Adds a marker to the clusterer and redraws if needed.\r\n *\r\n * @param {google.maps.Marker} marker The marker to add.\r\n * @param {boolean=} opt_nodraw Whether to redraw the clusters.\r\n */\r\nMarkerClusterer.prototype.addMarker = function (marker, opt_nodraw) {\r\n this.pushMarkerTo_(marker);\r\n if (!opt_nodraw) {\r\n this.redraw();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Removes a marker and returns true if removed, false if not\r\n *\r\n * @param {google.maps.Marker} marker The marker to remove\r\n * @return {boolean} Whether the marker was removed or not\r\n * @private\r\n */\r\nMarkerClusterer.prototype.removeMarker_ = function (marker) {\r\n var index = -1;\r\n if (this.markers_.indexOf) {\r\n index = this.markers_.indexOf(marker);\r\n } else {\r\n for (var i = 0, m; m = this.markers_[i]; i++) {\r\n if (m == marker) {\r\n index = i;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (index == -1) {\r\n // Marker is not in our list of markers.\r\n return false;\r\n }\r\n\r\n marker.setMap(null);\r\n\r\n this.markers_.splice(index, 1);\r\n\r\n return true;\r\n};\r\n\r\n\r\n/**\r\n * Remove a marker from the cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to remove.\r\n * @param {boolean=} opt_nodraw Optional boolean to force no redraw.\r\n * @return {boolean} True if the marker was removed.\r\n */\r\nMarkerClusterer.prototype.removeMarker = function (marker, opt_nodraw) {\r\n var removed = this.removeMarker_(marker);\r\n\r\n if (!opt_nodraw && removed) {\r\n this.resetViewport();\r\n this.redraw();\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Removes an array of markers from the cluster.\r\n *\r\n * @param {Array.} markers The markers to remove.\r\n * @param {boolean=} opt_nodraw Optional boolean to force no redraw.\r\n */\r\nMarkerClusterer.prototype.removeMarkers = function (markers, opt_nodraw) {\r\n // create a local copy of markers if required\r\n // (removeMarker_ modifies the getMarkers() array in place)\r\n var markersCopy = markers === this.getMarkers() ? markers.slice() : markers;\r\n var removed = false;\r\n\r\n for (var i = 0, marker; marker = markersCopy[i]; i++) {\r\n var r = this.removeMarker_(marker);\r\n removed = removed || r;\r\n }\r\n\r\n if (!opt_nodraw && removed) {\r\n this.resetViewport();\r\n this.redraw();\r\n return true;\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Sets the clusterer's ready state.\r\n *\r\n * @param {boolean} ready The state.\r\n * @private\r\n */\r\nMarkerClusterer.prototype.setReady_ = function (ready) {\r\n if (!this.ready_) {\r\n this.ready_ = ready;\r\n this.createClusters_();\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Returns the number of clusters in the clusterer.\r\n *\r\n * @return {number} The number of clusters.\r\n */\r\nMarkerClusterer.prototype.getTotalClusters = function () {\r\n return this.clusters_.length;\r\n};\r\n\r\n\r\n/**\r\n * Returns the google map that the clusterer is associated with.\r\n *\r\n * @return {google.maps.Map} The map.\r\n */\r\nMarkerClusterer.prototype.getMap = function () {\r\n return this.map_;\r\n};\r\n\r\n\r\n/**\r\n * Sets the google map that the clusterer is associated with.\r\n *\r\n * @param {google.maps.Map} map The map.\r\n */\r\nMarkerClusterer.prototype.setMap = function (map) {\r\n this.map_ = map;\r\n};\r\n\r\n\r\n/**\r\n * Returns the size of the grid.\r\n *\r\n * @return {number} The grid size.\r\n */\r\nMarkerClusterer.prototype.getGridSize = function () {\r\n return this.gridSize_;\r\n};\r\n\r\n\r\n/**\r\n * Sets the size of the grid.\r\n *\r\n * @param {number} size The grid size.\r\n */\r\nMarkerClusterer.prototype.setGridSize = function (size) {\r\n this.gridSize_ = size;\r\n};\r\n\r\n\r\n/**\r\n * Returns the min cluster size.\r\n *\r\n * @return {number} The grid size.\r\n */\r\nMarkerClusterer.prototype.getMinClusterSize = function () {\r\n return this.minClusterSize_;\r\n};\r\n\r\n/**\r\n * Sets the min cluster size.\r\n *\r\n * @param {number} size The grid size.\r\n */\r\nMarkerClusterer.prototype.setMinClusterSize = function (size) {\r\n this.minClusterSize_ = size;\r\n};\r\n\r\n\r\n/**\r\n * Extends a bounds object by the grid size.\r\n *\r\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\r\n * @return {google.maps.LatLngBounds} The extended bounds.\r\n */\r\nMarkerClusterer.prototype.getExtendedBounds = function (bounds) {\r\n var projection = this.getProjection();\r\n\r\n // Turn the bounds into latlng.\r\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\r\n bounds.getNorthEast().lng());\r\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\r\n bounds.getSouthWest().lng());\r\n\r\n // Convert the points to pixels and the extend out by the grid size.\r\n var trPix = projection.fromLatLngToDivPixel(tr);\r\n trPix.x += this.gridSize_;\r\n trPix.y -= this.gridSize_;\r\n\r\n var blPix = projection.fromLatLngToDivPixel(bl);\r\n blPix.x -= this.gridSize_;\r\n blPix.y += this.gridSize_;\r\n\r\n // Convert the pixel points back to LatLng\r\n var ne = projection.fromDivPixelToLatLng(trPix);\r\n var sw = projection.fromDivPixelToLatLng(blPix);\r\n\r\n // Extend the bounds to contain the new bounds.\r\n bounds.extend(ne);\r\n bounds.extend(sw);\r\n\r\n return bounds;\r\n};\r\n\r\n\r\n/**\r\n * Determins if a marker is contained in a bounds.\r\n *\r\n * @param {google.maps.Marker} marker The marker to check.\r\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\r\n * @return {boolean} True if the marker is in the bounds.\r\n * @private\r\n */\r\nMarkerClusterer.prototype.isMarkerInBounds_ = function (marker, bounds) {\r\n return bounds.contains(marker.getPosition());\r\n};\r\n\r\n\r\n/**\r\n * Clears all clusters and markers from the clusterer.\r\n */\r\nMarkerClusterer.prototype.clearMarkers = function () {\r\n this.resetViewport(true);\r\n\r\n // Set the markers a empty array.\r\n this.markers_ = [];\r\n};\r\n\r\n\r\n/**\r\n * Clears all existing clusters and recreates them.\r\n * @param {boolean} opt_hide To also hide the marker.\r\n */\r\nMarkerClusterer.prototype.resetViewport = function (opt_hide) {\r\n // Remove all the clusters\r\n for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {\r\n cluster.remove();\r\n }\r\n\r\n // Reset the markers to not be added and to be invisible.\r\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\r\n marker.isAdded = false;\r\n if (opt_hide) {\r\n marker.setMap(null);\r\n }\r\n }\r\n\r\n this.clusters_ = [];\r\n};\r\n\r\n/**\r\n *\r\n */\r\nMarkerClusterer.prototype.repaint = function () {\r\n var oldClusters = this.clusters_.slice();\r\n this.clusters_.length = 0;\r\n this.resetViewport();\r\n this.redraw();\r\n\r\n // Remove the old clusters.\r\n // Do it in a timeout so the other clusters have been drawn first.\r\n window.setTimeout(function () {\r\n for (var i = 0, cluster; cluster = oldClusters[i]; i++) {\r\n cluster.remove();\r\n }\r\n }, 0);\r\n};\r\n\r\n\r\n/**\r\n * Redraws the clusters.\r\n */\r\nMarkerClusterer.prototype.redraw = function () {\r\n this.createClusters_();\r\n};\r\n\r\n\r\n/**\r\n * Calculates the distance between two latlng locations in km.\r\n * @see http://www.movable-type.co.uk/scripts/latlong.html\r\n *\r\n * @param {google.maps.LatLng} p1 The first lat lng point.\r\n * @param {google.maps.LatLng} p2 The second lat lng point.\r\n * @return {number} The distance between the two points in km.\r\n * @private\r\n*/\r\nMarkerClusterer.prototype.distanceBetweenPoints_ = function (p1, p2) {\r\n if (!p1 || !p2) {\r\n return 0;\r\n }\r\n\r\n var R = 6371; // Radius of the Earth in km\r\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\r\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\r\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\r\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\r\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\r\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\r\n var d = R * c;\r\n return d;\r\n};\r\n\r\n\r\n/**\r\n * Add a marker to a cluster, or creates a new cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to add.\r\n * @private\r\n */\r\nMarkerClusterer.prototype.addToClosestCluster_ = function (marker) {\r\n var distance = 40000; // Some large number\r\n var clusterToAddTo = null;\r\n var pos = marker.getPosition();\r\n for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {\r\n var center = cluster.getCenter();\r\n if (center) {\r\n var d = this.distanceBetweenPoints_(center, marker.getPosition());\r\n if (d < distance) {\r\n distance = d;\r\n clusterToAddTo = cluster;\r\n }\r\n }\r\n }\r\n\r\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\r\n clusterToAddTo.addMarker(marker);\r\n } else {\r\n var cluster = new Cluster(this);\r\n cluster.addMarker(marker);\r\n this.clusters_.push(cluster);\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Creates the clusters.\r\n *\r\n * @private\r\n */\r\nMarkerClusterer.prototype.createClusters_ = function () {\r\n if (!this.ready_) {\r\n return;\r\n }\r\n\r\n // Get our current map view bounds.\r\n // Create a new bounds object so we don't affect the map.\r\n var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),\r\n this.map_.getBounds().getNorthEast());\r\n var bounds = this.getExtendedBounds(mapBounds);\r\n\r\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\r\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\r\n this.addToClosestCluster_(marker);\r\n }\r\n }\r\n};\r\n\r\n\r\n/**\r\n * A cluster that contains markers.\r\n *\r\n * @param {MarkerClusterer} markerClusterer The markerclusterer that this\r\n * cluster is associated with.\r\n * @constructor\r\n * @ignore\r\n */\r\nfunction Cluster(markerClusterer) {\r\n this.markerClusterer_ = markerClusterer;\r\n this.map_ = markerClusterer.getMap();\r\n this.gridSize_ = markerClusterer.getGridSize();\r\n this.minClusterSize_ = markerClusterer.getMinClusterSize();\r\n this.averageCenter_ = markerClusterer.isAverageCenter();\r\n this.center_ = null;\r\n this.markers_ = [];\r\n this.bounds_ = null;\r\n this.clusterIcon_ = new ClusterIcon(this, markerClusterer.getStyles(),\r\n markerClusterer.getGridSize());\r\n}\r\n\r\n/**\r\n * Determins if a marker is already added to the cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to check.\r\n * @return {boolean} True if the marker is already added.\r\n */\r\nCluster.prototype.isMarkerAlreadyAdded = function (marker) {\r\n if (this.markers_.indexOf) {\r\n return this.markers_.indexOf(marker) != -1;\r\n } else {\r\n for (var i = 0, m; m = this.markers_[i]; i++) {\r\n if (m == marker) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n};\r\n\r\n\r\n/**\r\n * Add a marker the cluster.\r\n *\r\n * @param {google.maps.Marker} marker The marker to add.\r\n * @return {boolean} True if the marker was added.\r\n */\r\nCluster.prototype.addMarker = function (marker) {\r\n if (this.isMarkerAlreadyAdded(marker)) {\r\n return false;\r\n }\r\n\r\n if (!this.center_) {\r\n this.center_ = marker.getPosition();\r\n this.calculateBounds_();\r\n } else {\r\n if (this.averageCenter_) {\r\n var l = this.markers_.length + 1;\r\n var lat = (this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;\r\n var lng = (this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;\r\n this.center_ = new google.maps.LatLng(lat, lng);\r\n this.calculateBounds_();\r\n }\r\n }\r\n\r\n marker.isAdded = true;\r\n this.markers_.push(marker);\r\n\r\n var len = this.markers_.length;\r\n if (len < this.minClusterSize_ && marker.getMap() != this.map_) {\r\n // Min cluster size not reached so show the marker.\r\n marker.setMap(this.map_);\r\n }\r\n\r\n if (len == this.minClusterSize_) {\r\n // Hide the markers that were showing.\r\n for (var i = 0; i < len; i++) {\r\n this.markers_[i].setMap(null);\r\n }\r\n }\r\n\r\n if (len >= this.minClusterSize_) {\r\n marker.setMap(null);\r\n }\r\n\r\n this.updateIcon();\r\n return true;\r\n};\r\n\r\n\r\n/**\r\n * Returns the marker clusterer that the cluster is associated with.\r\n *\r\n * @return {MarkerClusterer} The associated marker clusterer.\r\n */\r\nCluster.prototype.getMarkerClusterer = function () {\r\n return this.markerClusterer_;\r\n};\r\n\r\n\r\n/**\r\n * Returns the bounds of the cluster.\r\n *\r\n * @return {google.maps.LatLngBounds} the cluster bounds.\r\n */\r\nCluster.prototype.getBounds = function () {\r\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\r\n var markers = this.getMarkers();\r\n for (var i = 0, marker; marker = markers[i]; i++) {\r\n bounds.extend(marker.getPosition());\r\n }\r\n return bounds;\r\n};\r\n\r\n\r\n/**\r\n * Removes the cluster\r\n */\r\nCluster.prototype.remove = function () {\r\n this.clusterIcon_.remove();\r\n this.markers_.length = 0;\r\n delete this.markers_;\r\n};\r\n\r\n\r\n/**\r\n * Returns the number of markers in the cluster.\r\n *\r\n * @return {number} The number of markers in the cluster.\r\n */\r\nCluster.prototype.getSize = function () {\r\n return this.markers_.length;\r\n};\r\n\r\n\r\n/**\r\n * Returns a list of the markers in the cluster.\r\n *\r\n * @return {Array.} The markers in the cluster.\r\n */\r\nCluster.prototype.getMarkers = function () {\r\n return this.markers_;\r\n};\r\n\r\n\r\n/**\r\n * Returns the center of the cluster.\r\n *\r\n * @return {google.maps.LatLng} The cluster center.\r\n */\r\nCluster.prototype.getCenter = function () {\r\n return this.center_;\r\n};\r\n\r\n\r\n/**\r\n * Calculated the extended bounds of the cluster with the grid.\r\n *\r\n * @private\r\n */\r\nCluster.prototype.calculateBounds_ = function () {\r\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\r\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\r\n};\r\n\r\n\r\n/**\r\n * Determines if a marker lies in the clusters bounds.\r\n *\r\n * @param {google.maps.Marker} marker The marker to check.\r\n * @return {boolean} True if the marker lies in the bounds.\r\n */\r\nCluster.prototype.isMarkerInClusterBounds = function (marker) {\r\n return this.bounds_.contains(marker.getPosition());\r\n};\r\n\r\n\r\n/**\r\n * Returns the map that the cluster is associated with.\r\n *\r\n * @return {google.maps.Map} The map.\r\n */\r\nCluster.prototype.getMap = function () {\r\n return this.map_;\r\n};\r\n\r\n\r\n/**\r\n * Updates the cluster icon\r\n */\r\nCluster.prototype.updateIcon = function () {\r\n var zoom = this.map_.getZoom();\r\n var mz = this.markerClusterer_.getMaxZoom();\r\n\r\n if (mz && zoom > mz) {\r\n // The zoom is greater than our max zoom so show all the markers in cluster.\r\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\r\n marker.setMap(this.map_);\r\n }\r\n return;\r\n }\r\n\r\n if (this.markers_.length < this.minClusterSize_) {\r\n // Min cluster size not yet reached.\r\n this.clusterIcon_.hide();\r\n return;\r\n }\r\n\r\n var numStyles = this.markerClusterer_.getStyles().length;\r\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\r\n this.clusterIcon_.setCenter(this.center_);\r\n this.clusterIcon_.setSums(sums);\r\n this.clusterIcon_.show();\r\n};\r\n\r\n\r\n/**\r\n * A cluster icon\r\n *\r\n * @param {Cluster} cluster The cluster to be associated with.\r\n * @param {Object} styles An object that has style properties:\r\n * 'url': (string) The image url.\r\n * 'height': (number) The image height.\r\n * 'width': (number) The image width.\r\n * 'anchor': (Array) The anchor position of the label text.\r\n * 'textColor': (string) The text color.\r\n * 'textSize': (number) The text size.\r\n * 'backgroundPosition: (string) The background postition x, y.\r\n * @param {number=} opt_padding Optional padding to apply to the cluster icon.\r\n * @constructor\r\n * @extends google.maps.OverlayView\r\n * @ignore\r\n */\r\nfunction ClusterIcon(cluster, styles, opt_padding) {\r\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\r\n\r\n this.styles_ = styles;\r\n this.padding_ = opt_padding || 0;\r\n this.cluster_ = cluster;\r\n this.center_ = null;\r\n this.map_ = cluster.getMap();\r\n this.div_ = null;\r\n this.sums_ = null;\r\n this.visible_ = false;\r\n\r\n this.setMap(this.map_);\r\n}\r\n\r\n\r\n/**\r\n * Triggers the clusterclick event and zoom's if the option is set.\r\n */\r\nClusterIcon.prototype.triggerClusterClick = function () {\r\n var markerClusterer = this.cluster_.getMarkerClusterer();\r\n\r\n // Trigger the clusterclick event.\r\n google.maps.event.trigger(markerClusterer.map_, 'clusterclick', this.cluster_);\r\n\r\n if (markerClusterer.isZoomOnClick()) {\r\n // Zoom into the cluster.\r\n this.map_.fitBounds(this.cluster_.getBounds());\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Adding the cluster icon to the dom.\r\n * @ignore\r\n */\r\nClusterIcon.prototype.onAdd = function () {\r\n this.div_ = document.createElement('DIV');\r\n if (this.visible_) {\r\n var pos = this.getPosFromLatLng_(this.center_);\r\n this.div_.style.cssText = this.createCss(pos);\r\n this.div_.innerHTML = this.sums_.text;\r\n }\r\n\r\n var panes = this.getPanes();\r\n panes.overlayMouseTarget.appendChild(this.div_);\r\n\r\n var that = this;\r\n google.maps.event.addDomListener(this.div_, 'click', function () {\r\n that.triggerClusterClick();\r\n });\r\n};\r\n\r\n\r\n/**\r\n * Returns the position to place the div dending on the latlng.\r\n *\r\n * @param {google.maps.LatLng} latlng The position in latlng.\r\n * @return {google.maps.Point} The position in pixels.\r\n * @private\r\n */\r\nClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {\r\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\r\n pos.x -= parseInt(this.width_ / 2, 10);\r\n pos.y -= parseInt(this.height_ / 2, 10);\r\n return pos;\r\n};\r\n\r\n\r\n/**\r\n * Draw the icon.\r\n * @ignore\r\n */\r\nClusterIcon.prototype.draw = function () {\r\n if (this.visible_) {\r\n var pos = this.getPosFromLatLng_(this.center_);\r\n this.div_.style.top = pos.y + 'px';\r\n this.div_.style.left = pos.x + 'px';\r\n this.div_.style.zIndex = google.maps.Marker.MAX_ZINDEX + 1;\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Hide the icon.\r\n */\r\nClusterIcon.prototype.hide = function () {\r\n if (this.div_) {\r\n this.div_.style.display = 'none';\r\n }\r\n this.visible_ = false;\r\n};\r\n\r\n\r\n/**\r\n * Position and show the icon.\r\n */\r\nClusterIcon.prototype.show = function () {\r\n if (this.div_) {\r\n var pos = this.getPosFromLatLng_(this.center_);\r\n this.div_.style.cssText = this.createCss(pos);\r\n this.div_.style.display = '';\r\n }\r\n this.visible_ = true;\r\n};\r\n\r\n\r\n/**\r\n * Remove the icon from the map\r\n */\r\nClusterIcon.prototype.remove = function () {\r\n this.setMap(null);\r\n};\r\n\r\n\r\n/**\r\n * Implementation of the onRemove interface.\r\n * @ignore\r\n */\r\nClusterIcon.prototype.onRemove = function () {\r\n if (this.div_ && this.div_.parentNode) {\r\n this.hide();\r\n this.div_.parentNode.removeChild(this.div_);\r\n this.div_ = null;\r\n }\r\n};\r\n\r\n\r\n/**\r\n * Set the sums of the icon.\r\n *\r\n * @param {Object} sums The sums containing:\r\n * 'text': (string) The text to display in the icon.\r\n * 'index': (number) The style index of the icon.\r\n */\r\nClusterIcon.prototype.setSums = function (sums) {\r\n this.sums_ = sums;\r\n this.text_ = sums.text;\r\n this.index_ = sums.index;\r\n if (this.div_) {\r\n this.div_.innerHTML = sums.text;\r\n }\r\n\r\n this.useStyle();\r\n};\r\n\r\n\r\n/**\r\n * Sets the icon to the the styles.\r\n */\r\nClusterIcon.prototype.useStyle = function () {\r\n var index = Math.max(0, this.sums_.index - 1);\r\n index = Math.min(this.styles_.length - 1, index);\r\n var style = this.styles_[index];\r\n this.url_ = style['url'];\r\n this.height_ = style['height'];\r\n this.width_ = style['width'];\r\n this.textColor_ = style['textColor'];\r\n this.anchor_ = style['anchor'];\r\n this.textSize_ = style['textSize'];\r\n this.backgroundPosition_ = style['backgroundPosition'];\r\n};\r\n\r\n\r\n/**\r\n * Sets the center of the icon.\r\n *\r\n * @param {google.maps.LatLng} center The latlng to set as the center.\r\n */\r\nClusterIcon.prototype.setCenter = function (center) {\r\n this.center_ = center;\r\n};\r\n\r\n\r\n/**\r\n * Create the css text based on the position of the icon.\r\n *\r\n * @param {google.maps.Point} pos The position.\r\n * @return {string} The css style text.\r\n */\r\nClusterIcon.prototype.createCss = function (pos) {\r\n var style = [];\r\n style.push('background-image:url(' + this.url_ + ');');\r\n var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';\r\n style.push('background-position:' + backgroundPosition + ';');\r\n\r\n if (typeof this.anchor_ === 'object') {\r\n if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 &&\r\n this.anchor_[0] < this.height_) {\r\n style.push('height:' + (this.height_ - this.anchor_[0]) +\r\n 'px; padding-top:' + this.anchor_[0] + 'px;');\r\n } else {\r\n style.push('height:' + this.height_ + 'px; line-height:' + this.height_ +\r\n 'px;');\r\n }\r\n if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 &&\r\n this.anchor_[1] < this.width_) {\r\n style.push('width:' + (this.width_ - this.anchor_[1]) +\r\n 'px; padding-left:' + this.anchor_[1] + 'px;');\r\n } else {\r\n style.push('width:' + this.width_ + 'px; text-align:center;');\r\n }\r\n } else {\r\n style.push('height:' + this.height_ + 'px; line-height:' +\r\n this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;');\r\n }\r\n\r\n var txtColor = this.textColor_ ? this.textColor_ : 'black';\r\n var txtSize = this.textSize_ ? this.textSize_ : 11;\r\n\r\n style.push('cursor:pointer; top:' + pos.y + 'px; left:' +\r\n pos.x + 'px; color:' + txtColor + '; position:absolute; font-size:' +\r\n txtSize + 'px; font-family:Arial,sans-serif; font-weight:bold');\r\n return style.join('');\r\n};\r\n\r\n\r\n// Export Symbols for Closure\r\n// If you are not going to compile with closure then you can remove the\r\n// code below.\r\nwindow['MarkerClusterer'] = MarkerClusterer;\r\nMarkerClusterer.prototype['addMarker'] = MarkerClusterer.prototype.addMarker;\r\nMarkerClusterer.prototype['addMarkers'] = MarkerClusterer.prototype.addMarkers;\r\nMarkerClusterer.prototype['clearMarkers'] =\r\n MarkerClusterer.prototype.clearMarkers;\r\nMarkerClusterer.prototype['fitMapToMarkers'] =\r\n MarkerClusterer.prototype.fitMapToMarkers;\r\nMarkerClusterer.prototype['getCalculator'] =\r\n MarkerClusterer.prototype.getCalculator;\r\nMarkerClusterer.prototype['getGridSize'] =\r\n MarkerClusterer.prototype.getGridSize;\r\nMarkerClusterer.prototype['getExtendedBounds'] =\r\n MarkerClusterer.prototype.getExtendedBounds;\r\nMarkerClusterer.prototype['getMap'] = MarkerClusterer.prototype.getMap;\r\nMarkerClusterer.prototype['getMarkers'] = MarkerClusterer.prototype.getMarkers;\r\nMarkerClusterer.prototype['getMaxZoom'] = MarkerClusterer.prototype.getMaxZoom;\r\nMarkerClusterer.prototype['getStyles'] = MarkerClusterer.prototype.getStyles;\r\nMarkerClusterer.prototype['getTotalClusters'] =\r\n MarkerClusterer.prototype.getTotalClusters;\r\nMarkerClusterer.prototype['getTotalMarkers'] =\r\n MarkerClusterer.prototype.getTotalMarkers;\r\nMarkerClusterer.prototype['redraw'] = MarkerClusterer.prototype.redraw;\r\nMarkerClusterer.prototype['removeMarker'] =\r\n MarkerClusterer.prototype.removeMarker;\r\nMarkerClusterer.prototype['removeMarkers'] =\r\n MarkerClusterer.prototype.removeMarkers;\r\nMarkerClusterer.prototype['resetViewport'] =\r\n MarkerClusterer.prototype.resetViewport;\r\nMarkerClusterer.prototype['repaint'] =\r\n MarkerClusterer.prototype.repaint;\r\nMarkerClusterer.prototype['setCalculator'] =\r\n MarkerClusterer.prototype.setCalculator;\r\nMarkerClusterer.prototype['setGridSize'] =\r\n MarkerClusterer.prototype.setGridSize;\r\nMarkerClusterer.prototype['setMaxZoom'] =\r\n MarkerClusterer.prototype.setMaxZoom;\r\nMarkerClusterer.prototype['onAdd'] = MarkerClusterer.prototype.onAdd;\r\nMarkerClusterer.prototype['draw'] = MarkerClusterer.prototype.draw;\r\n\r\nCluster.prototype['getCenter'] = Cluster.prototype.getCenter;\r\nCluster.prototype['getSize'] = Cluster.prototype.getSize;\r\nCluster.prototype['getMarkers'] = Cluster.prototype.getMarkers;\r\n\r\nClusterIcon.prototype['onAdd'] = ClusterIcon.prototype.onAdd;\r\nClusterIcon.prototype['draw'] = ClusterIcon.prototype.draw;\r\nClusterIcon.prototype['onRemove'] = ClusterIcon.prototype.onRemove;\r\n\r\nObject.keys = Object.keys || function (o) {\r\n var result = [];\r\n for (var name in o) {\r\n if (o.hasOwnProperty(name))\r\n result.push(name);\r\n }\r\n return result;\r\n};\r\n\r\nif (typeof module == 'object') {\r\n module.exports = MarkerClusterer;\r\n} \r\n"]}