function initMap() {
var centre = {lat: 43.08, lng: 2.36} ;
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: 43.36769300, lng: 2.51941500,
nom: 'Mairie de Lespinassiere',url: '/hotspot-wifi-mairie-lespinassiere-mairie-de-lespinassiere-1480.html',ville: 'Lespinassiere', activite: 'Mairie'},
{lat: 42.95719720, lng: 2.84057210,
nom: 'Mairie de Saint Jean de Barrou',url: '/hotspot-wifi-mairie-saint-jean-de-barrou-mairie-de-saint-jean-de-barrou-3292.html',ville: 'Saint Jean de Barrou', activite: 'Mairie'},
{lat: 42.91706400, lng: 2.04669500,
nom: 'Eurl Buvette du Lac',url: '/hotspot-wifi-bar-restaurant-puiveert-eurl-buvette-du-lac-4703.html',ville: 'Puiveert', activite: 'Bar restaurant'},
{lat: 42.81008050, lng: 2.30704900,
nom: 'Mairie de Lapradelle',url: '/hotspot-wifi-mairie-puilaurens-lapradelle-mairie-de-lapradelle-4773.html',ville: 'Puilaurens-Lapradelle', activite: 'Mairie'},
{lat: 43.29827000, lng: 2.22143800,
nom: 'Camping de Montolieu',url: '/hotspot-wifi-camping-montolieu-camping-de-montolieu-7961.html',ville: 'Montolieu', activite: 'Camping'},
{lat: 42.80059800, lng: 2.30505100,
nom: 'Mairie Lapradelle',url: '/hotspot-wifi-mairie-lapradelle-puilaurens-mairie-lapradelle-8012.html',ville: 'Lapradelle Puilaurens', activite: 'Mairie'},
{lat: 42.80279840, lng: 2.22809460,
nom: 'Co-Working Axat',url: '/hotspot-wifi-mairie-axat-co-working-axat-8021.html',ville: 'Axat', activite: 'Mairie'},
{lat: 42.99966020, lng: 2.81889160,
nom: 'Camping Municipal L\'Espazo',url: '/hotspot-wifi-camping-durban-corbieres-camping-municipal-l-espazo-8068.html',ville: 'Durban.corbières', activite: 'Camping'},
{lat: 43.31068160, lng: 2.21425720,
nom: 'Bar Restaurant Casquette Et Chapeau',url: '/hotspot-wifi-restaurant-montolieu-bar-restaurant-casquette-et-chapeau-8094.html',ville: 'Montolieu', activite: 'Restaurant'},
{lat: 43.18987010, lng: 3.02928460,
nom: 'Le Campus - Batiment A',url: '/hotspot-wifi-residence-etudiante-narbonne-le-campus-batiment-a-8100.html',ville: 'Narbonne', activite: 'Résidence étudiante'},
{lat: 43.18727020, lng: 3.03026360,
nom: 'Le Campus - Batiment B',url: '/hotspot-wifi-residence-etudiante-narbonne-le-campus-batiment-b-8111.html',ville: 'Narbonne', activite: 'Résidence étudiante'},
{lat: 43.19913100, lng: 2.75846100,
nom: 'Wifi Mediatheque (ares)',url: '/hotspot-wifi-mairie-lezignan-les-corbieres-wifi-mediatheque-ares-10270.html',ville: 'Lezignan les Corbieres', activite: 'Mairie'},
{lat: 43.13308300, lng: 3.13448100,
nom: 'Centre de Vacance Carsat Auvergne',url: '/hotspot-wifi-residence-de-services-gruissan-centre-de-vacance-carsat-auvergne-10612.html',ville: 'Gruissan', activite: 'Résidence de services'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Médiathèque Espéraza',url: '/hotspot-wifi-bibliotheque-esperaza-mediatheque-esperaza-11171.html',ville: 'Esperaza', activite: 'Bibliothèque '},
{lat: 43.24814090, lng: 2.76751500,
nom: 'Locaboat Argens',url: '/hotspot-wifi-societe-argens-minervois-locaboat-argens-11291.html',ville: 'Argens-Minervois', activite: 'Société'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Mairie de Maisons',url: '/hotspot-wifi-mairie-maisons-mairie-de-maisons-11881.html',ville: 'Maisons', activite: 'Mairie'},
{lat: 43.25358800, lng: 2.17793800,
nom: 'Mairie D\'Alzonne Esplanade',url: '/hotspot-wifi-mairie-alzonne-mairie-d-alzonne-esplanade-12366.html',ville: 'Alzonne', activite: 'Mairie'},
{lat: 43.20483500, lng: 2.39872300,
nom: 'Audotel',url: '/hotspot-wifi-hotel-carcassonne-audotel-12613.html',ville: 'Carcassonne', activite: 'Hôtel'}
]