Class Grid


  • public class Grid
    extends Layer
    The Grid layer draws a geographical grid.
    • 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.
    • 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: 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.