Package org.mapsforge.map.layer.overlay
Class Grid
- java.lang.Object
-
- org.mapsforge.map.layer.Layer
-
- org.mapsforge.map.layer.overlay.Grid
-
public class Grid extends Layer
The Grid layer draws a geographical grid.
-
-
Field Summary
-
Fields inherited from class org.mapsforge.map.layer.Layer
displayModel
-
-
Constructor Summary
Constructors Constructor Description Grid(org.mapsforge.core.graphics.GraphicFactory graphicFactory, DisplayModel displayModel, java.util.Map<java.lang.Byte,java.lang.Double> spacingConfig)Ctor.Grid(DisplayModel displayModel, java.util.Map<java.lang.Byte,java.lang.Double> spacingConfig, org.mapsforge.core.graphics.Paint lineBack, org.mapsforge.core.graphics.Paint lineFront, org.mapsforge.core.graphics.Paint textBack, org.mapsforge.core.graphics.Paint textFront)Ctor.
-
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.-
Methods inherited from class org.mapsforge.map.layer.Layer
getDisplayModel, getPosition, isVisible, onAdd, onDestroy, onLongPress, onRemove, onScroll, onTap, requestRedraw, setDisplayModel, setVisible, setVisible
-
-
-
-
Constructor Detail
-
Grid
public Grid(org.mapsforge.core.graphics.GraphicFactory graphicFactory, DisplayModel displayModel, java.util.Map<java.lang.Byte,java.lang.Double> spacingConfig)Ctor.- Parameters:
graphicFactory- the graphic factory.displayModel- the display model of the map view.spacingConfig- a map containing the spacing for every zoom level.
-
Grid
public Grid(DisplayModel displayModel, java.util.Map<java.lang.Byte,java.lang.Double> spacingConfig, org.mapsforge.core.graphics.Paint lineBack, org.mapsforge.core.graphics.Paint lineFront, org.mapsforge.core.graphics.Paint textBack, org.mapsforge.core.graphics.Paint textFront)
Ctor.- Parameters:
displayModel- the display model of the map view.spacingConfig- a map containing the spacing for every zoom level.lineBack- the back line paint.lineFront- the top line paint.textBack- the back text paint.textFront- the top text paint.
-
-
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.
-
-