function initMap() {
var centre = {lat: 16.251, lng: -61.5454} ;
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 7,
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: -20.88594400, lng: 55.45534700,
nom: 'Groupe Mediaustral Residence Aude',url: '/hotspot-wifi-ehpad-saint-denis-reunion-groupe-mediaustral-residence-aude-10153.html',ville: 'Saint Denis Reunion', activite: 'EHPAD'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'K\'Frine / Artefact',url: '/hotspot-wifi-bar-restaurant-saint-denis-k-frine-artefact-11377.html',ville: 'Saint Denis', activite: 'Bar restaurant'},
{lat: -20.88147900, lng: 55.45787200,
nom: 'Cafe Edouard Et Zarathoustra',url: '/hotspot-wifi-bar-restaurant-saint-denis-cafe-edouard-et-zarathoustra-11378.html',ville: 'Saint Denis', activite: 'Bar restaurant'},
{lat: -20.88147900, lng: 55.45787200,
nom: 'Kt-Dral',url: '/hotspot-wifi-restaurant-saint-denis-kt-dral-11379.html',ville: 'Saint Denis', activite: 'Restaurant'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Hotel_select',url: '/hotspot-wifi-hotel-saint-denis-hotel_select-11511.html',ville: 'Saint Denis', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Fjt la Ruche',url: '/hotspot-wifi-agence-bancaire-fort-de-france-fjt-la-ruche-11553.html',ville: 'Fort de France', activite: 'Agence bancaire'}
]