1// /assets/js/gtc-maps.js 2(function () { 3 function initAllMaps() { 4 if (!window.google || !google.maps) return; 5 6 document.querySelectorAll(".js-gtc-map").forEach((el) => { 7 if (el.dataset.inited === "1") return; 8 9 const lat = parseFloat(el.dataset.lat); 10 const lng = parseFloat(el.dataset.lng); 11 const zoom = parseInt(el.dataset.zoom || "4", 10); 12 const title = el.dataset.title || ""; 13 14 const map = new google.maps.Map(el, { 15 center: { lat, lng }, 16 zoom, 17 styles: window.GTC_MAP_STYLE || null, 18 mapTypeControl: false, 19 streetViewControl: false, 20 fullscreenControl: false, 21 }); 22 23 new google.maps.Marker({ 24 position: { lat, lng }, 25 map, 26 title, 27 }); 28 29 el.dataset.inited = "1"; 30 }); 31 } 32 33 // If Maps loads after DOM 34 document.addEventListener("DOMContentLoaded", initAllMaps); 35 36 // Also try immediately (in case DOM already loaded + maps already present) 37 window.initAllMaps = initAllMaps; 38 initAllMaps(); 39})();
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.