There is no listing to display in this city. Be the first to add a business listing on this page.
const listingsDataIsEmpty = true;
// Hide the map if listingsDataIsEmpty is true
if (listingsDataIsEmpty === true) {
const mapDiv = document.getElementById('map-button');
if (mapDiv) {
//mapDiv.style.display = 'none'; // Hide the div using inline style
//Or you can add a class that has display:none;
mapDiv.classList.add('invisible');
}
}
// Define multiple markers location, latitude, and longitude
const locations = [
];
// Initialize the map
function initMap() {
// Set fixed center (London) and zoom level
const mapCenter = { lat: 51.5074, lng: -0.1278 }; // Latitude and longitude for London
const fixedZoom = 10; // Fixed zoom level
// Initialize the map
const map = new google.maps.Map(document.getElementById('Mymap'), {
center: mapCenter,
zoom: fixedZoom
});
// Add markers to the map
locations.forEach(location => {
const marker = new google.maps.Marker({
position: { lat: location[0], lng: location[1] },
map: map,
title: location[2] // Optional: Add a title to the marker
});
// Add info window (popup) to the marker
const infowindow = new google.maps.InfoWindow({
content: location[2] // HTML content for the popup
});
// Show info window when marker is clicked
marker.addListener('click', () => {
infowindow.open(map, marker);
});
});
}