function initMap() {
var centre = {lat: 48.31, lng: 4.11} ;
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.29526140, lng: 4.08696130,
nom: 'Simeka Charmille',url: '/hotspot-wifi-collectif-troyes-simeka-charmille-1179.html',ville: 'Troyes', activite: 'Collectif'},
{lat: 48.51960760, lng: 3.72167020,
nom: 'Sci le Patio la Solution D\'Hébergement!',url: '/hotspot-wifi-gite-chambres-d-hotes-romilly-sur-seine-sci-le-patio-la-solution-d-hebergement-4993.html',ville: 'Romilly Sur Seine', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.50390820, lng: 3.50883020,
nom: 'Camping Municipal',url: '/hotspot-wifi-camping-nogent-sur-seine-camping-municipal-5455.html',ville: 'Nogent Sur Seine', activite: 'Camping'},
{lat: 48.49756460, lng: 3.51158850,
nom: 'Ecole Saint Exupery',url: '/hotspot-wifi-ecole-nogent-sur-seine-ecole-saint-exupery-5533.html',ville: 'Nogent Sur Seine', activite: 'Ecole'},
{lat: 48.49045800, lng: 3.50011120,
nom: 'Espace Rw',url: '/hotspot-wifi-centre-de-loisirs-nogent-sur-seine-espace-rw-5636.html',ville: 'Nogent Sur Seine', activite: 'Centre de loisirs'},
{lat: 48.50380700, lng: 3.50876400,
nom: 'Piscine Municipale',url: '/hotspot-wifi-societe-nogent-sur-seine-piscine-municipale-6248.html',ville: 'Nogent Sur Seine', activite: 'Société'},
{lat: 48.50470140, lng: 3.72244360,
nom: 'Maison de L\'Emploi Et de la Formation',url: '/hotspot-wifi-espace-public-romilly-sur-seine-maison-de-l-emploi-et-de-la-formation-6480.html',ville: 'Romilly Sur Seine', activite: 'Espace public'},
{lat: 48.49619390, lng: 3.50962220,
nom: 'Agora',url: '/hotspot-wifi-collectif-nogent-sur-seine-agora-6714.html',ville: 'Nogent Sur Seine', activite: 'Collectif'},
{lat: 48.51609400, lng: 3.73398600,
nom: 'Pierre',url: '/hotspot-wifi-gite-chambres-d-hotes-romilly-sur-seine-pierre-7869.html',ville: 'Romilly Sur Seine', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.49453990, lng: 3.50087100,
nom: 'Ecole Flaubert',url: '/hotspot-wifi-ecole-nogent-sur-seine-ecole-flaubert-7870.html',ville: 'Nogent Sur Seine', activite: 'Ecole'},
{lat: 48.49262400, lng: 3.49816500,
nom: 'Ecole Primaire Jean de la Fontaine',url: '/hotspot-wifi-ecole-nogent-sur-sur-seine-ecole-primaire-jean-de-la-fontaine-7975.html',ville: 'Nogent Sur Sur Seine', activite: 'Ecole'},
{lat: 48.31201100, lng: 4.04781800,
nom: 'Première Classe',url: '/hotspot-wifi-hotel-la-chapelle-st-luc-premiere-classe-8105.html',ville: 'La Chapelle St Luc', activite: 'Hôtel'},
{lat: 48.51590400, lng: 3.73019120,
nom: 'Nicey - Hôtel Spa, Lounge, Coworking',url: '/hotspot-wifi-hotel-romilly-sur-seine-nicey-hotel-spa-lounge-coworking-8419.html',ville: 'Romilly Sur Seine', activite: 'Hôtel'},
{lat: 48.49592900, lng: 3.50831540,
nom: 'Espace Anne Franck',url: '/hotspot-wifi-centre-de-loisirs-nogent-sur-seine-espace-anne-franck-8689.html',ville: 'Nogent Sur Seine', activite: 'Centre de loisirs'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Musée Camille Claudel',url: '/hotspot-wifi-espace-public-nogent-sur-seine-musee-camille-claudel-9877.html',ville: 'Nogent-Sur-Seine', activite: 'Espace public'},
{lat: 48.49343900, lng: 3.50279300,
nom: 'Espace Heude Maccagno',url: '/hotspot-wifi-espace-public-nogent-sur-seine-espace-heude-maccagno-10136.html',ville: 'Nogent Sur Seine', activite: 'Espace public'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Simeka Gallieni',url: '/hotspot-wifi-residence-etudiante-sainte-savine-simeka-gallieni-10890.html',ville: 'Sainte Savine', activite: 'Résidence étudiante'},
{lat: 48.27256100, lng: 4.05555800,
nom: 'Feuillette Saint André les Vergers',url: '/hotspot-wifi-sandwicherie-saint-andre-les-vergers-feuillette-saint-andre-les-vergers-11023.html',ville: 'Saint André les Vergers', activite: 'Sandwicherie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Atelier du Bon Temps',url: '/hotspot-wifi-airbnb-rumilly-les-vaudes-atelier-du-bon-temps-11032.html',ville: 'Rumilly-Lès-Vaudes', activite: 'AirBnb'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Feuillette Lavau',url: '/hotspot-wifi-sandwicherie-pont-sainte-marie-feuillette-lavau-11376.html',ville: 'Pont Sainte Marie', activite: 'Sandwicherie'},
{lat: 48.30369120, lng: 4.08563770,
nom: '93 Rue Kleber',url: '/hotspot-wifi-residence-etudiante-troyes-93-rue-kleber-11544.html',ville: 'Troyes', activite: 'Résidence étudiante'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ace Hotel Troyes',url: '/hotspot-wifi-hotel-saint-andre-les-verges-ace-hotel-troyes-11551.html',ville: 'Saint Andre les Verges', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Feuillette Romilly',url: '/hotspot-wifi-agence-bancaire-romilly-sur-seine-feuillette-romilly-11622.html',ville: 'Romilly Sur Seine', activite: 'Agence bancaire'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Aux Saveurs des Ecrevolles',url: '/hotspot-wifi-agence-bancaire-pont-sainte-marie-aux-saveurs-des-ecrevolles-11875.html',ville: 'Pont Sainte Marie', activite: 'Agence bancaire'},
{lat: 48.51773200, lng: 3.72627500,
nom: 'Communauté de Communes des Portes de Romilly Sur Seine - Médiathèque',url: '/hotspot-wifi-bibliotheque-romilly-sur-seine-communaute-de-communes-des-portes-de-romilly-sur-seine-mediatheque-11976.html',ville: 'Romilly Sur Seine', activite: 'Bibliothèque '}
]