function initMap() {
var centre = {lat: 49.41, lng: 2.41} ;
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: 49.19402000, lng: 2.46515550,
nom: 'Hotel le Chantilly',url: '/hotspot-wifi-hotel-chantilly-hotel-le-chantilly-6306.html',ville: 'Chantilly', activite: 'Hôtel'},
{lat: 49.41600870, lng: 2.82172440,
nom: 'Compiegne-Residence Tiers Temps',url: '/hotspot-wifi-ehpad-compiegne-compiegne-residence-tiers-temps-6610.html',ville: 'Compiegne', activite: 'EHPAD'},
{lat: 49.21517450, lng: 2.32147240,
nom: 'Crouy En Thelle-Residence les Cedres',url: '/hotspot-wifi-ehpad-crouy-en-thelle-crouy-en-thelle-residence-les-cedres-6613.html',ville: 'Crouy En Thelle', activite: 'EHPAD'},
{lat: 49.21762600, lng: 2.17052600,
nom: 'Esches -Les Jardins Medicis',url: '/hotspot-wifi-ehpad-esches-esches-les-jardins-medicis-6620.html',ville: 'Esches', activite: 'EHPAD'},
{lat: 49.19403170, lng: 2.43016270,
nom: 'Gouvieux-La Fontaine Medicis',url: '/hotspot-wifi-ehpad-gouvieux-gouvieux-la-fontaine-medicis-6628.html',ville: 'Gouvieux', activite: 'EHPAD'},
{lat: 49.30102010, lng: 2.64364830,
nom: 'Pontpoint-Les Jardins Medicis',url: '/hotspot-wifi-ehpad-pontpoint-pontpoint-les-jardins-medicis-6668.html',ville: 'Pontpoint', activite: 'EHPAD'},
{lat: 49.20429700, lng: 2.37279800,
nom: 'Precy/oise-Residence les Lys',url: '/hotspot-wifi-ehpad-precy-sur-oise-precy-oise-residence-les-lys-6669.html',ville: 'Precy Sur Oise', activite: 'EHPAD'},
{lat: 49.42932500, lng: 2.07567600,
nom: 'Le Bar de Saint Quentin',url: '/hotspot-wifi-bar-brasserie-beauvais-le-bar-de-saint-quentin-7584.html',ville: 'Beauvais', activite: 'Bar brasserie'},
{lat: 49.20973880, lng: 2.40299320,
nom: 'Camping de L\'Abbatiale',url: '/hotspot-wifi-camping-saint-leu-d-esserent-camping-de-l-abbatiale-7590.html',ville: 'Saint Leu D\'Esserent', activite: 'Camping'},
{lat: 49.39262600, lng: 2.77862700,
nom: 'Le Relais du Port',url: '/hotspot-wifi-bar-restaurant-jaux-le-relais-du-port-9785.html',ville: 'Jaux', activite: 'Bar restaurant'},
{lat: 49.12775710, lng: 2.69648800,
nom: 'Chamant - Residence les Jardins D\'Aunette',url: '/hotspot-wifi-ehpad-chamant-chamant-residence-les-jardins-d-aunette-9959.html',ville: 'Chamant', activite: 'EHPAD'},
{lat: 49.19299060, lng: 2.46533540,
nom: 'L\'Avenue',url: '/hotspot-wifi-hotel-chantilly-l-avenue-10485.html',ville: 'Chantilly', activite: 'Hôtel'}
]