Looking for a way to add an empty overlay to a Leaflet map. I have multiple Leaflet overlays that load in their data from a realtime server. Because I am using a custom UI control and not the default Leaflet one, I have a listener that every time new markers are created, checks to see whether their associated layer is active, and if it is, adds the markers to that layer.
$rootScope.on('newMarkers',markers)->
type = *fn to find type*
if mapFactory.currentLayers[type]?.active
mapFactory.addLayer(markers, type)
)
I don't think building in logic to see whether it's the first time a marker is being added to that layer makes sense, and would rather create an empty layer and add data to it after. I know you can do this with the L.geoJson type, but this layer is made entirely of plain markers. Any suggestions