function initMap() {
var centre = {lat: 44.25, lng: 2.72} ;
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.36036800, lng: 1.99127600,
nom: 'L\'Entrenous',url: '/hotspot-wifi-bar-brasserie-villefranche-de-touergue-l-entrenous-1279.html',ville: 'Villefranche de Touergue', activite: 'Bar brasserie'},
{lat: 44.07745410, lng: 3.02283880,
nom: 'Hotel Deltour Millau Eco',url: '/hotspot-wifi-hotel-millau-hotel-deltour-millau-eco-8108.html',ville: 'Millau', activite: 'Hôtel'},
{lat: 44.35098700, lng: 2.57124900,
nom: 'Sub 12 Rodez',url: '/hotspot-wifi-sandwicherie-rodez-sub-12-rodez-9831.html',ville: 'Rodez', activite: 'Sandwicherie'},
{lat: 44.56217210, lng: 2.27788840,
nom: 'Flowercamping Lac Aux Oiseaux',url: '/hotspot-wifi-camping-martiel-flowercamping-lac-aux-oiseaux-9969.html',ville: 'Martiel', activite: 'Camping'},
{lat: 44.59095700, lng: 2.92162000,
nom: 'Ehpad Abbe Pierre Romieu',url: '/hotspot-wifi-ehpad-saint-chely-d-aubrac-ehpad-abbe-pierre-romieu-9997.html',ville: 'Saint Chély D\'Aubrac', activite: 'EHPAD'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ehpad les Caselles',url: '/hotspot-wifi-ehpad-bozouls-ehpad-les-caselles-11097.html',ville: 'Bozouls', activite: 'EHPAD'},
{lat: 44.36023498, lng: 2.55924498,
nom: 'Hotel Deltour Rodez',url: '/hotspot-wifi-hotel-rodez-hotel-deltour-rodez-11162.html',ville: 'Rodez', activite: 'Hôtel'},
{lat: 46.57622000, lng: 0.33895900,
nom: 'Ehpad Résidence Jean Xxiii',url: '/hotspot-wifi-ehpad-rodez-ehpad-residence-jean-xxiii-11315.html',ville: 'Rodez', activite: 'EHPAD'},
{lat: 44.10661000, lng: 2.68950100,
nom: 'Camping Cantarelles',url: '/hotspot-wifi-camping-alrance-camping-cantarelles-12619.html',ville: 'Alrance', activite: 'Camping'}
]