vendredi 2 janvier 2015

Leaflet Marker Cluster not appearing


I would like for my points to cluster using L.markerClusterGroup.


I am receiving a 200 status; but nothing appears on my map. I have commented out my markers which appear when uncommented.


http://ift.tt/1zJg08f



/// var points = L.geoJson(geojsonfeatures, {
///filter: function(feature, layer) {
/// return feature.properties.COUNTRY != "UNITED STATES";
/// },
/// pointToLayer: function(feature, latLng) {
/// return L.marker(latLng)
/// .bindPopup(feature.properties.NAME);






var points = L.markerClusterGroup();

for (var i = 0; i < geojsonfeatures.length; i++) {
var a = geojsonfeatures[i];
var NAME = a[2];
var marker = L.marker(new L.LatLng(a[0], a[1]), { NAME: NAME });
marker.bindPopup(NAME);
markers.addLayer(NAME);
}










map = L.map('myMap', {
center: centerlatlng,
zoom: 6,
layers: [aLayerOne]
});




Aucun commentaire:

Enregistrer un commentaire