Class PathLayer

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

public class PathLayer extends VectorLayer
This class draws a path line in given color or texture.
  • 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
    protected LineDrawable
     
    protected final ArrayList<org.oscim.core.GeoPoint>
     
    protected Style
     

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

    log, mConverter, mDrawables, mEnvelope, mMinX, mMinY, tmpDrawables

    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
    PathLayer(org.oscim.map.Map map, int lineColor)
     
    PathLayer(org.oscim.map.Map map, int lineColor, float lineWidth)
     
    PathLayer(org.oscim.map.Map map, Style style)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGreatCircle(org.oscim.core.GeoPoint startPoint, org.oscim.core.GeoPoint endPoint)
    Draw a great circle.
    void
    addGreatCircle(org.oscim.core.GeoPoint startPoint, org.oscim.core.GeoPoint endPoint, int numberOfPoints)
    Draw a great circle.
    void
    addPoint(int latitudeE6, int longitudeE6)
     
    void
    addPoint(org.oscim.core.GeoPoint pt)
     
    void
    addPoints(Collection<? extends org.oscim.core.GeoPoint> pts)
     
    void
     
    boolean
    contains(float x, float y)
     
    List<org.oscim.core.GeoPoint>
     
    void
    setLineString(double[] lonLat)
     
    void
    setLineString(org.locationtech.jts.geom.LineString path)
     
    void
    setPoints(Collection<? extends org.oscim.core.GeoPoint> pts)
     
    void
    setStyle(Style style)
     

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

    add, addCircle, draw, drawLine, drawPoint, drawPolygon, onGesture, processFeatures, remove, remove

    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

    • mPoints

      protected final ArrayList<org.oscim.core.GeoPoint> mPoints
    • mStyle

      protected Style mStyle
    • mDrawable

      protected LineDrawable mDrawable
  • Constructor Details

    • PathLayer

      public PathLayer(org.oscim.map.Map map, Style style)
    • PathLayer

      public PathLayer(org.oscim.map.Map map, int lineColor, float lineWidth)
    • PathLayer

      public PathLayer(org.oscim.map.Map map, int lineColor)
  • Method Details

    • setStyle

      public void setStyle(Style style)
    • clearPath

      public void clearPath()
    • setPoints

      public void setPoints(Collection<? extends org.oscim.core.GeoPoint> pts)
    • addPoint

      public void addPoint(org.oscim.core.GeoPoint pt)
    • addPoint

      public void addPoint(int latitudeE6, int longitudeE6)
    • addPoints

      public void addPoints(Collection<? extends org.oscim.core.GeoPoint> pts)
    • getPoints

      public List<org.oscim.core.GeoPoint> getPoints()
    • addGreatCircle

      public void addGreatCircle(org.oscim.core.GeoPoint startPoint, org.oscim.core.GeoPoint endPoint)
      Draw a great circle. Calculate a point for every 100km along the path.
      Parameters:
      startPoint - start point of the great circle
      endPoint - end point of the great circle
    • addGreatCircle

      public void addGreatCircle(org.oscim.core.GeoPoint startPoint, org.oscim.core.GeoPoint endPoint, int numberOfPoints)
      Draw a great circle.
      Parameters:
      startPoint - start point of the great circle
      endPoint - end point of the great circle
      numberOfPoints - number of points to calculate along the path
    • setLineString

      public void setLineString(org.locationtech.jts.geom.LineString path)
    • setLineString

      public void setLineString(double[] lonLat)
    • contains

      public boolean contains(float x, float y)
      Overrides:
      contains in class VectorLayer