Class 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.
    • 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: Layer
        Draws this Layer on the given canvas.
        Overrides:
        draw in class LabelLayer
        Parameters:
        boundingBox - the geographical area which should be drawn.
        zoomLevel - the zoom level at which this Layer should draw itself.
        canvas - the canvas on which this Layer should 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)
      • onDestroy

        public void onDestroy()
        Overrides:
        onDestroy in class Layer