function initMap() {
var centre = {lat: 48.7851, lng: 1.82566} ;
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.93674000, lng: 2.16740500,
nom: 'Espace St Paul - Musée de L\'Histoire',url: '/hotspot-wifi-mairie-sartrouville-espace-st-paul-musee-de-l-histoire-566.html',ville: 'Sartrouville', activite: 'Mairie'},
{lat: 48.78055800, lng: 2.01696090,
nom: 'Yprema Trappes',url: '/hotspot-wifi-societe-trappes-yprema-trappes-3025.html',ville: 'Trappes', activite: 'Société'},
{lat: 48.80582360, lng: 2.13530610,
nom: 'Cap Tonic Ver',url: '/hotspot-wifi-salle-de-sport-versailles-cap-tonic-ver-3355.html',ville: 'Versailles', activite: 'Salle de sport'},
{lat: 48.87860128, lng: 2.12124518,
nom: 'Cercle Sports Et Loisirs de la Banque de France',url: '/hotspot-wifi-centre-de-loisirs-bougival-cercle-sports-et-loisirs-de-la-banque-de-france-4694.html',ville: 'Bougival', activite: 'Centre de loisirs'},
{lat: 48.87736840, lng: 2.11501890,
nom: 'Le Port Marly-Residence Simon Vouet',url: '/hotspot-wifi-ehpad-le-port-marly-le-port-marly-residence-simon-vouet-6229.html',ville: 'Le Port Marly', activite: 'EHPAD'},
{lat: 48.78211220, lng: 1.81150550,
nom: 'Montfort L Amaury-Residence Medicis',url: '/hotspot-wifi-ehpad-montfort-l-amaury-montfort-l-amaury-residence-medicis-6452.html',ville: 'Montfort L Amaury', activite: 'EHPAD'},
{lat: 48.80390040, lng: 2.14283140,
nom: 'Versailles-Residence Services Seniors les Templitudes',url: '/hotspot-wifi-ehpad-versailles-versailles-residence-services-seniors-les-templitudes-6477.html',ville: 'Versailles', activite: 'EHPAD'},
{lat: 48.98345070, lng: 2.04757700,
nom: 'Andresy-Residence Andresy',url: '/hotspot-wifi-ehpad-andresy-andresy-residence-andresy-6590.html',ville: 'Andresy', activite: 'EHPAD'},
{lat: 48.95265330, lng: 1.85810400,
nom: 'Aubergenville-Les Jardins Medicis',url: '/hotspot-wifi-ehpad-aubergenville-aubergenville-les-jardins-medicis-6592.html',ville: 'Aubergenville', activite: 'EHPAD'},
{lat: 48.97643820, lng: 1.81025930,
nom: 'Gargenville-Le Clos St Jean',url: '/hotspot-wifi-ehpad-gargenville-gargenville-le-clos-st-jean-6626.html',ville: 'Gargenville', activite: 'EHPAD'},
{lat: 48.86005590, lng: 2.12032410,
nom: 'Noisy le Roi-Residence de Maintenon',url: '/hotspot-wifi-ehpad-noisy-le-roi-noisy-le-roi-residence-de-maintenon-6639.html',ville: 'Noisy le Roi', activite: 'EHPAD'},
{lat: 48.99171360, lng: 1.71385790,
nom: 'Mantes la Ville-La Fontaine Medicis Concordia',url: '/hotspot-wifi-ehpad-mantes-la-ville-mantes-la-ville-la-fontaine-medicis-concordia-6646.html',ville: 'Mantes la Ville', activite: 'EHPAD'},
{lat: 49.00102500, lng: 1.88693700,
nom: 'Mezy Sur Seine - les Jardins Medicis',url: '/hotspot-wifi-ehpad-mezy-sur-seine-mezy-sur-seine-les-jardins-medicis-6654.html',ville: 'Mezy Sur Seine', activite: 'EHPAD'},
{lat: 48.94044900, lng: 2.16048800,
nom: 'Sartrouville-Residence Medicis',url: '/hotspot-wifi-ehpad-sartrouville-sartrouville-residence-medicis-6675.html',ville: 'Sartrouville', activite: 'EHPAD'},
{lat: 48.75423460, lng: 1.92872540,
nom: 'Rev\'Hotel',url: '/hotspot-wifi-hotel-coignieres-rev-hotel-6724.html',ville: 'Coignieres', activite: 'Hôtel'},
{lat: 48.75423460, lng: 1.92872540,
nom: 'Rev\'Hotel - Freebox',url: '/hotspot-wifi-hotel-coignieres-rev-hotel-freebox-6761.html',ville: 'Coignieres', activite: 'Hôtel'},
{lat: 48.99945580, lng: 2.10057910,
nom: 'Conflans Ste Honorine-Residence de la Tour',url: '/hotspot-wifi-ehpad-conflans-ste-honorine-conflans-ste-honorine-residence-de-la-tour-7735.html',ville: 'Conflans Ste Honorine', activite: 'EHPAD'},
{lat: 48.99028600, lng: 1.67645700,
nom: 'Bms Mantes Buchelay',url: '/hotspot-wifi-centre-automobile-buchelay-bms-mantes-buchelay-8707.html',ville: 'Buchelay', activite: 'Centre automobile'},
{lat: 48.80894500, lng: 2.12536100,
nom: 'L\'éveil Gourmand',url: '/hotspot-wifi-sandwicherie-versailles-l-eveil-gourmand-9340.html',ville: 'Versailles', activite: 'Sandwicherie'},
{lat: 48.95439800, lng: 1.81315700,
nom: 'Médiathèque D\'Epone',url: '/hotspot-wifi-collectif-epone-mediatheque-d-epone-9952.html',ville: 'Epone', activite: 'Collectif'},
{lat: 48.92065200, lng: 2.18374800,
nom: 'Hôtel la Passerelle',url: '/hotspot-wifi-hotel-houilles-hotel-la-passerelle-10172.html',ville: 'Houilles', activite: 'Hôtel'},
{lat: 48.95663500, lng: 1.81361200,
nom: 'Ccas - Police Municipale',url: '/hotspot-wifi-mairie-epone-ccas-police-municipale-10221.html',ville: 'Epône', activite: 'Mairie'},
{lat: 48.95439800, lng: 1.81315700,
nom: 'Centre D\'Action Culturelle Dominique de Roux',url: '/hotspot-wifi-mairie-epone-centre-d-action-culturelle-dominique-de-roux-10569.html',ville: 'Epone', activite: 'Mairie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Amv 78sl',url: '/hotspot-wifi-ehpad-versailles-amv-78sl-11010.html',ville: 'Versailles', activite: 'EHPAD'},
{lat: 48.95345450, lng: 2.16454790,
nom: 'Maisons Laffitte-Residence du Parc',url: '/hotspot-wifi-ehpad-maisons-laffite-maisons-laffitte-residence-du-parc-12028.html',ville: 'Maisons Laffite', activite: 'EHPAD'},
{lat: 48.95756760, lng: 1.81261610,
nom: 'Mairie D\'Epône',url: '/hotspot-wifi-mairie-epone-mairie-d-epone-12029.html',ville: 'Epône', activite: 'Mairie'},
{lat: 48.99248000, lng: 1.71675800,
nom: 'Fiteco Mantes-La-Jolie',url: '/hotspot-wifi-societe-mantes-la-jolie-fiteco-mantes-la-jolie-12050.html',ville: 'Mantes-La-Jolie', activite: 'Société'},
{lat: 48.91937900, lng: 2.03817000,
nom: 'Poissy-Residence Eleusis',url: '/hotspot-wifi-ehpad-poissy-poissy-residence-eleusis-12607.html',ville: 'Poissy', activite: 'EHPAD'}
]