I'm new to leaflet and I'm stuck here. I am receiving an xml with locations and their type, (lat, long, type). I want to create a marker layer for every unique type that I get but It's not possible to know how many types I'll be getting each time. So I would like to ask if it is possible to make an array of layers, something like:
for (var i = 0; i < locTypes.length; i++){
var markerLayers[i] = new L.layerGroup();
//populateLayer();
}
My target is to hide/show specific marker layers on the map.