var carte = L.map('carte').setView([ 47.219127, 2.558149 ], 8);
//var carte = L.map('carte');
L.tileLayer('https://api.mapbox.com/styles/v1/blackmeridian/cli0fjrsx02a101r08uhn2cpn/tiles/256/{z}/{x}/{y}?access_token=pk.eyJ1IjoiYmxhY2ttZXJpZGlhbiIsImEiOiJjbG11Zzc5bXgwMW13MmtwZW1scDQxcTg5In0.0OqZG-PQP1Ui9w7NSyyVWQ', {
maxZoom: 18,
attribution: 'bjbeditions.com © OpenStreetMap contributors, ' +
'CC-BY-SA'
}).addTo(carte);
carte.whenReady(function() {
setTimeout(function() {
$(".carte-loader").removeClass("carte-loader");
}, 1000);
});
var iconStandard = L.icon({iconUrl: 'https://next-assets.bjbeditions.com.black-meridian.fr/assets/js/leaflet/images/marker-icon.png', iconSize: [25, 41], iconAnchor: [12, 41], popupAnchor: [1, -41]});
var markerList = [];
var bounds = [];
var stores = $("#evenements-list");
var marker;
var markerCluster = L.markerClusterGroup({
spiderfyOnMaxZoom: true,
showCoverageOnHover: false,
zoomToBoundsOnClick: true,
maxClusterRadius:1,
singleMarkerMode:true
}); // à commenter pour désactiver markerCluster
console.log(geojson.features)
for (var i = 0; i < geojson.features.length; i++) {
markerList.push(marker = L.marker(geojson.features[i].geometry.coordinates, {icon: iconStandard}));
bounds.push(geojson.features[i].geometry.coordinates);
html = "";
if(geojson.features[i].fields.pagetitle) {
html += "" + geojson.features[i].fields.pagetitle + "";
}
if(geojson.features[i].fields.contact_zipcode || geojson.features[i].fields.contact_city) {
html += "";
html += "room";
html += "";
}
if(geojson.features[i].fields.contact_housenumber) {
html += geojson.features[i].fields.contact_housenumber + " ";
}
if(geojson.features[i].fields.contact_street) {
html += geojson.features[i].fields.contact_street + " ";
}
if(geojson.features[i].fields.contact_housenumber || geojson.features[i].fields.contact_street) {
html += "
";
}
if(geojson.features[i].fields.contact_zipcode) {
html += geojson.features[i].fields.contact_zipcode + " ";
}
if(geojson.features[i].fields.contact_city) {
html += geojson.features[i].fields.contact_city + " ";
}
if(geojson.features[i].fields.contact_zipcode || geojson.features[i].fields.contact_city) {
html += "";
html += "";
}
if(geojson.features[i].href) {
html += "