Desktop samples use label layer by devemux86 · Pull Request #1580 · mapsforge/mapsforge

Here is the real reason (the above seems to be just a lucky coincidence).

It can be reproduced in master if the DatabaseRenderer constructor is called with renderLabels=true and labelStore=null. Of course, the sample app took care not to set the parameters this way, but that's not the point, the point is that this case is not mentioned in the constructor's javadoc, so it can be misleading.

Probably nothing important, so we can drop it, but in case anyone will be wondering.

The code:

/**
* Constructs a new DatabaseRenderer.
* There are three possible configurations:
* 1) render labels directly onto tiles: renderLabels == true && tileCache != null
* 2) do not render labels but cache them: renderLabels == false && labelStore != null
* 3) do not render or cache labels: renderLabels == false && labelStore == null
*
* @param mapDataStore the data source.
* @param graphicFactory the graphic factory.
* @param tileCache where tiles are cached (needed if labels are drawn directly onto tiles, otherwise null)
* @param labelStore where labels are cached.
* @param renderLabels if labels should be rendered.
* @param cacheLabels if labels should be cached.
* @param hillsRenderConfig the hillshading setup to be used (can be null).
*/
public DatabaseRenderer(MapDataStore mapDataStore, GraphicFactory graphicFactory, TileCache tileCache,
TileBasedLabelStore labelStore, boolean renderLabels, boolean cacheLabels,
HillsRenderConfig hillsRenderConfig) {
super(mapDataStore, graphicFactory, renderLabels || cacheLabels, hillsRenderConfig);
this.tileCache = tileCache;
this.labelStore = labelStore;
this.renderLabels = renderLabels;
if (!renderLabels) {
this.tileDependencies = null;
} else {
this.tileDependencies = new TileDependencies();
}
}