function initMap() {
var centre = {lat: 50.41, lng: 2.85} ;
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: 50.94497960, lng: 1.88715080,
nom: 'Pain Levain',url: '/hotspot-wifi-sandwicherie-calais-pain-levain-714.html',ville: 'Calais', activite: 'Sandwicherie'},
{lat: 50.58396420, lng: 2.74968920,
nom: 'La Ferme les Caperies',url: '/hotspot-wifi-gite-chambres-d-hotes-richebourg-la-ferme-les-caperies-1278.html',ville: 'Richebourg', activite: 'Gîte / Chambres d\'hôtes'},
{lat: 50.88661760, lng: 1.65861290,
nom: 'Le Père Baptiste',url: '/hotspot-wifi-sandwicherie-wissant-le-pere-baptiste-3370.html',ville: 'Wissant', activite: 'Sandwicherie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Sci Warbler',url: '/hotspot-wifi-societe-blendecques-sci-warbler-3828.html',ville: 'Blendecques', activite: 'Société'},
{lat: 50.28595290, lng: 2.79174680,
nom: 'Peugeot Arras',url: '/hotspot-wifi-concession-automobile-arras-peugeot-arras-4687.html',ville: 'Arras', activite: 'Concession automobile'},
{lat: 50.42260540, lng: 2.70846100,
nom: 'Les Pensées D\'Automne',url: '/hotspot-wifi-ehpad-aix-noulette-les-pensees-d-automne-6591.html',ville: 'Aix Noulette', activite: 'EHPAD'},
{lat: 50.80666700, lng: 1.60950400,
nom: 'Arche 3 Fontaines - Site A',url: '/hotspot-wifi-collectif-ambleteuse-arche-3-fontaines-site-a-8717.html',ville: 'Ambleteuse', activite: 'Collectif'},
{lat: 50.28405570, lng: 2.80282540,
nom: 'Peugeot Arras Vo',url: '/hotspot-wifi-concession-automobile-arras-peugeot-arras-vo-8856.html',ville: 'Arras', activite: 'Concession automobile'},
{lat: 50.73442600, lng: 1.61424800,
nom: 'Ehpad Notre de Dame de Boulogne',url: '/hotspot-wifi-ehpad-boulogne-ehpad-notre-de-dame-de-boulogne-9003.html',ville: 'Boulogne', activite: 'EHPAD'},
{lat: 50.72523100, lng: 1.61333400,
nom: 'Kawa Coffee House',url: '/hotspot-wifi-bar-brasserie-boulogne-sur-mer-kawa-coffee-house-9675.html',ville: 'Boulogne-Sur-Mer', activite: 'Bar brasserie'},
{lat: 50.48031400, lng: 1.60842200,
nom: 'Stella Maris',url: '/hotspot-wifi-hotel-cucq-stella-maris-9763.html',ville: 'Cucq', activite: 'Hôtel'},
{lat: 50.82056400, lng: 1.70515800,
nom: 'Ehpad Ste Famille',url: '/hotspot-wifi-ehpad-marquise-ehpad-ste-famille-9871.html',ville: 'Marquise', activite: 'EHPAD'},
{lat: 50.32824100, lng: 2.98644700,
nom: 'Ehpad St Joseph',url: '/hotspot-wifi-ehpad-vitry-en-artois-ehpad-st-joseph-9961.html',ville: 'Vitry En Artois', activite: 'EHPAD'},
{lat: 50.45836100, lng: 2.79546700,
nom: 'Pierre Damageux',url: '/hotspot-wifi-residence-etudiante-loos-en-gohelle-pierre-damageux-9977.html',ville: 'Loos En Gohelle', activite: 'Résidence étudiante'},
{lat: 50.95389700, lng: 1.85146670,
nom: 'H Eco',url: '/hotspot-wifi-hotel-calais-h-eco-9980.html',ville: 'Calais', activite: 'Hôtel'},
{lat: 50.37196900, lng: 3.11109200,
nom: '172 Libercourt',url: '/hotspot-wifi-vehicule-de-transport-mark-172-libercourt-10285.html',ville: 'Mark', activite: 'Véhicule de transport'},
{lat: 50.10639800, lng: 2.84798900,
nom: 'Véhicule 2',url: '/hotspot-wifi-vehicule-de-transport-bapaume-vehicule-2-10394.html',ville: 'Bapaume', activite: 'Véhicule de transport'},
{lat: 50.63310300, lng: 2.43858900,
nom: 'Camping la Petite Forêt',url: '/hotspot-wifi-camping-aire-sur-la-lys-camping-la-petite-foret-10431.html',ville: 'Aire-Sur-La-Lys', activite: 'Camping'},
{lat: 50.94252090, lng: 1.85543290,
nom: 'Hermant',url: '/hotspot-wifi-residence-etudiante-calais-hermant-10440.html',ville: 'Calais', activite: 'Résidence étudiante'},
{lat: 50.94870900, lng: 1.92759200,
nom: 'Marck - Ecole des Hautes Communes',url: '/hotspot-wifi-mairie-marck-marck-ecole-des-hautes-communes-10503.html',ville: 'Marck', activite: 'Mairie'},
{lat: 50.50000600, lng: 2.63390900,
nom: 'Ehpad Saint Camille',url: '/hotspot-wifi-ehpad-verquin-ehpad-saint-camille-10575.html',ville: 'Verquin', activite: 'EHPAD'},
{lat: 50.29497500, lng: 2.78273700,
nom: 'Institut de Formatique Pedagogique Arras',url: '/hotspot-wifi-ecole-arras-institut-de-formatique-pedagogique-arras-10869.html',ville: 'Arras', activite: 'Ecole'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Mairie Audembert',url: '/hotspot-wifi-mairie-audembert-mairie-audembert-10946.html',ville: 'Audembert', activite: 'Mairie'},
{lat: 50.83995800, lng: 1.83634400,
nom: 'La Ferme du Grand Air',url: '/hotspot-wifi-gite-chambres-d-hotes-fiennes-la-ferme-du-grand-air-11015.html',ville: 'Fiennes', activite: 'Gîte / Chambres d\'hôtes'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Centre Aquatique Carvin',url: '/hotspot-wifi-centre-automobile-carvin-centre-aquatique-carvin-11313.html',ville: 'Carvin', activite: 'Centre automobile'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ace Hotel Noyelles',url: '/hotspot-wifi-hotel-noyelles-godault-ace-hotel-noyelles-11341.html',ville: 'Noyelles-Godault', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Opalinn',url: '/hotspot-wifi-hotel-boulogne-sur-mer-opalinn-11355.html',ville: 'Boulogne Sur Mer', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Ace Hotel Arras',url: '/hotspot-wifi-hotel-beaurains-ace-hotel-arras-11457.html',ville: 'Beaurains', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Communauté de Communes de Desvres - Ot Samer',url: '/hotspot-wifi-espace-public-desvres-communaute-de-communes-de-desvres-ot-samer-11565.html',ville: 'Desvres', activite: 'Espace public'},
{lat: 50.28856830, lng: 2.78997870,
nom: 'Arras - Ehpad St Francois',url: '/hotspot-wifi-ehpad-arras-arras-ehpad-st-francois-12011.html',ville: 'Arras', activite: 'EHPAD'},
{lat: 50.72407900, lng: 1.60509100,
nom: 'Hôtel le Metropole',url: '/hotspot-wifi-hotel-boulogne-sur-mer-hotel-le-metropole-12233.html',ville: 'Boulogne Sur Mer', activite: 'Hôtel'},
{lat: 50.91157860, lng: 1.75129490,
nom: 'Camping les Epinettes',url: '/hotspot-wifi-camping-peuplingues-camping-les-epinettes-12355.html',ville: 'Peuplingues', activite: 'Camping'},
{lat: 50.52192700, lng: 2.62355600,
nom: 'L\'Assiette Au Boeuf',url: '/hotspot-wifi-restaurant-bethune-l-assiette-au-boeuf-12476.html',ville: 'Bethune', activite: 'Restaurant'}
]