import { getEvents } from 'backend/events.jsw'; import wixWindow from 'wix-window'; $w.onReady(async function () { try { const location = await wixWindow.getCurrentGeolocation(); const events = await getEvents(location); $w('#repeater9').data = events.map(event => ({ _id: event._id, name: event.name, date: event.date, url: event.url, image: event.image })); // Keep the rest of your code related to the map as is $w('#googleMaps1').location = { 'latitude': location.coords.latitude, 'longitude': location.coords.longitude, 'description': 'Click HERE to see outdoor events in your area.' }; $w('#googleMaps1').show(); } catch (error) { console.error('Error fetching events:', error); } });