function initMap() {
var centre = {lat: 46.2476, lng: 5.13077} ;
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: 45.74019580, lng: 5.70156110,
nom: 'Les Gîtes des Ecassaz',url: '/hotspot-wifi-gite-chambres-d-hotes-belley-les-gites-des-ecassaz-993.html',ville: 'Belley', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 45.84804800, lng: 5.78786730,
nom: 'Hotel Restaurant le Cardinal',url: '/hotspot-wifi-bar-restaurant-culoz-hotel-restaurant-le-cardinal-1356.html',ville: 'Culoz', activite: 'Bar restaurant'},
{lat: 45.73182490, lng: 5.68803070,
nom: 'Gite Lallagnier',url: '/hotspot-wifi-gite-chambres-d-hotes-brens-gite-lallagnier-1685.html',ville: 'Brens', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 46.30874540, lng: 4.94120540,
nom: 'Roulottes de Bresse',url: '/hotspot-wifi-gite-chambres-d-hotes-bage-la-ville-roulottes-de-bresse-4705.html',ville: 'Bagé-La-Ville', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 45.84825780, lng: 5.78043590,
nom: 'Médiathèque de Culoz',url: '/hotspot-wifi-bibliotheque-culoz-mediatheque-de-culoz-4706.html',ville: 'Culoz', activite: 'Bibliothèque '},
{lat: 46.00052600, lng: 4.84858290,
nom: 'Carpe Diem',url: '/hotspot-wifi-bar-restaurant-savignieux-carpe-diem-6103.html',ville: 'Savignieux', activite: 'Bar restaurant'},
{lat: 45.74958820, lng: 5.69236730,
nom: 'Belley-Les Jardins Medicis',url: '/hotspot-wifi-ehpad-belley-belley-les-jardins-medicis-6538.html',ville: 'Belley', activite: 'EHPAD'},
{lat: 46.26380720, lng: 6.02835570,
nom: 'Restaurant Jardins de Malyar',url: '/hotspot-wifi-restaurant-saint-genis-pouilly-restaurant-jardins-de-malyar-7254.html',ville: 'Saint Genis Pouilly', activite: 'Restaurant'},
{lat: 45.75921468, lng: 5.69114848,
nom: 'Médiathèque',url: '/hotspot-wifi-mairie-belley-mediatheque-8354.html',ville: 'Belley', activite: 'Mairie'},
{lat: 46.33211700, lng: 6.05830400,
nom: 'Le Lingot D\'Orge',url: '/hotspot-wifi-bar-brasserie-gex-le-lingot-d-orge-10029.html',ville: 'Gex', activite: 'Bar brasserie'},
{lat: 45.74950500, lng: 5.69078100,
nom: 'Belley-Belley Village',url: '/hotspot-wifi-ehpad-belley-belley-belley-village-10176.html',ville: 'Belley', activite: 'EHPAD'},
{lat: 45.75065900, lng: 5.70990000,
nom: 'La Raffinerie Belley',url: '/hotspot-wifi-bar-brasserie-belley-la-raffinerie-belley-10271.html',ville: 'Belley', activite: 'Bar brasserie'},
{lat: 46.31084500, lng: 6.07108300,
nom: 'L\'Incontro',url: '/hotspot-wifi-restaurant-cessy-l-incontro-10872.html',ville: 'Cessy', activite: 'Restaurant'},
{lat: 46.12459200, lng: 5.81201700,
nom: 'Idéal Pneu Valserhône',url: '/hotspot-wifi-centre-automobile-valserhone-ideal-pneu-valserhone-11024.html',ville: 'Valserhone', activite: 'Centre automobile'}
]