PageSourceSearch

https://faciliteacasa.com/plugins/leafletjs-googlemutant/Leaflet.GoogleMutant.min.js?1790087158

js faciliteacasa.com collected 2026-10-08 23:16:17 UTC 9,214 bytes, 1 lines download raw bytes

1(function(){"use strict";function t(t,e){this.key=t,this.value=e,this[s]=void 0,this[a]=void 0}function e(t){this.entry=t}function i(t){this.entry=t}function n(t){this.entry=t}function o(t,e){var i=0,n=null;n=setInterval(function(){if(i>=20)throw clearInterval(n),new Error("window.google not found after 10 seconds");window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(n),t.call(e)),++i},500)}var s=Symbol("newer"),a=Symbol("older"),r=function(t,e){"number"!=typeof t&&(e=t,t=0),this.size=0,this.limit=t,this.oldest=this.newest=void 0,this._keymap=new Map,e&&(this.assign(e),t<1&&(this.limit=this.size))};r.prototype._markEntryAsUsed=function(t){t!==this.newest&&(t[s]&&(t===this.oldest&&(this.oldest=t[s]),t[s][a]=t[a]),t[a]&&(t[a][s]=t[s]),t[s]=void 0,t[a]=this.newest,this.newest&&(this.newest[s]=t),this.newest=t)},r.prototype.assign=function(e){var i,n=this.limit||Number.MAX_VALUE;this._keymap.clear();for(var o=e[Symbol.iterator](),r=o.next();!r.done;r=o.next()){var h=new t(r.value[0],r.value[1]);if(this._keymap.set(h.key,h),i?(i[s]=h,h[a]=i):this.oldest=h,i=h,0==n--)throw new Error("overflow")}this.newest=i,this.size=this._keymap.size},r.prototype.get=function(t){var e=this._keymap.get(t);if(e)return this._markEntryAsUsed(e),e.value},r.prototype.set=function(e,i){var n=this._keymap.get(e);return n?(n.value=i,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new t(e,i)),this.newest?(this.newest[s]=n,n[a]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var t=this.oldest;if(t)return this.oldest[s]?(this.oldest=this.oldest[s],this.oldest[a]=void 0):(this.oldest=void 0,this.newest=void 0),t[s]=t[a]=void 0,this._keymap.delete(t.key),--this.size,[t.key,t.value]},r.prototype.find=function(t){var e=this._keymap.get(t);return e?e.value:void 0},r.prototype.has=function(t){return this._keymap.has(t)},r.prototype.delete=function(t){var e=this._keymap.get(t);if(e)return this._keymap.delete(e.key),e[s]&&e[a]?(e[a][s]=e[s],e[s][a]=e[a]):e[s]?(e[s][a]=void 0,this.oldest=e[s]):e[a]?(e[a][s]=void 0,this.newest=e[a]):this.oldest=this.newest=void 0,this.size--,e.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()},r.prototype.keys=function(){return new i(this.oldest)},r.prototype.values=function(){return new n(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new e(this.oldest)},r.prototype.forEach=function(t,e){"object"!=typeof e&&(e=this);for(var i=this.oldest;i;)t.call(e,i.value,i.key,this),i=i[s]},r.prototype.toJSON=function(){for(var t=new Array(this.size),e=0,i=this.oldest;i;)t[e++]={key:i.key,value:i.value},i=i[s];return t},r.prototype.toString=function(){for(var t="",e=this.oldest;e;)t+=String(e.key)+":"+e.value,e=e[s],e&&(t+=" < ");return t},e.prototype[Symbol.iterator]=function(){return this},e.prototype.next=function(){var t=this.entry;return t?(this.entry=t[s],{done:!1,value:[t.key,t.value]}):{done:!0,value:void 0}},i.prototype[Symbol.iterator]=function(){return this},i.prototype.next=function(){var t=this.entry;return t?(this.entry=t[s],{done:!1,value:t.key}):{done:!0,value:void 0}},n.prototype[Symbol.iterator]=function(){return this},n.prototype.next=function(){var t=this.entry;return t?(this.entry=t[s],{done:!1,value:t.value}):{done:!0,value:void 0}},L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:"roadmap",maxNativeZoom:21},initialize:function(t){L.GridLayer.prototype.initialize.call(this,t),this._tileCallbacks={},this._lru=new r(100),this._imagesPerTile="hybrid"===this.options.type?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(t){var e=this;L.GridLayer.prototype.onAdd.call(this,t),this._initMutantContainer(),this._logoContainer&&t._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&t._controlCorners.bottomright.appendChild(this._attributionContainer),o(function(){e._map&&(e._initMutant(),google.maps.event.addListenerOnce(e._mutant,"idle",function(){e._map&&(e._checkZoomLevels(),e._mutantIsReady=!0)}))})},onRemove:function(t){L.GridLayer.prototype.onRemove.call(this,t),this._observer.disconnect(),t._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,"idle")},addGoogleLayer:function(t,e){var i=this;return this._subLayers||(this._subLayers={}),this.whenReady(function(){var n=google.maps[t],o=new n(e);o.setMap(i._mutant),i._subLayers[t]=o}),this},removeGoogleLayer:function(t){var e=this;return this.whenReady(function(){var i=e._subLayers&&e._subLayers[t];
1i&&(i.setMap(null),delete e._subLayers[t])}),this},_initMutantContainer:function(){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 t=this._mutantContainer.style;this._map.options.zoomSnap<1?(t.width="180%",t.height="180%"):(t.width="100%",t.height="100%"),t.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var t=new google.maps.Map(this._mutantContainer,{center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:"transparent"});this._mutant=t,this._update(),this.fire("spawned",{mapObject:t}),this._waitControls(),this.once("controls_ready",this._setupAttribution)}},_attachObserver:function(t){this._observer||(this._observer=new MutationObserver(this._onMutations.bind(this))),this._observer.observe(t,{childList:!0,subtree:!0}),Array.prototype.forEach.call(t.querySelectorAll("img"),this._boundOnMutatedImage)},_waitControls:function(){var t=this,e=setInterval(function(){var i,n=t._mutant.__gm.layoutManager;n&&(clearInterval(e),Object.keys(n).forEach(function(t){var e=n[t];e.get&&e.get(1)instanceof Node&&(i=e)}),t.fire("controls_ready",{positions:i}))},50)},_setupAttribution:function(t){if(this._map){var e=google.maps.ControlPosition,i=this._attributionContainer=t.positions.get(e.BOTTOM_RIGHT);L.DomUtil.addClass(i,"leaflet-control leaflet-control-attribution"),L.DomEvent.disableClickPropagation(i),i.style.height="14px",this._map._controlCorners.bottomright.appendChild(i),this._logoContainer=t.positions.get(e.BOTTOM_LEFT),this._logoContainer.style.pointerEvents="auto",this._map._controlCorners.bottomleft.appendChild(this._logoContainer)}},_onMutations:function(t){for(var e=0;e<t.length;++e)for(var i=t[e],n=0;n<i.addedNodes.length;++n){var o=i.addedNodes[n];o instanceof HTMLImageElement?this._onMutatedImage(o):o instanceof HTMLElement&&Array.prototype.forEach.call(o.querySelectorAll("img"),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function(t){var e,i=t.src.match(this._roadRegexp),n=0;if(i?(e={z:i[1],x:i[2],y:i[3]},this._imagesPerTile>1&&(t.style.zIndex=1,n=1)):(i=t.src.match(this._satRegexp),i&&(e={x:i[1],y:i[2],z:i[3]}),n=0),e){var o=this._tileCoordsToKey(e);t.style.position="absolute";var s=o+"/"+n;this._lru.set(s,t),s in this._tileCallbacks&&this._tileCallbacks[s]&&(this._tileCallbacks[s].forEach(function(e){return e(t)}),delete this._tileCallbacks[s])}},createTile:function(t,e){var i=this._tileCoordsToKey(t),n=L.DomUtil.create("div");n.style.textAlign="left",n.dataset.pending=this._imagesPerTile,e=e.bind(this,null,n);for(var o=0;o<this._imagesPerTile;++o){var s=i+"/"+o,a=this._lru.get(s);a?(n.appendChild(this._clone(a)),--n.dataset.pending):(this._tileCallbacks[s]=this._tileCallbacks[s]||[],this._tileCallbacks[s].push(function(t){return function(i){t.appendChild(this._clone(i)),--t.dataset.pending,parseInt(t.dataset.pending)||e()}.bind(this)}.bind(this)(n)))}return parseInt(n.dataset.pending)||L.Util.requestAnimFrame(e),n},_clone:function(t){var e=t.cloneNode(!0);return e.style.visibility="visible",e},_checkZoomLevels:function(){var t=this._map.getZoom(),e=this._mutant.getZoom();t&&e&&(e!==t||e>this.options.maxNativeZoom)&&this._setMaxNativeZoom(e)},_setMaxNativeZoom:function(t){t!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=t,this._resetView())},_update:function(t){if(this._mutant){t=t||this._map.getCenter();var e=new google.maps.LatLng(t.lat,t.lng),i=Math.round(this._map.getZoom()),n=this._mutant.getZoom();this._mutant.setCenter(e),i!==n&&(this._mutant.setZoom(i),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,t)},whenReady:function(t,e){return this._mutant?t.call(e||this,{target:this}):this.on("spawned",t,e),this}}),L.gridLayer.googleMutant=function(t){return new L.GridLayer.GoogleMutant(t)}})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.