T7PYIKMMBUPUPACRCKK2PHFG5MCCPWUBOHCCXBKCEJAVDTFPTNTAC
2PT2BUCYHLSQS23A2XLCMCCAZEHVQOOU4P3QJJJZQIYII7VFU2YAC
A23ZNGP6PWGE3S7U67L3S7EQBO3K5WLEMVAYM5JHDEO6MXHEDZRAC
TOLGMXUXRC74FQHKSAFLRNEG44GPLBMORKRDPU35EB2F424AN5QAC
ZRQFW3UNHIZLLXHXHK4EHVK74IN7RRGASB4WKYJAS2FJA5EHA2XAC
G475G2KUDACOYKXN4FSMA7LQBMVIV6QEPYYAGBXQGWLYX3YJDZTAC
6KFVCGKKXDPZMNUP6ZN6M7MJQ25PDER42VV5FAY45OHJZWO4VEMQC
LJWOKWMFBXKZJ3TSNWBMD6SCJW7EEOTXQ3XBZIBUL55CEWYV2F7QC
5TZPO2XG4EGASWQOWU6O26A63546YUJRR2MPXP5QCSRIJYZ3AYTAC
NLSNNB46NE4J26V72TP27OHEZFUFG5REZ5N72FDWDNB5K4TAZQIAC
QX7XVNQYOTBDULUCLFRGSATHL7KWBSEV6QWNFY353S7ZIR6UGJWQC
L4VSLVPDOQ734IXKARXBB4KTXPNLACCHF5EE3VGYKHUVXJICQKTQC
SSNV5W4QCVZ36VRU3F7UFIUHKN35MV2QWUWS67WTLKPTVTIBXVFAC
6Q2LBYYTS5Z67TKMOMJRBRST5UIOW3CGRSDGCDQBO3F3DNNPVGIQC
MCPXLE6LIQRLQA2OBQSVIH4O3HAEZZWKPQMEDERPBHN6IVOAVXVAC
7CRKZALXJV7SBMSXU44VATIRC6XBWNRVDZISX3XKGJAZNXUZOBKAC
{
"201806121D0001.jpg": {
"title": "Album 1 - London",
"description": "Eine kurze Beschreibung für Foto 1",
"counter": 15,
"lat": 7.8309249,
"lng": 98.0790568
},
"test.jpg": {
"title": "Album 2 - Wels",
"description": "Eine kurze Beschreibung für Foto 2",
"counter": 200,
"lat": 47.46222222222222,
"lng": 9.633055555555556
},
"test2.jpg": {
"title": "Album 3 - Maratonlauf",
"description": "Eine kurze Beschreibung für Foto 3",
"counter": 23,
"lat": 48.61739166666667,
"lng": 15.202711666666668
},
"test3.jpg": {
"title": "Album 4 - Freizeit",
"description": "Eine kurze Beschreibung für Foto 4",
"counter": 13,
"lat": 55.88805555555555,
"lng": -4.241666666666667
}
}
"preview": "/webfotos/fbtemp2/media/small/Scotland/Bridges/test3.jpg",
"preview": "/webfotos/fbtemp2/media/small/Scotland/Bridges/test2.jpg",
"preview": "/webfotos/fbtemp2/media/small/Scotland/Bridges/test.jpg",
"preview": "/webfotos/fbtemp2/media/small/Scotland/Bridges/201806121D0001.jpg",
{"rows":[{"lat":46.1525,"lng":8.773889,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1978 Ascona/19780708-000000-0478.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1978 Ascona/19780708-000000-0478.jpg","link":"1978-Ascona.html","video":false,"album":"1978 Ascona","caption":"1978 Ascona","description":""},{"lat":25.741111,"lng":-80.226111,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/19800702-000000-0505.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/19800702-000000-0505.jpg","link":"1980-Florida.html","video":false,"album":"1980 Florida","caption":"1980 Florida","description":""},{"lat":28.399167,"lng":-80.605278,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Cape Canaveral/19800730-110000-0506.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Cape Canaveral/19800730-110000-0506.jpg","link":"1980-Florida/Cape-Canaveral.html","video":false,"album":"1980 Florida/Cape Canaveral","caption":"1980 Florida/Cape Canaveral","description":""},{"lat":25.377778,"lng":-80.882778,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Everglades/19800725-083259-0546.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Everglades/19800725-083259-0546.jpg","link":"1980-Florida/Everglades.html","video":false,"album":"1980 Florida/Everglades","caption":"1980 Florida/Everglades","description":""},{"lat":47.452222,"lng":8.560556,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Miami Beach/19800712-120000-0605.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Miami Beach/19800712-120000-0605.jpg","link":"1980-Florida/Miami-Beach.html","video":false,"album":"1980 Florida/Miami Beach","caption":"1980 Florida/Miami Beach","description":""},{"lat":25.786667,"lng":-80.174444,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Miami Jungle Island/19800729-083259-0716.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Miami Jungle Island/19800729-083259-0716.jpg","link":"1980-Florida/Miami-Jungle-Island.html","video":false,"album":"1980 Florida/Miami Jungle Island","caption":"1980 Florida/Miami Jungle Island","description":""},{"lat":28.415278,"lng":-81.574444,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Orlando/19800728-083259-0801.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1980 Florida/Orlando/19800728-083259-0801.jpg","link":"1980-Florida/Orlando.html","video":false,"album":"1980 Florida/Orlando","caption":"1980 Florida/Orlando","description":""},{"lat":41.865556,"lng":12.435,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1985 Rom/19850601-000000-0874.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1985 Rom/19850601-000000-0874.jpg","link":"1985-Rom.html","video":false,"album":"1985 Rom","caption":"1985 Rom","description":""},{"lat":39.228611,"lng":26.286667,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1987 Griechenland/19870707-000000-15012.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1987 Griechenland/19870707-000000-15012.jpg","link":"1987-Griechenland.html","video":false,"album":"1987 Griechenland","caption":"1987 Griechenland","description":""},{"lat":24.527778,"lng":-75.514444,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/1988 Bahamas/19880702-000000-0988.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/1988 Bahamas/19880702-000000-0988.jpg","link":"1988-Bahamas.html","video":false,"album":"1988 Bahamas","caption":"1988 Bahamas","description":""},{"lat":38.7775,"lng":16.563611,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2000 Kalabrien/20000702-000000-1007.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2000 Kalabrien/20000702-000000-1007.jpg","link":"2000-Kalabrien.html","video":false,"album":"2000 Kalabrien","caption":"2000 Kalabrien","description":""},{"lat":47.415556,"lng":9.738056,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2001 Amateurfunk/20010917-190327-1050.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2001 Amateurfunk/20010917-190327-1050.jpg","link":"2001-Amateurfunk.html","video":false,"album":"2001 Amateurfunk","caption":"2001 Amateurfunk","description":""},{"lat":27.328056,"lng":33.701667,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2001 Rotes Meer Hurgada/20010209-000000-1080.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2001 Rotes Meer Hurgada/20010209-000000-1080.jpg","link":"2001-Rotes-Meer-Hurgada.html","video":false,"album":"2001 Rotes Meer Hurgada","caption":"2001 Rotes Meer Hurgada","description":""},{"lat":36.435,"lng":10.671667,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2001 Tunesien/20010703-000000-1114.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2001 Tunesien/20010703-000000-1114.jpg","link":"2001-Tunesien.html","video":false,"album":"2001 Tunesien","caption":"2001 Tunesien","description":""},{"lat":27.918056,"lng":34.331667,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2003 Sinai Sharm El Sheikh/20030105-000000-1125.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2003 Sinai Sharm El Sheikh/20030105-000000-1125.jpg","link":"2003-Sinai-Sharm-El-Sheikh.html","video":false,"album":"2003 Sinai Sharm El Sheikh","caption":"2003 Sinai Sharm El Sheikh","description":""},{"lat":38.341111,"lng":0.493056,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2006 Alicante/20061031-000000-1180.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2006 Alicante/20061031-000000-1180.jpg","link":"2006-Alicante.html","video":false,"album":"2006 Alicante","caption":"2006 Alicante","description":""},{"lat":35.3025,"lng":25.485556,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2006 Kreta/20060710-000000-1203.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2006 Kreta/20060710-000000-1203.jpg","link":"2006-Kreta.html","video":false,"album":"2006 Kreta","caption":"2006 Kreta","description":""},{"lat":39.7075,"lng":3.458056,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2007 Cala Ratjada/20070518-000000-1330.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2007 Cala Ratjada/20070518-000000-1330.jpg","link":"2007-Cala-Ratjada.html","video":false,"album":"2007 Cala Ratjada","caption":"2007 Cala Ratjada","description":""},{"lat":47.457919,"lng":9.638106,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2009 Bikes/20090601-000000-1410.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2009 Bikes/20090601-000000-1410.jpg","link":"2009-Bikes.html","video":false,"album":"2009 Bikes","caption":"2009 Bikes","description":""},{"lat":36.910556,"lng":27.272778,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2009 Kos Lambi/20090819-000000-1592.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2009 Kos Lambi/20090819-000000-1592.jpg","link":"2009-Kos-Lambi.html","video":false,"album":"2009 Kos Lambi","caption":"2009 Kos Lambi","description":""},{"lat":27.873611,"lng":34.319167,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2009 Sinai Sharm El Sheikh/20090404-000000-1605.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2009 Sinai Sharm El Sheikh/20090404-000000-1605.jpg","link":"2009-Sinai-Sharm-El-Sheikh.html","video":false,"album":"2009 Sinai Sharm El Sheikh","caption":"2009 Sinai Sharm El Sheikh","description":""},{"lat":38.343056,"lng":0.493056,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2010 Alicante/20101026-000000-1687.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2010 Alicante/20101026-000000-1687.jpg","link":"2010-Alicante.html","video":false,"album":"2010 Alicante","caption":"2010 Alicante","description":""},{"lat":39.712222,"lng":3.468056,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2011 Cala Radjada/20110821-000000-1861.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2011 Cala Radjada/20110821-000000-1861.jpg","link":"2011-Cala-Radjada.html","video":false,"album":"2011 Cala Radjada","caption":"2011 Cala Radjada","description":""},{"lat":25.004722,"lng":54.994167,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2012 Dubai/20120522-000000-1900.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2012 Dubai/20120522-000000-1900.jpg","link":"2012-Dubai.html","video":false,"album":"2012 Dubai","caption":"2012 Dubai","description":""},{"lat":23.174444,"lng":-81.226389,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2015 Kuba/Varadero/20151205-000000-5122.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2015 Kuba/Varadero/20151205-000000-5122.jpg","link":"2015-Kuba/Varadero.html","video":false,"album":"2015 Kuba/Varadero","caption":"2015 Kuba/Varadero","description":""},{"lat":27.746998,"lng":-15.5746,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2018 Gran Canaria/Las Dunas/20180618-103446-12670.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2018 Gran Canaria/Las Dunas/20180618-103446-12670.jpg","link":"2018-Gran-Canaria/Las-Dunas.html","video":false,"album":"2018 Gran Canaria/Las Dunas","caption":"2018 Gran Canaria/Las Dunas","description":""},{"lat":27.93703,"lng":-15.390982,"thumbnail":"'http://webapps.lab.dev/webfotos/fotobuch/media/small/2018 Gran Canaria/Maspalomas/20180617-180151-12827.jpg'","url":"http://webapps.lab.dev/webfotos/fotobuch/media/small/2018 Gran Canaria/Maspalomas/20180617-180151-12827.jpg","link":"2018-Gran-Canaria/Maspalomas.html","video":false,"album":"2018 Gran Canaria/Maspalomas","caption":"2018 Gran Canaria/Maspalomas","description":""}],"time":"","fields":{"lat":{"type":"number","pgtype":"float8"},"lng":{"type":"number","pgtype":"float8"},"thumbnail":{"type":"string","pgtype":"text"},"url":{"type":"string","pgtype":"text"},"video":{"type":"string","pgtype":"text"},"caption":{"type":"string","pgtype":"text"}},"total_rows":157,"autor":"Peter Siebler","version":"1.0.0"}
/**
*
*
*/
const Database = require('better-sqlite3'),
path = require('path'),
fs = require('fs-extra'),
settings = {
"database": "/Users/petsie1612/ips_apps/webfotos/fotobuch/thumbsup.db",
"sql": "SELECT * FROM files ORDER BY path",
"options": {},
"autor": "Peter Siebler",
"version": "1.0.0",
"start": new Date(),
"file": './mapdata.json',
"web": {
"images": "http://webapps.lab.dev/webfotos/fotobuch/media/small/",
"baseurl": ""
}
},
db = new Database(settings.database, settings.options),
stmt = db.prepare(settings.sql)
var gpsData = {
"rows": [],
"time": "",
"fields": {
"lat": {
"type": "number",
"pgtype": "float8"
},
"lng": {
"type": "number",
"pgtype": "float8"
},
"thumbnail": {
"type": "string",
"pgtype": "text"
},
"url": {
"type": "string",
"pgtype": "text"
},
"video": {
"type": "string",
"pgtype": "text"
},
"caption": {
"type": "string",
"pgtype": "text"
}
},
"total_rows": 0,
"autor": settings.autor,
"version": settings.version
};
/**
* simple slug url
* @param {*} url
*/
function getPageUrl(url) {
return url.toString()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
/**
* add gps data record
* @param {*} d
*/
function addGPSData(d) {
if (d.EXIF && d.EXIF.GPSLatitude && d.EXIF.GPSLongitude) {
var item = {};
item.lat = d.EXIF.GPSLatitude * ((d.EXIF.GPSLatitudeRef === "S" || d.EXIF.GPSLatitudeRef === "South") ? -1 : 1);
item.lng = d.EXIF.GPSLongitude * ((d.EXIF.GPSLongitudeRef === "W" || d.EXIF.GPSLongitudeRef === "West") ? -1 : 1);
item.thumbnail = "'" + settings.web.images + d.SourceFile + "'";
item.url = settings.web.images + d.SourceFile;
item.link = getPageUrl(settings.web.baseurl + d.File.Directory + ".html")
item.video = false
item.album = d.File.Directory
item.caption = d.EXIF.caption || d.File.Directory
item.description = d.EXIF.Description || ''
gpsData.rows.push(item)
gpsData.total_rows++;
console.log(' - ', d.File.Directory)
}
}
/**
* get the data rows for the gps data
*/
function getGPSData() {
var group = ""
console.log('✔︎ Start generate ', settings.file)
for (const fotos of stmt.iterate()) {
const d = JSON.parse(fotos.metadata)
if (group == d.File.Directory) {
// skip this ...
} else {
addGPSData(d)
gpsData.total_rows++;
group = d.File.Directory
}
}
if (gpsData.total_rows) {
var content = JSON.stringify(gpsData)
gpsData.time = (new Date() - settings.start) / 1000;
fs.mkdirsSync(path.dirname(settings.file))
fs.writeFileSync(settings.file, content)
console.log('✔︎ End generate ', gpsData.time, "sec,", gpsData.total_rows, "records, File", settings.file)
}
}
getGPSData()
#PHOTOS ON MAP Testcase
---
![FOTOS ON MAP](../../docs/testcase_map.png)
## Usage
```bash
## run tumbsup locally and build the gallery
> node_modules/thumbsup/bin/thumbsup.js --config config.json
## create the gps data for the map
> cd theme-cards-flow/tools/gps
> node index.js
```
##FILES
GPSPhotos.html, simple testcase with markers
GPSLocations.html, testcase with cluster layer
---
**Additional Informations**
http://mapbbcode.org/toc.html
http://share.mapbbcode.org
http://mapbbcode.org/leaflet.html
<!DOCTYPE html>
<html>
<!--http://webapps.lab.dev/webfotos/theme-cards-flow/tools/gps/GPSPhotos.html -->
<head>
<title>Meine Urlaubsfotos</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:image" content="route.png" />
<link rel="stylesheet" href="../../theme/public/leaflet/leaflet.css" />
<link rel="stylesheet" href="../../theme/public/leaflet/markercluster/MarkerCluster.css" />
<link rel="stylesheet" href="../../theme/public/leaflet/photo/Leaflet.Photo.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet-easybutton@2/src/easy-button.css">
<style>
html {
/* 1 */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 16px;
font-weight: normal;
line-height: 1.5;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 3 */
background: #fff;
color: #666;
}
html,
body,
#map {
margin: 0;
padding: 0;
height: 100%;
background: #fff;
}
#map {
width: 100%;
height: 100%;
}
/* photo/video popup */
.leaflet-popup-photo a.leaflet-popup-close-button {
top: -13px;
right: -13px;
background-color: #fff;
padding: 5px;
border-radius: 12px;
width: 15px;
height: 15px;
box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
color: #555;
}
.leaflet-popup-photo a.leaflet-popup-close-button:hover {
color: #333;
background-color: #eee;
}
.leaflet-popup-photo .leaflet-popup-content-wrapper {
padding: 6px;
border-radius: 4px;
}
.leaflet-popup-photo .leaflet-popup-content {
margin: 0;
}
.leaflet-popup-photo .leaflet-popup-tip {
background: white;
}
.leaflet-popup-photo img,
.leaflet-popup-photo video {
display: block;
width: 100%;
}
.leaflet-popup-photo p {
margin: 5px 0 0 0;
}
.navibar {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: #fafafa;
cursor: default;
border-bottom: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.35);
width: 100%;
padding: 0;
font-size: 1.6em;
z-index: 2000;
height: 56px;
line-height: 2em;
transition: height 0.3s linear 0s, padding 0.3s linear 0s;
transition: box-shadow 250ms;
}
.navibar img {
position: relative;
top: 10px;
left: 18px;
object-fit: cover;
width: 32px;
height: 32px;
border-radius: 4px;
}
.navibar h1 {
position: absolute;
left: 0;
top: 2px;
width: 100%;
font-size: 1.2em;
font-weight: 400;
display: block;
margin: 0;
padding: 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: center;
}
body>div.container {
position: fixed;
top: 54px;
bottom: 32px;
right: 0;
left: 0;
vertical-align: top;
}
footer {
position: fixed;
height: 24px;
bottom: 0;
right: 0;
left: 0;
padding: 8px;
text-align: center;
background-color: #555;
color: #fff;
}
</style>
</head>
<body>
<header class="navibar">
<img id="logo" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAfe0lEQVR4Xu2dCbTO1frHP68TESGSMZUiGSpFpZQpQxMhUYbmuTR3/033uldpHjTcBlFJRTJFpGgQypTmEiU3MjQaI5z3v77tzsJx3vP+hv37nfecs5+1rNbq7N/ez372993DMybwQ/cly7KVqiRpQIJ2QBMS1AUqAKWBhJ/uXFsngb8lkCTJZmAtsAhYQIKpbOFztrGK/on1XiXlDYBXJXenOmeToCsJDidJDRKU8DqIa+ckEEAC2cBKEnxMNuP5hRe5P7EhXT/pAX1HsilZvEaC6uk6c393EohMAklWso1u3JaYld8YqQE9MFkF6EcJrgD2ioxR17GTgFcJJFlLkidJ8iC3Jlbl9VnegL4nWYskQ4E2QJbX8Vw7J4EYJLCNJNqlz+XmxHe5x9sV0Hcka5LFcBK0ioE5N4STQDAJJJjJFs7itsQPO3awM6B1zUg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lkOQZPQpVPnMMUKKITtNNq3hIQMqNcxIMSB5ISaYDNYrHvN0si6gEVgPtE/RPlqMMI0lychGdqJtW8ZDAdDbR2eif70peTIKnise83SyLpASyuZZbEg8bQN+QLEtlFpPAUhmgIikyN6lMlUCS1WzmQPon1m+3EN6RPJYsJpOgfKby7fhyEshDAuvYRjduTbylv+1s8h6YvIcSXA/kkU3DCdNJIOMkkE02T7CAqxmV2LYroO9MVqUEo0hwfMax7hhyEthVAvPZSmduSyzP+dOuTkl3JetQgmEknfXQISiDJZBkLln04qbEoh25zNvL7o7kvmQxnAQtnMElgxe1eLKWTRLtzGdxe2KXvLWp3UbvTVZjGzeR4HygQvGUnZt1hklgHdkMI5u7drxmpN+hc1p0T2bRhBYkGOFUehm2tMWNHanmsunNx7yd8wDMSwTeHPv7J0tTmguAbiRpQIIq7ipS3BAV+3zlm/Ez8DXZjOVPnpGeOR0X3gCd08vdyQpsYz9K0JgkLf/6L9QhSXkS7O4iX9KJ2/09hQSSJFE+2rUkWEI2n5HFeyT5lE0spX/id6+S+3/TEh+zx6AfkAAAAABJRU5ErkJggg=="
title="Peter's Fotobuch">
<h1>Fotobuch Peter Siebler</h1>
</header>
<div class="container">
<div id="map"></div>
</div>
<footer>
<small>Testcase Fotos on Maps</small>
</footer>
<script src="../../theme/public/leaflet/photo/reqwest.min.js"></script>
<script src="../../theme/public/leaflet/leaflet.js"></script>
<script src="../../theme/public/leaflet/TileLayer.Grayscale.js"></script>
<script src="../../theme/public/leaflet/markercluster/leaflet.markercluster.js"></script>
<script src="../../theme/public/leaflet/photo/Leaflet.Photo.js"></script>
<script src="https://cdn.jsdelivr.net/npm/leaflet-easybutton@2/src/easy-button.js"></script>
<script>
const map = L.map('map', {
maxBounds: [
[-90, -Infinity],
[90, Infinity],
],
zoomControl: true,
scrollWheelZoom: false,
worldCopyJump: true
}).setView([40, 0], 3);
L.tileLayer.grayscale('http://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="http://openstreetmap.org/">OpenStreetMap</a> contributors',
maxZoom: 14,
minZoom: 2
}).addTo(map);
L.easyButton('<img src="home.png" with="15" height="15">', function(btn, map) {
map.setView([20, 0], 3);
}).addTo(map);
var photoLayer = L.photo.cluster().on('click', function(evt) {
var photo = evt.layer.photo,
template = '<img src="{url}" width="320" height="180" /></a><p>{album}</p>';
if (photo.video && (!!document.createElement('video').canPlayType('video/mp4; codecs=avc1.42E01E,mp4a.40.2'))) {
template = '<video autoplay controls poster="{url}" width="300" height="300"><source src="{video}" type="video/mp4"/></video>';
};
evt.layer.bindPopup(L.Util.template(template, photo), {
className: 'leaflet-popup-photo',
minWidth: 240
}).openPopup();
});
reqwest({
url: 'mapdata.json',
success: function(data) {
photoLayer.add(data.rows).addTo(map);
map.fitBounds(photoLayer.getBounds());
}
});
</script>
</body>
</html>
/*!
* Reqwest! A general purpose XHR connection manager
* license MIT (c) Dustin Diaz 2014
* https://github.com/ded/reqwest
*/
!function(e,t,n){typeof module!="undefined"&&module.exports?module.exports=n():typeof define=="function"&&define.amd?define(n):t[e]=n()}("reqwest",this,function(){function handleReadyState(e,t,n){return function(){if(e._aborted)return n(e.request);e.request&&e.request[readyState]==4&&(e.request.onreadystatechange=noop,twoHundo.test(e.request.status)?t(e.request):n(e.request))}}function setHeaders(e,t){var n=t.headers||{},r;n.Accept=n.Accept||defaultHeaders.accept[t.type]||defaultHeaders.accept["*"],!t.crossOrigin&&!n[requestedWith]&&(n[requestedWith]=defaultHeaders.requestedWith),n[contentType]||(n[contentType]=t.contentType||defaultHeaders.contentType);for(r in n)n.hasOwnProperty(r)&&"setRequestHeader"in e&&e.setRequestHeader(r,n[r])}function setCredentials(e,t){typeof t.withCredentials!="undefined"&&typeof e.withCredentials!="undefined"&&(e.withCredentials=!!t.withCredentials)}function generalCallback(e){lastValue=e}function urlappend(e,t){return e+(/\?/.test(e)?"&":"?")+t}function handleJsonp(e,t,n,r){var i=uniqid++,s=e.jsonpCallback||"callback",o=e.jsonpCallbackName||reqwest.getcallbackPrefix(i),u=new RegExp("((^|\\?|&)"+s+")=([^&]+)"),a=r.match(u),f=doc.createElement("script"),l=0,c=navigator.userAgent.indexOf("MSIE 10.0")!==-1;return a?a[3]==="?"?r=r.replace(u,"$1="+o):o=a[3]:r=urlappend(r,s+"="+o),win[o]=generalCallback,f.type="text/javascript",f.src=r,f.async=!0,typeof f.onreadystatechange!="undefined"&&!c&&(f.htmlFor=f.id="_reqwest_"+i),f.onload=f.onreadystatechange=function(){if(f[readyState]&&f[readyState]!=="complete"&&f[readyState]!=="loaded"||l)return!1;f.onload=f.onreadystatechange=null,f.onclick&&f.onclick(),t(lastValue),lastValue=undefined,head.removeChild(f),l=1},head.appendChild(f),{abort:function(){f.onload=f.onreadystatechange=null,n({},"Request is aborted: timeout",{}),lastValue=undefined,head.removeChild(f),l=1}}}function getRequest(e,t){var n=this.o,r=(n.method||"GET").toUpperCase(),i=typeof n=="string"?n:n.url,s=n.processData!==!1&&n.data&&typeof n.data!="string"?reqwest.toQueryString(n.data):n.data||null,o,u=!1;return(n["type"]=="jsonp"||r=="GET")&&s&&(i=urlappend(i,s),s=null),n["type"]=="jsonp"?handleJsonp(n,e,t,i):(o=n.xhr&&n.xhr(n)||xhr(n),o.open(r,i,n.async===!1?!1:!0),setHeaders(o,n),setCredentials(o,n),win[xDomainRequest]&&o instanceof win[xDomainRequest]?(o.onload=e,o.onerror=t,o.onprogress=function(){},u=!0):o.onreadystatechange=handleReadyState(this,e,t),n.before&&n.before(o),u?setTimeout(function(){o.send(s)},200):o.send(s),o)}function Reqwest(e,t){this.o=e,this.fn=t,init.apply(this,arguments)}function setType(e){if(e.match("json"))return"json";if(e.match("javascript"))return"js";if(e.match("text"))return"html";if(e.match("xml"))return"xml"}function init(o,fn){function complete(e){o.timeout&&clearTimeout(self.timeout),self.timeout=null;while(self._completeHandlers.length>0)self._completeHandlers.shift()(e)}function success(resp){var type=o.type||setType(resp.getResponseHeader("Content-Type"));resp=type!=="jsonp"?self.request:resp;var filteredResponse=globalSetupOptions.dataFilter(resp.responseText,type),r=filteredResponse;try{resp.responseText=r}catch(e){}if(r)switch(type){case"json":try{resp=win.JSON?win.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML&&resp.responseXML.parseError&&resp.responseXML.parseError.errorCode&&resp.responseXML.parseError.reason?null:resp.responseXML}self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp),self._successHandler(resp);while(self._fulfillmentHandlers.length>0)resp=self._fulfillmentHandlers.shift()(resp);complete(resp)}function error(e,t,n){e=self.request,self._responseArgs.resp=e,self._responseArgs.msg=t,self._responseArgs.t=n,self._erred=!0;while(self._errorHandlers.length>0)self._errorHandlers.shift()(e,t,n);complete(e)}this.url=typeof o=="string"?o:o.url,this.timeout=null,this._fulfilled=!1,this._successHandler=function(){},this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort()},o.timeout)),o.success&&(this._successHandler=function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest.call(this,success,error)}function reqwest(e,t){return new Reqwest(e,t)}function normalize(e){return e?e.replace(/\r?\n/g,"\r\n"):""}function serial(e,t){var n=e.name,r=e.tagName.toLowerCase(),i=function(e){e&&!e.disabled&&t(n,normalize(e.attributes.value&&e.attributes.value.specified?e.value:e.text))},s,o,u,a;if(e.disabled||!n)return;switch(r){case"input":/reset|button|image|file/i.test(e.type)||(s=/checkbox/i.test(e.type),o=/radio/i.test(e.type),u=e.value,(!s&&!o||e.checked)&&t(n,normalize(s&&u===""?"on":u)));break;case"textarea":t(n,normalize(e.value));break;case"select":if(e.type.toLowerCase()==="select-one")i(e.selectedIndex>=0?e.options[e.selectedIndex]:null);else for(a=0;e.length&&a<e.length;a++)e.options[a].selected&&i(e.options[a])}}function eachFormElement(){var e=this,t,n,r=function(t,n){var r,i,s;for(r=0;r<n.length;r++){s=t[byTag](n[r]);for(i=0;i<s.length;i++)serial(s[i],e)}};for(n=0;n<arguments.length;n++)t=arguments[n],/input|select|textarea/i.test(t.tagName)&&serial(t,e),r(t,["input","select","textarea"])}function serializeQueryString(){return reqwest.toQueryString(reqwest.serializeArray.apply(null,arguments))}function serializeHash(){var e={};return eachFormElement.apply(function(t,n){t in e?(e[t]&&!isArray(e[t])&&(e[t]=[e[t]]),e[t].push(n)):e[t]=n},arguments),e}function buildParams(e,t,n,r){var i,s,o,u=/\[\]$/;if(isArray(t))for(s=0;t&&s<t.length;s++)o=t[s],n||u.test(e)?r(e,o):buildParams(e+"["+(typeof o=="object"?s:"")+"]",o,n,r);else if(t&&t.toString()==="[object Object]")for(i in t)buildParams(e+"["+i+"]",t[i],n,r);else r(e,t)}var win=window,doc=document,twoHundo=/^(20\d|1223)$/,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",requestedWith="X-Requested-With",head=doc[byTag]("head")[0],uniqid=0,callbackPrefix="reqwest_"+ +(new Date),lastValue,xmlHttpRequest="XMLHttpRequest",xDomainRequest="XDomainRequest",noop=function(){},isArray=typeof Array.isArray=="function"?Array.isArray:function(e){return e instanceof Array},defaultHeaders={contentType:"application/x-www-form-urlencoded",requestedWith:xmlHttpRequest,accept:{"*":"text/javascript, text/html, application/xml, text/xml, */*",xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript",js:"application/javascript, text/javascript"}},xhr=function(e){if(e.crossOrigin===!0){var t=win[xmlHttpRequest]?new XMLHttpRequest:null;if(t&&"withCredentials"in t)return t;if(win[xDomainRequest])return new XDomainRequest;throw new Error("Browser does not support cross-origin requests")}return win[xmlHttpRequest]?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP")},globalSetupOptions={dataFilter:function(e){return e}};return Reqwest.prototype={abort:function(){this._aborted=!0,this.request.abort()},retry:function(){init.call(this,this.o,this.fn)},then:function(e,t){return e=e||function(){},t=t||function(){},this._fulfilled?this._responseArgs.resp=e(this._responseArgs.resp):this._erred?t(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):(this._fulfillmentHandlers.push(e),this._errorHandlers.push(t)),this},always:function(e){return this._fulfilled||this._erred?e(this._responseArgs.resp):this._completeHandlers.push(e),this},fail:function(e){return this._erred?e(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):this._errorHandlers.push(e),this}},reqwest.serializeArray=function(){var e=[];return eachFormElement.apply(function(t,n){e.push({name:t,value:n})},arguments),e},reqwest.serialize=function(){if(arguments.length===0)return"";var e,t,n=Array.prototype.slice.call(arguments,0);return e=n.pop(),e&&e.nodeType&&n.push(e)&&(e=null),e&&(e=e.type),e=="map"?t=serializeHash:e=="array"?t=reqwest.serializeArray:t=serializeQueryString,t.apply(null,n)},reqwest.toQueryString=function(e,t){var n,r,i=t||!1,s=[],o=encodeURIComponent,u=function(e,t){t="function"==typeof t?t():t==null?"":t,s[s.length]=o(e)+"="+o(t)};if(isArray(e))for(r=0;e&&r<e.length;r++)u(e[r].name,e[r].value);else for(n in e)e.hasOwnProperty(n)&&buildParams(n,e[n],i,u);return s.join("&").replace(/%20/g,"+")},reqwest.getcallbackPrefix=function(){return callbackPrefix},reqwest.compat=function(e,t){return e&&(e.type&&(e.method=e.type)&&delete e.type,e.dataType&&(e.type=e.dataType),e.jsonpCallback&&(e.jsonpCallbackName=e.jsonpCallback)&&delete e.jsonpCallback,e.jsonp&&(e.jsonpCallback=e.jsonp)),new Reqwest(e,t)},reqwest.ajaxSetup=function(e){e=e||{};for(var t in e)globalSetupOptions[t]=e[t]},reqwest})
Leaflet.Photo
=============
Plugin to show geotagged photos on a Leaflet map.
[Read this blog post](http://blog.thematicmapping.org/2014/08/showing-geotagged-photos-on-leaflet-map.html)
L.Photo = L.FeatureGroup.extend({
options: {
icon: {
iconSize: [40, 40]
}
},
initialize: function (photos, options) {
L.setOptions(this, options);
L.FeatureGroup.prototype.initialize.call(this, photos);
},
addLayers: function (photos) {
if (photos) {
for (var i = 0, len = photos.length; i < len; i++) {
this.addLayer(photos[i]);
}
}
return this;
},
addLayer: function (photo) {
L.FeatureGroup.prototype.addLayer.call(this, this.createMarker(photo));
},
createMarker: function (photo) {
var marker = L.marker(photo, {
icon: L.divIcon(L.extend({
html: '<div style="background-image: url(' + photo.thumbnail + ');"></div>',
className: 'leaflet-marker-photo'
}, photo, this.options.icon)),
title: photo.caption || ''
});
marker.photo = photo;
return marker;
}
});
L.photo = function (photos, options) {
return new L.Photo(photos, options);
};
if (L.MarkerClusterGroup) {
L.Photo.Cluster = L.MarkerClusterGroup.extend({
options: {
featureGroup: L.photo,
maxClusterRadius: 100,
showCoverageOnHover: false,
iconCreateFunction: function(cluster) {
return new L.DivIcon(L.extend({
className: 'leaflet-marker-photo',
html: '<div style="background-image: url(' + cluster.getAllChildMarkers()[0].photo.thumbnail + ');"></div><b>' + cluster.getChildCount() + '</b>'
}, this.icon));
},
icon: {
iconSize: [40, 40]
}
},
initialize: function (options) {
options = L.Util.setOptions(this, options);
L.MarkerClusterGroup.prototype.initialize.call(this);
this._photos = options.featureGroup(null, options);
},
add: function (photos) {
this.addLayer(this._photos.addLayers(photos));
return this;
},
clear: function () {
this._photos.clearLayers();
this.clearLayers();
}
});
L.photo.cluster = function (options) {
return new L.Photo.Cluster(options);
};
}
.leaflet-marker-photo {
border: 2px solid #fff;
box-shadow: 3px 3px 10px #888;
}
.leaflet-marker-photo div {
width: 100%;
height: 100%;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
.leaflet-marker-photo b {
position: absolute;
top: -7px;
right: -11px;
color: #555;
background-color: #fff;
border-radius: 8px;
height: 12px;
min-width: 12px;
line-height: 12px;
text-align: center;
padding: 3px;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
{"version":3,"sources":["../src/MarkerClusterGroup.js","../src/MarkerCluster.js","../src/MarkerOpacity.js","../src/DistanceGrid.js","../src/MarkerCluster.QuickHull.js","../src/MarkerCluster.Spiderfier.js","../src/MarkerClusterGroup.Refresh.js"],"names":[],"mappings":"0PAIO,IAAI,GAAqB,EAAE,mBAAqB,EAAE,aAAa,QAErE,SACC,iBAAkB,GAClB,mBAAoB,KACpB,YAAa,EAAE,OAAO,UAAU,QAAQ,KAExC,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAElB,wBAAyB,KAIzB,4BAA4B,EAK5B,SAAS,EAIT,sBAAsB,EAGtB,2BAA4B,EAG5B,0BAA4B,OAAQ,IAAK,MAAO,OAAQ,QAAS,IAGjE,gBAAgB,EAChB,cAAe,IACf,WAAY,GACZ,cAAe,KAGf,mBAGD,WAAY,SAAU,GACrB,EAAE,KAAK,WAAW,KAAM,GACnB,KAAK,QAAQ,qBACjB,KAAK,QAAQ,mBAAqB,KAAK,4BAGxC,KAAK,cAAgB,EAAE,eACvB,KAAK,cAAc,eAAe,MAElC,KAAK,eAAiB,EAAE,eACxB,KAAK,eAAe,eAAe,MAEnC,KAAK,iBAAmB,EACxB,KAAK,oBACL,KAAK,kBAEL,KAAK,oBAAsB,KAE3B,KAAK,UAEL,KAAK,2BACJ,UAAa,KAAK,sBAClB,KAAQ,KAAK,kBACb,QAAW,KAAK,oBAIjB,IAAI,GAAU,EAAE,QAAQ,YAAc,KAAK,QAAQ,OACnD,GAAE,OAAO,KAAM,EAAU,KAAK,eAAiB,KAAK,cAEpD,KAAK,eAAiB,EAAU,EAAE,cAAgB,EAAE,0BAGrD,SAAU,SAAU,GAEnB,GAAI,YAAiB,GAAE,WACtB,MAAO,MAAK,WAAW,GAIxB,KAAK,EAAM,UAGV,MAFA,MAAK,eAAe,SAAS,GAC7B,KAAK,KAAK,YAAc,MAAO,IACxB,IAGR,KAAK,KAAK,KAGT,MAFA,MAAK,iBAAiB,KAAK,GAC3B,KAAK,KAAK,YAAc,MAAO,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,kBAChB,KAAK,gCAAgC,GAG/B,MAQR,4BAA6B,SAAU,GACtC,GAAI,GAAI,CAGR,KAAK,IAAM,GAOV,IADA,EAAS,EAAO,GAAI,SACb,GACN,EAAO,kBAAmB,EAC1B,EAAS,EAAO,UAWnB,gCAAiC,SAAU,GAC1C,GAAI,GAAI,CAER,KAAK,IAAM,GACV,EAAQ,EAAO,GAGX,KAAK,SAAS,IAEjB,EAAM,QAAQ,KAAK,oBAAoB,OAM3C,EAAE,OAAO,SAQR,mBAAoB,SAAU,EAAS,GACtC,GAAI,GAAO,KAAK,QAAQ,IAcxB,OAZA,GAAE,WAAW,EAAM,GAEnB,KAAK,QAAQ,GAMT,GAA2B,KAAK,UACnC,KAAK,SAAS,OAAO,gBAAgB,MAG/B","file":"dist/leaflet.markercluster.js"}
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Leaflet=e.Leaflet||{},e.Leaflet.markercluster=e.Leaflet.markercluster||{}))}(this,function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,n=this._featureGroup,r=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=(new Date).getTime(),d=L.bind(function(){for(var c=(new Date).getTime();h>l;l++){if(s&&0===l%200){var p=(new Date).getTime()-c;if(p>o)break}if(i=e[l],i instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var f=i.__parent.getAllChildMarkers(),m=f[0]===i?f[1]:f[0];n.removeLayer(m)}}else r.addLayer(i),t||this.fire("layeradd",{layer:i})}a&&a(l,h,(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;h>l;l++)i=e[l],i instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||c.push(i):r.addLayer(i);return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=n;for(t=0;h>t;t++)i=a[t],i instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,n,r,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),n=s.length-1;n>=0;n--){for(i=!0,r=o.length-1;r>=0;r--)if(o[r].layer===s[n]){i=!1;break}i&&e.call(t,s[n])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){"function"!=typeof t&&(t=function(){});var i=function(){!e._icon&&!e.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),e._icon?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",i,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return i+=10>t?"small":100>t?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(t||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){for(var t=e.layer,i=t;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(e||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,n,r=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=r[t].getNearObject(i);if(a)return a._addChild(e),e.__parent=a,void 0;if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);r[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(n=t-1;n>h._zoom;n--)u=new this._markerCluster(this,n,u),r[n].addObject(u,this._map.project(a.getLatLng(),n));return h._addChild(u),this._removeFromGridUnclustered(a,t),void 0}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,n=e.getLayers(),r=0;for(t=t||[];r<n.length;r++)i=n[r],i instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i,n=this._getExpandedVisibleBounds(),r=this._featureGroup,s=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(n,e,s,function(s){var o,a=s._latlng,h=s._markers;for(n.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(r.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,n)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,n)),i=h.length-1;i>=0;i--)o=h[i],n.contains(o._latlng)||r.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,t),r.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(n,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,s,function(e){r.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(n,i,r,function(e){e._recursivelyRemoveChildrenFromMap(n,r,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e);for(var n=this._markers.length-1;n>=0;n--)t&&this._markers[n].__dragStart||e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),n=this._group._map,r=n.getBoundsZoom(this._bounds),s=this._zoom+1,o=n.getZoom();i.length>0&&r>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}r>s?this._group._map.setView(this._latlng,s):o>=r?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,n,r=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<r.length;e++)i=r[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)t=s[e],t._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,n=t._childCount,o+=i.lat*n,a+=i.lng*n;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,n,r=e._markers;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())},function(e){var i,n,r=e._childClusters;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var s=n._markers[r];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),n._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)r=e._markers[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)r=e._childClusters[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var s,o,a=this._childClusters,h=this._zoom;if(h>=t&&(n&&n(this),r&&h===i&&r(this)),t>h||i>h)for(s=a.length-1;s>=0;s--)o=a[s],o._boundsNeedUpdate&&o._recalculateBounds(),e.intersects(o._bounds)&&o._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,s=r[n]=r[n]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,n,r=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[r]=a[r]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,n=h.length;n>i;i++)if(h[i]===e)return h.splice(i,1),1===n&&delete a[r],!0},eachObject:function(e,t){var i,n,r,s,o,a,h,l=this._grid;for(i in l){o=l[i];for(n in o)for(a=o[n],r=0,s=a.length;s>r;r++)h=e.call(t,a[r]),h&&(r--,s--)}},getNearObject:function(e){var t,i,n,r,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,c=null;for(t=u-1;u+1>=t;t++)if(r=this._grid[t])for(i=l-1;l+1>=i;i++)if(s=r[i])for(n=0,o=s.length;o>n;n++)a=s[n],h=this._sqDist(_[L.Util.stamp(a)],e),(d>h||d>=h&&null===c)&&(d=h,c=a);return c},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,n,r,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)n=t[i],r=this.getDistant(n,e),r>0&&(a.push(n),r>s&&(s=r,o=n));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints))):[e[0]]},getConvexHull:function(e){var t,i=!1,n=!1,r=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(i===!1||d.lat>i)&&(o=d,i=d.lat),(n===!1||d.lat<n)&&(a=d,n=d.lat),(r===!1||d.lng>r)&&(h=d,r=d.lng),(s===!1||d.lng<s)&&(l=d,s=d.lng)}n!==i?(_=a,u=o):(_=l,u=h);var c=[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e));return c}}}(),L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),n=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),n.push(e);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group,n=i._map,r=n.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,r):(r.y+=10,e=this._generatePointsCircle(t.length,r)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,n,r=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),s=r/this._2PI,o=this._2PI/e,a=[];for(s=Math.max(s,35),a.length=e,i=0;e>i;i++)n=this._circleStartAngle+i*o,a[i]=new L.Point(t.x+s*Math.cos(n),t.y+s*Math.sin(n))._round();return a},_generatePointsSpiral:function(e,t){var i,n=this._group.options.spiderfyDistanceMultiplier,r=n*this._spiralLengthStart,s=n*this._spiralFootSeparation,o=n*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e;i>=0;i--)e>i&&(h[i]=new L.Point(t.x+r*Math.cos(a),t.y+r*Math.sin(a))._round()),a+=s/r+5e-4*i,r+=o/a;return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,n=i._map,r=i._featureGroup,s=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],r.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(n.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,n,r,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),n=e[i],r=new L.Polyline([this._latlng,s],l),a.addLayer(r),n._spiderLeg=r,n._preSpiderfyLatlng=n._latlng,n.setLatLng(s),n.setZIndexOffset&&n.setZIndexOffset(1e6),h.addLayer(n);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,n,r,s,o,a,h=this,l=this._group,u=l._map,_=l._featureGroup,d=this._latlng,c=u.latLngToLayerPoint(d),p=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),p?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,l._ignoreMove=!0,i=0;i<e.length;i++)n=e[i],a=u.layerPointToLatLng(t[i]),r=new L.Polyline([d,a],f),u.addLayer(r),n._spiderLeg=r,p&&(s=r._path,o=s.getTotalLength()+.1,s.style.strokeDasharray=o,s.style.strokeDashoffset=o),n.setZIndexOffset&&n.setZIndexOffset(1e6),n.clusterHide&&n.clusterHide(),_.addLayer(n),n._setPos&&n._setPos(c);for(l._forceLayout(),l._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),n=e[i],n._preSpiderfyLatlng=n._latlng,n.setLatLng(a),n.clusterShow&&n.clusterShow(),p&&(r=n._spiderLeg,s=r._path,s.style.strokeDashoffset=0,r.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout(function(){l._animationEnd(),l.fire("spiderfied",{cluster:h,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,n,r,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),c=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)t=d[i],t._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),c&&(n=t._spiderLeg,r=n._path,s=r.getTotalLength()+.1,r.style.strokeDashoffset=s,n.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()
},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i});
//# sourceMappingURL=leaflet.markercluster.js.map
{"version":3,"file":"leaflet.markercluster-src.js","sources":["../src/MarkerClusterGroup.js","../src/MarkerCluster.js","../src/MarkerOpacity.js","../src/DistanceGrid.js","../src/MarkerCluster.QuickHull.js","../src/MarkerCluster.Spiderfier.js","../src/MarkerClusterGroup.Refresh.js"],"sourcesContent":["/*\r\n * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within\r\n */\r\n\r\nexport var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({\r\n\r\n\toptions: {\r\n\t\tmaxClusterRadius: 80, //A cluster will cover at most this many pixels from its center\r\n\t\ticonCreateFunction: null,\r\n\t\tclusterPane: L.Marker.prototype.options.pane,\r\n\r\n\t\tspiderfyOnMaxZoom: true,\r\n\t\tshowCoverageOnHover: true,\r\n\t\tzoomToBoundsOnClick: true,\r\n\t\tsingleMarkerMode: false,\r\n\r\n\t\tdisableClusteringAtZoom: null,\r\n\r\n\t\t// Setting this to false prevents the removal of any clusters outside of the viewpoint, which\r\n\t\t// is the default behaviour for performance reasons.\r\n\t\tremoveOutsideVisibleBounds: true,\r\n\r\n\t\t// Set to false to disable all animations (zoom and spiderfy).\r\n\t\t// If false, option animateAddingMarkers below has no effect.\r\n\t\t// If L.DomUtil.TRANSITION is falsy, this option has no effect.\r\n\t\tanimate: true,\r\n\r\n\t\t//Whether to animate adding markers after adding the MarkerClusterGroup to the map\r\n\t\t// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.\r\n\t\tanimateAddingMarkers: false,\r\n\r\n\t\t//Increase to increase the distance away that spiderfied markers appear from the center\r\n\t\tspiderfyDistanceMultiplier: 1,\r\n\r\n\t\t// Make it possible to specify a polyline options on a spider leg\r\n\t\tspiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },\r\n\r\n\t\t// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts\r\n\t\tchunkedLoading: false,\r\n\t\tchunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)\r\n\t\tchunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser\r\n\t\tchunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)\r\n\r\n\t\t//Options to pass to the L.Polygon constructor\r\n\t\tpolygonOptions: {}\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tL.Util.setOptions(this, options);\r\n\t\tif (!this.options.iconCreateFunction) {\r\n\t\t\tthis.options.iconCreateFunction = this._defaultIconCreateFunction;\r\n\t\t}\r\n\r\n\t\tthis._featureGroup = L.featureGroup();\r\n\t\tthis._featureGroup.addEventParent(this);\r\n\r\n\t\tthis._nonPointGroup = L.featureGroup();\r\n\t\tthis._nonPointGroup.addEventParent(this);\r\n\r\n\t\tthis._inZoomAnimation = 0;\r\n\t\tthis._needsClustering = [];\r\n\t\tthis._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of\r\n\t\t//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move\r\n\t\tthis._currentShownBounds = null;\r\n\r\n\t\tthis._queue = [];\r\n\r\n\t\tthis._childMarkerEventHandlers = {\r\n\t\t\t'dragstart': this._childMarkerDragStart,\r\n\t\t\t'move': this._childMarkerMoved,\r\n\t\t\t'dragend': this._childMarkerDragEnd,\r\n\t\t};\r\n\r\n\t\t// Hook the appropriate animation methods.\r\n\t\tvar animate = L.DomUtil.TRANSITION && this.options.animate;\r\n\t\tL.extend(this, animate ? this._withAnimation : this._noAnimation);\r\n\t\t// Remember which MarkerCluster class to instantiate (animated or not).\r\n\t\tthis._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;\r\n\t},\r\n\r\n\taddLayer: function (layer) {\r\n\r\n\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\treturn this.addLayers([layer]);\r\n\t\t}\r\n\r\n\t\t//Don't cluster non point data\r\n\t\tif (!layer.getLatLng) {\r\n\t\t\tthis._nonPointGroup.addLayer(layer);\r\n\t\t\tthis.fire('layeradd', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tthis._needsClustering.push(layer);\r\n\t\t\tthis.fire('layeradd', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\r\n\t\t//If we have already clustered we'll need to add this one to a cluster\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\t\t}\r\n\r\n\t\tthis._addLayer(layer, this._maxZoom);\r\n\t\tthis.fire('layeradd', { layer: layer });\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t//Work out what is visible\r\n\t\tvar visibleLayer = layer,\r\n\t\t currentZoom = this._zoom;\r\n\t\tif (layer.__parent) {\r\n\t\t\twhile (visibleLayer.__parent._zoom >= currentZoom) {\r\n\t\t\t\tvisibleLayer = visibleLayer.__parent;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._currentShownBounds.contains(visibleLayer.getLatLng())) {\r\n\t\t\tif (this.options.animateAddingMarkers) {\r\n\t\t\t\tthis._animationAddLayer(layer, visibleLayer);\r\n\t\t\t} else {\r\n\t\t\t\tthis._animationAddLayerNonAnimated(layer, visibleLayer);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tremoveLayer: function (layer) {\r\n\r\n\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\treturn this.removeLayers([layer]);\r\n\t\t}\r\n\r\n\t\t//Non point layers\r\n\t\tif (!layer.getLatLng) {\r\n\t\t\tthis._nonPointGroup.removeLayer(layer);\r\n\t\t\tthis.fire('layerremove', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tif (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {\r\n\t\t\t\tthis._needsRemoving.push({ layer: layer, latlng: layer._latlng });\r\n\t\t\t}\r\n\t\t\tthis.fire('layerremove', { layer: layer });\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!layer.__parent) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\t\t\tthis._unspiderfyLayer(layer);\r\n\t\t}\r\n\r\n\t\t//Remove the marker from clusters\r\n\t\tthis._removeLayer(layer, true);\r\n\t\tthis.fire('layerremove', { layer: layer });\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\tlayer.off(this._childMarkerEventHandlers, this);\r\n\r\n\t\tif (this._featureGroup.hasLayer(layer)) {\r\n\t\t\tthis._featureGroup.removeLayer(layer);\r\n\t\t\tif (layer.clusterShow) {\r\n\t\t\t\tlayer.clusterShow();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Takes an array of markers and adds them in bulk\r\n\taddLayers: function (layersArray, skipLayerAddEvent) {\r\n\t\tif (!L.Util.isArray(layersArray)) {\r\n\t\t\treturn this.addLayer(layersArray);\r\n\t\t}\r\n\r\n\t\tvar fg = this._featureGroup,\r\n\t\t npg = this._nonPointGroup,\r\n\t\t chunked = this.options.chunkedLoading,\r\n\t\t chunkInterval = this.options.chunkInterval,\r\n\t\t chunkProgress = this.options.chunkProgress,\r\n\t\t l = layersArray.length,\r\n\t\t offset = 0,\r\n\t\t originalArray = true,\r\n\t\t m;\r\n\r\n\t\tif (this._map) {\r\n\t\t\tvar started = (new Date()).getTime();\r\n\t\t\tvar process = L.bind(function () {\r\n\t\t\t\tvar start = (new Date()).getTime();\r\n\t\t\t\tfor (; offset < l; offset++) {\r\n\t\t\t\t\tif (chunked && offset % 200 === 0) {\r\n\t\t\t\t\t\t// every couple hundred markers, instrument the time elapsed since processing started:\r\n\t\t\t\t\t\tvar elapsed = (new Date()).getTime() - start;\r\n\t\t\t\t\t\tif (elapsed > chunkInterval) {\r\n\t\t\t\t\t\t\tbreak; // been working too hard, time to take a break :-)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tm = layersArray[offset];\r\n\r\n\t\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\t\t// Side effects:\r\n\t\t\t\t\t// - Total increases, so chunkProgress ratio jumps backward.\r\n\t\t\t\t\t// - Groups are not included in this group, only their non-group child layers (hasLayer).\r\n\t\t\t\t\t// Changing array length while looping does not affect performance in current browsers:\r\n\t\t\t\t\t// http://jsperf.com/for-loop-changing-length/6\r\n\t\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\t\tif (originalArray) {\r\n\t\t\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\t\t\tl = layersArray.length;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//Not point data, can't be clustered\r\n\t\t\t\t\tif (!m.getLatLng) {\r\n\t\t\t\t\t\tnpg.addLayer(m);\r\n\t\t\t\t\t\tif (!skipLayerAddEvent) {\r\n\t\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.hasLayer(m)) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._addLayer(m, this._maxZoom);\r\n\t\t\t\t\tif (!skipLayerAddEvent) {\r\n\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will\r\n\t\t\t\t\tif (m.__parent) {\r\n\t\t\t\t\t\tif (m.__parent.getChildCount() === 2) {\r\n\t\t\t\t\t\t\tvar markers = m.__parent.getAllChildMarkers(),\r\n\t\t\t\t\t\t\t otherMarker = markers[0] === m ? markers[1] : markers[0];\r\n\t\t\t\t\t\t\tfg.removeLayer(otherMarker);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (chunkProgress) {\r\n\t\t\t\t\t// report progress and time elapsed:\r\n\t\t\t\t\tchunkProgress(offset, l, (new Date()).getTime() - started);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Completed processing all markers.\r\n\t\t\t\tif (offset === l) {\r\n\r\n\t\t\t\t\t// Refresh bounds and weighted positions.\r\n\t\t\t\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\t\t\t\tthis._refreshClustersIcons();\r\n\r\n\t\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(process, this.options.chunkDelay);\r\n\t\t\t\t}\r\n\t\t\t}, this);\r\n\r\n\t\t\tprocess();\r\n\t\t} else {\r\n\t\t\tvar needsClustering = this._needsClustering;\r\n\r\n\t\t\tfor (; offset < l; offset++) {\r\n\t\t\t\tm = layersArray[offset];\r\n\r\n\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\tif (originalArray) {\r\n\t\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\t\tl = layersArray.length;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Not point data, can't be clustered\r\n\t\t\t\tif (!m.getLatLng) {\r\n\t\t\t\t\tnpg.addLayer(m);\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.hasLayer(m)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tneedsClustering.push(m);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Takes an array of markers and removes them in bulk\r\n\tremoveLayers: function (layersArray) {\r\n\t\tvar i, m,\r\n\t\t l = layersArray.length,\r\n\t\t fg = this._featureGroup,\r\n\t\t npg = this._nonPointGroup,\r\n\t\t originalArray = true;\r\n\r\n\t\tif (!this._map) {\r\n\t\t\tfor (i = 0; i < l; i++) {\r\n\t\t\t\tm = layersArray[i];\r\n\r\n\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\tif (originalArray) {\r\n\t\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\t\tl = layersArray.length;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._arraySplice(this._needsClustering, m);\r\n\t\t\t\tnpg.removeLayer(m);\r\n\t\t\t\tif (this.hasLayer(m)) {\r\n\t\t\t\t\tthis._needsRemoving.push({ layer: m, latlng: m._latlng });\r\n\t\t\t\t}\r\n\t\t\t\tthis.fire('layerremove', { layer: m });\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (this._unspiderfy) {\r\n\t\t\tthis._unspiderfy();\r\n\r\n\t\t\t// Work on a copy of the array, so that next loop is not affected.\r\n\t\t\tvar layersArray2 = layersArray.slice(),\r\n\t\t\t l2 = l;\r\n\t\t\tfor (i = 0; i < l2; i++) {\r\n\t\t\t\tm = layersArray2[i];\r\n\r\n\t\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray2);\r\n\t\t\t\t\tl2 = layersArray2.length;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._unspiderfyLayer(m);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < l; i++) {\r\n\t\t\tm = layersArray[i];\r\n\r\n\t\t\t// Group of layers, append children to layersArray and skip.\r\n\t\t\tif (m instanceof L.LayerGroup) {\r\n\t\t\t\tif (originalArray) {\r\n\t\t\t\t\tlayersArray = layersArray.slice();\r\n\t\t\t\t\toriginalArray = false;\r\n\t\t\t\t}\r\n\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\r\n\t\t\t\tl = layersArray.length;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (!m.__parent) {\r\n\t\t\t\tnpg.removeLayer(m);\r\n\t\t\t\tthis.fire('layerremove', { layer: m });\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tthis._removeLayer(m, true, true);\r\n\t\t\tthis.fire('layerremove', { layer: m });\r\n\r\n\t\t\tif (fg.hasLayer(m)) {\r\n\t\t\t\tfg.removeLayer(m);\r\n\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Refresh bounds and weighted positions.\r\n\t\tthis._topClusterLevel._recalculateBounds();\r\n\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t//Fix up the clusters and markers on the map\r\n\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Removes all layers from the MarkerClusterGroup\r\n\tclearLayers: function () {\r\n\t\t//Need our own special implementation as the LayerGroup one doesn't work for us\r\n\r\n\t\t//If we aren't on the map (yet), blow away the markers we know of\r\n\t\tif (!this._map) {\r\n\t\t\tthis._needsClustering = [];\r\n\t\t\tthis._needsRemoving = [];\r\n\t\t\tdelete this._gridClusters;\r\n\t\t\tdelete this._gridUnclustered;\r\n\t\t}\r\n\r\n\t\tif (this._noanimationUnspiderfy) {\r\n\t\t\tthis._noanimationUnspiderfy();\r\n\t\t}\r\n\r\n\t\t//Remove all the visible layers\r\n\t\tthis._featureGroup.clearLayers();\r\n\t\tthis._nonPointGroup.clearLayers();\r\n\r\n\t\tthis.eachLayer(function (marker) {\r\n\t\t\tmarker.off(this._childMarkerEventHandlers, this);\r\n\t\t\tdelete marker.__parent;\r\n\t\t}, this);\r\n\r\n\t\tif (this._map) {\r\n\t\t\t//Reset _topClusterLevel and the DistanceGrids\r\n\t\t\tthis._generateInitialClusters();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t//Override FeatureGroup.getBounds as it doesn't work\r\n\tgetBounds: function () {\r\n\t\tvar bounds = new L.LatLngBounds();\r\n\r\n\t\tif (this._topClusterLevel) {\r\n\t\t\tbounds.extend(this._topClusterLevel._bounds);\r\n\t\t}\r\n\r\n\t\tfor (var i = this._needsClustering.length - 1; i >= 0; i--) {\r\n\t\t\tbounds.extend(this._needsClustering[i].getLatLng());\r\n\t\t}\r\n\r\n\t\tbounds.extend(this._nonPointGroup.getBounds());\r\n\r\n\t\treturn bounds;\r\n\t},\r\n\r\n\t//Overrides LayerGroup.eachLayer\r\n\teachLayer: function (method, context) {\r\n\t\tvar markers = this._needsClustering.slice(),\r\n\t\t\tneedsRemoving = this._needsRemoving,\r\n\t\t\tthisNeedsRemoving, i, j;\r\n\r\n\t\tif (this._topClusterLevel) {\r\n\t\t\tthis._topClusterLevel.getAllChildMarkers(markers);\r\n\t\t}\r\n\r\n\t\tfor (i = markers.length - 1; i >= 0; i--) {\r\n\t\t\tthisNeedsRemoving = true;\r\n\r\n\t\t\tfor (j = needsRemoving.length - 1; j >= 0; j--) {\r\n\t\t\t\tif (needsRemoving[j].layer === markers[i]) {\r\n\t\t\t\t\tthisNeedsRemoving = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (thisNeedsRemoving) {\r\n\t\t\t\tmethod.call(context, markers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._nonPointGroup.eachLayer(method, context);\r\n\t},\r\n\r\n\t//Overrides LayerGroup.getLayers\r\n\tgetLayers: function () {\r\n\t\tvar layers = [];\r\n\t\tthis.eachLayer(function (l) {\r\n\t\t\tlayers.push(l);\r\n\t\t});\r\n\t\treturn layers;\r\n\t},\r\n\r\n\t//Overrides LayerGroup.getLayer, WARNING: Really bad performance\r\n\tgetLayer: function (id) {\r\n\t\tvar result = null;\r\n\r\n\t\tid = parseInt(id, 10);\r\n\r\n\t\tthis.eachLayer(function (l) {\r\n\t\t\tif (L.stamp(l) === id) {\r\n\t\t\t\tresult = l;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t},\r\n\r\n\t//Returns true if the given layer is in this MarkerClusterGroup\r\n\thasLayer: function (layer) {\r\n\t\tif (!layer) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar i, anArray = this._needsClustering;\r\n\r\n\t\tfor (i = anArray.length - 1; i >= 0; i--) {\r\n\t\t\tif (anArray[i] === layer) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tanArray = this._needsRemoving;\r\n\t\tfor (i = anArray.length - 1; i >= 0; i--) {\r\n\t\t\tif (anArray[i].layer === layer) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer);\r\n\t},\r\n\r\n\t//Zoom down to show the given layer (spiderfying if necessary) then calls the callback\r\n\tzoomToShowLayer: function (layer, callback) {\r\n\r\n\t\tif (typeof callback !== 'function') {\r\n\t\t\tcallback = function () {};\r\n\t\t}\r\n\r\n\t\tvar showMarker = function () {\r\n\t\t\tif ((layer._icon || layer.__parent._icon) && !this._inZoomAnimation) {\r\n\t\t\t\tthis._map.off('moveend', showMarker, this);\r\n\t\t\t\tthis.off('animationend', showMarker, this);\r\n\r\n\t\t\t\tif (layer._icon) {\r\n\t\t\t\t\tcallback();\r\n\t\t\t\t} else if (layer.__parent._icon) {\r\n\t\t\t\t\tthis.once('spiderfied', callback, this);\r\n\t\t\t\t\tlayer.__parent.spiderfy();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tif (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {\r\n\t\t\t//Layer is visible ond on screen, immediate return\r\n\t\t\tcallback();\r\n\t\t} else if (layer.__parent._zoom < Math.round(this._map._zoom)) {\r\n\t\t\t//Layer should be visible at this zoom level. It must not be on screen so just pan over to it\r\n\t\t\tthis._map.on('moveend', showMarker, this);\r\n\t\t\tthis._map.panTo(layer.getLatLng());\r\n\t\t} else {\r\n\t\t\tthis._map.on('moveend', showMarker, this);\r\n\t\t\tthis.on('animationend', showMarker, this);\r\n\t\t\tlayer.__parent.zoomToBounds();\r\n\t\t}\r\n\t},\r\n\r\n\t//Overrides FeatureGroup.onAdd\r\n\tonAdd: function (map) {\r\n\t\tthis._map = map;\r\n\t\tvar i, l, layer;\r\n\r\n\t\tif (!isFinite(this._map.getMaxZoom())) {\r\n\t\t\tthrow \"Map has no maxZoom specified\";\r\n\t\t}\r\n\r\n\t\tthis._featureGroup.addTo(map);\r\n\t\tthis._nonPointGroup.addTo(map);\r\n\r\n\t\tif (!this._gridClusters) {\r\n\t\t\tthis._generateInitialClusters();\r\n\t\t}\r\n\r\n\t\tthis._maxLat = map.options.crs.projection.MAX_LATITUDE;\r\n\r\n\t\t//Restore all the positions as they are in the MCG before removing them\r\n\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\r\n\t\t\tlayer = this._needsRemoving[i];\r\n\t\t\tlayer.newlatlng = layer.layer._latlng;\r\n\t\t\tlayer.layer._latlng = layer.latlng;\r\n\t\t}\r\n\t\t//Remove them, then restore their new positions\r\n\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\r\n\t\t\tlayer = this._needsRemoving[i];\r\n\t\t\tthis._removeLayer(layer.layer, true);\r\n\t\t\tlayer.layer._latlng = layer.newlatlng;\r\n\t\t}\r\n\t\tthis._needsRemoving = [];\r\n\r\n\t\t//Remember the current zoom level and bounds\r\n\t\tthis._zoom = Math.round(this._map._zoom);\r\n\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\r\n\r\n\t\tthis._map.on('zoomend', this._zoomEnd, this);\r\n\t\tthis._map.on('moveend', this._moveEnd, this);\r\n\r\n\t\tif (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\r\n\t\t\tthis._spiderfierOnAdd();\r\n\t\t}\r\n\r\n\t\tthis._bindEvents();\r\n\r\n\t\t//Actually add our markers to the map:\r\n\t\tl = this._needsClustering;\r\n\t\tthis._needsClustering = [];\r\n\t\tthis.addLayers(l, true);\r\n\t},\r\n\r\n\t//Overrides FeatureGroup.onRemove\r\n\tonRemove: function (map) {\r\n\t\tmap.off('zoomend', this._zoomEnd, this);\r\n\t\tmap.off('moveend', this._moveEnd, this);\r\n\r\n\t\tthis._unbindEvents();\r\n\r\n\t\t//In case we are in a cluster animation\r\n\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\r\n\r\n\t\tif (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\r\n\t\t\tthis._spiderfierOnRemove();\r\n\t\t}\r\n\r\n\t\tdelete this._maxLat;\r\n\r\n\t\t//Clean up all the layers we added to the map\r\n\t\tthis._hideCoverage();\r\n\t\tthis._featureGroup.remove();\r\n\t\tthis._nonPointGroup.remove();\r\n\r\n\t\tthis._featureGroup.clearLayers();\r\n\r\n\t\tthis._map = null;\r\n\t},\r\n\r\n\tgetVisibleParent: function (marker) {\r\n\t\tvar vMarker = marker;\r\n\t\twhile (vMarker && !vMarker._icon) {\r\n\t\t\tvMarker = vMarker.__parent;\r\n\t\t}\r\n\t\treturn vMarker || null;\r\n\t},\r\n\r\n\t//Remove the given object from the given array\r\n\t_arraySplice: function (anArray, obj) {\r\n\t\tfor (var i = anArray.length - 1; i >= 0; i--) {\r\n\t\t\tif (anArray[i] === obj) {\r\n\t\t\t\tanArray.splice(i, 1);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom.\r\n\t * @param marker to be removed from _gridUnclustered.\r\n\t * @param z integer bottom start zoom level (included)\r\n\t * @private\r\n\t */\r\n\t_removeFromGridUnclustered: function (marker, z) {\r\n\t\tvar map = this._map,\r\n\t\t gridUnclustered = this._gridUnclustered,\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\r\n\r\n\t\tfor (; z >= minZoom; z--) {\r\n\t\t\tif (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_childMarkerDragStart: function (e) {\r\n\t\te.target.__dragStart = e.target._latlng;\r\n\t},\r\n\r\n\t_childMarkerMoved: function (e) {\r\n\t\tif (!this._ignoreMove && !e.target.__dragStart) {\r\n\t\t\tvar isPopupOpen = e.target._popup && e.target._popup.isOpen();\r\n\r\n\t\t\tthis._moveChild(e.target, e.oldLatLng, e.latlng);\r\n\r\n\t\t\tif (isPopupOpen) {\r\n\t\t\t\te.target.openPopup();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_moveChild: function (layer, from, to) {\r\n\t\tlayer._latlng = from;\r\n\t\tthis.removeLayer(layer);\r\n\r\n\t\tlayer._latlng = to;\r\n\t\tthis.addLayer(layer);\r\n\t},\r\n\r\n\t_childMarkerDragEnd: function (e) {\r\n\t\tvar dragStart = e.target.__dragStart;\r\n\t\tdelete e.target.__dragStart;\r\n\t\tif (dragStart) {\r\n\t\t\tthis._moveChild(e.target, dragStart, e.target._latlng);\r\n\t\t}\t\t\r\n\t},\r\n\r\n\r\n\t//Internal function for removing a marker from everything.\r\n\t//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)\r\n\t_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {\r\n\t\tvar gridClusters = this._gridClusters,\r\n\t\t\tgridUnclustered = this._gridUnclustered,\r\n\t\t\tfg = this._featureGroup,\r\n\t\t\tmap = this._map,\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\r\n\r\n\t\t//Remove the marker from distance clusters it might be in\r\n\t\tif (removeFromDistanceGrid) {\r\n\t\t\tthis._removeFromGridUnclustered(marker, this._maxZoom);\r\n\t\t}\r\n\r\n\t\t//Work our way up the clusters removing them as we go if required\r\n\t\tvar cluster = marker.__parent,\r\n\t\t\tmarkers = cluster._markers,\r\n\t\t\totherMarker;\r\n\r\n\t\t//Remove the marker from the immediate parents marker list\r\n\t\tthis._arraySplice(markers, marker);\r\n\r\n\t\twhile (cluster) {\r\n\t\t\tcluster._childCount--;\r\n\t\t\tcluster._boundsNeedUpdate = true;\r\n\r\n\t\t\tif (cluster._zoom < minZoom) {\r\n\t\t\t\t//Top level, do nothing\r\n\t\t\t\tbreak;\r\n\t\t\t} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required\r\n\t\t\t\t//We need to push the other marker up to the parent\r\n\t\t\t\totherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];\r\n\r\n\t\t\t\t//Update distance grid\r\n\t\t\t\tgridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));\r\n\t\t\t\tgridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));\r\n\r\n\t\t\t\t//Move otherMarker up to parent\r\n\t\t\t\tthis._arraySplice(cluster.__parent._childClusters, cluster);\r\n\t\t\t\tcluster.__parent._markers.push(otherMarker);\r\n\t\t\t\totherMarker.__parent = cluster.__parent;\r\n\r\n\t\t\t\tif (cluster._icon) {\r\n\t\t\t\t\t//Cluster is currently on the map, need to put the marker on the map instead\r\n\t\t\t\t\tfg.removeLayer(cluster);\r\n\t\t\t\t\tif (!dontUpdateMap) {\r\n\t\t\t\t\t\tfg.addLayer(otherMarker);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcluster._iconNeedsUpdate = true;\r\n\t\t\t}\r\n\r\n\t\t\tcluster = cluster.__parent;\r\n\t\t}\r\n\r\n\t\tdelete marker.__parent;\r\n\t},\r\n\r\n\t_isOrIsParent: function (el, oel) {\r\n\t\twhile (oel) {\r\n\t\t\tif (el === oel) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\toel = oel.parentNode;\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t//Override L.Evented.fire\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (data && data.layer instanceof L.MarkerCluster) {\r\n\t\t\t//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)\r\n\t\t\tif (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\ttype = 'cluster' + type;\r\n\t\t}\r\n\r\n\t\tL.FeatureGroup.prototype.fire.call(this, type, data, propagate);\r\n\t},\r\n\r\n\t//Override L.Evented.listens\r\n\tlistens: function (type, propagate) {\r\n\t\treturn L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, 'cluster' + type, propagate);\r\n\t},\r\n\r\n\t//Default functionality\r\n\t_defaultIconCreateFunction: function (cluster) {\r\n\t\tvar childCount = cluster.getChildCount();\r\n\r\n\t\tvar c = ' marker-cluster-';\r\n\t\tif (childCount < 10) {\r\n\t\t\tc += 'small';\r\n\t\t} else if (childCount < 100) {\r\n\t\t\tc += 'medium';\r\n\t\t} else {\r\n\t\t\tc += 'large';\r\n\t\t}\r\n\r\n\t\treturn new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });\r\n\t},\r\n\r\n\t_bindEvents: function () {\r\n\t\tvar map = this._map,\r\n\t\t spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\r\n\t\t showCoverageOnHover = this.options.showCoverageOnHover,\r\n\t\t zoomToBoundsOnClick = this.options.zoomToBoundsOnClick;\r\n\r\n\t\t//Zoom on cluster click or spiderfy if we are at the lowest level\r\n\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick) {\r\n\t\t\tthis.on('clusterclick', this._zoomOrSpiderfy, this);\r\n\t\t}\r\n\r\n\t\t//Show convex hull (boundary) polygon on mouse over\r\n\t\tif (showCoverageOnHover) {\r\n\t\t\tthis.on('clustermouseover', this._showCoverage, this);\r\n\t\t\tthis.on('clustermouseout', this._hideCoverage, this);\r\n\t\t\tmap.on('zoomend', this._hideCoverage, this);\r\n\t\t}\r\n\t},\r\n\r\n\t_zoomOrSpiderfy: function (e) {\r\n\t\tvar cluster = e.layer,\r\n\t\t bottomCluster = cluster;\r\n\r\n\t\twhile (bottomCluster._childClusters.length === 1) {\r\n\t\t\tbottomCluster = bottomCluster._childClusters[0];\r\n\t\t}\r\n\r\n\t\tif (bottomCluster._zoom === this._maxZoom &&\r\n\t\t\tbottomCluster._childCount === cluster._childCount &&\r\n\t\t\tthis.options.spiderfyOnMaxZoom) {\r\n\r\n\t\t\t// All child markers are contained in a single cluster from this._maxZoom to this cluster.\r\n\t\t\tcluster.spiderfy();\r\n\t\t} else if (this.options.zoomToBoundsOnClick) {\r\n\t\t\tcluster.zoomToBounds();\r\n\t\t}\r\n\r\n\t\t// Focus the map again for keyboard users.\r\n\t\tif (e.originalEvent && e.originalEvent.keyCode === 13) {\r\n\t\t\tthis._map._container.focus();\r\n\t\t}\r\n\t},\r\n\r\n\t_showCoverage: function (e) {\r\n\t\tvar map = this._map;\r\n\t\tif (this._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (this._shownPolygon) {\r\n\t\t\tmap.removeLayer(this._shownPolygon);\r\n\t\t}\r\n\t\tif (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) {\r\n\t\t\tthis._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions);\r\n\t\t\tmap.addLayer(this._shownPolygon);\r\n\t\t}\r\n\t},\r\n\r\n\t_hideCoverage: function () {\r\n\t\tif (this._shownPolygon) {\r\n\t\t\tthis._map.removeLayer(this._shownPolygon);\r\n\t\t\tthis._shownPolygon = null;\r\n\t\t}\r\n\t},\r\n\r\n\t_unbindEvents: function () {\r\n\t\tvar spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\r\n\t\t\tshowCoverageOnHover = this.options.showCoverageOnHover,\r\n\t\t\tzoomToBoundsOnClick = this.options.zoomToBoundsOnClick,\r\n\t\t\tmap = this._map;\r\n\r\n\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick) {\r\n\t\t\tthis.off('clusterclick', this._zoomOrSpiderfy, this);\r\n\t\t}\r\n\t\tif (showCoverageOnHover) {\r\n\t\t\tthis.off('clustermouseover', this._showCoverage, this);\r\n\t\t\tthis.off('clustermouseout', this._hideCoverage, this);\r\n\t\t\tmap.off('zoomend', this._hideCoverage, this);\r\n\t\t}\r\n\t},\r\n\r\n\t_zoomEnd: function () {\r\n\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._mergeSplitClusters();\r\n\r\n\t\tthis._zoom = Math.round(this._map._zoom);\r\n\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\r\n\t},\r\n\r\n\t_moveEnd: function () {\r\n\t\tif (this._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar newBounds = this._getExpandedVisibleBounds();\r\n\r\n\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds);\r\n\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds);\r\n\r\n\t\tthis._currentShownBounds = newBounds;\r\n\t\treturn;\r\n\t},\r\n\r\n\t_generateInitialClusters: function () {\r\n\t\tvar maxZoom = Math.ceil(this._map.getMaxZoom()),\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\r\n\t\t\tradius = this.options.maxClusterRadius,\r\n\t\t\tradiusFn = radius;\r\n\r\n\t\t//If we just set maxClusterRadius to a single number, we need to create\r\n\t\t//a simple function to return that number. Otherwise, we just have to\r\n\t\t//use the function we've passed in.\r\n\t\tif (typeof radius !== \"function\") {\r\n\t\t\tradiusFn = function () { return radius; };\r\n\t\t}\r\n\r\n\t\tif (this.options.disableClusteringAtZoom !== null) {\r\n\t\t\tmaxZoom = this.options.disableClusteringAtZoom - 1;\r\n\t\t}\r\n\t\tthis._maxZoom = maxZoom;\r\n\t\tthis._gridClusters = {};\r\n\t\tthis._gridUnclustered = {};\r\n\r\n\t\t//Set up DistanceGrids for each zoom\r\n\t\tfor (var zoom = maxZoom; zoom >= minZoom; zoom--) {\r\n\t\t\tthis._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));\r\n\t\t\tthis._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));\r\n\t\t}\r\n\r\n\t\t// Instantiate the appropriate L.MarkerCluster class (animated or not).\r\n\t\tthis._topClusterLevel = new this._markerCluster(this, minZoom - 1);\r\n\t},\r\n\r\n\t//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)\r\n\t_addLayer: function (layer, zoom) {\r\n\t\tvar gridClusters = this._gridClusters,\r\n\t\t gridUnclustered = this._gridUnclustered,\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\r\n\t\t markerPoint, z;\r\n\r\n\t\tif (this.options.singleMarkerMode) {\r\n\t\t\tthis._overrideMarkerIcon(layer);\r\n\t\t}\r\n\r\n\t\tlayer.on(this._childMarkerEventHandlers, this);\r\n\r\n\t\t//Find the lowest zoom level to slot this one in\r\n\t\tfor (; zoom >= minZoom; zoom--) {\r\n\t\t\tmarkerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position\r\n\r\n\t\t\t//Try find a cluster close by\r\n\t\t\tvar closest = gridClusters[zoom].getNearObject(markerPoint);\r\n\t\t\tif (closest) {\r\n\t\t\t\tclosest._addChild(layer);\r\n\t\t\t\tlayer.__parent = closest;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Try find a marker close by to form a new cluster with\r\n\t\t\tclosest = gridUnclustered[zoom].getNearObject(markerPoint);\r\n\t\t\tif (closest) {\r\n\t\t\t\tvar parent = closest.__parent;\r\n\t\t\t\tif (parent) {\r\n\t\t\t\t\tthis._removeLayer(closest, false);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Create new cluster with these 2 in it\r\n\r\n\t\t\t\tvar newCluster = new this._markerCluster(this, zoom, closest, layer);\r\n\t\t\t\tgridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));\r\n\t\t\t\tclosest.__parent = newCluster;\r\n\t\t\t\tlayer.__parent = newCluster;\r\n\r\n\t\t\t\t//First create any new intermediate parent clusters that don't exist\r\n\t\t\t\tvar lastParent = newCluster;\r\n\t\t\t\tfor (z = zoom - 1; z > parent._zoom; z--) {\r\n\t\t\t\t\tlastParent = new this._markerCluster(this, z, lastParent);\r\n\t\t\t\t\tgridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));\r\n\t\t\t\t}\r\n\t\t\t\tparent._addChild(lastParent);\r\n\r\n\t\t\t\t//Remove closest from this zoom level and any above that it is in, replace with newCluster\r\n\t\t\t\tthis._removeFromGridUnclustered(closest, zoom);\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards\r\n\t\t\tgridUnclustered[zoom].addObject(layer, markerPoint);\r\n\t\t}\r\n\r\n\t\t//Didn't get in anything, add us to the top\r\n\t\tthis._topClusterLevel._addChild(layer);\r\n\t\tlayer.__parent = this._topClusterLevel;\r\n\t\treturn;\r\n\t},\r\n\r\n\t/**\r\n\t * Refreshes the icon of all \"dirty\" visible clusters.\r\n\t * Non-visible \"dirty\" clusters will be updated when they are added to the map.\r\n\t * @private\r\n\t */\r\n\t_refreshClustersIcons: function () {\r\n\t\tthis._featureGroup.eachLayer(function (c) {\r\n\t\t\tif (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {\r\n\t\t\t\tc._updateIcon();\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t//Enqueue code to fire after the marker expand/contract has happened\r\n\t_enqueue: function (fn) {\r\n\t\tthis._queue.push(fn);\r\n\t\tif (!this._queueTimeout) {\r\n\t\t\tthis._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300);\r\n\t\t}\r\n\t},\r\n\t_processQueue: function () {\r\n\t\tfor (var i = 0; i < this._queue.length; i++) {\r\n\t\t\tthis._queue[i].call(this);\r\n\t\t}\r\n\t\tthis._queue.length = 0;\r\n\t\tclearTimeout(this._queueTimeout);\r\n\t\tthis._queueTimeout = null;\r\n\t},\r\n\r\n\t//Merge and split any existing clusters that are too big or small\r\n\t_mergeSplitClusters: function () {\r\n\t\tvar mapZoom = Math.round(this._map._zoom);\r\n\r\n\t\t//In case we are starting to split before the animation finished\r\n\t\tthis._processQueue();\r\n\r\n\t\tif (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split\r\n\t\t\tthis._animationStart();\r\n\t\t\t//Remove clusters now off screen\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds());\r\n\r\n\t\t\tthis._animationZoomIn(this._zoom, mapZoom);\r\n\r\n\t\t} else if (this._zoom > mapZoom) { //Zoom out, merge\r\n\t\t\tthis._animationStart();\r\n\r\n\t\t\tthis._animationZoomOut(this._zoom, mapZoom);\r\n\t\t} else {\r\n\t\t\tthis._moveEnd();\r\n\t\t}\r\n\t},\r\n\r\n\t//Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)\r\n\t_getExpandedVisibleBounds: function () {\r\n\t\tif (!this.options.removeOutsideVisibleBounds) {\r\n\t\t\treturn this._mapBoundsInfinite;\r\n\t\t} else if (L.Browser.mobile) {\r\n\t\t\treturn this._checkBoundsMaxLat(this._map.getBounds());\r\n\t\t}\r\n\r\n\t\treturn this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor.\r\n\t},\r\n\r\n\t/**\r\n\t * Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude\r\n\t * (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas).\r\n\t * Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without\r\n\t * this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit,\r\n\t * making the user think that MCG \"eats\" them and never displays them again.\r\n\t * @param bounds L.LatLngBounds\r\n\t * @returns {L.LatLngBounds}\r\n\t * @private\r\n\t */\r\n\t_checkBoundsMaxLat: function (bounds) {\r\n\t\tvar maxLat = this._maxLat;\r\n\r\n\t\tif (maxLat !== undefined) {\r\n\t\t\tif (bounds.getNorth() >= maxLat) {\r\n\t\t\t\tbounds._northEast.lat = Infinity;\r\n\t\t\t}\r\n\t\t\tif (bounds.getSouth() <= -maxLat) {\r\n\t\t\t\tbounds._southWest.lat = -Infinity;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bounds;\r\n\t},\r\n\r\n\t//Shared animation code\r\n\t_animationAddLayerNonAnimated: function (layer, newCluster) {\r\n\t\tif (newCluster === layer) {\r\n\t\t\tthis._featureGroup.addLayer(layer);\r\n\t\t} else if (newCluster._childCount === 2) {\r\n\t\t\tnewCluster._addToMap();\r\n\r\n\t\t\tvar markers = newCluster.getAllChildMarkers();\r\n\t\t\tthis._featureGroup.removeLayer(markers[0]);\r\n\t\t\tthis._featureGroup.removeLayer(markers[1]);\r\n\t\t} else {\r\n\t\t\tnewCluster._updateIcon();\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Extracts individual (i.e. non-group) layers from a Layer Group.\r\n\t * @param group to extract layers from.\r\n\t * @param output {Array} in which to store the extracted layers.\r\n\t * @returns {*|Array}\r\n\t * @private\r\n\t */\r\n\t_extractNonGroupLayers: function (group, output) {\r\n\t\tvar layers = group.getLayers(),\r\n\t\t i = 0,\r\n\t\t layer;\r\n\r\n\t\toutput = output || [];\r\n\r\n\t\tfor (; i < layers.length; i++) {\r\n\t\t\tlayer = layers[i];\r\n\r\n\t\t\tif (layer instanceof L.LayerGroup) {\r\n\t\t\t\tthis._extractNonGroupLayers(layer, output);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\toutput.push(layer);\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\r\n\t/**\r\n\t * Implements the singleMarkerMode option.\r\n\t * @param layer Marker to re-style using the Clusters iconCreateFunction.\r\n\t * @returns {L.Icon} The newly created icon.\r\n\t * @private\r\n\t */\r\n\t_overrideMarkerIcon: function (layer) {\r\n\t\tvar icon = layer.options.icon = this.options.iconCreateFunction({\r\n\t\t\tgetChildCount: function () {\r\n\t\t\t\treturn 1;\r\n\t\t\t},\r\n\t\t\tgetAllChildMarkers: function () {\r\n\t\t\t\treturn [layer];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn icon;\r\n\t}\r\n});\r\n\r\n// Constant bounds used in case option \"removeOutsideVisibleBounds\" is set to false.\r\nL.MarkerClusterGroup.include({\r\n\t_mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity))\r\n});\r\n\r\nL.MarkerClusterGroup.include({\r\n\t_noAnimation: {\r\n\t\t//Non Animated versions of everything\r\n\t\t_animationStart: function () {\r\n\t\t\t//Do nothing...\r\n\t\t},\r\n\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\r\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\r\n\r\n\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\r\n\t\t\tthis.fire('animationend');\r\n\t\t},\r\n\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\r\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\r\n\r\n\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\r\n\t\t\tthis.fire('animationend');\r\n\t\t},\r\n\t\t_animationAddLayer: function (layer, newCluster) {\r\n\t\t\tthis._animationAddLayerNonAnimated(layer, newCluster);\r\n\t\t}\r\n\t},\r\n\r\n\t_withAnimation: {\r\n\t\t//Animated versions here\r\n\t\t_animationStart: function () {\r\n\t\t\tthis._map._mapPane.className += ' leaflet-cluster-anim';\r\n\t\t\tthis._inZoomAnimation++;\r\n\t\t},\r\n\r\n\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tvar bounds = this._getExpandedVisibleBounds(),\r\n\t\t\t fg = this._featureGroup,\r\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\r\n\t\t\t i;\r\n\r\n\t\t\tthis._ignoreMove = true;\r\n\r\n\t\t\t//Add all children of current clusters to map and remove those clusters from map\r\n\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\r\n\t\t\t\tvar startPos = c._latlng,\r\n\t\t\t\t markers = c._markers,\r\n\t\t\t\t m;\r\n\r\n\t\t\t\tif (!bounds.contains(startPos)) {\r\n\t\t\t\t\tstartPos = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us\r\n\t\t\t\t\tfg.removeLayer(c);\r\n\t\t\t\t\tc._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Fade out old cluster\r\n\t\t\t\t\tc.clusterHide();\r\n\t\t\t\t\tc._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Remove all markers that aren't visible any more\r\n\t\t\t\t//TODO: Do we actually need to do this on the higher levels too?\r\n\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = markers[i];\r\n\t\t\t\t\tif (!bounds.contains(m._latlng)) {\r\n\t\t\t\t\t\tfg.removeLayer(m);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\r\n\t\t\tthis._forceLayout();\r\n\r\n\t\t\t//Update opacities\r\n\t\t\tthis._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);\r\n\t\t\t//TODO Maybe? Update markers in _recursivelyBecomeVisible\r\n\t\t\tfg.eachLayer(function (n) {\r\n\t\t\t\tif (!(n instanceof L.MarkerCluster) && n._icon) {\r\n\t\t\t\t\tn.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//update the positions of the just added clusters/markers\r\n\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {\r\n\t\t\t\tc._recursivelyRestoreChildPositions(newZoomLevel);\r\n\t\t\t});\r\n\r\n\t\t\tthis._ignoreMove = false;\r\n\r\n\t\t\t//Remove the old clusters and close the zoom animation\r\n\t\t\tthis._enqueue(function () {\r\n\t\t\t\t//update the positions of the just added clusters/markers\r\n\t\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\r\n\t\t\t\t\tfg.removeLayer(c);\r\n\t\t\t\t\tc.clusterShow();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis._animationEnd();\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\r\n\t\t\tthis._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);\r\n\r\n\t\t\t//Need to add markers for those that weren't on the map before but are now\r\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\r\n\t\t\t//Remove markers that were on the map before but won't be now\r\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds());\r\n\t\t},\r\n\r\n\t\t_animationAddLayer: function (layer, newCluster) {\r\n\t\t\tvar me = this,\r\n\t\t\t fg = this._featureGroup;\r\n\r\n\t\t\tfg.addLayer(layer);\r\n\t\t\tif (newCluster !== layer) {\r\n\t\t\t\tif (newCluster._childCount > 2) { //Was already a cluster\r\n\r\n\t\t\t\t\tnewCluster._updateIcon();\r\n\t\t\t\t\tthis._forceLayout();\r\n\t\t\t\t\tthis._animationStart();\r\n\r\n\t\t\t\t\tlayer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));\r\n\t\t\t\t\tlayer.clusterHide();\r\n\r\n\t\t\t\t\tthis._enqueue(function () {\r\n\t\t\t\t\t\tfg.removeLayer(layer);\r\n\t\t\t\t\t\tlayer.clusterShow();\r\n\r\n\t\t\t\t\t\tme._animationEnd();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t} else { //Just became a cluster\r\n\t\t\t\t\tthis._forceLayout();\r\n\r\n\t\t\t\t\tme._animationStart();\r\n\t\t\t\t\tme._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// Private methods for animated versions.\r\n\t_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {\r\n\t\tvar bounds = this._getExpandedVisibleBounds(),\r\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\r\n\r\n\t\t//Animate all of the markers in the clusters to move to their cluster center point\r\n\t\tcluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel);\r\n\r\n\t\tvar me = this;\r\n\r\n\t\t//Update the opacity (If we immediately set it they won't animate)\r\n\t\tthis._forceLayout();\r\n\t\tcluster._recursivelyBecomeVisible(bounds, newZoomLevel);\r\n\r\n\t\t//TODO: Maybe use the transition timing stuff to make this more reliable\r\n\t\t//When the animations are done, tidy up\r\n\t\tthis._enqueue(function () {\r\n\r\n\t\t\t//This cluster stopped being a cluster before the timeout fired\r\n\t\t\tif (cluster._childCount === 1) {\r\n\t\t\t\tvar m = cluster._markers[0];\r\n\t\t\t\t//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it\r\n\t\t\t\tthis._ignoreMove = true;\r\n\t\t\t\tm.setLatLng(m.getLatLng());\r\n\t\t\t\tthis._ignoreMove = false;\r\n\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcluster._recursively(bounds, newZoomLevel, minZoom, function (c) {\r\n\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tme._animationEnd();\r\n\t\t});\r\n\t},\r\n\r\n\t_animationEnd: function () {\r\n\t\tif (this._map) {\r\n\t\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\r\n\t\t}\r\n\t\tthis._inZoomAnimation--;\r\n\t\tthis.fire('animationend');\r\n\t},\r\n\r\n\t//Force a browser layout of stuff in the map\r\n\t// Should apply the current opacity and location to all elements so we can update them again for an animation\r\n\t_forceLayout: function () {\r\n\t\t//In my testing this works, infact offsetWidth of any element seems to work.\r\n\t\t//Could loop all this._layers and do this for each _icon if it stops working\r\n\r\n\t\tL.Util.falseFn(document.body.offsetWidth);\r\n\t}\r\n});\r\n\r\nL.markerClusterGroup = function (options) {\r\n\treturn new L.MarkerClusterGroup(options);\r\n};\r\n","export var MarkerCluster = L.MarkerCluster = L.Marker.extend({\r\n\toptions: L.Icon.prototype.options,\r\n\r\n\tinitialize: function (group, zoom, a, b) {\r\n\r\n\t\tL.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0),\r\n { icon: this, pane: group.options.clusterPane });\r\n\r\n\t\tthis._group = group;\r\n\t\tthis._zoom = zoom;\r\n\r\n\t\tthis._markers = [];\r\n\t\tthis._childClusters = [];\r\n\t\tthis._childCount = 0;\r\n\t\tthis._iconNeedsUpdate = true;\r\n\t\tthis._boundsNeedUpdate = true;\r\n\r\n\t\tthis._bounds = new L.LatLngBounds();\r\n\r\n\t\tif (a) {\r\n\t\t\tthis._addChild(a);\r\n\t\t}\r\n\t\tif (b) {\r\n\t\t\tthis._addChild(b);\r\n\t\t}\r\n\t},\r\n\r\n\t//Recursively retrieve all child markers of this cluster\r\n\tgetAllChildMarkers: function (storageArray, ignoreDraggedMarker) {\r\n\t\tstorageArray = storageArray || [];\r\n\r\n\t\tfor (var i = this._childClusters.length - 1; i >= 0; i--) {\r\n\t\t\tthis._childClusters[i].getAllChildMarkers(storageArray);\r\n\t\t}\r\n\r\n\t\tfor (var j = this._markers.length - 1; j >= 0; j--) {\r\n\t\t\tif (ignoreDraggedMarker && this._markers[j].__dragStart) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tstorageArray.push(this._markers[j]);\r\n\t\t}\r\n\r\n\t\treturn storageArray;\r\n\t},\r\n\r\n\t//Returns the count of how many child markers we have\r\n\tgetChildCount: function () {\r\n\t\treturn this._childCount;\r\n\t},\r\n\r\n\t//Zoom to the minimum of showing all of the child markers, or the extents of this cluster\r\n\tzoomToBounds: function (fitBoundsOptions) {\r\n\t\tvar childClusters = this._childClusters.slice(),\r\n\t\t\tmap = this._group._map,\r\n\t\t\tboundsZoom = map.getBoundsZoom(this._bounds),\r\n\t\t\tzoom = this._zoom + 1,\r\n\t\t\tmapZoom = map.getZoom(),\r\n\t\t\ti;\r\n\r\n\t\t//calculate how far we need to zoom down to see all of the markers\r\n\t\twhile (childClusters.length > 0 && boundsZoom > zoom) {\r\n\t\t\tzoom++;\r\n\t\t\tvar newClusters = [];\r\n\t\t\tfor (i = 0; i < childClusters.length; i++) {\r\n\t\t\t\tnewClusters = newClusters.concat(childClusters[i]._childClusters);\r\n\t\t\t}\r\n\t\t\tchildClusters = newClusters;\r\n\t\t}\r\n\r\n\t\tif (boundsZoom > zoom) {\r\n\t\t\tthis._group._map.setView(this._latlng, zoom);\r\n\t\t} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead\r\n\t\t\tthis._group._map.setView(this._latlng, mapZoom + 1);\r\n\t\t} else {\r\n\t\t\tthis._group._map.fitBounds(this._bounds, fitBoundsOptions);\r\n\t\t}\r\n\t},\r\n\r\n\tgetBounds: function () {\r\n\t\tvar bounds = new L.LatLngBounds();\r\n\t\tbounds.extend(this._bounds);\r\n\t\treturn bounds;\r\n\t},\r\n\r\n\t_updateIcon: function () {\r\n\t\tthis._iconNeedsUpdate = true;\r\n\t\tif (this._icon) {\r\n\t\t\tthis.setIcon(this);\r\n\t\t}\r\n\t},\r\n\r\n\t//Cludge for Icon, we pretend to be an icon for performance\r\n\tcreateIcon: function () {\r\n\t\tif (this._iconNeedsUpdate) {\r\n\t\t\tthis._iconObj = this._group.options.iconCreateFunction(this);\r\n\t\t\tthis._iconNeedsUpdate = false;\r\n\t\t}\r\n\t\treturn this._iconObj.createIcon();\r\n\t},\r\n\tcreateShadow: function () {\r\n\t\treturn this._iconObj.createShadow();\r\n\t},\r\n\r\n\r\n\t_addChild: function (new1, isNotificationFromChild) {\r\n\r\n\t\tthis._iconNeedsUpdate = true;\r\n\r\n\t\tthis._boundsNeedUpdate = true;\r\n\t\tthis._setClusterCenter(new1);\r\n\r\n\t\tif (new1 instanceof L.MarkerCluster) {\r\n\t\t\tif (!isNotificationFromChild) {\r\n\t\t\t\tthis._childClusters.push(new1);\r\n\t\t\t\tnew1.__parent = this;\r\n\t\t\t}\r\n\t\t\tthis._childCount += new1._childCount;\r\n\t\t} else {\r\n\t\t\tif (!isNotificationFromChild) {\r\n\t\t\t\tthis._markers.push(new1);\r\n\t\t\t}\r\n\t\t\tthis._childCount++;\r\n\t\t}\r\n\r\n\t\tif (this.__parent) {\r\n\t\t\tthis.__parent._addChild(new1, true);\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position.\r\n\t * @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet.\r\n\t * @private\r\n\t */\r\n\t_setClusterCenter: function (child) {\r\n\t\tif (!this._cLatLng) {\r\n\t\t\t// when clustering, take position of the first point as the cluster center\r\n\t\t\tthis._cLatLng = child._cLatLng || child._latlng;\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Assigns impossible bounding values so that the next extend entirely determines the new bounds.\r\n\t * This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class.\r\n\t * As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended.\r\n\t * @private\r\n\t */\r\n\t_resetBounds: function () {\r\n\t\tvar bounds = this._bounds;\r\n\r\n\t\tif (bounds._southWest) {\r\n\t\t\tbounds._southWest.lat = Infinity;\r\n\t\t\tbounds._southWest.lng = Infinity;\r\n\t\t}\r\n\t\tif (bounds._northEast) {\r\n\t\t\tbounds._northEast.lat = -Infinity;\r\n\t\t\tbounds._northEast.lng = -Infinity;\r\n\t\t}\r\n\t},\r\n\r\n\t_recalculateBounds: function () {\r\n\t\tvar markers = this._markers,\r\n\t\t childClusters = this._childClusters,\r\n\t\t latSum = 0,\r\n\t\t lngSum = 0,\r\n\t\t totalCount = this._childCount,\r\n\t\t i, child, childLatLng, childCount;\r\n\r\n\t\t// Case where all markers are removed from the map and we are left with just an empty _topClusterLevel.\r\n\t\tif (totalCount === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Reset rather than creating a new object, for performance.\r\n\t\tthis._resetBounds();\r\n\r\n\t\t// Child markers.\r\n\t\tfor (i = 0; i < markers.length; i++) {\r\n\t\t\tchildLatLng = markers[i]._latlng;\r\n\r\n\t\t\tthis._bounds.extend(childLatLng);\r\n\r\n\t\t\tlatSum += childLatLng.lat;\r\n\t\t\tlngSum += childLatLng.lng;\r\n\t\t}\r\n\r\n\t\t// Child clusters.\r\n\t\tfor (i = 0; i < childClusters.length; i++) {\r\n\t\t\tchild = childClusters[i];\r\n\r\n\t\t\t// Re-compute child bounds and weighted position first if necessary.\r\n\t\t\tif (child._boundsNeedUpdate) {\r\n\t\t\t\tchild._recalculateBounds();\r\n\t\t\t}\r\n\r\n\t\t\tthis._bounds.extend(child._bounds);\r\n\r\n\t\t\tchildLatLng = child._wLatLng;\r\n\t\t\tchildCount = child._childCount;\r\n\r\n\t\t\tlatSum += childLatLng.lat * childCount;\r\n\t\t\tlngSum += childLatLng.lng * childCount;\r\n\t\t}\r\n\r\n\t\tthis._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount);\r\n\r\n\t\t// Reset dirty flag.\r\n\t\tthis._boundsNeedUpdate = false;\r\n\t},\r\n\r\n\t//Set our markers position as given and add it to the map\r\n\t_addToMap: function (startPos) {\r\n\t\tif (startPos) {\r\n\t\t\tthis._backupLatlng = this._latlng;\r\n\t\t\tthis.setLatLng(startPos);\r\n\t\t}\r\n\t\tthis._group._featureGroup.addLayer(this);\r\n\t},\r\n\r\n\t_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {\r\n\t\tthis._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,\r\n\t\t\tfunction (c) {\r\n\t\t\t\tvar markers = c._markers,\r\n\t\t\t\t\ti, m;\r\n\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = markers[i];\r\n\r\n\t\t\t\t\t//Only do it if the icon is still on the map\r\n\t\t\t\t\tif (m._icon) {\r\n\t\t\t\t\t\tm._setPos(center);\r\n\t\t\t\t\t\tm.clusterHide();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction (c) {\r\n\t\t\t\tvar childClusters = c._childClusters,\r\n\t\t\t\t\tj, cm;\r\n\t\t\t\tfor (j = childClusters.length - 1; j >= 0; j--) {\r\n\t\t\t\t\tcm = childClusters[j];\r\n\t\t\t\t\tif (cm._icon) {\r\n\t\t\t\t\t\tcm._setPos(center);\r\n\t\t\t\t\t\tcm.clusterHide();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) {\r\n\t\tthis._recursively(bounds, newZoomLevel, mapMinZoom,\r\n\t\t\tfunction (c) {\r\n\t\t\t\tc._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);\r\n\r\n\t\t\t\t//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.\r\n\t\t\t\t//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate\r\n\t\t\t\tif (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {\r\n\t\t\t\t\tc.clusterShow();\r\n\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds\r\n\t\t\t\t} else {\r\n\t\t\t\t\tc.clusterHide();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tc._addToMap();\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t_recursivelyBecomeVisible: function (bounds, zoomLevel) {\r\n\t\tthis._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {\r\n\t\t\tc.clusterShow();\r\n\t\t});\r\n\t},\r\n\r\n\t_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {\r\n\t\tthis._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,\r\n\t\t\tfunction (c) {\r\n\t\t\t\tif (zoomLevel === c._zoom) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Add our child markers at startPos (so they can be animated out)\r\n\t\t\t\tfor (var i = c._markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tvar nm = c._markers[i];\r\n\r\n\t\t\t\t\tif (!bounds.contains(nm._latlng)) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (startPos) {\r\n\t\t\t\t\t\tnm._backupLatlng = nm.getLatLng();\r\n\r\n\t\t\t\t\t\tnm.setLatLng(startPos);\r\n\t\t\t\t\t\tif (nm.clusterHide) {\r\n\t\t\t\t\t\t\tnm.clusterHide();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tc._group._featureGroup.addLayer(nm);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction (c) {\r\n\t\t\t\tc._addToMap(startPos);\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t_recursivelyRestoreChildPositions: function (zoomLevel) {\r\n\t\t//Fix positions of child markers\r\n\t\tfor (var i = this._markers.length - 1; i >= 0; i--) {\r\n\t\t\tvar nm = this._markers[i];\r\n\t\t\tif (nm._backupLatlng) {\r\n\t\t\t\tnm.setLatLng(nm._backupLatlng);\r\n\t\t\t\tdelete nm._backupLatlng;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (zoomLevel - 1 === this._zoom) {\r\n\t\t\t//Reposition child clusters\r\n\t\t\tfor (var j = this._childClusters.length - 1; j >= 0; j--) {\r\n\t\t\t\tthis._childClusters[j]._restorePosition();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var k = this._childClusters.length - 1; k >= 0; k--) {\r\n\t\t\t\tthis._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_restorePosition: function () {\r\n\t\tif (this._backupLatlng) {\r\n\t\t\tthis.setLatLng(this._backupLatlng);\r\n\t\t\tdelete this._backupLatlng;\r\n\t\t}\r\n\t},\r\n\r\n\t//exceptBounds: If set, don't remove any markers/clusters in it\r\n\t_recursivelyRemoveChildrenFromMap: function (previousBounds, mapMinZoom, zoomLevel, exceptBounds) {\r\n\t\tvar m, i;\r\n\t\tthis._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1,\r\n\t\t\tfunction (c) {\r\n\t\t\t\t//Remove markers at every level\r\n\t\t\t\tfor (i = c._markers.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = c._markers[i];\r\n\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\r\n\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\r\n\t\t\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tfunction (c) {\r\n\t\t\t\t//Remove child clusters at just the bottom level\r\n\t\t\t\tfor (i = c._childClusters.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tm = c._childClusters[i];\r\n\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\r\n\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\r\n\t\t\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t},\r\n\r\n\t//Run the given functions recursively to this and child clusters\r\n\t// boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to\r\n\t// zoomLevelToStart: zoom level to start running functions (inclusive)\r\n\t// zoomLevelToStop: zoom level to stop running functions (inclusive)\r\n\t// runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level\r\n\t// runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level\r\n\t_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {\r\n\t\tvar childClusters = this._childClusters,\r\n\t\t zoom = this._zoom,\r\n\t\t i, c;\r\n\r\n\t\tif (zoomLevelToStart <= zoom) {\r\n\t\t\tif (runAtEveryLevel) {\r\n\t\t\t\trunAtEveryLevel(this);\r\n\t\t\t}\r\n\t\t\tif (runAtBottomLevel && zoom === zoomLevelToStop) {\r\n\t\t\t\trunAtBottomLevel(this);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (zoom < zoomLevelToStart || zoom < zoomLevelToStop) {\r\n\t\t\tfor (i = childClusters.length - 1; i >= 0; i--) {\r\n\t\t\t\tc = childClusters[i];\r\n\t\t\t\tif (c._boundsNeedUpdate) {\r\n\t\t\t\t\tc._recalculateBounds();\r\n\t\t\t\t}\r\n\t\t\t\tif (boundsToApplyTo.intersects(c._bounds)) {\r\n\t\t\t\t\tc._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//Returns true if we are the parent of only one cluster and that cluster is the same as us\r\n\t_isSingleParent: function () {\r\n\t\t//Don't need to check this._markers as the rest won't work if there are any\r\n\t\treturn this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount;\r\n\t}\r\n});\r\n\r\n","/*\r\n* Extends L.Marker to include two extra methods: clusterHide and clusterShow.\r\n* \r\n* They work as setOpacity(0) and setOpacity(1) respectively, but\r\n* don't overwrite the options.opacity\r\n* \r\n*/\r\n\r\nL.Marker.include({\r\n\tclusterHide: function () {\r\n\t\tvar backup = this.options.opacity;\r\n\t\tthis.setOpacity(0);\r\n\t\tthis.options.opacity = backup;\r\n\t\treturn this;\r\n\t},\r\n\t\r\n\tclusterShow: function () {\r\n\t\treturn this.setOpacity(this.options.opacity);\r\n\t}\r\n});\r\n\r\n\r\n","\r\nL.DistanceGrid = function (cellSize) {\r\n\tthis._cellSize = cellSize;\r\n\tthis._sqCellSize = cellSize * cellSize;\r\n\tthis._grid = {};\r\n\tthis._objectPoint = { };\r\n};\r\n\r\nL.DistanceGrid.prototype = {\r\n\r\n\taddObject: function (obj, point) {\r\n\t\tvar x = this._getCoord(point.x),\r\n\t\t y = this._getCoord(point.y),\r\n\t\t grid = this._grid,\r\n\t\t row = grid[y] = grid[y] || {},\r\n\t\t cell = row[x] = row[x] || [],\r\n\t\t stamp = L.Util.stamp(obj);\r\n\r\n\t\tthis._objectPoint[stamp] = point;\r\n\r\n\t\tcell.push(obj);\r\n\t},\r\n\r\n\tupdateObject: function (obj, point) {\r\n\t\tthis.removeObject(obj);\r\n\t\tthis.addObject(obj, point);\r\n\t},\r\n\r\n\t//Returns true if the object was found\r\n\tremoveObject: function (obj, point) {\r\n\t\tvar x = this._getCoord(point.x),\r\n\t\t y = this._getCoord(point.y),\r\n\t\t grid = this._grid,\r\n\t\t row = grid[y] = grid[y] || {},\r\n\t\t cell = row[x] = row[x] || [],\r\n\t\t i, len;\r\n\r\n\t\tdelete this._objectPoint[L.Util.stamp(obj)];\r\n\r\n\t\tfor (i = 0, len = cell.length; i < len; i++) {\r\n\t\t\tif (cell[i] === obj) {\r\n\r\n\t\t\t\tcell.splice(i, 1);\r\n\r\n\t\t\t\tif (len === 1) {\r\n\t\t\t\t\tdelete row[x];\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t},\r\n\r\n\teachObject: function (fn, context) {\r\n\t\tvar i, j, k, len, row, cell, removed,\r\n\t\t grid = this._grid;\r\n\r\n\t\tfor (i in grid) {\r\n\t\t\trow = grid[i];\r\n\r\n\t\t\tfor (j in row) {\r\n\t\t\t\tcell = row[j];\r\n\r\n\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\r\n\t\t\t\t\tremoved = fn.call(context, cell[k]);\r\n\t\t\t\t\tif (removed) {\r\n\t\t\t\t\t\tk--;\r\n\t\t\t\t\t\tlen--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tgetNearObject: function (point) {\r\n\t\tvar x = this._getCoord(point.x),\r\n\t\t y = this._getCoord(point.y),\r\n\t\t i, j, k, row, cell, len, obj, dist,\r\n\t\t objectPoint = this._objectPoint,\r\n\t\t closestDistSq = this._sqCellSize,\r\n\t\t closest = null;\r\n\r\n\t\tfor (i = y - 1; i <= y + 1; i++) {\r\n\t\t\trow = this._grid[i];\r\n\t\t\tif (row) {\r\n\r\n\t\t\t\tfor (j = x - 1; j <= x + 1; j++) {\r\n\t\t\t\t\tcell = row[j];\r\n\t\t\t\t\tif (cell) {\r\n\r\n\t\t\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\r\n\t\t\t\t\t\t\tobj = cell[k];\r\n\t\t\t\t\t\t\tdist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);\r\n\t\t\t\t\t\t\tif (dist < closestDistSq ||\r\n\t\t\t\t\t\t\t\tdist <= closestDistSq && closest === null) {\r\n\t\t\t\t\t\t\t\tclosestDistSq = dist;\r\n\t\t\t\t\t\t\t\tclosest = obj;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closest;\r\n\t},\r\n\r\n\t_getCoord: function (x) {\r\n\t\tvar coord = Math.floor(x / this._cellSize);\r\n\t\treturn isFinite(coord) ? coord : x;\r\n\t},\r\n\r\n\t_sqDist: function (p, p2) {\r\n\t\tvar dx = p2.x - p.x,\r\n\t\t dy = p2.y - p.y;\r\n\t\treturn dx * dx + dy * dy;\r\n\t}\r\n};\r\n","/* Copyright (c) 2012 the authors listed at the following URL, and/or\r\nthe authors of referenced articles or incorporated external code:\r\nhttp://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining\r\na copy of this software and associated documentation files (the\r\n\"Software\"), to deal in the Software without restriction, including\r\nwithout limitation the rights to use, copy, modify, merge, publish,\r\ndistribute, sublicense, and/or sell copies of the Software, and to\r\npermit persons to whom the Software is furnished to do so, subject to\r\nthe following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be\r\nincluded in all copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\r\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\r\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\r\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\r\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\nRetrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434\r\n*/\r\n\r\n(function () {\r\n\tL.QuickHull = {\r\n\r\n\t\t/*\r\n\t\t * @param {Object} cpt a point to be measured from the baseline\r\n\t\t * @param {Array} bl the baseline, as represented by a two-element\r\n\t\t * array of latlng objects.\r\n\t\t * @returns {Number} an approximate distance measure\r\n\t\t */\r\n\t\tgetDistant: function (cpt, bl) {\r\n\t\t\tvar vY = bl[1].lat - bl[0].lat,\r\n\t\t\t\tvX = bl[0].lng - bl[1].lng;\r\n\t\t\treturn (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng));\r\n\t\t},\r\n\r\n\t\t/*\r\n\t\t * @param {Array} baseLine a two-element array of latlng objects\r\n\t\t * representing the baseline to project from\r\n\t\t * @param {Array} latLngs an array of latlng objects\r\n\t\t * @returns {Object} the maximum point and all new points to stay\r\n\t\t * in consideration for the hull.\r\n\t\t */\r\n\t\tfindMostDistantPointFromBaseLine: function (baseLine, latLngs) {\r\n\t\t\tvar maxD = 0,\r\n\t\t\t\tmaxPt = null,\r\n\t\t\t\tnewPoints = [],\r\n\t\t\t\ti, pt, d;\r\n\r\n\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\r\n\t\t\t\tpt = latLngs[i];\r\n\t\t\t\td = this.getDistant(pt, baseLine);\r\n\r\n\t\t\t\tif (d > 0) {\r\n\t\t\t\t\tnewPoints.push(pt);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (d > maxD) {\r\n\t\t\t\t\tmaxD = d;\r\n\t\t\t\t\tmaxPt = pt;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn { maxPoint: maxPt, newPoints: newPoints };\r\n\t\t},\r\n\r\n\r\n\t\t/*\r\n\t\t * Given a baseline, compute the convex hull of latLngs as an array\r\n\t\t * of latLngs.\r\n\t\t *\r\n\t\t * @param {Array} latLngs\r\n\t\t * @returns {Array}\r\n\t\t */\r\n\t\tbuildConvexHull: function (baseLine, latLngs) {\r\n\t\t\tvar convexHullBaseLines = [],\r\n\t\t\t\tt = this.findMostDistantPointFromBaseLine(baseLine, latLngs);\r\n\r\n\t\t\tif (t.maxPoint) { // if there is still a point \"outside\" the base line\r\n\t\t\t\tconvexHullBaseLines =\r\n\t\t\t\t\tconvexHullBaseLines.concat(\r\n\t\t\t\t\t\tthis.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints)\r\n\t\t\t\t\t);\r\n\t\t\t\tconvexHullBaseLines =\r\n\t\t\t\t\tconvexHullBaseLines.concat(\r\n\t\t\t\t\t\tthis.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints)\r\n\t\t\t\t\t);\r\n\t\t\t\treturn convexHullBaseLines;\r\n\t\t\t} else { // if there is no more point \"outside\" the base line, the current base line is part of the convex hull\r\n\t\t\t\treturn [baseLine[0]];\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t/*\r\n\t\t * Given an array of latlngs, compute a convex hull as an array\r\n\t\t * of latlngs\r\n\t\t *\r\n\t\t * @param {Array} latLngs\r\n\t\t * @returns {Array}\r\n\t\t */\r\n\t\tgetConvexHull: function (latLngs) {\r\n\t\t\t// find first baseline\r\n\t\t\tvar maxLat = false, minLat = false,\r\n\t\t\t\tmaxLng = false, minLng = false,\r\n\t\t\t\tmaxLatPt = null, minLatPt = null,\r\n\t\t\t\tmaxLngPt = null, minLngPt = null,\r\n\t\t\t\tmaxPt = null, minPt = null,\r\n\t\t\t\ti;\r\n\r\n\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\r\n\t\t\t\tvar pt = latLngs[i];\r\n\t\t\t\tif (maxLat === false || pt.lat > maxLat) {\r\n\t\t\t\t\tmaxLatPt = pt;\r\n\t\t\t\t\tmaxLat = pt.lat;\r\n\t\t\t\t}\r\n\t\t\t\tif (minLat === false || pt.lat < minLat) {\r\n\t\t\t\t\tminLatPt = pt;\r\n\t\t\t\t\tminLat = pt.lat;\r\n\t\t\t\t}\r\n\t\t\t\tif (maxLng === false || pt.lng > maxLng) {\r\n\t\t\t\t\tmaxLngPt = pt;\r\n\t\t\t\t\tmaxLng = pt.lng;\r\n\t\t\t\t}\r\n\t\t\t\tif (minLng === false || pt.lng < minLng) {\r\n\t\t\t\t\tminLngPt = pt;\r\n\t\t\t\t\tminLng = pt.lng;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (minLat !== maxLat) {\r\n\t\t\t\tminPt = minLatPt;\r\n\t\t\t\tmaxPt = maxLatPt;\r\n\t\t\t} else {\r\n\t\t\t\tminPt = minLngPt;\r\n\t\t\t\tmaxPt = maxLngPt;\r\n\t\t\t}\r\n\r\n\t\t\tvar ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),\r\n\t\t\t\t\t\t\t\tthis.buildConvexHull([maxPt, minPt], latLngs));\r\n\t\t\treturn ch;\r\n\t\t}\r\n\t};\r\n}());\r\n\r\nL.MarkerCluster.include({\r\n\tgetConvexHull: function () {\r\n\t\tvar childMarkers = this.getAllChildMarkers(),\r\n\t\t\tpoints = [],\r\n\t\t\tp, i;\r\n\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tp = childMarkers[i].getLatLng();\r\n\t\t\tpoints.push(p);\r\n\t\t}\r\n\r\n\t\treturn L.QuickHull.getConvexHull(points);\r\n\t}\r\n});\r\n","//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet\r\n//Huge thanks to jawj for implementing it first to make my job easy :-)\r\n\r\nL.MarkerCluster.include({\r\n\r\n\t_2PI: Math.PI * 2,\r\n\t_circleFootSeparation: 25, //related to circumference of circle\r\n\t_circleStartAngle: 0,\r\n\r\n\t_spiralFootSeparation: 28, //related to size of spiral (experiment!)\r\n\t_spiralLengthStart: 11,\r\n\t_spiralLengthFactor: 5,\r\n\r\n\t_circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards.\r\n\t\t\t\t\t\t\t\t// 0 -> always spiral; Infinity -> always circle\r\n\r\n\tspiderfy: function () {\r\n\t\tif (this._group._spiderfied === this || this._group._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar childMarkers = this.getAllChildMarkers(null, true),\r\n\t\t\tgroup = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tcenter = map.latLngToLayerPoint(this._latlng),\r\n\t\t\tpositions;\r\n\r\n\t\tthis._group._unspiderfy();\r\n\t\tthis._group._spiderfied = this;\r\n\r\n\t\t//TODO Maybe: childMarkers order by distance to center\r\n\r\n\t\tif (childMarkers.length >= this._circleSpiralSwitchover) {\r\n\t\t\tpositions = this._generatePointsSpiral(childMarkers.length, center);\r\n\t\t} else {\r\n\t\t\tcenter.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons.\r\n\t\t\tpositions = this._generatePointsCircle(childMarkers.length, center);\r\n\t\t}\r\n\r\n\t\tthis._animationSpiderfy(childMarkers, positions);\r\n\t},\r\n\r\n\tunspiderfy: function (zoomDetails) {\r\n\t\t/// <param Name=\"zoomDetails\">Argument from zoomanim if being called in a zoom animation or null otherwise</param>\r\n\t\tif (this._group._inZoomAnimation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._animationUnspiderfy(zoomDetails);\r\n\r\n\t\tthis._group._spiderfied = null;\r\n\t},\r\n\r\n\t_generatePointsCircle: function (count, centerPt) {\r\n\t\tvar circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count),\r\n\t\t\tlegLength = circumference / this._2PI, //radius from circumference\r\n\t\t\tangleStep = this._2PI / count,\r\n\t\t\tres = [],\r\n\t\t\ti, angle;\r\n\r\n\t\tlegLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon.\r\n\r\n\t\tres.length = count;\r\n\r\n\t\tfor (i = 0; i < count; i++) { // Clockwise, like spiral.\r\n\t\t\tangle = this._circleStartAngle + i * angleStep;\r\n\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t},\r\n\r\n\t_generatePointsSpiral: function (count, centerPt) {\r\n\t\tvar spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier,\r\n\t\t\tlegLength = spiderfyDistanceMultiplier * this._spiralLengthStart,\r\n\t\t\tseparation = spiderfyDistanceMultiplier * this._spiralFootSeparation,\r\n\t\t\tlengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI,\r\n\t\t\tangle = 0,\r\n\t\t\tres = [],\r\n\t\t\ti;\r\n\r\n\t\tres.length = count;\r\n\r\n\t\t// Higher index, closer position to cluster center.\r\n\t\tfor (i = count; i >= 0; i--) {\r\n\t\t\t// Skip the first position, so that we are already farther from center and we avoid\r\n\t\t\t// being under the default cluster icon (especially important for Circle Markers).\r\n\t\t\tif (i < count) {\r\n\t\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\r\n\t\t\t}\r\n\t\t\tangle += separation / legLength + i * 0.0005;\r\n\t\t\tlegLength += lengthFactor / angle;\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\t_noanimationUnspiderfy: function () {\r\n\t\tvar group = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\r\n\t\t\tm, i;\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\r\n\t\tthis.setOpacity(1);\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\tfg.removeLayer(m);\r\n\r\n\t\t\tif (m._preSpiderfyLatlng) {\r\n\t\t\t\tm.setLatLng(m._preSpiderfyLatlng);\r\n\t\t\t\tdelete m._preSpiderfyLatlng;\r\n\t\t\t}\r\n\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\tm.setZIndexOffset(0);\r\n\t\t\t}\r\n\r\n\t\t\tif (m._spiderLeg) {\r\n\t\t\t\tmap.removeLayer(m._spiderLeg);\r\n\t\t\t\tdelete m._spiderLeg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tgroup.fire('unspiderfied', {\r\n\t\t\tcluster: this,\r\n\t\t\tmarkers: childMarkers\r\n\t\t});\r\n\t\tgroup._ignoreMove = false;\r\n\t\tgroup._spiderfied = null;\r\n\t}\r\n});\r\n\r\n//Non Animated versions of everything\r\nL.MarkerClusterNonAnimated = L.MarkerCluster.extend({\r\n\t_animationSpiderfy: function (childMarkers, positions) {\r\n\t\tvar group = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tlegOptions = this._group.options.spiderLegPolylineOptions,\r\n\t\t\ti, m, leg, newPos;\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\r\n\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\r\n\t\t// The reverse order trick no longer improves performance on modern browsers.\r\n\t\tfor (i = 0; i < childMarkers.length; i++) {\r\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\r\n\t\t\tleg = new L.Polyline([this._latlng, newPos], legOptions);\r\n\t\t\tmap.addLayer(leg);\r\n\t\t\tm._spiderLeg = leg;\r\n\r\n\t\t\t// Now add the marker.\r\n\t\t\tm._preSpiderfyLatlng = m._latlng;\r\n\t\t\tm.setLatLng(newPos);\r\n\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\tm.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING\r\n\t\t\t}\r\n\r\n\t\t\tfg.addLayer(m);\r\n\t\t}\r\n\t\tthis.setOpacity(0.3);\r\n\r\n\t\tgroup._ignoreMove = false;\r\n\t\tgroup.fire('spiderfied', {\r\n\t\t\tcluster: this,\r\n\t\t\tmarkers: childMarkers\r\n\t\t});\r\n\t},\r\n\r\n\t_animationUnspiderfy: function () {\r\n\t\tthis._noanimationUnspiderfy();\r\n\t}\r\n});\r\n\r\n//Animated versions here\r\nL.MarkerCluster.include({\r\n\r\n\t_animationSpiderfy: function (childMarkers, positions) {\r\n\t\tvar me = this,\r\n\t\t\tgroup = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tthisLayerLatLng = this._latlng,\r\n\t\t\tthisLayerPos = map.latLngToLayerPoint(thisLayerLatLng),\r\n\t\t\tsvg = L.Path.SVG,\r\n\t\t\tlegOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation.\r\n\t\t\tfinalLegOpacity = legOptions.opacity,\r\n\t\t\ti, m, leg, legPath, legLength, newPos;\r\n\r\n\t\tif (finalLegOpacity === undefined) {\r\n\t\t\tfinalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity;\r\n\t\t}\r\n\r\n\t\tif (svg) {\r\n\t\t\t// If the initial opacity of the spider leg is not 0 then it appears before the animation starts.\r\n\t\t\tlegOptions.opacity = 0;\r\n\r\n\t\t\t// Add the class for CSS transitions.\r\n\t\t\tlegOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg';\r\n\t\t} else {\r\n\t\t\t// Make sure we have a defined opacity.\r\n\t\t\tlegOptions.opacity = finalLegOpacity;\r\n\t\t}\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\r\n\t\t// Add markers and spider legs to map, hidden at our center point.\r\n\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\r\n\t\t// The reverse order trick no longer improves performance on modern browsers.\r\n\t\tfor (i = 0; i < childMarkers.length; i++) {\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\r\n\r\n\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\r\n\t\t\tleg = new L.Polyline([thisLayerLatLng, newPos], legOptions);\r\n\t\t\tmap.addLayer(leg);\r\n\t\t\tm._spiderLeg = leg;\r\n\r\n\t\t\t// Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/\r\n\t\t\t// In our case the transition property is declared in the CSS file.\r\n\t\t\tif (svg) {\r\n\t\t\t\tlegPath = leg._path;\r\n\t\t\t\tlegLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox.\r\n\t\t\t\tlegPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated.\r\n\t\t\t\tlegPath.style.strokeDashoffset = legLength;\r\n\t\t\t}\r\n\r\n\t\t\t// If it is a marker, add it now and we'll animate it out\r\n\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\tm.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING\r\n\t\t\t}\r\n\t\t\tif (m.clusterHide) {\r\n\t\t\t\tm.clusterHide();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Vectors just get immediately added\r\n\t\t\tfg.addLayer(m);\r\n\r\n\t\t\tif (m._setPos) {\r\n\t\t\t\tm._setPos(thisLayerPos);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tgroup._forceLayout();\r\n\t\tgroup._animationStart();\r\n\r\n\t\t// Reveal markers and spider legs.\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t//Move marker to new position\r\n\t\t\tm._preSpiderfyLatlng = m._latlng;\r\n\t\t\tm.setLatLng(newPos);\r\n\t\t\t\r\n\t\t\tif (m.clusterShow) {\r\n\t\t\t\tm.clusterShow();\r\n\t\t\t}\r\n\r\n\t\t\t// Animate leg (animation is actually delegated to CSS transition).\r\n\t\t\tif (svg) {\r\n\t\t\t\tleg = m._spiderLeg;\r\n\t\t\t\tlegPath = leg._path;\r\n\t\t\t\tlegPath.style.strokeDashoffset = 0;\r\n\t\t\t\t//legPath.style.strokeOpacity = finalLegOpacity;\r\n\t\t\t\tleg.setStyle({opacity: finalLegOpacity});\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.setOpacity(0.3);\r\n\r\n\t\tgroup._ignoreMove = false;\r\n\r\n\t\tsetTimeout(function () {\r\n\t\t\tgroup._animationEnd();\r\n\t\t\tgroup.fire('spiderfied', {\r\n\t\t\t\tcluster: me,\r\n\t\t\t\tmarkers: childMarkers\r\n\t\t\t});\r\n\t\t}, 200);\r\n\t},\r\n\r\n\t_animationUnspiderfy: function (zoomDetails) {\r\n\t\tvar me = this,\r\n\t\t\tgroup = this._group,\r\n\t\t\tmap = group._map,\r\n\t\t\tfg = group._featureGroup,\r\n\t\t\tthisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),\r\n\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\r\n\t\t\tsvg = L.Path.SVG,\r\n\t\t\tm, i, leg, legPath, legLength, nonAnimatable;\r\n\r\n\t\tgroup._ignoreMove = true;\r\n\t\tgroup._animationStart();\r\n\r\n\t\t//Make us visible and bring the child markers back in\r\n\t\tthis.setOpacity(1);\r\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t//Marker was added to us after we were spiderfied\r\n\t\t\tif (!m._preSpiderfyLatlng) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll\r\n\t\t\tm.closePopup();\r\n\r\n\t\t\t//Fix up the location to the real one\r\n\t\t\tm.setLatLng(m._preSpiderfyLatlng);\r\n\t\t\tdelete m._preSpiderfyLatlng;\r\n\r\n\t\t\t//Hack override the location to be our center\r\n\t\t\tnonAnimatable = true;\r\n\t\t\tif (m._setPos) {\r\n\t\t\t\tm._setPos(thisLayerPos);\r\n\t\t\t\tnonAnimatable = false;\r\n\t\t\t}\r\n\t\t\tif (m.clusterHide) {\r\n\t\t\t\tm.clusterHide();\r\n\t\t\t\tnonAnimatable = false;\r\n\t\t\t}\r\n\t\t\tif (nonAnimatable) {\r\n\t\t\t\tfg.removeLayer(m);\r\n\t\t\t}\r\n\r\n\t\t\t// Animate the spider leg back in (animation is actually delegated to CSS transition).\r\n\t\t\tif (svg) {\r\n\t\t\t\tleg = m._spiderLeg;\r\n\t\t\t\tlegPath = leg._path;\r\n\t\t\t\tlegLength = legPath.getTotalLength() + 0.1;\r\n\t\t\t\tlegPath.style.strokeDashoffset = legLength;\r\n\t\t\t\tleg.setStyle({opacity: 0});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tgroup._ignoreMove = false;\r\n\r\n\t\tsetTimeout(function () {\r\n\t\t\t//If we have only <= one child left then that marker will be shown on the map so don't remove it!\r\n\t\t\tvar stillThereChildCount = 0;\r\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\t\tm = childMarkers[i];\r\n\t\t\t\tif (m._spiderLeg) {\r\n\t\t\t\t\tstillThereChildCount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\r\n\t\t\t\tm = childMarkers[i];\r\n\r\n\t\t\t\tif (!m._spiderLeg) { //Has already been unspiderfied\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (m.clusterShow) {\r\n\t\t\t\t\tm.clusterShow();\r\n\t\t\t\t}\r\n\t\t\t\tif (m.setZIndexOffset) {\r\n\t\t\t\t\tm.setZIndexOffset(0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (stillThereChildCount > 1) {\r\n\t\t\t\t\tfg.removeLayer(m);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmap.removeLayer(m._spiderLeg);\r\n\t\t\t\tdelete m._spiderLeg;\r\n\t\t\t}\r\n\t\t\tgroup._animationEnd();\r\n\t\t\tgroup.fire('unspiderfied', {\r\n\t\t\t\tcluster: me,\r\n\t\t\t\tmarkers: childMarkers\r\n\t\t\t});\r\n\t\t}, 200);\r\n\t}\r\n});\r\n\r\n\r\nL.MarkerClusterGroup.include({\r\n\t//The MarkerCluster currently spiderfied (if any)\r\n\t_spiderfied: null,\r\n\r\n\tunspiderfy: function () {\r\n\t\tthis._unspiderfy.apply(this, arguments);\r\n\t},\r\n\r\n\t_spiderfierOnAdd: function () {\r\n\t\tthis._map.on('click', this._unspiderfyWrapper, this);\r\n\r\n\t\tif (this._map.options.zoomAnimation) {\r\n\t\t\tthis._map.on('zoomstart', this._unspiderfyZoomStart, this);\r\n\t\t}\r\n\t\t//Browsers without zoomAnimation or a big zoom don't fire zoomstart\r\n\t\tthis._map.on('zoomend', this._noanimationUnspiderfy, this);\r\n\r\n\t\tif (!L.Browser.touch) {\r\n\t\t\tthis._map.getRenderer(this);\r\n\t\t\t//Needs to happen in the pageload, not after, or animations don't work in webkit\r\n\t\t\t// http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements\r\n\t\t\t//Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable\r\n\t\t}\r\n\t},\r\n\r\n\t_spiderfierOnRemove: function () {\r\n\t\tthis._map.off('click', this._unspiderfyWrapper, this);\r\n\t\tthis._map.off('zoomstart', this._unspiderfyZoomStart, this);\r\n\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\r\n\t\tthis._map.off('zoomend', this._noanimationUnspiderfy, this);\r\n\r\n\t\t//Ensure that markers are back where they should be\r\n\t\t// Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane\r\n\t\tthis._noanimationUnspiderfy();\r\n\t},\r\n\r\n\t//On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)\r\n\t//This means we can define the animation they do rather than Markers doing an animation to their actual location\r\n\t_unspiderfyZoomStart: function () {\r\n\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._map.on('zoomanim', this._unspiderfyZoomAnim, this);\r\n\t},\r\n\r\n\t_unspiderfyZoomAnim: function (zoomDetails) {\r\n\t\t//Wait until the first zoomanim after the user has finished touch-zooming before running the animation\r\n\t\tif (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\r\n\t\tthis._unspiderfy(zoomDetails);\r\n\t},\r\n\r\n\t_unspiderfyWrapper: function () {\r\n\t\t/// <summary>_unspiderfy but passes no arguments</summary>\r\n\t\tthis._unspiderfy();\r\n\t},\r\n\r\n\t_unspiderfy: function (zoomDetails) {\r\n\t\tif (this._spiderfied) {\r\n\t\t\tthis._spiderfied.unspiderfy(zoomDetails);\r\n\t\t}\r\n\t},\r\n\r\n\t_noanimationUnspiderfy: function () {\r\n\t\tif (this._spiderfied) {\r\n\t\t\tthis._spiderfied._noanimationUnspiderfy();\r\n\t\t}\r\n\t},\r\n\r\n\t//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc\r\n\t_unspiderfyLayer: function (layer) {\r\n\t\tif (layer._spiderLeg) {\r\n\t\t\tthis._featureGroup.removeLayer(layer);\r\n\r\n\t\t\tif (layer.clusterShow) {\r\n\t\t\t\tlayer.clusterShow();\r\n\t\t\t}\r\n\t\t\t\t//Position will be fixed up immediately in _animationUnspiderfy\r\n\t\t\tif (layer.setZIndexOffset) {\r\n\t\t\t\tlayer.setZIndexOffset(0);\r\n\t\t\t}\r\n\r\n\t\t\tthis._map.removeLayer(layer._spiderLeg);\r\n\t\t\tdelete layer._spiderLeg;\r\n\t\t}\r\n\t}\r\n});\r\n","/**\r\n * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing\r\n * markers' icon options and refreshing their icon and their parent clusters\r\n * accordingly (case where their iconCreateFunction uses data of childMarkers\r\n * to make up the cluster icon).\r\n */\r\n\r\n\r\nL.MarkerClusterGroup.include({\r\n\t/**\r\n\t * Updates the icon of all clusters which are parents of the given marker(s).\r\n\t * In singleMarkerMode, also updates the given marker(s) icon.\r\n\t * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|\r\n\t * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent\r\n\t * clusters need to be updated. If not provided, retrieves all child markers of this.\r\n\t * @returns {L.MarkerClusterGroup}\r\n\t */\r\n\trefreshClusters: function (layers) {\r\n\t\tif (!layers) {\r\n\t\t\tlayers = this._topClusterLevel.getAllChildMarkers();\r\n\t\t} else if (layers instanceof L.MarkerClusterGroup) {\r\n\t\t\tlayers = layers._topClusterLevel.getAllChildMarkers();\r\n\t\t} else if (layers instanceof L.LayerGroup) {\r\n\t\t\tlayers = layers._layers;\r\n\t\t} else if (layers instanceof L.MarkerCluster) {\r\n\t\t\tlayers = layers.getAllChildMarkers();\r\n\t\t} else if (layers instanceof L.Marker) {\r\n\t\t\tlayers = [layers];\r\n\t\t} // else: must be an Array(L.Marker)|Map(L.Marker)\r\n\t\tthis._flagParentsIconsNeedUpdate(layers);\r\n\t\tthis._refreshClustersIcons();\r\n\r\n\t\t// In case of singleMarkerMode, also re-draw the markers.\r\n\t\tif (this.options.singleMarkerMode) {\r\n\t\t\tthis._refreshSingleMarkerModeMarkers(layers);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/**\r\n\t * Simply flags all parent clusters of the given markers as having a \"dirty\" icon.\r\n\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\r\n\t * @private\r\n\t */\r\n\t_flagParentsIconsNeedUpdate: function (layers) {\r\n\t\tvar id, parent;\r\n\r\n\t\t// Assumes layers is an Array or an Object whose prototype is non-enumerable.\r\n\t\tfor (id in layers) {\r\n\t\t\t// Flag parent clusters' icon as \"dirty\", all the way up.\r\n\t\t\t// Dumb process that flags multiple times upper parents, but still\r\n\t\t\t// much more efficient than trying to be smart and make short lists,\r\n\t\t\t// at least in the case of a hierarchy following a power law:\r\n\t\t\t// http://jsperf.com/flag-nodes-in-power-hierarchy/2\r\n\t\t\tparent = layers[id].__parent;\r\n\t\t\twhile (parent) {\r\n\t\t\t\tparent._iconNeedsUpdate = true;\r\n\t\t\t\tparent = parent.__parent;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * Re-draws the icon of the supplied markers.\r\n\t * To be used in singleMarkerMode only.\r\n\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\r\n\t * @private\r\n\t */\r\n\t_refreshSingleMarkerModeMarkers: function (layers) {\r\n\t\tvar id, layer;\r\n\r\n\t\tfor (id in layers) {\r\n\t\t\tlayer = layers[id];\r\n\r\n\t\t\t// Make sure we do not override markers that do not belong to THIS group.\r\n\t\t\tif (this.hasLayer(layer)) {\r\n\t\t\t\t// Need to re-create the icon first, then re-draw the marker.\r\n\t\t\t\tlayer.setIcon(this._overrideMarkerIcon(layer));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n});\r\n\r\nL.Marker.include({\r\n\t/**\r\n\t * Updates the given options in the marker's icon and refreshes the marker.\r\n\t * @param options map object of icon options.\r\n\t * @param directlyRefreshClusters boolean (optional) true to trigger\r\n\t * MCG.refreshClustersOf() right away with this single marker.\r\n\t * @returns {L.Marker}\r\n\t */\r\n\trefreshIconOptions: function (options, directlyRefreshClusters) {\r\n\t\tvar icon = this.options.icon;\r\n\r\n\t\tL.setOptions(icon, options);\r\n\r\n\t\tthis.setIcon(icon);\r\n\r\n\t\t// Shortcut to refresh the associated MCG clusters right away.\r\n\t\t// To be used when refreshing a single marker.\r\n\t\t// Otherwise, better use MCG.refreshClusters() once at the end with\r\n\t\t// the list of modified markers.\r\n\t\tif (directlyRefreshClusters && this.__parent) {\r\n\t\t\tthis.__parent._group.refreshClusters(this);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;AAIA,AAAO,IAAI,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC,MAAM,CA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AMlB,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;GAC7B,OAAO,MAAM,EAAE;IACd,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAC/B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IACzB;GACD;EACD;;;;;;;;CAQD,+BAA+B,EAAE,UAAU,MAAM,EAAE;EAClD,IAAI,EAAE,EAAE,KAAK,CAAC;;EAEd,KAAK,EAAE,IAAI,MAAM,EAAE;GAClB,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;;;GAGnB,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;;IAEzB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C;GACD;EACD;CACD,CAAC,CAAC;;AAEH,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;CAQhB,kBAAkB,EAAE,UAAU,OAAO,EAAE,uBAAuB,EAAE;EAC/D,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;;EAE7B,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;EAE5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;;;;;;EAMnB,IAAI,uBAAuB,IAAI,IAAI,CAAC,QAAQ,EAAE;GAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;GAC3C;;EAED,OAAO,IAAI,CAAC;EACZ;CACD,CAAC,CAAC;;;;;"}
/*
* Leaflet.markercluster 1.4.1+master.37ab9a2,
* Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.
* https://github.com/Leaflet/Leaflet.markercluster
* (c) 2012-2017, Dave Leaver, smartrak
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.Leaflet = global.Leaflet || {}, global.Leaflet.markercluster = global.Leaflet.markercluster || {})));
}(this, (function (exports) { 'use strict';
/*
* L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within
*/
var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({
options: {
maxClusterRadius: 80, //A cluster will cover at most this many pixels from its center
iconCreateFunction: null,
clusterPane: L.Marker.prototype.options.pane,
spiderfyOnMaxZoom: true,
showCoverageOnHover: true,
zoomToBoundsOnClick: true,
singleMarkerMode: false,
disableClusteringAtZoom: null,
// Setting this to false prevents the removal of any clusters outside of the viewpoint, which
// is the default behaviour for performance reasons.
removeOutsideVisibleBounds: true,
// Set to false to disable all animations (zoom and spiderfy).
// If false, option animateAddingMarkers below has no effect.
// If L.DomUtil.TRANSITION is falsy, this option has no effect.
animate: true,
//Whether to animate adding markers after adding the MarkerClusterGroup to the map
// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.
animateAddingMarkers: false,
//Increase to increase the distance away that spiderfied markers appear from the center
spiderfyDistanceMultiplier: 1,
// Make it possible to specify a polyline options on a spider leg
spiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },
// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts
chunkedLoading: false,
chunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)
chunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser
chunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)
//Options to pass to the L.Polygon constructor
polygonOptions: {}
},
initialize: function (options) {
L.Util.setOptions(this, options);
if (!this.options.iconCreateFunction) {
this.options.iconCreateFunction = this._defaultIconCreateFunction;
}
this._featureGroup = L.featureGroup();
this._featureGroup.addEventParent(this);
this._nonPointGroup = L.featureGroup();
this._nonPointGroup.addEventParent(this);
this._inZoomAnimation = 0;
this._needsClustering = [];
this._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of
//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move
this._currentShownBounds = null;
this._queue = [];
this._childMarkerEventHandlers = {
'dragstart': this._childMarkerDragStart,
'move': this._childMarkerMoved,
'dragend': this._childMarkerDragEnd,
};
// Hook the appropriate animation methods.
var animate = L.DomUtil.TRANSITION && this.options.animate;
L.extend(this, animate ? this._withAnimation : this._noAnimation);
// Remember which MarkerCluster class to instantiate (animated or not).
this._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;
},
addLayer: function (layer) {
if (layer instanceof L.LayerGroup) {
return this.addLayers([layer]);
}
//Don't cluster non point data
if (!layer.getLatLng) {
this._nonPointGroup.addLayer(layer);
this.fire('layeradd', { layer: layer });
return this;
}
if (!this._map) {
this._needsClustering.push(layer);
this.fire('layeradd', { layer: layer });
return this;
}
if (this.hasLayer(layer)) {
return this;
}
//If we have already clustered we'll need to add this one to a cluster
if (this._unspiderfy) {
this._unspiderfy();
}
this._addLayer(layer, this._maxZoom);
this.fire('layeradd', { layer: layer });
// Refresh bounds and weighted positions.
this._topClusterLevel._recalculateBounds();
this._refreshClustersIcons();
//Work out what is visible
var visibleLayer = layer,
currentZoom = this._zoom;
if (layer.__parent) {
while (visibleLayer.__parent._zoom >= currentZoom) {
visibleLayer = visibleLayer.__parent;
}
}
if (this._currentShownBounds.contains(visibleLayer.getLatLng())) {
if (this.options.animateAddingMarkers) {
this._animationAddLayer(layer, visibleLayer);
} else {
this._animationAddLayerNonAnimated(layer, visibleLayer);
}
}
return this;
},
removeLayer: function (layer) {
if (layer instanceof L.LayerGroup) {
return this.removeLayers([layer]);
}
//Non point layers
if (!layer.getLatLng) {
this._nonPointGroup.removeLayer(layer);
this.fire('layerremove', { layer: layer });
return this;
}
if (!this._map) {
if (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {
this._needsRemoving.push({ layer: layer, latlng: layer._latlng });
}
this.fire('layerremove', { layer: layer });
return this;
}
if (!layer.__parent) {
return this;
}
if (this._unspiderfy) {
this._unspiderfy();
this._unspiderfyLayer(layer);
}
//Remove the marker from clusters
this._removeLayer(layer, true);
this.fire('layerremove', { layer: layer });
// Refresh bounds and weighted positions.
this._topClusterLevel._recalculateBounds();
this._refreshClustersIcons();
layer.off(this._childMarkerEventHandlers, this);
if (this._featureGroup.hasLayer(layer)) {
this._featureGroup.removeLayer(layer);
if (layer.clusterShow) {
layer.clusterShow();
}
}
return this;
},
//Takes an array of markers and adds them in bulk
addLayers: function (layersArray, skipLayerAddEvent) {
if (!L.Util.isArray(layersArray)) {
return this.addLayer(layersArray);
}
var fg = this._featureGroup,
npg = this._nonPointGroup,
chunked = this.options.chunkedLoading,
chunkInterval = this.options.chunkInterval,
chunkProgress = this.options.chunkProgress,
l = layersArray.length,
offset = 0,
originalArray = true,
m;
if (this._map) {
var started = (new Date()).getTime();
var process = L.bind(function () {
var start = (new Date()).getTime();
for (; offset < l; offset++) {
if (chunked && offset % 200 === 0) {
// every couple hundred markers, instrument the time elapsed since processing started:
var elapsed = (new Date()).getTime() - start;
if (elapsed > chunkInterval) {
break; // been working too hard, time to take a break :-)
}
}
m = layersArray[offset];
// Group of layers, append children to layersArray and skip.
// Side effects:
// - Total increases, so chunkProgress ratio jumps backward.
// - Groups are not included in this group, only their non-group child layers (hasLayer).
// Changing array length while looping does not affect performance in current browsers:
// http://jsperf.com/for-loop-changing-length/6
if (m instanceof L.LayerGroup) {
if (originalArray) {
layersArray = layersArray.slice();
originalArray = false;
}
this._extractNonGroupLayers(m, layersArray);
l = layersArray.length;
continue;
}
//Not point data, can't be clustered
if (!m.getLatLng) {
npg.addLayer(m);
if (!skipLayerAddEvent) {
this.fire('layeradd', { layer: m });
}
continue;
}
if (this.hasLayer(m)) {
continue;
}
this._addLayer(m, this._maxZoom);
if (!skipLayerAddEvent) {
this.fire('layeradd', { layer: m });
}
//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will
if (m.__parent) {
if (m.__parent.getChildCount() === 2) {
var markers = m.__parent.getAllChildMarkers(),
otherMarker = markers[0] === m ? markers[1] : markers[0];
fg.removeLayer(otherMarker);
}
}
}
if (chunkProgress) {
// report progress and time elapsed:
chunkProgress(offset, l, (new Date()).getTime() - started);
}
// Completed processing all markers.
if (offset === l) {
// Refresh bounds and weighted positions.
this._topClusterLevel._recalculateBounds();
this._refreshClustersIcons();
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);
} else {
setTimeout(process, this.options.chunkDelay);
}
}, this);
process();
} else {
var needsClustering = this._needsClustering;
for (; offset < l; offset++) {
m = layersArray[offset];
// Group of layers, append children to layersArray and skip.
if (m instanceof L.LayerGroup) {
if (originalArray) {
layersArray = layersArray.slice();
originalArray = false;
}
this._extractNonGroupLayers(m, layersArray);
l = layersArray.length;
continue;
}
//Not point data, can't be clustered
if (!m.getLatLng) {
npg.addLayer(m);
continue;
}
if (this.hasLayer(m)) {
continue;
}
needsClustering.push(m);
}
}
return this;
},
//Takes an array of markers and removes them in bulk
removeLayers: function (layersArray) {
var i, m,
l = layersArray.length,
fg = this._featureGroup,
npg = this._nonPointGroup,
originalArray = true;
if (!this._map) {
for (i = 0; i < l; i++) {
m = layersArray[i];
// Group of layers, append children to layersArray and skip.
if (m instanceof L.LayerGroup) {
if (originalArray) {
layersArray = layersArray.slice();
originalArray = false;
}
this._extractNonGroupLayers(m, layersArray);
l = layersArray.length;
continue;
}
this._arraySplice(this._needsClustering, m);
npg.removeLayer(m);
if (this.hasLayer(m)) {
this._needsRemoving.push({ layer: m, latlng: m._latlng });
}
this.fire('layerremove', { layer: m });
}
return this;
}
if (this._unspiderfy) {
this._unspiderfy();
// Work on a copy of the array, so that next loop is not affected.
var layersArray2 = layersArray.slice(),
l2 = l;
for (i = 0; i < l2; i++) {
m = layersArray2[i];
// Group of layers, append children to layersArray and skip.
if (m instanceof L.LayerGroup) {
this._extractNonGroupLayers(m, layersArray2);
l2 = layersArray2.length;
continue;
}
this._unspiderfyLayer(m);
}
}
for (i = 0; i < l; i++) {
m = layersArray[i];
// Group of layers, append children to layersArray and skip.
if (m instanceof L.LayerGroup) {
if (originalArray) {
layersArray = layersArray.slice();
originalArray = false;
}
this._extractNonGroupLayers(m, layersArray);
l = layersArray.length;
continue;
}
if (!m.__parent) {
npg.removeLayer(m);
this.fire('layerremove', { layer: m });
continue;
}
this._removeLayer(m, true, true);
this.fire('layerremove', { layer: m });
if (fg.hasLayer(m)) {
fg.removeLayer(m);
if (m.clusterShow) {
m.clusterShow();
}
}
}
// Refresh bounds and weighted positions.
this._topClusterLevel._recalculateBounds();
this._refreshClustersIcons();
//Fix up the clusters and markers on the map
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);
return this;
},
//Removes all layers from the MarkerClusterGroup
clearLayers: function () {
//Need our own special implementation as the LayerGroup one doesn't work for us
//If we aren't on the map (yet), blow away the markers we know of
if (!this._map) {
this._needsClustering = [];
this._needsRemoving = [];
delete this._gridClusters;
delete this._gridUnclustered;
}
if (this._noanimationUnspiderfy) {
this._noanimationUnspiderfy();
}
//Remove all the visible layers
this._featureGroup.clearLayers();
this._nonPointGroup.clearLayers();
this.eachLayer(function (marker) {
marker.off(this._childMarkerEventHandlers, this);
delete marker.__parent;
}, this);
if (this._map) {
//Reset _topClusterLevel and the DistanceGrids
this._generateInitialClusters();
}
return this;
},
//Override FeatureGroup.getBounds as it doesn't work
getBounds: function () {
var bounds = new L.LatLngBounds();
if (this._topClusterLevel) {
bounds.extend(this._topClusterLevel._bounds);
}
for (var i = this._needsClustering.length - 1; i >= 0; i--) {
bounds.extend(this._needsClustering[i].getLatLng());
}
bounds.extend(this._nonPointGroup.getBounds());
return bounds;
},
//Overrides LayerGroup.eachLayer
eachLayer: function (method, context) {
var markers = this._needsClustering.slice(),
needsRemoving = this._needsRemoving,
thisNeedsRemoving, i, j;
if (this._topClusterLevel) {
this._topClusterLevel.getAllChildMarkers(markers);
}
for (i = markers.length - 1; i >= 0; i--) {
thisNeedsRemoving = true;
for (j = needsRemoving.length - 1; j >= 0; j--) {
if (needsRemoving[j].layer === markers[i]) {
thisNeedsRemoving = false;
break;
}
}
if (thisNeedsRemoving) {
method.call(context, markers[i]);
}
}
this._nonPointGroup.eachLayer(method, context);
},
//Overrides LayerGroup.getLayers
getLayers: function () {
var layers = [];
this.eachLayer(function (l) {
layers.push(l);
});
return layers;
},
//Overrides LayerGroup.getLayer, WARNING: Really bad performance
getLayer: function (id) {
var result = null;
id = parseInt(id, 10);
this.eachLayer(function (l) {
if (L.stamp(l) === id) {
result = l;
}
});
return result;
},
//Returns true if the given layer is in this MarkerClusterGroup
hasLayer: function (layer) {
if (!layer) {
return false;
}
var i, anArray = this._needsClustering;
for (i = anArray.length - 1; i >= 0; i--) {
if (anArray[i] === layer) {
return true;
}
}
anArray = this._needsRemoving;
for (i = anArray.length - 1; i >= 0; i--) {
if (anArray[i].layer === layer) {
return false;
}
}
return !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer);
},
//Zoom down to show the given layer (spiderfying if necessary) then calls the callback
zoomToShowLayer: function (layer, callback) {
if (typeof callback !== 'function') {
callback = function () {};
}
var showMarker = function () {
if ((layer._icon || layer.__parent._icon) && !this._inZoomAnimation) {
this._map.off('moveend', showMarker, this);
this.off('animationend', showMarker, this);
if (layer._icon) {
callback();
} else if (layer.__parent._icon) {
this.once('spiderfied', callback, this);
layer.__parent.spiderfy();
}
}
};
if (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {
//Layer is visible ond on screen, immediate return
callback();
} else if (layer.__parent._zoom < Math.round(this._map._zoom)) {
//Layer should be visible at this zoom level. It must not be on screen so just pan over to it
this._map.on('moveend', showMarker, this);
this._map.panTo(layer.getLatLng());
} else {
this._map.on('moveend', showMarker, this);
this.on('animationend', showMarker, this);
layer.__parent.zoomToBounds();
}
},
//Overrides FeatureGroup.onAdd
onAdd: function (map) {
this._map = map;
var i, l, layer;
if (!isFinite(this._map.getMaxZoom())) {
throw "Map has no maxZoom specified";
}
this._featureGroup.addTo(map);
this._nonPointGroup.addTo(map);
if (!this._gridClusters) {
this._generateInitialClusters();
}
this._maxLat = map.options.crs.projection.MAX_LATITUDE;
//Restore all the positions as they are in the MCG before removing them
for (i = 0, l = this._needsRemoving.length; i < l; i++) {
layer = this._needsRemoving[i];
layer.newlatlng = layer.layer._latlng;
layer.layer._latlng = layer.latlng;
}
//Remove them, then restore their new positions
for (i = 0, l = this._needsRemoving.length; i < l; i++) {
layer = this._needsRemoving[i];
this._removeLayer(layer.layer, true);
layer.layer._latlng = layer.newlatlng;
}
this._needsRemoving = [];
//Remember the current zoom level and bounds
this._zoom = Math.round(this._map._zoom);
this._currentShownBounds = this._getExpandedVisibleBounds();
this._map.on('zoomend', this._zoomEnd, this);
this._map.on('moveend', this._moveEnd, this);
if (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely
this._spiderfierOnAdd();
}
this._bindEvents();
//Actually add our markers to the map:
l = this._needsClustering;
this._needsClustering = [];
this.addLayers(l, true);
},
//Overrides FeatureGroup.onRemove
onRemove: function (map) {
map.off('zoomend', this._zoomEnd, this);
map.off('moveend', this._moveEnd, this);
this._unbindEvents();
//In case we are in a cluster animation
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
if (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely
this._spiderfierOnRemove();
}
delete this._maxLat;
//Clean up all the layers we added to the map
this._hideCoverage();
this._featureGroup.remove();
this._nonPointGroup.remove();
this._featureGroup.clearLayers();
this._map = null;
},
getVisibleParent: function (marker) {
var vMarker = marker;
while (vMarker && !vMarker._icon) {
vMarker = vMarker.__parent;
}
return vMarker || null;
},
//Remove the given object from the given array
_arraySplice: function (anArray, obj) {
for (var i = anArray.length - 1; i >= 0; i--) {
if (anArray[i] === obj) {
anArray.splice(i, 1);
return true;
}
}
},
/**
* Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom.
* @param marker to be removed from _gridUnclustered.
* @param z integer bottom start zoom level (included)
* @private
*/
_removeFromGridUnclustered: function (marker, z) {
var map = this._map,
gridUnclustered = this._gridUnclustered,
minZoom = Math.floor(this._map.getMinZoom());
for (; z >= minZoom; z--) {
if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
break;
}
}
},
_childMarkerDragStart: function (e) {
e.target.__dragStart = e.target._latlng;
},
_childMarkerMoved: function (e) {
if (!this._ignoreMove && !e.target.__dragStart) {
var isPopupOpen = e.target._popup && e.target._popup.isOpen();
this._moveChild(e.target, e.oldLatLng, e.latlng);
if (isPopupOpen) {
e.target.openPopup();
}
}
},
_moveChild: function (layer, from, to) {
layer._latlng = from;
this.removeLayer(layer);
layer._latlng = to;
this.addLayer(layer);
},
_childMarkerDragEnd: function (e) {
var dragStart = e.target.__dragStart;
delete e.target.__dragStart;
if (dragStart) {
this._moveChild(e.target, dragStart, e.target._latlng);
}
},
//Internal function for removing a marker from everything.
//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)
_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {
var gridClusters = this._gridClusters,
gridUnclustered = this._gridUnclustered,
fg = this._featureGroup,
map = this._map,
minZoom = Math.floor(this._map.getMinZoom());
//Remove the marker from distance clusters it might be in
if (removeFromDistanceGrid) {
this._removeFromGridUnclustered(marker, this._maxZoom);
}
//Work our way up the clusters removing them as we go if required
var cluster = marker.__parent,
markers = cluster._markers,
otherMarker;
//Remove the marker from the immediate parents marker list
this._arraySplice(markers, marker);
while (cluster) {
cluster._childCount--;
cluster._boundsNeedUpdate = true;
if (cluster._zoom < minZoom) {
//Top level, do nothing
break;
} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
//We need to push the other marker up to the parent
otherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];
//Update distance grid
gridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));
gridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));
//Move otherMarker up to parent
this._arraySplice(cluster.__parent._childClusters, cluster);
cluster.__parent._markers.push(otherMarker);
otherMarker.__parent = cluster.__parent;
if (cluster._icon) {
//Cluster is currently on the map, need to put the marker on the map instead
fg.removeLayer(cluster);
if (!dontUpdateMap) {
fg.addLayer(otherMarker);
}
}
} else {
cluster._iconNeedsUpdate = true;
}
cluster = cluster.__parent;
}
delete marker.__parent;
},
_isOrIsParent: function (el, oel) {
while (oel) {
if (el === oel) {
return true;
}
oel = oel.parentNode;
}
return false;
},
//Override L.Evented.fire
fire: function (type, data, propagate) {
if (data && data.layer instanceof L.MarkerCluster) {
//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)
if (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) {
return;
}
type = 'cluster' + type;
}
L.FeatureGroup.prototype.fire.call(this, type, data, propagate);
},
//Override L.Evented.listens
listens: function (type, propagate) {
return L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, 'cluster' + type, propagate);
},
//Default functionality
_defaultIconCreateFunction: function (cluster) {
var childCount = cluster.getChildCount();
var c = ' marker-cluster-';
if (childCount < 10) {
c += 'small';
} else if (childCount < 100) {
c += 'medium';
} else {
c += 'large';
}
return new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });
},
_bindEvents: function () {
var map = this._map,
spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,
showCoverageOnHover = this.options.showCoverageOnHover,
zoomToBoundsOnClick = this.options.zoomToBoundsOnClick;
//Zoom on cluster click or spiderfy if we are at the lowest level
if (spiderfyOnMaxZoom || zoomToBoundsOnClick) {
this.on('clusterclick', this._zoomOrSpiderfy, this);
}
//Show convex hull (boundary) polygon on mouse over
if (showCoverageOnHover) {
this.on('clustermouseover', this._showCoverage, this);
this.on('clustermouseout', this._hideCoverage, this);
map.on('zoomend', this._hideCoverage, this);
}
},
_zoomOrSpiderfy: function (e) {
var cluster = e.layer,
bottomCluster = cluster;
while (bottomCluster._childClusters.length === 1) {
bottomCluster = bottomCluster._childClusters[0];
}
if (bottomCluster._zoom === this._maxZoom &&
bottomCluster._childCount === cluster._childCount &&
this.options.spiderfyOnMaxZoom) {
// All child markers are contained in a single cluster from this._maxZoom to this cluster.
cluster.spiderfy();
} else if (this.options.zoomToBoundsOnClick) {
cluster.zoomToBounds();
}
// Focus the map again for keyboard users.
if (e.originalEvent && e.originalEvent.keyCode === 13) {
this._map._container.focus();
}
},
_showCoverage: function (e) {
var map = this._map;
if (this._inZoomAnimation) {
return;
}
if (this._shownPolygon) {
map.removeLayer(this._shownPolygon);
}
if (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) {
this._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions);
map.addLayer(this._shownPolygon);
}
},
_hideCoverage: function () {
if (this._shownPolygon) {
this._map.removeLayer(this._shownPolygon);
this._shownPolygon = null;
}
},
_unbindEvents: function () {
var spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,
showCoverageOnHover = this.options.showCoverageOnHover,
zoomToBoundsOnClick = this.options.zoomToBoundsOnClick,
map = this._map;
if (spiderfyOnMaxZoom || zoomToBoundsOnClick) {
this.off('clusterclick', this._zoomOrSpiderfy, this);
}
if (showCoverageOnHover) {
this.off('clustermouseover', this._showCoverage, this);
this.off('clustermouseout', this._hideCoverage, this);
map.off('zoomend', this._hideCoverage, this);
}
},
_zoomEnd: function () {
if (!this._map) { //May have been removed from the map by a zoomEnd handler
return;
}
this._mergeSplitClusters();
this._zoom = Math.round(this._map._zoom);
this._currentShownBounds = this._getExpandedVisibleBounds();
},
_moveEnd: function () {
if (this._inZoomAnimation) {
return;
}
var newBounds = this._getExpandedVisibleBounds();
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds);
this._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds);
this._currentShownBounds = newBounds;
return;
},
_generateInitialClusters: function () {
var maxZoom = Math.ceil(this._map.getMaxZoom()),
minZoom = Math.floor(this._map.getMinZoom()),
radius = this.options.maxClusterRadius,
radiusFn = radius;
//If we just set maxClusterRadius to a single number, we need to create
//a simple function to return that number. Otherwise, we just have to
//use the function we've passed in.
if (typeof radius !== "function") {
radiusFn = function () { return radius; };
}
if (this.options.disableClusteringAtZoom !== null) {
maxZoom = this.options.disableClusteringAtZoom - 1;
}
this._maxZoom = maxZoom;
this._gridClusters = {};
this._gridUnclustered = {};
//Set up DistanceGrids for each zoom
for (var zoom = maxZoom; zoom >= minZoom; zoom--) {
this._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));
this._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));
}
// Instantiate the appropriate L.MarkerCluster class (animated or not).
this._topClusterLevel = new this._markerCluster(this, minZoom - 1);
},
//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)
_addLayer: function (layer, zoom) {
var gridClusters = this._gridClusters,
gridUnclustered = this._gridUnclustered,
minZoom = Math.floor(this._map.getMinZoom()),
markerPoint, z;
if (this.options.singleMarkerMode) {
this._overrideMarkerIcon(layer);
}
layer.on(this._childMarkerEventHandlers, this);
//Find the lowest zoom level to slot this one in
for (; zoom >= minZoom; zoom--) {
markerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position
//Try find a cluster close by
var closest = gridClusters[zoom].getNearObject(markerPoint);
if (closest) {
closest._addChild(layer);
layer.__parent = closest;
return;
}
//Try find a marker close by to form a new cluster with
closest = gridUnclustered[zoom].getNearObject(markerPoint);
if (closest) {
var parent = closest.__parent;
if (parent) {
this._removeLayer(closest, false);
}
//Create new cluster with these 2 in it
var newCluster = new this._markerCluster(this, zoom, closest, layer);
gridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));
closest.__parent = newCluster;
layer.__parent = newCluster;
//First create any new intermediate parent clusters that don't exist
var lastParent = newCluster;
for (z = zoom - 1; z > parent._zoom; z--) {
lastParent = new this._markerCluster(this, z, lastParent);
gridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));
}
parent._addChild(lastParent);
//Remove closest from this zoom level and any above that it is in, replace with newCluster
this._removeFromGridUnclustered(closest, zoom);
return;
}
//Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards
gridUnclustered[zoom].addObject(layer, markerPoint);
}
//Didn't get in anything, add us to the top
this._topClusterLevel._addChild(layer);
layer.__parent = this._topClusterLevel;
return;
},
/**
* Refreshes the icon of all "dirty" visible clusters.
* Non-visible "dirty" clusters will be updated when they are added to the map.
* @private
*/
_refreshClustersIcons: function () {
this._featureGroup.eachLayer(function (c) {
if (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {
c._updateIcon();
}
});
},
//Enqueue code to fire after the marker expand/contract has happened
_enqueue: function (fn) {
this._queue.push(fn);
if (!this._queueTimeout) {
this._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300);
}
},
_processQueue: function () {
for (var i = 0; i < this._queue.length; i++) {
this._queue[i].call(this);
}
this._queue.length = 0;
clearTimeout(this._queueTimeout);
this._queueTimeout = null;
},
//Merge and split any existing clusters that are too big or small
_mergeSplitClusters: function () {
var mapZoom = Math.round(this._map._zoom);
//In case we are starting to split before the animation finished
this._processQueue();
if (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split
this._animationStart();
//Remove clusters now off screen
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds());
this._animationZoomIn(this._zoom, mapZoom);
} else if (this._zoom > mapZoom) { //Zoom out, merge
this._animationStart();
this._animationZoomOut(this._zoom, mapZoom);
} else {
this._moveEnd();
}
},
//Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)
_getExpandedVisibleBounds: function () {
if (!this.options.removeOutsideVisibleBounds) {
return this._mapBoundsInfinite;
} else if (L.Browser.mobile) {
return this._checkBoundsMaxLat(this._map.getBounds());
}
return this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor.
},
/**
* Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude
* (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas).
* Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without
* this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit,
* making the user think that MCG "eats" them and never displays them again.
* @param bounds L.LatLngBounds
* @returns {L.LatLngBounds}
* @private
*/
_checkBoundsMaxLat: function (bounds) {
var maxLat = this._maxLat;
if (maxLat !== undefined) {
if (bounds.getNorth() >= maxLat) {
bounds._northEast.lat = Infinity;
}
if (bounds.getSouth() <= -maxLat) {
bounds._southWest.lat = -Infinity;
}
}
return bounds;
},
//Shared animation code
_animationAddLayerNonAnimated: function (layer, newCluster) {
if (newCluster === layer) {
this._featureGroup.addLayer(layer);
} else if (newCluster._childCount === 2) {
newCluster._addToMap();
var markers = newCluster.getAllChildMarkers();
this._featureGroup.removeLayer(markers[0]);
this._featureGroup.removeLayer(markers[1]);
} else {
newCluster._updateIcon();
}
},
/**
* Extracts individual (i.e. non-group) layers from a Layer Group.
* @param group to extract layers from.
* @param output {Array} in which to store the extracted layers.
* @returns {*|Array}
* @private
*/
_extractNonGroupLayers: function (group, output) {
var layers = group.getLayers(),
i = 0,
layer;
output = output || [];
for (; i < layers.length; i++) {
layer = layers[i];
if (layer instanceof L.LayerGroup) {
this._extractNonGroupLayers(layer, output);
continue;
}
output.push(layer);
}
return output;
},
/**
* Implements the singleMarkerMode option.
* @param layer Marker to re-style using the Clusters iconCreateFunction.
* @returns {L.Icon} The newly created icon.
* @private
*/
_overrideMarkerIcon: function (layer) {
var icon = layer.options.icon = this.options.iconCreateFunction({
getChildCount: function () {
return 1;
},
getAllChildMarkers: function () {
return [layer];
}
});
return icon;
}
});
// Constant bounds used in case option "removeOutsideVisibleBounds" is set to false.
L.MarkerClusterGroup.include({
_mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity))
});
L.MarkerClusterGroup.include({
_noAnimation: {
//Non Animated versions of everything
_animationStart: function () {
//Do nothing...
},
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//We didn't actually animate, but we use this event to mean "clustering animations have finished"
this.fire('animationend');
},
_animationZoomOut: function (previousZoomLevel, newZoomLevel) {
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//We didn't actually animate, but we use this event to mean "clustering animations have finished"
this.fire('animationend');
},
_animationAddLayer: function (layer, newCluster) {
this._animationAddLayerNonAnimated(layer, newCluster);
}
},
_withAnimation: {
//Animated versions here
_animationStart: function () {
this._map._mapPane.className += ' leaflet-cluster-anim';
this._inZoomAnimation++;
},
_animationZoomIn: function (previousZoomLevel, newZoomLevel) {
var bounds = this._getExpandedVisibleBounds(),
fg = this._featureGroup,
minZoom = Math.floor(this._map.getMinZoom()),
i;
this._ignoreMove = true;
//Add all children of current clusters to map and remove those clusters from map
this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {
var startPos = c._latlng,
markers = c._markers,
m;
if (!bounds.contains(startPos)) {
startPos = null;
}
if (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us
fg.removeLayer(c);
c._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);
} else {
//Fade out old cluster
c.clusterHide();
c._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);
}
//Remove all markers that aren't visible any more
//TODO: Do we actually need to do this on the higher levels too?
for (i = markers.length - 1; i >= 0; i--) {
m = markers[i];
if (!bounds.contains(m._latlng)) {
fg.removeLayer(m);
}
}
});
this._forceLayout();
//Update opacities
this._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);
//TODO Maybe? Update markers in _recursivelyBecomeVisible
fg.eachLayer(function (n) {
if (!(n instanceof L.MarkerCluster) && n._icon) {
n.clusterShow();
}
});
//update the positions of the just added clusters/markers
this._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {
c._recursivelyRestoreChildPositions(newZoomLevel);
});
this._ignoreMove = false;
//Remove the old clusters and close the zoom animation
this._enqueue(function () {
//update the positions of the just added clusters/markers
this._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {
fg.removeLayer(c);
c.clusterShow();
});
this._animationEnd();
});
},
_animationZoomOut: function (previousZoomLevel, newZoomLevel) {
this._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);
//Need to add markers for those that weren't on the map before but are now
this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
//Remove markers that were on the map before but won't be now
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds());
},
_animationAddLayer: function (layer, newCluster) {
var me = this,
fg = this._featureGroup;
fg.addLayer(layer);
if (newCluster !== layer) {
if (newCluster._childCount > 2) { //Was already a cluster
newCluster._updateIcon();
this._forceLayout();
this._animationStart();
layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));
layer.clusterHide();
this._enqueue(function () {
fg.removeLayer(layer);
layer.clusterShow();
me._animationEnd();
});
} else { //Just became a cluster
this._forceLayout();
me._animationStart();
me._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom);
}
}
}
},
// Private methods for animated versions.
_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
var bounds = this._getExpandedVisibleBounds(),
minZoom = Math.floor(this._map.getMinZoom());
//Animate all of the markers in the clusters to move to their cluster center point
cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel);
var me = this;
//Update the opacity (If we immediately set it they won't animate)
this._forceLayout();
cluster._recursivelyBecomeVisible(bounds, newZoomLevel);
//TODO: Maybe use the transition timing stuff to make this more reliable
//When the animations are done, tidy up
this._enqueue(function () {
//This cluster stopped being a cluster before the timeout fired
if (cluster._childCount === 1) {
var m = cluster._markers[0];
//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it
this._ignoreMove = true;
m.setLatLng(m.getLatLng());
this._ignoreMove = false;
if (m.clusterShow) {
m.clusterShow();
}
} else {
cluster._recursively(bounds, newZoomLevel, minZoom, function (c) {
c._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1);
});
}
me._animationEnd();
});
},
_animationEnd: function () {
if (this._map) {
this._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');
}
this._inZoomAnimation--;
this.fire('animationend');
},
//Force a browser layout of stuff in the map
// Should apply the current opacity and location to all elements so we can update them again for an animation
_forceLayout: function () {
//In my testing this works, infact offsetWidth of any element seems to work.
//Could loop all this._layers and do this for each _icon if it stops working
L.Util.falseFn(document.body.offsetWidth);
}
});
L.markerClusterGroup = function (options) {
return new L.MarkerClusterGroup(options);
};
var MarkerCluster = L.MarkerCluster = L.Marker.extend({
options: L.Icon.prototype.options,
initialize: function (group, zoom, a, b) {
L.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0),
{ icon: this, pane: group.options.clusterPane });
this._group = group;
this._zoom = zoom;
this._markers = [];
this._childClusters = [];
this._childCount = 0;
this._iconNeedsUpdate = true;
this._boundsNeedUpdate = true;
this._bounds = new L.LatLngBounds();
if (a) {
this._addChild(a);
}
if (b) {
this._addChild(b);
}
},
//Recursively retrieve all child markers of this cluster
getAllChildMarkers: function (storageArray, ignoreDraggedMarker) {
storageArray = storageArray || [];
for (var i = this._childClusters.length - 1; i >= 0; i--) {
this._childClusters[i].getAllChildMarkers(storageArray);
}
for (var j = this._markers.length - 1; j >= 0; j--) {
if (ignoreDraggedMarker && this._markers[j].__dragStart) {
continue;
}
storageArray.push(this._markers[j]);
}
return storageArray;
},
//Returns the count of how many child markers we have
getChildCount: function () {
return this._childCount;
},
//Zoom to the minimum of showing all of the child markers, or the extents of this cluster
zoomToBounds: function (fitBoundsOptions) {
var childClusters = this._childClusters.slice(),
map = this._group._map,
boundsZoom = map.getBoundsZoom(this._bounds),
zoom = this._zoom + 1,
mapZoom = map.getZoom(),
i;
//calculate how far we need to zoom down to see all of the markers
while (childClusters.length > 0 && boundsZoom > zoom) {
zoom++;
var newClusters = [];
for (i = 0; i < childClusters.length; i++) {
newClusters = newClusters.concat(childClusters[i]._childClusters);
}
childClusters = newClusters;
}
if (boundsZoom > zoom) {
this._group._map.setView(this._latlng, zoom);
} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead
this._group._map.setView(this._latlng, mapZoom + 1);
} else {
this._group._map.fitBounds(this._bounds, fitBoundsOptions);
}
},
getBounds: function () {
var bounds = new L.LatLngBounds();
bounds.extend(this._bounds);
return bounds;
},
_updateIcon: function () {
this._iconNeedsUpdate = true;
if (this._icon) {
this.setIcon(this);
}
},
//Cludge for Icon, we pretend to be an icon for performance
createIcon: function () {
if (this._iconNeedsUpdate) {
this._iconObj = this._group.options.iconCreateFunction(this);
this._iconNeedsUpdate = false;
}
return this._iconObj.createIcon();
},
createShadow: function () {
return this._iconObj.createShadow();
},
_addChild: function (new1, isNotificationFromChild) {
this._iconNeedsUpdate = true;
this._boundsNeedUpdate = true;
this._setClusterCenter(new1);
if (new1 instanceof L.MarkerCluster) {
if (!isNotificationFromChild) {
this._childClusters.push(new1);
new1.__parent = this;
}
this._childCount += new1._childCount;
} else {
if (!isNotificationFromChild) {
this._markers.push(new1);
}
this._childCount++;
}
if (this.__parent) {
this.__parent._addChild(new1, true);
}
},
/**
* Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position.
* @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet.
* @private
*/
_setClusterCenter: function (child) {
if (!this._cLatLng) {
// when clustering, take position of the first point as the cluster center
this._cLatLng = child._cLatLng || child._latlng;
}
},
/**
* Assigns impossible bounding values so that the next extend entirely determines the new bounds.
* This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class.
* As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended.
* @private
*/
_resetBounds: function () {
var bounds = this._bounds;
if (bounds._southWest) {
bounds._southWest.lat = Infinity;
bounds._southWest.lng = Infinity;
}
if (bounds._northEast) {
bounds._northEast.lat = -Infinity;
bounds._northEast.lng = -Infinity;
}
},
_recalculateBounds: function () {
var markers = this._markers,
childClusters = this._childClusters,
latSum = 0,
lngSum = 0,
totalCount = this._childCount,
i, child, childLatLng, childCount;
// Case where all markers are removed from the map and we are left with just an empty _topClusterLevel.
if (totalCount === 0) {
return;
}
// Reset rather than creating a new object, for performance.
this._resetBounds();
// Child markers.
for (i = 0; i < markers.length; i++) {
childLatLng = markers[i]._latlng;
this._bounds.extend(childLatLng);
latSum += childLatLng.lat;
lngSum += childLatLng.lng;
}
// Child clusters.
for (i = 0; i < childClusters.length; i++) {
child = childClusters[i];
// Re-compute child bounds and weighted position first if necessary.
if (child._boundsNeedUpdate) {
child._recalculateBounds();
}
this._bounds.extend(child._bounds);
childLatLng = child._wLatLng;
childCount = child._childCount;
latSum += childLatLng.lat * childCount;
lngSum += childLatLng.lng * childCount;
}
this._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount);
// Reset dirty flag.
this._boundsNeedUpdate = false;
},
//Set our markers position as given and add it to the map
_addToMap: function (startPos) {
if (startPos) {
this._backupLatlng = this._latlng;
this.setLatLng(startPos);
}
this._group._featureGroup.addLayer(this);
},
_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {
this._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,
function (c) {
var markers = c._markers,
i, m;
for (i = markers.length - 1; i >= 0; i--) {
m = markers[i];
//Only do it if the icon is still on the map
if (m._icon) {
m._setPos(center);
m.clusterHide();
}
}
},
function (c) {
var childClusters = c._childClusters,
j, cm;
for (j = childClusters.length - 1; j >= 0; j--) {
cm = childClusters[j];
if (cm._icon) {
cm._setPos(center);
cm.clusterHide();
}
}
}
);
},
_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) {
this._recursively(bounds, newZoomLevel, mapMinZoom,
function (c) {
c._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);
//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.
//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate
if (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {
c.clusterShow();
c._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds
} else {
c.clusterHide();
}
c._addToMap();
}
);
},
_recursivelyBecomeVisible: function (bounds, zoomLevel) {
this._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {
c.clusterShow();
});
},
_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {
this._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,
function (c) {
if (zoomLevel === c._zoom) {
return;
}
//Add our child markers at startPos (so they can be animated out)
for (var i = c._markers.length - 1; i >= 0; i--) {
var nm = c._markers[i];
if (!bounds.contains(nm._latlng)) {
continue;
}
if (startPos) {
nm._backupLatlng = nm.getLatLng();
nm.setLatLng(startPos);
if (nm.clusterHide) {
nm.clusterHide();
}
}
c._group._featureGroup.addLayer(nm);
}
},
function (c) {
c._addToMap(startPos);
}
);
},
_recursivelyRestoreChildPositions: function (zoomLevel) {
//Fix positions of child markers
for (var i = this._markers.length - 1; i >= 0; i--) {
var nm = this._markers[i];
if (nm._backupLatlng) {
nm.setLatLng(nm._backupLatlng);
delete nm._backupLatlng;
}
}
if (zoomLevel - 1 === this._zoom) {
//Reposition child clusters
for (var j = this._childClusters.length - 1; j >= 0; j--) {
this._childClusters[j]._restorePosition();
}
} else {
for (var k = this._childClusters.length - 1; k >= 0; k--) {
this._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel);
}
}
},
_restorePosition: function () {
if (this._backupLatlng) {
this.setLatLng(this._backupLatlng);
delete this._backupLatlng;
}
},
//exceptBounds: If set, don't remove any markers/clusters in it
_recursivelyRemoveChildrenFromMap: function (previousBounds, mapMinZoom, zoomLevel, exceptBounds) {
var m, i;
this._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1,
function (c) {
//Remove markers at every level
for (i = c._markers.length - 1; i >= 0; i--) {
m = c._markers[i];
if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
c._group._featureGroup.removeLayer(m);
if (m.clusterShow) {
m.clusterShow();
}
}
}
},
function (c) {
//Remove child clusters at just the bottom level
for (i = c._childClusters.length - 1; i >= 0; i--) {
m = c._childClusters[i];
if (!exceptBounds || !exceptBounds.contains(m._latlng)) {
c._group._featureGroup.removeLayer(m);
if (m.clusterShow) {
m.clusterShow();
}
}
}
}
);
},
//Run the given functions recursively to this and child clusters
// boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to
// zoomLevelToStart: zoom level to start running functions (inclusive)
// zoomLevelToStop: zoom level to stop running functions (inclusive)
// runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level
// runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level
_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {
var childClusters = this._childClusters,
zoom = this._zoom,
i, c;
if (zoomLevelToStart <= zoom) {
if (runAtEveryLevel) {
runAtEveryLevel(this);
}
if (runAtBottomLevel && zoom === zoomLevelToStop) {
runAtBottomLevel(this);
}
}
if (zoom < zoomLevelToStart || zoom < zoomLevelToStop) {
for (i = childClusters.length - 1; i >= 0; i--) {
c = childClusters[i];
if (c._boundsNeedUpdate) {
c._recalculateBounds();
}
if (boundsToApplyTo.intersects(c._bounds)) {
c._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);
}
}
}
},
//Returns true if we are the parent of only one cluster and that cluster is the same as us
_isSingleParent: function () {
//Don't need to check this._markers as the rest won't work if there are any
return this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount;
}
});
/*
* Extends L.Marker to include two extra methods: clusterHide and clusterShow.
*
* They work as setOpacity(0) and setOpacity(1) respectively, but
* don't overwrite the options.opacity
*
*/
L.Marker.include({
clusterHide: function () {
var backup = this.options.opacity;
this.setOpacity(0);
this.options.opacity = backup;
return this;
},
clusterShow: function () {
return this.setOpacity(this.options.opacity);
}
});
L.DistanceGrid = function (cellSize) {
this._cellSize = cellSize;
this._sqCellSize = cellSize * cellSize;
this._grid = {};
this._objectPoint = { };
};
L.DistanceGrid.prototype = {
addObject: function (obj, point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
grid = this._grid,
row = grid[y] = grid[y] || {},
cell = row[x] = row[x] || [],
stamp = L.Util.stamp(obj);
this._objectPoint[stamp] = point;
cell.push(obj);
},
updateObject: function (obj, point) {
this.removeObject(obj);
this.addObject(obj, point);
},
//Returns true if the object was found
removeObject: function (obj, point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
grid = this._grid,
row = grid[y] = grid[y] || {},
cell = row[x] = row[x] || [],
i, len;
delete this._objectPoint[L.Util.stamp(obj)];
for (i = 0, len = cell.length; i < len; i++) {
if (cell[i] === obj) {
cell.splice(i, 1);
if (len === 1) {
delete row[x];
}
return true;
}
}
},
eachObject: function (fn, context) {
var i, j, k, len, row, cell, removed,
grid = this._grid;
for (i in grid) {
row = grid[i];
for (j in row) {
cell = row[j];
for (k = 0, len = cell.length; k < len; k++) {
removed = fn.call(context, cell[k]);
if (removed) {
k--;
len--;
}
}
}
}
},
getNearObject: function (point) {
var x = this._getCoord(point.x),
y = this._getCoord(point.y),
i, j, k, row, cell, len, obj, dist,
objectPoint = this._objectPoint,
closestDistSq = this._sqCellSize,
closest = null;
for (i = y - 1; i <= y + 1; i++) {
row = this._grid[i];
if (row) {
for (j = x - 1; j <= x + 1; j++) {
cell = row[j];
if (cell) {
for (k = 0, len = cell.length; k < len; k++) {
obj = cell[k];
dist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);
if (dist < closestDistSq ||
dist <= closestDistSq && closest === null) {
closestDistSq = dist;
closest = obj;
}
}
}
}
}
}
return closest;
},
_getCoord: function (x) {
var coord = Math.floor(x / this._cellSize);
return isFinite(coord) ? coord : x;
},
_sqDist: function (p, p2) {
var dx = p2.x - p.x,
dy = p2.y - p.y;
return dx * dx + dy * dy;
}
};
/* Copyright (c) 2012 the authors listed at the following URL, and/or
the authors of referenced articles or incorporated external code:
http://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Retrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434
*/
(function () {
L.QuickHull = {
/*
* @param {Object} cpt a point to be measured from the baseline
* @param {Array} bl the baseline, as represented by a two-element
* array of latlng objects.
* @returns {Number} an approximate distance measure
*/
getDistant: function (cpt, bl) {
var vY = bl[1].lat - bl[0].lat,
vX = bl[0].lng - bl[1].lng;
return (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng));
},
/*
* @param {Array} baseLine a two-element array of latlng objects
* representing the baseline to project from
* @param {Array} latLngs an array of latlng objects
* @returns {Object} the maximum point and all new points to stay
* in consideration for the hull.
*/
findMostDistantPointFromBaseLine: function (baseLine, latLngs) {
var maxD = 0,
maxPt = null,
newPoints = [],
i, pt, d;
for (i = latLngs.length - 1; i >= 0; i--) {
pt = latLngs[i];
d = this.getDistant(pt, baseLine);
if (d > 0) {
newPoints.push(pt);
} else {
continue;
}
if (d > maxD) {
maxD = d;
maxPt = pt;
}
}
return { maxPoint: maxPt, newPoints: newPoints };
},
/*
* Given a baseline, compute the convex hull of latLngs as an array
* of latLngs.
*
* @param {Array} latLngs
* @returns {Array}
*/
buildConvexHull: function (baseLine, latLngs) {
var convexHullBaseLines = [],
t = this.findMostDistantPointFromBaseLine(baseLine, latLngs);
if (t.maxPoint) { // if there is still a point "outside" the base line
convexHullBaseLines =
convexHullBaseLines.concat(
this.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints)
);
convexHullBaseLines =
convexHullBaseLines.concat(
this.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints)
);
return convexHullBaseLines;
} else { // if there is no more point "outside" the base line, the current base line is part of the convex hull
return [baseLine[0]];
}
},
/*
* Given an array of latlngs, compute a convex hull as an array
* of latlngs
*
* @param {Array} latLngs
* @returns {Array}
*/
getConvexHull: function (latLngs) {
// find first baseline
var maxLat = false, minLat = false,
maxLng = false, minLng = false,
maxLatPt = null, minLatPt = null,
maxLngPt = null, minLngPt = null,
maxPt = null, minPt = null,
i;
for (i = latLngs.length - 1; i >= 0; i--) {
var pt = latLngs[i];
if (maxLat === false || pt.lat > maxLat) {
maxLatPt = pt;
maxLat = pt.lat;
}
if (minLat === false || pt.lat < minLat) {
minLatPt = pt;
minLat = pt.lat;
}
if (maxLng === false || pt.lng > maxLng) {
maxLngPt = pt;
maxLng = pt.lng;
}
if (minLng === false || pt.lng < minLng) {
minLngPt = pt;
minLng = pt.lng;
}
}
if (minLat !== maxLat) {
minPt = minLatPt;
maxPt = maxLatPt;
} else {
minPt = minLngPt;
maxPt = maxLngPt;
}
var ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),
this.buildConvexHull([maxPt, minPt], latLngs));
return ch;
}
};
}());
L.MarkerCluster.include({
getConvexHull: function () {
var childMarkers = this.getAllChildMarkers(),
points = [],
p, i;
for (i = childMarkers.length - 1; i >= 0; i--) {
p = childMarkers[i].getLatLng();
points.push(p);
}
return L.QuickHull.getConvexHull(points);
}
});
//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet
//Huge thanks to jawj for implementing it first to make my job easy :-)
L.MarkerCluster.include({
_2PI: Math.PI * 2,
_circleFootSeparation: 25, //related to circumference of circle
_circleStartAngle: 0,
_spiralFootSeparation: 28, //related to size of spiral (experiment!)
_spiralLengthStart: 11,
_spiralLengthFactor: 5,
_circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards.
// 0 -> always spiral; Infinity -> always circle
spiderfy: function () {
if (this._group._spiderfied === this || this._group._inZoomAnimation) {
return;
}
var childMarkers = this.getAllChildMarkers(null, true),
group = this._group,
map = group._map,
center = map.latLngToLayerPoint(this._latlng),
positions;
this._group._unspiderfy();
this._group._spiderfied = this;
//TODO Maybe: childMarkers order by distance to center
if (childMarkers.length >= this._circleSpiralSwitchover) {
positions = this._generatePointsSpiral(childMarkers.length, center);
} else {
center.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons.
positions = this._generatePointsCircle(childMarkers.length, center);
}
this._animationSpiderfy(childMarkers, positions);
},
unspiderfy: function (zoomDetails) {
/// <param Name="zoomDetails">Argument from zoomanim if being called in a zoom animation or null otherwise</param>
if (this._group._inZoomAnimation) {
return;
}
this._animationUnspiderfy(zoomDetails);
this._group._spiderfied = null;
},
_generatePointsCircle: function (count, centerPt) {
var circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count),
legLength = circumference / this._2PI, //radius from circumference
angleStep = this._2PI / count,
res = [],
i, angle;
legLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon.
res.length = count;
for (i = 0; i < count; i++) { // Clockwise, like spiral.
angle = this._circleStartAngle + i * angleStep;
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
}
return res;
},
_generatePointsSpiral: function (count, centerPt) {
var spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier,
legLength = spiderfyDistanceMultiplier * this._spiralLengthStart,
separation = spiderfyDistanceMultiplier * this._spiralFootSeparation,
lengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI,
angle = 0,
res = [],
i;
res.length = count;
// Higher index, closer position to cluster center.
for (i = count; i >= 0; i--) {
// Skip the first position, so that we are already farther from center and we avoid
// being under the default cluster icon (especially important for Circle Markers).
if (i < count) {
res[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();
}
angle += separation / legLength + i * 0.0005;
legLength += lengthFactor / angle;
}
return res;
},
_noanimationUnspiderfy: function () {
var group = this._group,
map = group._map,
fg = group._featureGroup,
childMarkers = this.getAllChildMarkers(null, true),
m, i;
group._ignoreMove = true;
this.setOpacity(1);
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
fg.removeLayer(m);
if (m._preSpiderfyLatlng) {
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;
}
if (m.setZIndexOffset) {
m.setZIndexOffset(0);
}
if (m._spiderLeg) {
map.removeLayer(m._spiderLeg);
delete m._spiderLeg;
}
}
group.fire('unspiderfied', {
cluster: this,
markers: childMarkers
});
group._ignoreMove = false;
group._spiderfied = null;
}
});
//Non Animated versions of everything
L.MarkerClusterNonAnimated = L.MarkerCluster.extend({
_animationSpiderfy: function (childMarkers, positions) {
var group = this._group,
map = group._map,
fg = group._featureGroup,
legOptions = this._group.options.spiderLegPolylineOptions,
i, m, leg, newPos;
group._ignoreMove = true;
// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.
// The reverse order trick no longer improves performance on modern browsers.
for (i = 0; i < childMarkers.length; i++) {
newPos = map.layerPointToLatLng(positions[i]);
m = childMarkers[i];
// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.
leg = new L.Polyline([this._latlng, newPos], legOptions);
map.addLayer(leg);
m._spiderLeg = leg;
// Now add the marker.
m._preSpiderfyLatlng = m._latlng;
m.setLatLng(newPos);
if (m.setZIndexOffset) {
m.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING
}
fg.addLayer(m);
}
this.setOpacity(0.3);
group._ignoreMove = false;
group.fire('spiderfied', {
cluster: this,
markers: childMarkers
});
},
_animationUnspiderfy: function () {
this._noanimationUnspiderfy();
}
});
//Animated versions here
L.MarkerCluster.include({
_animationSpiderfy: function (childMarkers, positions) {
var me = this,
group = this._group,
map = group._map,
fg = group._featureGroup,
thisLayerLatLng = this._latlng,
thisLayerPos = map.latLngToLayerPoint(thisLayerLatLng),
svg = L.Path.SVG,
legOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation.
finalLegOpacity = legOptions.opacity,
i, m, leg, legPath, legLength, newPos;
if (finalLegOpacity === undefined) {
finalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity;
}
if (svg) {
// If the initial opacity of the spider leg is not 0 then it appears before the animation starts.
legOptions.opacity = 0;
// Add the class for CSS transitions.
legOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg';
} else {
// Make sure we have a defined opacity.
legOptions.opacity = finalLegOpacity;
}
group._ignoreMove = true;
// Add markers and spider legs to map, hidden at our center point.
// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.
// The reverse order trick no longer improves performance on modern browsers.
for (i = 0; i < childMarkers.length; i++) {
m = childMarkers[i];
newPos = map.layerPointToLatLng(positions[i]);
// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.
leg = new L.Polyline([thisLayerLatLng, newPos], legOptions);
map.addLayer(leg);
m._spiderLeg = leg;
// Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/
// In our case the transition property is declared in the CSS file.
if (svg) {
legPath = leg._path;
legLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox.
legPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated.
legPath.style.strokeDashoffset = legLength;
}
// If it is a marker, add it now and we'll animate it out
if (m.setZIndexOffset) {
m.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING
}
if (m.clusterHide) {
m.clusterHide();
}
// Vectors just get immediately added
fg.addLayer(m);
if (m._setPos) {
m._setPos(thisLayerPos);
}
}
group._forceLayout();
group._animationStart();
// Reveal markers and spider legs.
for (i = childMarkers.length - 1; i >= 0; i--) {
newPos = map.layerPointToLatLng(positions[i]);
m = childMarkers[i];
//Move marker to new position
m._preSpiderfyLatlng = m._latlng;
m.setLatLng(newPos);
if (m.clusterShow) {
m.clusterShow();
}
// Animate leg (animation is actually delegated to CSS transition).
if (svg) {
leg = m._spiderLeg;
legPath = leg._path;
legPath.style.strokeDashoffset = 0;
//legPath.style.strokeOpacity = finalLegOpacity;
leg.setStyle({opacity: finalLegOpacity});
}
}
this.setOpacity(0.3);
group._ignoreMove = false;
setTimeout(function () {
group._animationEnd();
group.fire('spiderfied', {
cluster: me,
markers: childMarkers
});
}, 200);
},
_animationUnspiderfy: function (zoomDetails) {
var me = this,
group = this._group,
map = group._map,
fg = group._featureGroup,
thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),
childMarkers = this.getAllChildMarkers(null, true),
svg = L.Path.SVG,
m, i, leg, legPath, legLength, nonAnimatable;
group._ignoreMove = true;
group._animationStart();
//Make us visible and bring the child markers back in
this.setOpacity(1);
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
//Marker was added to us after we were spiderfied
if (!m._preSpiderfyLatlng) {
continue;
}
//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll
m.closePopup();
//Fix up the location to the real one
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;
//Hack override the location to be our center
nonAnimatable = true;
if (m._setPos) {
m._setPos(thisLayerPos);
nonAnimatable = false;
}
if (m.clusterHide) {
m.clusterHide();
nonAnimatable = false;
}
if (nonAnimatable) {
fg.removeLayer(m);
}
// Animate the spider leg back in (animation is actually delegated to CSS transition).
if (svg) {
leg = m._spiderLeg;
legPath = leg._path;
legLength = legPath.getTotalLength() + 0.1;
legPath.style.strokeDashoffset = legLength;
leg.setStyle({opacity: 0});
}
}
group._ignoreMove = false;
setTimeout(function () {
//If we have only <= one child left then that marker will be shown on the map so don't remove it!
var stillThereChildCount = 0;
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
if (m._spiderLeg) {
stillThereChildCount++;
}
}
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
if (!m._spiderLeg) { //Has already been unspiderfied
continue;
}
if (m.clusterShow) {
m.clusterShow();
}
if (m.setZIndexOffset) {
m.setZIndexOffset(0);
}
if (stillThereChildCount > 1) {
fg.removeLayer(m);
}
map.removeLayer(m._spiderLeg);
delete m._spiderLeg;
}
group._animationEnd();
group.fire('unspiderfied', {
cluster: me,
markers: childMarkers
});
}, 200);
}
});
L.MarkerClusterGroup.include({
//The MarkerCluster currently spiderfied (if any)
_spiderfied: null,
unspiderfy: function () {
this._unspiderfy.apply(this, arguments);
},
_spiderfierOnAdd: function () {
this._map.on('click', this._unspiderfyWrapper, this);
if (this._map.options.zoomAnimation) {
this._map.on('zoomstart', this._unspiderfyZoomStart, this);
}
//Browsers without zoomAnimation or a big zoom don't fire zoomstart
this._map.on('zoomend', this._noanimationUnspiderfy, this);
if (!L.Browser.touch) {
this._map.getRenderer(this);
//Needs to happen in the pageload, not after, or animations don't work in webkit
// http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements
//Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable
}
},
_spiderfierOnRemove: function () {
this._map.off('click', this._unspiderfyWrapper, this);
this._map.off('zoomstart', this._unspiderfyZoomStart, this);
this._map.off('zoomanim', this._unspiderfyZoomAnim, this);
this._map.off('zoomend', this._noanimationUnspiderfy, this);
//Ensure that markers are back where they should be
// Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane
this._noanimationUnspiderfy();
},
//On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)
//This means we can define the animation they do rather than Markers doing an animation to their actual location
_unspiderfyZoomStart: function () {
if (!this._map) { //May have been removed from the map by a zoomEnd handler
return;
}
this._map.on('zoomanim', this._unspiderfyZoomAnim, this);
},
_unspiderfyZoomAnim: function (zoomDetails) {
//Wait until the first zoomanim after the user has finished touch-zooming before running the animation
if (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {
return;
}
this._map.off('zoomanim', this._unspiderfyZoomAnim, this);
this._unspiderfy(zoomDetails);
},
_unspiderfyWrapper: function () {
/// <summary>_unspiderfy but passes no arguments</summary>
this._unspiderfy();
},
_unspiderfy: function (zoomDetails) {
if (this._spiderfied) {
this._spiderfied.unspiderfy(zoomDetails);
}
},
_noanimationUnspiderfy: function () {
if (this._spiderfied) {
this._spiderfied._noanimationUnspiderfy();
}
},
//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc
_unspiderfyLayer: function (layer) {
if (layer._spiderLeg) {
this._featureGroup.removeLayer(layer);
if (layer.clusterShow) {
layer.clusterShow();
}
//Position will be fixed up immediately in _animationUnspiderfy
if (layer.setZIndexOffset) {
layer.setZIndexOffset(0);
}
this._map.removeLayer(layer._spiderLeg);
delete layer._spiderLeg;
}
}
});
/**
* Adds 1 public method to MCG and 1 to L.Marker to facilitate changing
* markers' icon options and refreshing their icon and their parent clusters
* accordingly (case where their iconCreateFunction uses data of childMarkers
* to make up the cluster icon).
*/
L.MarkerClusterGroup.include({
/**
* Updates the icon of all clusters which are parents of the given marker(s).
* In singleMarkerMode, also updates the given marker(s) icon.
* @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|
* L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent
* clusters need to be updated. If not provided, retrieves all child markers of this.
* @returns {L.MarkerClusterGroup}
*/
refreshClusters: function (layers) {
if (!layers) {
layers = this._topClusterLevel.getAllChildMarkers();
} else if (layers instanceof L.MarkerClusterGroup) {
layers = layers._topClusterLevel.getAllChildMarkers();
} else if (layers instanceof L.LayerGroup) {
layers = layers._layers;
} else if (layers instanceof L.MarkerCluster) {
layers = layers.getAllChildMarkers();
} else if (layers instanceof L.Marker) {
layers = [layers];
} // else: must be an Array(L.Marker)|Map(L.Marker)
this._flagParentsIconsNeedUpdate(layers);
this._refreshClustersIcons();
// In case of singleMarkerMode, also re-draw the markers.
if (this.options.singleMarkerMode) {
this._refreshSingleMarkerModeMarkers(layers);
}
return this;
},
/**
* Simply flags all parent clusters of the given markers as having a "dirty" icon.
* @param layers Array(L.Marker)|Map(L.Marker) list of markers.
* @private
*/
_flagParentsIconsNeedUpdate: function (layers) {
var id, parent;
// Assumes layers is an Array or an Object whose prototype is non-enumerable.
for (id in layers) {
// Flag parent clusters' icon as "dirty", all the way up.
// Dumb process that flags multiple times upper parents, but still
// much more efficient than trying to be smart and make short lists,
// at least in the case of a hierarchy following a power law:
// http://jsperf.com/flag-nodes-in-power-hierarchy/2
parent = layers[id].__parent;
while (parent) {
parent._iconNeedsUpdate = true;
parent = parent.__parent;
}
}
},
/**
* Re-draws the icon of the supplied markers.
* To be used in singleMarkerMode only.
* @param layers Array(L.Marker)|Map(L.Marker) list of markers.
* @private
*/
_refreshSingleMarkerModeMarkers: function (layers) {
var id, layer;
for (id in layers) {
layer = layers[id];
// Make sure we do not override markers that do not belong to THIS group.
if (this.hasLayer(layer)) {
// Need to re-create the icon first, then re-draw the marker.
layer.setIcon(this._overrideMarkerIcon(layer));
}
}
}
});
L.Marker.include({
/**
* Updates the given options in the marker's icon and refreshes the marker.
* @param options map object of icon options.
* @param directlyRefreshClusters boolean (optional) true to trigger
* MCG.refreshClustersOf() right away with this single marker.
* @returns {L.Marker}
*/
refreshIconOptions: function (options, directlyRefreshClusters) {
var icon = this.options.icon;
L.setOptions(icon, options);
this.setIcon(icon);
// Shortcut to refresh the associated MCG clusters right away.
// To be used when refreshing a single marker.
// Otherwise, better use MCG.refreshClusters() once at the end with
// the list of modified markers.
if (directlyRefreshClusters && this.__parent) {
this.__parent._group.refreshClusters(this);
}
return this;
}
});
exports.MarkerClusterGroup = MarkerClusterGroup;
exports.MarkerCluster = MarkerCluster;
})));
//# sourceMappingURL=leaflet.markercluster-src.js.map
We don't ship the .js files in the git master branch.
They are only present in version tags and in npm.
See how to get the JS files here: https://github.com/Leaflet/Leaflet.markercluster#using-the-plugin
Or how to build them: https://github.com/Leaflet/Leaflet.markercluster#building-testing-and-linting-scripts
Leaflet.markercluster
=====================
Provides Beautiful Animated Marker Clustering functionality for [Leaflet](http://leafletjs.com), a JS library for interactive maps.
*Requires Leaflet 1.0.0*
![cluster map example](example/map.png)
For a Leaflet 0.7 compatible version, [use the leaflet-0.7 branch](https://github.com/Leaflet/Leaflet.markercluster/tree/leaflet-0.7)<br>
For a Leaflet 0.5 compatible version, [Download b128e950](https://github.com/Leaflet/Leaflet.markercluster/archive/b128e950d8f5d7da5b60bd0aa9a88f6d3dd17c98.zip)<br>
For a Leaflet 0.4 compatible version, [Download the 0.2 release](https://github.com/Leaflet/Leaflet.markercluster/archive/0.2.zip)
<!---
TOC created with gh-md-toc
https://github.com/ekalinin/github-markdown-toc
removed link to h1 and indented back 2 spaces all links.
-->
## Table of Contents
* [Using the plugin](#using-the-plugin)
* [Building, testing and linting scripts](#building-testing-and-linting-scripts)
* [Examples](#examples)
* [Usage](#usage)
* [Options](#options)
* [Defaults](#defaults)
* [Customising the Clustered Markers](#customising-the-clustered-markers)
* [All Options](#all-options)
* [Enabled by default (boolean options)](#enabled-by-default-boolean-options)
* [Other options](#other-options)
* [Chunked addLayers options](#chunked-addlayers-options)
* [Events](#events)
* [Additional MarkerClusterGroup Events](#additional-markerclustergroup-events)
* [Methods](#methods)
* [Group methods](#group-methods)
* [Adding and removing Markers](#adding-and-removing-markers)
* [Bulk adding and removing Markers](#bulk-adding-and-removing-markers)
* [Getting the visible parent of a marker](#getting-the-visible-parent-of-a-marker)
* [Refreshing the clusters icon](#refreshing-the-clusters-icon)
* [Other Group Methods](#other-group-methods)
* [Clusters methods](#clusters-methods)
* [Getting the bounds of a cluster](#getting-the-bounds-of-a-cluster)
* [Zooming to the bounds of a cluster](#zooming-to-the-bounds-of-a-cluster)
* [Other clusters methods](#other-clusters-methods)
* [Handling LOTS of markers](#handling-lots-of-markers)
* [License](#license)
* [Sub-plugins](#sub-plugins)
## Using the plugin
Include the plugin CSS and JS files on your page after Leaflet files, using your method of choice:
* [Download the `v1.4.1` release](https://github.com/Leaflet/Leaflet.markercluster/archive/v1.4.1.zip)
* Use unpkg CDN: `https://unpkg.com/leaflet.markercluster@1.4.1/dist/`
* Install with npm: `npm install leaflet.markercluster`
In each case, use files in the `dist` folder:
* `MarkerCluster.css`
* `MarkerCluster.Default.css` (not needed if you use your own `iconCreateFunction` instead of the default one)
* `leaflet.markercluster.js` (or `leaflet.markercluster-src.js` for the non-minified version)
### Building, testing and linting scripts
Install jake `npm install -g jake` then run `npm install`
* To check the code for errors and build Leaflet from source, run `jake`.
* To run the tests, run `jake test`.
### Examples
See the included examples for usage.
The [realworld example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html) is a good place to start, it uses all of the defaults of the clusterer.
Or check out the [custom example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for how to customise the behaviour and appearance of the clusterer
### Usage
Create a new MarkerClusterGroup, add your markers to it, then add it to the map
```javascript
var markers = L.markerClusterGroup();
markers.addLayer(L.marker(getRandomLatLng(map)));
... Add more layers ...
map.addLayer(markers);
```
## Options
### Defaults
By default the Clusterer enables some nice defaults for you:
* **showCoverageOnHover**: When you mouse over a cluster it shows the bounds of its markers.
* **zoomToBoundsOnClick**: When you click a cluster we zoom to its bounds.
* **spiderfyOnMaxZoom**: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers. (*Note: the spiderfy occurs at the current zoom level if all items within the cluster are still clustered at the maximum zoom level or at zoom specified by `disableClusteringAtZoom` option*)
* **removeOutsideVisibleBounds**: Clusters and markers too far from the viewport are removed from the map for performance.
* **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`.
You can disable any of these as you want in the options when you create the MarkerClusterGroup:
```javascript
var markers = L.markerClusterGroup({
spiderfyOnMaxZoom: false,
showCoverageOnHover: false,
zoomToBoundsOnClick: false
});
```
### Customising the Clustered Markers
As an option to MarkerClusterGroup you can provide your own function for creating the Icon for the clustered markers.
The default implementation changes color at bounds of 10 and 100, but more advanced uses may require customising this.
You do not need to include the .Default css if you go this way.
You are passed a MarkerCluster object, you'll probably want to use `getChildCount()` or `getAllChildMarkers()` to work out the icon to show.
```javascript
var markers = L.markerClusterGroup({
iconCreateFunction: function(cluster) {
return L.divIcon({ html: '<b>' + cluster.getChildCount() + '</b>' });
}
});
```
Check out the [custom example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html) for an example of this.
If you need to update the clusters icon (e.g. they are based on markers real-time data), use the method [refreshClusters()](#refreshing-the-clusters-icon).
### All Options
#### Enabled by default (boolean options)
* **showCoverageOnHover**: When you mouse over a cluster it shows the bounds of its markers.
* **zoomToBoundsOnClick**: When you click a cluster we zoom to its bounds.
* **spiderfyOnMaxZoom**: When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers. (*Note: the spiderfy occurs at the current zoom level if all items within the cluster are still clustered at the maximum zoom level or at zoom specified by `disableClusteringAtZoom` option*).
* **removeOutsideVisibleBounds**: Clusters and markers too far from the viewport are removed from the map for performance.
* **animate**: Smoothly split / merge cluster children when zooming and spiderfying. If `L.DomUtil.TRANSITION` is false, this option has no effect (no animation is possible).
#### Other options
* **animateAddingMarkers**: If set to true (and `animate` option is also true) then adding individual markers to the MarkerClusterGroup after it has been added to the map will add the marker and animate it into the cluster. Defaults to false as this gives better performance when bulk adding markers. addLayers does not support this, only addLayer with individual Markers.
* **disableClusteringAtZoom**: If set, at this zoom level and below, markers will not be clustered. This defaults to disabled. [See Example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld-maxzoom.388.html). Note: you may be interested in disabling `spiderfyOnMaxZoom` option when using `disableClusteringAtZoom`.
* **maxClusterRadius**: The maximum radius that a cluster will cover from the central marker (in pixels). Default 80. Decreasing will make more, smaller clusters. You can also use a function that accepts the current map zoom and returns the maximum cluster radius in pixels.
* **polygonOptions**: Options to pass when creating the L.Polygon(points, options) to show the bounds of a cluster. Defaults to empty, which lets Leaflet use the [default Path options](http://leafletjs.com/reference.html#path-options).
* **singleMarkerMode**: If set to true, overrides the icon for all added markers to make them appear as a 1 size cluster. Note: the markers are not replaced by cluster objects, only their icon is replaced. Hence they still react to normal events, and option `disableClusteringAtZoom` does not restore their previous icon (see [#391](https://github.com/Leaflet/Leaflet.markercluster/issues/391)).
* **spiderLegPolylineOptions**: Allows you to specify [PolylineOptions](http://leafletjs.com/reference.html#polyline-options) to style spider legs. By default, they are `{ weight: 1.5, color: '#222', opacity: 0.5 }`.
* **spiderfyDistanceMultiplier**: Increase from 1 to increase the distance away from the center that spiderfied markers are placed. Use if you are using big marker icons (Default: 1).
* **iconCreateFunction**: Function used to create the cluster icon. See [the default implementation](https://github.com/Leaflet/Leaflet.markercluster/blob/15ed12654acdc54a4521789c498e4603fe4bf781/src/MarkerClusterGroup.js#L542) or the [custom example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-custom.html).
* **clusterPane**: Map pane where the cluster icons will be added. Defaults to L.Marker's default (currently 'markerPane'). [See the pane example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-pane.html).
#### Chunked addLayers options
Options for the [addLayers](#bulk-adding-and-removing-markers) method. See [#357](https://github.com/Leaflet/Leaflet.markercluster/issues/357) for explanation on how the chunking works.
* **chunkedLoading**: Boolean to split the addLayer**s** processing in to small intervals so that the page does not freeze.
* **chunkInterval**: Time interval (in ms) during which addLayers works before pausing to let the rest of the page process. In particular, this prevents the page from freezing while adding a lot of markers. Defaults to 200ms.
* **chunkDelay**: Time delay (in ms) between consecutive periods of processing for addLayers. Default to 50ms.
* **chunkProgress**: Callback function that is called at the end of each chunkInterval. Typically used to implement a progress indicator, e.g. [code in RealWorld 50k](https://github.com/Leaflet/Leaflet.markercluster/blob/master/example/marker-clustering-realworld.50000.html#L33-L49). Defaults to null. Arguments:
1. Number of processed markers
2. Total number of markers being added
3. Elapsed time (in ms)
## Events
Leaflet events like `click`, `mouseover`, etc. are just related to _Markers_ in the cluster.
To receive events for clusters, listen to `'cluster' + '<eventName>'`, ex: `clusterclick`, `clustermouseover`, `clustermouseout`.
Set your callback up as follows to handle both cases:
```javascript
markers.on('click', function (a) {
console.log('marker ' + a.layer);
});
markers.on('clusterclick', function (a) {
// a.layer is actually a cluster
console.log('cluster ' + a.layer.getAllChildMarkers().length);
});
```
### Additional MarkerClusterGroup Events
- **animationend**: Fires when marker clustering/unclustering animation has completed
- **spiderfied**: Fires when overlapping markers get spiderified (Contains ```cluster``` and ```markers``` attributes)
- **unspiderfied**: Fires when overlapping markers get unspiderified (Contains ```cluster``` and ```markers``` attributes)
## Methods
### Group methods
#### Adding and removing Markers
`addLayer`, `removeLayer` and `clearLayers` are supported and they should work for most uses.
#### Bulk adding and removing Markers
`addLayers` and `removeLayers` are bulk methods for adding and removing markers and should be favoured over the single versions when doing bulk addition/removal of markers. Each takes an array of markers. You can use [dedicated options](#chunked-addlayers-options) to fine-tune the behaviour of `addLayers`.
These methods extract non-group layer children from Layer Group types, even deeply nested. _However_, be noted that:
- `chunkProgress` jumps backward when `addLayers` finds a group (since appending its children to the input array makes the total increase).
- Groups are not actually added into the MarkerClusterGroup, only their non-group child layers. Therfore, `hasLayer` method will return `true` for non-group child layers, but `false` on any (possibly parent) Layer Group types.
If you are removing a lot of markers it will almost definitely be better to call `clearLayers` then call `addLayers` to add the markers you don't want to remove back in. See [#59](https://github.com/Leaflet/Leaflet.markercluster/issues/59#issuecomment-9320628) for details.
#### Getting the visible parent of a marker
If you have a marker in your MarkerClusterGroup and you want to get the visible parent of it (Either itself or a cluster it is contained in that is currently visible on the map).
This will return null if the marker and its parent clusters are not visible currently (they are not near the visible viewpoint)
```javascript
var visibleOne = markerClusterGroup.getVisibleParent(myMarker);
console.log(visibleOne.getLatLng());
```
#### Refreshing the clusters icon
If you have [customized](#customising-the-clustered-markers) the clusters icon to use some data from the contained markers, and later that data changes, use this method to force a refresh of the cluster icons.
You can use the method:
- without arguments to force all cluster icons in the Marker Cluster Group to be re-drawn.
- with an array or a mapping of markers to force only their parent clusters to be re-drawn.
- with an L.LayerGroup. The method will look for all markers in it. Make sure it contains only markers which are also within this Marker Cluster Group.
- with a single marker.
```javascript
markers.refreshClusters();
markers.refreshClusters([myMarker0, myMarker33]);
markers.refreshClusters({id_0: myMarker0, id_any: myMarker33});
markers.refreshClusters(myLayerGroup);
markers.refreshClusters(myMarker);
```
The plugin also adds a method on L.Marker to easily update the underlying icon options and refresh the icon.
If passing a second argument that evaluates to `true`, the method will also trigger a `refreshCluster` on the parent MarkerClusterGroup for that single marker.
```javascript
// Use as many times as required to update markers,
// then call refreshClusters once finished.
for (i in markersSubArray) {
markersSubArray[i].refreshIconOptions(newOptionsMappingArray[i]);
}
markers.refreshClusters(markersSubArray);
// If updating only one marker, pass true to
// refresh this marker's parent clusters right away.
myMarker.refreshIconOptions(optionsMap, true);
```
#### Other Group Methods
* **hasLayer**(layer): Returns true if the given layer (marker) is in the MarkerClusterGroup.
* **zoomToShowLayer**(layer, callback): Zooms to show the given marker (spiderfying if required), calls the callback when the marker is visible on the map.
### Clusters methods
The following methods can be used with clusters (not the group). They are typically used for event handling.
#### Getting the bounds of a cluster
When you receive an event from a cluster you can query it for the bounds.
```javascript
markers.on('clusterclick', function (a) {
var latLngBounds = a.layer.getBounds();
});
```
You can also query for the bounding convex polygon.
See [example/marker-clustering-convexhull.html](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-convexhull.html) for a working example.
```javascript
markers.on('clusterclick', function (a) {
map.addLayer(L.polygon(a.layer.getConvexHull()));
});
```
#### Zooming to the bounds of a cluster
When you receive an event from a cluster you can zoom to its bounds in one easy step.
If all of the markers will appear at a higher zoom level, that zoom level is zoomed to instead.
`zoomToBounds` takes an optional argument to pass [options to the resulting `fitBounds` call](http://leafletjs.com/reference.html#map-fitboundsoptions).
See [marker-clustering-zoomtobounds.html](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-zoomtobounds.html) for a working example.
```javascript
markers.on('clusterclick', function (a) {
a.layer.zoomToBounds({padding: [20, 20]});
});
```
#### Other clusters methods
* **getChildCount**: Returns the total number of markers contained within that cluster.
* **getAllChildMarkers(storage: array | undefined, ignoreDraggedMarker: boolean | undefined)**: Returns an array of all markers contained within this cluster (storage will be used if provided). If ignoreDraggedMarker is true and there is currently a marker dragged, the dragged marker will not be included in the array.
* **spiderfy**: Spiderfies the child markers of this cluster
* **unspiderfy**: Unspiderfies a cluster (opposite of spiderfy)
## Handling LOTS of markers
The Clusterer can handle 10,000 or even 50,000 markers (in chrome). IE9 has some issues with 50,000.
- [realworld 10,000 example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.10000.html)
- [realworld 50,000 example](https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.50000.html)
Note: these two examples use the `chunkedLoading` option set to true in order to avoid locking the browser for a long time.
## License
Leaflet.markercluster is free software, and may be redistributed under the MIT-LICENSE.
[![Build Status](https://travis-ci.org/Leaflet/Leaflet.markercluster.png?branch=master)](https://travis-ci.org/Leaflet/Leaflet.markercluster)
## Sub-plugins
Leaflet.markercluster plugin is very popular and as such it generates high and
diverse expectations for increased functionalities.
If you are in that case, be sure to have a look first at the repository
[issues](https://github.com/Leaflet/Leaflet.markercluster/issues) in case what
you are looking for would already be discussed, and some workarounds would be proposed.
Check also the below sub-plugins:
| Plugin | Description | Maintainer |
| :----- | :---------- | :--------- |
| [Leaflet.FeatureGroup.SubGroup](https://github.com/ghybs/Leaflet.FeatureGroup.SubGroup) | Creates a Feature Group that adds its child layers into a parent group when added to a map (e.g. through L.Control.Layers). Typical usage is to dynamically add/remove groups of markers from Marker Cluster. | [ghybs](https://github.com/ghybs) |
| [Leaflet.MarkerCluster.LayerSupport](https://github.com/ghybs/Leaflet.MarkerCluster.LayerSupport) | Brings compatibility with L.Control.Layers and other Leaflet plugins. I.e. everything that uses direct calls to map.addLayer and map.removeLayer. | [ghybs](https://github.com/ghybs) |
| [Leaflet.MarkerCluster.Freezable](https://github.com/ghybs/Leaflet.MarkerCluster.Freezable) | Adds the ability to freeze clusters at a specified zoom. E.g. freezing at maxZoom + 1 makes as if clustering was programmatically disabled. | [ghybs](https://github.com/ghybs) |
| [Leaflet.MarkerCluster.PlacementStrategies](https://github.com/adammertel/Leaflet.MarkerCluster.PlacementStrategies) | Implements new strategies to position clustered markers (eg: clock, concentric circles, ...). Recommended to use with circleMarkers. [Demo](https://adammertel.github.io/Leaflet.MarkerCluster.PlacementStrategies/demo/demo1.html) | [adammertel](https://github.com/adammertel) / [UNIVIE](http://carto.univie.ac.at/) |
| [Leaflet.MarkerCluster.List](https://github.com/adammertel/Leaflet.MarkerCluster.List) | Displays child elements in a list. Suitable for mobile devices. [Demo](https://adammertel.github.io/Leaflet.MarkerCluster.List/demo/demo1.html) | [adammertel](https://github.com/adammertel) / [UNIVIE](http://carto.univie.ac.at/) |
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;
-moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;
-o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;
transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}
.leaflet-cluster-spider-leg {
/* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */
-webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;
-moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;
-o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;
transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;
}
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}
.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}
.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}
/* IE 6-8 fallback colors */
.leaflet-oldie .marker-cluster-small {
background-color: rgb(181, 226, 140);
}
.leaflet-oldie .marker-cluster-small div {
background-color: rgb(110, 204, 57);
}
.leaflet-oldie .marker-cluster-medium {
background-color: rgb(241, 211, 87);
}
.leaflet-oldie .marker-cluster-medium div {
background-color: rgb(240, 194, 12);
}
.leaflet-oldie .marker-cluster-large {
background-color: rgb(253, 156, 115);
}
.leaflet-oldie .marker-cluster-large div {
background-color: rgb(241, 128, 23);
}
.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;
text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
/*
* L.TileLayer.Grayscale is a regular tilelayer with grayscale makeover.
*/
L.TileLayer.Grayscale = L.TileLayer.extend({
options: {
quotaRed: 21,
quotaGreen: 71,
quotaBlue: 8,
quotaDividerTune: 0,
quotaDivider: function() {
return this.quotaRed + this.quotaGreen + this.quotaBlue + this.quotaDividerTune;
}
},
initialize: function (url, options) {
options.crossOrigin = true;
L.TileLayer.prototype.initialize.call(this, url, options);
this.on('tileload', function(e) {
this._makeGrayscale(e.tile);
});
},
_createTile: function () {
var tile = L.TileLayer.prototype._createTile.call(this);
tile.crossOrigin = "Anonymous";
return tile;
},
_makeGrayscale: function (img) {
if (img.getAttribute('data-grayscaled'))
return;
img.crossOrigin = '';
var canvas = document.createElement("canvas");
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
var imgd = ctx.getImageData(0, 0, canvas.width, canvas.height);
var pix = imgd.data;
for (var i = 0, n = pix.length; i < n; i += 4) {
pix[i] = pix[i + 1] = pix[i + 2] = (this.options.quotaRed * pix[i] + this.options.quotaGreen * pix[i + 1] + this.options.quotaBlue * pix[i + 2]) / this.options.quotaDivider();
}
ctx.putImageData(imgd, 0, 0);
img.setAttribute('data-grayscaled', true);
img.src = canvas.toDataURL();
}
});
L.tileLayer.grayscale = function (url, options) {
return new L.TileLayer.Grayscale(url, options);
};
if (metafile == null && meta.exif) {
// optional prepare the data sections
checkMeta('data-metasection', "Information")
checkMeta('data-datetimeoriginal', meta.exif.DateTimeOriginal)
checkMeta('data-fnumber', meta.exif.FNumber)
checkMeta('data-exposuretime', meta.exif.ExposureTime)
checkMeta('data-isospeedratings', meta.exif.ISO)
checkMeta('data-focallength', meta.exif.FocalLength)
checkMeta('data-lens', meta.exif.Lens)
checkMeta('data-model', meta.exif.Model)
checkMeta('data-make', meta.exif.Make)
checkMeta('data-gpslatitude', meta.exif.GPSLatitude)
checkMeta('data-gpslongitude', meta.exif.GPSLongitude)
checkMeta('data-gpslatituderef', meta.exif.GPSLatitudeRef)
checkMeta('data-gpslongituderef', meta.exif.GPSLongitudeRef)
}
//3rd add the data attributes to the photo element
getPhotodata(meta, config)
/**
* build the data attributes for the current photo
* @param {*} meta
*/
function getPhotodata(meta, config) {
var d = meta.exif,
keydata = [];
if (vars.metafileName == null && d) {
if (config && config.metadata) {
keydata = config.metadata;
} else {
// fallback if no metadata keys found
keydata = [
"DateTimeOriginal",
"FNumber",
"ExposureTime",
"ISO",
"FocalLength",
"Lens",
"Model",
"Make",
"GPSLatitude",
"GPSLongitude",
"GPSLatitudeRef",
"GPSLongitudeRef"
]
}
checkMeta('data-metasection', config.metadatatitle || "Details")
for (const key of keydata) {
checkMeta('data-' + key, d[key])
}
```
**Optional define metadata attributes**
```json
theme-settings.json
{
"metadatatitle": "Details",
"_metadata": [
"DateTimeOriginal",
"FNumber",
"ExposureTime",
"ISO",
"FocalLength",
"Lens",
"Model",
"Make",
"GPSLatitude",
"GPSLongitude",
"GPSLatitudeRef",
"GPSLongitudeRef"
],
...
}