1const initGoMapsManualApiLoader = () => { 2 const mapElements = document.querySelectorAll('.js-map[data-google-maps-library]'); 3 4 if (!mapElements.length) { 5 return; 6 } 7 8 // go-maps-ext lädt die Google API selbst, wenn include_google_api_manually = 0. 9 // In diesem Fall darf der lokale Loader nichts tun, um Doppel-Loads zu vermeiden. 10 if (window.txGoMapsExtLibrary) { 11 return; 12 } 13 14 const areMapsPrepared = () => Array.from(mapElements).every((mapElement) => ( 15 mapElement.gomapsext && mapElement.gomapsext.gme 16 )); 17 18 const initializeExistingApi = () => { 19 if (window.__goMapsExtManualApiInitialized) { 20 return; 21 } 22 23 if (typeof window.goMapsExtLoaded !== 'function') { 24 window.setTimeout(initializeExistingApi, 50); 25 return; 26 } 27 28 if (!window.google || !window.google.maps || typeof window.google.maps.InfoWindow !== 'function') { 29 window.setTimeout(initializeExistingApi, 50); 30 return; 31 } 32 33 if (!areMapsPrepared()) { 34 window.setTimeout(initializeExistingApi, 50); 35 return; 36 } 37 38 window.__goMapsExtManualApiInitialized = true; 39 window.goMapsExtLoaded(); 40 }; 41 42 if (window.google && window.google.maps && typeof window.google.maps.InfoWindow === 'function') { 43 initializeExistingApi(); 44 return; 45 } 46 47 if (document.querySelector('script[data-go-maps-ext-google-api="1"]')) { 48 return; 49 } 50 51 const apiUrl = mapElements[0].dataset.googleMapsLibrary; 52 53 if (!apiUrl) { 54 return; 55 } 56 57 const script = document.createElement('script'); 58 script.src = apiUrl; 59 script.async = true; 60 script.defer = true; 61 script.dataset.goMapsExtGoogleApi = '1'; 62 document.head.appendChild(script); 63}; 64 65if (document.readyState === 'loading') { 66 document.addEventListener('DOMContentLoaded', initGoMapsManualApiLoader); 67} else { 68 initGoMapsManualApiLoader(); 69} 70
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.