function initMap() {
var centre = {lat: 45.9, lng: 1.22} ;
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.82855200, lng: 1.27181800,
nom: 'Le Pont Saint-Etienne',url: '/hotspot-wifi-restaurant-limoges-le-pont-saint-etienne-3293.html',ville: 'Limoges', activite: 'Restaurant'},
{lat: 46.21570830, lng: 1.16027940,
nom: 'Espace du Rocher',url: '/hotspot-wifi-espace-public-magnac-laval-espace-du-rocher-4482.html',ville: 'Magnac Laval', activite: 'Espace public'},
{lat: 45.88183410, lng: 0.89531900,
nom: 'Esat les Seilles',url: '/hotspot-wifi-societe-saint-junien-esat-les-seilles-7558.html',ville: 'Saint Junien', activite: 'Société'},
{lat: 46.05259900, lng: 1.46915700,
nom: 'Bibliothèque',url: '/hotspot-wifi-mairie-saint-sulpice-lauriere-bibliotheque-7701.html',ville: 'Saint-Sulpice-Laurière', activite: 'Mairie'},
{lat: 45.88534160, lng: 0.89513740,
nom: 'Le Relais de Comodoliac',url: '/hotspot-wifi-hotel-saint-junien-le-relais-de-comodoliac-9483.html',ville: 'Saint Junien', activite: 'Hôtel'},
{lat: 46.12003700, lng: 1.05077900,
nom: 'Espace Public Multimédia de la Ville de Bellac ( Epmb)',url: '/hotspot-wifi-espace-public-bellac-espace-public-multimedia-de-la-ville-de-bellac-epmb-10710.html',ville: 'Bellac', activite: 'Espace public'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Epnak Esrp Limoges',url: '/hotspot-wifi-collectif-limoges-epnak-esrp-limoges-11335.html',ville: 'Limoges', activite: 'Collectif'},
{lat: 45.86442900, lng: 1.26934600,
nom: 'Hôtel du Parc',url: '/hotspot-wifi-hotel-limoges-hotel-du-parc-11620.html',ville: 'Limoges', activite: 'Hôtel'},
{lat: 45.83393900, lng: 1.27140600,
nom: 'Epnak Esrp Limoges',url: '/hotspot-wifi-ecole-limoges-epnak-esrp-limoges-12151.html',ville: 'Limoges', activite: 'Ecole'},
{lat: 45.83393900, lng: 1.27140600,
nom: 'Esat-Chagrenon',url: '/hotspot-wifi-agence-bancaire-limoges-esat-chagrenon-12238.html',ville: 'Limoges', activite: 'Agence bancaire'},
{lat: 45.82359660, lng: 0.82129640,
nom: 'Le Café des Sports',url: '/hotspot-wifi-bar-brasserie-rochechouart-le-cafe-des-sports-12459.html',ville: 'Rochechouart', activite: 'Bar brasserie'}
]