function initMap() {
var centre = {lat: 48.8, lng: 6.01} ;
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.67321800, lng: 6.15349600,
nom: 'Aeim',url: '/hotspot-wifi-collectif-villers-les-nancy-aeim-2872.html',ville: 'Villers les Nancy', activite: 'Collectif'},
{lat: 48.46206170, lng: 6.74087230,
nom: 'Gendarmerie de Baccarat',url: '/hotspot-wifi-residence-de-services-baccarat-gendarmerie-de-baccarat-7246.html',ville: 'Baccarat', activite: 'Résidence de services'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Sdc Escurial',url: '/hotspot-wifi-residence-etudiante-vandoeuvres-les-nancy-sdc-escurial-10776.html',ville: 'Vandoeuvres les Nancy', activite: 'Résidence étudiante'},
{lat: 48.69360810, lng: 6.18422220,
nom: 'Grand Hôtel de la Reine',url: '/hotspot-wifi-hotel-nancy-grand-hotel-de-la-reine-11068.html',ville: 'Nancy', activite: 'Hôtel'},
{lat: 48.61595560, lng: 6.17740060,
nom: 'Hôtel Première Classe',url: '/hotspot-wifi-hotel-ludres-hotel-premiere-classe-11287.html',ville: 'Ludres', activite: 'Hôtel'},
{lat: 48.61619710, lng: 6.17737850,
nom: 'Hotel Bonsai',url: '/hotspot-wifi-hotel-ludres-hotel-bonsai-11570.html',ville: 'Ludres', activite: 'Hôtel'}
]