function initMap() {
var centre = {lat: 47.9217, lng: 0.16558} ;
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: 47.81393600, lng: -0.08674300,
nom: 'Camping Port Sainte Marie',url: '/hotspot-wifi-camping-malicorne-sur-sarthe-camping-port-sainte-marie-343.html',ville: 'Malicorne Sur Sarthe', activite: 'Camping'},
{lat: 47.65520380, lng: 0.16629280,
nom: 'Camping Au Bord du Loir',url: '/hotspot-wifi-camping-le-lude-camping-au-bord-du-loir-358.html',ville: 'Le Lude', activite: 'Camping'},
{lat: 48.04863080, lng: 0.17195960,
nom: 'Le Village Hollandais',url: '/hotspot-wifi-bar-brasserie-saint-saturnin-le-village-hollandais-957.html',ville: 'Saint Saturnin', activite: 'Bar brasserie'},
{lat: 47.72791930, lng: 0.57501800,
nom: 'Le Celtique',url: '/hotspot-wifi-bar-tabac-la-chartre-sur-le-loir-le-celtique-1040.html',ville: 'La Chartre Sur le Loir', activite: 'Bar tabac'},
{lat: 47.99346380, lng: 0.10718270,
nom: 'Bar le Randonneur',url: '/hotspot-wifi-bar-brasserie-pruille-le-chetif-bar-le-randonneur-1109.html',ville: 'Pruille le Chétif', activite: 'Bar brasserie'},
{lat: 48.02597960, lng: 0.21387200,
nom: 'Jsc les 3 Vallées',url: '/hotspot-wifi-collectif-coulaines-jsc-les-3-vallees-1364.html',ville: 'Coulaines', activite: 'Collectif'},
{lat: 47.91528370, lng: 0.15805260,
nom: 'Camping du Houssay',url: '/hotspot-wifi-camping-spay-camping-du-houssay-5367.html',ville: 'Spay', activite: 'Camping'},
{lat: 48.34774190, lng: 0.37278060,
nom: 'Maison des Sports',url: '/hotspot-wifi-collectif-mamers-maison-des-sports-6463.html',ville: 'Mamers', activite: 'Collectif'},
{lat: 48.35510600, lng: 0.37166400,
nom: 'Camping de Mamers',url: '/hotspot-wifi-camping-mamers-camping-de-mamers-6472.html',ville: 'Mamers', activite: 'Camping'},
{lat: 48.00461580, lng: 0.19609290,
nom: 'Lk Food',url: '/hotspot-wifi-restaurant-le-mans-lk-food-6954.html',ville: 'Le Mans', activite: 'Restaurant'},
{lat: 47.91260500, lng: 0.24720500,
nom: 'Mulsanne-L Oree des Pins',url: '/hotspot-wifi-ehpad-mulsanne-mulsanne-l-oree-des-pins-7277.html',ville: 'Mulsanne', activite: 'EHPAD'},
{lat: 47.99472720, lng: 0.19146090,
nom: 'Ibis Styles le Mans Centre Gare',url: '/hotspot-wifi-hotel-le-mans-ibis-styles-le-mans-centre-gare-7356.html',ville: 'Le Mans', activite: 'Hôtel'},
{lat: 47.94655090, lng: 0.17879430,
nom: 'Hôtel Inn Design',url: '/hotspot-wifi-hotel-arnage-hotel-inn-design-8075.html',ville: 'Arnage', activite: 'Hôtel'},
{lat: 48.00174540, lng: 0.20255480,
nom: 'Mercure le Mans Centre',url: '/hotspot-wifi-hotel-le-mans-mercure-le-mans-centre-8620.html',ville: 'Le Mans', activite: 'Hôtel'},
{lat: 48.00423100, lng: 0.19701400,
nom: 'Le Globe',url: '/hotspot-wifi-bar-brasserie-le-mans-le-globe-9425.html',ville: 'Le Mans', activite: 'Bar brasserie'},
{lat: 47.69615840, lng: -0.07455930,
nom: 'Maison de Quartier Verron',url: '/hotspot-wifi-espace-public-la-fleche-maison-de-quartier-verron-9514.html',ville: 'La Fleche', activite: 'Espace public'},
{lat: 47.69615840, lng: -0.07455930,
nom: 'Espace Pierre Mendès France',url: '/hotspot-wifi-mairie-la-fleche-espace-pierre-mendes-france-9527.html',ville: 'La Fleche', activite: 'Mairie'},
{lat: 47.69750738, lng: -0.07321032,
nom: 'Place de la Libération',url: '/hotspot-wifi-mairie-la-fleche-place-de-la-liberation-9740.html',ville: 'La Fleche', activite: 'Mairie'},
{lat: 47.69614900, lng: -0.07451900,
nom: 'Place du Marché Au Blé',url: '/hotspot-wifi-mairie-la-fleche-place-du-marche-au-ble-9742.html',ville: 'La Flèche', activite: 'Mairie'},
{lat: 48.00053120, lng: 0.19677610,
nom: 'Concordia',url: '/hotspot-wifi-hotel-le-mans-concordia-9789.html',ville: 'Le Mans', activite: 'Hôtel'},
{lat: 47.69615840, lng: -0.07455930,
nom: 'Place Henri Iv',url: '/hotspot-wifi-mairie-la-fleche-place-henri-iv-9883.html',ville: 'La Flèche', activite: 'Mairie'},
{lat: 48.01027900, lng: 0.16140900,
nom: 'Seenovia le Mans',url: '/hotspot-wifi-societe-le-mans-seenovia-le-mans-9904.html',ville: 'Le Mans', activite: 'Société'},
{lat: 44.01974100, lng: 1.35386400,
nom: 'Moulin de la Bruère',url: '/hotspot-wifi-espace-public-la-fleche-moulin-de-la-bruere-10182.html',ville: 'La Flèche', activite: 'Espace public'},
{lat: 47.84280470, lng: -0.33133780,
nom: 'Hotel Inn Design',url: '/hotspot-wifi-hotel-sable-sur-sarthe-hotel-inn-design-10408.html',ville: 'Sable Sur Sarthe', activite: 'Hôtel'},
{lat: 44.51870700, lng: 0.22149300,
nom: 'Logement Monnerie',url: '/hotspot-wifi-espace-public-la-fleche-logement-monnerie-10538.html',ville: 'La Flèche', activite: 'Espace public'},
{lat: 47.99986360, lng: 0.20297040,
nom: 'Mercure Seminaire',url: '/hotspot-wifi-hotel-le-mans-mercure-seminaire-10918.html',ville: 'Le Mans', activite: 'Hôtel'},
{lat: 48.00213900, lng: 0.20251890,
nom: 'Ibis Budget',url: '/hotspot-wifi-hotel-le-mans-ibis-budget-11256.html',ville: 'Le Mans', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Le Newport',url: '/hotspot-wifi-bar-brasserie-le-mans-le-newport-11366.html',ville: 'Le Mans', activite: 'Bar brasserie'},
{lat: 47.83120800, lng: 0.20803200,
nom: 'Commune de St-Ouen-En-Belin - Salle Audonienne',url: '/hotspot-wifi-centre-culturel-st-ouen-en-belin-commune-de-st-ouen-en-belin-salle-audonienne-12218.html',ville: 'St Ouen En Belin', activite: 'Centre culturel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Feuillette Yvré L\'Evêque',url: '/hotspot-wifi-sandwicherie-yvre-l-eveque-feuillette-yvre-l-eveque-12338.html',ville: 'Yvré L\'Evêque', activite: 'Sandwicherie'},
{lat: 47.94745800, lng: 0.23575800,
nom: 'Ac-Concepts',url: '/hotspot-wifi-societe-ruaudin-ac-concepts-12367.html',ville: 'Ruaudin', activite: 'Société'},
{lat: 48.15982900, lng: -0.19840500,
nom: 'Commune de Rouesse Vasse',url: '/hotspot-wifi-mairie-rouesse-vasse-commune-de-rouesse-vasse-12473.html',ville: 'Rouesse Vasse', activite: 'Mairie'},
{lat: 48.00167340, lng: 0.19647910,
nom: 'Mulligan\'S Pub',url: '/hotspot-wifi-bar-brasserie-le-mans-mulligan-s-pub-12735.html',ville: 'Le Mans', activite: 'Bar brasserie'}
]