function initMap() {
var centre = {lat: 47.91, lng: 2.29} ;
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.01633910, lng: 2.73324530,
nom: 'Camping des Rives du Loing',url: '/hotspot-wifi-camping-cepoy-camping-des-rives-du-loing-2875.html',ville: 'Cepoy', activite: 'Camping'},
{lat: 47.98249940, lng: 2.72376090,
nom: 'Hôtel Inn Design',url: '/hotspot-wifi-hotel-villemandeur-hotel-inn-design-5562.html',ville: 'Villemandeur', activite: 'Hôtel'},
{lat: 47.86540800, lng: 1.89756500,
nom: 'Bonsai',url: '/hotspot-wifi-hotel-olivet-bonsai-7372.html',ville: 'Olivet', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Robshouse',url: '/hotspot-wifi-restaurant-chateauneuf-sur-loire-robshouse-11025.html',ville: 'Chateauneuf Sur Loire', activite: 'Restaurant'},
{lat: 47.70133400, lng: 2.71280300,
nom: 'Domaine de Bel Air',url: '/hotspot-wifi-gite-chambres-d-hotes-gien-domaine-de-bel-air-11060.html',ville: 'Gien', activite: 'Gîte / Chambres d\'hôtes'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Feuillette St Jean de la Ruelle',url: '/hotspot-wifi-sandwicherie-saint-jean-de-la-ruelle-feuillette-st-jean-de-la-ruelle-11584.html',ville: 'Saint Jean de la Ruelle', activite: 'Sandwicherie'},
{lat: 47.66560300, lng: 2.61187900,
nom: 'Villa Hotel Gien',url: '/hotspot-wifi-hotel-poilly-lez-gien-villa-hotel-gien-11947.html',ville: 'Poilly-Lez-Gien', activite: 'Hôtel'},
{lat: 48.18005400, lng: 2.25186000,
nom: 'Feuillette Pithiviers',url: '/hotspot-wifi-sandwicherie-pithiviers-feuillette-pithiviers-12205.html',ville: 'Pithiviers', activite: 'Sandwicherie'},
{lat: 47.88158000, lng: 1.87292100,
nom: 'Rs Lac de St Pryve',url: '/hotspot-wifi-agence-bancaire-saint-pryve-saint-mesmin-rs-lac-de-st-pryve-12428.html',ville: 'Saint Pryve Saint Mesmin', activite: 'Agence bancaire'}
]