function initMap() {
var mapElement = document.querySelector('.elementor-widget-google_maps iframe');
if (!mapElement) {
console.error('Google Maps iframe not found');
return;
}
var mapSrc = mapElement.src;
// Define location bias (latitude, longitude)
var locationBias = '35.7796,78.6382'; // Example: San Francisco, CA
// Check if URL already has parameters
if (mapSrc.includes('?')) {
mapSrc += `&location=${locationBias}`;
} else {
mapSrc += `?location=${locationBias}`;
}
// Apply the new src with location bias
mapElement.src = mapSrc;
}
// Run the function after the page has loaded
document.addEventListener('DOMContentLoaded', initMap);