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>
layers
The 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 void
draw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)
Draws thisLayer
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 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:Layer
Draws thisLayer
on the given canvas.- Specified by:
draw
in classLayer
- Parameters:
boundingBox
- the geographical area which should be drawn.zoomLevel
- the zoom level at which thisLayer
should draw itself.canvas
- the canvas on which thisLayer
should 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:
onLongPress
in 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: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 classLayer
- Parameters:
displayModel
- the displayModel to use.
-
-