leaflet.jie..js 208 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339
  1. /*
  2. Leaflet 1.0.2+4bbb16c, a JS library for interactive maps. http://leafletjs.com
  3. (c) 2010-2016 Vladimir Agafonkin, (c) 2010-2011 CloudMade
  4. */
  5. !
  6. function(t, e, i) {
  7. function n() {
  8. var e = t.L;
  9. o.noConflict = function() {
  10. return t.L = e, this
  11. }, t.L = o
  12. }
  13. var o = {
  14. version: "1.0.2+4bbb16c"
  15. };
  16. "object" == typeof module && "object" == typeof module.exports ? module.exports = o : "function" == typeof define && define.amd && define(o), "undefined" != typeof t && n(), o.Util = {
  17. extend: function(t) {
  18. var e, i, n, o;
  19. for (i = 1, n = arguments.length; i < n; i++) {
  20. o = arguments[i];
  21. for (e in o) t[e] = o[e]
  22. }
  23. return t
  24. },
  25. create: Object.create ||
  26. function() {
  27. function t() {}
  28. return function(e) {
  29. return t.prototype = e, new t
  30. }
  31. }(),
  32. bind: function(t, e) {
  33. var i = Array.prototype.slice;
  34. if (t.bind) return t.bind.apply(t, i.call(arguments, 1));
  35. var n = i.call(arguments, 2);
  36. return function() {
  37. return t.apply(e, n.length ? n.concat(i.call(arguments)) : arguments)
  38. }
  39. },
  40. stamp: function(t) {
  41. return t._leaflet_id = t._leaflet_id || ++o.Util.lastId, t._leaflet_id
  42. },
  43. lastId: 0,
  44. throttle: function(t, e, i) {
  45. var n, o, s, r;
  46. return r = function() {
  47. n = !1, o && (s.apply(i, o), o = !1)
  48. }, s = function() {
  49. n ? o = arguments : (t.apply(i, arguments), setTimeout(r, e), n = !0)
  50. }
  51. },
  52. wrapNum: function(t, e, i) {
  53. var n = e[1],
  54. o = e[0],
  55. s = n - o;
  56. return t === n && i ? t : ((t - o) % s + s) % s + o
  57. },
  58. falseFn: function() {
  59. return !1
  60. },
  61. formatNum: function(t, e) {
  62. var i = Math.pow(10, e || 5);
  63. return Math.round(t * i) / i
  64. },
  65. trim: function(t) {
  66. return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
  67. },
  68. splitWords: function(t) {
  69. return o.Util.trim(t).split(/\s+/)
  70. },
  71. setOptions: function(t, e) {
  72. t.hasOwnProperty("options") || (t.options = t.options ? o.Util.create(t.options) : {});
  73. for (var i in e) t.options[i] = e[i];
  74. return t.options
  75. },
  76. getParamString: function(t, e, i) {
  77. var n = [];
  78. for (var o in t) n.push(encodeURIComponent(i ? o.toUpperCase() : o) + "=" + encodeURIComponent(t[o]));
  79. return (e && e.indexOf("?") !== -1 ? "&" : "?") + n.join("&")
  80. },
  81. template: function(t, e) {
  82. return t.replace(o.Util.templateRe, function(t, n) {
  83. var o = e[n];
  84. if (o === i) throw new Error("No value provided for variable " + t);
  85. return "function" == typeof o && (o = o(e)), o
  86. })
  87. },
  88. templateRe: /\{ *([\w_\-]+) *\}/g,
  89. isArray: Array.isArray ||
  90. function(t) {
  91. return "[object Array]" === Object.prototype.toString.call(t)
  92. },
  93. indexOf: function(t, e) {
  94. for (var i = 0; i < t.length; i++) if (t[i] === e) return i;
  95. return -1
  96. },
  97. emptyImageUrl: "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
  98. }, function() {
  99. function e(e) {
  100. return t["webkit" + e] || t["moz" + e] || t["ms" + e]
  101. }
  102. function i(e) {
  103. var i = +new Date,
  104. o = Math.max(0, 16 - (i - n));
  105. return n = i + o, t.setTimeout(e, o)
  106. }
  107. var n = 0,
  108. s = t.requestAnimationFrame || e("RequestAnimationFrame") || i,
  109. r = t.cancelAnimationFrame || e("CancelAnimationFrame") || e("CancelRequestAnimationFrame") ||
  110. function(e) {
  111. t.clearTimeout(e)
  112. };
  113. o.Util.requestAnimFrame = function(e, n, r) {
  114. return r && s === i ? void e.call(n) : s.call(t, o.bind(e, n))
  115. }, o.Util.cancelAnimFrame = function(e) {
  116. e && r.call(t, e)
  117. }
  118. }(), o.extend = o.Util.extend, o.bind = o.Util.bind, o.stamp = o.Util.stamp, o.setOptions = o.Util.setOptions, o.Class = function() {}, o.Class.extend = function(t) {
  119. var e = function() {
  120. this.initialize && this.initialize.apply(this, arguments), this.callInitHooks()
  121. },
  122. i = e.__super__ = this.prototype,
  123. n = o.Util.create(i);
  124. n.constructor = e, e.prototype = n;
  125. for (var s in this) this.hasOwnProperty(s) && "prototype" !== s && (e[s] = this[s]);
  126. return t.statics && (o.extend(e, t.statics), delete t.statics), t.includes && (o.Util.extend.apply(null, [n].concat(t.includes)), delete t.includes), n.options && (t.options = o.Util.extend(o.Util.create(n.options), t.options)), o.extend(n, t), n._initHooks = [], n.callInitHooks = function() {
  127. if (!this._initHooksCalled) {
  128. i.callInitHooks && i.callInitHooks.call(this), this._initHooksCalled = !0;
  129. for (var t = 0, e = n._initHooks.length; t < e; t++) n._initHooks[t].call(this)
  130. }
  131. }, e
  132. }, o.Class.include = function(t) {
  133. return o.extend(this.prototype, t), this
  134. }, o.Class.mergeOptions = function(t) {
  135. return o.extend(this.prototype.options, t), this
  136. }, o.Class.addInitHook = function(t) {
  137. var e = Array.prototype.slice.call(arguments, 1),
  138. i = "function" == typeof t ? t : function() {
  139. this[t].apply(this, e)
  140. };
  141. return this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(i), this
  142. }, o.Evented = o.Class.extend({
  143. on: function(t, e, i) {
  144. if ("object" == typeof t) for (var n in t) this._on(n, t[n], e);
  145. else {
  146. t = o.Util.splitWords(t);
  147. for (var s = 0, r = t.length; s < r; s++) this._on(t[s], e, i)
  148. }
  149. return this
  150. },
  151. off: function(t, e, i) {
  152. if (t) if ("object" == typeof t) for (var n in t) this._off(n, t[n], e);
  153. else {
  154. t = o.Util.splitWords(t);
  155. for (var s = 0, r = t.length; s < r; s++) this._off(t[s], e, i)
  156. } else delete this._events;
  157. return this
  158. },
  159. _on: function(t, e, n) {
  160. this._events = this._events || {};
  161. var o = this._events[t];
  162. o || (o = [], this._events[t] = o), n === this && (n = i);
  163. for (var s = {
  164. fn: e,
  165. ctx: n
  166. }, r = o, a = 0, h = r.length; a < h; a++) if (r[a].fn === e && r[a].ctx === n) return;
  167. r.push(s), o.count++
  168. },
  169. _off: function(t, e, n) {
  170. var s, r, a;
  171. if (this._events && (s = this._events[t])) {
  172. if (!e) {
  173. for (r = 0, a = s.length; r < a; r++) s[r].fn = o.Util.falseFn;
  174. return void delete this._events[t]
  175. }
  176. if (n === this && (n = i), s) for (r = 0, a = s.length; r < a; r++) {
  177. var h = s[r];
  178. if (h.ctx === n && h.fn === e) return h.fn = o.Util.falseFn, this._firingCount && (this._events[t] = s = s.slice()), void s.splice(r, 1)
  179. }
  180. }
  181. },
  182. fire: function(t, e, i) {
  183. if (!this.listens(t, i)) return this;
  184. var n = o.Util.extend({}, e, {
  185. type: t,
  186. target: this
  187. });
  188. if (this._events) {
  189. var s = this._events[t];
  190. if (s) {
  191. this._firingCount = this._firingCount + 1 || 1;
  192. for (var r = 0, a = s.length; r < a; r++) {
  193. var h = s[r];
  194. h.fn.call(h.ctx || this, n)
  195. }
  196. this._firingCount--
  197. }
  198. }
  199. return i && this._propagateEvent(n), this
  200. },
  201. listens: function(t, e) {
  202. var i = this._events && this._events[t];
  203. if (i && i.length) return !0;
  204. if (e) for (var n in this._eventParents) if (this._eventParents[n].listens(t, e)) return !0;
  205. return !1
  206. },
  207. once: function(t, e, i) {
  208. if ("object" == typeof t) {
  209. for (var n in t) this.once(n, t[n], e);
  210. return this
  211. }
  212. var s = o.bind(function() {
  213. this.off(t, e, i).off(t, s, i)
  214. }, this);
  215. return this.on(t, e, i).on(t, s, i)
  216. },
  217. addEventParent: function(t) {
  218. return this._eventParents = this._eventParents || {}, this._eventParents[o.stamp(t)] = t, this
  219. },
  220. removeEventParent: function(t) {
  221. return this._eventParents && delete this._eventParents[o.stamp(t)], this
  222. },
  223. _propagateEvent: function(t) {
  224. for (var e in this._eventParents) this._eventParents[e].fire(t.type, o.extend({
  225. layer: t.target
  226. }, t), !0)
  227. }
  228. });
  229. var s = o.Evented.prototype;
  230. s.addEventListener = s.on, s.removeEventListener = s.clearAllEventListeners = s.off, s.addOneTimeEventListener = s.once, s.fireEvent = s.fire, s.hasEventListeners = s.listens, o.Mixin = {
  231. Events: s
  232. }, function() {
  233. var i = navigator.userAgent.toLowerCase(),
  234. n = e.documentElement,
  235. s = "ActiveXObject" in t,
  236. r = i.indexOf("webkit") !== -1,
  237. a = i.indexOf("phantom") !== -1,
  238. h = i.search("android [23]") !== -1,
  239. l = i.indexOf("chrome") !== -1,
  240. u = i.indexOf("gecko") !== -1 && !r && !t.opera && !s,
  241. c = 0 === navigator.platform.indexOf("Win"),
  242. d = "undefined" != typeof orientation || i.indexOf("mobile") !== -1,
  243. _ = !t.PointerEvent && t.MSPointerEvent,
  244. m = t.PointerEvent || _,
  245. p = s && "transition" in n.style,
  246. f = "WebKitCSSMatrix" in t && "m11" in new t.WebKitCSSMatrix && !h,
  247. g = "MozPerspective" in n.style,
  248. v = "OTransition" in n.style,
  249. y = !t.L_NO_TOUCH && (m || "ontouchstart" in t || t.DocumentTouch && e instanceof t.DocumentTouch);
  250. o.Browser = {
  251. ie: s,
  252. ielt9: s && !e.addEventListener,
  253. edge: "msLaunchUri" in navigator && !("documentMode" in e),
  254. webkit: r,
  255. gecko: u,
  256. android: i.indexOf("android") !== -1,
  257. android23: h,
  258. chrome: l,
  259. safari: !l && i.indexOf("safari") !== -1,
  260. win: c,
  261. ie3d: p,
  262. webkit3d: f,
  263. gecko3d: g,
  264. opera12: v,
  265. any3d: !t.L_DISABLE_3D && (p || f || g) && !v && !a,
  266. mobile: d,
  267. mobileWebkit: d && r,
  268. mobileWebkit3d: d && f,
  269. mobileOpera: d && t.opera,
  270. mobileGecko: d && u,
  271. touch: !! y,
  272. msPointer: !! _,
  273. pointer: !! m,
  274. retina: (t.devicePixelRatio || t.screen.deviceXDPI / t.screen.logicalXDPI) > 1
  275. }
  276. }(), o.Point = function(t, e, i) {
  277. this.x = i ? Math.round(t) : t, this.y = i ? Math.round(e) : e
  278. }, o.Point.prototype = {
  279. clone: function() {
  280. return new o.Point(this.x, this.y)
  281. },
  282. add: function(t) {
  283. return this.clone()._add(o.point(t))
  284. },
  285. _add: function(t) {
  286. return this.x += t.x, this.y += t.y, this
  287. },
  288. subtract: function(t) {
  289. return this.clone()._subtract(o.point(t))
  290. },
  291. _subtract: function(t) {
  292. return this.x -= t.x, this.y -= t.y, this
  293. },
  294. divideBy: function(t) {
  295. return this.clone()._divideBy(t)
  296. },
  297. _divideBy: function(t) {
  298. return this.x /= t, this.y /= t, this
  299. },
  300. multiplyBy: function(t) {
  301. return this.clone()._multiplyBy(t)
  302. },
  303. _multiplyBy: function(t) {
  304. return this.x *= t, this.y *= t, this
  305. },
  306. scaleBy: function(t) {
  307. return new o.Point(this.x * t.x, this.y * t.y)
  308. },
  309. unscaleBy: function(t) {
  310. return new o.Point(this.x / t.x, this.y / t.y)
  311. },
  312. round: function() {
  313. return this.clone()._round()
  314. },
  315. _round: function() {
  316. return this.x = Math.round(this.x), this.y = Math.round(this.y), this
  317. },
  318. floor: function() {
  319. return this.clone()._floor()
  320. },
  321. _floor: function() {
  322. return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
  323. },
  324. ceil: function() {
  325. return this.clone()._ceil()
  326. },
  327. _ceil: function() {
  328. return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this
  329. },
  330. distanceTo: function(t) {
  331. t = o.point(t);
  332. var e = t.x - this.x,
  333. i = t.y - this.y;
  334. return Math.sqrt(e * e + i * i)
  335. },
  336. equals: function(t) {
  337. return t = o.point(t), t.x === this.x && t.y === this.y
  338. },
  339. contains: function(t) {
  340. return t = o.point(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
  341. },
  342. toString: function() {
  343. return "Point(" + o.Util.formatNum(this.x) + ", " + o.Util.formatNum(this.y) + ")"
  344. }
  345. }, o.point = function(t, e, n) {
  346. return t instanceof o.Point ? t : o.Util.isArray(t) ? new o.Point(t[0], t[1]) : t === i || null === t ? t : "object" == typeof t && "x" in t && "y" in t ? new o.Point(t.x, t.y) : new o.Point(t, e, n)
  347. }, o.Bounds = function(t, e) {
  348. if (t) for (var i = e ? [t, e] : t, n = 0, o = i.length; n < o; n++) this.extend(i[n])
  349. }, o.Bounds.prototype = {
  350. extend: function(t) {
  351. return t = o.point(t), this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x), this.max.x = Math.max(t.x, this.max.x), this.min.y = Math.min(t.y, this.min.y), this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.clone(), this.max = t.clone()), this
  352. },
  353. getCenter: function(t) {
  354. return new o.Point((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, t)
  355. },
  356. getBottomLeft: function() {
  357. return new o.Point(this.min.x, this.max.y)
  358. },
  359. getTopRight: function() {
  360. return new o.Point(this.max.x, this.min.y)
  361. },
  362. getSize: function() {
  363. return this.max.subtract(this.min)
  364. },
  365. contains: function(t) {
  366. var e, i;
  367. return t = "number" == typeof t[0] || t instanceof o.Point ? o.point(t) : o.bounds(t), t instanceof o.Bounds ? (e = t.min, i = t.max) : e = i = t, e.x >= this.min.x && i.x <= this.max.x && e.y >= this.min.y && i.y <= this.max.y
  368. },
  369. intersects: function(t) {
  370. t = o.bounds(t);
  371. var e = this.min,
  372. i = this.max,
  373. n = t.min,
  374. s = t.max,
  375. r = s.x >= e.x && n.x <= i.x,
  376. a = s.y >= e.y && n.y <= i.y;
  377. return r && a
  378. },
  379. overlaps: function(t) {
  380. t = o.bounds(t);
  381. var e = this.min,
  382. i = this.max,
  383. n = t.min,
  384. s = t.max,
  385. r = s.x > e.x && n.x < i.x,
  386. a = s.y > e.y && n.y < i.y;
  387. return r && a
  388. },
  389. isValid: function() {
  390. return !(!this.min || !this.max)
  391. }
  392. }, o.bounds = function(t, e) {
  393. return !t || t instanceof o.Bounds ? t : new o.Bounds(t, e)
  394. }, o.Transformation = function(t, e, i, n) {
  395. this._a = t, this._b = e, this._c = i, this._d = n
  396. }, o.Transformation.prototype = {
  397. transform: function(t, e) {
  398. return this._transform(t.clone(), e)
  399. },
  400. _transform: function(t, e) {
  401. return e = e || 1, t.x = e * (this._a * t.x + this._b), t.y = e * (this._c * t.y + this._d), t
  402. },
  403. untransform: function(t, e) {
  404. return e = e || 1, new o.Point((t.x / e - this._b) / this._a, (t.y / e - this._d) / this._c)
  405. }
  406. }, o.DomUtil = {
  407. get: function(t) {
  408. return "string" == typeof t ? e.getElementById(t) : t
  409. },
  410. getStyle: function(t, i) {
  411. var n = t.style[i] || t.currentStyle && t.currentStyle[i];
  412. if ((!n || "auto" === n) && e.defaultView) {
  413. var o = e.defaultView.getComputedStyle(t, null);
  414. n = o ? o[i] : null
  415. }
  416. return "auto" === n ? null : n
  417. },
  418. create: function(t, i, n) {
  419. var o = e.createElement(t);
  420. return o.className = i || "", n && n.appendChild(o), o
  421. },
  422. remove: function(t) {
  423. var e = t.parentNode;
  424. e && e.removeChild(t)
  425. },
  426. empty: function(t) {
  427. for (; t.firstChild;) t.removeChild(t.firstChild)
  428. },
  429. toFront: function(t) {
  430. t.parentNode.appendChild(t)
  431. },
  432. toBack: function(t) {
  433. var e = t.parentNode;
  434. e.insertBefore(t, e.firstChild)
  435. },
  436. hasClass: function(t, e) {
  437. if (t.classList !== i) return t.classList.contains(e);
  438. var n = o.DomUtil.getClass(t);
  439. return n.length > 0 && new RegExp("(^|\\s)" + e + "(\\s|$)").test(n)
  440. },
  441. addClass: function(t, e) {
  442. if (t.classList !== i) for (var n = o.Util.splitWords(e), s = 0, r = n.length; s < r; s++) t.classList.add(n[s]);
  443. else if (!o.DomUtil.hasClass(t, e)) {
  444. var a = o.DomUtil.getClass(t);
  445. o.DomUtil.setClass(t, (a ? a + " " : "") + e)
  446. }
  447. },
  448. removeClass: function(t, e) {
  449. t.classList !== i ? t.classList.remove(e) : o.DomUtil.setClass(t, o.Util.trim((" " + o.DomUtil.getClass(t) + " ").replace(" " + e + " ", " ")))
  450. },
  451. setClass: function(t, e) {
  452. t.className.baseVal === i ? t.className = e : t.className.baseVal = e
  453. },
  454. getClass: function(t) {
  455. return t.className.baseVal === i ? t.className : t.className.baseVal
  456. },
  457. setOpacity: function(t, e) {
  458. "opacity" in t.style ? t.style.opacity = e : "filter" in t.style && o.DomUtil._setOpacityIE(t, e)
  459. },
  460. _setOpacityIE: function(t, e) {
  461. var i = !1,
  462. n = "DXImageTransform.Microsoft.Alpha";
  463. try {
  464. i = t.filters.item(n)
  465. } catch (t) {
  466. if (1 === e) return
  467. }
  468. e = Math.round(100 * e), i ? (i.Enabled = 100 !== e, i.Opacity = e) : t.style.filter += " progid:" + n + "(opacity=" + e + ")"
  469. },
  470. testProp: function(t) {
  471. for (var i = e.documentElement.style, n = 0; n < t.length; n++) if (t[n] in i) return t[n];
  472. return !1
  473. },
  474. setTransform: function(t, e, i) {
  475. var n = e || new o.Point(0, 0);
  476. t.style[o.DomUtil.TRANSFORM] = (o.Browser.ie3d ? "translate(" + n.x + "px," + n.y + "px)" : "translate3d(" + n.x + "px," + n.y + "px,0)") + (i ? " scale(" + i + ")" : "")
  477. },
  478. setPosition: function(t, e) {
  479. t._leaflet_pos = e, o.Browser.any3d ? o.DomUtil.setTransform(t, e) : (t.style.left = e.x + "px", t.style.top = e.y + "px")
  480. },
  481. getPosition: function(t) {
  482. return t._leaflet_pos || new o.Point(0, 0)
  483. }
  484. }, function() {
  485. o.DomUtil.TRANSFORM = o.DomUtil.testProp(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]);
  486. var i = o.DomUtil.TRANSITION = o.DomUtil.testProp(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
  487. if (o.DomUtil.TRANSITION_END = "webkitTransition" === i || "OTransition" === i ? i + "End" : "transitionend", "onselectstart" in e) o.DomUtil.disableTextSelection = function() {
  488. o.DomEvent.on(t, "selectstart", o.DomEvent.preventDefault)
  489. }, o.DomUtil.enableTextSelection = function() {
  490. o.DomEvent.off(t, "selectstart", o.DomEvent.preventDefault)
  491. };
  492. else {
  493. var n = o.DomUtil.testProp(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
  494. o.DomUtil.disableTextSelection = function() {
  495. if (n) {
  496. var t = e.documentElement.style;
  497. this._userSelect = t[n], t[n] = "none"
  498. }
  499. }, o.DomUtil.enableTextSelection = function() {
  500. n && (e.documentElement.style[n] = this._userSelect, delete this._userSelect)
  501. }
  502. }
  503. o.DomUtil.disableImageDrag = function() {
  504. o.DomEvent.on(t, "dragstart", o.DomEvent.preventDefault)
  505. }, o.DomUtil.enableImageDrag = function() {
  506. o.DomEvent.off(t, "dragstart", o.DomEvent.preventDefault)
  507. }, o.DomUtil.preventOutline = function(e) {
  508. for (; e.tabIndex === -1;) e = e.parentNode;
  509. e && e.style && (o.DomUtil.restoreOutline(), this._outlineElement = e, this._outlineStyle = e.style.outline, e.style.outline = "none", o.DomEvent.on(t, "keydown", o.DomUtil.restoreOutline, this))
  510. }, o.DomUtil.restoreOutline = function() {
  511. this._outlineElement && (this._outlineElement.style.outline = this._outlineStyle, delete this._outlineElement, delete this._outlineStyle, o.DomEvent.off(t, "keydown", o.DomUtil.restoreOutline, this))
  512. }
  513. }(), o.LatLng = function(t, e, n) {
  514. if (isNaN(t) || isNaN(e)) throw new Error("Invalid LatLng object: (" + t + ", " + e + ")");
  515. this.lat = +t, this.lng = +e, n !== i && (this.alt = +n)
  516. }, o.LatLng.prototype = {
  517. equals: function(t, e) {
  518. if (!t) return !1;
  519. t = o.latLng(t);
  520. var n = Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng));
  521. return n <= (e === i ? 1e-9 : e)
  522. },
  523. toString: function(t) {
  524. return "LatLng(" + o.Util.formatNum(this.lat, t) + ", " + o.Util.formatNum(this.lng, t) + ")"
  525. },
  526. distanceTo: function(t) {
  527. return o.CRS.Earth.distance(this, o.latLng(t))
  528. },
  529. wrap: function() {
  530. return o.CRS.Earth.wrapLatLng(this)
  531. },
  532. toBounds: function(t) {
  533. var e = 180 * t / 40075017,
  534. i = e / Math.cos(Math.PI / 180 * this.lat);
  535. return o.latLngBounds([this.lat - e, this.lng - i], [this.lat + e, this.lng + i])
  536. },
  537. clone: function() {
  538. return new o.LatLng(this.lat, this.lng, this.alt)
  539. }
  540. }, o.latLng = function(t, e, n) {
  541. return t instanceof o.LatLng ? t : o.Util.isArray(t) && "object" != typeof t[0] ? 3 === t.length ? new o.LatLng(t[0], t[1], t[2]) : 2 === t.length ? new o.LatLng(t[0], t[1]) : null : t === i || null === t ? t : "object" == typeof t && "lat" in t ? new o.LatLng(t.lat, "lng" in t ? t.lng : t.lon, t.alt) : e === i ? null : new o.LatLng(t, e, n)
  542. }, o.LatLngBounds = function(t, e) {
  543. if (t) for (var i = e ? [t, e] : t, n = 0, o = i.length; n < o; n++) this.extend(i[n])
  544. }, o.LatLngBounds.prototype = {
  545. extend: function(t) {
  546. var e, i, n = this._southWest,
  547. s = this._northEast;
  548. if (t instanceof o.LatLng) e = t, i = t;
  549. else {
  550. if (!(t instanceof o.LatLngBounds)) return t ? this.extend(o.latLng(t) || o.latLngBounds(t)) : this;
  551. if (e = t._southWest, i = t._northEast, !e || !i) return this
  552. }
  553. return n || s ? (n.lat = Math.min(e.lat, n.lat), n.lng = Math.min(e.lng, n.lng), s.lat = Math.max(i.lat, s.lat), s.lng = Math.max(i.lng, s.lng)) : (this._southWest = new o.LatLng(e.lat, e.lng), this._northEast = new o.LatLng(i.lat, i.lng)), this
  554. },
  555. pad: function(t) {
  556. var e = this._southWest,
  557. i = this._northEast,
  558. n = Math.abs(e.lat - i.lat) * t,
  559. s = Math.abs(e.lng - i.lng) * t;
  560. return new o.LatLngBounds(new o.LatLng(e.lat - n, e.lng - s), new o.LatLng(i.lat + n, i.lng + s))
  561. },
  562. getCenter: function() {
  563. return new o.LatLng((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
  564. },
  565. getSouthWest: function() {
  566. return this._southWest
  567. },
  568. getNorthEast: function() {
  569. return this._northEast
  570. },
  571. getNorthWest: function() {
  572. return new o.LatLng(this.getNorth(), this.getWest())
  573. },
  574. getSouthEast: function() {
  575. return new o.LatLng(this.getSouth(), this.getEast())
  576. },
  577. getWest: function() {
  578. return this._southWest.lng
  579. },
  580. getSouth: function() {
  581. return this._southWest.lat
  582. },
  583. getEast: function() {
  584. return this._northEast.lng
  585. },
  586. getNorth: function() {
  587. return this._northEast.lat
  588. },
  589. contains: function(t) {
  590. t = "number" == typeof t[0] || t instanceof o.LatLng ? o.latLng(t) : o.latLngBounds(t);
  591. var e, i, n = this._southWest,
  592. s = this._northEast;
  593. return t instanceof o.LatLngBounds ? (e = t.getSouthWest(), i = t.getNorthEast()) : e = i = t, e.lat >= n.lat && i.lat <= s.lat && e.lng >= n.lng && i.lng <= s.lng
  594. },
  595. intersects: function(t) {
  596. t = o.latLngBounds(t);
  597. var e = this._southWest,
  598. i = this._northEast,
  599. n = t.getSouthWest(),
  600. s = t.getNorthEast(),
  601. r = s.lat >= e.lat && n.lat <= i.lat,
  602. a = s.lng >= e.lng && n.lng <= i.lng;
  603. return r && a
  604. },
  605. overlaps: function(t) {
  606. t = o.latLngBounds(t);
  607. var e = this._southWest,
  608. i = this._northEast,
  609. n = t.getSouthWest(),
  610. s = t.getNorthEast(),
  611. r = s.lat > e.lat && n.lat < i.lat,
  612. a = s.lng > e.lng && n.lng < i.lng;
  613. return r && a
  614. },
  615. toBBoxString: function() {
  616. return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
  617. },
  618. equals: function(t) {
  619. return !!t && (t = o.latLngBounds(t), this._southWest.equals(t.getSouthWest()) && this._northEast.equals(t.getNorthEast()))
  620. },
  621. isValid: function() {
  622. return !(!this._southWest || !this._northEast)
  623. }
  624. }, o.latLngBounds = function(t, e) {
  625. return t instanceof o.LatLngBounds ? t : new o.LatLngBounds(t, e)
  626. }, o.Projection = {}, o.Projection.LonLat = {
  627. project: function(t) {
  628. return new o.Point(t.lng, t.lat)
  629. },
  630. unproject: function(t) {
  631. return new o.LatLng(t.y, t.x)
  632. },
  633. bounds: o.bounds([-180, -90], [180, 90])
  634. }, o.Projection.SphericalMercator = {
  635. R: 6378137,
  636. MAX_LATITUDE: 85.0511287798,
  637. project: function(t) {
  638. var e = Math.PI / 180,
  639. i = this.MAX_LATITUDE,
  640. n = Math.max(Math.min(i, t.lat), -i),
  641. s = Math.sin(n * e);
  642. return new o.Point(this.R * t.lng * e, this.R * Math.log((1 + s) / (1 - s)) / 2)
  643. },
  644. unproject: function(t) {
  645. var e = 180 / Math.PI;
  646. return new o.LatLng((2 * Math.atan(Math.exp(t.y / this.R)) - Math.PI / 2) * e, t.x * e / this.R)
  647. },
  648. bounds: function() {
  649. var t = 6378137 * Math.PI;
  650. return o.bounds([-t, -t], [t, t])
  651. }()
  652. }, o.CRS = {
  653. latLngToPoint: function(t, e) {
  654. var i = this.projection.project(t),
  655. n = this.scale(e);
  656. return this.transformation._transform(i, n)
  657. },
  658. pointToLatLng: function(t, e) {
  659. var i = this.scale(e),
  660. n = this.transformation.untransform(t, i);
  661. return this.projection.unproject(n)
  662. },
  663. project: function(t) {
  664. return this.projection.project(t)
  665. },
  666. unproject: function(t) {
  667. return this.projection.unproject(t)
  668. },
  669. scale: function(t) {
  670. return 256 * Math.pow(2, t)
  671. },
  672. zoom: function(t) {
  673. return Math.log(t / 256) / Math.LN2
  674. },
  675. getProjectedBounds: function(t) {
  676. if (this.infinite) return null;
  677. var e = this.projection.bounds,
  678. i = this.scale(t),
  679. n = this.transformation.transform(e.min, i),
  680. s = this.transformation.transform(e.max, i);
  681. return o.bounds(n, s)
  682. },
  683. infinite: !1,
  684. wrapLatLng: function(t) {
  685. var e = this.wrapLng ? o.Util.wrapNum(t.lng, this.wrapLng, !0) : t.lng,
  686. i = this.wrapLat ? o.Util.wrapNum(t.lat, this.wrapLat, !0) : t.lat,
  687. n = t.alt;
  688. return o.latLng(i, e, n)
  689. }
  690. }, o.CRS.Simple = o.extend({}, o.CRS, {
  691. projection: o.Projection.LonLat,
  692. transformation: new o.Transformation(1, 0, -1, 0),
  693. scale: function(t) {
  694. return Math.pow(2, t)
  695. },
  696. zoom: function(t) {
  697. return Math.log(t) / Math.LN2
  698. },
  699. distance: function(t, e) {
  700. var i = e.lng - t.lng,
  701. n = e.lat - t.lat;
  702. return Math.sqrt(i * i + n * n)
  703. },
  704. infinite: !0
  705. }), o.CRS.Earth = o.extend({}, o.CRS, {
  706. wrapLng: [-180, 180],
  707. R: 6371e3,
  708. distance: function(t, e) {
  709. var i = Math.PI / 180,
  710. n = t.lat * i,
  711. o = e.lat * i,
  712. s = Math.sin(n) * Math.sin(o) + Math.cos(n) * Math.cos(o) * Math.cos((e.lng - t.lng) * i);
  713. return this.R * Math.acos(Math.min(s, 1))
  714. }
  715. }), o.CRS.EPSG3857 = o.extend({}, o.CRS.Earth, {
  716. code: "EPSG:3857",
  717. projection: o.Projection.SphericalMercator,
  718. transformation: function() {
  719. var t = .5 / (Math.PI * o.Projection.SphericalMercator.R);
  720. return new o.Transformation(t, .5, -t, .5)
  721. }()
  722. }), o.CRS.EPSG900913 = o.extend({}, o.CRS.EPSG3857, {
  723. code: "EPSG:900913"
  724. }), o.CRS.EPSG4326 = o.extend({}, o.CRS.Earth, {
  725. code: "EPSG:4326",
  726. projection: o.Projection.LonLat,
  727. transformation: new o.Transformation(1 / 180, 1, -1 / 180, .5)
  728. }), o.Map = o.Evented.extend({
  729. options: {
  730. crs: o.CRS.EPSG3857,
  731. center: i,
  732. zoom: i,
  733. minZoom: i,
  734. maxZoom: i,
  735. layers: [],
  736. maxBounds: i,
  737. renderer: i,
  738. zoomAnimation: !0,
  739. zoomAnimationThreshold: 4,
  740. fadeAnimation: !0,
  741. markerZoomAnimation: !0,
  742. transform3DLimit: 8388608,
  743. zoomSnap: 1,
  744. zoomDelta: 1,
  745. trackResize: !0
  746. },
  747. initialize: function(t, e) {
  748. e = o.setOptions(this, e), this._initContainer(t), this._initLayout(), this._onResize = o.bind(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.zoom !== i && (this._zoom = this._limitZoom(e.zoom)), e.center && e.zoom !== i && this.setView(o.latLng(e.center), e.zoom, {
  749. reset: !0
  750. }), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = !0, this.callInitHooks(), this._zoomAnimated = o.DomUtil.TRANSITION && o.Browser.any3d && !o.Browser.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), o.DomEvent.on(this._proxy, o.DomUtil.TRANSITION_END, this._catchTransitionEnd, this)), this._addLayers(this.options.layers)
  751. },
  752. setView: function(t, e, n) {
  753. if (e = e === i ? this._zoom : this._limitZoom(e), t = this._limitCenter(o.latLng(t), e, this.options.maxBounds), n = n || {}, this._stop(), this._loaded && !n.reset && n !== !0) {
  754. n.animate !== i && (n.zoom = o.extend({
  755. animate: n.animate
  756. }, n.zoom), n.pan = o.extend({
  757. animate: n.animate,
  758. duration: n.duration
  759. }, n.pan));
  760. var s = this._zoom !== e ? this._tryAnimatedZoom && this._tryAnimatedZoom(t, e, n.zoom) : this._tryAnimatedPan(t, n.pan);
  761. if (s) return clearTimeout(this._sizeTimer), this
  762. }
  763. return this._resetView(t, e), this
  764. },
  765. setZoom: function(t, e) {
  766. return this._loaded ? this.setView(this.getCenter(), t, {
  767. zoom: e
  768. }) : (this._zoom = t, this)
  769. },
  770. zoomIn: function(t, e) {
  771. return t = t || (o.Browser.any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom + t, e)
  772. },
  773. zoomOut: function(t, e) {
  774. return t = t || (o.Browser.any3d ? this.options.zoomDelta : 1), this.setZoom(this._zoom - t, e)
  775. },
  776. setZoomAround: function(t, e, i) {
  777. var n = this.getZoomScale(e),
  778. s = this.getSize().divideBy(2),
  779. r = t instanceof o.Point ? t : this.latLngToContainerPoint(t),
  780. a = r.subtract(s).multiplyBy(1 - 1 / n),
  781. h = this.containerPointToLatLng(s.add(a));
  782. return this.setView(h, e, {
  783. zoom: i
  784. })
  785. },
  786. _getBoundsCenterZoom: function(t, e) {
  787. e = e || {}, t = t.getBounds ? t.getBounds() : o.latLngBounds(t);
  788. var i = o.point(e.paddingTopLeft || e.padding || [0, 0]),
  789. n = o.point(e.paddingBottomRight || e.padding || [0, 0]),
  790. s = this.getBoundsZoom(t, !1, i.add(n));
  791. s = "number" == typeof e.maxZoom ? Math.min(e.maxZoom, s) : s;
  792. var r = n.subtract(i).divideBy(2),
  793. a = this.project(t.getSouthWest(), s),
  794. h = this.project(t.getNorthEast(), s),
  795. l = this.unproject(a.add(h).divideBy(2).add(r), s);
  796. return {
  797. center: l,
  798. zoom: s
  799. }
  800. },
  801. fitBounds: function(t, e) {
  802. if (t = o.latLngBounds(t), !t.isValid()) throw new Error("Bounds are not valid.");
  803. var i = this._getBoundsCenterZoom(t, e);
  804. return this.setView(i.center, i.zoom, e)
  805. },
  806. fitWorld: function(t) {
  807. return this.fitBounds([
  808. [-90, -180],
  809. [90, 180]
  810. ], t)
  811. },
  812. panTo: function(t, e) {
  813. return this.setView(t, this._zoom, {
  814. pan: e
  815. })
  816. },
  817. panBy: function(t, e) {
  818. if (t = o.point(t).round(), e = e || {}, !t.x && !t.y) return this.fire("moveend");
  819. if (e.animate !== !0 && !this.getSize().contains(t)) return this._resetView(this.unproject(this.project(this.getCenter()).add(t)), this.getZoom()), this;
  820. if (this._panAnim || (this._panAnim = new o.PosAnimation, this._panAnim.on({
  821. step: this._onPanTransitionStep,
  822. end: this._onPanTransitionEnd
  823. }, this)), e.noMoveStart || this.fire("movestart"), e.animate !== !1) {
  824. o.DomUtil.addClass(this._mapPane, "leaflet-pan-anim");
  825. var i = this._getMapPanePos().subtract(t).round();
  826. this._panAnim.run(this._mapPane, i, e.duration || .25, e.easeLinearity)
  827. } else this._rawPanBy(t), this.fire("move").fire("moveend");
  828. return this
  829. },
  830. flyTo: function(t, e, n) {
  831. function s(t) {
  832. var e = t ? -1 : 1,
  833. i = t ? v : g,
  834. n = v * v - g * g + e * L * L * y * y,
  835. o = 2 * i * L * y,
  836. s = n / o,
  837. r = Math.sqrt(s * s + 1) - s,
  838. a = r < 1e-9 ? -18 : Math.log(r);
  839. return a
  840. }
  841. function r(t) {
  842. return (Math.exp(t) - Math.exp(-t)) / 2
  843. }
  844. function a(t) {
  845. return (Math.exp(t) + Math.exp(-t)) / 2
  846. }
  847. function h(t) {
  848. return r(t) / a(t)
  849. }
  850. function l(t) {
  851. return g * (a(x) / a(x + P * t))
  852. }
  853. function u(t) {
  854. return g * (a(x) * h(x + P * t) - r(x)) / L
  855. }
  856. function c(t) {
  857. return 1 - Math.pow(1 - t, 1.5)
  858. }
  859. function d() {
  860. var i = (Date.now() - b) / T,
  861. n = c(i) * w;
  862. i <= 1 ? (this._flyToFrame = o.Util.requestAnimFrame(d, this), this._move(this.unproject(_.add(m.subtract(_).multiplyBy(u(n) / y)), f), this.getScaleZoom(g / l(n), f), {
  863. flyTo: !0
  864. })) : this._move(t, e)._moveEnd(!0)
  865. }
  866. if (n = n || {}, n.animate === !1 || !o.Browser.any3d) return this.setView(t, e, n);
  867. this._stop();
  868. var _ = this.project(this.getCenter()),
  869. m = this.project(t),
  870. p = this.getSize(),
  871. f = this._zoom;
  872. t = o.latLng(t), e = e === i ? f : e;
  873. var g = Math.max(p.x, p.y),
  874. v = g * this.getZoomScale(f, e),
  875. y = m.distanceTo(_) || 1,
  876. P = 1.42,
  877. L = P * P,
  878. x = s(0),
  879. b = Date.now(),
  880. w = (s(1) - x) / P,
  881. T = n.duration ? 1e3 * n.duration : 1e3 * w * .8;
  882. return this._moveStart(!0), d.call(this), this
  883. },
  884. flyToBounds: function(t, e) {
  885. var i = this._getBoundsCenterZoom(t, e);
  886. return this.flyTo(i.center, i.zoom, e)
  887. },
  888. setMaxBounds: function(t) {
  889. return t = o.latLngBounds(t), t.isValid() ? (this.options.maxBounds && this.off("moveend", this._panInsideMaxBounds), this.options.maxBounds = t, this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds)) : (this.options.maxBounds = null, this.off("moveend", this._panInsideMaxBounds))
  890. },
  891. setMinZoom: function(t) {
  892. return this.options.minZoom = t, this._loaded && this.getZoom() < this.options.minZoom ? this.setZoom(t) : this
  893. },
  894. setMaxZoom: function(t) {
  895. return this.options.maxZoom = t, this._loaded && this.getZoom() > this.options.maxZoom ? this.setZoom(t) : this
  896. },
  897. panInsideBounds: function(t, e) {
  898. this._enforcingBounds = !0;
  899. var i = this.getCenter(),
  900. n = this._limitCenter(i, this._zoom, o.latLngBounds(t));
  901. return i.equals(n) || this.panTo(n, e), this._enforcingBounds = !1, this
  902. },
  903. invalidateSize: function(t) {
  904. if (!this._loaded) return this;
  905. t = o.extend({
  906. animate: !1,
  907. pan: !0
  908. }, t === !0 ? {
  909. animate: !0
  910. } : t);
  911. var e = this.getSize();
  912. this._sizeChanged = !0, this._lastCenter = null;
  913. var i = this.getSize(),
  914. n = e.divideBy(2).round(),
  915. s = i.divideBy(2).round(),
  916. r = n.subtract(s);
  917. return r.x || r.y ? (t.animate && t.pan ? this.panBy(r) : (t.pan && this._rawPanBy(r), this.fire("move"), t.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(o.bind(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
  918. oldSize: e,
  919. newSize: i
  920. })) : this
  921. },
  922. stop: function() {
  923. return this.setZoom(this._limitZoom(this._zoom)), this.options.zoomSnap || this.fire("viewreset"), this._stop()
  924. },
  925. locate: function(t) {
  926. if (t = this._locateOptions = o.extend({
  927. timeout: 1e4,
  928. watch: !1
  929. }, t), !("geolocation" in navigator)) return this._handleGeolocationError({
  930. code: 0,
  931. message: "Geolocation not supported."
  932. }), this;
  933. var e = o.bind(this._handleGeolocationResponse, this),
  934. i = o.bind(this._handleGeolocationError, this);
  935. return t.watch ? this._locationWatchId = navigator.geolocation.watchPosition(e, i, t) : navigator.geolocation.getCurrentPosition(e, i, t), this
  936. },
  937. stopLocate: function() {
  938. return navigator.geolocation && navigator.geolocation.clearWatch && navigator.geolocation.clearWatch(this._locationWatchId), this._locateOptions && (this._locateOptions.setView = !1), this
  939. },
  940. _handleGeolocationError: function(t) {
  941. var e = t.code,
  942. i = t.message || (1 === e ? "permission denied" : 2 === e ? "position unavailable" : "timeout");
  943. this._locateOptions.setView && !this._loaded && this.fitWorld(), this.fire("locationerror", {
  944. code: e,
  945. message: "Geolocation error: " + i + "."
  946. })
  947. },
  948. _handleGeolocationResponse: function(t) {
  949. var e = t.coords.latitude,
  950. i = t.coords.longitude,
  951. n = new o.LatLng(e, i),
  952. s = n.toBounds(t.coords.accuracy),
  953. r = this._locateOptions;
  954. if (r.setView) {
  955. var a = this.getBoundsZoom(s);
  956. this.setView(n, r.maxZoom ? Math.min(a, r.maxZoom) : a)
  957. }
  958. var h = {
  959. latlng: n,
  960. bounds: s,
  961. timestamp: t.timestamp
  962. };
  963. for (var l in t.coords)"number" == typeof t.coords[l] && (h[l] = t.coords[l]);
  964. this.fire("locationfound", h)
  965. },
  966. addHandler: function(t, e) {
  967. if (!e) return this;
  968. var i = this[t] = new e(this);
  969. return this._handlers.push(i), this.options[t] && i.enable(), this
  970. },
  971. remove: function() {
  972. if (this._initEvents(!0), this._containerId !== this._container._leaflet_id) throw new Error("Map container is being reused by another instance");
  973. try {
  974. delete this._container._leaflet_id, delete this._containerId
  975. } catch (t) {
  976. this._container._leaflet_id = i, this._containerId = i
  977. }
  978. o.DomUtil.remove(this._mapPane), this._clearControlPos && this._clearControlPos(), this._clearHandlers(), this._loaded && this.fire("unload");
  979. for (var t in this._layers) this._layers[t].remove();
  980. return this
  981. },
  982. createPane: function(t, e) {
  983. var i = "leaflet-pane" + (t ? " leaflet-" + t.replace("Pane", "") + "-pane" : ""),
  984. n = o.DomUtil.create("div", i, e || this._mapPane);
  985. return t && (this._panes[t] = n), n
  986. },
  987. getCenter: function() {
  988. return this._checkIfLoaded(), this._lastCenter && !this._moved() ? this._lastCenter : this.layerPointToLatLng(this._getCenterLayerPoint())
  989. },
  990. getZoom: function() {
  991. return this._zoom
  992. },
  993. getBounds: function() {
  994. var t = this.getPixelBounds(),
  995. e = this.unproject(t.getBottomLeft()),
  996. i = this.unproject(t.getTopRight());
  997. return new o.LatLngBounds(e, i)
  998. },
  999. getMinZoom: function() {
  1000. return this.options.minZoom === i ? this._layersMinZoom || 0 : this.options.minZoom
  1001. },
  1002. getMaxZoom: function() {
  1003. return this.options.maxZoom === i ? this._layersMaxZoom === i ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom
  1004. },
  1005. getBoundsZoom: function(t, e, i) {
  1006. t = o.latLngBounds(t), i = o.point(i || [0, 0]);
  1007. var n = this.getZoom() || 0,
  1008. s = this.getMinZoom(),
  1009. r = this.getMaxZoom(),
  1010. a = t.getNorthWest(),
  1011. h = t.getSouthEast(),
  1012. l = this.getSize().subtract(i),
  1013. u = this.project(h, n).subtract(this.project(a, n)),
  1014. c = o.Browser.any3d ? this.options.zoomSnap : 1,
  1015. d = Math.min(l.x / u.x, l.y / u.y);
  1016. return n = this.getScaleZoom(d, n), c && (n = Math.round(n / (c / 100)) * (c / 100), n = e ? Math.ceil(n / c) * c : Math.floor(n / c) * c), Math.max(s, Math.min(r, n))
  1017. },
  1018. getSize: function() {
  1019. return this._size && !this._sizeChanged || (this._size = new o.Point(this._container.clientWidth, this._container.clientHeight), this._sizeChanged = !1), this._size.clone()
  1020. },
  1021. getPixelBounds: function(t, e) {
  1022. var i = this._getTopLeftPoint(t, e);
  1023. return new o.Bounds(i, i.add(this.getSize()))
  1024. },
  1025. getPixelOrigin: function() {
  1026. return this._checkIfLoaded(), this._pixelOrigin
  1027. },
  1028. getPixelWorldBounds: function(t) {
  1029. return this.options.crs.getProjectedBounds(t === i ? this.getZoom() : t)
  1030. },
  1031. getPane: function(t) {
  1032. return "string" == typeof t ? this._panes[t] : t
  1033. },
  1034. getPanes: function() {
  1035. return this._panes
  1036. },
  1037. getContainer: function() {
  1038. return this._container
  1039. },
  1040. getZoomScale: function(t, e) {
  1041. var n = this.options.crs;
  1042. return e = e === i ? this._zoom : e, n.scale(t) / n.scale(e)
  1043. },
  1044. getScaleZoom: function(t, e) {
  1045. var n = this.options.crs;
  1046. e = e === i ? this._zoom : e;
  1047. var o = n.zoom(t * n.scale(e));
  1048. return isNaN(o) ? 1 / 0 : o
  1049. },
  1050. project: function(t, e) {
  1051. return e = e === i ? this._zoom : e, this.options.crs.latLngToPoint(o.latLng(t), e)
  1052. },
  1053. unproject: function(t, e) {
  1054. return e = e === i ? this._zoom : e, this.options.crs.pointToLatLng(o.point(t), e)
  1055. },
  1056. layerPointToLatLng: function(t) {
  1057. var e = o.point(t).add(this.getPixelOrigin());
  1058. return this.unproject(e)
  1059. },
  1060. latLngToLayerPoint: function(t) {
  1061. var e = this.project(o.latLng(t))._round();
  1062. return e._subtract(this.getPixelOrigin())
  1063. },
  1064. wrapLatLng: function(t) {
  1065. return this.options.crs.wrapLatLng(o.latLng(t))
  1066. },
  1067. distance: function(t, e) {
  1068. return this.options.crs.distance(o.latLng(t), o.latLng(e))
  1069. },
  1070. containerPointToLayerPoint: function(t) {
  1071. return o.point(t).subtract(this._getMapPanePos())
  1072. },
  1073. layerPointToContainerPoint: function(t) {
  1074. return o.point(t).add(this._getMapPanePos())
  1075. },
  1076. containerPointToLatLng: function(t) {
  1077. var e = this.containerPointToLayerPoint(o.point(t));
  1078. return this.layerPointToLatLng(e)
  1079. },
  1080. latLngToContainerPoint: function(t) {
  1081. return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))
  1082. },
  1083. mouseEventToContainerPoint: function(t) {
  1084. return o.DomEvent.getMousePosition(t, this._container)
  1085. },
  1086. mouseEventToLayerPoint: function(t) {
  1087. return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))
  1088. },
  1089. mouseEventToLatLng: function(t) {
  1090. return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))
  1091. },
  1092. _initContainer: function(t) {
  1093. var e = this._container = o.DomUtil.get(t);
  1094. if (!e) throw new Error("Map container not found.");
  1095. if (e._leaflet_id) throw new Error("Map container is already initialized.");
  1096. o.DomEvent.addListener(e, "scroll", this._onScroll, this), this._containerId = o.Util.stamp(e)
  1097. },
  1098. _initLayout: function() {
  1099. var t = this._container;
  1100. this._fadeAnimated = this.options.fadeAnimation && o.Browser.any3d, o.DomUtil.addClass(t, "leaflet-container" + (o.Browser.touch ? " leaflet-touch" : "") + (o.Browser.retina ? " leaflet-retina" : "") + (o.Browser.ielt9 ? " leaflet-oldie" : "") + (o.Browser.safari ? " leaflet-safari" : "") + (this._fadeAnimated ? " leaflet-fade-anim" : ""));
  1101. var e = o.DomUtil.getStyle(t, "position");
  1102. "absolute" !== e && "relative" !== e && "fixed" !== e && (t.style.position = "relative"), this._initPanes(), this._initControlPos && this._initControlPos()
  1103. },
  1104. _initPanes: function() {
  1105. var t = this._panes = {};
  1106. this._paneRenderers = {}, this._mapPane = this.createPane("mapPane", this._container), o.DomUtil.setPosition(this._mapPane, new o.Point(0, 0)), this.createPane("tilePane"), this.createPane("shadowPane"), this.createPane("overlayPane"), this.createPane("markerPane"), this.createPane("tooltipPane"), this.createPane("popupPane"), this.options.markerZoomAnimation || (o.DomUtil.addClass(t.markerPane, "leaflet-zoom-hide"), o.DomUtil.addClass(t.shadowPane, "leaflet-zoom-hide"))
  1107. },
  1108. _resetView: function(t, e) {
  1109. o.DomUtil.setPosition(this._mapPane, new o.Point(0, 0));
  1110. var i = !this._loaded;
  1111. this._loaded = !0, e = this._limitZoom(e), this.fire("viewprereset");
  1112. var n = this._zoom !== e;
  1113. this._moveStart(n)._move(t, e)._moveEnd(n), this.fire("viewreset"), i && this.fire("load")
  1114. },
  1115. _moveStart: function(t) {
  1116. return t && this.fire("zoomstart"), this.fire("movestart")
  1117. },
  1118. _move: function(t, e, n) {
  1119. e === i && (e = this._zoom);
  1120. var o = this._zoom !== e;
  1121. return this._zoom = e, this._lastCenter = t, this._pixelOrigin = this._getNewPixelOrigin(t), (o || n && n.pinch) && this.fire("zoom", n), this.fire("move", n)
  1122. },
  1123. _moveEnd: function(t) {
  1124. return t && this.fire("zoomend"), this.fire("moveend")
  1125. },
  1126. _stop: function() {
  1127. return o.Util.cancelAnimFrame(this._flyToFrame), this._panAnim && this._panAnim.stop(), this
  1128. },
  1129. _rawPanBy: function(t) {
  1130. o.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(t))
  1131. },
  1132. _getZoomSpan: function() {
  1133. return this.getMaxZoom() - this.getMinZoom()
  1134. },
  1135. _panInsideMaxBounds: function() {
  1136. this._enforcingBounds || this.panInsideBounds(this.options.maxBounds)
  1137. },
  1138. _checkIfLoaded: function() {
  1139. if (!this._loaded) throw new Error("Set map center and zoom first.")
  1140. },
  1141. _initEvents: function(e) {
  1142. if (o.DomEvent) {
  1143. this._targets = {}, this._targets[o.stamp(this._container)] = this;
  1144. var i = e ? "off" : "on";
  1145. o.DomEvent[i](this._container, "click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress", this._handleDOMEvent, this), this.options.trackResize && o.DomEvent[i](t, "resize", this._onResize, this), o.Browser.any3d && this.options.transform3DLimit && this[i]("moveend", this._onMoveEnd)
  1146. }
  1147. },
  1148. _onResize: function() {
  1149. o.Util.cancelAnimFrame(this._resizeRequest), this._resizeRequest = o.Util.requestAnimFrame(function() {
  1150. this.invalidateSize({
  1151. debounceMoveend: !0
  1152. })
  1153. }, this)
  1154. },
  1155. _onScroll: function() {
  1156. this._container.scrollTop = 0, this._container.scrollLeft = 0
  1157. },
  1158. _onMoveEnd: function() {
  1159. var t = this._getMapPanePos();
  1160. Math.max(Math.abs(t.x), Math.abs(t.y)) >= this.options.transform3DLimit && this._resetView(this.getCenter(), this.getZoom())
  1161. },
  1162. _findEventTargets: function(t, e) {
  1163. for (var i, n = [], s = "mouseout" === e || "mouseover" === e, r = t.target || t.srcElement, a = !1; r;) {
  1164. if (i = this._targets[o.stamp(r)], i && ("click" === e || "preclick" === e) && !t._simulated && this._draggableMoved(i)) {
  1165. a = !0;
  1166. break
  1167. }
  1168. if (i && i.listens(e, !0)) {
  1169. if (s && !o.DomEvent._isExternalTarget(r, t)) break;
  1170. if (n.push(i), s) break
  1171. }
  1172. if (r === this._container) break;
  1173. r = r.parentNode
  1174. }
  1175. return n.length || a || s || !o.DomEvent._isExternalTarget(r, t) || (n = [this]), n
  1176. },
  1177. _handleDOMEvent: function(t) {
  1178. if (this._loaded && !o.DomEvent._skipped(t)) {
  1179. var e = "keypress" === t.type && 13 === t.keyCode ? "click" : t.type;
  1180. "mousedown" === e && o.DomUtil.preventOutline(t.target || t.srcElement), this._fireDOMEvent(t, e)
  1181. }
  1182. },
  1183. _fireDOMEvent: function(t, e, i) {
  1184. if ("click" === t.type) {
  1185. var n = o.Util.extend({}, t);
  1186. n.type = "preclick", this._fireDOMEvent(n, n.type, i)
  1187. }
  1188. if (!t._stopped && (i = (i || []).concat(this._findEventTargets(t, e)), i.length)) {
  1189. var s = i[0];
  1190. "contextmenu" === e && s.listens(e, !0) && o.DomEvent.preventDefault(t);
  1191. var r = {
  1192. originalEvent: t
  1193. };
  1194. if ("keypress" !== t.type) {
  1195. var a = s instanceof o.Marker;
  1196. r.containerPoint = a ? this.latLngToContainerPoint(s.getLatLng()) : this.mouseEventToContainerPoint(t), r.layerPoint = this.containerPointToLayerPoint(r.containerPoint), r.latlng = a ? s.getLatLng() : this.layerPointToLatLng(r.layerPoint)
  1197. }
  1198. for (var h = 0; h < i.length; h++) if (i[h].fire(e, r, !0), r.originalEvent._stopped || i[h].options.nonBubblingEvents && o.Util.indexOf(i[h].options.nonBubblingEvents, e) !== -1) return
  1199. }
  1200. },
  1201. _draggableMoved: function(t) {
  1202. return t = t.dragging && t.dragging.enabled() ? t : this, t.dragging && t.dragging.moved() || this.boxZoom && this.boxZoom.moved()
  1203. },
  1204. _clearHandlers: function() {
  1205. for (var t = 0, e = this._handlers.length; t < e; t++) this._handlers[t].disable()
  1206. },
  1207. whenReady: function(t, e) {
  1208. return this._loaded ? t.call(e || this, {
  1209. target: this
  1210. }) : this.on("load", t, e), this
  1211. },
  1212. _getMapPanePos: function() {
  1213. return o.DomUtil.getPosition(this._mapPane) || new o.Point(0, 0)
  1214. },
  1215. _moved: function() {
  1216. var t = this._getMapPanePos();
  1217. return t && !t.equals([0, 0])
  1218. },
  1219. _getTopLeftPoint: function(t, e) {
  1220. var n = t && e !== i ? this._getNewPixelOrigin(t, e) : this.getPixelOrigin();
  1221. return n.subtract(this._getMapPanePos())
  1222. },
  1223. _getNewPixelOrigin: function(t, e) {
  1224. var i = this.getSize()._divideBy(2);
  1225. return this.project(t, e)._subtract(i)._add(this._getMapPanePos())._round()
  1226. },
  1227. _latLngToNewLayerPoint: function(t, e, i) {
  1228. var n = this._getNewPixelOrigin(i, e);
  1229. return this.project(t, e)._subtract(n)
  1230. },
  1231. _latLngBoundsToNewLayerBounds: function(t, e, i) {
  1232. var n = this._getNewPixelOrigin(i, e);
  1233. return o.bounds([this.project(t.getSouthWest(), e)._subtract(n), this.project(t.getNorthWest(), e)._subtract(n), this.project(t.getSouthEast(), e)._subtract(n), this.project(t.getNorthEast(), e)._subtract(n)])
  1234. },
  1235. _getCenterLayerPoint: function() {
  1236. return this.containerPointToLayerPoint(this.getSize()._divideBy(2))
  1237. },
  1238. _getCenterOffset: function(t) {
  1239. return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())
  1240. },
  1241. _limitCenter: function(t, e, i) {
  1242. if (!i) return t;
  1243. var n = this.project(t, e),
  1244. s = this.getSize().divideBy(2),
  1245. r = new o.Bounds(n.subtract(s), n.add(s)),
  1246. a = this._getBoundsOffset(r, i, e);
  1247. return a.round().equals([0, 0]) ? t : this.unproject(n.add(a), e)
  1248. },
  1249. _limitOffset: function(t, e) {
  1250. if (!e) return t;
  1251. var i = this.getPixelBounds(),
  1252. n = new o.Bounds(i.min.add(t), i.max.add(t));
  1253. return t.add(this._getBoundsOffset(n, e))
  1254. },
  1255. _getBoundsOffset: function(t, e, i) {
  1256. var n = o.bounds(this.project(e.getNorthEast(), i), this.project(e.getSouthWest(), i)),
  1257. s = n.min.subtract(t.min),
  1258. r = n.max.subtract(t.max),
  1259. a = this._rebound(s.x, -r.x),
  1260. h = this._rebound(s.y, -r.y);
  1261. return new o.Point(a, h)
  1262. },
  1263. _rebound: function(t, e) {
  1264. return t + e > 0 ? Math.round(t - e) / 2 : Math.max(0, Math.ceil(t)) - Math.max(0, Math.floor(e))
  1265. },
  1266. _limitZoom: function(t) {
  1267. var e = this.getMinZoom(),
  1268. i = this.getMaxZoom(),
  1269. n = o.Browser.any3d ? this.options.zoomSnap : 1;
  1270. return n && (t = Math.round(t / n) * n), Math.max(e, Math.min(i, t))
  1271. },
  1272. _onPanTransitionStep: function() {
  1273. this.fire("move")
  1274. },
  1275. _onPanTransitionEnd: function() {
  1276. o.DomUtil.removeClass(this._mapPane, "leaflet-pan-anim"), this.fire("moveend")
  1277. },
  1278. _tryAnimatedPan: function(t, e) {
  1279. var i = this._getCenterOffset(t)._floor();
  1280. return !((e && e.animate) !== !0 && !this.getSize().contains(i)) && (this.panBy(i, e), !0)
  1281. },
  1282. _createAnimProxy: function() {
  1283. var t = this._proxy = o.DomUtil.create("div", "leaflet-proxy leaflet-zoom-animated");
  1284. this._panes.mapPane.appendChild(t), this.on("zoomanim", function(e) {
  1285. var i = o.DomUtil.TRANSFORM,
  1286. n = t.style[i];
  1287. o.DomUtil.setTransform(t, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1)), n === t.style[i] && this._animatingZoom && this._onZoomTransitionEnd()
  1288. }, this), this.on("load moveend", function() {
  1289. var e = this.getCenter(),
  1290. i = this.getZoom();
  1291. o.DomUtil.setTransform(t, this.project(e, i), this.getZoomScale(i, 1))
  1292. }, this)
  1293. },
  1294. _catchTransitionEnd: function(t) {
  1295. this._animatingZoom && t.propertyName.indexOf("transform") >= 0 && this._onZoomTransitionEnd()
  1296. },
  1297. _nothingToAnimate: function() {
  1298. return !this._container.getElementsByClassName("leaflet-zoom-animated").length
  1299. },
  1300. _tryAnimatedZoom: function(t, e, i) {
  1301. if (this._animatingZoom) return !0;
  1302. if (i = i || {}, !this._zoomAnimated || i.animate === !1 || this._nothingToAnimate() || Math.abs(e - this._zoom) > this.options.zoomAnimationThreshold) return !1;
  1303. var n = this.getZoomScale(e),
  1304. s = this._getCenterOffset(t)._divideBy(1 - 1 / n);
  1305. return !(i.animate !== !0 && !this.getSize().contains(s)) && (o.Util.requestAnimFrame(function() {
  1306. this._moveStart(!0)._animateZoom(t, e, !0)
  1307. }, this), !0)
  1308. },
  1309. _animateZoom: function(t, e, i, n) {
  1310. i && (this._animatingZoom = !0, this._animateToCenter = t, this._animateToZoom = e, o.DomUtil.addClass(this._mapPane, "leaflet-zoom-anim")), this.fire("zoomanim", {
  1311. center: t,
  1312. zoom: e,
  1313. noUpdate: n
  1314. }), setTimeout(o.bind(this._onZoomTransitionEnd, this), 250)
  1315. },
  1316. _onZoomTransitionEnd: function() {
  1317. this._animatingZoom && (o.DomUtil.removeClass(this._mapPane, "leaflet-zoom-anim"), this._animatingZoom = !1, this._move(this._animateToCenter, this._animateToZoom), o.Util.requestAnimFrame(function() {
  1318. this._moveEnd(!0)
  1319. }, this))
  1320. }
  1321. }), o.map = function(t, e) {
  1322. return new o.Map(t, e)
  1323. }, o.Layer = o.Evented.extend({
  1324. options: {
  1325. pane: "overlayPane",
  1326. nonBubblingEvents: [],
  1327. attribution: null
  1328. },
  1329. addTo: function(t) {
  1330. return t.addLayer(this), this
  1331. },
  1332. remove: function() {
  1333. return this.removeFrom(this._map || this._mapToAdd)
  1334. },
  1335. removeFrom: function(t) {
  1336. return t && t.removeLayer(this), this
  1337. },
  1338. getPane: function(t) {
  1339. return this._map.getPane(t ? this.options[t] || t : this.options.pane)
  1340. },
  1341. addInteractiveTarget: function(t) {
  1342. return this._map._targets[o.stamp(t)] = this, this
  1343. },
  1344. removeInteractiveTarget: function(t) {
  1345. return delete this._map._targets[o.stamp(t)], this
  1346. },
  1347. getAttribution: function() {
  1348. return this.options.attribution
  1349. },
  1350. _layerAdd: function(t) {
  1351. var e = t.target;
  1352. if (e.hasLayer(this)) {
  1353. if (this._map = e, this._zoomAnimated = e._zoomAnimated, this.getEvents) {
  1354. var i = this.getEvents();
  1355. e.on(i, this), this.once("remove", function() {
  1356. e.off(i, this)
  1357. }, this)
  1358. }
  1359. this.onAdd(e), this.getAttribution && this._map.attributionControl && this._map.attributionControl.addAttribution(this.getAttribution()), this.fire("add"), e.fire("layeradd", {
  1360. layer: this
  1361. })
  1362. }
  1363. }
  1364. }), o.Map.include({
  1365. addLayer: function(t) {
  1366. var e = o.stamp(t);
  1367. return this._layers[e] ? this : (this._layers[e] = t, t._mapToAdd = this, t.beforeAdd && t.beforeAdd(this), this.whenReady(t._layerAdd, t), this)
  1368. },
  1369. removeLayer: function(t) {
  1370. var e = o.stamp(t);
  1371. return this._layers[e] ? (this._loaded && t.onRemove(this), t.getAttribution && this.attributionControl && this.attributionControl.removeAttribution(t.getAttribution()), delete this._layers[e], this._loaded && (this.fire("layerremove", {
  1372. layer: t
  1373. }), t.fire("remove")), t._map = t._mapToAdd = null, this) : this
  1374. },
  1375. hasLayer: function(t) {
  1376. return !!t && o.stamp(t) in this._layers
  1377. },
  1378. eachLayer: function(t, e) {
  1379. for (var i in this._layers) t.call(e, this._layers[i]);
  1380. return this
  1381. },
  1382. _addLayers: function(t) {
  1383. t = t ? o.Util.isArray(t) ? t : [t] : [];
  1384. for (var e = 0, i = t.length; e < i; e++) this.addLayer(t[e])
  1385. },
  1386. _addZoomLimit: function(t) {
  1387. !isNaN(t.options.maxZoom) && isNaN(t.options.minZoom) || (this._zoomBoundLayers[o.stamp(t)] = t, this._updateZoomLevels())
  1388. },
  1389. _removeZoomLimit: function(t) {
  1390. var e = o.stamp(t);
  1391. this._zoomBoundLayers[e] && (delete this._zoomBoundLayers[e], this._updateZoomLevels())
  1392. },
  1393. _updateZoomLevels: function() {
  1394. var t = 1 / 0,
  1395. e = -(1 / 0),
  1396. n = this._getZoomSpan();
  1397. for (var o in this._zoomBoundLayers) {
  1398. var s = this._zoomBoundLayers[o].options;
  1399. t = s.minZoom === i ? t : Math.min(t, s.minZoom), e = s.maxZoom === i ? e : Math.max(e, s.maxZoom)
  1400. }
  1401. this._layersMaxZoom = e === -(1 / 0) ? i : e, this._layersMinZoom = t === 1 / 0 ? i : t, n !== this._getZoomSpan() && this.fire("zoomlevelschange"), this.options.maxZoom === i && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom && this.setZoom(this._layersMaxZoom), this.options.minZoom === i && this._layersMinZoom && this.getZoom() < this._layersMinZoom && this.setZoom(this._layersMinZoom)
  1402. }
  1403. });
  1404. var r = "_leaflet_events";
  1405. o.DomEvent = {
  1406. on: function(t, e, i, n) {
  1407. if ("object" == typeof e) for (var s in e) this._on(t, s, e[s], i);
  1408. else {
  1409. e = o.Util.splitWords(e);
  1410. for (var r = 0, a = e.length; r < a; r++) this._on(t, e[r], i, n)
  1411. }
  1412. return this
  1413. },
  1414. off: function(t, e, i, n) {
  1415. if ("object" == typeof e) for (var s in e) this._off(t, s, e[s], i);
  1416. else {
  1417. e = o.Util.splitWords(e);
  1418. for (var r = 0, a = e.length; r < a; r++) this._off(t, e[r], i, n)
  1419. }
  1420. return this
  1421. },
  1422. _on: function(e, i, n, s) {
  1423. var a = i + o.stamp(n) + (s ? "_" + o.stamp(s) : "");
  1424. if (e[r] && e[r][a]) return this;
  1425. var h = function(i) {
  1426. return n.call(s || e, i || t.event)
  1427. },
  1428. l = h;
  1429. return o.Browser.pointer && 0 === i.indexOf("touch") ? this.addPointerListener(e, i, h, a) : o.Browser.touch && "dblclick" === i && this.addDoubleTapListener ? this.addDoubleTapListener(e, h, a) : "addEventListener" in e ? "mousewheel" === i ? e.addEventListener("onwheel" in e ? "wheel" : "mousewheel", h, !1) : "mouseenter" === i || "mouseleave" === i ? (h = function(i) {
  1430. i = i || t.event, o.DomEvent._isExternalTarget(e, i) && l(i)
  1431. }, e.addEventListener("mouseenter" === i ? "mouseover" : "mouseout", h, !1)) : ("click" === i && o.Browser.android && (h = function(t) {
  1432. return o.DomEvent._filterClick(t, l)
  1433. }), e.addEventListener(i, h, !1)) : "attachEvent" in e && e.attachEvent("on" + i, h), e[r] = e[r] || {}, e[r][a] = h, this
  1434. },
  1435. _off: function(t, e, i, n) {
  1436. var s = e + o.stamp(i) + (n ? "_" + o.stamp(n) : ""),
  1437. a = t[r] && t[r][s];
  1438. return a ? (o.Browser.pointer && 0 === e.indexOf("touch") ? this.removePointerListener(t, e, s) : o.Browser.touch && "dblclick" === e && this.removeDoubleTapListener ? this.removeDoubleTapListener(t, s) : "removeEventListener" in t ? "mousewheel" === e ? t.removeEventListener("onwheel" in t ? "wheel" : "mousewheel", a, !1) : t.removeEventListener("mouseenter" === e ? "mouseover" : "mouseleave" === e ? "mouseout" : e, a, !1) : "detachEvent" in t && t.detachEvent("on" + e, a), t[r][s] = null, this) : this
  1439. },
  1440. stopPropagation: function(t) {
  1441. return t.stopPropagation ? t.stopPropagation() : t.originalEvent ? t.originalEvent._stopped = !0 : t.cancelBubble = !0, o.DomEvent._skipped(t), this
  1442. },
  1443. disableScrollPropagation: function(t) {
  1444. return o.DomEvent.on(t, "mousewheel", o.DomEvent.stopPropagation)
  1445. },
  1446. disableClickPropagation: function(t) {
  1447. var e = o.DomEvent.stopPropagation;
  1448. return o.DomEvent.on(t, o.Draggable.START.join(" "), e), o.DomEvent.on(t, {
  1449. click: o.DomEvent._fakeStop,
  1450. dblclick: e
  1451. })
  1452. },
  1453. preventDefault: function(t) {
  1454. return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this
  1455. },
  1456. stop: function(t) {
  1457. return o.DomEvent.preventDefault(t).stopPropagation(t)
  1458. },
  1459. getMousePosition: function(t, e) {
  1460. if (!e) return new o.Point(t.clientX, t.clientY);
  1461. var i = e.getBoundingClientRect();
  1462. return new o.Point(t.clientX - i.left - e.clientLeft, t.clientY - i.top - e.clientTop)
  1463. },
  1464. _wheelPxFactor: o.Browser.win && o.Browser.chrome ? 2 : o.Browser.gecko ? t.devicePixelRatio : 1,
  1465. getWheelDelta: function(t) {
  1466. return o.Browser.edge ? t.wheelDeltaY / 2 : t.deltaY && 0 === t.deltaMode ? -t.deltaY / o.DomEvent._wheelPxFactor : t.deltaY && 1 === t.deltaMode ? 20 * -t.deltaY : t.deltaY && 2 === t.deltaMode ? 60 * -t.deltaY : t.deltaX || t.deltaZ ? 0 : t.wheelDelta ? (t.wheelDeltaY || t.wheelDelta) / 2 : t.detail && Math.abs(t.detail) < 32765 ? 20 * -t.detail : t.detail ? t.detail / -32765 * 60 : 0
  1467. },
  1468. _skipEvents: {},
  1469. _fakeStop: function(t) {
  1470. o.DomEvent._skipEvents[t.type] = !0
  1471. },
  1472. _skipped: function(t) {
  1473. var e = this._skipEvents[t.type];
  1474. return this._skipEvents[t.type] = !1, e
  1475. },
  1476. _isExternalTarget: function(t, e) {
  1477. var i = e.relatedTarget;
  1478. if (!i) return !0;
  1479. try {
  1480. for (; i && i !== t;) i = i.parentNode
  1481. } catch (t) {
  1482. return !1
  1483. }
  1484. return i !== t
  1485. },
  1486. _filterClick: function(t, e) {
  1487. var i = t.timeStamp || t.originalEvent && t.originalEvent.timeStamp,
  1488. n = o.DomEvent._lastClick && i - o.DomEvent._lastClick;
  1489. return n && n > 100 && n < 500 || t.target._simulatedClick && !t._simulated ? void o.DomEvent.stop(t) : (o.DomEvent._lastClick = i, void e(t))
  1490. }
  1491. }, o.DomEvent.addListener = o.DomEvent.on, o.DomEvent.removeListener = o.DomEvent.off, o.PosAnimation = o.Evented.extend({
  1492. run: function(t, e, i, n) {
  1493. this.stop(), this._el = t, this._inProgress = !0, this._duration = i || .25, this._easeOutPower = 1 / Math.max(n || .5, .2), this._startPos = o.DomUtil.getPosition(t), this._offset = e.subtract(this._startPos), this._startTime = +new Date, this.fire("start"), this._animate()
  1494. },
  1495. stop: function() {
  1496. this._inProgress && (this._step(!0), this._complete())
  1497. },
  1498. _animate: function() {
  1499. this._animId = o.Util.requestAnimFrame(this._animate, this), this._step()
  1500. },
  1501. _step: function(t) {
  1502. var e = +new Date - this._startTime,
  1503. i = 1e3 * this._duration;
  1504. e < i ? this._runFrame(this._easeOut(e / i), t) : (this._runFrame(1), this._complete())
  1505. },
  1506. _runFrame: function(t, e) {
  1507. var i = this._startPos.add(this._offset.multiplyBy(t));
  1508. e && i._round(), o.DomUtil.setPosition(this._el, i), this.fire("step")
  1509. },
  1510. _complete: function() {
  1511. o.Util.cancelAnimFrame(this._animId), this._inProgress = !1, this.fire("end")
  1512. },
  1513. _easeOut: function(t) {
  1514. return 1 - Math.pow(1 - t, this._easeOutPower)
  1515. }
  1516. }), o.Projection.Mercator = {
  1517. R: 6378137,
  1518. R_MINOR: 6356752.314245179,
  1519. bounds: o.bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),
  1520. project: function(t) {
  1521. var e = Math.PI / 180,
  1522. i = this.R,
  1523. n = t.lat * e,
  1524. s = this.R_MINOR / i,
  1525. r = Math.sqrt(1 - s * s),
  1526. a = r * Math.sin(n),
  1527. h = Math.tan(Math.PI / 4 - n / 2) / Math.pow((1 - a) / (1 + a), r / 2);
  1528. return n = -i * Math.log(Math.max(h, 1e-10)), new o.Point(t.lng * e * i, n)
  1529. },
  1530. unproject: function(t) {
  1531. for (var e, i = 180 / Math.PI, n = this.R, s = this.R_MINOR / n, r = Math.sqrt(1 - s * s), a = Math.exp(-t.y / n), h = Math.PI / 2 - 2 * Math.atan(a), l = 0, u = .1; l < 15 && Math.abs(u) > 1e-7; l++) e = r * Math.sin(h), e = Math.pow((1 - e) / (1 + e), r / 2), u = Math.PI / 2 - 2 * Math.atan(a * e) - h, h += u;
  1532. return new o.LatLng(h * i, t.x * i / n)
  1533. }
  1534. }, o.CRS.EPSG3395 = o.extend({}, o.CRS.Earth, {
  1535. code: "EPSG:3395",
  1536. projection: o.Projection.Mercator,
  1537. transformation: function() {
  1538. var t = .5 / (Math.PI * o.Projection.Mercator.R);
  1539. return new o.Transformation(t, .5, -t, .5)
  1540. }()
  1541. }), o.GridLayer = o.Layer.extend({
  1542. options: {
  1543. tileSize: 256,
  1544. opacity: 1,
  1545. updateWhenIdle: o.Browser.mobile,
  1546. updateWhenZooming: !0,
  1547. updateInterval: 200,
  1548. zIndex: 1,
  1549. bounds: null,
  1550. minZoom: 0,
  1551. maxZoom: i,
  1552. noWrap: !1,
  1553. pane: "tilePane",
  1554. className: "",
  1555. keepBuffer: 2
  1556. },
  1557. initialize: function(t) {
  1558. o.setOptions(this, t)
  1559. },
  1560. onAdd: function() {
  1561. this._initContainer(), this._levels = {}, this._tiles = {}, this._resetView(), this._update()
  1562. },
  1563. beforeAdd: function(t) {
  1564. t._addZoomLimit(this)
  1565. },
  1566. onRemove: function(t) {
  1567. this._removeAllTiles(), o.DomUtil.remove(this._container), t._removeZoomLimit(this), this._container = null, this._tileZoom = null
  1568. },
  1569. bringToFront: function() {
  1570. return this._map && (o.DomUtil.toFront(this._container), this._setAutoZIndex(Math.max)), this
  1571. },
  1572. bringToBack: function() {
  1573. return this._map && (o.DomUtil.toBack(this._container), this._setAutoZIndex(Math.min)), this
  1574. },
  1575. getContainer: function() {
  1576. return this._container
  1577. },
  1578. setOpacity: function(t) {
  1579. return this.options.opacity = t, this._updateOpacity(), this
  1580. },
  1581. setZIndex: function(t) {
  1582. return this.options.zIndex = t, this._updateZIndex(), this
  1583. },
  1584. isLoading: function() {
  1585. return this._loading
  1586. },
  1587. redraw: function() {
  1588. return this._map && (this._removeAllTiles(), this._update()), this
  1589. },
  1590. getEvents: function() {
  1591. var t = {
  1592. viewprereset: this._invalidateAll,
  1593. viewreset: this._resetView,
  1594. zoom: this._resetView,
  1595. moveend: this._onMoveEnd
  1596. };
  1597. return this.options.updateWhenIdle || (this._onMove || (this._onMove = o.Util.throttle(this._onMoveEnd, this.options.updateInterval, this)), t.move = this._onMove), this._zoomAnimated && (t.zoomanim = this._animateZoom), t
  1598. },
  1599. createTile: function() {
  1600. return e.createElement("div")
  1601. },
  1602. getTileSize: function() {
  1603. var t = this.options.tileSize;
  1604. return t instanceof o.Point ? t : new o.Point(t, t)
  1605. },
  1606. _updateZIndex: function() {
  1607. this._container && this.options.zIndex !== i && null !== this.options.zIndex && (this._container.style.zIndex = this.options.zIndex)
  1608. },
  1609. _setAutoZIndex: function(t) {
  1610. for (var e, i = this.getPane().children, n = -t(-(1 / 0), 1 / 0), o = 0, s = i.length; o < s; o++) e = i[o].style.zIndex, i[o] !== this._container && e && (n = t(n, +e));
  1611. isFinite(n) && (this.options.zIndex = n + t(-1, 1), this._updateZIndex())
  1612. },
  1613. _updateOpacity: function() {
  1614. if (this._map && !o.Browser.ielt9) {
  1615. o.DomUtil.setOpacity(this._container, this.options.opacity);
  1616. var t = +new Date,
  1617. e = !1,
  1618. i = !1;
  1619. for (var n in this._tiles) {
  1620. var s = this._tiles[n];
  1621. if (s.current && s.loaded) {
  1622. var r = Math.min(1, (t - s.loaded) / 200);
  1623. o.DomUtil.setOpacity(s.el, r), r < 1 ? e = !0 : (s.active && (i = !0), s.active = !0)
  1624. }
  1625. }
  1626. i && !this._noPrune && this._pruneTiles(), e && (o.Util.cancelAnimFrame(this._fadeFrame), this._fadeFrame = o.Util.requestAnimFrame(this._updateOpacity, this))
  1627. }
  1628. },
  1629. _initContainer: function() {
  1630. this._container || (this._container = o.DomUtil.create("div", "leaflet-layer " + (this.options.className || "")), this._updateZIndex(), this.options.opacity < 1 && this._updateOpacity(), this.getPane().appendChild(this._container))
  1631. },
  1632. _updateLevels: function() {
  1633. var t = this._tileZoom,
  1634. e = this.options.maxZoom;
  1635. if (t === i) return i;
  1636. for (var n in this._levels) this._levels[n].el.children.length || n === t ? this._levels[n].el.style.zIndex = e - Math.abs(t - n) : (o.DomUtil.remove(this._levels[n].el), this._removeTilesAtZoom(n), delete this._levels[n]);
  1637. var s = this._levels[t],
  1638. r = this._map;
  1639. return s || (s = this._levels[t] = {}, s.el = o.DomUtil.create("div", "leaflet-tile-container leaflet-zoom-animated", this._container), s.el.style.zIndex = e, s.origin = r.project(r.unproject(r.getPixelOrigin()), t).round(), s.zoom = t, this._setZoomTransform(s, r.getCenter(), r.getZoom()), o.Util.falseFn(s.el.offsetWidth)), this._level = s, s
  1640. },
  1641. _pruneTiles: function() {
  1642. if (this._map) {
  1643. var t, e, i = this._map.getZoom();
  1644. if (i > this.options.maxZoom || i < this.options.minZoom) return void this._removeAllTiles();
  1645. for (t in this._tiles) e = this._tiles[t], e.retain = e.current;
  1646. for (t in this._tiles) if (e = this._tiles[t], e.current && !e.active) {
  1647. var n = e.coords;
  1648. this._retainParent(n.x, n.y, n.z, n.z - 5) || this._retainChildren(n.x, n.y, n.z, n.z + 2)
  1649. }
  1650. for (t in this._tiles) this._tiles[t].retain || this._removeTile(t)
  1651. }
  1652. },
  1653. _removeTilesAtZoom: function(t) {
  1654. for (var e in this._tiles) this._tiles[e].coords.z === t && this._removeTile(e)
  1655. },
  1656. _removeAllTiles: function() {
  1657. for (var t in this._tiles) this._removeTile(t)
  1658. },
  1659. _invalidateAll: function() {
  1660. for (var t in this._levels) o.DomUtil.remove(this._levels[t].el), delete this._levels[t];
  1661. this._removeAllTiles(), this._tileZoom = null
  1662. },
  1663. _retainParent: function(t, e, i, n) {
  1664. var s = Math.floor(t / 2),
  1665. r = Math.floor(e / 2),
  1666. a = i - 1,
  1667. h = new o.Point(+s, +r);
  1668. h.z = +a;
  1669. var l = this._tileCoordsToKey(h),
  1670. u = this._tiles[l];
  1671. return u && u.active ? (u.retain = !0, !0) : (u && u.loaded && (u.retain = !0), a > n && this._retainParent(s, r, a, n))
  1672. },
  1673. _retainChildren: function(t, e, i, n) {
  1674. for (var s = 2 * t; s < 2 * t + 2; s++) for (var r = 2 * e; r < 2 * e + 2; r++) {
  1675. var a = new o.Point(s, r);
  1676. a.z = i + 1;
  1677. var h = this._tileCoordsToKey(a),
  1678. l = this._tiles[h];
  1679. l && l.active ? l.retain = !0 : (l && l.loaded && (l.retain = !0), i + 1 < n && this._retainChildren(s, r, i + 1, n))
  1680. }
  1681. },
  1682. _resetView: function(t) {
  1683. var e = t && (t.pinch || t.flyTo);
  1684. this._setView(this._map.getCenter(), this._map.getZoom(), e, e)
  1685. },
  1686. _animateZoom: function(t) {
  1687. this._setView(t.center, t.zoom, !0, t.noUpdate)
  1688. },
  1689. _setView: function(t, e, n, o) {
  1690. var s = Math.round(e);
  1691. (this.options.maxZoom !== i && s > this.options.maxZoom || this.options.minZoom !== i && s < this.options.minZoom) && (s = i);
  1692. var r = this.options.updateWhenZooming && s !== this._tileZoom;
  1693. o && !r || (this._tileZoom = s, this._abortLoading && this._abortLoading(), this._updateLevels(), this._resetGrid(), s !== i && this._update(t), n || this._pruneTiles(), this._noPrune = !! n), this._setZoomTransforms(t, e)
  1694. },
  1695. _setZoomTransforms: function(t, e) {
  1696. for (var i in this._levels) this._setZoomTransform(this._levels[i], t, e)
  1697. },
  1698. _setZoomTransform: function(t, e, i) {
  1699. var n = this._map.getZoomScale(i, t.zoom),
  1700. s = t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e, i)).round();
  1701. o.Browser.any3d ? o.DomUtil.setTransform(t.el, s, n) : o.DomUtil.setPosition(t.el, s)
  1702. },
  1703. _resetGrid: function() {
  1704. var t = this._map,
  1705. e = t.options.crs,
  1706. i = this._tileSize = this.getTileSize(),
  1707. n = this._tileZoom,
  1708. o = this._map.getPixelWorldBounds(this._tileZoom);
  1709. o && (this._globalTileRange = this._pxBoundsToTileRange(o)), this._wrapX = e.wrapLng && !this.options.noWrap && [Math.floor(t.project([0, e.wrapLng[0]], n).x / i.x), Math.ceil(t.project([0, e.wrapLng[1]], n).x / i.y)], this._wrapY = e.wrapLat && !this.options.noWrap && [Math.floor(t.project([e.wrapLat[0], 0], n).y / i.x), Math.ceil(t.project([e.wrapLat[1], 0], n).y / i.y)]
  1710. },
  1711. _onMoveEnd: function() {
  1712. this._map && !this._map._animatingZoom && this._update()
  1713. },
  1714. _getTiledPixelBounds: function(t) {
  1715. var e = this._map,
  1716. i = e._animatingZoom ? Math.max(e._animateToZoom, e.getZoom()) : e.getZoom(),
  1717. n = e.getZoomScale(i, this._tileZoom),
  1718. s = e.project(t, this._tileZoom).floor(),
  1719. r = e.getSize().divideBy(2 * n);
  1720. return new o.Bounds(s.subtract(r), s.add(r))
  1721. },
  1722. _update: function(t) {
  1723. var n = this._map;
  1724. if (n) {
  1725. var s = n.getZoom();
  1726. if (t === i && (t = n.getCenter()), this._tileZoom !== i) {
  1727. var r = this._getTiledPixelBounds(t),
  1728. a = this._pxBoundsToTileRange(r),
  1729. h = a.getCenter(),
  1730. l = [],
  1731. u = this.options.keepBuffer,
  1732. c = new o.Bounds(a.getBottomLeft().subtract([u, -u]), a.getTopRight().add([u, -u]));
  1733. for (var d in this._tiles) {
  1734. var _ = this._tiles[d].coords;
  1735. _.z === this._tileZoom && c.contains(o.point(_.x, _.y)) || (this._tiles[d].current = !1)
  1736. }
  1737. if (Math.abs(s - this._tileZoom) > 1) return void this._setView(t, s);
  1738. for (var m = a.min.y; m <= a.max.y; m++) for (var p = a.min.x; p <= a.max.x; p++) {
  1739. var f = new o.Point(p, m);
  1740. if (f.z = this._tileZoom, this._isValidTile(f)) {
  1741. var g = this._tiles[this._tileCoordsToKey(f)];
  1742. g ? g.current = !0 : l.push(f)
  1743. }
  1744. }
  1745. if (l.sort(function(t, e) {
  1746. return t.distanceTo(h) - e.distanceTo(h)
  1747. }), 0 !== l.length) {
  1748. this._loading || (this._loading = !0, this.fire("loading"));
  1749. var v = e.createDocumentFragment();
  1750. for (p = 0; p < l.length; p++) this._addTile(l[p], v);
  1751. this._level.el.appendChild(v)
  1752. }
  1753. }
  1754. }
  1755. },
  1756. _isValidTile: function(t) {
  1757. var e = this._map.options.crs;
  1758. if (!e.infinite) {
  1759. var i = this._globalTileRange;
  1760. if (!e.wrapLng && (t.x < i.min.x || t.x > i.max.x) || !e.wrapLat && (t.y < i.min.y || t.y > i.max.y)) return !1
  1761. }
  1762. if (!this.options.bounds) return !0;
  1763. var n = this._tileCoordsToBounds(t);
  1764. return o.latLngBounds(this.options.bounds).overlaps(n)
  1765. },
  1766. _keyToBounds: function(t) {
  1767. return this._tileCoordsToBounds(this._keyToTileCoords(t))
  1768. },
  1769. _tileCoordsToBounds: function(t) {
  1770. var e = this._map,
  1771. i = this.getTileSize(),
  1772. n = t.scaleBy(i),
  1773. s = n.add(i),
  1774. r = e.unproject(n, t.z),
  1775. a = e.unproject(s, t.z);
  1776. return this.options.noWrap || (r = e.wrapLatLng(r), a = e.wrapLatLng(a)), new o.LatLngBounds(r, a)
  1777. },
  1778. _tileCoordsToKey: function(t) {
  1779. return t.x + ":" + t.y + ":" + t.z
  1780. },
  1781. _keyToTileCoords: function(t) {
  1782. var e = t.split(":"),
  1783. i = new o.Point(+e[0], +e[1]);
  1784. return i.z = +e[2], i
  1785. },
  1786. _removeTile: function(t) {
  1787. var e = this._tiles[t];
  1788. e && (o.DomUtil.remove(e.el), delete this._tiles[t], this.fire("tileunload", {
  1789. tile: e.el,
  1790. coords: this._keyToTileCoords(t)
  1791. }))
  1792. },
  1793. _initTile: function(t) {
  1794. o.DomUtil.addClass(t, "leaflet-tile");
  1795. var e = this.getTileSize();
  1796. t.style.width = e.x + "px", t.style.height = e.y + "px", t.onselectstart = o.Util.falseFn, t.onmousemove = o.Util.falseFn, o.Browser.ielt9 && this.options.opacity < 1 && o.DomUtil.setOpacity(t, this.options.opacity), o.Browser.android && !o.Browser.android23 && (t.style.WebkitBackfaceVisibility = "hidden")
  1797. },
  1798. _addTile: function(t, e) {
  1799. var i = this._getTilePos(t),
  1800. n = this._tileCoordsToKey(t),
  1801. s = this.createTile(this._wrapCoords(t), o.bind(this._tileReady, this, t));
  1802. this._initTile(s), this.createTile.length < 2 && o.Util.requestAnimFrame(o.bind(this._tileReady, this, t, null, s)), o.DomUtil.setPosition(s, i), this._tiles[n] = {
  1803. el: s,
  1804. coords: t,
  1805. current: !0
  1806. }, e.appendChild(s), this.fire("tileloadstart", {
  1807. tile: s,
  1808. coords: t
  1809. })
  1810. },
  1811. _tileReady: function(t, e, i) {
  1812. if (this._map) {
  1813. e && this.fire("tileerror", {
  1814. error: e,
  1815. tile: i,
  1816. coords: t
  1817. });
  1818. var n = this._tileCoordsToKey(t);
  1819. i = this._tiles[n], i && (i.loaded = +new Date, this._map._fadeAnimated ? (o.DomUtil.setOpacity(i.el, 0), o.Util.cancelAnimFrame(this._fadeFrame), this._fadeFrame = o.Util.requestAnimFrame(this._updateOpacity, this)) : (i.active = !0, this._pruneTiles()), e || (o.DomUtil.addClass(i.el, "leaflet-tile-loaded"), this.fire("tileload", {
  1820. tile: i.el,
  1821. coords: t
  1822. })), this._noTilesToLoad() && (this._loading = !1, this.fire("load"), o.Browser.ielt9 || !this._map._fadeAnimated ? o.Util.requestAnimFrame(this._pruneTiles, this) : setTimeout(o.bind(this._pruneTiles, this), 250)))
  1823. }
  1824. },
  1825. _getTilePos: function(t) {
  1826. return t.scaleBy(this.getTileSize()).subtract(this._level.origin)
  1827. },
  1828. _wrapCoords: function(t) {
  1829. var e = new o.Point(this._wrapX ? o.Util.wrapNum(t.x, this._wrapX) : t.x, this._wrapY ? o.Util.wrapNum(t.y, this._wrapY) : t.y);
  1830. return e.z = t.z, e
  1831. },
  1832. _pxBoundsToTileRange: function(t) {
  1833. var e = this.getTileSize();
  1834. return new o.Bounds(t.min.unscaleBy(e).floor(), t.max.unscaleBy(e).ceil().subtract([1, 1]))
  1835. },
  1836. _noTilesToLoad: function() {
  1837. for (var t in this._tiles) if (!this._tiles[t].loaded) return !1;
  1838. return !0
  1839. }
  1840. }), o.gridLayer = function(t) {
  1841. return new o.GridLayer(t)
  1842. }, o.TileLayer = o.GridLayer.extend({
  1843. options: {
  1844. minZoom: 0,
  1845. maxZoom: 18,
  1846. maxNativeZoom: null,
  1847. minNativeZoom: null,
  1848. subdomains: "abc",
  1849. errorTileUrl: "",
  1850. zoomOffset: 0,
  1851. tms: !1,
  1852. zoomReverse: !1,
  1853. detectRetina: !1,
  1854. crossOrigin: !1
  1855. },
  1856. initialize: function(t, e) {
  1857. this._url = t, e = o.setOptions(this, e), e.detectRetina && o.Browser.retina && e.maxZoom > 0 && (e.tileSize = Math.floor(e.tileSize / 2), e.zoomReverse ? (e.zoomOffset--, e.minZoom++) : (e.zoomOffset++, e.maxZoom--), e.minZoom = Math.max(0, e.minZoom)), "string" == typeof e.subdomains && (e.subdomains = e.subdomains.split("")), o.Browser.android || this.on("tileunload", this._onTileRemove)
  1858. },
  1859. setUrl: function(t, e) {
  1860. return this._url = t, e || this.redraw(), this
  1861. },
  1862. createTile: function(t, i) {
  1863. var n = e.createElement("img");
  1864. return o.DomEvent.on(n, "load", o.bind(this._tileOnLoad, this, i, n)), o.DomEvent.on(n, "error", o.bind(this._tileOnError, this, i, n)), this.options.crossOrigin && (n.crossOrigin = ""), n.alt = "", n.setAttribute("role", "presentation"), n.src = this.getTileUrl(t), n
  1865. },
  1866. getTileUrl: function(t) {
  1867. var e = {
  1868. r: o.Browser.retina ? "@2x" : "",
  1869. s: this._getSubdomain(t),
  1870. x: t.x,
  1871. y: t.y,
  1872. z: this._getZoomForUrl()
  1873. };
  1874. if (this._map && !this._map.options.crs.infinite) {
  1875. var i = this._globalTileRange.max.y - t.y;
  1876. this.options.tms && (e.y = i), e["-y"] = i
  1877. }
  1878. return o.Util.template(this._url, o.extend(e, this.options))
  1879. },
  1880. _tileOnLoad: function(t, e) {
  1881. o.Browser.ielt9 ? setTimeout(o.bind(t, this, null, e), 0) : t(null, e)
  1882. },
  1883. _tileOnError: function(t, e, i) {
  1884. var n = this.options.errorTileUrl;
  1885. n && (e.src = n), t(i, e)
  1886. },
  1887. getTileSize: function() {
  1888. var t = this._map,
  1889. e = o.GridLayer.prototype.getTileSize.call(this),
  1890. i = this._tileZoom + this.options.zoomOffset,
  1891. n = this.options.minNativeZoom,
  1892. s = this.options.maxNativeZoom;
  1893. return null !== n && i < n ? e.divideBy(t.getZoomScale(n, i)).round() : null !== s && i > s ? e.divideBy(t.getZoomScale(s, i)).round() : e
  1894. },
  1895. _onTileRemove: function(t) {
  1896. t.tile.onload = null
  1897. },
  1898. _getZoomForUrl: function() {
  1899. var t = this._tileZoom,
  1900. e = this.options.maxZoom,
  1901. i = this.options.zoomReverse,
  1902. n = this.options.zoomOffset,
  1903. o = this.options.minNativeZoom,
  1904. s = this.options.maxNativeZoom;
  1905. return i && (t = e - t), t += n, null !== o && t < o ? o : null !== s && t > s ? s : t
  1906. },
  1907. _getSubdomain: function(t) {
  1908. var e = Math.abs(t.x + t.y) % this.options.subdomains.length;
  1909. return this.options.subdomains[e]
  1910. },
  1911. _abortLoading: function() {
  1912. var t, e;
  1913. for (t in this._tiles) this._tiles[t].coords.z !== this._tileZoom && (e = this._tiles[t].el, e.onload = o.Util.falseFn, e.onerror = o.Util.falseFn, e.complete || (e.src = o.Util.emptyImageUrl, o.DomUtil.remove(e)))
  1914. }
  1915. }), o.tileLayer = function(t, e) {
  1916. return new o.TileLayer(t, e)
  1917. }, o.TileLayer.WMS = o.TileLayer.extend({
  1918. defaultWmsParams: {
  1919. service: "WMS",
  1920. request: "GetMap",
  1921. layers: "",
  1922. styles: "",
  1923. format: "image/jpeg",
  1924. transparent: !1,
  1925. version: "1.1.1"
  1926. },
  1927. options: {
  1928. crs: null,
  1929. uppercase: !1
  1930. },
  1931. initialize: function(t, e) {
  1932. this._url = t;
  1933. var i = o.extend({}, this.defaultWmsParams);
  1934. for (var n in e) n in this.options || (i[n] = e[n]);
  1935. e = o.setOptions(this, e), i.width = i.height = e.tileSize * (e.detectRetina && o.Browser.retina ? 2 : 1), this.wmsParams = i
  1936. },
  1937. onAdd: function(t) {
  1938. this._crs = this.options.crs || t.options.crs, this._wmsVersion = parseFloat(this.wmsParams.version);
  1939. var e = this._wmsVersion >= 1.3 ? "crs" : "srs";
  1940. this.wmsParams[e] = this._crs.code, o.TileLayer.prototype.onAdd.call(this, t)
  1941. },
  1942. getTileUrl: function(t) {
  1943. var e = this._tileCoordsToBounds(t),
  1944. i = this._crs.project(e.getNorthWest()),
  1945. n = this._crs.project(e.getSouthEast()),
  1946. s = (this._wmsVersion >= 1.3 && this._crs === o.CRS.EPSG4326 ? [n.y, i.x, i.y, n.x] : [i.x, n.y, n.x, i.y]).join(","),
  1947. r = o.TileLayer.prototype.getTileUrl.call(this, t);
  1948. return r + o.Util.getParamString(this.wmsParams, r, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + s
  1949. },
  1950. setParams: function(t, e) {
  1951. return o.extend(this.wmsParams, t), e || this.redraw(), this
  1952. }
  1953. }), o.tileLayer.wms = function(t, e) {
  1954. return new o.TileLayer.WMS(t, e)
  1955. }, o.ImageOverlay = o.Layer.extend({
  1956. options: {
  1957. opacity: 1,
  1958. alt: "",
  1959. interactive: !1,
  1960. crossOrigin: !1
  1961. },
  1962. initialize: function(t, e, i) {
  1963. this._url = t, this._bounds = o.latLngBounds(e), o.setOptions(this, i)
  1964. },
  1965. onAdd: function() {
  1966. this._image || (this._initImage(), this.options.opacity < 1 && this._updateOpacity()), this.options.interactive && (o.DomUtil.addClass(this._image, "leaflet-interactive"), this.addInteractiveTarget(this._image)), this.getPane().appendChild(this._image), this._reset()
  1967. },
  1968. onRemove: function() {
  1969. o.DomUtil.remove(this._image), this.options.interactive && this.removeInteractiveTarget(this._image)
  1970. },
  1971. setOpacity: function(t) {
  1972. return this.options.opacity = t, this._image && this._updateOpacity(), this
  1973. },
  1974. setStyle: function(t) {
  1975. return t.opacity && this.setOpacity(t.opacity), this
  1976. },
  1977. bringToFront: function() {
  1978. return this._map && o.DomUtil.toFront(this._image), this
  1979. },
  1980. bringToBack: function() {
  1981. return this._map && o.DomUtil.toBack(this._image), this
  1982. },
  1983. setUrl: function(t) {
  1984. return this._url = t, this._image && (this._image.src = t), this
  1985. },
  1986. setBounds: function(t) {
  1987. return this._bounds = t, this._map && this._reset(), this
  1988. },
  1989. getEvents: function() {
  1990. var t = {
  1991. zoom: this._reset,
  1992. viewreset: this._reset
  1993. };
  1994. return this._zoomAnimated && (t.zoomanim = this._animateZoom), t
  1995. },
  1996. getBounds: function() {
  1997. return this._bounds
  1998. },
  1999. getElement: function() {
  2000. return this._image
  2001. },
  2002. _initImage: function() {
  2003. var t = this._image = o.DomUtil.create("img", "leaflet-image-layer " + (this._zoomAnimated ? "leaflet-zoom-animated" : ""));
  2004. t.onselectstart = o.Util.falseFn, t.onmousemove = o.Util.falseFn, t.onload = o.bind(this.fire, this, "load"), this.options.crossOrigin && (t.crossOrigin = ""), t.src = this._url, t.alt = this.options.alt
  2005. },
  2006. _animateZoom: function(t) {
  2007. var e = this._map.getZoomScale(t.zoom),
  2008. i = this._map._latLngBoundsToNewLayerBounds(this._bounds, t.zoom, t.center).min;
  2009. o.DomUtil.setTransform(this._image, i, e)
  2010. },
  2011. _reset: function() {
  2012. var t = this._image,
  2013. e = new o.Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()), this._map.latLngToLayerPoint(this._bounds.getSouthEast())),
  2014. i = e.getSize();
  2015. o.DomUtil.setPosition(t, e.min), t.style.width = i.x + "px", t.style.height = i.y + "px"
  2016. },
  2017. _updateOpacity: function() {
  2018. o.DomUtil.setOpacity(this._image, this.options.opacity)
  2019. }
  2020. }), o.imageOverlay = function(t, e, i) {
  2021. return new o.ImageOverlay(t, e, i)
  2022. }, o.Icon = o.Class.extend({
  2023. initialize: function(t) {
  2024. o.setOptions(this, t)
  2025. },
  2026. createIcon: function(t) {
  2027. return this._createIcon("icon", t)
  2028. },
  2029. createShadow: function(t) {
  2030. return this._createIcon("shadow", t)
  2031. },
  2032. _createIcon: function(t, e) {
  2033. var i = this._getIconUrl(t);
  2034. if (!i) {
  2035. if ("icon" === t) throw new Error("iconUrl not set in Icon options (see the docs).");
  2036. return null
  2037. }
  2038. var n = this._createImg(i, e && "IMG" === e.tagName ? e : null);
  2039. return this._setIconStyles(n, t), n
  2040. },
  2041. _setIconStyles: function(t, e) {
  2042. var i = this.options,
  2043. n = i[e + "Size"];
  2044. "number" == typeof n && (n = [n, n]);
  2045. var s = o.point(n),
  2046. r = o.point("shadow" === e && i.shadowAnchor || i.iconAnchor || s && s.divideBy(2, !0));
  2047. t.className = "leaflet-marker-" + e + " " + (i.className || ""), r && (t.style.marginLeft = -r.x + "px", t.style.marginTop = -r.y + "px"), s && (t.style.width = s.x + "px", t.style.height = s.y + "px")
  2048. },
  2049. _createImg: function(t, i) {
  2050. return i = i || e.createElement("img"), i.src = t, i
  2051. },
  2052. _getIconUrl: function(t) {
  2053. return o.Browser.retina && this.options[t + "RetinaUrl"] || this.options[t + "Url"]
  2054. }
  2055. }), o.icon = function(t) {
  2056. return new o.Icon(t)
  2057. }, o.Icon.Default = o.Icon.extend({
  2058. options: {
  2059. iconUrl: "marker-icon.png",
  2060. iconRetinaUrl: "marker-icon-2x.png",
  2061. shadowUrl: "marker-shadow.png",
  2062. iconSize: [25, 41],
  2063. iconAnchor: [12, 41],
  2064. popupAnchor: [1, -34],
  2065. tooltipAnchor: [16, -28],
  2066. shadowSize: [41, 41]
  2067. },
  2068. _getIconUrl: function(t) {
  2069. return o.Icon.Default.imagePath || (o.Icon.Default.imagePath = this._detectIconPath()), (this.options.imagePath || o.Icon.Default.imagePath) + o.Icon.prototype._getIconUrl.call(this, t)
  2070. },
  2071. _detectIconPath: function() {
  2072. var t = o.DomUtil.create("div", "leaflet-default-icon-path", e.body),
  2073. i = o.DomUtil.getStyle(t, "background-image") || o.DomUtil.getStyle(t, "backgroundImage");
  2074. return e.body.removeChild(t), 0 === i.indexOf("url") ? i.replace(/^url\([\"\']?/, "").replace(/marker-icon\.png[\"\']?\)$/, "") : ""
  2075. }
  2076. }), o.Marker = o.Layer.extend({
  2077. options: {
  2078. icon: new o.Icon.Default,
  2079. interactive: !0,
  2080. draggable: !1,
  2081. keyboard: !0,
  2082. title: "",
  2083. alt: "",
  2084. zIndexOffset: 0,
  2085. opacity: 1,
  2086. riseOnHover: !1,
  2087. riseOffset: 250,
  2088. pane: "markerPane",
  2089. nonBubblingEvents: ["click", "dblclick", "mouseover", "mouseout", "contextmenu"]
  2090. },
  2091. initialize: function(t, e) {
  2092. o.setOptions(this, e), this._latlng = o.latLng(t)
  2093. },
  2094. onAdd: function(t) {
  2095. this._zoomAnimated = this._zoomAnimated && t.options.markerZoomAnimation, this._zoomAnimated && t.on("zoomanim", this._animateZoom, this), this._initIcon(), this.update()
  2096. },
  2097. onRemove: function(t) {
  2098. this.dragging && this.dragging.enabled() && (this.options.draggable = !0, this.dragging.removeHooks()), this._zoomAnimated && t.off("zoomanim", this._animateZoom, this), this._removeIcon(), this._removeShadow()
  2099. },
  2100. getEvents: function() {
  2101. return {
  2102. zoom: this.update,
  2103. viewreset: this.update
  2104. }
  2105. },
  2106. getLatLng: function() {
  2107. return this._latlng
  2108. },
  2109. setLatLng: function(t) {
  2110. var e = this._latlng;
  2111. return this._latlng = o.latLng(t), this.update(), this.fire("move", {
  2112. oldLatLng: e,
  2113. latlng: this._latlng
  2114. })
  2115. },
  2116. setZIndexOffset: function(t) {
  2117. return this.options.zIndexOffset = t, this.update()
  2118. },
  2119. setIcon: function(t) {
  2120. return this.options.icon = t, this._map && (this._initIcon(), this.update()), this._popup && this.bindPopup(this._popup, this._popup.options), this
  2121. },
  2122. getElement: function() {
  2123. return this._icon
  2124. },
  2125. update: function() {
  2126. if (this._icon) {
  2127. var t = this._map.latLngToLayerPoint(this._latlng).round();
  2128. this._setPos(t)
  2129. }
  2130. return this
  2131. },
  2132. _initIcon: function() {
  2133. var t = this.options,
  2134. e = "leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide"),
  2135. i = t.icon.createIcon(this._icon),
  2136. n = !1;
  2137. i !== this._icon && (this._icon && this._removeIcon(), n = !0, t.title && (i.title = t.title), t.alt && (i.alt = t.alt)), o.DomUtil.addClass(i, e), t.keyboard && (i.tabIndex = "0"), this._icon = i, t.riseOnHover && this.on({
  2138. mouseover: this._bringToFront,
  2139. mouseout: this._resetZIndex
  2140. });
  2141. var s = t.icon.createShadow(this._shadow),
  2142. r = !1;
  2143. s !== this._shadow && (this._removeShadow(), r = !0), s && o.DomUtil.addClass(s, e), this._shadow = s, t.opacity < 1 && this._updateOpacity(), n && this.getPane().appendChild(this._icon), this._initInteraction(), s && r && this.getPane("shadowPane").appendChild(this._shadow)
  2144. },
  2145. _removeIcon: function() {
  2146. this.options.riseOnHover && this.off({
  2147. mouseover: this._bringToFront,
  2148. mouseout: this._resetZIndex
  2149. }), o.DomUtil.remove(this._icon), this.removeInteractiveTarget(this._icon), this._icon = null
  2150. },
  2151. _removeShadow: function() {
  2152. this._shadow && o.DomUtil.remove(this._shadow), this._shadow = null
  2153. },
  2154. _setPos: function(t) {
  2155. o.DomUtil.setPosition(this._icon, t), this._shadow && o.DomUtil.setPosition(this._shadow, t), this._zIndex = t.y + this.options.zIndexOffset, this._resetZIndex()
  2156. },
  2157. _updateZIndex: function(t) {
  2158. this._icon.style.zIndex = this._zIndex + t
  2159. },
  2160. _animateZoom: function(t) {
  2161. var e = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center).round();
  2162. this._setPos(e)
  2163. },
  2164. _initInteraction: function() {
  2165. if (this.options.interactive && (o.DomUtil.addClass(this._icon, "leaflet-interactive"), this.addInteractiveTarget(this._icon), o.Handler.MarkerDrag)) {
  2166. var t = this.options.draggable;
  2167. this.dragging && (t = this.dragging.enabled(), this.dragging.disable()), this.dragging = new o.Handler.MarkerDrag(this), t && this.dragging.enable()
  2168. }
  2169. },
  2170. setOpacity: function(t) {
  2171. return this.options.opacity = t, this._map && this._updateOpacity(), this
  2172. },
  2173. _updateOpacity: function() {
  2174. var t = this.options.opacity;
  2175. o.DomUtil.setOpacity(this._icon, t), this._shadow && o.DomUtil.setOpacity(this._shadow, t)
  2176. },
  2177. _bringToFront: function() {
  2178. this._updateZIndex(this.options.riseOffset)
  2179. },
  2180. _resetZIndex: function() {
  2181. this._updateZIndex(0)
  2182. },
  2183. _getPopupAnchor: function() {
  2184. return this.options.icon.options.popupAnchor || [0, 0]
  2185. },
  2186. _getTooltipAnchor: function() {
  2187. return this.options.icon.options.tooltipAnchor || [0, 0]
  2188. }
  2189. }), o.marker = function(t, e) {
  2190. return new o.Marker(t, e)
  2191. }, o.DivIcon = o.Icon.extend({
  2192. options: {
  2193. iconSize: [12, 12],
  2194. html: !1,
  2195. bgPos: null,
  2196. className: "leaflet-div-icon"
  2197. },
  2198. createIcon: function(t) {
  2199. var i = t && "DIV" === t.tagName ? t : e.createElement("div"),
  2200. n = this.options;
  2201. if (i.innerHTML = n.html !== !1 ? n.html : "", n.bgPos) {
  2202. var s = o.point(n.bgPos);
  2203. i.style.backgroundPosition = -s.x + "px " + -s.y + "px"
  2204. }
  2205. return this._setIconStyles(i, "icon"), i
  2206. },
  2207. createShadow: function() {
  2208. return null
  2209. }
  2210. }), o.divIcon = function(t) {
  2211. return new o.DivIcon(t)
  2212. }, o.DivOverlay = o.Layer.extend({
  2213. options: {
  2214. offset: [0, 7],
  2215. className: "",
  2216. pane: "popupPane"
  2217. },
  2218. initialize: function(t, e) {
  2219. o.setOptions(this, t), this._source = e
  2220. },
  2221. onAdd: function(t) {
  2222. this._zoomAnimated = t._zoomAnimated, this._container || this._initLayout(), t._fadeAnimated && o.DomUtil.setOpacity(this._container, 0), clearTimeout(this._removeTimeout), this.getPane().appendChild(this._container), this.update(), t._fadeAnimated && o.DomUtil.setOpacity(this._container, 1), this.bringToFront()
  2223. },
  2224. onRemove: function(t) {
  2225. t._fadeAnimated ? (o.DomUtil.setOpacity(this._container, 0), this._removeTimeout = setTimeout(o.bind(o.DomUtil.remove, o.DomUtil, this._container), 200)) : o.DomUtil.remove(this._container)
  2226. },
  2227. getLatLng: function() {
  2228. return this._latlng
  2229. },
  2230. setLatLng: function(t) {
  2231. return this._latlng = o.latLng(t), this._map && (this._updatePosition(), this._adjustPan()), this
  2232. },
  2233. getContent: function() {
  2234. return this._content
  2235. },
  2236. setContent: function(t) {
  2237. return this._content = t, this.update(), this
  2238. },
  2239. getElement: function() {
  2240. return this._container
  2241. },
  2242. update: function() {
  2243. this._map && (this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan())
  2244. },
  2245. getEvents: function() {
  2246. var t = {
  2247. zoom: this._updatePosition,
  2248. viewreset: this._updatePosition
  2249. };
  2250. return this._zoomAnimated && (t.zoomanim = this._animateZoom), t
  2251. },
  2252. isOpen: function() {
  2253. return !!this._map && this._map.hasLayer(this)
  2254. },
  2255. bringToFront: function() {
  2256. return this._map && o.DomUtil.toFront(this._container), this
  2257. },
  2258. bringToBack: function() {
  2259. return this._map && o.DomUtil.toBack(this._container), this
  2260. },
  2261. _updateContent: function() {
  2262. if (this._content) {
  2263. var t = this._contentNode,
  2264. e = "function" == typeof this._content ? this._content(this._source || this) : this._content;
  2265. if ("string" == typeof e) t.innerHTML = e;
  2266. else {
  2267. for (; t.hasChildNodes();) t.removeChild(t.firstChild);
  2268. t.appendChild(e)
  2269. }
  2270. this.fire("contentupdate")
  2271. }
  2272. },
  2273. _updatePosition: function() {
  2274. if (this._map) {
  2275. var t = this._map.latLngToLayerPoint(this._latlng),
  2276. e = o.point(this.options.offset),
  2277. i = this._getAnchor();
  2278. this._zoomAnimated ? o.DomUtil.setPosition(this._container, t.add(i)) : e = e.add(t).add(i);
  2279. var n = this._containerBottom = -e.y,
  2280. s = this._containerLeft = -Math.round(this._containerWidth / 2) + e.x;
  2281. this._container.style.bottom = n + "px", this._container.style.left = s + "px"
  2282. }
  2283. },
  2284. _getAnchor: function() {
  2285. return [0, 0]
  2286. }
  2287. }), o.Popup = o.DivOverlay.extend({
  2288. options: {
  2289. maxWidth: 300,
  2290. minWidth: 50,
  2291. maxHeight: null,
  2292. autoPan: !0,
  2293. autoPanPaddingTopLeft: null,
  2294. autoPanPaddingBottomRight: null,
  2295. autoPanPadding: [5, 5],
  2296. keepInView: !1,
  2297. closeButton: !0,
  2298. autoClose: !0,
  2299. className: ""
  2300. },
  2301. openOn: function(t) {
  2302. return t.openPopup(this), this
  2303. },
  2304. onAdd: function(t) {
  2305. o.DivOverlay.prototype.onAdd.call(this, t), t.fire("popupopen", {
  2306. popup: this
  2307. }), this._source && (this._source.fire("popupopen", {
  2308. popup: this
  2309. }, !0), this._source instanceof o.Path || this._source.on("preclick", o.DomEvent.stopPropagation))
  2310. },
  2311. onRemove: function(t) {
  2312. o.DivOverlay.prototype.onRemove.call(this, t), t.fire("popupclose", {
  2313. popup: this
  2314. }), this._source && (this._source.fire("popupclose", {
  2315. popup: this
  2316. }, !0), this._source instanceof o.Path || this._source.off("preclick", o.DomEvent.stopPropagation))
  2317. },
  2318. getEvents: function() {
  2319. var t = o.DivOverlay.prototype.getEvents.call(this);
  2320. return ("closeOnClick" in this.options ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (t.preclick = this._close), this.options.keepInView && (t.moveend = this._adjustPan), t
  2321. },
  2322. _close: function() {
  2323. this._map && this._map.closePopup(this)
  2324. },
  2325. _initLayout: function() {
  2326. var t = "leaflet-popup",
  2327. e = this._container = o.DomUtil.create("div", t + " " + (this.options.className || "") + " leaflet-zoom-animated");
  2328. if (this.options.closeButton) {
  2329. var i = this._closeButton = o.DomUtil.create("a", t + "-close-button", e);
  2330. i.href = "#close", i.innerHTML = "&#215;", o.DomEvent.on(i, "click", this._onCloseButtonClick, this)
  2331. }
  2332. var n = this._wrapper = o.DomUtil.create("div", t + "-content-wrapper", e);
  2333. this._contentNode = o.DomUtil.create("div", t + "-content", n), o.DomEvent.disableClickPropagation(n).disableScrollPropagation(this._contentNode).on(n, "contextmenu", o.DomEvent.stopPropagation), this._tipContainer = o.DomUtil.create("div", t + "-tip-container", e), this._tip = o.DomUtil.create("div", t + "-tip", this._tipContainer)
  2334. },
  2335. _updateLayout: function() {
  2336. var t = this._contentNode,
  2337. e = t.style;
  2338. e.width = "", e.whiteSpace = "nowrap";
  2339. var i = t.offsetWidth;
  2340. i = Math.min(i, this.options.maxWidth), i = Math.max(i, this.options.minWidth), e.width = i + 1 + "px", e.whiteSpace = "", e.height = "";
  2341. var n = t.offsetHeight,
  2342. s = this.options.maxHeight,
  2343. r = "leaflet-popup-scrolled";
  2344. s && n > s ? (e.height = s + "px", o.DomUtil.addClass(t, r)) : o.DomUtil.removeClass(t, r), this._containerWidth = this._container.offsetWidth
  2345. },
  2346. _animateZoom: function(t) {
  2347. var e = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center),
  2348. i = this._getAnchor();
  2349. o.DomUtil.setPosition(this._container, e.add(i))
  2350. },
  2351. _adjustPan: function() {
  2352. if (!(!this.options.autoPan || this._map._panAnim && this._map._panAnim._inProgress)) {
  2353. var t = this._map,
  2354. e = parseInt(o.DomUtil.getStyle(this._container, "marginBottom"), 10) || 0,
  2355. i = this._container.offsetHeight + e,
  2356. n = this._containerWidth,
  2357. s = new o.Point(this._containerLeft, -i - this._containerBottom);
  2358. s._add(o.DomUtil.getPosition(this._container));
  2359. var r = t.layerPointToContainerPoint(s),
  2360. a = o.point(this.options.autoPanPadding),
  2361. h = o.point(this.options.autoPanPaddingTopLeft || a),
  2362. l = o.point(this.options.autoPanPaddingBottomRight || a),
  2363. u = t.getSize(),
  2364. c = 0,
  2365. d = 0;
  2366. r.x + n + l.x > u.x && (c = r.x + n - u.x + l.x), r.x - c - h.x < 0 && (c = r.x - h.x), r.y + i + l.y > u.y && (d = r.y + i - u.y + l.y), r.y - d - h.y < 0 && (d = r.y - h.y), (c || d) && t.fire("autopanstart").panBy([c, d])
  2367. }
  2368. },
  2369. _onCloseButtonClick: function(t) {
  2370. this._close(), o.DomEvent.stop(t)
  2371. },
  2372. _getAnchor: function() {
  2373. return o.point(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0])
  2374. }
  2375. }), o.popup = function(t, e) {
  2376. return new o.Popup(t, e)
  2377. }, o.Map.mergeOptions({
  2378. closePopupOnClick: !0
  2379. }), o.Map.include({
  2380. openPopup: function(t, e, i) {
  2381. return t instanceof o.Popup || (t = new o.Popup(i).setContent(t)), e && t.setLatLng(e), this.hasLayer(t) ? this : (this._popup && this._popup.options.autoClose && this.closePopup(), this._popup = t, this.addLayer(t))
  2382. },
  2383. closePopup: function(t) {
  2384. return t && t !== this._popup || (t = this._popup, this._popup = null), t && this.removeLayer(t), this
  2385. }
  2386. }), o.Layer.include({
  2387. bindPopup: function(t, e) {
  2388. return t instanceof o.Popup ? (o.setOptions(t, e), this._popup = t, t._source = this) : (this._popup && !e || (this._popup = new o.Popup(e, this)), this._popup.setContent(t)), this._popupHandlersAdded || (this.on({
  2389. click: this._openPopup,
  2390. remove: this.closePopup,
  2391. move: this._movePopup
  2392. }), this._popupHandlersAdded = !0), this
  2393. },
  2394. unbindPopup: function() {
  2395. return this._popup && (this.off({
  2396. click: this._openPopup,
  2397. remove: this.closePopup,
  2398. move: this._movePopup
  2399. }), this._popupHandlersAdded = !1, this._popup = null), this
  2400. },
  2401. openPopup: function(t, e) {
  2402. if (t instanceof o.Layer || (e = t, t = this), t instanceof o.FeatureGroup) for (var i in this._layers) {
  2403. t = this._layers[i];
  2404. break
  2405. }
  2406. return e || (e = t.getCenter ? t.getCenter() : t.getLatLng()), this._popup && this._map && (this._popup._source = t, this._popup.update(), this._map.openPopup(this._popup, e)), this
  2407. },
  2408. closePopup: function() {
  2409. return this._popup && this._popup._close(), this
  2410. },
  2411. togglePopup: function(t) {
  2412. return this._popup && (this._popup._map ? this.closePopup() : this.openPopup(t)), this
  2413. },
  2414. isPopupOpen: function() {
  2415. return this._popup.isOpen()
  2416. },
  2417. setPopupContent: function(t) {
  2418. return this._popup && this._popup.setContent(t), this
  2419. },
  2420. getPopup: function() {
  2421. return this._popup
  2422. },
  2423. _openPopup: function(t) {
  2424. var e = t.layer || t.target;
  2425. if (this._popup && this._map) return o.DomEvent.stop(t), e instanceof o.Path ? void this.openPopup(t.layer || t.target, t.latlng) : void(this._map.hasLayer(this._popup) && this._popup._source === e ? this.closePopup() : this.openPopup(e, t.latlng))
  2426. },
  2427. _movePopup: function(t) {
  2428. this._popup.setLatLng(t.latlng)
  2429. }
  2430. }), o.Tooltip = o.DivOverlay.extend({
  2431. options: {
  2432. pane: "tooltipPane",
  2433. offset: [0, 0],
  2434. direction: "auto",
  2435. permanent: !1,
  2436. sticky: !1,
  2437. interactive: !1,
  2438. opacity: .9
  2439. },
  2440. onAdd: function(t) {
  2441. o.DivOverlay.prototype.onAdd.call(this, t), this.setOpacity(this.options.opacity), t.fire("tooltipopen", {
  2442. tooltip: this
  2443. }), this._source && this._source.fire("tooltipopen", {
  2444. tooltip: this
  2445. }, !0)
  2446. },
  2447. onRemove: function(t) {
  2448. o.DivOverlay.prototype.onRemove.call(this, t), t.fire("tooltipclose", {
  2449. tooltip: this
  2450. }), this._source && this._source.fire("tooltipclose", {
  2451. tooltip: this
  2452. }, !0)
  2453. },
  2454. getEvents: function() {
  2455. var t = o.DivOverlay.prototype.getEvents.call(this);
  2456. return o.Browser.touch && !this.options.permanent && (t.preclick = this._close), t
  2457. },
  2458. _close: function() {
  2459. this._map && this._map.closeTooltip(this)
  2460. },
  2461. _initLayout: function() {
  2462. var t = "leaflet-tooltip",
  2463. e = t + " " + (this.options.className || "") + " leaflet-zoom-" + (this._zoomAnimated ? "animated" : "hide");
  2464. this._contentNode = this._container = o.DomUtil.create("div", e)
  2465. },
  2466. _updateLayout: function() {},
  2467. _adjustPan: function() {},
  2468. _setPosition: function(t) {
  2469. var e = this._map,
  2470. i = this._container,
  2471. n = e.latLngToContainerPoint(e.getCenter()),
  2472. s = e.layerPointToContainerPoint(t),
  2473. r = this.options.direction,
  2474. a = i.offsetWidth,
  2475. h = i.offsetHeight,
  2476. l = o.point(this.options.offset),
  2477. u = this._getAnchor();
  2478. "top" === r ? t = t.add(o.point(-a / 2 + l.x, -h + l.y + u.y, !0)) : "bottom" === r ? t = t.subtract(o.point(a / 2 - l.x, -l.y, !0)) : "center" === r ? t = t.subtract(o.point(a / 2 + l.x, h / 2 - u.y + l.y, !0)) : "right" === r || "auto" === r && s.x < n.x ? (r = "right", t = t.add(o.point(l.x + u.x, u.y - h / 2 + l.y, !0))) : (r = "left", t = t.subtract(o.point(a + u.x - l.x, h / 2 - u.y - l.y, !0))), o.DomUtil.removeClass(i, "leaflet-tooltip-right"), o.DomUtil.removeClass(i, "leaflet-tooltip-left"), o.DomUtil.removeClass(i, "leaflet-tooltip-top"), o.DomUtil.removeClass(i, "leaflet-tooltip-bottom"), o.DomUtil.addClass(i, "leaflet-tooltip-" + r), o.DomUtil.setPosition(i, t)
  2479. },
  2480. _updatePosition: function() {
  2481. var t = this._map.latLngToLayerPoint(this._latlng);
  2482. this._setPosition(t)
  2483. },
  2484. setOpacity: function(t) {
  2485. this.options.opacity = t, this._container && o.DomUtil.setOpacity(this._container, t)
  2486. },
  2487. _animateZoom: function(t) {
  2488. var e = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center);
  2489. this._setPosition(e)
  2490. },
  2491. _getAnchor: function() {
  2492. return o.point(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0])
  2493. }
  2494. }), o.tooltip = function(t, e) {
  2495. return new o.Tooltip(t, e)
  2496. }, o.Map.include({
  2497. openTooltip: function(t, e, i) {
  2498. return t instanceof o.Tooltip || (t = new o.Tooltip(i).setContent(t)), e && t.setLatLng(e), this.hasLayer(t) ? this : this.addLayer(t)
  2499. },
  2500. closeTooltip: function(t) {
  2501. return t && this.removeLayer(t), this
  2502. }
  2503. }), o.Layer.include({
  2504. bindTooltip: function(t, e) {
  2505. return t instanceof o.Tooltip ? (o.setOptions(t, e), this._tooltip = t, t._source = this) : (this._tooltip && !e || (this._tooltip = o.tooltip(e, this)), this._tooltip.setContent(t)), this._initTooltipInteractions(), this._tooltip.options.permanent && this._map && this._map.hasLayer(this) && this.openTooltip(), this
  2506. },
  2507. unbindTooltip: function() {
  2508. return this._tooltip && (this._initTooltipInteractions(!0), this.closeTooltip(), this._tooltip = null), this
  2509. },
  2510. _initTooltipInteractions: function(t) {
  2511. if (t || !this._tooltipHandlersAdded) {
  2512. var e = t ? "off" : "on",
  2513. i = {
  2514. remove: this.closeTooltip,
  2515. move: this._moveTooltip
  2516. };
  2517. this._tooltip.options.permanent ? i.add = this._openTooltip : (i.mouseover = this._openTooltip, i.mouseout = this.closeTooltip, this._tooltip.options.sticky && (i.mousemove = this._moveTooltip), o.Browser.touch && (i.click = this._openTooltip)), this[e](i), this._tooltipHandlersAdded = !t
  2518. }
  2519. },
  2520. openTooltip: function(t, e) {
  2521. if (t instanceof o.Layer || (e = t, t = this), t instanceof o.FeatureGroup) for (var i in this._layers) {
  2522. t = this._layers[i];
  2523. break
  2524. }
  2525. return e || (e = t.getCenter ? t.getCenter() : t.getLatLng()), this._tooltip && this._map && (this._tooltip._source = t, this._tooltip.update(), this._map.openTooltip(this._tooltip, e), this._tooltip.options.interactive && this._tooltip._container && (o.DomUtil.addClass(this._tooltip._container, "leaflet-clickable"), this.addInteractiveTarget(this._tooltip._container))), this
  2526. },
  2527. closeTooltip: function() {
  2528. return this._tooltip && (this._tooltip._close(), this._tooltip.options.interactive && this._tooltip._container && (o.DomUtil.removeClass(this._tooltip._container, "leaflet-clickable"), this.removeInteractiveTarget(this._tooltip._container))), this
  2529. },
  2530. toggleTooltip: function(t) {
  2531. return this._tooltip && (this._tooltip._map ? this.closeTooltip() : this.openTooltip(t)), this
  2532. },
  2533. isTooltipOpen: function() {
  2534. return this._tooltip.isOpen()
  2535. },
  2536. setTooltipContent: function(t) {
  2537. return this._tooltip && this._tooltip.setContent(t), this
  2538. },
  2539. getTooltip: function() {
  2540. return this._tooltip
  2541. },
  2542. _openTooltip: function(t) {
  2543. var e = t.layer || t.target;
  2544. this._tooltip && this._map && this.openTooltip(e, this._tooltip.options.sticky ? t.latlng : i)
  2545. },
  2546. _moveTooltip: function(t) {
  2547. var e, i, n = t.latlng;
  2548. this._tooltip.options.sticky && t.originalEvent && (e = this._map.mouseEventToContainerPoint(t.originalEvent), i = this._map.containerPointToLayerPoint(e), n = this._map.layerPointToLatLng(i)), this._tooltip.setLatLng(n)
  2549. }
  2550. }), o.LayerGroup = o.Layer.extend({
  2551. initialize: function(t) {
  2552. this._layers = {};
  2553. var e, i;
  2554. if (t) for (e = 0, i = t.length; e < i; e++) this.addLayer(t[e])
  2555. },
  2556. addLayer: function(t) {
  2557. var e = this.getLayerId(t);
  2558. return this._layers[e] = t, this._map && this._map.addLayer(t), this
  2559. },
  2560. removeLayer: function(t) {
  2561. var e = t in this._layers ? t : this.getLayerId(t);
  2562. return this._map && this._layers[e] && this._map.removeLayer(this._layers[e]), delete this._layers[e], this
  2563. },
  2564. hasLayer: function(t) {
  2565. return !!t && (t in this._layers || this.getLayerId(t) in this._layers)
  2566. },
  2567. clearLayers: function() {
  2568. for (var t in this._layers) this.removeLayer(this._layers[t]);
  2569. return this
  2570. },
  2571. invoke: function(t) {
  2572. var e, i, n = Array.prototype.slice.call(arguments, 1);
  2573. for (e in this._layers) i = this._layers[e], i[t] && i[t].apply(i, n);
  2574. return this
  2575. },
  2576. onAdd: function(t) {
  2577. for (var e in this._layers) t.addLayer(this._layers[e])
  2578. },
  2579. onRemove: function(t) {
  2580. for (var e in this._layers) t.removeLayer(this._layers[e])
  2581. },
  2582. eachLayer: function(t, e) {
  2583. for (var i in this._layers) t.call(e, this._layers[i]);
  2584. return this
  2585. },
  2586. getLayer: function(t) {
  2587. return this._layers[t]
  2588. },
  2589. getLayers: function() {
  2590. var t = [];
  2591. for (var e in this._layers) t.push(this._layers[e]);
  2592. return t
  2593. },
  2594. setZIndex: function(t) {
  2595. return this.invoke("setZIndex", t)
  2596. },
  2597. getLayerId: function(t) {
  2598. return o.stamp(t)
  2599. }
  2600. }), o.layerGroup = function(t) {
  2601. return new o.LayerGroup(t)
  2602. }, o.FeatureGroup = o.LayerGroup.extend({
  2603. addLayer: function(t) {
  2604. return this.hasLayer(t) ? this : (t.addEventParent(this), o.LayerGroup.prototype.addLayer.call(this, t), this.fire("layeradd", {
  2605. layer: t
  2606. }))
  2607. },
  2608. removeLayer: function(t) {
  2609. return this.hasLayer(t) ? (t in this._layers && (t = this._layers[t]), t.removeEventParent(this), o.LayerGroup.prototype.removeLayer.call(this, t), this.fire("layerremove", {
  2610. layer: t
  2611. })) : this
  2612. },
  2613. setStyle: function(t) {
  2614. return this.invoke("setStyle", t)
  2615. },
  2616. bringToFront: function() {
  2617. return this.invoke("bringToFront")
  2618. },
  2619. bringToBack: function() {
  2620. return this.invoke("bringToBack")
  2621. },
  2622. getBounds: function() {
  2623. var t = new o.LatLngBounds;
  2624. for (var e in this._layers) {
  2625. var i = this._layers[e];
  2626. t.extend(i.getBounds ? i.getBounds() : i.getLatLng())
  2627. }
  2628. return t
  2629. }
  2630. }), o.featureGroup = function(t) {
  2631. return new o.FeatureGroup(t)
  2632. }, o.Renderer = o.Layer.extend({
  2633. options: {
  2634. padding: .1
  2635. },
  2636. initialize: function(t) {
  2637. o.setOptions(this, t), o.stamp(this), this._layers = this._layers || {}
  2638. },
  2639. onAdd: function() {
  2640. this._container || (this._initContainer(), this._zoomAnimated && o.DomUtil.addClass(this._container, "leaflet-zoom-animated")), this.getPane().appendChild(this._container), this._update(), this.on("update", this._updatePaths, this)
  2641. },
  2642. onRemove: function() {
  2643. o.DomUtil.remove(this._container), this.off("update", this._updatePaths, this)
  2644. },
  2645. getEvents: function() {
  2646. var t = {
  2647. viewreset: this._reset,
  2648. zoom: this._onZoom,
  2649. moveend: this._update,
  2650. zoomend: this._onZoomEnd
  2651. };
  2652. return this._zoomAnimated && (t.zoomanim = this._onAnimZoom), t
  2653. },
  2654. _onAnimZoom: function(t) {
  2655. this._updateTransform(t.center, t.zoom)
  2656. },
  2657. _onZoom: function() {
  2658. this._updateTransform(this._map.getCenter(), this._map.getZoom())
  2659. },
  2660. _updateTransform: function(t, e) {
  2661. var i = this._map.getZoomScale(e, this._zoom),
  2662. n = o.DomUtil.getPosition(this._container),
  2663. s = this._map.getSize().multiplyBy(.5 + this.options.padding),
  2664. r = this._map.project(this._center, e),
  2665. a = this._map.project(t, e),
  2666. h = a.subtract(r),
  2667. l = s.multiplyBy(-i).add(n).add(s).subtract(h);
  2668. o.Browser.any3d ? o.DomUtil.setTransform(this._container, l, i) : o.DomUtil.setPosition(this._container, l)
  2669. },
  2670. _reset: function() {
  2671. this._update(), this._updateTransform(this._center, this._zoom);
  2672. for (var t in this._layers) this._layers[t]._reset()
  2673. },
  2674. _onZoomEnd: function() {
  2675. for (var t in this._layers) this._layers[t]._project()
  2676. },
  2677. _updatePaths: function() {
  2678. for (var t in this._layers) this._layers[t]._update()
  2679. },
  2680. _update: function() {
  2681. var t = this.options.padding,
  2682. e = this._map.getSize(),
  2683. i = this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();
  2684. this._bounds = new o.Bounds(i, i.add(e.multiplyBy(1 + 2 * t)).round()), this._center = this._map.getCenter(), this._zoom = this._map.getZoom()
  2685. }
  2686. }), o.Map.include({
  2687. getRenderer: function(t) {
  2688. var e = t.options.renderer || this._getPaneRenderer(t.options.pane) || this.options.renderer || this._renderer;
  2689. return e || (e = this._renderer = this.options.preferCanvas && o.canvas() || o.svg()), this.hasLayer(e) || this.addLayer(e), e
  2690. },
  2691. _getPaneRenderer: function(t) {
  2692. if ("overlayPane" === t || t === i) return !1;
  2693. var e = this._paneRenderers[t];
  2694. return e === i && (e = o.SVG && o.svg({
  2695. pane: t
  2696. }) || o.Canvas && o.canvas({
  2697. pane: t
  2698. }), this._paneRenderers[t] = e), e
  2699. }
  2700. }), o.Path = o.Layer.extend({
  2701. options: {
  2702. stroke: !0,
  2703. color: "#3388ff",
  2704. weight: 3,
  2705. opacity: 1,
  2706. lineCap: "round",
  2707. lineJoin: "round",
  2708. dashArray: null,
  2709. dashOffset: null,
  2710. fill: !1,
  2711. fillColor: null,
  2712. fillOpacity: .2,
  2713. fillRule: "evenodd",
  2714. interactive: !0
  2715. },
  2716. beforeAdd: function(t) {
  2717. this._renderer = t.getRenderer(this)
  2718. },
  2719. onAdd: function() {
  2720. this._renderer._initPath(this), this._reset(), this._renderer._addPath(this)
  2721. },
  2722. onRemove: function() {
  2723. this._renderer._removePath(this)
  2724. },
  2725. redraw: function() {
  2726. return this._map && this._renderer._updatePath(this), this
  2727. },
  2728. setStyle: function(t) {
  2729. return o.setOptions(this, t), this._renderer && this._renderer._updateStyle(this), this
  2730. },
  2731. bringToFront: function() {
  2732. return this._renderer && this._renderer._bringToFront(this), this
  2733. },
  2734. bringToBack: function() {
  2735. return this._renderer && this._renderer._bringToBack(this), this
  2736. },
  2737. getElement: function() {
  2738. return this._path
  2739. },
  2740. _reset: function() {
  2741. this._project(), this._update()
  2742. },
  2743. _clickTolerance: function() {
  2744. return (this.options.stroke ? this.options.weight / 2 : 0) + (o.Browser.touch ? 10 : 0)
  2745. }
  2746. }), o.LineUtil = {
  2747. simplify: function(t, e) {
  2748. if (!e || !t.length) return t.slice();
  2749. var i = e * e;
  2750. return t = this._reducePoints(t, i), t = this._simplifyDP(t, i)
  2751. },
  2752. pointToSegmentDistance: function(t, e, i) {
  2753. return Math.sqrt(this._sqClosestPointOnSegment(t, e, i, !0))
  2754. },
  2755. closestPointOnSegment: function(t, e, i) {
  2756. return this._sqClosestPointOnSegment(t, e, i)
  2757. },
  2758. _simplifyDP: function(t, e) {
  2759. var n = t.length,
  2760. o = typeof Uint8Array != i + "" ? Uint8Array : Array,
  2761. s = new o(n);
  2762. s[0] = s[n - 1] = 1, this._simplifyDPStep(t, s, e, 0, n - 1);
  2763. var r, a = [];
  2764. for (r = 0; r < n; r++) s[r] && a.push(t[r]);
  2765. return a
  2766. },
  2767. _simplifyDPStep: function(t, e, i, n, o) {
  2768. var s, r, a, h = 0;
  2769. for (r = n + 1; r <= o - 1; r++) a = this._sqClosestPointOnSegment(t[r], t[n], t[o], !0), a > h && (s = r, h = a);
  2770. h > i && (e[s] = 1, this._simplifyDPStep(t, e, i, n, s), this._simplifyDPStep(t, e, i, s, o))
  2771. },
  2772. _reducePoints: function(t, e) {
  2773. for (var i = [t[0]], n = 1, o = 0, s = t.length; n < s; n++) this._sqDist(t[n], t[o]) > e && (i.push(t[n]), o = n);
  2774. return o < s - 1 && i.push(t[s - 1]), i
  2775. },
  2776. clipSegment: function(t, e, i, n, o) {
  2777. var s, r, a, h = n ? this._lastCode : this._getBitCode(t, i),
  2778. l = this._getBitCode(e, i);
  2779. for (this._lastCode = l;;) {
  2780. if (!(h | l)) return [t, e];
  2781. if (h & l) return !1;
  2782. s = h || l, r = this._getEdgeIntersection(t, e, s, i, o), a = this._getBitCode(r, i), s === h ? (t = r, h = a) : (e = r, l = a)
  2783. }
  2784. },
  2785. _getEdgeIntersection: function(t, e, i, n, s) {
  2786. var r, a, h = e.x - t.x,
  2787. l = e.y - t.y,
  2788. u = n.min,
  2789. c = n.max;
  2790. return 8 & i ? (r = t.x + h * (c.y - t.y) / l, a = c.y) : 4 & i ? (r = t.x + h * (u.y - t.y) / l, a = u.y) : 2 & i ? (r = c.x, a = t.y + l * (c.x - t.x) / h) : 1 & i && (r = u.x, a = t.y + l * (u.x - t.x) / h), new o.Point(r, a, s)
  2791. },
  2792. _getBitCode: function(t, e) {
  2793. var i = 0;
  2794. return t.x < e.min.x ? i |= 1 : t.x > e.max.x && (i |= 2), t.y < e.min.y ? i |= 4 : t.y > e.max.y && (i |= 8), i
  2795. },
  2796. _sqDist: function(t, e) {
  2797. var i = e.x - t.x,
  2798. n = e.y - t.y;
  2799. return i * i + n * n
  2800. },
  2801. _sqClosestPointOnSegment: function(t, e, i, n) {
  2802. var s, r = e.x,
  2803. a = e.y,
  2804. h = i.x - r,
  2805. l = i.y - a,
  2806. u = h * h + l * l;
  2807. return u > 0 && (s = ((t.x - r) * h + (t.y - a) * l) / u, s > 1 ? (r = i.x, a = i.y) : s > 0 && (r += h * s, a += l * s)), h = t.x - r, l = t.y - a, n ? h * h + l * l : new o.Point(r, a)
  2808. }
  2809. }, o.Polyline = o.Path.extend({
  2810. options: {
  2811. smoothFactor: 1,
  2812. noClip: !1
  2813. },
  2814. initialize: function(t, e) {
  2815. o.setOptions(this, e), this._setLatLngs(t)
  2816. },
  2817. getLatLngs: function() {
  2818. return this._latlngs
  2819. },
  2820. setLatLngs: function(t) {
  2821. return this._setLatLngs(t), this.redraw()
  2822. },
  2823. isEmpty: function() {
  2824. return !this._latlngs.length
  2825. },
  2826. closestLayerPoint: function(t) {
  2827. for (var e, i, n = 1 / 0, s = null, r = o.LineUtil._sqClosestPointOnSegment, a = 0, h = this._parts.length; a < h; a++) for (var l = this._parts[a], u = 1, c = l.length; u < c; u++) {
  2828. e = l[u - 1], i = l[u];
  2829. var d = r(t, e, i, !0);
  2830. d < n && (n = d, s = r(t, e, i))
  2831. }
  2832. return s && (s.distance = Math.sqrt(n)), s
  2833. },
  2834. getCenter: function() {
  2835. if (!this._map) throw new Error("Must add layer to map before using getCenter()");
  2836. var t, e, i, n, o, s, r, a = this._rings[0],
  2837. h = a.length;
  2838. if (!h) return null;
  2839. for (t = 0, e = 0; t < h - 1; t++) e += a[t].distanceTo(a[t + 1]) / 2;
  2840. if (0 === e) return this._map.layerPointToLatLng(a[0]);
  2841. for (t = 0, n = 0; t < h - 1; t++) if (o = a[t], s = a[t + 1], i = o.distanceTo(s), n += i, n > e) return r = (n - e) / i, this._map.layerPointToLatLng([s.x - r * (s.x - o.x), s.y - r * (s.y - o.y)])
  2842. },
  2843. getBounds: function() {
  2844. return this._bounds
  2845. },
  2846. addLatLng: function(t, e) {
  2847. return e = e || this._defaultShape(), t = o.latLng(t), e.push(t), this._bounds.extend(t), this.redraw()
  2848. },
  2849. _setLatLngs: function(t) {
  2850. this._bounds = new o.LatLngBounds, this._latlngs = this._convertLatLngs(t)
  2851. },
  2852. _defaultShape: function() {
  2853. return o.Polyline._flat(this._latlngs) ? this._latlngs : this._latlngs[0]
  2854. },
  2855. _convertLatLngs: function(t) {
  2856. for (var e = [], i = o.Polyline._flat(t), n = 0, s = t.length; n < s; n++) i ? (e[n] = o.latLng(t[n]), this._bounds.extend(e[n])) : e[n] = this._convertLatLngs(t[n]);
  2857. return e
  2858. },
  2859. _project: function() {
  2860. var t = new o.Bounds;
  2861. this._rings = [], this._projectLatlngs(this._latlngs, this._rings, t);
  2862. var e = this._clickTolerance(),
  2863. i = new o.Point(e, e);
  2864. this._bounds.isValid() && t.isValid() && (t.min._subtract(i), t.max._add(i), this._pxBounds = t)
  2865. },
  2866. _projectLatlngs: function(t, e, i) {
  2867. var n, s, r = t[0] instanceof o.LatLng,
  2868. a = t.length;
  2869. if (r) {
  2870. for (s = [], n = 0; n < a; n++) s[n] = this._map.latLngToLayerPoint(t[n]), i.extend(s[n]);
  2871. e.push(s)
  2872. } else for (n = 0; n < a; n++) this._projectLatlngs(t[n], e, i)
  2873. },
  2874. _clipPoints: function() {
  2875. var t = this._renderer._bounds;
  2876. if (this._parts = [], this._pxBounds && this._pxBounds.intersects(t)) {
  2877. if (this.options.noClip) return void(this._parts = this._rings);
  2878. var e, i, n, s, r, a, h, l = this._parts;
  2879. for (e = 0, n = 0, s = this._rings.length; e < s; e++) for (h = this._rings[e], i = 0, r = h.length; i < r - 1; i++) a = o.LineUtil.clipSegment(h[i], h[i + 1], t, i, !0), a && (l[n] = l[n] || [], l[n].push(a[0]), a[1] === h[i + 1] && i !== r - 2 || (l[n].push(a[1]), n++))
  2880. }
  2881. },
  2882. _simplifyPoints: function() {
  2883. for (var t = this._parts, e = this.options.smoothFactor, i = 0, n = t.length; i < n; i++) t[i] = o.LineUtil.simplify(t[i], e)
  2884. },
  2885. _update: function() {
  2886. this._map && (this._clipPoints(), this._simplifyPoints(), this._updatePath())
  2887. },
  2888. _updatePath: function() {
  2889. this._renderer._updatePoly(this)
  2890. }
  2891. }), o.polyline = function(t, e) {
  2892. return new o.Polyline(t, e)
  2893. }, o.Polyline._flat = function(t) {
  2894. return !o.Util.isArray(t[0]) || "object" != typeof t[0][0] && "undefined" != typeof t[0][0]
  2895. }, o.PolyUtil = {}, o.PolyUtil.clipPolygon = function(t, e, i) {
  2896. var n, s, r, a, h, l, u, c, d, _ = [1, 4, 2, 8],
  2897. m = o.LineUtil;
  2898. for (s = 0, u = t.length; s < u; s++) t[s]._code = m._getBitCode(t[s], e);
  2899. for (a = 0; a < 4; a++) {
  2900. for (c = _[a], n = [], s = 0, u = t.length, r = u - 1; s < u; r = s++) h = t[s], l = t[r], h._code & c ? l._code & c || (d = m._getEdgeIntersection(l, h, c, e, i), d._code = m._getBitCode(d, e), n.push(d)) : (l._code & c && (d = m._getEdgeIntersection(l, h, c, e, i), d._code = m._getBitCode(d, e), n.push(d)), n.push(h));
  2901. t = n
  2902. }
  2903. return t
  2904. }, o.Polygon = o.Polyline.extend({
  2905. options: {
  2906. fill: !0
  2907. },
  2908. isEmpty: function() {
  2909. return !this._latlngs.length || !this._latlngs[0].length
  2910. },
  2911. getCenter: function() {
  2912. if (!this._map) throw new Error("Must add layer to map before using getCenter()");
  2913. var t, e, i, n, o, s, r, a, h, l = this._rings[0],
  2914. u = l.length;
  2915. if (!u) return null;
  2916. for (s = r = a = 0, t = 0, e = u - 1; t < u; e = t++) i = l[t], n = l[e], o = i.y * n.x - n.y * i.x, r += (i.x + n.x) * o, a += (i.y + n.y) * o, s += 3 * o;
  2917. return h = 0 === s ? l[0] : [r / s, a / s], this._map.layerPointToLatLng(h)
  2918. },
  2919. _convertLatLngs: function(t) {
  2920. var e = o.Polyline.prototype._convertLatLngs.call(this, t),
  2921. i = e.length;
  2922. return i >= 2 && e[0] instanceof o.LatLng && e[0].equals(e[i - 1]) && e.pop(), e
  2923. },
  2924. _setLatLngs: function(t) {
  2925. o.Polyline.prototype._setLatLngs.call(this, t), o.Polyline._flat(this._latlngs) && (this._latlngs = [this._latlngs])
  2926. },
  2927. _defaultShape: function() {
  2928. return o.Polyline._flat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0]
  2929. },
  2930. _clipPoints: function() {
  2931. var t = this._renderer._bounds,
  2932. e = this.options.weight,
  2933. i = new o.Point(e, e);
  2934. if (t = new o.Bounds(t.min.subtract(i), t.max.add(i)), this._parts = [], this._pxBounds && this._pxBounds.intersects(t)) {
  2935. if (this.options.noClip) return void(this._parts = this._rings);
  2936. for (var n, s = 0, r = this._rings.length; s < r; s++) n = o.PolyUtil.clipPolygon(this._rings[s], t, !0), n.length && this._parts.push(n)
  2937. }
  2938. },
  2939. _updatePath: function() {
  2940. this._renderer._updatePoly(this, !0)
  2941. }
  2942. }), o.polygon = function(t, e) {
  2943. return new o.Polygon(t, e)
  2944. }, o.Rectangle = o.Polygon.extend({
  2945. initialize: function(t, e) {
  2946. o.Polygon.prototype.initialize.call(this, this._boundsToLatLngs(t), e)
  2947. },
  2948. setBounds: function(t) {
  2949. return this.setLatLngs(this._boundsToLatLngs(t))
  2950. },
  2951. _boundsToLatLngs: function(t) {
  2952. return t = o.latLngBounds(t), [t.getSouthWest(), t.getNorthWest(), t.getNorthEast(), t.getSouthEast()]
  2953. }
  2954. }), o.rectangle = function(t, e) {
  2955. return new o.Rectangle(t, e)
  2956. }, o.CircleMarker = o.Path.extend({
  2957. options: {
  2958. fill: !0,
  2959. radius: 10
  2960. },
  2961. initialize: function(t, e) {
  2962. o.setOptions(this, e), this._latlng = o.latLng(t), this._radius = this.options.radius
  2963. },
  2964. setLatLng: function(t) {
  2965. return this._latlng = o.latLng(t), this.redraw(), this.fire("move", {
  2966. latlng: this._latlng
  2967. })
  2968. },
  2969. getLatLng: function() {
  2970. return this._latlng
  2971. },
  2972. setRadius: function(t) {
  2973. return this.options.radius = this._radius = t, this.redraw()
  2974. },
  2975. getRadius: function() {
  2976. return this._radius
  2977. },
  2978. setStyle: function(t) {
  2979. var e = t && t.radius || this._radius;
  2980. return o.Path.prototype.setStyle.call(this, t), this.setRadius(e), this
  2981. },
  2982. _project: function() {
  2983. this._point = this._map.latLngToLayerPoint(this._latlng), this._updateBounds()
  2984. },
  2985. _updateBounds: function() {
  2986. var t = this._radius,
  2987. e = this._radiusY || t,
  2988. i = this._clickTolerance(),
  2989. n = [t + i, e + i];
  2990. this._pxBounds = new o.Bounds(this._point.subtract(n), this._point.add(n))
  2991. },
  2992. _update: function() {
  2993. this._map && this._updatePath()
  2994. },
  2995. _updatePath: function() {
  2996. this._renderer._updateCircle(this)
  2997. },
  2998. _empty: function() {
  2999. return this._radius && !this._renderer._bounds.intersects(this._pxBounds)
  3000. }
  3001. }), o.circleMarker = function(t, e) {
  3002. return new o.CircleMarker(t, e)
  3003. }, o.Circle = o.CircleMarker.extend({
  3004. initialize: function(t, e, i) {
  3005. if ("number" == typeof e && (e = o.extend({}, i, {
  3006. radius: e
  3007. })), o.setOptions(this, e), this._latlng = o.latLng(t), isNaN(this.options.radius)) throw new Error("Circle radius cannot be NaN");
  3008. this._mRadius = this.options.radius
  3009. },
  3010. setRadius: function(t) {
  3011. return this._mRadius = t, this.redraw()
  3012. },
  3013. getRadius: function() {
  3014. return this._mRadius
  3015. },
  3016. getBounds: function() {
  3017. var t = [this._radius, this._radiusY || this._radius];
  3018. return new o.LatLngBounds(this._map.layerPointToLatLng(this._point.subtract(t)), this._map.layerPointToLatLng(this._point.add(t)))
  3019. },
  3020. setStyle: o.Path.prototype.setStyle,
  3021. _project: function() {
  3022. var t = this._latlng.lng,
  3023. e = this._latlng.lat,
  3024. i = this._map,
  3025. n = i.options.crs;
  3026. if (n.distance === o.CRS.Earth.distance) {
  3027. var s = Math.PI / 180,
  3028. r = this._mRadius / o.CRS.Earth.R / s,
  3029. a = i.project([e + r, t]),
  3030. h = i.project([e - r, t]),
  3031. l = a.add(h).divideBy(2),
  3032. u = i.unproject(l).lat,
  3033. c = Math.acos((Math.cos(r * s) - Math.sin(e * s) * Math.sin(u * s)) / (Math.cos(e * s) * Math.cos(u * s))) / s;
  3034. (isNaN(c) || 0 === c) && (c = r / Math.cos(Math.PI / 180 * e)), this._point = l.subtract(i.getPixelOrigin()), this._radius = isNaN(c) ? 0 : Math.max(Math.round(l.x - i.project([u, t - c]).x), 1), this._radiusY = Math.max(Math.round(l.y - a.y), 1)
  3035. } else {
  3036. var d = n.unproject(n.project(this._latlng).subtract([this._mRadius, 0]));
  3037. this._point = i.latLngToLayerPoint(this._latlng), this._radius = this._point.x - i.latLngToLayerPoint(d).x
  3038. }
  3039. this._updateBounds()
  3040. }
  3041. }), o.circle = function(t, e, i) {
  3042. return new o.Circle(t, e, i)
  3043. }, o.SVG = o.Renderer.extend({
  3044. getEvents: function() {
  3045. var t = o.Renderer.prototype.getEvents.call(this);
  3046. return t.zoomstart = this._onZoomStart, t
  3047. },
  3048. _initContainer: function() {
  3049. this._container = o.SVG.create("svg"), this._container.setAttribute("pointer-events", "none"), this._rootGroup = o.SVG.create("g"), this._container.appendChild(this._rootGroup)
  3050. },
  3051. _onZoomStart: function() {
  3052. this._update()
  3053. },
  3054. _update: function() {
  3055. if (!this._map._animatingZoom || !this._bounds) {
  3056. o.Renderer.prototype._update.call(this);
  3057. var t = this._bounds,
  3058. e = t.getSize(),
  3059. i = this._container;
  3060. this._svgSize && this._svgSize.equals(e) || (this._svgSize = e, i.setAttribute("width", e.x), i.setAttribute("height", e.y)), o.DomUtil.setPosition(i, t.min), i.setAttribute("viewBox", [t.min.x, t.min.y, e.x, e.y].join(" ")), this.fire("update")
  3061. }
  3062. },
  3063. _initPath: function(t) {
  3064. var e = t._path = o.SVG.create("path");
  3065. t.options.className && o.DomUtil.addClass(e, t.options.className), t.options.interactive && o.DomUtil.addClass(e, "leaflet-interactive"), this._updateStyle(t), this._layers[o.stamp(t)] = t
  3066. },
  3067. _addPath: function(t) {
  3068. this._rootGroup.appendChild(t._path), t.addInteractiveTarget(t._path)
  3069. },
  3070. _removePath: function(t) {
  3071. o.DomUtil.remove(t._path), t.removeInteractiveTarget(t._path), delete this._layers[o.stamp(t)]
  3072. },
  3073. _updatePath: function(t) {
  3074. t._project(), t._update()
  3075. },
  3076. _updateStyle: function(t) {
  3077. var e = t._path,
  3078. i = t.options;
  3079. e && (i.stroke ? (e.setAttribute("stroke", i.color), e.setAttribute("stroke-opacity", i.opacity), e.setAttribute("stroke-width", i.weight), e.setAttribute("stroke-linecap", i.lineCap), e.setAttribute("stroke-linejoin", i.lineJoin), i.dashArray ? e.setAttribute("stroke-dasharray", i.dashArray) : e.removeAttribute("stroke-dasharray"), i.dashOffset ? e.setAttribute("stroke-dashoffset", i.dashOffset) : e.removeAttribute("stroke-dashoffset")) : e.setAttribute("stroke", "none"), i.fill ? (e.setAttribute("fill", i.fillColor || i.color), e.setAttribute("fill-opacity", i.fillOpacity), e.setAttribute("fill-rule", i.fillRule || "evenodd")) : e.setAttribute("fill", "none"))
  3080. },
  3081. _updatePoly: function(t, e) {
  3082. this._setPath(t, o.SVG.pointsToPath(t._parts, e))
  3083. },
  3084. _updateCircle: function(t) {
  3085. var e = t._point,
  3086. i = t._radius,
  3087. n = t._radiusY || i,
  3088. o = "a" + i + "," + n + " 0 1,0 ",
  3089. s = t._empty() ? "M0 0" : "M" + (e.x - i) + "," + e.y + o + 2 * i + ",0 " + o + 2 * -i + ",0 ";
  3090. this._setPath(t, s)
  3091. },
  3092. _setPath: function(t, e) {
  3093. t._path.setAttribute("d", e)
  3094. },
  3095. _bringToFront: function(t) {
  3096. o.DomUtil.toFront(t._path)
  3097. },
  3098. _bringToBack: function(t) {
  3099. o.DomUtil.toBack(t._path)
  3100. }
  3101. }), o.extend(o.SVG, {
  3102. create: function(t) {
  3103. return e.createElementNS("http://www.w3.org/2000/svg", t)
  3104. },
  3105. pointsToPath: function(t, e) {
  3106. var i, n, s, r, a, h, l = "";
  3107. for (i = 0, s = t.length; i < s; i++) {
  3108. for (a = t[i], n = 0, r = a.length; n < r; n++) h = a[n], l += (n ? "L" : "M") + h.x + " " + h.y;
  3109. l += e ? o.Browser.svg ? "z" : "x" : ""
  3110. }
  3111. return l || "M0 0"
  3112. }
  3113. }), o.Browser.svg = !(!e.createElementNS || !o.SVG.create("svg").createSVGRect), o.svg = function(t) {
  3114. return o.Browser.svg || o.Browser.vml ? new o.SVG(t) : null
  3115. }, o.Browser.vml = !o.Browser.svg &&
  3116. function() {
  3117. try {
  3118. var t = e.createElement("div");
  3119. t.innerHTML = '<v:shape adj="1"/>';
  3120. var i = t.firstChild;
  3121. return i.style.behavior = "url(#default#VML)", i && "object" == typeof i.adj
  3122. } catch (t) {
  3123. return !1
  3124. }
  3125. }(), o.SVG.include(o.Browser.vml ? {
  3126. _initContainer: function() {
  3127. this._container = o.DomUtil.create("div", "leaflet-vml-container")
  3128. },
  3129. _update: function() {
  3130. this._map._animatingZoom || (o.Renderer.prototype._update.call(this), this.fire("update"))
  3131. },
  3132. _initPath: function(t) {
  3133. var e = t._container = o.SVG.create("shape");
  3134. o.DomUtil.addClass(e, "leaflet-vml-shape " + (this.options.className || "")), e.coordsize = "1 1", t._path = o.SVG.create("path"), e.appendChild(t._path), this._updateStyle(t)
  3135. },
  3136. _addPath: function(t) {
  3137. var e = t._container;
  3138. this._container.appendChild(e), t.options.interactive && t.addInteractiveTarget(e)
  3139. },
  3140. _removePath: function(t) {
  3141. var e = t._container;
  3142. o.DomUtil.remove(e), t.removeInteractiveTarget(e)
  3143. },
  3144. _updateStyle: function(t) {
  3145. var e = t._stroke,
  3146. i = t._fill,
  3147. n = t.options,
  3148. s = t._container;
  3149. s.stroked = !! n.stroke, s.filled = !! n.fill, n.stroke ? (e || (e = t._stroke = o.SVG.create("stroke")), s.appendChild(e), e.weight = n.weight + "px", e.color = n.color, e.opacity = n.opacity, n.dashArray ? e.dashStyle = o.Util.isArray(n.dashArray) ? n.dashArray.join(" ") : n.dashArray.replace(/( *, *)/g, " ") : e.dashStyle = "", e.endcap = n.lineCap.replace("butt", "flat"), e.joinstyle = n.lineJoin) : e && (s.removeChild(e), t._stroke = null), n.fill ? (i || (i = t._fill = o.SVG.create("fill")), s.appendChild(i), i.color = n.fillColor || n.color, i.opacity = n.fillOpacity) : i && (s.removeChild(i), t._fill = null)
  3150. },
  3151. _updateCircle: function(t) {
  3152. var e = t._point.round(),
  3153. i = Math.round(t._radius),
  3154. n = Math.round(t._radiusY || i);
  3155. this._setPath(t, t._empty() ? "M0 0" : "AL " + e.x + "," + e.y + " " + i + "," + n + " 0,23592600")
  3156. },
  3157. _setPath: function(t, e) {
  3158. t._path.v = e
  3159. },
  3160. _bringToFront: function(t) {
  3161. o.DomUtil.toFront(t._container)
  3162. },
  3163. _bringToBack: function(t) {
  3164. o.DomUtil.toBack(t._container)
  3165. }
  3166. } : {}), o.Browser.vml && (o.SVG.create = function() {
  3167. try {
  3168. return e.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"), function(t) {
  3169. return e.createElement("<lvml:" + t + ' class="lvml">')
  3170. }
  3171. } catch (t) {
  3172. return function(t) {
  3173. return e.createElement("<" + t + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')
  3174. }
  3175. }
  3176. }()), o.Canvas = o.Renderer.extend({
  3177. onAdd: function() {
  3178. o.Renderer.prototype.onAdd.call(this), this._draw()
  3179. },
  3180. _initContainer: function() {
  3181. var t = this._container = e.createElement("canvas");
  3182. o.DomEvent.on(t, "mousemove", o.Util.throttle(this._onMouseMove, 32, this), this).on(t, "click dblclick mousedown mouseup contextmenu", this._onClick, this).on(t, "mouseout", this._handleMouseOut, this), this._ctx = t.getContext("2d")
  3183. },
  3184. _updatePaths: function() {
  3185. var t;
  3186. this._redrawBounds = null;
  3187. for (var e in this._layers) t = this._layers[e], t._update();
  3188. this._redraw()
  3189. },
  3190. _update: function() {
  3191. if (!this._map._animatingZoom || !this._bounds) {
  3192. this._drawnLayers = {}, o.Renderer.prototype._update.call(this);
  3193. var t = this._bounds,
  3194. e = this._container,
  3195. i = t.getSize(),
  3196. n = o.Browser.retina ? 2 : 1;
  3197. o.DomUtil.setPosition(e, t.min), e.width = n * i.x, e.height = n * i.y, e.style.width = i.x + "px", e.style.height = i.y + "px", o.Browser.retina && this._ctx.scale(2, 2), this._ctx.translate(-t.min.x, -t.min.y), this.fire("update")
  3198. }
  3199. },
  3200. _initPath: function(t) {
  3201. this._updateDashArray(t), this._layers[o.stamp(t)] = t;
  3202. var e = t._order = {
  3203. layer: t,
  3204. prev: this._drawLast,
  3205. next: null
  3206. };
  3207. this._drawLast && (this._drawLast.next = e), this._drawLast = e, this._drawFirst = this._drawFirst || this._drawLast
  3208. },
  3209. _addPath: function(t) {
  3210. this._requestRedraw(t)
  3211. },
  3212. _removePath: function(t) {
  3213. var e = t._order,
  3214. i = e.next,
  3215. n = e.prev;
  3216. i ? i.prev = n : this._drawLast = n, n ? n.next = i : this._drawFirst = i, delete t._order, delete this._layers[o.stamp(t)], this._requestRedraw(t)
  3217. },
  3218. _updatePath: function(t) {
  3219. this._extendRedrawBounds(t), t._project(), t._update(), this._requestRedraw(t)
  3220. },
  3221. _updateStyle: function(t) {
  3222. this._updateDashArray(t), this._requestRedraw(t)
  3223. },
  3224. _updateDashArray: function(t) {
  3225. if (t.options.dashArray) {
  3226. var e, i = t.options.dashArray.split(","),
  3227. n = [];
  3228. for (e = 0; e < i.length; e++) n.push(Number(i[e]));
  3229. t.options._dashArray = n
  3230. }
  3231. },
  3232. _requestRedraw: function(t) {
  3233. this._map && (this._extendRedrawBounds(t), this._redrawRequest = this._redrawRequest || o.Util.requestAnimFrame(this._redraw, this))
  3234. },
  3235. _extendRedrawBounds: function(t) {
  3236. var e = (t.options.weight || 0) + 1;
  3237. this._redrawBounds = this._redrawBounds || new o.Bounds, this._redrawBounds.extend(t._pxBounds.min.subtract([e, e])), this._redrawBounds.extend(t._pxBounds.max.add([e, e]))
  3238. },
  3239. _redraw: function() {
  3240. this._redrawRequest = null, this._clear(), this._draw(), this._redrawBounds = null
  3241. },
  3242. _clear: function() {
  3243. var t = this._redrawBounds;
  3244. if (t) {
  3245. var e = t.getSize();
  3246. this._ctx.clearRect(t.min.x, t.min.y, e.x, e.y)
  3247. } else this._ctx.clearRect(0, 0, this._container.width, this._container.height)
  3248. },
  3249. _draw: function() {
  3250. var t, e = this._redrawBounds;
  3251. if (this._ctx.save(), e) {
  3252. var i = e.getSize();
  3253. this._ctx.beginPath(), this._ctx.rect(e.min.x, e.min.y, i.x, i.y), this._ctx.clip()
  3254. }
  3255. this._drawing = !0;
  3256. for (var n = this._drawFirst; n; n = n.next) t = n.layer, (!e || t._pxBounds && t._pxBounds.intersects(e)) && t._updatePath();
  3257. this._drawing = !1, this._ctx.restore()
  3258. },
  3259. _updatePoly: function(t, e) {
  3260. if (this._drawing) {
  3261. var i, n, o, s, r = t._parts,
  3262. a = r.length,
  3263. h = this._ctx;
  3264. if (a) {
  3265. for (this._drawnLayers[t._leaflet_id] = t, h.beginPath(), h.setLineDash && h.setLineDash(t.options && t.options._dashArray || []), i = 0; i < a; i++) {
  3266. for (n = 0, o = r[i].length; n < o; n++) s = r[i][n], h[n ? "lineTo" : "moveTo"](s.x, s.y);
  3267. e && h.closePath()
  3268. }
  3269. this._fillStroke(h, t)
  3270. }
  3271. }
  3272. },
  3273. _updateCircle: function(t) {
  3274. if (this._drawing && !t._empty()) {
  3275. var e = t._point,
  3276. i = this._ctx,
  3277. n = t._radius,
  3278. o = (t._radiusY || n) / n;
  3279. this._drawnLayers[t._leaflet_id] = t, 1 !== o && (i.save(), i.scale(1, o)), i.beginPath(), i.arc(e.x, e.y / o, n, 0, 2 * Math.PI, !1), 1 !== o && i.restore(), this._fillStroke(i, t)
  3280. }
  3281. },
  3282. _fillStroke: function(t, e) {
  3283. var i = e.options;
  3284. i.fill && (t.globalAlpha = i.fillOpacity, t.fillStyle = i.fillColor || i.color, t.fill(i.fillRule || "evenodd")), i.stroke && 0 !== i.weight && (t.globalAlpha = i.opacity, t.lineWidth = i.weight, t.strokeStyle = i.color, t.lineCap = i.lineCap, t.lineJoin = i.lineJoin, t.stroke())
  3285. },
  3286. _onClick: function(t) {
  3287. for (var e, i, n = this._map.mouseEventToLayerPoint(t), s = this._drawFirst; s; s = s.next) e = s.layer, e.options.interactive && e._containsPoint(n) && !this._map._draggableMoved(e) && (i = e);
  3288. i && (o.DomEvent._fakeStop(t), this._fireEvent([i], t))
  3289. },
  3290. _onMouseMove: function(t) {
  3291. if (this._map && !this._map.dragging.moving() && !this._map._animatingZoom) {
  3292. var e = this._map.mouseEventToLayerPoint(t);
  3293. this._handleMouseHover(t, e)
  3294. }
  3295. },
  3296. _handleMouseOut: function(t) {
  3297. var e = this._hoveredLayer;
  3298. e && (o.DomUtil.removeClass(this._container, "leaflet-interactive"), this._fireEvent([e], t, "mouseout"), this._hoveredLayer = null)
  3299. },
  3300. _handleMouseHover: function(t, e) {
  3301. for (var i, n, s = this._drawFirst; s; s = s.next) i = s.layer, i.options.interactive && i._containsPoint(e) && (n = i);
  3302. n !== this._hoveredLayer && (this._handleMouseOut(t), n && (o.DomUtil.addClass(this._container, "leaflet-interactive"), this._fireEvent([n], t, "mouseover"), this._hoveredLayer = n)), this._hoveredLayer && this._fireEvent([this._hoveredLayer], t)
  3303. },
  3304. _fireEvent: function(t, e, i) {
  3305. this._map._fireDOMEvent(e, i || e.type, t)
  3306. },
  3307. _bringToFront: function(t) {
  3308. var e = t._order,
  3309. i = e.next,
  3310. n = e.prev;
  3311. i && (i.prev = n, n ? n.next = i : i && (this._drawFirst = i), e.prev = this._drawLast, this._drawLast.next = e, e.next = null, this._drawLast = e, this._requestRedraw(t))
  3312. },
  3313. _bringToBack: function(t) {
  3314. var e = t._order,
  3315. i = e.next,
  3316. n = e.prev;
  3317. n && (n.next = i, i ? i.prev = n : n && (this._drawLast = n), e.prev = null, e.next = this._drawFirst, this._drawFirst.prev = e, this._drawFirst = e, this._requestRedraw(t))
  3318. }
  3319. }), o.Browser.canvas = function() {
  3320. return !!e.createElement("canvas").getContext
  3321. }(), o.canvas = function(t) {
  3322. return o.Browser.canvas ? new o.Canvas(t) : null
  3323. }, o.Polyline.prototype._containsPoint = function(t, e) {
  3324. var i, n, s, r, a, h, l = this._clickTolerance();
  3325. if (!this._pxBounds.contains(t)) return !1;
  3326. for (i = 0, r = this._parts.length; i < r; i++) for (h = this._parts[i], n = 0, a = h.length, s = a - 1; n < a; s = n++) if ((e || 0 !== n) && o.LineUtil.pointToSegmentDistance(t, h[s], h[n]) <= l) return !0;
  3327. return !1
  3328. }, o.Polygon.prototype._containsPoint = function(t) {
  3329. var e, i, n, s, r, a, h, l, u = !1;
  3330. if (!this._pxBounds.contains(t)) return !1;
  3331. for (s = 0, h = this._parts.length; s < h; s++) for (e = this._parts[s], r = 0, l = e.length, a = l - 1; r < l; a = r++) i = e[r], n = e[a], i.y > t.y != n.y > t.y && t.x < (n.x - i.x) * (t.y - i.y) / (n.y - i.y) + i.x && (u = !u);
  3332. return u || o.Polyline.prototype._containsPoint.call(this, t, !0)
  3333. }, o.CircleMarker.prototype._containsPoint = function(t) {
  3334. return t.distanceTo(this._point) <= this._radius + this._clickTolerance()
  3335. }, o.GeoJSON = o.FeatureGroup.extend({
  3336. initialize: function(t, e) {
  3337. o.setOptions(this, e), this._layers = {}, t && this.addData(t)
  3338. },
  3339. addData: function(t) {
  3340. var e, i, n, s = o.Util.isArray(t) ? t : t.features;
  3341. if (s) {
  3342. for (e = 0, i = s.length; e < i; e++) n = s[e], (n.geometries || n.geometry || n.features || n.coordinates) && this.addData(n);
  3343. return this
  3344. }
  3345. var r = this.options;
  3346. if (r.filter && !r.filter(t)) return this;
  3347. var a = o.GeoJSON.geometryToLayer(t, r);
  3348. return a ? (a.feature = o.GeoJSON.asFeature(t), a.defaultOptions = a.options, this.resetStyle(a), r.onEachFeature && r.onEachFeature(t, a), this.addLayer(a)) : this
  3349. },
  3350. resetStyle: function(t) {
  3351. return t.options = o.Util.extend({}, t.defaultOptions), this._setLayerStyle(t, this.options.style), this
  3352. },
  3353. setStyle: function(t) {
  3354. return this.eachLayer(function(e) {
  3355. this._setLayerStyle(e, t)
  3356. }, this)
  3357. },
  3358. _setLayerStyle: function(t, e) {
  3359. "function" == typeof e && (e = e(t.feature)), t.setStyle && t.setStyle(e)
  3360. }
  3361. }), o.extend(o.GeoJSON, {
  3362. geometryToLayer: function(t, e) {
  3363. var i, n, s, r, a = "Feature" === t.type ? t.geometry : t,
  3364. h = a ? a.coordinates : null,
  3365. l = [],
  3366. u = e && e.pointToLayer,
  3367. c = e && e.coordsToLatLng || this.coordsToLatLng;
  3368. if (!h && !a) return null;
  3369. switch (a.type) {
  3370. case "Point":
  3371. return i = c(h), u ? u(t, i) : new o.Marker(i);
  3372. case "MultiPoint":
  3373. for (s = 0, r = h.length; s < r; s++) i = c(h[s]), l.push(u ? u(t, i) : new o.Marker(i));
  3374. return new o.FeatureGroup(l);
  3375. case "LineString":
  3376. case "MultiLineString":
  3377. return n = this.coordsToLatLngs(h, "LineString" === a.type ? 0 : 1, c), new o.Polyline(n, e);
  3378. case "Polygon":
  3379. case "MultiPolygon":
  3380. return n = this.coordsToLatLngs(h, "Polygon" === a.type ? 1 : 2, c), new o.Polygon(n, e);
  3381. case "GeometryCollection":
  3382. for (s = 0, r = a.geometries.length; s < r; s++) {
  3383. var d = this.geometryToLayer({
  3384. geometry: a.geometries[s],
  3385. type: "Feature",
  3386. properties: t.properties
  3387. }, e);
  3388. d && l.push(d)
  3389. }
  3390. return new o.FeatureGroup(l);
  3391. default:
  3392. throw new Error("Invalid GeoJSON object.")
  3393. }
  3394. },
  3395. coordsToLatLng: function(t) {
  3396. return new o.LatLng(t[1], t[0], t[2])
  3397. },
  3398. coordsToLatLngs: function(t, e, i) {
  3399. for (var n, o = [], s = 0, r = t.length; s < r; s++) n = e ? this.coordsToLatLngs(t[s], e - 1, i) : (i || this.coordsToLatLng)(t[s]), o.push(n);
  3400. return o
  3401. },
  3402. latLngToCoords: function(t) {
  3403. return t.alt !== i ? [t.lng, t.lat, t.alt] : [t.lng, t.lat]
  3404. },
  3405. latLngsToCoords: function(t, e, i) {
  3406. for (var n = [], s = 0, r = t.length; s < r; s++) n.push(e ? o.GeoJSON.latLngsToCoords(t[s], e - 1, i) : o.GeoJSON.latLngToCoords(t[s]));
  3407. return !e && i && n.push(n[0]), n
  3408. },
  3409. getFeature: function(t, e) {
  3410. return t.feature ? o.extend({}, t.feature, {
  3411. geometry: e
  3412. }) : o.GeoJSON.asFeature(e)
  3413. },
  3414. asFeature: function(t) {
  3415. return "Feature" === t.type || "FeatureCollection" === t.type ? t : {
  3416. type: "Feature",
  3417. properties: {},
  3418. geometry: t
  3419. }
  3420. }
  3421. });
  3422. var a = {
  3423. toGeoJSON: function() {
  3424. return o.GeoJSON.getFeature(this, {
  3425. type: "Point",
  3426. coordinates: o.GeoJSON.latLngToCoords(this.getLatLng())
  3427. })
  3428. }
  3429. };
  3430. o.Marker.include(a), o.Circle.include(a), o.CircleMarker.include(a), o.Polyline.prototype.toGeoJSON = function() {
  3431. var t = !o.Polyline._flat(this._latlngs),
  3432. e = o.GeoJSON.latLngsToCoords(this._latlngs, t ? 1 : 0);
  3433. return o.GeoJSON.getFeature(this, {
  3434. type: (t ? "Multi" : "") + "LineString",
  3435. coordinates: e
  3436. })
  3437. }, o.Polygon.prototype.toGeoJSON = function() {
  3438. var t = !o.Polyline._flat(this._latlngs),
  3439. e = t && !o.Polyline._flat(this._latlngs[0]),
  3440. i = o.GeoJSON.latLngsToCoords(this._latlngs, e ? 2 : t ? 1 : 0, !0);
  3441. return t || (i = [i]), o.GeoJSON.getFeature(this, {
  3442. type: (e ? "Multi" : "") + "Polygon",
  3443. coordinates: i
  3444. })
  3445. }, o.LayerGroup.include({
  3446. toMultiPoint: function() {
  3447. var t = [];
  3448. return this.eachLayer(function(e) {
  3449. t.push(e.toGeoJSON().geometry.coordinates)
  3450. }), o.GeoJSON.getFeature(this, {
  3451. type: "MultiPoint",
  3452. coordinates: t
  3453. })
  3454. },
  3455. toGeoJSON: function() {
  3456. var t = this.feature && this.feature.geometry && this.feature.geometry.type;
  3457. if ("MultiPoint" === t) return this.toMultiPoint();
  3458. var e = "GeometryCollection" === t,
  3459. i = [];
  3460. return this.eachLayer(function(t) {
  3461. if (t.toGeoJSON) {
  3462. var n = t.toGeoJSON();
  3463. i.push(e ? n.geometry : o.GeoJSON.asFeature(n))
  3464. }
  3465. }), e ? o.GeoJSON.getFeature(this, {
  3466. geometries: i,
  3467. type: "GeometryCollection"
  3468. }) : {
  3469. type: "FeatureCollection",
  3470. features: i
  3471. }
  3472. }
  3473. }), o.geoJSON = function(t, e) {
  3474. return new o.GeoJSON(t, e)
  3475. }, o.geoJson = o.geoJSON, o.Draggable = o.Evented.extend({
  3476. options: {
  3477. clickTolerance: 3
  3478. },
  3479. statics: {
  3480. START: o.Browser.touch ? ["touchstart", "mousedown"] : ["mousedown"],
  3481. END: {
  3482. mousedown: "mouseup",
  3483. touchstart: "touchend",
  3484. pointerdown: "touchend",
  3485. MSPointerDown: "touchend"
  3486. },
  3487. MOVE: {
  3488. mousedown: "mousemove",
  3489. touchstart: "touchmove",
  3490. pointerdown: "touchmove",
  3491. MSPointerDown: "touchmove"
  3492. }
  3493. },
  3494. initialize: function(t, e, i) {
  3495. this._element = t, this._dragStartTarget = e || t, this._preventOutline = i
  3496. },
  3497. enable: function() {
  3498. this._enabled || (o.DomEvent.on(this._dragStartTarget, o.Draggable.START.join(" "), this._onDown, this), this._enabled = !0)
  3499. },
  3500. disable: function() {
  3501. this._enabled && (o.Draggable._dragging === this && this.finishDrag(), o.DomEvent.off(this._dragStartTarget, o.Draggable.START.join(" "), this._onDown, this), this._enabled = !1, this._moved = !1)
  3502. },
  3503. _onDown: function(t) {
  3504. if (!t._simulated && this._enabled && (this._moved = !1, !o.DomUtil.hasClass(this._element, "leaflet-zoom-anim") && !(o.Draggable._dragging || t.shiftKey || 1 !== t.which && 1 !== t.button && !t.touches || (o.Draggable._dragging = this, this._preventOutline && o.DomUtil.preventOutline(this._element), o.DomUtil.disableImageDrag(), o.DomUtil.disableTextSelection(), this._moving)))) {
  3505. this.fire("down");
  3506. var i = t.touches ? t.touches[0] : t;
  3507. this._startPoint = new o.Point(i.clientX, i.clientY), o.DomEvent.on(e, o.Draggable.MOVE[t.type], this._onMove, this).on(e, o.Draggable.END[t.type], this._onUp, this)
  3508. }
  3509. },
  3510. _onMove: function(i) {
  3511. if (!i._simulated && this._enabled) {
  3512. if (i.touches && i.touches.length > 1) return void(this._moved = !0);
  3513. var n = i.touches && 1 === i.touches.length ? i.touches[0] : i,
  3514. s = new o.Point(n.clientX, n.clientY),
  3515. r = s.subtract(this._startPoint);
  3516. (r.x || r.y) && (Math.abs(r.x) + Math.abs(r.y) < this.options.clickTolerance || (o.DomEvent.preventDefault(i), this._moved || (this.fire("dragstart"), this._moved = !0, this._startPos = o.DomUtil.getPosition(this._element).subtract(r), o.DomUtil.addClass(e.body, "leaflet-dragging"), this._lastTarget = i.target || i.srcElement, t.SVGElementInstance && this._lastTarget instanceof SVGElementInstance && (this._lastTarget = this._lastTarget.correspondingUseElement), o.DomUtil.addClass(this._lastTarget, "leaflet-drag-target")), this._newPos = this._startPos.add(r), this._moving = !0, o.Util.cancelAnimFrame(this._animRequest), this._lastEvent = i, this._animRequest = o.Util.requestAnimFrame(this._updatePosition, this, !0)))
  3517. }
  3518. },
  3519. _updatePosition: function() {
  3520. var t = {
  3521. originalEvent: this._lastEvent
  3522. };
  3523. this.fire("predrag", t), o.DomUtil.setPosition(this._element, this._newPos), this.fire("drag", t)
  3524. },
  3525. _onUp: function(t) {
  3526. !t._simulated && this._enabled && this.finishDrag()
  3527. },
  3528. finishDrag: function() {
  3529. o.DomUtil.removeClass(e.body, "leaflet-dragging"), this._lastTarget && (o.DomUtil.removeClass(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null);
  3530. for (var t in o.Draggable.MOVE) o.DomEvent.off(e, o.Draggable.MOVE[t], this._onMove, this).off(e, o.Draggable.END[t], this._onUp, this);
  3531. o.DomUtil.enableImageDrag(), o.DomUtil.enableTextSelection(), this._moved && this._moving && (o.Util.cancelAnimFrame(this._animRequest), this.fire("dragend", {
  3532. distance: this._newPos.distanceTo(this._startPos)
  3533. })), this._moving = !1, o.Draggable._dragging = !1
  3534. }
  3535. }), o.Handler = o.Class.extend({
  3536. initialize: function(t) {
  3537. this._map = t
  3538. },
  3539. enable: function() {
  3540. return this._enabled ? this : (this._enabled = !0, this.addHooks(), this)
  3541. },
  3542. disable: function() {
  3543. return this._enabled ? (this._enabled = !1, this.removeHooks(), this) : this
  3544. },
  3545. enabled: function() {
  3546. return !!this._enabled
  3547. }
  3548. }), o.Map.mergeOptions({
  3549. dragging: !0,
  3550. inertia: !o.Browser.android23,
  3551. inertiaDeceleration: 3400,
  3552. inertiaMaxSpeed: 1 / 0,
  3553. easeLinearity: .2,
  3554. worldCopyJump: !1,
  3555. maxBoundsViscosity: 0
  3556. }), o.Map.Drag = o.Handler.extend({
  3557. addHooks: function() {
  3558. if (!this._draggable) {
  3559. var t = this._map;
  3560. this._draggable = new o.Draggable(t._mapPane, t._container), this._draggable.on({
  3561. down: this._onDown,
  3562. dragstart: this._onDragStart,
  3563. drag: this._onDrag,
  3564. dragend: this._onDragEnd
  3565. }, this), this._draggable.on("predrag", this._onPreDragLimit, this), t.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDragWrap, this), t.on("zoomend", this._onZoomEnd, this), t.whenReady(this._onZoomEnd, this))
  3566. }
  3567. o.DomUtil.addClass(this._map._container, "leaflet-grab leaflet-touch-drag"), this._draggable.enable(), this._positions = [], this._times = []
  3568. },
  3569. removeHooks: function() {
  3570. o.DomUtil.removeClass(this._map._container, "leaflet-grab"), o.DomUtil.removeClass(this._map._container, "leaflet-touch-drag"), this._draggable.disable()
  3571. },
  3572. moved: function() {
  3573. return this._draggable && this._draggable._moved
  3574. },
  3575. moving: function() {
  3576. return this._draggable && this._draggable._moving
  3577. },
  3578. _onDown: function() {
  3579. this._map._stop()
  3580. },
  3581. _onDragStart: function() {
  3582. var t = this._map;
  3583. if (this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {
  3584. var e = o.latLngBounds(this._map.options.maxBounds);
  3585. this._offsetLimit = o.bounds(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1), this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())), this._viscosity = Math.min(1, Math.max(0, this._map.options.maxBoundsViscosity))
  3586. } else this._offsetLimit = null;
  3587. t.fire("movestart").fire("dragstart"), t.options.inertia && (this._positions = [], this._times = [])
  3588. },
  3589. _onDrag: function(t) {
  3590. if (this._map.options.inertia) {
  3591. var e = this._lastTime = +new Date,
  3592. i = this._lastPos = this._draggable._absPos || this._draggable._newPos;
  3593. this._positions.push(i), this._times.push(e), e - this._times[0] > 50 && (this._positions.shift(), this._times.shift())
  3594. }
  3595. this._map.fire("move", t).fire("drag", t)
  3596. },
  3597. _onZoomEnd: function() {
  3598. var t = this._map.getSize().divideBy(2),
  3599. e = this._map.latLngToLayerPoint([0, 0]);
  3600. this._initialWorldOffset = e.subtract(t).x, this._worldWidth = this._map.getPixelWorldBounds().getSize().x
  3601. },
  3602. _viscousLimit: function(t, e) {
  3603. return t - (t - e) * this._viscosity
  3604. },
  3605. _onPreDragLimit: function() {
  3606. if (this._viscosity && this._offsetLimit) {
  3607. var t = this._draggable._newPos.subtract(this._draggable._startPos),
  3608. e = this._offsetLimit;
  3609. t.x < e.min.x && (t.x = this._viscousLimit(t.x, e.min.x)), t.y < e.min.y && (t.y = this._viscousLimit(t.y, e.min.y)), t.x > e.max.x && (t.x = this._viscousLimit(t.x, e.max.x)), t.y > e.max.y && (t.y = this._viscousLimit(t.y, e.max.y)), this._draggable._newPos = this._draggable._startPos.add(t)
  3610. }
  3611. },
  3612. _onPreDragWrap: function() {
  3613. var t = this._worldWidth,
  3614. e = Math.round(t / 2),
  3615. i = this._initialWorldOffset,
  3616. n = this._draggable._newPos.x,
  3617. o = (n - e + i) % t + e - i,
  3618. s = (n + e + i) % t - e - i,
  3619. r = Math.abs(o + i) < Math.abs(s + i) ? o : s;
  3620. this._draggable._absPos = this._draggable._newPos.clone(), this._draggable._newPos.x = r
  3621. },
  3622. _onDragEnd: function(t) {
  3623. var e = this._map,
  3624. i = e.options,
  3625. n = !i.inertia || this._times.length < 2;
  3626. if (e.fire("dragend", t), n) e.fire("moveend");
  3627. else {
  3628. var s = this._lastPos.subtract(this._positions[0]),
  3629. r = (this._lastTime - this._times[0]) / 1e3,
  3630. a = i.easeLinearity,
  3631. h = s.multiplyBy(a / r),
  3632. l = h.distanceTo([0, 0]),
  3633. u = Math.min(i.inertiaMaxSpeed, l),
  3634. c = h.multiplyBy(u / l),
  3635. d = u / (i.inertiaDeceleration * a),
  3636. _ = c.multiplyBy(-d / 2).round();
  3637. _.x || _.y ? (_ = e._limitOffset(_, e.options.maxBounds), o.Util.requestAnimFrame(function() {
  3638. e.panBy(_, {
  3639. duration: d,
  3640. easeLinearity: a,
  3641. noMoveStart: !0,
  3642. animate: !0
  3643. })
  3644. })) : e.fire("moveend")
  3645. }
  3646. }
  3647. }), o.Map.addInitHook("addHandler", "dragging", o.Map.Drag), o.Map.mergeOptions({
  3648. doubleClickZoom: !0
  3649. }), o.Map.DoubleClickZoom = o.Handler.extend({
  3650. addHooks: function() {
  3651. this._map.on("dblclick", this._onDoubleClick, this)
  3652. },
  3653. removeHooks: function() {
  3654. this._map.off("dblclick", this._onDoubleClick, this)
  3655. },
  3656. _onDoubleClick: function(t) {
  3657. var e = this._map,
  3658. i = e.getZoom(),
  3659. n = e.options.zoomDelta,
  3660. o = t.originalEvent.shiftKey ? i - n : i + n;
  3661. "center" === e.options.doubleClickZoom ? e.setZoom(o) : e.setZoomAround(t.containerPoint, o)
  3662. }
  3663. }), o.Map.addInitHook("addHandler", "doubleClickZoom", o.Map.DoubleClickZoom), o.Map.mergeOptions({
  3664. scrollWheelZoom: !0,
  3665. wheelDebounceTime: 40,
  3666. wheelPxPerZoomLevel: 60
  3667. }), o.Map.ScrollWheelZoom = o.Handler.extend({
  3668. addHooks: function() {
  3669. o.DomEvent.on(this._map._container, "mousewheel", this._onWheelScroll, this), this._delta = 0
  3670. },
  3671. removeHooks: function() {
  3672. o.DomEvent.off(this._map._container, "mousewheel", this._onWheelScroll, this)
  3673. },
  3674. _onWheelScroll: function(t) {
  3675. var e = o.DomEvent.getWheelDelta(t),
  3676. i = this._map.options.wheelDebounceTime;
  3677. this._delta += e, this._lastMousePos = this._map.mouseEventToContainerPoint(t), this._startTime || (this._startTime = +new Date);
  3678. var n = Math.max(i - (+new Date - this._startTime), 0);
  3679. clearTimeout(this._timer), this._timer = setTimeout(o.bind(this._performZoom, this), n), o.DomEvent.stop(t)
  3680. },
  3681. _performZoom: function() {
  3682. var t = this._map,
  3683. e = t.getZoom(),
  3684. i = this._map.options.zoomSnap || 0;
  3685. t._stop();
  3686. var n = this._delta / (4 * this._map.options.wheelPxPerZoomLevel),
  3687. o = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(n)))) / Math.LN2,
  3688. s = i ? Math.ceil(o / i) * i : o,
  3689. r = t._limitZoom(e + (this._delta > 0 ? s : -s)) - e;
  3690. this._delta = 0, this._startTime = null, r && ("center" === t.options.scrollWheelZoom ? t.setZoom(e + r) : t.setZoomAround(this._lastMousePos, e + r))
  3691. }
  3692. }), o.Map.addInitHook("addHandler", "scrollWheelZoom", o.Map.ScrollWheelZoom), o.extend(o.DomEvent, {
  3693. _touchstart: o.Browser.msPointer ? "MSPointerDown" : o.Browser.pointer ? "pointerdown" : "touchstart",
  3694. _touchend: o.Browser.msPointer ? "MSPointerUp" : o.Browser.pointer ? "pointerup" : "touchend",
  3695. addDoubleTapListener: function(t, e, i) {
  3696. function n(t) {
  3697. var e;
  3698. if (e = o.Browser.pointer ? o.DomEvent._pointersCount : t.touches.length, !(e > 1)) {
  3699. var i = Date.now(),
  3700. n = i - (r || i);
  3701. a = t.touches ? t.touches[0] : t, h = n > 0 && n <= l, r = i
  3702. }
  3703. }
  3704. function s() {
  3705. if (h && !a.cancelBubble) {
  3706. if (o.Browser.pointer) {
  3707. var t, i, n = {};
  3708. for (i in a) t = a[i], n[i] = t && t.bind ? t.bind(a) : t;
  3709. a = n
  3710. }
  3711. a.type = "dblclick", e(a), r = null
  3712. }
  3713. }
  3714. var r, a, h = !1,
  3715. l = 250,
  3716. u = "_leaflet_",
  3717. c = this._touchstart,
  3718. d = this._touchend;
  3719. return t[u + c + i] = n, t[u + d + i] = s, t[u + "dblclick" + i] = e, t.addEventListener(c, n, !1), t.addEventListener(d, s, !1), o.Browser.edge || t.addEventListener("dblclick", e, !1), this
  3720. },
  3721. removeDoubleTapListener: function(t, e) {
  3722. var i = "_leaflet_",
  3723. n = t[i + this._touchstart + e],
  3724. s = t[i + this._touchend + e],
  3725. r = t[i + "dblclick" + e];
  3726. return t.removeEventListener(this._touchstart, n, !1), t.removeEventListener(this._touchend, s, !1), o.Browser.edge || t.removeEventListener("dblclick", r, !1), this
  3727. }
  3728. }), o.extend(o.DomEvent, {
  3729. POINTER_DOWN: o.Browser.msPointer ? "MSPointerDown" : "pointerdown",
  3730. POINTER_MOVE: o.Browser.msPointer ? "MSPointerMove" : "pointermove",
  3731. POINTER_UP: o.Browser.msPointer ? "MSPointerUp" : "pointerup",
  3732. POINTER_CANCEL: o.Browser.msPointer ? "MSPointerCancel" : "pointercancel",
  3733. TAG_WHITE_LIST: ["INPUT", "SELECT", "OPTION"],
  3734. _pointers: {},
  3735. _pointersCount: 0,
  3736. addPointerListener: function(t, e, i, n) {
  3737. return "touchstart" === e ? this._addPointerStart(t, i, n) : "touchmove" === e ? this._addPointerMove(t, i, n) : "touchend" === e && this._addPointerEnd(t, i, n), this
  3738. },
  3739. removePointerListener: function(t, e, i) {
  3740. var n = t["_leaflet_" + e + i];
  3741. return "touchstart" === e ? t.removeEventListener(this.POINTER_DOWN, n, !1) : "touchmove" === e ? t.removeEventListener(this.POINTER_MOVE, n, !1) : "touchend" === e && (t.removeEventListener(this.POINTER_UP, n, !1), t.removeEventListener(this.POINTER_CANCEL, n, !1)), this
  3742. },
  3743. _addPointerStart: function(t, i, n) {
  3744. var s = o.bind(function(t) {
  3745. if ("mouse" !== t.pointerType && t.pointerType !== t.MSPOINTER_TYPE_MOUSE) {
  3746. if (!(this.TAG_WHITE_LIST.indexOf(t.target.tagName) < 0)) return;
  3747. o.DomEvent.preventDefault(t)
  3748. }
  3749. this._handlePointer(t, i)
  3750. }, this);
  3751. if (t["_leaflet_touchstart" + n] = s, t.addEventListener(this.POINTER_DOWN, s, !1), !this._pointerDocListener) {
  3752. var r = o.bind(this._globalPointerUp, this);
  3753. e.documentElement.addEventListener(this.POINTER_DOWN, o.bind(this._globalPointerDown, this), !0), e.documentElement.addEventListener(this.POINTER_MOVE, o.bind(this._globalPointerMove, this), !0), e.documentElement.addEventListener(this.POINTER_UP, r, !0), e.documentElement.addEventListener(this.POINTER_CANCEL, r, !0), this._pointerDocListener = !0
  3754. }
  3755. },
  3756. _globalPointerDown: function(t) {
  3757. this._pointers[t.pointerId] = t, this._pointersCount++
  3758. },
  3759. _globalPointerMove: function(t) {
  3760. this._pointers[t.pointerId] && (this._pointers[t.pointerId] = t)
  3761. },
  3762. _globalPointerUp: function(t) {
  3763. delete this._pointers[t.pointerId], this._pointersCount--
  3764. },
  3765. _handlePointer: function(t, e) {
  3766. t.touches = [];
  3767. for (var i in this._pointers) t.touches.push(this._pointers[i]);
  3768. t.changedTouches = [t], e(t)
  3769. },
  3770. _addPointerMove: function(t, e, i) {
  3771. var n = o.bind(function(t) {
  3772. (t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType || 0 !== t.buttons) && this._handlePointer(t, e)
  3773. }, this);
  3774. t["_leaflet_touchmove" + i] = n, t.addEventListener(this.POINTER_MOVE, n, !1)
  3775. },
  3776. _addPointerEnd: function(t, e, i) {
  3777. var n = o.bind(function(t) {
  3778. this._handlePointer(t, e)
  3779. }, this);
  3780. t["_leaflet_touchend" + i] = n, t.addEventListener(this.POINTER_UP, n, !1), t.addEventListener(this.POINTER_CANCEL, n, !1)
  3781. }
  3782. }), o.Map.mergeOptions({
  3783. touchZoom: o.Browser.touch && !o.Browser.android23,
  3784. bounceAtZoomLimits: !0
  3785. }), o.Map.TouchZoom = o.Handler.extend({
  3786. addHooks: function() {
  3787. o.DomUtil.addClass(this._map._container, "leaflet-touch-zoom"), o.DomEvent.on(this._map._container, "touchstart", this._onTouchStart, this)
  3788. },
  3789. removeHooks: function() {
  3790. o.DomUtil.removeClass(this._map._container, "leaflet-touch-zoom"), o.DomEvent.off(this._map._container, "touchstart", this._onTouchStart, this)
  3791. },
  3792. _onTouchStart: function(t) {
  3793. var i = this._map;
  3794. if (t.touches && 2 === t.touches.length && !i._animatingZoom && !this._zooming) {
  3795. var n = i.mouseEventToContainerPoint(t.touches[0]),
  3796. s = i.mouseEventToContainerPoint(t.touches[1]);
  3797. this._centerPoint = i.getSize()._divideBy(2), this._startLatLng = i.containerPointToLatLng(this._centerPoint), "center" !== i.options.touchZoom && (this._pinchStartLatLng = i.containerPointToLatLng(n.add(s)._divideBy(2))), this._startDist = n.distanceTo(s), this._startZoom = i.getZoom(), this._moved = !1, this._zooming = !0, i._stop(), o.DomEvent.on(e, "touchmove", this._onTouchMove, this).on(e, "touchend", this._onTouchEnd, this), o.DomEvent.preventDefault(t)
  3798. }
  3799. },
  3800. _onTouchMove: function(t) {
  3801. if (t.touches && 2 === t.touches.length && this._zooming) {
  3802. var e = this._map,
  3803. i = e.mouseEventToContainerPoint(t.touches[0]),
  3804. n = e.mouseEventToContainerPoint(t.touches[1]),
  3805. s = i.distanceTo(n) / this._startDist;
  3806. if (this._zoom = e.getScaleZoom(s, this._startZoom), !e.options.bounceAtZoomLimits && (this._zoom < e.getMinZoom() && s < 1 || this._zoom > e.getMaxZoom() && s > 1) && (this._zoom = e._limitZoom(this._zoom)), "center" === e.options.touchZoom) {
  3807. if (this._center = this._startLatLng, 1 === s) return
  3808. } else {
  3809. var r = i._add(n)._divideBy(2)._subtract(this._centerPoint);
  3810. if (1 === s && 0 === r.x && 0 === r.y) return;
  3811. this._center = e.unproject(e.project(this._pinchStartLatLng, this._zoom).subtract(r), this._zoom)
  3812. }
  3813. this._moved || (e._moveStart(!0), this._moved = !0), o.Util.cancelAnimFrame(this._animRequest);
  3814. var a = o.bind(e._move, e, this._center, this._zoom, {
  3815. pinch: !0,
  3816. round: !1
  3817. });
  3818. this._animRequest = o.Util.requestAnimFrame(a, this, !0), o.DomEvent.preventDefault(t)
  3819. }
  3820. },
  3821. _onTouchEnd: function() {
  3822. return this._moved && this._zooming ? (this._zooming = !1, o.Util.cancelAnimFrame(this._animRequest), o.DomEvent.off(e, "touchmove", this._onTouchMove).off(e, "touchend", this._onTouchEnd), void(this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), !0, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom)))) : void(this._zooming = !1)
  3823. }
  3824. }), o.Map.addInitHook("addHandler", "touchZoom", o.Map.TouchZoom), o.Map.mergeOptions({
  3825. tap: !0,
  3826. tapTolerance: 15
  3827. }), o.Map.Tap = o.Handler.extend({
  3828. addHooks: function() {
  3829. o.DomEvent.on(this._map._container, "touchstart", this._onDown, this)
  3830. },
  3831. removeHooks: function() {
  3832. o.DomEvent.off(this._map._container, "touchstart", this._onDown, this)
  3833. },
  3834. _onDown: function(t) {
  3835. if (t.touches) {
  3836. if (o.DomEvent.preventDefault(t), this._fireClick = !0, t.touches.length > 1) return this._fireClick = !1, void clearTimeout(this._holdTimeout);
  3837. var i = t.touches[0],
  3838. n = i.target;
  3839. this._startPos = this._newPos = new o.Point(i.clientX, i.clientY), n.tagName && "a" === n.tagName.toLowerCase() && o.DomUtil.addClass(n, "leaflet-active"), this._holdTimeout = setTimeout(o.bind(function() {
  3840. this._isTapValid() && (this._fireClick = !1, this._onUp(), this._simulateEvent("contextmenu", i))
  3841. }, this), 1e3), this._simulateEvent("mousedown", i), o.DomEvent.on(e, {
  3842. touchmove: this._onMove,
  3843. touchend: this._onUp
  3844. }, this)
  3845. }
  3846. },
  3847. _onUp: function(t) {
  3848. if (clearTimeout(this._holdTimeout), o.DomEvent.off(e, {
  3849. touchmove: this._onMove,
  3850. touchend: this._onUp
  3851. }, this), this._fireClick && t && t.changedTouches) {
  3852. var i = t.changedTouches[0],
  3853. n = i.target;
  3854. n && n.tagName && "a" === n.tagName.toLowerCase() && o.DomUtil.removeClass(n, "leaflet-active"), this._simulateEvent("mouseup", i), this._isTapValid() && this._simulateEvent("click", i)
  3855. }
  3856. },
  3857. _isTapValid: function() {
  3858. return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance
  3859. },
  3860. _onMove: function(t) {
  3861. var e = t.touches[0];
  3862. this._newPos = new o.Point(e.clientX, e.clientY), this._simulateEvent("mousemove", e)
  3863. },
  3864. _simulateEvent: function(i, n) {
  3865. var o = e.createEvent("MouseEvents");
  3866. o._simulated = !0, n.target._simulatedClick = !0, o.initMouseEvent(i, !0, !0, t, 1, n.screenX, n.screenY, n.clientX, n.clientY, !1, !1, !1, !1, 0, null), n.target.dispatchEvent(o)
  3867. }
  3868. }), o.Browser.touch && !o.Browser.pointer && o.Map.addInitHook("addHandler", "tap", o.Map.Tap), o.Map.mergeOptions({
  3869. boxZoom: !0
  3870. }), o.Map.BoxZoom = o.Handler.extend({
  3871. initialize: function(t) {
  3872. this._map = t, this._container = t._container, this._pane = t._panes.overlayPane
  3873. },
  3874. addHooks: function() {
  3875. o.DomEvent.on(this._container, "mousedown", this._onMouseDown, this)
  3876. },
  3877. removeHooks: function() {
  3878. o.DomEvent.off(this._container, "mousedown", this._onMouseDown, this)
  3879. },
  3880. moved: function() {
  3881. return this._moved
  3882. },
  3883. _resetState: function() {
  3884. this._moved = !1
  3885. },
  3886. _onMouseDown: function(t) {
  3887. return !(!t.shiftKey || 1 !== t.which && 1 !== t.button) && (this._resetState(), o.DomUtil.disableTextSelection(), o.DomUtil.disableImageDrag(), this._startPoint = this._map.mouseEventToContainerPoint(t), void o.DomEvent.on(e, {
  3888. contextmenu: o.DomEvent.stop,
  3889. mousemove: this._onMouseMove,
  3890. mouseup: this._onMouseUp,
  3891. keydown: this._onKeyDown
  3892. }, this))
  3893. },
  3894. _onMouseMove: function(t) {
  3895. this._moved || (this._moved = !0, this._box = o.DomUtil.create("div", "leaflet-zoom-box", this._container), o.DomUtil.addClass(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
  3896. var e = new o.Bounds(this._point, this._startPoint),
  3897. i = e.getSize();
  3898. o.DomUtil.setPosition(this._box, e.min), this._box.style.width = i.x + "px", this._box.style.height = i.y + "px"
  3899. },
  3900. _finish: function() {
  3901. this._moved && (o.DomUtil.remove(this._box), o.DomUtil.removeClass(this._container, "leaflet-crosshair")), o.DomUtil.enableTextSelection(), o.DomUtil.enableImageDrag(), o.DomEvent.off(e, {
  3902. contextmenu: o.DomEvent.stop,
  3903. mousemove: this._onMouseMove,
  3904. mouseup: this._onMouseUp,
  3905. keydown: this._onKeyDown
  3906. }, this)
  3907. },
  3908. _onMouseUp: function(t) {
  3909. if ((1 === t.which || 1 === t.button) && (this._finish(), this._moved)) {
  3910. setTimeout(o.bind(this._resetState, this), 0);
  3911. var e = new o.LatLngBounds(this._map.containerPointToLatLng(this._startPoint), this._map.containerPointToLatLng(this._point));
  3912. this._map.fitBounds(e).fire("boxzoomend", {
  3913. boxZoomBounds: e
  3914. })
  3915. }
  3916. },
  3917. _onKeyDown: function(t) {
  3918. 27 === t.keyCode && this._finish()
  3919. }
  3920. }), o.Map.addInitHook("addHandler", "boxZoom", o.Map.BoxZoom), o.Map.mergeOptions({
  3921. keyboard: !0,
  3922. keyboardPanDelta: 80
  3923. }), o.Map.Keyboard = o.Handler.extend({
  3924. keyCodes: {
  3925. left: [37],
  3926. right: [39],
  3927. down: [40],
  3928. up: [38],
  3929. zoomIn: [187, 107, 61, 171],
  3930. zoomOut: [189, 109, 54, 173]
  3931. },
  3932. initialize: function(t) {
  3933. this._map = t, this._setPanDelta(t.options.keyboardPanDelta), this._setZoomDelta(t.options.zoomDelta)
  3934. },
  3935. addHooks: function() {
  3936. var t = this._map._container;
  3937. t.tabIndex <= 0 && (t.tabIndex = "0"), o.DomEvent.on(t, {
  3938. focus: this._onFocus,
  3939. blur: this._onBlur,
  3940. mousedown: this._onMouseDown
  3941. }, this), this._map.on({
  3942. focus: this._addHooks,
  3943. blur: this._removeHooks
  3944. }, this)
  3945. },
  3946. removeHooks: function() {
  3947. this._removeHooks(), o.DomEvent.off(this._map._container, {
  3948. focus: this._onFocus,
  3949. blur: this._onBlur,
  3950. mousedown: this._onMouseDown
  3951. }, this), this._map.off({
  3952. focus: this._addHooks,
  3953. blur: this._removeHooks
  3954. }, this)
  3955. },
  3956. _onMouseDown: function() {
  3957. if (!this._focused) {
  3958. var i = e.body,
  3959. n = e.documentElement,
  3960. o = i.scrollTop || n.scrollTop,
  3961. s = i.scrollLeft || n.scrollLeft;
  3962. this._map._container.focus(), t.scrollTo(s, o)
  3963. }
  3964. },
  3965. _onFocus: function() {
  3966. this._focused = !0, this._map.fire("focus")
  3967. },
  3968. _onBlur: function() {
  3969. this._focused = !1, this._map.fire("blur")
  3970. },
  3971. _setPanDelta: function(t) {
  3972. var e, i, n = this._panKeys = {},
  3973. o = this.keyCodes;
  3974. for (e = 0, i = o.left.length; e < i; e++) n[o.left[e]] = [-1 * t, 0];
  3975. for (e = 0, i = o.right.length; e < i; e++) n[o.right[e]] = [t, 0];
  3976. for (e = 0, i = o.down.length; e < i; e++) n[o.down[e]] = [0, t];
  3977. for (e = 0, i = o.up.length; e < i; e++) n[o.up[e]] = [0, -1 * t]
  3978. },
  3979. _setZoomDelta: function(t) {
  3980. var e, i, n = this._zoomKeys = {},
  3981. o = this.keyCodes;
  3982. for (e = 0, i = o.zoomIn.length; e < i; e++) n[o.zoomIn[e]] = t;
  3983. for (e = 0, i = o.zoomOut.length; e < i; e++) n[o.zoomOut[e]] = -t
  3984. },
  3985. _addHooks: function() {
  3986. o.DomEvent.on(e, "keydown", this._onKeyDown, this)
  3987. },
  3988. _removeHooks: function() {
  3989. o.DomEvent.off(e, "keydown", this._onKeyDown, this)
  3990. },
  3991. _onKeyDown: function(t) {
  3992. if (!(t.altKey || t.ctrlKey || t.metaKey)) {
  3993. var e, i = t.keyCode,
  3994. n = this._map;
  3995. if (i in this._panKeys) {
  3996. if (n._panAnim && n._panAnim._inProgress) return;
  3997. e = this._panKeys[i], t.shiftKey && (e = o.point(e).multiplyBy(3)), n.panBy(e), n.options.maxBounds && n.panInsideBounds(n.options.maxBounds)
  3998. } else if (i in this._zoomKeys) n.setZoom(n.getZoom() + (t.shiftKey ? 3 : 1) * this._zoomKeys[i]);
  3999. else {
  4000. if (27 !== i) return;
  4001. n.closePopup()
  4002. }
  4003. o.DomEvent.stop(t)
  4004. }
  4005. }
  4006. }), o.Map.addInitHook("addHandler", "keyboard", o.Map.Keyboard), o.Handler.MarkerDrag = o.Handler.extend({
  4007. initialize: function(t) {
  4008. this._marker = t
  4009. },
  4010. addHooks: function() {
  4011. var t = this._marker._icon;
  4012. this._draggable || (this._draggable = new o.Draggable(t, t, !0)), this._draggable.on({
  4013. dragstart: this._onDragStart,
  4014. drag: this._onDrag,
  4015. dragend: this._onDragEnd
  4016. }, this).enable(), o.DomUtil.addClass(t, "leaflet-marker-draggable")
  4017. },
  4018. removeHooks: function() {
  4019. this._draggable.off({
  4020. dragstart: this._onDragStart,
  4021. drag: this._onDrag,
  4022. dragend: this._onDragEnd
  4023. }, this).disable(), this._marker._icon && o.DomUtil.removeClass(this._marker._icon, "leaflet-marker-draggable")
  4024. },
  4025. moved: function() {
  4026. return this._draggable && this._draggable._moved
  4027. },
  4028. _onDragStart: function() {
  4029. this._oldLatLng = this._marker.getLatLng(), this._marker.closePopup().fire("movestart").fire("dragstart")
  4030. },
  4031. _onDrag: function(t) {
  4032. var e = this._marker,
  4033. i = e._shadow,
  4034. n = o.DomUtil.getPosition(e._icon),
  4035. s = e._map.layerPointToLatLng(n);
  4036. i && o.DomUtil.setPosition(i, n), e._latlng = s, t.latlng = s, t.oldLatLng = this._oldLatLng, e.fire("move", t).fire("drag", t)
  4037. },
  4038. _onDragEnd: function(t) {
  4039. delete this._oldLatLng, this._marker.fire("moveend").fire("dragend", t)
  4040. }
  4041. }), o.Control = o.Class.extend({
  4042. options: {
  4043. position: "topright"
  4044. },
  4045. initialize: function(t) {
  4046. o.setOptions(this, t)
  4047. },
  4048. getPosition: function() {
  4049. return this.options.position
  4050. },
  4051. setPosition: function(t) {
  4052. var e = this._map;
  4053. return e && e.removeControl(this), this.options.position = t, e && e.addControl(this), this
  4054. },
  4055. getContainer: function() {
  4056. return this._container
  4057. },
  4058. addTo: function(t) {
  4059. this.remove(), this._map = t;
  4060. var e = this._container = this.onAdd(t),
  4061. i = this.getPosition(),
  4062. n = t._controlCorners[i];
  4063. return o.DomUtil.addClass(e, "leaflet-control"), i.indexOf("bottom") !== -1 ? n.insertBefore(e, n.firstChild) : n.appendChild(e), this
  4064. },
  4065. remove: function() {
  4066. return this._map ? (o.DomUtil.remove(this._container), this.onRemove && this.onRemove(this._map), this._map = null, this) : this
  4067. },
  4068. _refocusOnMap: function(t) {
  4069. this._map && t && t.screenX > 0 && t.screenY > 0 && this._map.getContainer().focus()
  4070. }
  4071. }), o.control = function(t) {
  4072. return new o.Control(t)
  4073. }, o.Map.include({
  4074. addControl: function(t) {
  4075. return t.addTo(this), this
  4076. },
  4077. removeControl: function(t) {
  4078. return t.remove(), this
  4079. },
  4080. _initControlPos: function() {
  4081. function t(t, s) {
  4082. var r = i + t + " " + i + s;
  4083. e[t + s] = o.DomUtil.create("div", r, n)
  4084. }
  4085. var e = this._controlCorners = {},
  4086. i = "leaflet-",
  4087. n = this._controlContainer = o.DomUtil.create("div", i + "control-container", this._container);
  4088. t("top", "left"), t("top", "right"), t("bottom", "left"), t("bottom", "right")
  4089. },
  4090. _clearControlPos: function() {
  4091. o.DomUtil.remove(this._controlContainer)
  4092. }
  4093. }), o.Control.Zoom = o.Control.extend({
  4094. options: {
  4095. position: "topleft",
  4096. zoomInText: "+",
  4097. zoomInTitle: "Zoom in",
  4098. zoomOutText: "-",
  4099. zoomOutTitle: "Zoom out"
  4100. },
  4101. onAdd: function(t) {
  4102. var e = "leaflet-control-zoom",
  4103. i = o.DomUtil.create("div", e + " leaflet-bar"),
  4104. n = this.options;
  4105. return this._zoomInButton = this._createButton(n.zoomInText, n.zoomInTitle, e + "-in", i, this._zoomIn), this._zoomOutButton = this._createButton(n.zoomOutText, n.zoomOutTitle, e + "-out", i, this._zoomOut), this._updateDisabled(), t.on("zoomend zoomlevelschange", this._updateDisabled, this), i
  4106. },
  4107. onRemove: function(t) {
  4108. t.off("zoomend zoomlevelschange", this._updateDisabled, this)
  4109. },
  4110. disable: function() {
  4111. return this._disabled = !0, this._updateDisabled(), this
  4112. },
  4113. enable: function() {
  4114. return this._disabled = !1, this._updateDisabled(), this
  4115. },
  4116. _zoomIn: function(t) {
  4117. !this._disabled && this._map._zoom < this._map.getMaxZoom() && this._map.zoomIn(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1))
  4118. },
  4119. _zoomOut: function(t) {
  4120. !this._disabled && this._map._zoom > this._map.getMinZoom() && this._map.zoomOut(this._map.options.zoomDelta * (t.shiftKey ? 3 : 1))
  4121. },
  4122. _createButton: function(t, e, i, n, s) {
  4123. var r = o.DomUtil.create("a", i, n);
  4124. return r.innerHTML = t, r.href = "#", r.title = e, r.setAttribute("role", "button"), r.setAttribute("aria-label", e), o.DomEvent.on(r, "mousedown dblclick", o.DomEvent.stopPropagation).on(r, "click", o.DomEvent.stop).on(r, "click", s, this).on(r, "click", this._refocusOnMap, this), r
  4125. },
  4126. _updateDisabled: function() {
  4127. var t = this._map,
  4128. e = "leaflet-disabled";
  4129. o.DomUtil.removeClass(this._zoomInButton, e), o.DomUtil.removeClass(this._zoomOutButton, e), (this._disabled || t._zoom === t.getMinZoom()) && o.DomUtil.addClass(this._zoomOutButton, e), (this._disabled || t._zoom === t.getMaxZoom()) && o.DomUtil.addClass(this._zoomInButton, e)
  4130. }
  4131. }), o.Map.mergeOptions({
  4132. zoomControl: !0
  4133. }), o.Map.addInitHook(function() {
  4134. this.options.zoomControl && (this.zoomControl = new o.Control.Zoom, this.addControl(this.zoomControl))
  4135. }), o.control.zoom = function(t) {
  4136. return new o.Control.Zoom(t)
  4137. }, o.Control.Attribution = o.Control.extend({
  4138. options: {
  4139. position: "bottomright",
  4140. prefix: '<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'
  4141. },
  4142. initialize: function(t) {
  4143. o.setOptions(this, t), this._attributions = {}
  4144. },
  4145. onAdd: function(t) {
  4146. t.attributionControl = this, this._container = o.DomUtil.create("div", "leaflet-control-attribution"), o.DomEvent && o.DomEvent.disableClickPropagation(this._container);
  4147. for (var e in t._layers) t._layers[e].getAttribution && this.addAttribution(t._layers[e].getAttribution());
  4148. return this._update(), this._container
  4149. },
  4150. setPrefix: function(t) {
  4151. return this.options.prefix = t, this._update(), this
  4152. },
  4153. addAttribution: function(t) {
  4154. return t ? (this._attributions[t] || (this._attributions[t] = 0), this._attributions[t]++, this._update(), this) : this
  4155. },
  4156. removeAttribution: function(t) {
  4157. return t ? (this._attributions[t] && (this._attributions[t]--, this._update()), this) : this
  4158. },
  4159. _update: function() {
  4160. if (this._map) {
  4161. var t = [];
  4162. for (var e in this._attributions) this._attributions[e] && t.push(e);
  4163. var i = [];
  4164. this.options.prefix && i.push(this.options.prefix), t.length && i.push(t.join(", ")), this._container.innerHTML = i.join(" | ")
  4165. }
  4166. }
  4167. }), o.Map.mergeOptions({
  4168. attributionControl: !0
  4169. }), o.Map.addInitHook(function() {
  4170. this.options.attributionControl && (new o.Control.Attribution).addTo(this)
  4171. }), o.control.attribution = function(t) {
  4172. return new o.Control.Attribution(t)
  4173. }, o.Control.Scale = o.Control.extend({
  4174. options: {
  4175. position: "bottomleft",
  4176. maxWidth: 100,
  4177. metric: !0,
  4178. imperial: !0
  4179. },
  4180. onAdd: function(t) {
  4181. var e = "leaflet-control-scale",
  4182. i = o.DomUtil.create("div", e),
  4183. n = this.options;
  4184. return this._addScales(n, e + "-line", i), t.on(n.updateWhenIdle ? "moveend" : "move", this._update, this), t.whenReady(this._update, this), i
  4185. },
  4186. onRemove: function(t) {
  4187. t.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this)
  4188. },
  4189. _addScales: function(t, e, i) {
  4190. t.metric && (this._mScale = o.DomUtil.create("div", e, i)), t.imperial && (this._iScale = o.DomUtil.create("div", e, i))
  4191. },
  4192. _update: function() {
  4193. var t = this._map,
  4194. e = t.getSize().y / 2,
  4195. i = t.distance(t.containerPointToLatLng([0, e]), t.containerPointToLatLng([this.options.maxWidth, e]));
  4196. this._updateScales(i)
  4197. },
  4198. _updateScales: function(t) {
  4199. this.options.metric && t && this._updateMetric(t), this.options.imperial && t && this._updateImperial(t)
  4200. },
  4201. _updateMetric: function(t) {
  4202. var e = this._getRoundNum(t),
  4203. i = e < 1e3 ? e + " m" : e / 1e3 + " km";
  4204. this._updateScale(this._mScale, i, e / t)
  4205. },
  4206. _updateImperial: function(t) {
  4207. var e, i, n, o = 3.2808399 * t;
  4208. o > 5280 ? (e = o / 5280, i = this._getRoundNum(e), this._updateScale(this._iScale, i + " mi", i / e)) : (n = this._getRoundNum(o), this._updateScale(this._iScale, n + " ft", n / o))
  4209. },
  4210. _updateScale: function(t, e, i) {
  4211. t.style.width = Math.round(this.options.maxWidth * i) + "px", t.innerHTML = e
  4212. },
  4213. _getRoundNum: function(t) {
  4214. var e = Math.pow(10, (Math.floor(t) + "").length - 1),
  4215. i = t / e;
  4216. return i = i >= 10 ? 10 : i >= 5 ? 5 : i >= 3 ? 3 : i >= 2 ? 2 : 1, e * i
  4217. }
  4218. }), o.control.scale = function(t) {
  4219. return new o.Control.Scale(t)
  4220. }, o.Control.Layers = o.Control.extend({
  4221. options: {
  4222. collapsed: !0,
  4223. position: "topright",
  4224. autoZIndex: !0,
  4225. hideSingleBase: !1,
  4226. sortLayers: !1,
  4227. sortFunction: function(t, e, i, n) {
  4228. return i < n ? -1 : n < i ? 1 : 0
  4229. }
  4230. },
  4231. initialize: function(t, e, i) {
  4232. o.setOptions(this, i), this._layers = [], this._lastZIndex = 0, this._handlingClick = !1;
  4233. for (var n in t) this._addLayer(t[n], n);
  4234. for (n in e) this._addLayer(e[n], n, !0)
  4235. },
  4236. onAdd: function(t) {
  4237. return this._initLayout(), this._update(), this._map = t, t.on("zoomend", this._checkDisabledLayers, this), this._container
  4238. },
  4239. onRemove: function() {
  4240. this._map.off("zoomend", this._checkDisabledLayers, this);
  4241. for (var t = 0; t < this._layers.length; t++) this._layers[t].layer.off("add remove", this._onLayerChange, this)
  4242. },
  4243. addBaseLayer: function(t, e) {
  4244. return this._addLayer(t, e), this._map ? this._update() : this
  4245. },
  4246. addOverlay: function(t, e) {
  4247. return this._addLayer(t, e, !0), this._map ? this._update() : this
  4248. },
  4249. removeLayer: function(t) {
  4250. t.off("add remove", this._onLayerChange, this);
  4251. var e = this._getLayer(o.stamp(t));
  4252. return e && this._layers.splice(this._layers.indexOf(e), 1), this._map ? this._update() : this
  4253. },
  4254. expand: function() {
  4255. o.DomUtil.addClass(this._container, "leaflet-control-layers-expanded"), this._form.style.height = null;
  4256. var t = this._map.getSize().y - (this._container.offsetTop + 50);
  4257. return t < this._form.clientHeight ? (o.DomUtil.addClass(this._form, "leaflet-control-layers-scrollbar"), this._form.style.height = t + "px") : o.DomUtil.removeClass(this._form, "leaflet-control-layers-scrollbar"), this._checkDisabledLayers(), this
  4258. },
  4259. collapse: function() {
  4260. return o.DomUtil.removeClass(this._container, "leaflet-control-layers-expanded"), this
  4261. },
  4262. _initLayout: function() {
  4263. var t = "leaflet-control-layers",
  4264. e = this._container = o.DomUtil.create("div", t);
  4265. e.setAttribute("aria-haspopup", !0), o.DomEvent.disableClickPropagation(e), o.Browser.touch || o.DomEvent.disableScrollPropagation(e);
  4266. var i = this._form = o.DomUtil.create("form", t + "-list");
  4267. o.Browser.android || o.DomEvent.on(e, {
  4268. mouseenter: this.expand,
  4269. mouseleave: this.collapse
  4270. }, this);
  4271. var n = this._layersLink = o.DomUtil.create("a", t + "-toggle", e);
  4272. n.href = "#", n.title = "Layers", o.Browser.touch ? o.DomEvent.on(n, "click", o.DomEvent.stop).on(n, "click", this.expand, this) : o.DomEvent.on(n, "focus", this.expand, this), o.DomEvent.on(i, "click", function() {
  4273. setTimeout(o.bind(this._onInputClick, this), 0)
  4274. }, this), this._map.on("click", this.collapse, this), this.options.collapsed || this.expand(), this._baseLayersList = o.DomUtil.create("div", t + "-base", i), this._separator = o.DomUtil.create("div", t + "-separator", i), this._overlaysList = o.DomUtil.create("div", t + "-overlays", i), e.appendChild(i)
  4275. },
  4276. _getLayer: function(t) {
  4277. for (var e = 0; e < this._layers.length; e++) if (this._layers[e] && o.stamp(this._layers[e].layer) === t) return this._layers[e]
  4278. },
  4279. _addLayer: function(t, e, i) {
  4280. t.on("add remove", this._onLayerChange, this), this._layers.push({
  4281. layer: t,
  4282. name: e,
  4283. overlay: i
  4284. }), this.options.sortLayers && this._layers.sort(o.bind(function(t, e) {
  4285. return this.options.sortFunction(t.layer, e.layer, t.name, e.name)
  4286. }, this)), this.options.autoZIndex && t.setZIndex && (this._lastZIndex++, t.setZIndex(this._lastZIndex))
  4287. },
  4288. _update: function() {
  4289. if (!this._container) return this;
  4290. o.DomUtil.empty(this._baseLayersList), o.DomUtil.empty(this._overlaysList);
  4291. var t, e, i, n, s = 0;
  4292. for (i = 0; i < this._layers.length; i++) n = this._layers[i], this._addItem(n), e = e || n.overlay, t = t || !n.overlay, s += n.overlay ? 0 : 1;
  4293. return this.options.hideSingleBase && (t = t && s > 1, this._baseLayersList.style.display = t ? "" : "none"), this._separator.style.display = e && t ? "" : "none", this
  4294. },
  4295. _onLayerChange: function(t) {
  4296. this._handlingClick || this._update();
  4297. var e = this._getLayer(o.stamp(t.target)),
  4298. i = e.overlay ? "add" === t.type ? "overlayadd" : "overlayremove" : "add" === t.type ? "baselayerchange" : null;
  4299. i && this._map.fire(i, e)
  4300. },
  4301. _createRadioElement: function(t, i) {
  4302. var n = '<input type="radio" class="leaflet-control-layers-selector" name="' + t + '"' + (i ? ' checked="checked"' : "") + "/>",
  4303. o = e.createElement("div");
  4304. return o.innerHTML = n, o.firstChild
  4305. },
  4306. _addItem: function(t) {
  4307. var i, n = e.createElement("label"),
  4308. s = this._map.hasLayer(t.layer);
  4309. t.overlay ? (i = e.createElement("input"), i.type = "checkbox", i.className = "leaflet-control-layers-selector", i.defaultChecked = s) : i = this._createRadioElement("leaflet-base-layers", s), i.layerId = o.stamp(t.layer), o.DomEvent.on(i, "click", this._onInputClick, this);
  4310. var r = e.createElement("span");
  4311. r.innerHTML = " " + t.name;
  4312. var a = e.createElement("div");
  4313. n.appendChild(a), a.appendChild(i), a.appendChild(r);
  4314. var h = t.overlay ? this._overlaysList : this._baseLayersList;
  4315. return h.appendChild(n), this._checkDisabledLayers(), n
  4316. },
  4317. _onInputClick: function() {
  4318. var t, e, i, n = this._form.getElementsByTagName("input"),
  4319. o = [],
  4320. s = [];
  4321. this._handlingClick = !0;
  4322. for (var r = n.length - 1; r >= 0; r--) t = n[r], e = this._getLayer(t.layerId).layer, i = this._map.hasLayer(e), t.checked && !i ? o.push(e) : !t.checked && i && s.push(e);
  4323. for (r = 0; r < s.length; r++) this._map.removeLayer(s[r]);
  4324. for (r = 0; r < o.length; r++) this._map.addLayer(o[r]);
  4325. this._handlingClick = !1, this._refocusOnMap()
  4326. },
  4327. _checkDisabledLayers: function() {
  4328. for (var t, e, n = this._form.getElementsByTagName("input"), o = this._map.getZoom(), s = n.length - 1; s >= 0; s--) t = n[s], e = this._getLayer(t.layerId).layer, t.disabled = e.options.minZoom !== i && o < e.options.minZoom || e.options.maxZoom !== i && o > e.options.maxZoom
  4329. },
  4330. _expand: function() {
  4331. return this.expand()
  4332. },
  4333. _collapse: function() {
  4334. return this.collapse()
  4335. }
  4336. }), o.control.layers = function(t, e, i) {
  4337. return new o.Control.Layers(t, e, i)
  4338. }
  4339. }(window, document);