....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 213.186.33.2  /  Your IP : 216.73.217.61
Web Server : Apache
System : Linux webd003.cluster102.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : uneseuleoc ( 96096)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/uneseuleoc/www/plugins/auto/gis/v5.0.0/lib/leaflet/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/uneseuleoc/www/plugins/auto/gis/v5.0.0/lib/leaflet/plugins//Leaflet.GoogleMutant.js
(function () {
	'use strict';

	/**
	 * GoogleMutant by Iván Sánchez Ortega <ivan@sanchezortega.es> https://ivan.sanchezortega.es
	 * Source and issue tracking: https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant/
	 *
	 * Based on techniques from https://github.com/shramov/leaflet-plugins
	 * and https://avinmathew.com/leaflet-and-google-maps/ , but relying on MutationObserver.
	 *
	 * "THE BEER-WARE LICENSE":
	 * <ivan@sanchezortega.es> wrote this file. As long as you retain this notice you
	 * can do whatever you want with this stuff. If we meet some day, and you think
	 * this stuff is worth it, you can buy me a beer in return.
	 *
	 * Uses MIT-licensed code from https://github.com/rsms/js-lru/
	 */

	// This implementation of LRUMap is a copy of https://github.com/rsms/js-lru/ ,
	// trivially adapted for ES6 exports.

	/*
	The MIT License

	Copyright (c) 2010-2020 Rasmus Andersson <https://rsms.me/>

	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:

	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
	*/

	/**
	 * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most
	 * recently used items while discarding least recently used items when its limit
	 * is reached.
	 *
	 * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
	 * See README.md for details.
	 *
	 * Illustration of the design:
	 *
	 *       entry             entry             entry             entry
	 *       ______            ______            ______            ______
	 *      | head |.newer => |      |.newer => |      |.newer => | tail |
	 *      |  A   |          |  B   |          |  C   |          |  D   |
	 *      |______| <= older.|______| <= older.|______| <= older.|______|
	 *
	 *  removed  <--  <--  <--  <--  <--  <--  <--  <--  <--  <--  <--  added
	 */

	var NEWER = Symbol("newer");
	var OLDER = Symbol("older");

	var LRUMap = function LRUMap(limit, entries) {
		if (typeof limit !== "number") {
			// called as (entries)
			entries = limit;
			limit = 0;
		}

		this.size = 0;
		this.limit = limit;
		this.oldest = this.newest = undefined;
		this._keymap = new Map();

		if (entries) {
			this.assign(entries);
			if (limit < 1) {
				this.limit = this.size;
			}
		}
	};

	LRUMap.prototype._markEntryAsUsed = function _markEntryAsUsed (entry) {
		if (entry === this.newest) {
			// Already the most recenlty used entry, so no need to update the list
			return;
		}
		// HEAD--------------TAIL
		//   <.older   .newer>
		//  <--- add direction --
		//   A  B  C  <D>  E
		if (entry[NEWER]) {
			if (entry === this.oldest) {
				this.oldest = entry[NEWER];
			}
			entry[NEWER][OLDER] = entry[OLDER]; // C <-- E.
		}
		if (entry[OLDER]) {
			entry[OLDER][NEWER] = entry[NEWER]; // C. --> E
		}
		entry[NEWER] = undefined; // D --x
		entry[OLDER] = this.newest; // D. --> E
		if (this.newest) {
			this.newest[NEWER] = entry; // E. <-- D
		}
		this.newest = entry;
	};

	LRUMap.prototype.assign = function assign (entries) {
		var entry,
			limit = this.limit || Number.MAX_VALUE;
		this._keymap.clear();
		var it = entries[Symbol.iterator]();
		for (var itv = it.next(); !itv.done; itv = it.next()) {
			var e = new Entry(itv.value[0], itv.value[1]);
			this._keymap.set(e.key, e);
			if (!entry) {
				this.oldest = e;
			} else {
				entry[NEWER] = e;
				e[OLDER] = entry;
			}
			entry = e;
			if (limit-- == 0) {
				throw new Error("overflow");
			}
		}
		this.newest = entry;
		this.size = this._keymap.size;
	};

	LRUMap.prototype.get = function get (key) {
		// First, find our cache entry
		var entry = this._keymap.get(key);
		if (!entry) { return; } // Not cached. Sorry.
		// As <key> was found in the cache, register it as being requested recently
		this._markEntryAsUsed(entry);
		return entry.value;
	};

	LRUMap.prototype.set = function set (key, value) {
		var entry = this._keymap.get(key);

		if (entry) {
			// update existing
			entry.value = value;
			this._markEntryAsUsed(entry);
			return this;
		}

		// new entry
		this._keymap.set(key, (entry = new Entry(key, value)));

		if (this.newest) {
			// link previous tail to the new tail (entry)
			this.newest[NEWER] = entry;
			entry[OLDER] = this.newest;
		} else {
			// we're first in -- yay
			this.oldest = entry;
		}

		// add new entry to the end of the linked list -- it's now the freshest entry.
		this.newest = entry;
		++this.size;
		if (this.size > this.limit) {
			// we hit the limit -- remove the head
			this.shift();
		}

		return this;
	};

	LRUMap.prototype.shift = function shift () {
		// todo: handle special case when limit == 1
		var entry = this.oldest;
		if (entry) {
			if (this.oldest[NEWER]) {
				// advance the list
				this.oldest = this.oldest[NEWER];
				this.oldest[OLDER] = undefined;
			} else {
				// the cache is exhausted
				this.oldest = undefined;
				this.newest = undefined;
			}
			// Remove last strong reference to <entry> and remove links from the purged
			// entry being returned:
			entry[NEWER] = entry[OLDER] = undefined;
			this._keymap.delete(entry.key);
			--this.size;
			return [entry.key, entry.value];
		}
	};

	// -------------------------------------------------------------------------------------
	// Following code (until end of class definition) is optional and can be removed without
	// breaking the core functionality.

	LRUMap.prototype.find = function find (key) {
		var e = this._keymap.get(key);
		return e ? e.value : undefined;
	};

	LRUMap.prototype.has = function has (key) {
		return this._keymap.has(key);
	};

	LRUMap.prototype.delete = function delete$1 (key) {
		var entry = this._keymap.get(key);
		if (!entry) { return; }
		this._keymap.delete(entry.key);
		if (entry[NEWER] && entry[OLDER]) {
			// relink the older entry with the newer entry
			entry[OLDER][NEWER] = entry[NEWER];
			entry[NEWER][OLDER] = entry[OLDER];
		} else if (entry[NEWER]) {
			// remove the link to us
			entry[NEWER][OLDER] = undefined;
			// link the newer entry to head
			this.oldest = entry[NEWER];
		} else if (entry[OLDER]) {
			// remove the link to us
			entry[OLDER][NEWER] = undefined;
			// link the newer entry to head
			this.newest = entry[OLDER];
		} else {
			// if(entry[OLDER] === undefined && entry.newer === undefined) {
			this.oldest = this.newest = undefined;
		}

		this.size--;
		return entry.value;
	};

	LRUMap.prototype.clear = function clear () {
		// Not clearing links should be safe, as we don't expose live links to user
		this.oldest = this.newest = undefined;
		this.size = 0;
		this._keymap.clear();
	};

	LRUMap.prototype.keys = function keys () {
		return new KeyIterator(this.oldest);
	};

	LRUMap.prototype.values = function values () {
		return new ValueIterator(this.oldest);
	};

	LRUMap.prototype.entries = function entries () {
		return this;
	};

	LRUMap.prototype[Symbol.iterator] = function () {
		return new EntryIterator(this.oldest);
	};

	LRUMap.prototype.forEach = function forEach (fun, thisObj) {
		if (typeof thisObj !== "object") {
			thisObj = this;
		}
		var entry = this.oldest;
		while (entry) {
			fun.call(thisObj, entry.value, entry.key, this);
			entry = entry[NEWER];
		}
	};

	/** Returns a JSON (array) representation */
	LRUMap.prototype.toJSON = function toJSON () {
		var s = new Array(this.size),
			i = 0,
			entry = this.oldest;
		while (entry) {
			s[i++] = { key: entry.key, value: entry.value };
			entry = entry[NEWER];
		}
		return s;
	};

	/** Returns a String representation */
	LRUMap.prototype.toString = function toString () {
		var s = "",
			entry = this.oldest;
		while (entry) {
			s += String(entry.key) + ":" + entry.value;
			entry = entry[NEWER];
			if (entry) {
				s += " < ";
			}
		}
		return s;
	};

	function Entry(key, value) {
		this.key = key;
		this.value = value;
		this[NEWER] = undefined;
		this[OLDER] = undefined;
	}

	function EntryIterator(oldestEntry) {
		this.entry = oldestEntry;
	}
	EntryIterator.prototype[Symbol.iterator] = function () {
		return this;
	};
	EntryIterator.prototype.next = function () {
		var ent = this.entry;
		if (ent) {
			this.entry = ent[NEWER];
			return { done: false, value: [ent.key, ent.value] };
		} else {
			return { done: true, value: undefined };
		}
	};

	function KeyIterator(oldestEntry) {
		this.entry = oldestEntry;
	}
	KeyIterator.prototype[Symbol.iterator] = function () {
		return this;
	};
	KeyIterator.prototype.next = function () {
		var ent = this.entry;
		if (ent) {
			this.entry = ent[NEWER];
			return { done: false, value: ent.key };
		} else {
			return { done: true, value: undefined };
		}
	};

	function ValueIterator(oldestEntry) {
		this.entry = oldestEntry;
	}
	ValueIterator.prototype[Symbol.iterator] = function () {
		return this;
	};
	ValueIterator.prototype.next = function () {
		var ent = this.entry;
		if (ent) {
			this.entry = ent[NEWER];
			return { done: false, value: ent.value };
		} else {
			return { done: true, value: undefined };
		}
	};

	// GoogleMutant by Iván Sánchez Ortega <ivan@sanchezortega.es>

	function waitForAPI(callback, context) {
		var checkCounter = 0,
			intervalId = null;

		intervalId = setInterval(function () {
			if (checkCounter >= 20) {
				clearInterval(intervalId);
				throw new Error("window.google not found after 10 seconds");
			}
			if (!!window.google && !!window.google.maps && !!window.google.maps.Map) {
				clearInterval(intervalId);
				callback.call(context);
			}
			++checkCounter;
		}, 500);
	}

	// 🍂class GridLayer.GoogleMutant
	// 🍂extends GridLayer
	L.GridLayer.GoogleMutant = L.GridLayer.extend({
		options: {
			maxZoom: 21, // can be 23, but ugly if more than maxNativeZoom
			// 🍂option type: String = 'roadmap'
			// Google's map type. Valid values are 'roadmap', 'satellite' or 'terrain'. 'hybrid' is not really supported.
			type: "roadmap",
			maxNativeZoom: 21,
		},

		initialize: function (options) {
			L.GridLayer.prototype.initialize.call(this, options);

			// Couple data structures indexed by tile key
			this._tileCallbacks = {}; // Callbacks for promises for tiles that are expected
			this._lru = new LRUMap(100); // Tile LRU cache

			this._imagesPerTile = this.options.type === "hybrid" ? 2 : 1;

			this._boundOnMutatedImage = this._onMutatedImage.bind(this);
		},

		onAdd: function (map) {
			var this$1 = this;

			L.GridLayer.prototype.onAdd.call(this, map);
			this._initMutantContainer();

			// Attribution and logo nodes are not mutated a second time if the
			// mutant is removed and re-added to the map, hence they are
			// not cleaned up on layer removal, so they can be added here.
			if (this._logoContainer) {
				map._controlCorners.bottomleft.appendChild(this._logoContainer);
			}
			if (this._attributionContainer) {
				map._controlCorners.bottomright.appendChild(this._attributionContainer);
			}

			waitForAPI(function () {
				if (!this$1._map) {
					return;
				}
				this$1._initMutant();

				//handle layer being added to a map for which there are no Google tiles at the given zoom
				google.maps.event.addListenerOnce(this$1._mutant, "idle", function () {
					if (!this$1._map) {
						return;
					}
					this$1._checkZoomLevels();
					this$1._mutantIsReady = true;
				});
			});
		},

		onRemove: function (map) {
			L.GridLayer.prototype.onRemove.call(this, map);
			this._observer.disconnect();
			map._container.removeChild(this._mutantContainer);
			if (this._logoContainer) {
				L.DomUtil.remove(this._logoContainer);
			}
			if (this._attributionContainer) {
				L.DomUtil.remove(this._attributionContainer);
			}
			if (this._mutant) {
				google.maps.event.clearListeners(this._mutant, "idle");
			}
		},

		// 🍂method addGoogleLayer(name: String, options?: Object): this
		// Adds layer with the given name and options to the google Map instance.
		// `name`: one of the google maps API layers, with it's constructor available in `google.maps` object.
		// currently following values supported: 'TrafficLayer', 'TransitLayer', 'BicyclingLayer'.
		// `options`: see https://developers.google.com/maps/documentation/javascript/reference/map
		addGoogleLayer: function (googleLayerName, options) {
			var this$1 = this;

			if (!this._subLayers) { this._subLayers = {}; }
			this.whenReady(function () {
				var Constructor = google.maps[googleLayerName];
				var googleLayer = new Constructor(options);
				googleLayer.setMap(this$1._mutant);
				this$1._subLayers[googleLayerName] = googleLayer;
			});
			return this;
		},

		// 🍂method removeGoogleLayer(name: String): this
		// Removes layer with the given name from the google Map instance.
		removeGoogleLayer: function (googleLayerName) {
			var this$1 = this;

			this.whenReady(function () {
				var googleLayer = this$1._subLayers && this$1._subLayers[googleLayerName];
				if (googleLayer) {
					googleLayer.setMap(null);
					delete this$1._subLayers[googleLayerName];
				}
			});
			return this;
		},

		_initMutantContainer: function () {
			if (!this._mutantContainer) {
				this._mutantContainer = L.DomUtil.create(
					"div",
					"leaflet-google-mutant leaflet-top leaflet-left"
				);
				this._mutantContainer.id = "_MutantContainer_" + L.Util.stamp(this._mutantContainer);
				this._mutantContainer.style.pointerEvents = "none";
				this._mutantContainer.style.visibility = "hidden";

				L.DomEvent.off(this._mutantContainer);
			}
			this._map.getContainer().appendChild(this._mutantContainer);

			this.setOpacity(this.options.opacity);
			var style = this._mutantContainer.style;
			if (this._map.options.zoomSnap < 1) {
				// Fractional zoom needs a bigger mutant container in order to load more (smaller) tiles
				style.width = "180%";
				style.height = "180%";
			} else {
				style.width = "100%";
				style.height = "100%";
			}
			style.zIndex = -1;

			this._attachObserver(this._mutantContainer);
		},

		_initMutant: function () {
			if (this._mutant) {
				return;
			}

			var map = new google.maps.Map(this._mutantContainer, {
				center: { lat: 0, lng: 0 },
				zoom: 0,
				tilt: 0,
				mapTypeId: this.options.type,
				disableDefaultUI: true,
				keyboardShortcuts: false,
				draggable: false,
				disableDoubleClickZoom: true,
				scrollwheel: false,
				styles: this.options.styles || [],
				backgroundColor: "transparent",
			});

			this._mutant = map;

			this._update();

			// 🍂event spawned
			// Fired when the mutant has been created.
			this.fire("spawned", { mapObject: map });

			this._waitControls();
			this.once('controls_ready', this._setupAttribution);
		},

		_attachObserver: function _attachObserver(node) {
			if (!this._observer) { this._observer = new MutationObserver(this._onMutations.bind(this)); }

			// pass in the target node, as well as the observer options
			this._observer.observe(node, { childList: true, subtree: true });

			// if we are reusing an old _mutantContainer, we must manually detect
			// all existing tiles in it
			Array.prototype.forEach.call(node.querySelectorAll("img"), this._boundOnMutatedImage);
		},

		_waitControls: function () {
			var this$1 = this;

			var id = setInterval(function () {
				var layoutManager = this$1._mutant.__gm.layoutManager;
				if (!layoutManager) { return; }
				clearInterval(id);
				var positions;
				// iterate through obfuscated key names to find positions set (atm: layoutManager.o)
				Object.keys(layoutManager).forEach(function(key) {
					var el = layoutManager[key];
					if (el.get) {
						if (el.get(1) instanceof Node) {
							positions = el;
						}
					}
				});
				// 🍂event controls_ready
				// Fired when controls positions get available (passed in `positions` property).
				this$1.fire("controls_ready", { positions: positions });
			}, 50);
		},

		_setupAttribution: function (ev) {
			// https://developers.google.com/maps/documentation/javascript/reference/control#ControlPosition
			var pos = google.maps.ControlPosition;
			var ctr = this._attributionContainer = ev.positions.get(pos.BOTTOM_RIGHT);
			L.DomUtil.addClass(ctr, "leaflet-control leaflet-control-attribution");
			L.DomEvent.disableClickPropagation(ctr);
			ctr.style.height = "14px";
			this._map._controlCorners.bottomright.appendChild(ctr);

			this._logoContainer = ev.positions.get(pos.BOTTOM_LEFT);
			this._logoContainer.style.pointerEvents = "auto";
			this._map._controlCorners.bottomleft.appendChild(this._logoContainer);
		},

		_onMutations: function _onMutations(mutations) {
			for (var i = 0; i < mutations.length; ++i) {
				var mutation = mutations[i];
				for (var j = 0; j < mutation.addedNodes.length; ++j) {
					var node = mutation.addedNodes[j];

					if (node instanceof HTMLImageElement) {
						this._onMutatedImage(node);
					} else if (node instanceof HTMLElement) {
						Array.prototype.forEach.call(
							node.querySelectorAll("img"),
							this._boundOnMutatedImage
						);
					}
				}
			}
		},

		// Only images which 'src' attrib match this will be considered for moving around.
		// Looks like some kind of string-based protobuf, maybe??
		// Only the roads (and terrain, and vector-based stuff) match this pattern
		_roadRegexp: /!1i(\d+)!2i(\d+)!3i(\d+)!/,

		// On the other hand, raster imagery matches this other pattern
		_satRegexp: /x=(\d+)&y=(\d+)&z=(\d+)/,

		// On small viewports, when zooming in/out, a static image is requested
		// This will not be moved around, just removed from the DOM.
		_staticRegExp: /StaticMapService\.GetMapImage/,

		_onMutatedImage: function _onMutatedImage(imgNode) {
			var coords;
			var match = imgNode.src.match(this._roadRegexp);
			var sublayer = 0;

			if (match) {
				coords = {
					z: match[1],
					x: match[2],
					y: match[3],
				};
				if (this._imagesPerTile > 1) {
					imgNode.style.zIndex = 1;
					sublayer = 1;
				}
			} else {
				match = imgNode.src.match(this._satRegexp);
				if (match) {
					coords = {
						x: match[1],
						y: match[2],
						z: match[3],
					};
				}
				// imgNode.style.zIndex = 0;
				sublayer = 0;
			}

			if (coords) {
				var tileKey = this._tileCoordsToKey(coords);
				imgNode.style.position = "absolute";

				var key = tileKey + "/" + sublayer;
				// Cache img so it can also be used in subsequent tile requests
				this._lru.set(key, imgNode);

				if (key in this._tileCallbacks && this._tileCallbacks[key]) {
					// Use the tile for *all* pending callbacks. They'll be cloned anyway.
					this._tileCallbacks[key].forEach(function (callback) { return callback(imgNode); });
					delete this._tileCallbacks[key];
				}
			}
		},

		createTile: function (coords, done) {
			var key = this._tileCoordsToKey(coords),
				tileContainer = L.DomUtil.create("div");

			tileContainer.style.textAlign = "left";
			tileContainer.dataset.pending = this._imagesPerTile;
			done = done.bind(this, null, tileContainer);

			for (var i = 0; i < this._imagesPerTile; ++i) {
				var key2 = key + "/" + i,
					imgNode = this._lru.get(key2);
				if (imgNode) {
					tileContainer.appendChild(this._clone(imgNode));
					--tileContainer.dataset.pending;
				} else {
					this._tileCallbacks[key2] = this._tileCallbacks[key2] || [];
					this._tileCallbacks[key2].push(
						function (c /*, k2*/) {
							return function (imgNode) {
								c.appendChild(this._clone(imgNode));
								--c.dataset.pending;
								if (!parseInt(c.dataset.pending)) {
									done();
								}
							}.bind(this);
						}.bind(this)(tileContainer /*, key2*/)
					);
				}
			}

			if (!parseInt(tileContainer.dataset.pending)) {
				L.Util.requestAnimFrame(done);
			}
			return tileContainer;
		},

		_clone: function (imgNode) {
			var clonedImgNode = imgNode.cloneNode(true);
			clonedImgNode.style.visibility = "visible";
			return clonedImgNode;
		},

		_checkZoomLevels: function () {
			//setting the zoom level on the Google map may result in a different zoom level than the one requested
			//(it won't go beyond the level for which they have data).
			var zoomLevel = this._map.getZoom(),
				gMapZoomLevel = this._mutant.getZoom();

			if (!zoomLevel || !gMapZoomLevel) { return; }

			if (
				gMapZoomLevel !== zoomLevel || //zoom levels are out of sync, Google doesn't have data
				gMapZoomLevel > this.options.maxNativeZoom
			) {
				//at current location, Google does have data (contrary to maxNativeZoom)
				//Update maxNativeZoom
				this._setMaxNativeZoom(gMapZoomLevel);
			}
		},

		_setMaxNativeZoom: function (zoomLevel) {
			if (zoomLevel !== this.options.maxNativeZoom) {
				this.options.maxNativeZoom = zoomLevel;
				this._resetView();
			}
		},

		_update: function (center) {
			// zoom level check needs to happen before super's implementation (tile addition/creation)
			// otherwise tiles may be missed if maxNativeZoom is not yet correctly determined
			if (this._mutant) {
				center = center || this._map.getCenter();
				var _center = new google.maps.LatLng(center.lat, center.lng),
					zoom = Math.round(this._map.getZoom()),
					mutantZoom = this._mutant.getZoom();

				this._mutant.setCenter(_center);

				//ignore fractional zoom levels
				if (zoom !== mutantZoom) {
					this._mutant.setZoom(zoom);

					if (this._mutantIsReady) { this._checkZoomLevels(); }
					//else zoom level check will be done later by 'idle' handler
				}
			}

			L.GridLayer.prototype._update.call(this, center);
		},

		// @method whenReady(fn: Function, context?: Object): this
		// Runs the given function `fn` when the mutant gets initialized, or immediately
		// if it's already initialized, optionally passing a function context.
		whenReady: function (callback, context) {
			if (this._mutant) {
				callback.call(context || this, { target: this });
			} else {
				this.on("spawned", callback, context);
			}
			return this;
		},
	});

	// 🍂factory gridLayer.googleMutant(options)
	// Returns a new `GridLayer.GoogleMutant` given its options
	L.gridLayer.googleMutant = function (options) {
		return new L.GridLayer.GoogleMutant(options);
	};

}());
//# sourceMappingURL=Leaflet.GoogleMutant.js.map

Youez - 2016 - github.com/yon3zu
LinuXploit