Package org.mapsforge.map.layer.labels
Class ThreadedLabelLayer
- java.lang.Object
-
- org.mapsforge.map.layer.Layer
-
- org.mapsforge.map.layer.labels.LabelLayer
-
- org.mapsforge.map.layer.labels.ThreadedLabelLayer
-
public class ThreadedLabelLayer extends LabelLayer
This ThreadedLabelLayer employs a single thread to request new data from the LabelStore. In case the previously displayed data is still valid for at least some part of the map, the old data is drawn first. When the thread delivers the data for the new area, the layer is redrawn. The layer keeps track of the requested area and will not request the same area multiple times. Also the queue length is limited to one, so outdated requests will not be started.
-
-
Field Summary
-
Fields inherited from class org.mapsforge.map.layer.labels.LabelLayer
elementsToDraw, labelStore, lastLabelStoreVersion, lowerRight, matrix, upperLeft
-
Fields inherited from class org.mapsforge.map.layer.Layer
displayModel
-
-
Constructor Summary
Constructors Constructor Description ThreadedLabelLayer(org.mapsforge.core.graphics.GraphicFactory graphicFactory, LabelStore labelStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)Draws thisLayeron the given canvas.protected voidgetData(org.mapsforge.core.model.Tile upperLeft, org.mapsforge.core.model.Tile lowerRight)voidonDestroy()-
Methods inherited from class org.mapsforge.map.layer.labels.LabelLayer
draw
-
Methods inherited from class org.mapsforge.map.layer.Layer
getDisplayModel, getPosition, isVisible, onAdd, onLongPress, onRemove, onScroll, onTap, requestRedraw, setDisplayModel, setVisible, setVisible
-
-
-
-
Constructor Detail
-
ThreadedLabelLayer
public ThreadedLabelLayer(org.mapsforge.core.graphics.GraphicFactory graphicFactory, LabelStore labelStore)
-
-
Method Detail
-
draw
public void draw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)Description copied from class:LayerDraws thisLayeron the given canvas.- Overrides:
drawin classLabelLayer- Parameters:
boundingBox- the geographical area which should be drawn.zoomLevel- the zoom level at which thisLayershould draw itself.canvas- the canvas on which thisLayershould draw itself.topLeftPoint- the top-left pixel position of the canvas relative to the top-left map position.
-
getData
protected void getData(org.mapsforge.core.model.Tile upperLeft, org.mapsforge.core.model.Tile lowerRight)
-
-