Class GroupLayer


  • public class GroupLayer
    extends Layer
    A layer which is a group of other layers.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<Layer> layers
      The group of other layers.
    • Constructor Summary

      Constructors 
      Constructor Description
      GroupLayer()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void draw​(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)
      Draws this Layer on the given canvas.
      void onDestroy()  
      boolean onLongPress​(org.mapsforge.core.model.LatLong tapLatLong, org.mapsforge.core.model.Point layerXY, org.mapsforge.core.model.Point tapXY)
      GroupLayer does not have a position, layerXY is null.
      boolean onTap​(org.mapsforge.core.model.LatLong tapLatLong, org.mapsforge.core.model.Point layerXY, org.mapsforge.core.model.Point tapXY)
      GroupLayer does not have a position, layerXY is null.
      void setDisplayModel​(DisplayModel displayModel)
      The DisplayModel comes from a MapView, so is generally not known when the layer itself is created.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • layers

        public final java.util.List<Layer> layers
        The group of other layers.
    • Constructor Detail

      • GroupLayer

        public GroupLayer()
    • 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.
        Specified by:
        draw in class Layer
        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.
      • onDestroy

        public void onDestroy()
        Overrides:
        onDestroy in class Layer
      • onLongPress

        public boolean onLongPress​(org.mapsforge.core.model.LatLong tapLatLong,
                                   org.mapsforge.core.model.Point layerXY,
                                   org.mapsforge.core.model.Point tapXY)
        GroupLayer does not have a position, layerXY is null.
        Overrides:
        onLongPress in class Layer
        Parameters:
        tapLatLong - the geographic position of the long press.
        layerXY - the xy position of the layer element (if available)
        tapXY - the xy position of the tap
        Returns:
        true if the long press event was handled, false otherwise.
      • onTap

        public boolean onTap​(org.mapsforge.core.model.LatLong tapLatLong,
                             org.mapsforge.core.model.Point layerXY,
                             org.mapsforge.core.model.Point tapXY)
        GroupLayer does not have a position, layerXY is null.
        Overrides:
        onTap in class Layer
        Parameters:
        tapLatLong - the the geographic position of the tap.
        layerXY - the xy position of the layer element (if available)
        tapXY - the xy position of the tap
        Returns:
        true if the tap event was handled, false otherwise.
      • setDisplayModel

        public void setDisplayModel​(DisplayModel displayModel)
        Description copied from class: Layer
        The DisplayModel comes from a MapView, so is generally not known when the layer itself is created. Maybe a better way would be to have a MapView as a parameter when creating a layer.
        Overrides:
        setDisplayModel in class Layer
        Parameters:
        displayModel - the displayModel to use.