function initMap() {
var centre = {lat: 43.09, lng: 0.17} ;
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: 42.81251200, lng: 0.29519200,
nom: 'Le Grand Schuss',url: '/hotspot-wifi-collectif-saint-lary-soulan-le-grand-schuss-1092.html',ville: 'Saint Lary Soulan', activite: 'Collectif'},
{lat: 42.84244400, lng: 0.40654900,
nom: 'Relais D\'Avajan',url: '/hotspot-wifi-hotel-avajan-relais-d-avajan-1337.html',ville: 'Avajan', activite: 'Hôtel'},
{lat: 43.23429520, lng: 0.07090660,
nom: 'Sci Meril - M. Darees Gérard',url: '/hotspot-wifi-collectif-tarbes-sci-meril-m-darees-gerard-3775.html',ville: 'Tarbes', activite: 'Collectif'},
{lat: 43.23161080, lng: 0.07353380,
nom: 'Office de Tourisme de Tarbes',url: '/hotspot-wifi-office-de-tourisme-tarbes-office-de-tourisme-de-tarbes-3783.html',ville: 'Tarbes', activite: 'Office de tourisme'},
{lat: 43.06936130, lng: 0.14954120,
nom: 'Atc Routes du Monde',url: '/hotspot-wifi-hotel-bagneres-de-bigorre-atc-routes-du-monde-4861.html',ville: 'Bagnères de Bigorre', activite: 'Hôtel'},
{lat: 43.24175620, lng: 0.07458360,
nom: 'Mda Arsenal',url: '/hotspot-wifi-centre-culturel-tarbes-mda-arsenal-6872.html',ville: 'Tarbes', activite: 'Centre culturel'},
{lat: 43.00761160, lng: -0.09810020,
nom: 'Hôtel du Soleil Levant',url: '/hotspot-wifi-hotel-argeles-gazost-hotel-du-soleil-levant-7236.html',ville: 'Argeles-Gazost', activite: 'Hôtel'},
{lat: 43.09486200, lng: -0.05348000,
nom: 'Hotel Notre Dame de France',url: '/hotspot-wifi-hotel-lourdes-hotel-notre-dame-de-france-7292.html',ville: 'Lourdes', activite: 'Hôtel'},
{lat: 43.08110700, lng: 0.15073320,
nom: 'Camping le Monloo',url: '/hotspot-wifi-camping-bagneres-de-bigorre-camping-le-monloo-7378.html',ville: 'Bagnères-De-Bigorre', activite: 'Camping'},
{lat: 43.05533600, lng: 0.16583170,
nom: 'Camping la Pommeraie',url: '/hotspot-wifi-camping-gerde-camping-la-pommeraie-8333.html',ville: 'Gerde', activite: 'Camping'},
{lat: 43.09635300, lng: -0.04846200,
nom: 'Château Fort de Lourdes',url: '/hotspot-wifi-mairie-lourdes-chateau-fort-de-lourdes-9045.html',ville: 'Lourdes', activite: 'Mairie'},
{lat: 43.23278800, lng: 0.07798900,
nom: 'Mairie de Tarbes',url: '/hotspot-wifi-mairie-tarbes-mairie-de-tarbes-9472.html',ville: 'Tarbes', activite: 'Mairie'},
{lat: 42.81603700, lng: 0.32737800,
nom: 'Residence le Parc',url: '/hotspot-wifi-collectif-saint-lary-soulan-residence-le-parc-9666.html',ville: 'Saint Lary Soulan', activite: 'Collectif'},
{lat: 43.25847900, lng: 0.05100600,
nom: 'Bibliothèque Claude Nougaro',url: '/hotspot-wifi-bibliotheque-borderes-sur-l-echez-bibliotheque-claude-nougaro-9954.html',ville: 'Bordères Sur L\'Echez', activite: 'Bibliothèque '},
{lat: 43.23737200, lng: 0.09353900,
nom: 'Bibliothèque Jules Laforgue',url: '/hotspot-wifi-bibliotheque-aureilhan-bibliotheque-jules-laforgue-9963.html',ville: 'Aureilhan', activite: 'Bibliothèque '},
{lat: 43.24381500, lng: 0.06348900,
nom: 'Bibliothèque Nelson Mandela',url: '/hotspot-wifi-bibliotheque-tarbes-bibliotheque-nelson-mandela-9972.html',ville: 'Tarbes', activite: 'Bibliothèque '},
{lat: 43.23602900, lng: 0.07777500,
nom: 'Médiathèque Louis Aragon',url: '/hotspot-wifi-bibliotheque-tarbes-mediatheque-louis-aragon-9984.html',ville: 'Tarbes', activite: 'Bibliothèque '},
{lat: 43.06934900, lng: 0.14991100,
nom: 'Atc - Route du Monde',url: '/hotspot-wifi-collectif-bagneres-de-bigorre-atc-route-du-monde-10068.html',ville: 'Bagneres de Bigorre', activite: 'Collectif'},
{lat: 43.22830800, lng: 0.10546800,
nom: 'Bibliothèque Albert Camus',url: '/hotspot-wifi-bibliotheque-semeac-bibliotheque-albert-camus-10137.html',ville: 'Semeac', activite: 'Bibliothèque '},
{lat: 43.24411700, lng: 0.06858000,
nom: 'Communauté D\'Agglomération Tarbes Lourdes Pyrénées',url: '/hotspot-wifi-espace-public-tarbes-communaute-d-agglomeration-tarbes-lourdes-pyrenees-10276.html',ville: 'Tarbes', activite: 'Espace public'},
{lat: 43.23270700, lng: 0.07802700,
nom: 'Mairie de Tarbes - Parking Brauhauban',url: '/hotspot-wifi-mairie-tarbes-mairie-de-tarbes-parking-brauhauban-10621.html',ville: 'Tarbes', activite: 'Mairie'},
{lat: 42.83694600, lng: 0.40791100,
nom: 'Camping le Hourgade',url: '/hotspot-wifi-camping-avajan-camping-le-hourgade-10733.html',ville: 'Avajan', activite: 'Camping'},
{lat: 43.09165200, lng: -0.04525800,
nom: 'Lac de Lourdes',url: '/hotspot-wifi-mairie-lourdes-lac-de-lourdes-10805.html',ville: 'Lourdes', activite: 'Mairie'},
{lat: 43.23086000, lng: 0.08395300,
nom: 'Mairie de Tarbes - Place Marcadieu',url: '/hotspot-wifi-mairie-tarbes-mairie-de-tarbes-place-marcadieu-10888.html',ville: 'Tarbes', activite: 'Mairie'},
{lat: 43.09165200, lng: -0.04525800,
nom: 'Maison France Service',url: '/hotspot-wifi-mairie-lourdes-maison-france-service-10917.html',ville: 'Lourdes', activite: 'Mairie'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Communauté D\'Agglomération Tarbes Lourdes Pyrénées - Siège',url: '/hotspot-wifi-espace-public-juillan-communaute-d-agglomeration-tarbes-lourdes-pyrenees-siege-11262.html',ville: 'Juillan', activite: 'Espace public'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Brit Hotel du Laca',url: '/hotspot-wifi-hotel-capvern-brit-hotel-du-laca-11418.html',ville: 'Capvern', activite: 'Hôtel'},
{lat: -99.00000000, lng: -99.00000000,
nom: 'Gip65',url: '/hotspot-wifi-espace-public-tarbes-gip65-11513.html',ville: 'Tarbes', activite: 'Espace public'},
{lat: 42.82042500, lng: 0.32256000,
nom: 'Royal Milan',url: '/hotspot-wifi-agence-bancaire-saint-lary-soulan-royal-milan-12356.html',ville: 'Saint Lary Soulan', activite: 'Agence bancaire'}
]