Package org.mapsforge.map.layer.renderer
Class StandardRenderer
- java.lang.Object
-
- org.mapsforge.map.layer.renderer.StandardRenderer
-
- All Implemented Interfaces:
RenderCallback
- Direct Known Subclasses:
DatabaseRenderer
,DirectRenderer
public class StandardRenderer extends java.lang.Object implements RenderCallback
The DatabaseRenderer renders map tiles by reading from aMapDataStore
.
-
-
Field Summary
Fields Modifier and Type Field Description org.mapsforge.core.graphics.GraphicFactory
graphicFactory
HillsRenderConfig
hillsRenderConfig
MapDataStore
mapDataStore
-
Constructor Summary
Constructors Constructor Description StandardRenderer(MapDataStore mapDataStore, org.mapsforge.core.graphics.GraphicFactory graphicFactory, boolean renderLabels)
Constructs a new StandardRenderer (without hillshading).StandardRenderer(MapDataStore mapDataStore, org.mapsforge.core.graphics.GraphicFactory graphicFactory, boolean renderLabels, HillsRenderConfig hillsRenderConfig)
Constructs a new StandardRenderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.mapsforge.core.model.LatLong
getStartPosition()
java.lang.Byte
getStartZoomLevel()
byte
getZoomLevelMax()
protected void
processReadMapData(RenderContext renderContext, MapReadResult mapReadResult)
void
renderArea(RenderContext renderContext, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, int level, PolylineContainer way)
Renders an area with the given parameters.void
renderAreaCaption(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, java.lang.String caption, float horizontalOffset, float verticalOffset, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, org.mapsforge.core.graphics.Position position, int maxTextWidth, PolylineContainer way)
Renders an area caption with the given text.void
renderAreaSymbol(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, org.mapsforge.core.graphics.Bitmap symbol, PolylineContainer way)
Renders an area symbol with the given bitmap.protected void
renderPointOfInterest(RenderContext renderContext, PointOfInterest pointOfInterest)
void
renderPointOfInterestCaption(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, java.lang.String caption, float horizontalOffset, float verticalOffset, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, org.mapsforge.core.graphics.Position position, int maxTextWidth, PointOfInterest poi)
Renders a point of interest caption with the given text.void
renderPointOfInterestCircle(RenderContext renderContext, float radius, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, int level, PointOfInterest poi)
Renders a point of interest circle with the given parameters.void
renderPointOfInterestSymbol(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, org.mapsforge.core.model.Rectangle boundary, org.mapsforge.core.graphics.Bitmap symbol, PointOfInterest poi)
Renders a point of interest symbol with the given bitmap.protected void
renderWaterBackground(RenderContext renderContext)
void
renderWay(RenderContext renderContext, org.mapsforge.core.graphics.Paint stroke, float dy, int level, PolylineContainer way)
Renders a way with the given parameters.protected void
renderWay(RenderContext renderContext, PolylineContainer way)
void
renderWaySymbol(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, org.mapsforge.core.graphics.Bitmap symbol, float dy, org.mapsforge.core.model.Rectangle boundary, boolean repeat, float repeatGap, float repeatStart, boolean rotate, PolylineContainer way)
Renders a way with the given symbol along the way path.void
renderWayText(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, java.lang.String textKey, float dy, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, boolean repeat, float repeatGap, float repeatStart, boolean rotate, PolylineContainer way)
Renders a way with the given text along the way path.
-
-
-
Field Detail
-
graphicFactory
public final org.mapsforge.core.graphics.GraphicFactory graphicFactory
-
hillsRenderConfig
public final HillsRenderConfig hillsRenderConfig
-
mapDataStore
public final MapDataStore mapDataStore
-
-
Constructor Detail
-
StandardRenderer
public StandardRenderer(MapDataStore mapDataStore, org.mapsforge.core.graphics.GraphicFactory graphicFactory, boolean renderLabels)
Constructs a new StandardRenderer (without hillshading).- Parameters:
mapDataStore
- the MapDataStore from which the map data will be read.
-
StandardRenderer
public StandardRenderer(MapDataStore mapDataStore, org.mapsforge.core.graphics.GraphicFactory graphicFactory, boolean renderLabels, HillsRenderConfig hillsRenderConfig)
Constructs a new StandardRenderer.- Parameters:
mapDataStore
- the MapDataStore from which the map data will be read.hillsRenderConfig
- optional relief shading support.
-
-
Method Detail
-
getStartPosition
public org.mapsforge.core.model.LatLong getStartPosition()
- Returns:
- the start point (may be null).
-
getStartZoomLevel
public java.lang.Byte getStartZoomLevel()
- Returns:
- the start zoom level (may be null).
-
getZoomLevelMax
public byte getZoomLevelMax()
- Returns:
- the maximum zoom level.
-
renderArea
public void renderArea(RenderContext renderContext, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, int level, PolylineContainer way)
Description copied from interface:RenderCallback
Renders an area with the given parameters.- Specified by:
renderArea
in interfaceRenderCallback
fill
- the paint to be used for rendering the area.stroke
- an optional paint for the area casing (may be null).
-
renderAreaCaption
public void renderAreaCaption(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, java.lang.String caption, float horizontalOffset, float verticalOffset, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, org.mapsforge.core.graphics.Position position, int maxTextWidth, PolylineContainer way)
Description copied from interface:RenderCallback
Renders an area caption with the given text.- Specified by:
renderAreaCaption
in interfaceRenderCallback
display
- display modepriority
- priority levelcaption
- the text.horizontalOffset
- the horizontal offset of the text.verticalOffset
- the vertical offset of the text.fill
- the paint for the text.stroke
- the casing of the text (may be null).position
- optional position (may be null)maxTextWidth
- maximum text width .way
- the way for the caption.
-
renderAreaSymbol
public void renderAreaSymbol(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, org.mapsforge.core.graphics.Bitmap symbol, PolylineContainer way)
Description copied from interface:RenderCallback
Renders an area symbol with the given bitmap.- Specified by:
renderAreaSymbol
in interfaceRenderCallback
-
renderPointOfInterestCaption
public void renderPointOfInterestCaption(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, java.lang.String caption, float horizontalOffset, float verticalOffset, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, org.mapsforge.core.graphics.Position position, int maxTextWidth, PointOfInterest poi)
Description copied from interface:RenderCallback
Renders a point of interest caption with the given text.- Specified by:
renderPointOfInterestCaption
in interfaceRenderCallback
caption
- the text to be rendered.horizontalOffset
- the horizontal offset of the caption.verticalOffset
- the vertical offset of the caption.fill
- the paint to be used for rendering the text.stroke
- an optional paint for the text casing (may be null).
-
renderPointOfInterestCircle
public void renderPointOfInterestCircle(RenderContext renderContext, float radius, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, int level, PointOfInterest poi)
Description copied from interface:RenderCallback
Renders a point of interest circle with the given parameters.- Specified by:
renderPointOfInterestCircle
in interfaceRenderCallback
radius
- the radius of the circle.fill
- the paint to be used for rendering the circle.stroke
- an optional paint for the circle casing (may be null).
-
renderPointOfInterestSymbol
public void renderPointOfInterestSymbol(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, org.mapsforge.core.model.Rectangle boundary, org.mapsforge.core.graphics.Bitmap symbol, PointOfInterest poi)
Description copied from interface:RenderCallback
Renders a point of interest symbol with the given bitmap.- Specified by:
renderPointOfInterestSymbol
in interfaceRenderCallback
-
renderWay
public void renderWay(RenderContext renderContext, org.mapsforge.core.graphics.Paint stroke, float dy, int level, PolylineContainer way)
Description copied from interface:RenderCallback
Renders a way with the given parameters.- Specified by:
renderWay
in interfaceRenderCallback
stroke
- the paint to be used for rendering the way.dy
- the offset of the way.
-
renderWaySymbol
public void renderWaySymbol(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, org.mapsforge.core.graphics.Bitmap symbol, float dy, org.mapsforge.core.model.Rectangle boundary, boolean repeat, float repeatGap, float repeatStart, boolean rotate, PolylineContainer way)
Description copied from interface:RenderCallback
Renders a way with the given symbol along the way path.- Specified by:
renderWaySymbol
in interfaceRenderCallback
symbol
- the symbol to be rendered.dy
- the offset of the way.boundary
- the relative positioning of the symbolrepeat
- true if the symbol should be repeated, false otherwise.repeatGap
- distance between repetitions.
-
renderWayText
public void renderWayText(RenderContext renderContext, org.mapsforge.core.graphics.Display display, int priority, java.lang.String textKey, float dy, org.mapsforge.core.graphics.Paint fill, org.mapsforge.core.graphics.Paint stroke, boolean repeat, float repeatGap, float repeatStart, boolean rotate, PolylineContainer way)
Description copied from interface:RenderCallback
Renders a way with the given text along the way path.- Specified by:
renderWayText
in interfaceRenderCallback
textKey
- the text to be rendered.dy
- the offset of the way text.fill
- the paint to be used for rendering the text.
-
renderPointOfInterest
protected void renderPointOfInterest(RenderContext renderContext, PointOfInterest pointOfInterest)
-
renderWaterBackground
protected void renderWaterBackground(RenderContext renderContext)
-
renderWay
protected void renderWay(RenderContext renderContext, PolylineContainer way)
-
processReadMapData
protected void processReadMapData(RenderContext renderContext, MapReadResult mapReadResult)
-
-