I have a leaflet map with several markers in it. I\'ve put these markers in \"Layer Groups\" to be able to show and hide the marker-categories. These are my markers:
<
First you need a link for each layer
Then, for each link you can write a handler like this (example with jQuery)
$("#restaurants").click(function(event) {
event.preventDefault();
if(map.hasLayer(restaurants)) {
$(this).removeClass('selected');
map.removeLayer(restaurants);
} else {
map.addLayer(restaurants);
$(this).addClass('selected');
}
});
You have an example here http://jsfiddle.net/FranceImage/c5Yfb/