I'm currently using ngx-leaflet 4.0.0 with Angular 6.x and RXjs 6.x. I have a bunch of observable that generate/stream Layers which should be drawn on the map.
When we have a lot of markers then, as you might expect, the performance degrades. This probably has to do with the fact that I basically concat all the markers in to one single array which I pass to leafletLayers.
Ideally I only add, remove or update a single layergroup using its name. Unfortunately I don't know how to use LayerGroups as is suggested as one of the two performance enhancements when working with a large number of markers. I want to use a data structure as you see below, should this be possible?
blueLayerGroup: L.LayerGroup
redLayerGroup: L.LayerGroup
{
"BlueShips": blueLayerGroup,
"RedShips": redLayerGroup
}
I'm not using the leafletMapControl, we have our own custom ui for selecting layers.