Mapa Restaurantes

Cerca de tí:

No se pudo obtener tu ubicación.

Cargando restaurantes...

${restaurante.nombre}

${restaurante.distancia.toFixed(2)} km

Ver Restaurante Google Maps
`; fragment.appendChild(restaurantItem); }); // Eliminar botón anterior si existe const prevLoadMore = document.getElementById('load-more-btn-inline'); if (prevLoadMore) { prevLoadMore.remove(); } // Agregar botón si quedan más por cargar if (filteredRestaurants.length > currentPage * PAGE_SIZE) { const loadMoreItem = document.createElement('div'); loadMoreItem.id = 'load-more-btn-inline'; loadMoreItem.style = "text-align: center;"; const btn = document.createElement('button'); btn.textContent = "Cargar más"; btn.style = "padding: 10px 20px; background-color: #F8B233; color: white; font-weight: bold; border: none; border-radius: 25px; cursor: pointer; font-family: Arial, sans-serif;"; btn.addEventListener("click", () => { currentPage++; renderRestaurants(filterId, false); }); loadMoreItem.appendChild(btn); fragment.appendChild(loadMoreItem); } listContainer.appendChild(fragment); }; gastronomyFilter.addEventListener("change", (e) => { renderRestaurants(e.target.value, true); }); renderRestaurants("all", true); loadingElement.style.display = "none"; }); } } catch (error) { console.error("Error cargando restaurantes:", error); loadingElement.style.display = "none"; } } loadRestaurants();

No se pudo obtener tu ubicación.

${restaurante.nombre}

${distancia}

Ver Restaurante Abrir en Google Maps ` }); // Mostrar infowindow al hacer clic marker.addListener("click", () => { // Cerrar la InfoWindow abierta previamente, si existe if (openInfoWindow) { openInfoWindow.close(); } // Abrir la nueva InfoWindow infowindow.open(map, marker); openInfoWindow = infowindow; }); markers.push(marker); }); // Si hay restaurantes, centrar el mapa en el primero // if (filteredRestaurants.length > 0) { // map.setCenter({ lat: filteredRestaurants[0].lat, lng: //filteredRestaurants[0].lng }); // } }