function initMap() {
var centre = {lat: 43.4676, lng: 6.23759} ;
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.52871810, lng: 6.81416750,
nom: 'Le Mas de la Verrerie',url: '/hotspot-wifi-gite-chambres-d-hotes-les-adrets-de-l-esterel-le-mas-de-la-verrerie-1460.html',ville: 'Les Adrets de L Esterel', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.35103770, lng: 6.71465330,
nom: 'Hotel les Calanques',url: '/hotspot-wifi-hotel-les-issambres-hotel-les-calanques-2838.html',ville: 'Les Issambres', activite: 'Hôtel'},
{lat: 43.39095400, lng: 6.34142700,
nom: 'La Piece de Boeuf',url: '/hotspot-wifi-restaurant-le-cannet-des-maures-la-piece-de-boeuf-3291.html',ville: 'Le Cannet des Maures', activite: 'Restaurant'},
{lat: 43.65301430, lng: 6.16637600,
nom: 'Mairie de Régusse',url: '/hotspot-wifi-bibliotheque-regusse-mairie-de-regusse-4657.html',ville: 'Régusse', activite: 'Bibliothèque '},
{lat: 43.42462880, lng: 6.74530400,
nom: 'Casino de Frejus',url: '/hotspot-wifi-restaurant-frejus-casino-de-frejus-4856.html',ville: 'Frejus', activite: 'Restaurant'},
{lat: 43.01811520, lng: 6.43413560,
nom: 'La Coccinelle',url: '/hotspot-wifi-gite-chambres-d-hotes-hyeres-la-coccinelle-5824.html',ville: 'Hyeres', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.13566900, lng: 6.23626000,
nom: 'La Londe les Maures-Les Templitudes',url: '/hotspot-wifi-residence-de-services-la-londe-les-maures-la-londe-les-maures-les-templitudes-5954.html',ville: 'La Londe les Maures', activite: 'Résidence de services'},
{lat: 43.12262000, lng: 6.23500200,
nom: 'La Londe les Maures-Residence Bellisa',url: '/hotspot-wifi-ehpad-la-londe-les-maures-la-londe-les-maures-residence-bellisa-6631.html',ville: 'La Londe les Maures', activite: 'EHPAD'},
{lat: 43.45310080, lng: 5.86024550,
nom: 'Hotel Plaisance',url: '/hotspot-wifi-hotel-saint-maximin-hotel-plaisance-6870.html',ville: 'Saint Maximin', activite: 'Hôtel'},
{lat: 43.32531290, lng: 6.62274360,
nom: 'Amicale Sapeurs Pompiers',url: '/hotspot-wifi-clinique-hopital-sainte-maxime-amicale-sapeurs-pompiers-6945.html',ville: 'Sainte-Maxime', activite: 'Clinique / Hôpital'},
{lat: 43.34353970, lng: 6.12045720,
nom: 'Chemin des Oustaous Routs',url: '/hotspot-wifi-gite-chambres-d-hotes-saint-anastasie-sur-issole-chemin-des-oustaous-routs-7377.html',ville: 'Saint Anastasie Sur Issole', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.12492140, lng: 5.93105540,
nom: 'Happy Food Cafe',url: '/hotspot-wifi-bar-brasserie-toulon-happy-food-cafe-7388.html',ville: 'Toulon', activite: 'Bar brasserie'},
{lat: 43.23727700, lng: 6.30920100,
nom: 'Office de Tourisme de Collobrières',url: '/hotspot-wifi-office-de-tourisme-collobrieres-office-de-tourisme-de-collobrieres-7395.html',ville: 'Collobrières', activite: 'Office de tourisme'},
{lat: 43.13606100, lng: 6.00906800,
nom: 'Bioandco le Marché Toulon',url: '/hotspot-wifi-bar-restaurant-la-valette-du-var-bioandco-le-marche-toulon-7423.html',ville: 'La Valette du Var', activite: 'Bar restaurant'},
{lat: 43.87540400, lng: 7.08132100,
nom: 'Office de Tourisme de Pierrefeu',url: '/hotspot-wifi-office-de-tourisme-pierrefeu-office-de-tourisme-de-pierrefeu-7425.html',ville: 'Pierrefeu', activite: 'Office de tourisme'},
{lat: 43.23787500, lng: 6.07219990,
nom: 'Office de Tourisme de Cuers',url: '/hotspot-wifi-office-de-tourisme-cuers-office-de-tourisme-de-cuers-7426.html',ville: 'Cuers', activite: 'Office de tourisme'},
{lat: 43.46440260, lng: 6.47942380,
nom: 'L\'Entraide Salesienne',url: '/hotspot-wifi-ehpad-les-arcs-l-entraide-salesienne-7548.html',ville: 'Les Arcs', activite: 'EHPAD'},
{lat: 43.29974140, lng: 6.22397410,
nom: 'La Petite Auberge',url: '/hotspot-wifi-bar-restaurant-pignans-la-petite-auberge-8719.html',ville: 'Pignans', activite: 'Bar restaurant'},
{lat: 43.28073500, lng: 6.58251800,
nom: 'Hôtel Villa des Anges',url: '/hotspot-wifi-hotel-grimaud-hotel-villa-des-anges-8889.html',ville: 'Grimaud', activite: 'Hôtel'},
{lat: 43.39735600, lng: 6.43470600,
nom: 'Gites83_83g1185',url: '/hotspot-wifi-gite-chambres-d-hotes-vidauban-gites83_83g1185-9490.html',ville: 'Vidauban', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.50621700, lng: 6.01418500,
nom: 'Gites de la Réparade',url: '/hotspot-wifi-gite-chambres-d-hotes-chateauvert-gites-de-la-reparade-10065.html',ville: 'Châteauvert', activite: 'Gîte / Chambres d\'hôtes'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ace - 83ca',url: '/hotspot-wifi-ehpad-ollioules-ace-83ca-10841.html',ville: 'Ollioules', activite: 'EHPAD'},
{lat: 43.53527500, lng: 6.15323900,
nom: 'Camping Municipal Cotignac',url: '/hotspot-wifi-camping-cotignac-camping-municipal-cotignac-10980.html',ville: 'Cotignac', activite: 'Camping'},
{lat: 43.14144800, lng: 6.38031000,
nom: 'Hotel la Bastide',url: '/hotspot-wifi-hotel-le-lavandou-hotel-la-bastide-10992.html',ville: 'Le Lavandou', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Hotel California',url: '/hotspot-wifi-hotel-le-lavandou-hotel-california-11163.html',ville: 'Le Lavandou', activite: 'Hôtel'},
{lat: 43.13862200, lng: 6.23520800,
nom: 'Office de Tourisme Port de la Londe les Maures',url: '/hotspot-wifi-office-de-tourisme-la-londe-les-maures-office-de-tourisme-port-de-la-londe-les-maures-11290.html',ville: 'La Londe les Maures', activite: 'Office de tourisme'},
{lat: 43.45698100, lng: 6.42735300,
nom: 'Chateau Taradeau',url: '/hotspot-wifi-gite-chambres-d-hotes-taradeau-chateau-taradeau-11546.html',ville: 'Taradeau', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 43.32160100, lng: 6.66433400,
nom: 'La Voile',url: '/hotspot-wifi-bar-restaurant-sainte-maxime-la-voile-12147.html',ville: 'Sainte-Maxime', activite: 'Bar restaurant'},
{lat: 43.07902000, lng: 6.15390100,
nom: 'Hôtel le Méditerranée',url: '/hotspot-wifi-hotel-hyeres-hotel-le-mediterranee-12394.html',ville: 'Hyères', activite: 'Hôtel'},
{lat: 43.47123200, lng: 6.55550200,
nom: 'Emera - Rs Mille Soleils',url: '/hotspot-wifi-ehpad-muy-emera-rs-mille-soleils-12430.html',ville: 'Muy', activite: 'EHPAD'},
{lat: 43.44548500, lng: 6.46922700,
nom: 'Hôtel Aurelia',url: '/hotspot-wifi-hotel-les-arcs-sur-argens-hotel-aurelia-12533.html',ville: 'Les Arcs Sur Argens', activite: 'Hôtel'},
{lat: 43.59223100, lng: 6.67995000,
nom: 'Lou Cantaire',url: '/hotspot-wifi-camping-fayence-lou-cantaire-12622.html',ville: 'Fayence', activite: 'Camping'},
{lat: 43.10457100, lng: 5.85162500,
nom: 'Résidence L\'Age D\'Or',url: '/hotspot-wifi-ehpad-la-seyne-sur-mer-residence-l-age-d-or-12670.html',ville: 'La Seyne-Sur-Mer', activite: 'EHPAD'}
]