function initMap() {
var centre = {lat: 47.63, lng: 1.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: 47.58989510, lng: 1.33324740,
nom: 'Préfecture de Loir-Et-Cher',url: '/hotspot-wifi-collectif-blois-prefecture-de-loir-et-cher-6073.html',ville: 'Blois', activite: 'Collectif'},
{lat: 47.60377100, lng: 1.32924110,
nom: 'Nissan Blois',url: '/hotspot-wifi-societe-blois-nissan-blois-6296.html',ville: 'Blois', activite: 'Société'},
{lat: 47.64862300, lng: 1.61382700,
nom: 'Le Moulin de Crouy',url: '/hotspot-wifi-gite-chambres-d-hotes-crouy-sur-cosson-le-moulin-de-crouy-7258.html',ville: 'Crouy Sur Cosson', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 47.36031830, lng: 1.74412440,
nom: 'Grand Hotel du Lion D\'Or',url: '/hotspot-wifi-hotel-romorantin-grand-hotel-du-lion-d-or-7274.html',ville: 'Romorantin', activite: 'Hôtel'},
{lat: 47.57843800, lng: 1.21583400,
nom: 'Hotel du Pont',url: '/hotspot-wifi-hotel-molineuf-hotel-du-pont-9339.html',ville: 'Molineuf', activite: 'Hôtel'},
{lat: 47.75347600, lng: 0.87504500,
nom: 'Hospitalet',url: '/hotspot-wifi-clinique-hopital-montoire-sur-le-loir-hospitalet-9413.html',ville: 'Montoire Sur le Loir', activite: 'Clinique / Hôpital'},
{lat: 47.79821800, lng: 1.06372300,
nom: 'Feuillette Vendôme',url: '/hotspot-wifi-sandwicherie-vendome-feuillette-vendome-9569.html',ville: 'Vendôme', activite: 'Sandwicherie'},
{lat: 47.60993600, lng: 1.36053100,
nom: 'Siège Feuillette',url: '/hotspot-wifi-sandwicherie-la-chaussee-st-victor-siege-feuillette-10149.html',ville: 'La Chaussée St Victor', activite: 'Sandwicherie'},
{lat: 47.59855000, lng: 1.32400100,
nom: 'Feuillette Blois',url: '/hotspot-wifi-bar-restaurant-blois-feuillette-blois-10156.html',ville: 'Blois', activite: 'Bar restaurant'},
{lat: 47.36393700, lng: 1.71130800,
nom: 'Feuillette Pruniers-En-Sologne',url: '/hotspot-wifi-sandwicherie-pruniers-en-sologne-feuillette-pruniers-en-sologne-10488.html',ville: 'Pruniers-En-Sologne', activite: 'Sandwicherie'},
{lat: 47.60514900, lng: 1.35204000,
nom: 'Feuillette la Chaussée Saint Victor',url: '/hotspot-wifi-sandwicherie-la-chaussee-saint-victor-feuillette-la-chaussee-saint-victor-10637.html',ville: 'La Chaussee Saint Victor', activite: 'Sandwicherie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Feuillette St Gervais',url: '/hotspot-wifi-sandwicherie-saint-gervais-la-foret-feuillette-st-gervais-10722.html',ville: 'Saint Gervais la Foret', activite: 'Sandwicherie'},
{lat: 47.61389100, lng: 1.33647600,
nom: 'Hotel Balladins Blois',url: '/hotspot-wifi-hotel-blois-hotel-balladins-blois-10883.html',ville: 'Blois', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: '24710',url: '/hotspot-wifi-vehicule-de-transport-blois-24710-11954.html',ville: 'Blois', activite: 'Véhicule de transport'},
{lat: 47.58937100, lng: 1.33678300,
nom: 'Fiteco Blois',url: '/hotspot-wifi-societe-blois-fiteco-blois-12052.html',ville: 'Blois', activite: 'Société'},
{lat: 47.59624500, lng: 1.34163700,
nom: 'Chez Lucette Blois',url: '/hotspot-wifi-agence-bancaire-blois-chez-lucette-blois-12461.html',ville: 'Blois', activite: 'Agence bancaire'}
]