function initMap() {
var centre = {lat: 42.94, lng: 1.48} ;
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: 48.84128230, lng: 2.30087520,
nom: 'Hotel Amiral',url: '/hotspot-wifi-hotel-paris-hotel-amiral-1168.html',ville: 'Paris', activite: 'Hôtel'},
{lat: 42.86402880, lng: 1.20135580,
nom: 'Mairie de Seix',url: '/hotspot-wifi-mairie-seix-mairie-de-seix-5740.html',ville: 'Seix', activite: 'Mairie'},
{lat: 42.86319350, lng: 1.20179600,
nom: 'Auberge du Haut Salat',url: '/hotspot-wifi-hotel-seix-auberge-du-haut-salat-8063.html',ville: 'Seix', activite: 'Hôtel'},
{lat: 42.78402000, lng: 1.29876100,
nom: 'Chalet la Pause de L\'Ours',url: '/hotspot-wifi-gite-chambres-d-hotes-ustou-chalet-la-pause-de-l-ours-10520.html',ville: 'Ustou', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.01366200, lng: 1.92922300,
nom: 'Camping le Rocdelrey',url: '/hotspot-wifi-camping-belloc-camping-le-rocdelrey-10758.html',ville: 'Belloc', activite: 'Camping'},
{lat: 43.07863870, lng: 1.37266280,
nom: 'Camping le Petit Pyrénéen',url: '/hotspot-wifi-camping-le-mas-d-azil-camping-le-petit-pyreneen-11393.html',ville: 'Le Mas D\'Azil', activite: 'Camping'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Les Oustalous',url: '/hotspot-wifi-gite-chambres-d-hotes-les-cabannes-les-oustalous-12543.html',ville: 'Les Cabannes', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 42.99536300, lng: 1.61583700,
nom: 'Epnak_dispositif_foix',url: '/hotspot-wifi-ecole-foix-epnak_dispositif_foix-12606.html',ville: 'Foix', activite: 'Ecole'}
]