function initMap() {
var centre = {lat: 48.6389, lng: 0.0848201} ;
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.53419230, lng: -0.48121170,
nom: 'Mediatheque',url: '/hotspot-wifi-collectif-la-chapelle-d-andaine-mediatheque-1420.html',ville: 'La Chapelle D\'Andaine', activite: 'Collectif'},
{lat: 48.55680330, lng: -0.41331040,
nom: 'Bagnoles Hotel - Bistrot Gourmand',url: '/hotspot-wifi-hotel-bagnoles-de-l-orne-bagnoles-hotel-bistrot-gourmand-3139.html',ville: 'Bagnoles de L\'Orne', activite: 'Hôtel'},
{lat: 48.56435800, lng: -0.49890300,
nom: 'Creperie de la Tour de Bonvouloir',url: '/hotspot-wifi-bar-restaurant-juvigny-val-d-andaine-creperie-de-la-tour-de-bonvouloir-6726.html',ville: 'Juvigny Val D\'Andaine', activite: 'Bar restaurant'},
{lat: 48.55054970, lng: -0.42106520,
nom: 'Hotel** Restaurant Bellevue',url: '/hotspot-wifi-hotel-bagnoles-de-l-orne-hotel-restaurant-bellevue-6858.html',ville: 'Bagnoles de L\'Orne', activite: 'Hôtel'},
{lat: 48.69863000, lng: -0.36839200,
nom: 'Bar du Centre',url: '/hotspot-wifi-bar-tabac-briouze-bar-du-centre-6898.html',ville: 'Briouze', activite: 'Bar tabac'},
{lat: 48.51190690, lng: 0.35476520,
nom: 'Bar de France',url: '/hotspot-wifi-bar-tabac-le-mele-sur-sarthe-bar-de-france-7240.html',ville: 'Le Mele Sur Sarthe', activite: 'Bar tabac'},
{lat: 48.55436500, lng: -0.41525500,
nom: 'Hôtel du Roc Au Chien',url: '/hotspot-wifi-hotel-bagnoles-de-l-orne-hotel-du-roc-au-chien-8395.html',ville: 'Bagnoles de L\'Orne', activite: 'Hôtel'},
{lat: 48.44955100, lng: 0.09743640,
nom: 'Hôtel Inn Design',url: '/hotspot-wifi-hotel-valframbert-hotel-inn-design-8405.html',ville: 'Valframbert', activite: 'Hôtel'},
{lat: 48.44781700, lng: 0.57404400,
nom: 'Gîte \'Le Montgacel\'',url: '/hotspot-wifi-gite-chambres-d-hotes-le-pin-la-garenne-gite-le-montgacel-8665.html',ville: 'Le Pin la Garenne', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.44781700, lng: 0.57404400,
nom: 'Gîte \"les Merisiers\"',url: '/hotspot-wifi-gite-chambres-d-hotes-le-pin-la-garenne-gite-les-merisiers-8666.html',ville: 'Le Pin la Garenne', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.51141130, lng: 0.35219850,
nom: 'Gîtes le Mêle Sur Sarthe',url: '/hotspot-wifi-gite-chambres-d-hotes-le-mele-sur-sarthe-gites-le-mele-sur-sarthe-8844.html',ville: 'Le Mêle Sur Sarthe', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.73928000, lng: -0.02426500,
nom: 'Bar de L\'Ouest',url: '/hotspot-wifi-bar-tabac-argentan-bar-de-l-ouest-9275.html',ville: 'Argentan', activite: 'Bar tabac'},
{lat: 48.50891300, lng: 0.35659500,
nom: 'Camping la Prairie',url: '/hotspot-wifi-camping-le-mele-sur-sarthe-camping-la-prairie-9438.html',ville: 'Le Mele Sur Sarthe', activite: 'Camping'},
{lat: 48.55966180, lng: -0.41559210,
nom: 'Bois Joli',url: '/hotspot-wifi-hotel-bagnoles-de-l-orne-bois-joli-9535.html',ville: 'Bagnoles de L\'Orne', activite: 'Hôtel'},
{lat: 48.53049700, lng: 0.40124800,
nom: 'Ehpad Residence Fleurie',url: '/hotspot-wifi-ehpad-coulonges-sur-sarthe-ehpad-residence-fleurie-9875.html',ville: 'Coulonges Sur Sarthe', activite: 'EHPAD'},
{lat: 48.44157800, lng: 0.47268900,
nom: 'Gite Gouin',url: '/hotspot-wifi-gite-chambres-d-hotes-saint-jouin-de-blavou-gite-gouin-9978.html',ville: 'Saint Jouin de Blavou', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.54164500, lng: 0.90322700,
nom: 'La Bonne Franquette',url: '/hotspot-wifi-bar-tabac-neuilly-sur-eure-la-bonne-franquette-9989.html',ville: 'Neuilly Sur Eure', activite: 'Bar tabac'},
{lat: 48.53574900, lng: 0.34231200,
nom: 'Salle des Fêtes',url: '/hotspot-wifi-mairie-saint-aubin-d-appenai-salle-des-fetes-10134.html',ville: 'Saint Aubin D\'Appenai', activite: 'Mairie'},
{lat: 48.58963500, lng: -0.35732900,
nom: 'Le Vincennes',url: '/hotspot-wifi-bar-tabac-le-ferte-mace-le-vincennes-10200.html',ville: 'Le Ferte Mace', activite: 'Bar tabac'},
{lat: 48.41161900, lng: 0.08940600,
nom: 'Epnak Esrp Grand Ouest-Alencon',url: '/hotspot-wifi-ecole-alencon-epnak-esrp-grand-ouest-alencon-10272.html',ville: 'Alencon', activite: 'Ecole'},
{lat: 48.55839900, lng: -0.41509100,
nom: 'La Chaumière',url: '/hotspot-wifi-gite-chambres-d-hotes-bagnoles-de-l-orne-la-chaumiere-10414.html',ville: 'Bagnoles de L\'Orne', activite: 'Gîte / Chambres d\'hôtes'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Brit Hotel du Dauphin',url: '/hotspot-wifi-hotel-l-aigle-brit-hotel-du-dauphin-11154.html',ville: 'L\'Aigle', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Gîtes \"les Fauvettes & les Iris\"',url: '/hotspot-wifi-gite-chambres-d-hotes-le-pin-la-garenne-gites-les-fauvettes-les-iris-11179.html',ville: 'Le Pin la Garenne', activite: 'Gîte / Chambres d\'hôtes'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Mairie Marchemaisons',url: '/hotspot-wifi-espace-public-marchemaisons-mairie-marchemaisons-11180.html',ville: 'Marchemaisons', activite: 'Espace public'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Gîte la Robinière',url: '/hotspot-wifi-gite-chambres-d-hotes-saint-germain-de-martigny-gite-la-robiniere-11516.html',ville: 'Saint Germain de Martigny', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.88036600, lng: 2.39925600,
nom: 'Fiteco L\'Aigle',url: '/hotspot-wifi-societe-l-aigle-fiteco-l-aigle-12051.html',ville: 'L\'Aigle', activite: 'Société'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Fiteco Alencon',url: '/hotspot-wifi-societe-vlaframbert-fiteco-alencon-12056.html',ville: 'Vlaframbert', activite: 'Société'},
{lat: 48.73269100, lng: -0.57741100,
nom: 'Fiteco Flers',url: '/hotspot-wifi-societe-flers-fiteco-flers-12287.html',ville: 'Flers', activite: 'Société'},
{lat: 48.51270500, lng: 0.35276400,
nom: 'Hotel de la Poste',url: '/hotspot-wifi-hotel-le-mele-sur-sarthe-hotel-de-la-poste-12511.html',ville: 'Le Mele Sur Sarthe', activite: 'Hôtel'}
]