function initMap() {
var centre = {lat: 45.31, lng: 1.82} ;
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: 45.37730700, lng: 1.38447000,
nom: 'Camping les Etoiles',url: '/hotspot-wifi-camping-saint-sornin-lavops-camping-les-etoiles-4606.html',ville: 'Saint Sornin Lavops', activite: 'Camping'},
{lat: 45.26597740, lng: 1.76989630,
nom: 'Hotel Limouzi',url: '/hotspot-wifi-hotel-tulle-hotel-limouzi-6238.html',ville: 'Tulle', activite: 'Hôtel'},
{lat: 45.15302590, lng: 1.52920630,
nom: 'Grand Hotel Terminus',url: '/hotspot-wifi-hotel-brive-la-gaillarde-grand-hotel-terminus-7052.html',ville: 'Brive la Gaillarde', activite: 'Hôtel'},
{lat: 45.26679920, lng: 1.77072060,
nom: 'La Taverne du Sommelier',url: '/hotspot-wifi-bar-brasserie-tulle-la-taverne-du-sommelier-7080.html',ville: 'Tulle', activite: 'Bar brasserie'},
{lat: 45.42639300, lng: 1.56775900,
nom: 'Hotel Teyssier',url: '/hotspot-wifi-bar-restaurant-uzerche-hotel-teyssier-9217.html',ville: 'Uzerche', activite: 'Bar restaurant'},
{lat: 45.59908200, lng: 1.74653400,
nom: 'Village D+ les Roches de Scoeux',url: '/hotspot-wifi-collectif-chamberet-village-d-les-roches-de-scoeux-9747.html',ville: 'Chamberet', activite: 'Collectif'},
{lat: 45.31289300, lng: 1.76647100,
nom: 'Hotel - Restaurant L\'Oustal',url: '/hotspot-wifi-hotel-naves-hotel-restaurant-l-oustal-10127.html',ville: 'Naves', activite: 'Hôtel'},
{lat: 45.40437500, lng: 2.06118700,
nom: 'Erhard',url: '/hotspot-wifi-agence-bancaire-egletons-erhard-10635.html',ville: 'Egletons', activite: 'Agence bancaire'},
{lat: 45.08420100, lng: 1.51862200,
nom: 'Domaine de la Fage',url: '/hotspot-wifi-restaurant-noailles-domaine-de-la-fage-10771.html',ville: 'Noailles', activite: 'Restaurant'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Eden Lake',url: '/hotspot-wifi-centre-de-loisirs-egletons-eden-lake-10968.html',ville: 'Egletons', activite: 'Centre de loisirs'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Camping le Domaine des Forges - Wifi4eu',url: '/hotspot-wifi-camping-lamongerie-camping-le-domaine-des-forges-wifi4eu-11257.html',ville: 'Lamongerie', activite: 'Camping'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Eden Aubree - Wifi4eu',url: '/hotspot-wifi-mairie-beyssac-eden-aubree-wifi4eu-11258.html',ville: 'Beyssac', activite: 'Mairie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Camping Municipal Lac de Pontcharal - Wifi4eu',url: '/hotspot-wifi-camping-vigeois-camping-municipal-lac-de-pontcharal-wifi4eu-11259.html',ville: 'Vigeois', activite: 'Camping'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Mairie de Jugeals-Nazareth - Wifi4eu',url: '/hotspot-wifi-mairie-jugeals-nazareth-mairie-de-jugeals-nazareth-wifi4eu-11331.html',ville: 'Jugeals-Nazareth', activite: 'Mairie'},
{lat: 45.15100300, lng: 1.51147500,
nom: 'Feuillette Brive-La-Gaillarde',url: '/hotspot-wifi-sandwicherie-brive-la-gaillarde-feuillette-brive-la-gaillarde-12352.html',ville: 'Brive-La-Gaillarde', activite: 'Sandwicherie'},
{lat: 44.51870700, lng: 0.22149300,
nom: 'Sci Vincaud Immo',url: '/hotspot-wifi-airbnb-egletons-sci-vincaud-immo-12682.html',ville: 'Egletons', activite: 'AirBnb'}
]