function initMap() {
var centre = {lat: 47.47, lng: 4.74} ;
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.31122410, lng: 5.10627140,
nom: 'Hôtel Kyriad Quetigny',url: '/hotspot-wifi-hotel-quetigny-hotel-kyriad-quetigny-643.html',ville: 'Quetigny', activite: 'Hôtel'},
{lat: 47.13376500, lng: 4.48687700,
nom: 'Chez Camille',url: '/hotspot-wifi-hotel-arnay-le-duc-chez-camille-3020.html',ville: 'Arnay le Duc', activite: 'Hôtel'},
{lat: 47.27907010, lng: 4.23211410,
nom: 'Bluebox',url: '/hotspot-wifi-societe-saulieu-bluebox-3296.html',ville: 'Saulieu', activite: 'Société'},
{lat: 47.32993630, lng: 5.05188010,
nom: 'Cci Cote-D\'Or',url: '/hotspot-wifi-chambre-de-commerce-et-d-industrie-dijon-cci-cote-d-or-4419.html',ville: 'Dijon', activite: 'Chambre de commerce et d\'industrie '},
{lat: 47.02994710, lng: 4.59420350,
nom: 'Manoir Bonpassage',url: '/hotspot-wifi-hotel-thury-manoir-bonpassage-7585.html',ville: 'Thury', activite: 'Hôtel'},
{lat: 47.03625540, lng: 4.83760410,
nom: 'Les Blanches Fleurs',url: '/hotspot-wifi-residence-etudiante-beaune-les-blanches-fleurs-7711.html',ville: 'Beaune', activite: 'Résidence étudiante'},
{lat: 47.13389600, lng: 4.48595600,
nom: 'Chez Camille',url: '/hotspot-wifi-hotel-arnay-le-duc-chez-camille-10337.html',ville: 'Arnay le Duc', activite: 'Hôtel'},
{lat: 47.22156600, lng: 4.96269300,
nom: 'S2eg Gevrey',url: '/hotspot-wifi-restaurant-gevrey-chambertin-s2eg-gevrey-10613.html',ville: 'Gevrey Chambertin', activite: 'Restaurant'},
{lat: 47.27984200, lng: 5.01168300,
nom: 'Distrimatic',url: '/hotspot-wifi-societe-marsannay-la-cote-distrimatic-11146.html',ville: 'Marsannay la Côte', activite: 'Société'},
{lat: 47.27939460, lng: 5.02306660,
nom: 'Hotel Inn Dijon',url: '/hotspot-wifi-hotel-marsannay-la-cote-hotel-inn-dijon-11944.html',ville: 'Marsannay la Cote', activite: 'Hôtel'},
{lat: 46.95162000, lng: 4.63004800,
nom: 'Mairie de Nolay',url: '/hotspot-wifi-mairie-nolay-mairie-de-nolay-12510.html',ville: 'Nolay', activite: 'Mairie'}
]