Maps API v3 Infowindows with multiple markers
http://stackoverflow.com/questions/24803074
by whelkaholism
HTML
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<div id="map"></div>
CSS
html, body, #map {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
}
JavaScript
// Generated by CoffeeScript 1.12.2
/** @preserve OverlappingMarkerSpiderfier
https://github.com/jawj/OverlappingMarkerSpiderfier
Copyright (c) 2011 - 2017 George MacKerron
Released under the MIT licence: http://opensource.org/licenses/mit-license
Note: The Google Maps API v3 must be included *before* this code
*/
(function() {
var callbackName, callbackRegEx, ref, ref1, scriptTag, tag,
hasProp = {}.hasOwnProperty,
slice = [].slice;
this['OverlappingMarkerSpiderfier'] = (function() {
var ge, gm, j, len, mt, p, ref, twoPi, x;
p = _Class.prototype;
ref = [_Class, p];
for (j = 0, len = ref.length; j < len; j++) {
x = ref[j];
x['VERSION'] = '1.0.3';
}
twoPi = Math.PI * 2;
gm = ge = mt = null;
_Class['markerStatus'] = {
'SPIDERFIED': 'SPIDERFIED',
'SPIDERFIABLE': 'SPIDERFIABLE',
'UNSPIDERFIABLE': 'UNSPIDERFIABLE',
'UNSPIDERFIED': 'UNSPIDERFIED'
};
function _Class(map1, opts) {
var k, lcH, lcU, v;
this.map = map1;
if (opts == null) {
opts = {};
}
if (this.constructor.hasInitialized == null) {
this.constructor.hasInitialized = true;
gm = google.maps;
ge = gm.event;
mt = gm.MapTypeId;
p['keepSpiderfied'] = false;
p['ignoreMapClick'] = false;
p['markersWontHide'] = false;
p['markersWontMove'] = false;
p['basicFormatEvents'] = false;
p['nearbyDistance'] = 20;
p['circleSpiralSwitchover'] = 9;
p['circleFootSeparation'] = 23;
p['circleStartAngle'] = twoPi / 12;
p['spiralFootSeparation'] = 26;
p['spiralLengthStart'] = 11;
p['spiralLengthFactor'] = 4;
p['spiderfiedZIndex'] = gm.Marker.MAX_ZINDEX + 20000;
...