function initMap() {
var centre = {lat: 48.99, lng: 5.35} ;
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.15474600, lng: 5.62593100,
nom: 'Gites Braquis',url: '/hotspot-wifi-gite-chambres-d-hotes-braquis-gites-braquis-1195.html',ville: 'Braquis', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.50472900, lng: 5.35731400,
nom: 'Gendarmerie de Bure',url: '/hotspot-wifi-collectif-bure-gendarmerie-de-bure-7393.html',ville: 'Bure', activite: 'Collectif'},
{lat: 48.77554400, lng: 5.16738200,
nom: 'Camping du Chateau',url: '/hotspot-wifi-camping-bar-le-duc-camping-du-chateau-9289.html',ville: 'Bar le Duc', activite: 'Camping'},
{lat: 48.68582200, lng: 5.31627100,
nom: 'Camping le Chartel',url: '/hotspot-wifi-camping-ligny-en-barrois-camping-le-chartel-9306.html',ville: 'Ligny En Barrois', activite: 'Camping'},
{lat: 49.16517000, lng: 5.38052600,
nom: 'Boutique Rezo',url: '/hotspot-wifi-societe-verdun-boutique-rezo-9867.html',ville: 'Verdun', activite: 'Société'},
{lat: 48.89651300, lng: 5.53783060,
nom: 'Hotel de la Gare',url: '/hotspot-wifi-hotel-saint-mihiel-hotel-de-la-gare-11280.html',ville: 'Saint Mihiel', activite: 'Hôtel'},
{lat: 48.77305200, lng: 5.16603700,
nom: 'Agence Tub',url: '/hotspot-wifi-vehicule-de-transport-bar-le-duc-agence-tub-11294.html',ville: 'Bar le Duc', activite: 'Véhicule de transport'}
]