PageSourceSearch

https://www.pcfruit.be/frontend/site/googleMaps.component-BwxrqaO1.js

js pcfruit.be collected 2026-09-26 01:36:54 UTC 2,498 bytes, 3 lines download raw bytes

1import{D as p}from"./site-haiVB-FE.js";class g{constructor(t=null){this.googleApiKey="AIzaSyDkFFg8PRaoEsqLk5hLR2Ct3KMLF3LWDi8",this.markerLibraryPromise=null,t&&(this.googleApiKey=t),typeof google>"u"||!google.hasOwnProperty("maps")?p.loadScript(`https://maps.googleapis.com/maps/api/js?key=${this.googleApiKey}&v=weekly&libraries=marker`,this.initGoogleMaps.bind(this)):this.initGoogleMaps()}async initGoogleMaps(){try{const t=await this.loadMarkerLibrary(),a=document.querySelectorAll("[data-google-map]");Array.from(a).forEach(e=>{new h(e,t)})}catch(t){console.error("Failed to initialize Google Maps:",t)}}async loadMarkerLibrary(){if(this.markerLibraryPromise)return this.markerLibraryPromise;this.markerLibraryPromise=google.maps.importLibrary("marker");try{await this.markerLibraryPromise}catch(t){throw this.markerLibraryPromise=void 0,console.error("Failed to load Google Maps marker library:",t),t}return this.markerLibraryPromise}}class h{constructor(t,a){this.mapData=[],this.markers=[],this.locations=[],this.customOptions={};const e=this,s={zoom:9,scrollwheel:!1,mapId:"d2f8a889e7a9850f5c2657cd"};this.mapData=[];try{this.locations=JSON.parse(t.getAttribute("data-locations")),this.customOptions=JSON.parse(t.getAttribute("data-options"))}catch{}new MutationObserver(function(r){r.forEach(function(i){const m=i.target;i.type==="attributes"&&i.attributeName==="data-locations"&&(e.locations=JSON.parse(m.getAttribute("data-locations")),e.addMarkers(a))})}).observe(t,{attributes:!0}),this.map=new google.maps.Map(t,{...s,...this.customOptions}),this.addMarkers(a);let n=null;window.addEventListener("resize",()=>{clearTimeout(n),n=setTimeout(()=>{this.mapData.forEach(r=>{r.markers.length>1&&r.instance.fitBounds(r.bounds),r.instance.setCenter(r.bounds.getCenter())})},250)})}addMarkers(t){const a=new google.maps.InfoWindow,e=new google.maps.LatLngBounds;this.markers.forEach(s=>{s.setMap(null)}),this.markers=[],this.mapData=[],this.locations.forEach(s=>{const o=new t.AdvancedMarkerElement({map:this.map,position:{lat:parseFloat(s.lat),lng:parseFloat(s.lng)}});s.info&&google.maps.event.addListener(o,"click",function(){a.setContent(`
2                        <h2 class="text-base font-semibold text-primary">${s.info}</h2>
3                    `),a.open(this.map,o)}),e.extend(o.position),this.markers.push(o)}),this.mapData.push({instance:this.map,bounds:e,markers:this.markers}),this.markers.length>1&&this.map.fitBounds(e),this.map.setCenter(e.getCenter())}}export{g as default};

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.