Package org.mapsforge.map.layer
Class GroupLayer
- java.lang.Object
-
- org.mapsforge.map.layer.Layer
-
- org.mapsforge.map.layer.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>layersThe group of other layers.-
Fields inherited from class org.mapsforge.map.layer.Layer
displayModel
-
-
Constructor Summary
Constructors Constructor Description GroupLayer()
-
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.voidonDestroy()booleanonLongPress(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.booleanonTap(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.voidsetDisplayModel(DisplayModel displayModel)The DisplayModel comes from a MapView, so is generally not known when the layer itself is created.-
Methods inherited from class org.mapsforge.map.layer.Layer
getDisplayModel, getPosition, isVisible, onAdd, onRemove, onScroll, requestRedraw, setVisible, setVisible
-
-
-
-
Field Detail
-
layers
public final java.util.List<Layer> layers
The group of other layers.
-
-
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.- Specified by:
drawin classLayer- 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.
-
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:
onLongPressin classLayer- 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.
-
setDisplayModel
public void setDisplayModel(DisplayModel displayModel)
Description copied from class:LayerThe 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:
setDisplayModelin classLayer- Parameters:
displayModel- the displayModel to use.
-
-