function initMap() {
var centre = {lat: 44.62, lng: 1.6} ;
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 8,
center: centre
});
var tempMarkers = [];
var infoWindow = new google.maps.InfoWindow();
var marker, i;
for (var i = 0; i < locations.length; i++) {
var lat = locations[i].lat;
var lng = locations[i].lng;
marker = new google.maps.Marker({
position: new google.maps.LatLng(lat, lng),
map: map,
icon: 'https://cdn2.iconfinder.com/data/icons/flat-ui-icons-24-px/24/location-24-32.png'
});
tempMarkers.push(marker);
//markerCluster.addMarker(marker);
var prev_infowindow = false;
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
var contentString = ''+locations[i].nom+'
'+locations[i].activite+' à '+locations[i].ville;
var infoWindow = new google.maps.InfoWindow({
content: contentString
});
if (prev_infowindow) {
prev_infowindow.close();
}
prev_infowindow = infoWindow;
infoWindow.open(map, marker);
}
})(marker, i));
}
var markerCluster = new MarkerClusterer(map,tempMarkers,{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'});
}
var locations = [
{lat: 44.56629200, lng: 1.65339400,
nom: 'Les Sentiers du Causse',url: '/hotspot-wifi-gite-chambres-d-hotes-lentillac-du-causse-les-sentiers-du-causse-5620.html',ville: 'Lentillac du Causse', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 44.46607000, lng: 1.42838200,
nom: 'Hotel Deltour Cahors',url: '/hotspot-wifi-hotel-cahors-hotel-deltour-cahors-8101.html',ville: 'Cahors', activite: 'Hôtel'},
{lat: 44.78455000, lng: 1.98447700,
nom: 'Accueil En Quercy',url: '/hotspot-wifi-hotel-terrou-accueil-en-quercy-8127.html',ville: 'Terrou', activite: 'Hôtel'},
{lat: 44.48460500, lng: 1.83929600,
nom: 'Camping Municipal le Terriol**',url: '/hotspot-wifi-camping-cajarc-camping-municipal-le-terriol-9982.html',ville: 'Cajarc', activite: 'Camping'},
{lat: 44.93973390, lng: 1.92949500,
nom: 'Camping du Lac',url: '/hotspot-wifi-camping-laval-de-cere-camping-du-lac-10767.html',ville: 'Laval de Cere', activite: 'Camping'}
]