Detailing the prevention of non-deterministic labels by Sublimis · Pull Request #1588 · mapsforge/mapsforge
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not always -- even in the current master it can be null. DatabaseRenderer does not depend on this being a TileBasedLabelStore. Current implementation of processLabels() also does not depend on a particular LabelStore implementation, it only assumes there's a LabelStore that contains some labels, nothing more. It can even run with labelStore == null.
And now that DirectRenderer extends DatabaseRenderer in this PR, LabelStore implementation can also be MapDataStoreLabelStore, so it feels natural to generalize things. If this is really something you want to avoid we can for example create a new interface extending LabelStore that would define the TileBasedLabelStore.storeMapItems(). Otherwise too much code would get duplicated in DirectRenderer (there would be no point in extending DatabaseRenderer if it can only work with TileBasedLabelStore).