function initMap() {
var centre = {lat: 47.2914, lng: -0.487785} ;
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: 47.47418290, lng: -0.63550200,
nom: 'Sarl Asm Pros It',url: '/hotspot-wifi-bar-brasserie-beaucouze-sarl-asm-pros-it-1039.html',ville: 'Beaucouze', activite: 'Bar brasserie'},
{lat: 47.47582850, lng: -0.54796740,
nom: 'Escales Gourmandes',url: '/hotspot-wifi-bar-restaurant-angers-escales-gourmandes-1156.html',ville: 'Angers', activite: 'Bar restaurant'},
{lat: 47.49187800, lng: -0.54787670,
nom: 'Au Quai des Saveurs',url: '/hotspot-wifi-bar-restaurant-angers-au-quai-des-saveurs-1163.html',ville: 'Angers', activite: 'Bar restaurant'},
{lat: 47.46920160, lng: -0.54972150,
nom: 'Mercure Angers Centre Gare',url: '/hotspot-wifi-hotel-angers-mercure-angers-centre-gare-2858.html',ville: 'Angers', activite: 'Hôtel'},
{lat: 47.19671910, lng: -0.86201050,
nom: 'Sarl Humeau',url: '/hotspot-wifi-concession-automobile-jallais-sarl-humeau-3567.html',ville: 'Jallais', activite: 'Concession automobile'},
{lat: 47.21008190, lng: -0.72740780,
nom: 'Super U',url: '/hotspot-wifi-bar-brasserie-chemille-super-u-5571.html',ville: 'Chemille', activite: 'Bar brasserie'},
{lat: 47.22318200, lng: -0.11111600,
nom: 'Oga Toyota',url: '/hotspot-wifi-concession-automobile-distre-oga-toyota-6003.html',ville: 'Distre', activite: 'Concession automobile'},
{lat: 47.46883400, lng: -0.59278610,
nom: 'Mercure Angers Lac de Maine',url: '/hotspot-wifi-hotel-angers-mercure-angers-lac-de-maine-6850.html',ville: 'Angers', activite: 'Hôtel'},
{lat: 47.46553600, lng: -0.55084500,
nom: 'Ibis Styles Angers Centre Gare',url: '/hotspot-wifi-hotel-angers-ibis-styles-angers-centre-gare-8593.html',ville: 'Angers', activite: 'Hôtel'},
{lat: 47.19670320, lng: -0.86065550,
nom: 'Sojadis',url: '/hotspot-wifi-centre-automobile-jallais-sojadis-8698.html',ville: 'Jallais', activite: 'Centre automobile'},
{lat: 48.05811000, lng: -0.80612600,
nom: 'Seenovia Trelaze',url: '/hotspot-wifi-societe-trelaze-seenovia-trelaze-9410.html',ville: 'Trelaze', activite: 'Société'},
{lat: 47.06197600, lng: -0.88176300,
nom: 'O Tacos Cholet',url: '/hotspot-wifi-office-de-tourisme-cholet-o-tacos-cholet-9845.html',ville: 'Cholet', activite: 'Office de tourisme'},
{lat: 47.47034500, lng: -0.55431900,
nom: 'La Tour D\'Adam',url: '/hotspot-wifi-gite-chambres-d-hotes-angers-la-tour-d-adam-10181.html',ville: 'Angers', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 47.46463500, lng: -0.54076100,
nom: 'Irss Angers St Léonard',url: '/hotspot-wifi-ecole-angers-irss-angers-st-leonard-10341.html',ville: 'Angers', activite: 'Ecole'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ace Hotel Angers',url: '/hotspot-wifi-hotel-saint-barthelemy-d-anjou-ace-hotel-angers-11264.html',ville: 'Saint Barthelemy D\'Anjou', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Commune de Verrières En Anjou',url: '/hotspot-wifi-mairie-verrieres-en-anjou-commune-de-verrieres-en-anjou-11397.html',ville: 'Verrières En Anjou', activite: 'Mairie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Kyriad',url: '/hotspot-wifi-hotel-cholet-kyriad-11459.html',ville: 'Cholet', activite: 'Hôtel'},
{lat: 47.52014000, lng: -0.47162700,
nom: 'Commune de Verrières-En-Anjou - Hotspot Nomade',url: '/hotspot-wifi-mairie-verrieres-en-anjou-commune-de-verrieres-en-anjou-hotspot-nomade-11820.html',ville: 'Verrières-En-Anjou', activite: 'Mairie'},
{lat: 47.07255000, lng: -0.83938700,
nom: 'Coclico',url: '/hotspot-wifi-gite-chambres-d-hotes-cholet-coclico-12156.html',ville: 'Cholet', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 47.47327600, lng: -0.57078300,
nom: 'Afocal',url: '/hotspot-wifi-collectif-angers-afocal-12362.html',ville: 'Angers', activite: 'Collectif'}
]