function initMap() {
var centre = {lat: 48.3061, lng: -0.620935} ;
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.28756220, lng: -0.62314900,
nom: 'La Motte Hyper U',url: '/hotspot-wifi-grande-surface-mayenne-la-motte-hyper-u-1254.html',ville: 'Mayenne', activite: 'Grande surface'},
{lat: 47.94469170, lng: -0.91350470,
nom: 'Snc le Carre D As',url: '/hotspot-wifi-bar-restaurant-cosse-le-vivien-snc-le-carre-d-as-1277.html',ville: 'Cosse le Vivien', activite: 'Bar restaurant'},
{lat: 48.07144600, lng: -0.76942300,
nom: 'Immo de France Ouest',url: '/hotspot-wifi-collectif-laval-immo-de-france-ouest-1934.html',ville: 'Laval', activite: 'Collectif'},
{lat: 48.07060240, lng: -0.77437730,
nom: 'Librairie Corneille',url: '/hotspot-wifi-bibliotheque-laval-librairie-corneille-3060.html',ville: 'Laval', activite: 'Bibliothèque '},
{lat: 47.95014650, lng: -0.55307240,
nom: 'Cafe du Centre',url: '/hotspot-wifi-bar-tabac-meslay-du-maine-cafe-du-centre-3717.html',ville: 'Meslay du Maine', activite: 'Bar tabac'},
{lat: 48.07493860, lng: -0.69924260,
nom: 'Le Central',url: '/hotspot-wifi-bar-tabac-bonchamp-les-laval-le-central-6762.html',ville: 'Bonchamp-Les-Laval', activite: 'Bar tabac'},
{lat: 47.99875700, lng: -0.71674900,
nom: 'Le Bréon',url: '/hotspot-wifi-bar-tabac-entrammes-le-breon-7624.html',ville: 'Entrammes', activite: 'Bar tabac'},
{lat: 48.16371410, lng: -0.97042840,
nom: 'Cafe des Sports Bar Tabac Pmu',url: '/hotspot-wifi-bar-tabac-le-bourgneuf-la-foret-cafe-des-sports-bar-tabac-pmu-7626.html',ville: 'Le Bourgneuf la Foret', activite: 'Bar tabac'},
{lat: 48.06130400, lng: -0.79313200,
nom: 'Le Bourny',url: '/hotspot-wifi-bar-tabac-laval-le-bourny-7629.html',ville: 'Laval', activite: 'Bar tabac'},
{lat: 47.97061550, lng: -1.11912510,
nom: 'Bar des Sports Lounge',url: '/hotspot-wifi-bar-tabac-cuille-bar-des-sports-lounge-8349.html',ville: 'Cuille', activite: 'Bar tabac'},
{lat: 48.27056700, lng: -0.62538200,
nom: 'Chez Marlene',url: '/hotspot-wifi-bar-tabac-moulay-chez-marlene-8366.html',ville: 'Moulay', activite: 'Bar tabac'},
{lat: 48.11472290, lng: -1.02630890,
nom: 'Bar Tabac Loto le St Pierre',url: '/hotspot-wifi-bar-tabac-saint-pierre-la-cour-bar-tabac-loto-le-st-pierre-8373.html',ville: 'Saint Pierre la Cour', activite: 'Bar tabac'},
{lat: 47.93085090, lng: -0.70153900,
nom: 'Emmaus53',url: '/hotspot-wifi-gite-chambres-d-hotes-villiers-charlemagne-emmaus53-8380.html',ville: 'Villiers-Charlemagne', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 48.07042230, lng: -0.77203760,
nom: 'Roadside Laval',url: '/hotspot-wifi-restaurant-laval-roadside-laval-8611.html',ville: 'Laval', activite: 'Restaurant'},
{lat: 51.04196200, lng: 2.38523400,
nom: 'Le Garden\'S',url: '/hotspot-wifi-bar-brasserie-mayenne-le-garden-s-9233.html',ville: 'Mayenne', activite: 'Bar brasserie'},
{lat: 48.30779000, lng: -0.62529300,
nom: 'L\'Octroi',url: '/hotspot-wifi-bar-restaurant-mayenne-l-octroi-9271.html',ville: 'Mayenne', activite: 'Bar restaurant'},
{lat: 48.06922800, lng: -0.76553900,
nom: 'Le Méridional',url: '/hotspot-wifi-bar-brasserie-laval-le-meridional-9274.html',ville: 'Laval', activite: 'Bar brasserie'},
{lat: 48.41838100, lng: -0.33473300,
nom: 'Le Bon Accueil',url: '/hotspot-wifi-bar-restaurant-javron-les-chapelles-le-bon-accueil-9278.html',ville: 'Javron les Chapelles', activite: 'Bar restaurant'},
{lat: 48.36223400, lng: -0.99926300,
nom: 'Le Relais',url: '/hotspot-wifi-bar-tabac-larchamp-le-relais-9279.html',ville: 'Larchamp', activite: 'Bar tabac'},
{lat: 48.27397300, lng: -1.02559300,
nom: 'Au Rendez-Vous des Amis',url: '/hotspot-wifi-bar-tabac-st-pierre-des-landes-au-rendez-vous-des-amis-9280.html',ville: 'St Pierre des Landes', activite: 'Bar tabac'},
{lat: 48.29696000, lng: -0.93832800,
nom: 'Bar de L\'Europe',url: '/hotspot-wifi-bar-brasserie-ernee-bar-de-l-europe-9283.html',ville: 'Ernee', activite: 'Bar brasserie'},
{lat: 47.82339600, lng: -0.70807200,
nom: 'La Renaissance',url: '/hotspot-wifi-bar-tabac-chateau-gontier-la-renaissance-9288.html',ville: 'Chateau Gontier', activite: 'Bar tabac'},
{lat: 48.05811000, lng: -0.80612600,
nom: 'Seenovia Saint Berthevin',url: '/hotspot-wifi-societe-saint-berthevin-seenovia-saint-berthevin-9764.html',ville: 'Saint Berthevin', activite: 'Société'},
{lat: 48.30332300, lng: -0.61562200,
nom: 'Le Fluvial',url: '/hotspot-wifi-bar-tabac-mayenne-le-fluvial-10197.html',ville: 'Mayenne', activite: 'Bar tabac'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'La Terrasse',url: '/hotspot-wifi-bar-brasserie-laval-la-terrasse-10203.html',ville: 'Laval', activite: 'Bar brasserie'},
{lat: 48.25103900, lng: -0.36384300,
nom: 'Le Lion D\'Or',url: '/hotspot-wifi-bar-restaurant-bais-le-lion-d-or-10209.html',ville: 'Bais', activite: 'Bar restaurant'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Restaurant la Rabine',url: '/hotspot-wifi-bar-restaurant-st-pierre-des-landes-restaurant-la-rabine-11007.html',ville: 'St Pierre des Landes', activite: 'Bar restaurant'},
{lat: 48.08374090, lng: -0.80244380,
nom: 'Hotel Inn Design',url: '/hotspot-wifi-hotel-laval-hotel-inn-design-11394.html',ville: 'Laval', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Somouest',url: '/hotspot-wifi-societe-montsurs-somouest-11420.html',ville: 'Montsurs', activite: 'Société'},
{lat: 48.09002700, lng: -0.75442000,
nom: 'Fiteco Laval Siège',url: '/hotspot-wifi-societe-change-fiteco-laval-siege-12042.html',ville: 'Changé', activite: 'Société'},
{lat: 47.81513400, lng: -0.70696100,
nom: 'Fiteco Château-Gontier',url: '/hotspot-wifi-societe-chateau-gontier-sur-mayenne-fiteco-chateau-gontier-12053.html',ville: 'Chateau-Gontier-Sur-Mayenne', activite: 'Société'},
{lat: 48.29424900, lng: -0.60736000,
nom: 'Fiteco Mayenne',url: '/hotspot-wifi-agence-bancaire-mayenne-fiteco-mayenne-12057.html',ville: 'Mayenne', activite: 'Agence bancaire'},
{lat: 48.09002700, lng: -0.75442000,
nom: 'Fiteco Laval Agence',url: '/hotspot-wifi-societe-change-fiteco-laval-agence-12150.html',ville: 'Changé', activite: 'Société'},
{lat: 48.30185150, lng: -0.61996760,
nom: 'La Tour des Anglais',url: '/hotspot-wifi-hotel-mayenne-la-tour-des-anglais-12199.html',ville: 'Mayenne', activite: 'Hôtel'}
]