function initMap() {
var centre = {lat: 46.82, lng: 1.58} ;
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: 46.60090650, lng: 1.97945940,
nom: 'Camping Solange Sand',url: '/hotspot-wifi-camping-montgivray-camping-solange-sand-5101.html',ville: 'Montgivray', activite: 'Camping'},
{lat: 46.53580900, lng: 1.59170100,
nom: 'Badecon le Pin-Les Jardins D Automne',url: '/hotspot-wifi-ehpad-badecon-le-pin-badecon-le-pin-les-jardins-d-automne-7272.html',ville: 'Badecon le Pin', activite: 'EHPAD'},
{lat: 47.25442870, lng: 1.65554030,
nom: 'La Roseraie',url: '/hotspot-wifi-ehpad-chabris-la-roseraie-7885.html',ville: 'Chabris', activite: 'EHPAD'},
{lat: 46.79207300, lng: 1.73980100,
nom: 'Feuillette le Poinçonnet',url: '/hotspot-wifi-sandwicherie-le-poinconnet-feuillette-le-poinconnet-9648.html',ville: 'Le Poinçonnet', activite: 'Sandwicherie'},
{lat: 46.58565500, lng: 1.51861400,
nom: 'Manoir de Boisvillers',url: '/hotspot-wifi-hotel-argenton-sur-creuse-manoir-de-boisvillers-10615.html',ville: 'Argenton Sur Creuse', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ace - 36lc',url: '/hotspot-wifi-ehpad-issoudun-ace-36lc-11571.html',ville: 'Issoudun', activite: 'EHPAD'},
{lat: 48.07770300, lng: 5.05607200,
nom: 'Cité Aéronautique Centre Val de Loire',url: '/hotspot-wifi-ecole-deols-cite-aeronautique-centre-val-de-loire-11929.html',ville: 'Deols', activite: 'Ecole'},
{lat: 46.84900200, lng: 1.70290500,
nom: 'Ace Hotel Chateauroux',url: '/hotspot-wifi-hotel-deols-ace-hotel-chateauroux-12444.html',ville: 'Deols', activite: 'Hôtel'}
]