I have to create a map with more than 5000 points from a geojson. So I would like to use markercluster plugin with Leaflet.
I wrote the following code with help from the documentation and from other posts (I'm new to webmapping and to programming languages) and the chrome console returns that "L is not defined" for the leaflet.markercluster.js file and that "undefined is not a function" for my line of code with L.markerClusterGroup().
Here is the code :
var clusterGroup = new L.markerClusterGroup();
var points = L.geoJson(gares, {
pointToLayer: function (feature, latlng) {
return L.marker(latlng)
.bindPopup(feature.properties.NOM);
}
});
clusterGroup.addLayer(points);
map.addLayer(clusterGroup);
Is there someone to help me understanding why it doesn't work ?