{"version":3,"file":"chunks/map.js?v=93239192428af8c18ef1","mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,6BAA6B;AACxC;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA,aAAa;AACb;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;;AAGA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,sBAAsB;AAC9C;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,4BAA4B;AACzC;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,4BAA4B;AACxC,YAAY,QAAQ;AACpB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,yBAAyB;AACrC;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,UAAU;AACrB;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,UAAU;AACrB,YAAY,SAAS;AACrB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,4BAA4B;AACvC,WAAW,UAAU;AACrB;AACA;AACA;;AAEA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,YAAY,0BAA0B;AACtC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,0BAA0B;AACrC,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;;AAEA;AACA,0BAA0B,2BAA2B;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B,2BAA2B;AACrD;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,IAAI;AACJ,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,0BAA0B;AACtC;AACA;AACA;AACA;AACA,0BAA0B,qBAAqB;AAC/C;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,4BAA4B;AACxC;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,YAAY,SAAS;AACrB;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,YAAY,iBAAiB;AAC7B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B,2BAA2B;AACvD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,YAAY,mBAAmB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,MAAM;AACjB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,yBAAyB;AACzB,0BAA0B;AAC1B,oBAAoB;AACpB,uBAAuB;AACvB;;AAEA;AACA,sDAAsD;AACtD;AACA,6DAA6D;;AAE7D;AACA;AACA;AACA;AACA,eAAe,sCAAsC;AACrD,MAAM;AACN;AACA,iDAAiD;AACjD,cAAc;AACd,MAAM;AACN,iDAAiD;AACjD,cAAc;AACd;AACA;AACA;AACA;AACA,eAAe,uCAAuC;AACtD,MAAM;AACN,+CAA+C,kBAAkB;AACjE;AACA,IAAI;AACJ,+CAA+C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EACF;AACF;AAEA,+DAAerF,GAAG;;;;;;;;;;;;;;;;;;ACnVlBwB,MAAM,CAAC+D,CAAC,GAAGA,CAAC","sources":["webpack://Alster/./app/vendors/js-marker-clusterer/src/markerclusterer.js","webpack://Alster/./app/components/map/map.js","webpack://Alster/./app/vendor.js"],"sourcesContent":["// ==ClosureCompiler==\n// @compilation_level ADVANCED_OPTIMIZATIONS\n// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/maps/google_maps_api_v3.js\n// ==/ClosureCompiler==\n\n/**\n * @name MarkerClusterer for Google Maps v3\n * @version version 1.0\n * @author Luke Mahe\n * @fileoverview\n * The library creates and manages per-zoom-level clusters for large amounts of\n * markers.\n *
\n * This is a v3 implementation of the\n * v2 MarkerClusterer.\n */\n\n/**\n * @license\n * Copyright 2010 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * A Marker Clusterer that clusters markers.\n *\n * @param {google.maps.Map} map The Google map to attach to.\n * @param {Array.=} opt_markers Optional markers to add to\n * the cluster.\n * @param {Object=} opt_options support the following options:\n * 'gridSize': (number) The grid size of a cluster in pixels.\n * 'maxZoom': (number) The maximum zoom level that a marker can be part of a\n * cluster.\n * 'zoomOnClick': (boolean) Whether the default behaviour of clicking on a\n * cluster is to zoom into it.\n * 'averageCenter': (boolean) Whether the center of each cluster should be\n * the average of all markers in the cluster.\n * 'minimumClusterSize': (number) The minimum number of markers to be in a\n * cluster before the markers are hidden and a count\n * is shown.\n * 'cssClass': (string) Css class to add to each cluster maker. This will \n * also remove default style and ignore 'styles' parameter.\n * 'styles': (object) An object that has style properties:\n * 'url': (string) The image url.\n * 'height': (number) The image height.\n * 'width': (number) The image width.\n * 'anchor': (Array) The anchor position of the label text.\n * 'textColor': (string) The text color.\n * 'textSize': (number) The text size.\n * 'backgroundPosition': (string) The position of the backgound x, y.\n * 'iconAnchor': (Array) The anchor position of the icon x, y.\n * @constructor\n * @extends google.maps.OverlayView\n */\nfunction MarkerClusterer(map, opt_markers, opt_options) {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n this.extend(MarkerClusterer, google.maps.OverlayView);\n this.map_ = map;\n\n /**\n * @type {Array.}\n * @private\n */\n this.markers_ = [];\n\n /**\n * @type {Array.}\n */\n this.clusters_ = [];\n\n this.sizes = [53, 56, 66, 78, 90];\n\n /**\n * @private\n */\n this.styles_ = [];\n\n /**\n * @type {boolean}\n * @private\n */\n this.ready_ = false;\n\n var options = opt_options || {};\n\n /**\n * @type {number}\n * @private\n */\n this.gridSize_ = options['gridSize'] || 60;\n\n /**\n * @private\n */\n this.minClusterSize_ = options['minimumClusterSize'] || 2;\n\n\n /**\n * @type {?number}\n * @private\n */\n this.maxZoom_ = options['maxZoom'] || null;\n\n this.styles_ = options['styles'] || [];\n\n /**\n * @type {string}\n * @private\n */\n this.cssClass_ = options['cssClass'];\n\n if (Object.keys(this.styles_).length > 0 && this.cssClass_)\n console.warn(\"A custom style and cssClass is applied. The custom style will be discarded.\");\n\n /**\n * @type {string}\n * @private\n */\n this.imagePath_ = options['imagePath'] ||\n this.MARKER_CLUSTER_IMAGE_PATH_;\n\n /**\n * @type {string}\n * @private\n */\n this.imageExtension_ = options['imageExtension'] ||\n this.MARKER_CLUSTER_IMAGE_EXTENSION_;\n\n /**\n * @type {boolean}\n * @private\n */\n this.zoomOnClick_ = true;\n\n if (options['zoomOnClick'] != undefined) {\n this.zoomOnClick_ = options['zoomOnClick'];\n }\n\n /**\n * @type {boolean}\n * @private\n */\n this.averageCenter_ = false;\n\n if (options['averageCenter'] != undefined) {\n this.averageCenter_ = options['averageCenter'];\n }\n\n this.setupStyles_();\n\n this.setMap(map);\n\n /**\n * @type {number}\n * @private\n */\n this.prevZoom_ = this.map_.getZoom();\n\n // Add the map event listeners\n var that = this;\n google.maps.event.addListener(this.map_, 'zoom_changed', function() {\n var zoom = that.map_.getZoom();\n\n if (that.prevZoom_ != zoom) {\n that.prevZoom_ = zoom;\n that.resetViewport();\n }\n });\n\n google.maps.event.addListener(this.map_, 'idle', function() {\n that.redraw();\n });\n\n // Finally, add the markers\n if (opt_markers && opt_markers.length) {\n this.addMarkers(opt_markers, false);\n }\n}\n\n\n/**\n * The marker cluster image path.\n *\n * @type {string}\n * @private\n */\nMarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_ = '../images/m';\n\n\n/**\n * The marker cluster image path.\n *\n * @type {string}\n * @private\n */\nMarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_EXTENSION_ = 'png';\n\n\n/**\n * Extends a objects prototype by anothers.\n *\n * @param {Object} obj1 The object to be extended.\n * @param {Object} obj2 The object to extend with.\n * @return {Object} The new extended object.\n * @ignore\n */\nMarkerClusterer.prototype.extend = function(obj1, obj2) {\n return (function(object) {\n for (var property in object.prototype) {\n this.prototype[property] = object.prototype[property];\n }\n return this;\n }).apply(obj1, [obj2]);\n};\n\n\n/**\n * Implementaion of the interface method.\n * @ignore\n */\nMarkerClusterer.prototype.onAdd = function() {\n this.setReady_(true);\n};\n\n/**\n * Implementaion of the interface method.\n * @ignore\n */\nMarkerClusterer.prototype.draw = function() {};\n\n/**\n * Sets up the styles object.\n *\n * @private\n */\nMarkerClusterer.prototype.setupStyles_ = function() {\n if (this.styles_.length) {\n return;\n }\n\n for (var i = 0, size; size = this.sizes[i]; i++) {\n this.styles_.push({\n url: this.imagePath_ + (i + 1) + '.' + this.imageExtension_,\n height: size,\n width: size\n });\n }\n};\n\n/**\n * Fit the map to the bounds of the markers in the clusterer.\n */\nMarkerClusterer.prototype.fitMapToMarkers = function() {\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (var i = 0, marker; marker = markers[i]; i++) {\n bounds.extend(marker.getPosition());\n }\n\n this.map_.fitBounds(bounds);\n};\n\n\n/**\n * Sets the styles.\n *\n * @param {Object} styles The style to set.\n */\nMarkerClusterer.prototype.setStyles = function(styles) {\n this.styles_ = styles;\n};\n\n\n/**\n * Gets the styles.\n *\n * @return {Object} The styles object.\n */\nMarkerClusterer.prototype.getStyles = function() {\n return this.styles_;\n};\n\n\n/**\n * Whether zoom on click is set.\n *\n * @return {boolean} True if zoomOnClick_ is set.\n */\nMarkerClusterer.prototype.isZoomOnClick = function() {\n return this.zoomOnClick_;\n};\n\n/**\n * Whether average center is set.\n *\n * @return {boolean} True if averageCenter_ is set.\n */\nMarkerClusterer.prototype.isAverageCenter = function() {\n return this.averageCenter_;\n};\n\n\n/**\n * Returns the array of markers in the clusterer.\n *\n * @return {Array.} The markers.\n */\nMarkerClusterer.prototype.getMarkers = function() {\n return this.markers_;\n};\n\n\n/**\n * Returns the number of markers in the clusterer\n *\n * @return {Number} The number of markers.\n */\nMarkerClusterer.prototype.getTotalMarkers = function() {\n return this.markers_.length;\n};\n\n\n/**\n * Sets the max zoom for the clusterer.\n *\n * @param {number} maxZoom The max zoom level.\n */\nMarkerClusterer.prototype.setMaxZoom = function(maxZoom) {\n this.maxZoom_ = maxZoom;\n};\n\n\n/**\n * Gets the max zoom for the clusterer.\n *\n * @return {number} The max zoom level.\n */\nMarkerClusterer.prototype.getMaxZoom = function() {\n return this.maxZoom_;\n};\n\n\n/**\n * The function for calculating the cluster icon image.\n *\n * @param {Array.} markers The markers in the clusterer.\n * @param {number} numStyles The number of styles available.\n * @return {Object} A object properties: 'text' (string) and 'index' (number).\n * @private\n */\nMarkerClusterer.prototype.calculator_ = function(markers, numStyles) {\n var index = 0;\n var count = markers.length;\n var dv = count;\n while (dv !== 0) {\n dv = parseInt(dv / 10, 10);\n index++;\n }\n\n index = Math.min(index, numStyles);\n return {\n text: count,\n index: index\n };\n};\n\n\n/**\n * Set the calculator function.\n *\n * @param {function(Array, number)} calculator The function to set as the\n * calculator. The function should return a object properties:\n * 'text' (string) and 'index' (number).\n *\n */\nMarkerClusterer.prototype.setCalculator = function(calculator) {\n this.calculator_ = calculator;\n};\n\n\n/**\n * Get the calculator function.\n *\n * @return {function(Array, number)} the calculator function.\n */\nMarkerClusterer.prototype.getCalculator = function() {\n return this.calculator_;\n};\n\n\n/**\n * Add an array of markers to the clusterer.\n *\n * @param {Array.} markers The markers to add.\n * @param {boolean=} opt_nodraw Whether to redraw the clusters.\n */\nMarkerClusterer.prototype.addMarkers = function(markers, opt_nodraw) {\n for (var i = 0, marker; marker = markers[i]; i++) {\n this.pushMarkerTo_(marker);\n }\n if (!opt_nodraw) {\n this.redraw();\n }\n};\n\n\n/**\n * Pushes a marker to the clusterer.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @private\n */\nMarkerClusterer.prototype.pushMarkerTo_ = function(marker) {\n marker.isAdded = false;\n if (marker['draggable']) {\n // If the marker is draggable add a listener so we update the clusters on\n // the drag end.\n var that = this;\n google.maps.event.addListener(marker, 'dragend', function() {\n marker.isAdded = false;\n that.repaint();\n });\n }\n this.markers_.push(marker);\n};\n\n\n/**\n * Adds a marker to the clusterer and redraws if needed.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @param {boolean=} opt_nodraw Whether to redraw the clusters.\n */\nMarkerClusterer.prototype.addMarker = function(marker, opt_nodraw) {\n this.pushMarkerTo_(marker);\n if (!opt_nodraw) {\n this.redraw();\n }\n};\n\n\n/**\n * Removes a marker and returns true if removed, false if not\n *\n * @param {google.maps.Marker} marker The marker to remove\n * @return {boolean} Whether the marker was removed or not\n * @private\n */\nMarkerClusterer.prototype.removeMarker_ = function(marker) {\n var index = -1;\n if (this.markers_.indexOf) {\n index = this.markers_.indexOf(marker);\n } else {\n for (var i = 0, m; m = this.markers_[i]; i++) {\n if (m == marker) {\n index = i;\n break;\n }\n }\n }\n\n if (index == -1) {\n // Marker is not in our list of markers.\n return false;\n }\n\n marker.setMap(null);\n\n this.markers_.splice(index, 1);\n\n return true;\n};\n\n\n/**\n * Remove a marker from the cluster.\n *\n * @param {google.maps.Marker} marker The marker to remove.\n * @param {boolean=} opt_nodraw Optional boolean to force no redraw.\n * @return {boolean} True if the marker was removed.\n */\nMarkerClusterer.prototype.removeMarker = function(marker, opt_nodraw) {\n var removed = this.removeMarker_(marker);\n\n if (!opt_nodraw && removed) {\n this.resetViewport();\n this.redraw();\n return true;\n } else {\n return false;\n }\n};\n\n\n/**\n * Removes an array of markers from the cluster.\n *\n * @param {Array.} markers The markers to remove.\n * @param {boolean=} opt_nodraw Optional boolean to force no redraw.\n */\nMarkerClusterer.prototype.removeMarkers = function(markers, opt_nodraw) {\n var removed = false;\n\n for (var i = 0, marker; marker = markers[i]; i++) {\n var r = this.removeMarker_(marker);\n removed = removed || r;\n }\n\n if (!opt_nodraw && removed) {\n this.resetViewport();\n this.redraw();\n return true;\n }\n};\n\n\n/**\n * Sets the clusterer's ready state.\n *\n * @param {boolean} ready The state.\n * @private\n */\nMarkerClusterer.prototype.setReady_ = function(ready) {\n if (!this.ready_) {\n this.ready_ = ready;\n this.createClusters_();\n }\n};\n\n\n/**\n * Returns the number of clusters in the clusterer.\n *\n * @return {number} The number of clusters.\n */\nMarkerClusterer.prototype.getTotalClusters = function() {\n return this.clusters_.length;\n};\n\n\n/**\n * Returns the google map that the clusterer is associated with.\n *\n * @return {google.maps.Map} The map.\n */\nMarkerClusterer.prototype.getMap = function() {\n return this.map_;\n};\n\n\n/**\n * Sets the google map that the clusterer is associated with.\n *\n * @param {google.maps.Map} map The map.\n */\nMarkerClusterer.prototype.setMap = function(map) {\n this.map_ = map;\n};\n\n\n/**\n * Returns the size of the grid.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getGridSize = function() {\n return this.gridSize_;\n};\n\n\n/**\n * Sets the size of the grid.\n *\n * @param {number} size The grid size.\n */\nMarkerClusterer.prototype.setGridSize = function(size) {\n this.gridSize_ = size;\n};\n\n\n/**\n * Returns the min cluster size.\n *\n * @return {number} The grid size.\n */\nMarkerClusterer.prototype.getMinClusterSize = function() {\n return this.minClusterSize_;\n};\n\n/**\n * Sets the min cluster size.\n *\n * @param {number} size The grid size.\n */\nMarkerClusterer.prototype.setMinClusterSize = function(size) {\n this.minClusterSize_ = size;\n};\n\n\n/**\n * Extends a bounds object by the grid size.\n *\n * @param {google.maps.LatLngBounds} bounds The bounds to extend.\n * @return {google.maps.LatLngBounds} The extended bounds.\n */\nMarkerClusterer.prototype.getExtendedBounds = function(bounds) {\n var projection = this.getProjection();\n\n // Turn the bounds into latlng.\n var tr = new google.maps.LatLng(bounds.getNorthEast().lat(),\n bounds.getNorthEast().lng());\n var bl = new google.maps.LatLng(bounds.getSouthWest().lat(),\n bounds.getSouthWest().lng());\n\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(tr);\n trPix.x += this.gridSize_;\n trPix.y -= this.gridSize_;\n\n var blPix = projection.fromLatLngToDivPixel(bl);\n blPix.x -= this.gridSize_;\n blPix.y += this.gridSize_;\n\n // Convert the pixel points back to LatLng\n var ne = projection.fromDivPixelToLatLng(trPix);\n var sw = projection.fromDivPixelToLatLng(blPix);\n\n // Extend the bounds to contain the new bounds.\n bounds.extend(ne);\n bounds.extend(sw);\n\n return bounds;\n};\n\n\n/**\n * Determins if a marker is contained in a bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @param {google.maps.LatLngBounds} bounds The bounds to check against.\n * @return {boolean} True if the marker is in the bounds.\n * @private\n */\nMarkerClusterer.prototype.isMarkerInBounds_ = function(marker, bounds) {\n return bounds.contains(marker.getPosition());\n};\n\n\n/**\n * Clears all clusters and markers from the clusterer.\n */\nMarkerClusterer.prototype.clearMarkers = function() {\n this.resetViewport(true);\n\n // Set the markers a empty array.\n this.markers_ = [];\n};\n\n\n/**\n * Clears all existing clusters and recreates them.\n * @param {boolean} opt_hide To also hide the marker.\n */\nMarkerClusterer.prototype.resetViewport = function(opt_hide) {\n // Remove all the clusters\n for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {\n cluster.remove();\n }\n\n // Reset the markers to not be added and to be invisible.\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\n marker.isAdded = false;\n if (opt_hide) {\n marker.setMap(null);\n }\n }\n\n this.clusters_ = [];\n};\n\n/**\n *\n */\nMarkerClusterer.prototype.repaint = function() {\n var oldClusters = this.clusters_.slice();\n this.clusters_.length = 0;\n this.resetViewport();\n this.redraw();\n\n // Remove the old clusters.\n // Do it in a timeout so the other clusters have been drawn first.\n window.setTimeout(function() {\n for (var i = 0, cluster; cluster = oldClusters[i]; i++) {\n cluster.remove();\n }\n }, 0);\n};\n\n\n/**\n * Redraws the clusters.\n */\nMarkerClusterer.prototype.redraw = function() {\n this.createClusters_();\n};\n\n\n/**\n * Calculates the distance between two latlng locations in km.\n * @see http://www.movable-type.co.uk/scripts/latlong.html\n *\n * @param {google.maps.LatLng} p1 The first lat lng point.\n * @param {google.maps.LatLng} p2 The second lat lng point.\n * @return {number} The distance between the two points in km.\n * @private\n*/\nMarkerClusterer.prototype.distanceBetweenPoints_ = function(p1, p2) {\n if (!p1 || !p2) {\n return 0;\n }\n\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *\n Math.sin(dLon / 2) * Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c;\n return d;\n};\n\n\n/**\n * Add a marker to a cluster, or creates a new cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @private\n */\nMarkerClusterer.prototype.addToClosestCluster_ = function(marker) {\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n var pos = marker.getPosition();\n for (var i = 0, cluster; cluster = this.clusters_[i]; i++) {\n var center = cluster.getCenter();\n if (center) {\n var d = this.distanceBetweenPoints_(center, marker.getPosition());\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n var cluster = new Cluster(this);\n cluster.addMarker(marker);\n this.clusters_.push(cluster);\n }\n};\n\n\n/**\n * Creates the clusters.\n *\n * @private\n */\nMarkerClusterer.prototype.createClusters_ = function() {\n if (!this.ready_) {\n return;\n }\n\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n var mapBounds = new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),\n this.map_.getBounds().getNorthEast());\n var bounds = this.getExtendedBounds(mapBounds);\n\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\n if (!marker.isAdded && this.isMarkerInBounds_(marker, bounds)) {\n this.addToClosestCluster_(marker);\n }\n }\n};\n\n\n/**\n * A cluster that contains markers.\n *\n * @param {MarkerClusterer} markerClusterer The markerclusterer that this\n * cluster is associated with.\n * @constructor\n * @ignore\n */\nfunction Cluster(markerClusterer) {\n this.markerClusterer_ = markerClusterer;\n this.map_ = markerClusterer.getMap();\n this.gridSize_ = markerClusterer.getGridSize();\n this.minClusterSize_ = markerClusterer.getMinClusterSize();\n this.averageCenter_ = markerClusterer.isAverageCenter();\n this.center_ = null;\n this.markers_ = [];\n this.bounds_ = null;\n this.clusterIcon_ = new ClusterIcon(this, markerClusterer.getStyles(),\n markerClusterer.getGridSize(), markerClusterer.cssClass_);\n}\n\n/**\n * Determins if a marker is already added to the cluster.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker is already added.\n */\nCluster.prototype.isMarkerAlreadyAdded = function(marker) {\n if (this.markers_.indexOf) {\n return this.markers_.indexOf(marker) != -1;\n } else {\n for (var i = 0, m; m = this.markers_[i]; i++) {\n if (m == marker) {\n return true;\n }\n }\n }\n return false;\n};\n\n\n/**\n * Add a marker the cluster.\n *\n * @param {google.maps.Marker} marker The marker to add.\n * @return {boolean} True if the marker was added.\n */\nCluster.prototype.addMarker = function(marker) {\n if (this.isMarkerAlreadyAdded(marker)) {\n return false;\n }\n\n if (!this.center_) {\n this.center_ = marker.getPosition();\n this.calculateBounds_();\n } else {\n if (this.averageCenter_) {\n var l = this.markers_.length + 1;\n var lat = (this.center_.lat() * (l-1) + marker.getPosition().lat()) / l;\n var lng = (this.center_.lng() * (l-1) + marker.getPosition().lng()) / l;\n this.center_ = new google.maps.LatLng(lat, lng);\n this.calculateBounds_();\n }\n }\n\n marker.isAdded = true;\n this.markers_.push(marker);\n\n var len = this.markers_.length;\n if (len < this.minClusterSize_ && marker.getMap() != this.map_) {\n // Min cluster size not reached so show the marker.\n marker.setMap(this.map_);\n }\n\n if (len == this.minClusterSize_) {\n // Hide the markers that were showing.\n for (var i = 0; i < len; i++) {\n this.markers_[i].setMap(null);\n }\n }\n\n if (len >= this.minClusterSize_) {\n marker.setMap(null);\n }\n\n this.updateIcon();\n return true;\n};\n\n\n/**\n * Returns the marker clusterer that the cluster is associated with.\n *\n * @return {MarkerClusterer} The associated marker clusterer.\n */\nCluster.prototype.getMarkerClusterer = function() {\n return this.markerClusterer_;\n};\n\n\n/**\n * Returns the bounds of the cluster.\n *\n * @return {google.maps.LatLngBounds} the cluster bounds.\n */\nCluster.prototype.getBounds = function() {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n var markers = this.getMarkers();\n for (var i = 0, marker; marker = markers[i]; i++) {\n bounds.extend(marker.getPosition());\n }\n return bounds;\n};\n\n\n/**\n * Removes the cluster\n */\nCluster.prototype.remove = function() {\n this.clusterIcon_.remove();\n this.markers_.length = 0;\n delete this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster.\n *\n * @return {number} The cluster center.\n */\nCluster.prototype.getSize = function() {\n return this.markers_.length;\n};\n\n\n/**\n * Returns the center of the cluster.\n *\n * @return {Array.} The cluster center.\n */\nCluster.prototype.getMarkers = function() {\n return this.markers_;\n};\n\n\n/**\n * Returns the center of the cluster.\n *\n * @return {google.maps.LatLng} The cluster center.\n */\nCluster.prototype.getCenter = function() {\n return this.center_;\n};\n\n\n/**\n * Calculated the extended bounds of the cluster with the grid.\n *\n * @private\n */\nCluster.prototype.calculateBounds_ = function() {\n var bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n};\n\n\n/**\n * Determines if a marker lies in the clusters bounds.\n *\n * @param {google.maps.Marker} marker The marker to check.\n * @return {boolean} True if the marker lies in the bounds.\n */\nCluster.prototype.isMarkerInClusterBounds = function(marker) {\n return this.bounds_.contains(marker.getPosition());\n};\n\n\n/**\n * Returns the map that the cluster is associated with.\n *\n * @return {google.maps.Map} The map.\n */\nCluster.prototype.getMap = function() {\n return this.map_;\n};\n\n\n/**\n * Updates the cluster icon\n */\nCluster.prototype.updateIcon = function() {\n var zoom = this.map_.getZoom();\n var mz = this.markerClusterer_.getMaxZoom();\n\n if (mz && zoom > mz) {\n // The zoom is greater than our max zoom so show all the markers in cluster.\n for (var i = 0, marker; marker = this.markers_[i]; i++) {\n marker.setMap(this.map_);\n }\n return;\n }\n\n if (this.markers_.length < this.minClusterSize_) {\n // Min cluster size not yet reached.\n this.clusterIcon_.hide();\n return;\n }\n\n var numStyles = this.markerClusterer_.getStyles().length;\n var sums = this.markerClusterer_.getCalculator()(this.markers_, numStyles);\n this.clusterIcon_.setCenter(this.center_);\n this.clusterIcon_.setSums(sums);\n this.clusterIcon_.show();\n};\n\n\n/**\n * A cluster icon\n *\n * @param {Cluster} cluster The cluster to be associated with.\n * @param {Object} styles An object that has style properties:\n * 'url': (string) The image url.\n * 'height': (number) The image height.\n * 'width': (number) The image width.\n * 'anchor': (Array) The anchor position of the label text.\n * 'textColor': (string) The text color.\n * 'textSize': (number) The text size.\n * 'backgroundPosition: (string) The background postition x, y.\n * @param {number=} opt_padding Optional padding to apply to the cluster icon.\n * @param {string} cssClass (string) Css class to add to each cluster maker. This will also remove default style and ignore 'styles' parameter.\n * @constructor\n * @extends google.maps.OverlayView\n * @ignore\n */\nfunction ClusterIcon(cluster, styles, opt_padding, cssClass) {\n cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);\n\n this.cssClass_ = cssClass;\n this.styles_ = styles;\n this.padding_ = opt_padding || 0;\n this.cluster_ = cluster;\n this.center_ = null;\n this.map_ = cluster.getMap();\n this.div_ = null;\n this.sums_ = null;\n this.visible_ = false;\n\n this.setMap(this.map_);\n}\n\n\n/**\n * Triggers the clusterclick event and zoom's if the option is set.\n *\n * @param {google.maps.MouseEvent} event The event to propagate\n */\nClusterIcon.prototype.triggerClusterClick = function(event) {\n var markerClusterer = this.cluster_.getMarkerClusterer();\n\n // Trigger the clusterclick event.\n google.maps.event.trigger(markerClusterer, 'clusterclick', this.cluster_, event);\n\n if (markerClusterer.isZoomOnClick()) {\n // Zoom into the cluster.\n this.map_.fitBounds(this.cluster_.getBounds());\n }\n};\n\n\n/**\n * Adding the cluster icon to the dom.\n * @ignore\n */\nClusterIcon.prototype.onAdd = function() {\n this.div_ = document.createElement('DIV');\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos, !!this.cssClass_);\n this.div_.className += this.cssClass_;\n this.div_.innerHTML = this.sums_.text;\n }\n\n var panes = this.getPanes();\n panes.overlayMouseTarget.appendChild(this.div_);\n\n var that = this;\n var isDragging = false;\n google.maps.event.addDomListener(this.div_, 'click', function(event) {\n // Only perform click when not preceded by a drag\n if (!isDragging) {\n that.triggerClusterClick(event);\n }\n });\n google.maps.event.addDomListener(this.div_, 'mousedown', function() {\n isDragging = false;\n });\n google.maps.event.addDomListener(this.div_, 'mousemove', function() {\n isDragging = true;\n });\n};\n\n\n/**\n * Returns the position to place the div dending on the latlng.\n *\n * @param {google.maps.LatLng} latlng The position in latlng.\n * @return {google.maps.Point} The position in pixels.\n * @private\n */\nClusterIcon.prototype.getPosFromLatLng_ = function(latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n\n if (typeof this.iconAnchor_ === 'object' && this.iconAnchor_.length === 2) {\n pos.x -= this.iconAnchor_[0];\n pos.y -= this.iconAnchor_[1];\n } else {\n pos.x -= parseInt(this.width_ / 2, 10);\n pos.y -= parseInt(this.height_ / 2, 10);\n }\n return pos;\n};\n\n\n/**\n * Draw the icon.\n * @ignore\n */\nClusterIcon.prototype.draw = function() {\n if (this.visible_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.top = pos.y + 'px';\n this.div_.style.left = pos.x + 'px';\n }\n};\n\n\n/**\n * Hide the icon.\n */\nClusterIcon.prototype.hide = function() {\n if (this.div_) {\n this.div_.style.display = 'none';\n }\n this.visible_ = false;\n};\n\n\n/**\n * Position and show the icon.\n */\nClusterIcon.prototype.show = function() {\n if (this.div_) {\n var pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos, !!this.cssClass_);\n this.div_.style.display = '';\n }\n this.visible_ = true;\n};\n\n\n/**\n * Remove the icon from the map\n */\nClusterIcon.prototype.remove = function() {\n this.setMap(null);\n};\n\n\n/**\n * Implementation of the onRemove interface.\n * @ignore\n */\nClusterIcon.prototype.onRemove = function() {\n if (this.div_ && this.div_.parentNode) {\n this.hide();\n this.div_.parentNode.removeChild(this.div_);\n this.div_ = null;\n }\n};\n\n\n/**\n * Set the sums of the icon.\n *\n * @param {Object} sums The sums containing:\n * 'text': (string) The text to display in the icon.\n * 'index': (number) The style index of the icon.\n */\nClusterIcon.prototype.setSums = function(sums) {\n this.sums_ = sums;\n this.text_ = sums.text;\n this.index_ = sums.index;\n if (this.div_) {\n this.div_.innerHTML = sums.text;\n }\n\n this.useStyle();\n};\n\n\n/**\n * Sets the icon to the the styles.\n */\nClusterIcon.prototype.useStyle = function() {\n var index = Math.max(0, this.sums_.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n var style = this.styles_[index];\n this.url_ = style['url'];\n this.height_ = style['height'];\n this.width_ = style['width'];\n this.textColor_ = style['textColor'];\n this.anchor_ = style['anchor'];\n this.textSize_ = style['textSize'];\n this.backgroundPosition_ = style['backgroundPosition'];\n this.iconAnchor_ = style['iconAnchor'];\n};\n\n\n/**\n * Sets the center of the icon.\n *\n * @param {google.maps.LatLng} center The latlng to set as the center.\n */\nClusterIcon.prototype.setCenter = function(center) {\n this.center_ = center;\n};\n\n\n/**\n * Create the css text based on the position of the icon.\n *\n * @param {google.maps.Point} pos The position.\n * @param {bool} hasCssClass If a cssClass is supplied, discard inline styling\n * @return {string} The css style text.\n */\nClusterIcon.prototype.createCss = function(pos, hasCssClass) {\n if(hasCssClass) {\n return +\n 'top:' + pos.y + 'px;' +\n 'left:' + pos.x + 'px;' +\n 'cursor:pointer;' +\n 'position:absolute;';\n }\n\n var style = [];\n style.push('background-image:url(' + this.url_ + ');');\n var backgroundPosition = this.backgroundPosition_ ? this.backgroundPosition_ : '0 0';\n style.push('background-position:' + backgroundPosition + ';');\n\n if (typeof this.anchor_ === 'object') {\n if (typeof this.anchor_[0] === 'number' && this.anchor_[0] > 0 &&\n this.anchor_[0] < this.height_) {\n style.push('height:' + (this.height_ - this.anchor_[0]) +\n 'px; padding-top:' + this.anchor_[0] + 'px;');\n } else if (typeof this.anchor_[0] === 'number' && this.anchor_[0] < 0 &&\n -this.anchor_[0] < this.height_) {\n style.push('height:' + this.height_ + 'px; line-height:' + (this.height_ + this.anchor_[0]) +\n 'px;');\n } else {\n style.push('height:' + this.height_ + 'px; line-height:' + this.height_ +\n 'px;');\n }\n if (typeof this.anchor_[1] === 'number' && this.anchor_[1] > 0 &&\n this.anchor_[1] < this.width_) {\n style.push('width:' + (this.width_ - this.anchor_[1]) +\n 'px; padding-left:' + this.anchor_[1] + 'px;');\n } else {\n style.push('width:' + this.width_ + 'px; text-align:center;');\n }\n } else {\n style.push('height:' + this.height_ + 'px; line-height:' +\n this.height_ + 'px; width:' + this.width_ + 'px; text-align:center;');\n }\n\n var txtColor = this.textColor_ ? this.textColor_ : 'black';\n var txtSize = this.textSize_ ? this.textSize_ : 11;\n\n style.push('cursor:pointer; top:' + pos.y + 'px; left:' +\n pos.x + 'px; color:' + txtColor + '; position:absolute; font-size:' +\n txtSize + 'px; font-family:Arial,sans-serif; font-weight:bold');\n return style.join('');\n};\n\n\n// Export Symbols for Closure\n// If you are not going to compile with closure then you can remove the\n// code below.\nwindow['MarkerClusterer'] = MarkerClusterer;\nMarkerClusterer.prototype['addMarker'] = MarkerClusterer.prototype.addMarker;\nMarkerClusterer.prototype['addMarkers'] = MarkerClusterer.prototype.addMarkers;\nMarkerClusterer.prototype['clearMarkers'] =\n MarkerClusterer.prototype.clearMarkers;\nMarkerClusterer.prototype['fitMapToMarkers'] =\n MarkerClusterer.prototype.fitMapToMarkers;\nMarkerClusterer.prototype['getCalculator'] =\n MarkerClusterer.prototype.getCalculator;\nMarkerClusterer.prototype['getGridSize'] =\n MarkerClusterer.prototype.getGridSize;\nMarkerClusterer.prototype['getExtendedBounds'] =\n MarkerClusterer.prototype.getExtendedBounds;\nMarkerClusterer.prototype['getMap'] = MarkerClusterer.prototype.getMap;\nMarkerClusterer.prototype['getMarkers'] = MarkerClusterer.prototype.getMarkers;\nMarkerClusterer.prototype['getMaxZoom'] = MarkerClusterer.prototype.getMaxZoom;\nMarkerClusterer.prototype['getStyles'] = MarkerClusterer.prototype.getStyles;\nMarkerClusterer.prototype['getTotalClusters'] =\n MarkerClusterer.prototype.getTotalClusters;\nMarkerClusterer.prototype['getTotalMarkers'] =\n MarkerClusterer.prototype.getTotalMarkers;\nMarkerClusterer.prototype['redraw'] = MarkerClusterer.prototype.redraw;\nMarkerClusterer.prototype['removeMarker'] =\n MarkerClusterer.prototype.removeMarker;\nMarkerClusterer.prototype['removeMarkers'] =\n MarkerClusterer.prototype.removeMarkers;\nMarkerClusterer.prototype['resetViewport'] =\n MarkerClusterer.prototype.resetViewport;\nMarkerClusterer.prototype['repaint'] =\n MarkerClusterer.prototype.repaint;\nMarkerClusterer.prototype['setCalculator'] =\n MarkerClusterer.prototype.setCalculator;\nMarkerClusterer.prototype['setGridSize'] =\n MarkerClusterer.prototype.setGridSize;\nMarkerClusterer.prototype['setMaxZoom'] =\n MarkerClusterer.prototype.setMaxZoom;\nMarkerClusterer.prototype['onAdd'] = MarkerClusterer.prototype.onAdd;\nMarkerClusterer.prototype['draw'] = MarkerClusterer.prototype.draw;\n\nCluster.prototype['getCenter'] = Cluster.prototype.getCenter;\nCluster.prototype['getSize'] = Cluster.prototype.getSize;\nCluster.prototype['getMarkers'] = Cluster.prototype.getMarkers;\n\nClusterIcon.prototype['onAdd'] = ClusterIcon.prototype.onAdd;\nClusterIcon.prototype['draw'] = ClusterIcon.prototype.draw;\nClusterIcon.prototype['onRemove'] = ClusterIcon.prototype.onRemove;\n","import { markerclusterer } from \"vendor\";\nclass Map {\n constructor(elem) {\n this.elem = elem;\n this.holder = this.elem.find(\".map-holder\");\n\n this.markers = [];\n this.markerCluster;\n this.markerClusterOptions = {\n averageCenter: true,\n cssClass: \"cluster-Marker\",\n };\n this.latitude = 0;\n this.longitude = 0;\n this.zoom = 12;\n this.gmap = null;\n this.searchCircle;\n this.searchMarker;\n this.searchField = document.getElementById(\"ballast-map-search\");\n\n this.searchField?.addEventListener(\"input\", event => {\n document.querySelector(\".ballast-map__no-hits-text\").classList.remove(\"show-error-msg\");\n });\n\n if (\n window.hasOwnProperty(\"google\") &&\n window.google.hasOwnProperty(\"maps\")\n ) {\n this.createMap();\n } else {\n window.addEventListener(\n \"google-maps-loaded\",\n (e) => {\n this.createMap();\n },\n false\n );\n }\n }\n\n loadPosition() {\n let data = this.holder.data(\"position\");\n data = data.split(\",\");\n\n this.latitude = parseFloat(data[0]);\n if (isNaN(this.latitude)) {\n this.latitude = 60.1299555;\n }\n\n this.longitude = parseFloat(data[1]);\n if (isNaN(this.longitude)) {\n this.longitude = 17.2169883;\n }\n\n this.position = { lat: this.latitude, lng: this.longitude };\n\n if (data.length > 2) {\n this.zoom = parseFloat(data[2]);\n } else {\n this.zoom = 5.61;\n }\n }\n\n loadMarkerSource() {\n var _self = this;\n var source = this.holder.data(\"marker-source\");\n var dataArray;\n\n if (source.indexOf(\"http\") !== -1 || source[0] === \"/\") {\n let xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {\n dataArray = JSON.parse(xmlhttp.responseText);\n dataArray.forEach(function (data) {\n _self.createMarker(data);\n });\n\n _self.markerCluster = new MarkerClusterer(\n _self.gmap,\n _self.markers,\n _self.markerClusterOptions\n );\n }\n };\n xmlhttp.open(\"GET\", this.holder.data(\"marker-source\"), true);\n xmlhttp.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xmlhttp.send();\n } else {\n dataArray = source;\n window.addEventListener(\"load\", function () {\n dataArray.forEach(function (data) {\n _self.createMarker(data);\n });\n\n _self.markerCluster = new MarkerClusterer(\n _self.gmap,\n _self.markers,\n _self.markerClusterOptions\n );\n });\n }\n }\n\n createMarkerIcon(pinColor = \"#18173c\") {\n var pinSVGHole =\n \"M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z\";\n var labelOriginFilled = new google.maps.Point(12, 9);\n\n // https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerLabel\n return {\n path: pinSVGHole,\n anchor: new google.maps.Point(12, 17),\n fillOpacity: 1,\n fillColor: pinColor,\n strokeWeight: 2,\n strokeColor: \"#ffffff\",\n scale: 2,\n labelOrigin: labelOriginFilled,\n };\n }\n\n createMarker(data) {\n var marker = new google.maps.Marker({\n position: data,\n title: this.holder.data(\"title\"),\n icon: this.createMarkerIcon(\"#0606cc\"),\n });\n if (data.content)\n marker.infowindow = new google.maps.InfoWindow({\n content: data.content,\n });\n marker.addListener(\"click\", () => this.onMarkerClicked(marker));\n\n this.markers.push(marker);\n }\n\n geocodeAddress(geocoder, distance) {\n var _self = this;\n var countryCode = _self.holder.data(\"postal-country-code\");\n var searchField = $(\"#ballast-map-search\");\n var address = searchField.val();\n\n geocoder.geocode(\n { address, componentRestrictions: { country: countryCode } },\n function (results, status) {\n if (status === \"OK\") {\n if (results[0].address_components.length > 1) {\n _self.updateMap(results[0].geometry.location, distance);\n } else {\n document.querySelector(\".ballast-map__no-hits-text\").classList.add(\"show-error-msg\");\n }\n } else {\n console.error(\n \"Geocode was not successful for the following reason: \" + status\n );\n }\n }\n );\n }\n\n updateMap(center, selectedDistance) {\n var circleOptions = {\n center: center,\n fillOpacity: 0,\n strokeOpacity: 0,\n map: this.gmap,\n radius: selectedDistance * 1000000,\n };\n var reducedMarkers = this.reduceMarkers(center, circleOptions.radius);\n var _self = this;\n\n // Clear previous circle/red marker\n if (typeof this.searchCircle !== \"undefined\") {\n this.searchCircle.setMap(null);\n this.searchMarker.setMap(null);\n }\n\n // Clear previous markerCluster (the blue markers)\n this.markerCluster.clearMarkers();\n\n this.gmap.setCenter(center);\n this.gmap.setZoom(this.getZoom(selectedDistance));\n\n this.searchMarker = new google.maps.Marker({\n map: this.gmap,\n position: center,\n icon: this.createMarkerIcon(),\n animation: google.maps.Animation.DROP,\n });\n this.searchCircle = new google.maps.Circle(circleOptions);\n\n // Make sure new clusters is rendered after zoom animation\n setTimeout(function () {\n _self.markerCluster = new MarkerClusterer(\n _self.gmap,\n reducedMarkers,\n _self.markerClusterOptions\n );\n }, 800);\n }\n\n reduceMarkers(searchLocation, searchDistance) {\n return this.markers.filter(function (m) {\n var markerLocation = new google.maps.LatLng(\n m.position.lat(),\n m.position.lng()\n );\n var distanceBetween =\n google.maps.geometry.spherical.computeDistanceBetween(\n markerLocation,\n searchLocation\n );\n\n return distanceBetween <= searchDistance;\n });\n }\n\n currentPosition(map, distance) {\n var _self = this;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n function (position) {\n var pos = new google.maps.LatLng(\n position.coords.latitude,\n position.coords.longitude\n );\n\n _self.updateMap(pos, distance);\n },\n function (error) {\n // Browser has Geolocation.\n console.error(\"The Geolocation service failed. Error:\", error);\n }\n );\n } else {\n // Browser doesn't support Geolocation\n console.error(\"Your browser doesn't support geolocation.\");\n }\n }\n\n createMap() {\n if (this.holder.data(\"position\")) {\n this.loadPosition();\n }\n\n this.gmap = new google.maps.Map(this.holder[0], {\n center: this.position,\n scrollwheel: false,\n zoom: this.zoom,\n });\n\n if (this.holder.data(\"marker-source\")) {\n this.loadMarkerSource();\n } else {\n this.createMarker(this.position);\n }\n\n $(window).on(\"refresh-map\", () => this.refreshMap());\n\n const submitButton = document.getElementById(\"map-submit\");\n const ballastMapSearch = document.getElementById(\"ballast-map-search\");\n const mapGeolocation = document.getElementById(\"map-geolocation\");\n\n if (submitButton) {\n submitButton.addEventListener(\"click\", (event) => {\n this.searchCity(event);\n });\n }\n\n if (ballastMapSearch) {\n // Enter-key keypress\n ballastMapSearch.addEventListener(\"keyup\", (event) => {\n if (event.keyCode === 13) {\n this.searchCity(event);\n }\n });\n }\n\n if (mapGeolocation) {\n mapGeolocation.addEventListener(\"click\", (event) => {\n var distance = $(\".selected-distance\").text().split(\" \").shift();\n this.currentPosition(this.gmap, distance);\n });\n }\n }\n\n searchCity(event) {\n // old way of getting distance\n var distance = $(\".selected-distance\").text().split(\" \").shift();\n\n if (!distance) {\n // if no result, try new way of getting distance\n try {\n distance = $(\".combobox--select > select\").val();\n } catch (e) {\n console.error(\"Missing distance field.\");\n console.log(\"error: \", e);\n }\n }\n var geocoder = new google.maps.Geocoder();\n\n event.preventDefault();\n this.geocodeAddress(geocoder, distance);\n }\n\n refreshMap() {\n console.log(\"refreshmap \" + this.gmap);\n google.maps.event.trigger(this.gmap, \"resize\");\n this.gmap.setZoom(this.gmap.getZoom());\n this.gmap.setCenter(this.position);\n }\n\n onMarkerClicked(marker) {\n if (marker.infowindow) {\n marker.infowindow.open(this.gmap, marker);\n }\n }\n\n getZoom(distance) {\n switch (distance) {\n case \"10\":\n return 11.4;\n\n case \"50\":\n return 9;\n\n case \"100\":\n return 8;\n\n case \"200\":\n return 7;\n\n default:\n return 9;\n }\n }\n}\n\nexport default Map;\n","window.$ = $;\n\nexport { default as markerclusterer } from \"./vendors/js-marker-clusterer/src/markerclusterer\";\n"],"names":["markerclusterer","Map","constructor","elem","holder","find","markers","markerCluster","markerClusterOptions","averageCenter","cssClass","latitude","longitude","zoom","gmap","searchCircle","searchMarker","searchField","document","getElementById","addEventListener","event","querySelector","classList","remove","window","hasOwnProperty","google","createMap","e","loadPosition","data","split","parseFloat","isNaN","position","lat","lng","length","loadMarkerSource","_self","source","dataArray","indexOf","xmlhttp","XMLHttpRequest","onreadystatechange","readyState","status","JSON","parse","responseText","forEach","createMarker","MarkerClusterer","open","setRequestHeader","send","createMarkerIcon","pinColor","arguments","undefined","pinSVGHole","labelOriginFilled","maps","Point","path","anchor","fillOpacity","fillColor","strokeWeight","strokeColor","scale","labelOrigin","marker","Marker","title","icon","content","infowindow","InfoWindow","addListener","onMarkerClicked","push","geocodeAddress","geocoder","distance","countryCode","$","address","val","geocode","componentRestrictions","country","results","address_components","updateMap","geometry","location","add","console","error","center","selectedDistance","circleOptions","strokeOpacity","map","radius","reducedMarkers","reduceMarkers","setMap","clearMarkers","setCenter","setZoom","getZoom","animation","Animation","DROP","Circle","setTimeout","searchLocation","searchDistance","filter","m","markerLocation","LatLng","distanceBetween","spherical","computeDistanceBetween","currentPosition","navigator","geolocation","getCurrentPosition","pos","coords","scrollwheel","on","refreshMap","submitButton","ballastMapSearch","mapGeolocation","searchCity","keyCode","text","shift","log","Geocoder","preventDefault","trigger","default"],"sourceRoot":""}