Class VectorLayer

java.lang.Object
org.oscim.layers.Layer
org.oscim.layers.vector.AbstractVectorLayer<Drawable>
org.oscim.layers.vector.VectorLayer
All Implemented Interfaces:
org.oscim.event.EventListener, org.oscim.event.GestureListener, org.oscim.map.Map.UpdateListener
Direct Known Subclasses:
PathLayer

public class VectorLayer extends org.oscim.layers.vector.AbstractVectorLayer<Drawable> implements org.oscim.event.GestureListener
Use this layer to draw predefined geometries from layers.vector.geometries package and JTS geometries together with a GeometryStyle
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.oscim.layers.vector.AbstractVectorLayer

    org.oscim.layers.vector.AbstractVectorLayer.Renderer, org.oscim.layers.vector.AbstractVectorLayer.Task, org.oscim.layers.vector.AbstractVectorLayer.Worker

    Nested classes/interfaces inherited from class org.oscim.layers.Layer

    org.oscim.layers.Layer.EnableHandler
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
     
    protected final JtsConverter
     
    protected final org.oscim.utils.SpatialIndex<Drawable>
     
    protected org.locationtech.jts.geom.Polygon
     
    protected double
     
    protected double
     
    protected final List<Drawable>
     

    Fields inherited from class org.oscim.layers.vector.AbstractVectorLayer

    mClipper, mGeom, mUpdate, mUpdateDelay, mWorker, UNSCALE_COORD

    Fields inherited from class org.oscim.layers.Layer

    mMap, mRenderer
  • Constructor Summary

    Constructors
    Constructor
    Description
    VectorLayer(org.oscim.map.Map map)
     
    VectorLayer(org.oscim.map.Map map, org.oscim.utils.SpatialIndex<Drawable> index)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Drawable drawable)
    Adds a drawable to a list of geometries that have to be drawn in the next map update.
    protected void
    addCircle(org.oscim.core.GeometryBuffer g, org.oscim.core.MapPosition pos, double px, double py, Style style)
     
    boolean
    contains(float x, float y)
     
    protected void
    draw(org.oscim.layers.vector.AbstractVectorLayer.Task task, int level, Drawable d, Style style)
     
    protected void
    drawLine(org.oscim.layers.vector.AbstractVectorLayer.Task t, int level, org.locationtech.jts.geom.Geometry line, Style style)
     
    protected void
    drawPoint(org.oscim.layers.vector.AbstractVectorLayer.Task t, int level, org.locationtech.jts.geom.Geometry points, Style style)
     
    protected void
    drawPolygon(org.oscim.layers.vector.AbstractVectorLayer.Task t, int level, org.locationtech.jts.geom.Geometry polygon, Style style)
     
    boolean
    onGesture(org.oscim.event.Gesture g, org.oscim.event.MotionEvent e)
     
    protected void
    processFeatures(org.oscim.layers.vector.AbstractVectorLayer.Task t, org.oscim.core.Box bbox)
     
    void
    remove(org.locationtech.jts.geom.Geometry geometry)
    removes the JTS geometry and its style from the list of drawn geometries.
    void
    remove(Drawable drawable)
    Removes the drawable from the list of drawn geometries.

    Methods inherited from class org.oscim.layers.vector.AbstractVectorLayer

    onDetach, onMapEvent, update

    Methods inherited from class org.oscim.layers.Layer

    getRenderer, isEnabled, map, setEnabled, setEnableHandler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      public static final org.slf4j.Logger log
    • mDrawables

      protected final org.oscim.utils.SpatialIndex<Drawable> mDrawables
    • tmpDrawables

      protected final List<Drawable> tmpDrawables
    • mConverter

      protected final JtsConverter mConverter
    • mMinX

      protected double mMinX
    • mMinY

      protected double mMinY
    • mEnvelope

      protected org.locationtech.jts.geom.Polygon mEnvelope
  • Constructor Details

    • VectorLayer

      public VectorLayer(org.oscim.map.Map map, org.oscim.utils.SpatialIndex<Drawable> index)
    • VectorLayer

      public VectorLayer(org.oscim.map.Map map)
  • Method Details

    • add

      public void add(Drawable drawable)
      Adds a drawable to a list of geometries that have to be drawn in the next map update.
      Parameters:
      drawable -
    • remove

      public void remove(Drawable drawable)
      Removes the drawable from the list of drawn geometries.
      Parameters:
      drawable -
    • remove

      public void remove(org.locationtech.jts.geom.Geometry geometry)
      removes the JTS geometry and its style from the list of drawn geometries.
      Parameters:
      geometry -
    • processFeatures

      protected void processFeatures(org.oscim.layers.vector.AbstractVectorLayer.Task t, org.oscim.core.Box bbox)
      Specified by:
      processFeatures in class org.oscim.layers.vector.AbstractVectorLayer<Drawable>
    • draw

      protected void draw(org.oscim.layers.vector.AbstractVectorLayer.Task task, int level, Drawable d, Style style)
    • drawPoint

      protected void drawPoint(org.oscim.layers.vector.AbstractVectorLayer.Task t, int level, org.locationtech.jts.geom.Geometry points, Style style)
    • drawLine

      protected void drawLine(org.oscim.layers.vector.AbstractVectorLayer.Task t, int level, org.locationtech.jts.geom.Geometry line, Style style)
    • drawPolygon

      protected void drawPolygon(org.oscim.layers.vector.AbstractVectorLayer.Task t, int level, org.locationtech.jts.geom.Geometry polygon, Style style)
    • addCircle

      protected void addCircle(org.oscim.core.GeometryBuffer g, org.oscim.core.MapPosition pos, double px, double py, Style style)
    • contains

      public boolean contains(float x, float y)
    • onGesture

      public boolean onGesture(org.oscim.event.Gesture g, org.oscim.event.MotionEvent e)
      Specified by:
      onGesture in interface org.oscim.event.GestureListener