Class MapElement


public class MapElement extends GeometryBuffer
The MapElement class is a reusable container for a geometry with tags.

MapElement is created by TileDataSource(s) and passed to MapTileLoader via ITileDataSink.process(). This is just a buffer that belongs to TileDataSource, so don't keep a reference to it when passed as parameter or make sure to use a copy.

  • Field Details

    • centroidPosition

      public PointF centroidPosition
    • labelPosition

      public PointF labelPosition
    • layer

      public int layer
      layer of the element (0-10) overrides the theme drawing order.
    • level

      public int level
    • tags

      public final TagSet tags
  • Constructor Details

    • MapElement

      public MapElement()
    • MapElement

      public MapElement(int numPoints, int numIndices)
    • MapElement

      public MapElement(float[] points, int[] index)
    • MapElement

      public MapElement(MapElement element)
      Parameters:
      element - the map element to copy
  • Method Details

    • getHeight

      public Float getHeight(IRenderTheme theme)
      Returns:
      height in meters, if present
    • getMinHeight

      public Float getMinHeight(IRenderTheme theme)
      Returns:
      minimum height in meters, if present
    • isBuilding

      public boolean isBuilding()
      Returns:
      true if this is a building, else false.
    • isBuildingPart

      public boolean isBuildingPart()
      Returns:
      true if this is a building part, else false.
    • setCentroidPosition

      public void setCentroidPosition(float x, float y)
    • setLabelPosition

      public void setLabelPosition(float x, float y)
    • setLayer

      public void setLayer(int layer)
      Set the layer of the element (0-10) to override theme drawing order.
    • clear

      public MapElement clear()
      Description copied from class: GeometryBuffer
      Reset buffer.
      Overrides:
      clear in class GeometryBuffer
    • scale

      public MapElement scale(float scaleX, float scaleY)
      Description copied from class: GeometryBuffer
      Scale.
      Overrides:
      scale in class GeometryBuffer
      Parameters:
      scaleX - the x scale.
      scaleY - the y scale.
      Returns:
      a reference to this object.
    • translate

      public MapElement translate(float dx, float dy)
      Description copied from class: GeometryBuffer
      Translate.
      Overrides:
      translate in class GeometryBuffer
      Parameters:
      dx - the x translation.
      dy - the y translation.
      Returns:
      a reference to this object.
    • toString

      public String toString()
      Overrides:
      toString in class GeometryBuffer