function initMap() {
var centre = {lat: 43.25, lng: -0.75} ;
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: 43.37601230, lng: -1.54366720,
nom: 'Maison Xoxoenia 2',url: '/hotspot-wifi-gite-chambres-d-hotes-saint-pee-sur-nivelle-maison-xoxoenia-2-1682.html',ville: 'Saint Pee Sur Nivelle', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.35939900, lng: -1.76614800,
nom: 'Transports Lapegue',url: '/hotspot-wifi-societe-hendaye-transports-lapegue-6482.html',ville: 'Hendaye', activite: 'Société'},
{lat: 43.47837880, lng: -1.52637060,
nom: 'Anglet-Residence Arpege',url: '/hotspot-wifi-ehpad-anglet-anglet-residence-arpege-6586.html',ville: 'Anglet', activite: 'EHPAD'},
{lat: 43.30423430, lng: -0.35498950,
nom: 'Pau-Residence Tiers Temps',url: '/hotspot-wifi-ehpad-pau-pau-residence-tiers-temps-6665.html',ville: 'Pau', activite: 'EHPAD'},
{lat: 43.42417880, lng: -1.60949980,
nom: 'Guethary-Residence Eskualduna',url: '/hotspot-wifi-ehpad-guethary-guethary-residence-eskualduna-6700.html',ville: 'Guethary', activite: 'EHPAD'},
{lat: 43.47995060, lng: -1.51467290,
nom: 'L\'Euforia',url: '/hotspot-wifi-sauna-anglet-l-euforia-6745.html',ville: 'Anglet', activite: 'Sauna'},
{lat: 43.20179010, lng: -0.90373900,
nom: 'Camping Uhaitza',url: '/hotspot-wifi-camping-gotein-libarrenx-camping-uhaitza-7989.html',ville: 'Gotein Libarrenx', activite: 'Camping'},
{lat: 43.47609210, lng: -0.93836850,
nom: 'Camping des Salines',url: '/hotspot-wifi-camping-salies-de-bearn-camping-des-salines-8166.html',ville: 'Salies de Béarn', activite: 'Camping'},
{lat: 43.18372420, lng: -0.11404690,
nom: 'Hotel du Commerce',url: '/hotspot-wifi-hotel-pontacq-hotel-du-commerce-8352.html',ville: 'Pontacq', activite: 'Hôtel'},
{lat: 43.33850300, lng: -0.56635100,
nom: 'Chez Maïté Et Michel',url: '/hotspot-wifi-gite-chambres-d-hotes-monein-chez-maite-et-michel-9452.html',ville: 'Monein', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.30022100, lng: -0.37194300,
nom: 'Ace-64lp',url: '/hotspot-wifi-ehpad-pau-ace-64lp-10140.html',ville: 'Pau', activite: 'EHPAD'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Gsvi Pau',url: '/hotspot-wifi-vehicule-de-transport-serres-castet-gsvi-pau-10990.html',ville: 'Serres-Castet', activite: 'Véhicule de transport'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Hotel Kyriad Orthez',url: '/hotspot-wifi-hotel-orthez-hotel-kyriad-orthez-11372.html',ville: 'Orthez', activite: 'Hôtel'},
{lat: 43.49483000, lng: -1.51354400,
nom: 'Speed Queen Anglet Bab',url: '/hotspot-wifi-societe-anglet-speed-queen-anglet-bab-12263.html',ville: 'Anglet', activite: 'Société'},
{lat: 43.47184300, lng: -1.55539900,
nom: 'Le Café de la Baleine',url: '/hotspot-wifi-bar-restaurant-biarritz-le-cafe-de-la-baleine-12373.html',ville: 'Biarritz', activite: 'Bar restaurant'},
{lat: 43.32975300, lng: -0.38471300,
nom: 'Feuillette Lons (pau)',url: '/hotspot-wifi-sandwicherie-lons-feuillette-lons-pau-12522.html',ville: 'Lons', activite: 'Sandwicherie'},
{lat: 43.48644300, lng: -1.47594800,
nom: 'Aviron Bayonnais',url: '/hotspot-wifi-salle-de-sport-bayonne-aviron-bayonnais-12626.html',ville: 'Bayonne', activite: 'Salle de sport'}
]