function initMap() {
var centre = {lat: 49.1147, lng: -1.31159} ;
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.67894300, lng: -1.34675440,
nom: 'Espace Mosaïque',url: '/hotspot-wifi-centre-de-loisirs-avranches-espace-mosaique-830.html',ville: 'Avranches', activite: 'Centre de loisirs'},
{lat: 48.83822260, lng: -1.58171960,
nom: 'Brit Hotel Essentiel de Granville',url: '/hotspot-wifi-hotel-granville-brit-hotel-essentiel-de-granville-1257.html',ville: 'Granville', activite: 'Hôtel'},
{lat: 49.63272030, lng: -1.58320560,
nom: 'Première Classe Cherbourg',url: '/hotspot-wifi-hotel-tourlaville-premiere-classe-cherbourg-2500.html',ville: 'Tourlaville', activite: 'Hôtel'},
{lat: 48.83782290, lng: -1.58946140,
nom: 'Café de la Gare',url: '/hotspot-wifi-bar-tabac-granville-cafe-de-la-gare-2934.html',ville: 'Granville', activite: 'Bar tabac'},
{lat: 49.65836130, lng: -1.67705450,
nom: 'Centre Aquatique Equeurdreville-Hainneville',url: '/hotspot-wifi-centre-de-loisirs-equeurdreville-hainneville-centre-aquatique-equeurdreville-hainneville-3294.html',ville: 'Equeurdreville-Hainneville', activite: 'Centre de loisirs'},
{lat: 49.58582740, lng: -1.26439920,
nom: 'Le Débarcadère',url: '/hotspot-wifi-bar-brasserie-saint-vaast-la-hougue-le-debarcadere-5075.html',ville: 'Saint-Vaast-La-Hougue', activite: 'Bar brasserie'},
{lat: 48.52377370, lng: -1.32381170,
nom: 'Office de Tourisme Saint-James',url: '/hotspot-wifi-office-de-tourisme-saint-james-office-de-tourisme-saint-james-6222.html',ville: 'Saint-James', activite: 'Office de tourisme'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Com. D\'Agglo. Mont Saint-Michel Normandie - Espace Eco',url: '/hotspot-wifi-espace-public-saint-james-com-d-agglo-mont-saint-michel-normandie-espace-eco-6300.html',ville: 'Saint James', activite: 'Espace public'},
{lat: 48.61407500, lng: -1.49833600,
nom: 'St Michel Café Ardevon',url: '/hotspot-wifi-sandwicherie-ardevon-st-michel-cafe-ardevon-6303.html',ville: 'Ardevon', activite: 'Sandwicherie'},
{lat: 48.98219510, lng: -1.55827460,
nom: 'Camping la Sirène',url: '/hotspot-wifi-camping-montmartin-sur-mer-camping-la-sirene-7264.html',ville: 'Montmartin Sur Mer', activite: 'Camping'},
{lat: 49.51389720, lng: -1.80699190,
nom: 'Au Café du Coin',url: '/hotspot-wifi-bar-restaurant-les-pieux-au-cafe-du-coin-7373.html',ville: 'Les Pieux', activite: 'Bar restaurant'},
{lat: 49.00822000, lng: -1.55448200,
nom: 'Camping du Havre de Regnéville',url: '/hotspot-wifi-camping-regneville-sur-mer-camping-du-havre-de-regneville-9078.html',ville: 'Regnéville-Sur-Mer', activite: 'Camping'},
{lat: 48.68244600, lng: -1.35495000,
nom: 'Caf de la Manche - Avranches',url: '/hotspot-wifi-espace-public-avranches-caf-de-la-manche-avranches-9526.html',ville: 'Avranches', activite: 'Espace public'},
{lat: 48.68244600, lng: -1.35495000,
nom: 'Caf de la Manche - Cherbourg',url: '/hotspot-wifi-espace-public-cherbourg-caf-de-la-manche-cherbourg-9547.html',ville: 'Cherbourg', activite: 'Espace public'},
{lat: 49.21909300, lng: -1.05388800,
nom: 'Fauvel',url: '/hotspot-wifi-societe-moon-sur-elle-fauvel-9848.html',ville: 'Moon-Sur-Elle', activite: 'Société'},
{lat: 49.11149100, lng: -1.08734700,
nom: 'Caf de la Manche - Saint Lô',url: '/hotspot-wifi-espace-public-saint-lo-caf-de-la-manche-saint-lo-10230.html',ville: 'Saint Lô', activite: 'Espace public'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Vikings Auto Saint Lo',url: '/hotspot-wifi-concession-automobile-saint-lo-vikings-auto-saint-lo-11029.html',ville: 'Saint Lo', activite: 'Concession automobile'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Vikings Auto Coutances',url: '/hotspot-wifi-centre-automobile-coutances-vikings-auto-coutances-11030.html',ville: 'Coutances', activite: 'Centre automobile'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Vikings Auto Granville',url: '/hotspot-wifi-centre-automobile-granville-vikings-auto-granville-11031.html',ville: 'Granville', activite: 'Centre automobile'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Vikings Auto Tourlaville',url: '/hotspot-wifi-concession-automobile-tourlaville-vikings-auto-tourlaville-11058.html',ville: 'Tourlaville', activite: 'Concession automobile'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Vikings Auto Audi Saint Lo',url: '/hotspot-wifi-centre-automobile-saint-lo-vikings-auto-audi-saint-lo-11296.html',ville: 'Saint Lo', activite: 'Centre automobile'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Passerelles Vers L\'Emploi',url: '/hotspot-wifi-collectif-avranches-passerelles-vers-l-emploi-11374.html',ville: 'Avranches', activite: 'Collectif'},
{lat: 49.65391800, lng: -1.65247400,
nom: 'Camping la Saline',url: '/hotspot-wifi-camping-equeurdreville-camping-la-saline-12008.html',ville: 'Equeurdreville', activite: 'Camping'},
{lat: 48.98215260, lng: -1.55614900,
nom: 'Camping les Dauphins',url: '/hotspot-wifi-camping-monmartin-sur-mer-camping-les-dauphins-12019.html',ville: 'Monmartin Sur Mer', activite: 'Camping'},
{lat: 49.51013200, lng: -1.46993300,
nom: 'Fiteco Valognes',url: '/hotspot-wifi-societe-valognes-fiteco-valognes-12284.html',ville: 'Valognes', activite: 'Société'}
]