{"version":3,"sources":["Feature/ContactLocator/code/ui/scripts/ContactLocator/markerclusterer.js"],"names":["MarkerClusterer","map","opt_markers","opt_options","this","extend","google","maps","OverlayView","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_","map_","getZoom","zoom","Math","event","addListener","that","resetViewport","minZoom","maxZoom","min","mapTypes","getMapTypeId","redraw","length","Object","keys","addMarkers","center_","markerClusterer","bounds_","getMap","clusterIcon_","ClusterIcon","getMinClusterSize","isAverageCenter","getStyles","getGridSize","styles","opt_padding","cluster","padding_","div_","sums_","visible_","textColor_","prototype","obj1","obj2","object","property","setReady_","apply","onAdd","draw","height","size","width","i","push","url","fitMapToMarkers","marker","markers","fitBounds","getMarkers","bounds","LatLngBounds","getPosition","setStyles","isZoomOnClick","getTotalMarkers","setMaxZoom","getMaxZoom","calculator_","numStyles","dv","index","parseInt","count","text","setCalculator","calculator","getCalculator","opt_nodraw","pushMarkerTo_","isAdded","repaint","removeMarker_","indexOf","m","splice","removed","removeMarkers","slice","r","ready","createClusters_","setGridSize","setMinClusterSize","getExtendedBounds","projection","getProjection","bl","LatLng","getSouthWest","lat","getNorthEast","lng","trPix","fromLatLngToDivPixel","blPix","tr","y","sw","fromDivPixelToLatLng","x","ne","clearMarkers","opt_hide","remove","oldClusters","window","setTimeout","p1","p2","dLat","PI","dLon","a","sin","cos","atan2","sqrt","addToClosestCluster_","distance","clusterToAddTo","center","d","distanceBetweenPoints_","isMarkerInClusterBounds","addMarker","Cluster","mapBounds","getBounds","isMarkerInBounds_","isMarkerAlreadyAdded","calculateBounds_","l","len","updateIcon","getMarkerClusterer","markerClusterer_","getSize","getCenter","contains","mz","hide","setCenter","sums","show","setSums","triggerClusterClick","trigger","cluster_","cssText","innerHTML","createElement","pos","getPosFromLatLng_","panes","style","getPanes","createCss","overlayMouseTarget","appendChild","addDomListener","latlng","width_","height_","zIndex","top","left","Marker","MAX_ZINDEX","display","parentNode","removeChild","index_","text_","useStyle","url_","anchor_","textSize_","backgroundPosition_","backgroundPosition","txtColor","join","txtSize","getTotalClusters","removeMarker","hasOwnProperty","module","onRemove","o","result","name","_typeof","exports"],"mappings":"2QAgEA,SAAAA,gBAAAC,EAAAC,EAAAC,GAMEC,KAAAC,OAAAL,gBAAAM,OAAAC,KAAAC,aACAJ,KAAKC,KAAOL,EAOZI,KAAKK,YAKLL,KAAKM,aAELN,KAAKO,OAAS,GAAI,GAAI,GAAI,GAAI,IAK9BP,KAAKQ,WAMLR,KAAKS,QAAS,EAId,IAAAC,EAAAX,MAMAC,KAAAW,UAAAD,EAAA,UAAA,GAMAV,KAAAY,gBAAAF,EAAA,oBAAA,EAQAV,KAAAa,SAAAH,EAAA,SAAA,KAEFV,KAAAQ,QAAAE,EAAA,WAOAV,KAAAc,WAAAJ,EAAA,WACAV,KAAAe,2BAOAf,KAAAgB,gBAAAN,EAAA,gBALMV,KAAKiB,gCAYTjB,KAAAkB,cAAA,EAEFC,MAAAT,EAAA,cACAV,KAAAkB,aAAAR,EAAA,aAKGV,KAAAoB,gBAAA,EAEDD,MAAAT,EAAKW,gBAELrB,KAAKsB,eAALZ,EAAA,eAIFV,KAAAqB,eAJErB,KAAKsB,OAAOzB,GAYVG,KAAAuB,UAAevB,KAAJwB,KAAUC,UAIrBC,IAAAA,EAAOC,KANTzB,OAAOC,KAAKyB,MAAMC,YAAY7B,KAAKwB,KAAM,eAAgB,WASrDM,IAAAA,EAAKP,EAALC,KAAiBE,UACjBI,EAAKC,EAAAA,KAALC,SAAA,EACDC,EAAAN,KAAAO,IAAAJ,EAAAN,KAAAS,SAAA,IAXHH,EAAAN,KAAAW,SAAAL,EAAAN,KAAAY,gBAAAH,SAcA/B,EAAOC,KAAKyB,IAAMC,KAAAA,IAAAA,EAAYG,GAAWC,GAIzCH,EAAAP,WA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ilation_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 this.textColor_ = 'white';\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_ : 'white';\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\nvar window = window || {};\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"]}