function initMap() {
var centre = {lat: 43.56, lng: 3.33} ;
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.61318200, lng: 3.15516900,
nom: 'Campotel des 3 Vallees',url: '/hotspot-wifi-gite-chambres-d-hotes-bedarieux-campotel-des-3-vallees-2769.html',ville: 'Bedarieux', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.45590280, lng: 3.68298480,
nom: 'Gilles Balestriere',url: '/hotspot-wifi-gite-chambres-d-hotes-balaruc-le-vieux-gilles-balestriere-3375.html',ville: 'Balaruc le Vieux', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.45837760, lng: 3.68552400,
nom: 'Balaruc le Vieux-Le Grand Chai',url: '/hotspot-wifi-ehpad-balaruc-le-vieux-balaruc-le-vieux-le-grand-chai-3500.html',ville: 'Balaruc le Vieux', activite: 'EHPAD'},
{lat: 43.46153100, lng: 3.42319300,
nom: 'B&b Pezenas',url: '/hotspot-wifi-hotel-pezenas-b-b-pezenas-5779.html',ville: 'Pezenas', activite: 'Hôtel'},
{lat: 43.50560920, lng: 3.79522260,
nom: 'Mireval-Le Valmi',url: '/hotspot-wifi-ehpad-mireval-mireval-le-valmi-6656.html',ville: 'Mireval', activite: 'EHPAD'},
{lat: 43.76787470, lng: 3.86293360,
nom: 'St Mathieu de Treviers-La Quintessence',url: '/hotspot-wifi-ehpad-st-mathieu-de-treviers-st-mathieu-de-treviers-la-quintessence-6685.html',ville: 'St Mathieu de Treviers', activite: 'EHPAD'},
{lat: 43.62924880, lng: 3.86959970,
nom: 'La Pasquiere',url: '/hotspot-wifi-residence-de-services-montpellier-la-pasquiere-7237.html',ville: 'Montpellier', activite: 'Résidence de services'},
{lat: 43.49729300, lng: 3.02788000,
nom: 'Campotel de L\'Orb',url: '/hotspot-wifi-camping-roquebrun-campotel-de-l-orb-7397.html',ville: 'Roquebrun', activite: 'Camping'},
{lat: 43.50059790, lng: 3.71200800,
nom: 'Gîte de Larmonys',url: '/hotspot-wifi-gite-chambres-d-hotes-gigean-gite-de-larmonys-7402.html',ville: 'Gigean', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.58384350, lng: 3.85921260,
nom: 'Le Pétrin des Grisettes',url: '/hotspot-wifi-bar-brasserie-montpellier-le-petrin-des-grisettes-7405.html',ville: 'Montpellier', activite: 'Bar brasserie'},
{lat: 43.52389540, lng: 3.92180130,
nom: 'Studio Palavas',url: '/hotspot-wifi-gite-chambres-d-hotes-palavas-les-flots-studio-palavas-7523.html',ville: 'Palavas les Flots', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.64184050, lng: 3.86359230,
nom: 'Maison de Retraite Protestante',url: '/hotspot-wifi-ehpa-montpellier-maison-de-retraite-protestante-7749.html',ville: 'Montpellier', activite: 'EHPA'},
{lat: 43.65798500, lng: 3.88391600,
nom: 'Le Foyer du Romarin',url: '/hotspot-wifi-ehpad-clapiers-le-foyer-du-romarin-8341.html',ville: 'Clapiers', activite: 'EHPAD'},
{lat: 43.56152760, lng: 4.09123780,
nom: 'Atc Residence Grande Motte',url: '/hotspot-wifi-collectif-la-grande-motte-atc-residence-grande-motte-8404.html',ville: 'La Grande Motte', activite: 'Collectif'},
{lat: 43.40021200, lng: 3.69021900,
nom: 'Sarl South Lodge',url: '/hotspot-wifi-gite-chambres-d-hotes-sete-sarl-south-lodge-8952.html',ville: 'Sète', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.94110900, lng: 3.71365600,
nom: 'Ehpad le Jardin des Aines',url: '/hotspot-wifi-ehpad-ganges-ehpad-le-jardin-des-aines-8985.html',ville: 'Ganges', activite: 'EHPAD'},
{lat: 43.64982200, lng: 3.89113400,
nom: 'Hameau des Horizons',url: '/hotspot-wifi-ehpa-clapiers-hameau-des-horizons-9336.html',ville: 'Clapiers', activite: 'EHPA'},
{lat: 43.44672130, lng: 3.65899200,
nom: 'La Voile Blanche',url: '/hotspot-wifi-hotel-bouzigues-la-voile-blanche-9470.html',ville: 'Bouzigues', activite: 'Hôtel'},
{lat: 43.34233800, lng: 3.21344500,
nom: 'Le Quartier Gourmand',url: '/hotspot-wifi-sandwicherie-beziers-le-quartier-gourmand-9981.html',ville: 'Beziers', activite: 'Sandwicherie'},
{lat: 43.59551400, lng: 3.84810400,
nom: 'Montpelier Herault Rugby',url: '/hotspot-wifi-societe-montpelier-montpelier-herault-rugby-10032.html',ville: 'Montpelier', activite: 'Société'},
{lat: 43.30518460, lng: 3.49117870,
nom: 'Les Jardins de Brescou',url: '/hotspot-wifi-ehpad-agde-les-jardins-de-brescou-10426.html',ville: 'Agde', activite: 'EHPAD'},
{lat: 43.56043500, lng: 4.07571800,
nom: 'Un Autre Pain',url: '/hotspot-wifi-sandwicherie-la-grande-motte-un-autre-pain-10479.html',ville: 'La Grande Motte', activite: 'Sandwicherie'},
{lat: 43.66754000, lng: 4.01838600,
nom: 'Ehpad Louis Laget',url: '/hotspot-wifi-ehpad-baillargues-ehpad-louis-laget-10740.html',ville: 'Baillargues', activite: 'EHPAD'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Gsvi Montpellier',url: '/hotspot-wifi-vehicule-de-transport-baillargues-gsvi-montpellier-10910.html',ville: 'Baillargues', activite: 'Véhicule de transport'},
{lat: 43.60726650, lng: 3.87709650,
nom: 'Hôtel des Etuves',url: '/hotspot-wifi-hotel-montpellier-hotel-des-etuves-11064.html',ville: 'Montpellier', activite: 'Hôtel'},
{lat: 43.60645900, lng: 3.87785700,
nom: 'Hôtel des Arts',url: '/hotspot-wifi-hotel-montpellier-hotel-des-arts-11310.html',ville: 'Montpellier', activite: 'Hôtel'},
{lat: 43.56064400, lng: 4.07563000,
nom: 'Extrem Gym',url: '/hotspot-wifi-salle-de-sport-la-grande-motte-extrem-gym-11491.html',ville: 'La Grande Motte', activite: 'Salle de sport'},
{lat: 43.55683900, lng: 3.78033900,
nom: 'Aire de Fabregues',url: '/hotspot-wifi-restaurant-fabregues-aire-de-fabregues-11589.html',ville: 'Fabregues', activite: 'Restaurant'},
{lat: 43.33705200, lng: 3.22327800,
nom: 'Citivie Residence Seniors des Poètes',url: '/hotspot-wifi-residence-de-services-beziers-citivie-residence-seniors-des-poetes-11995.html',ville: 'Beziers', activite: 'Résidence de services'},
{lat: 43.68401300, lng: 3.87492900,
nom: 'Mission Africaine',url: '/hotspot-wifi-ehpad-monferrier-sur-lez-mission-africaine-12541.html',ville: 'Monferrier-Sur-Lez', activite: 'EHPAD'}
]