Skip to content

Instantly share code, notes, and snippets.

@turban
Last active October 11, 2015 21:28
Show Gist options
  • Save turban/3922626 to your computer and use it in GitHub Desktop.
Save turban/3922626 to your computer and use it in GitHub Desktop.
var huts = new L.MarkerClusterGroup({
showCoverageOnHover: false,
maxClusterRadius: 50
});
var hutTypes = ['Basic Hut/Bivvy', 'Standard Hut', 'Serviced Hut', 'Serviced-Alpine Hut', 'Great Walk Hut'];
huts.addLayers(data.map(function(hut) {
return new L.Marker(new L.LatLng(hut[0], hut[1]), {
title: hut[2],
icon: L.icon({
iconSize: [32, 37],
iconAnchor: [16, 37],
popupAnchor: [0, -30],
iconUrl: 'icons/hut' + hut[3] + '.png'
})
}).bindPopup('<strong>' + hut[2] + '</strong><br>' + hutTypes[hut[3]]);
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment