Class LineDataSource


  • public final class LineDataSource
    extends NativeBase

    Polyline data source allows the rendering engine access to the user provided polylines geometry and their attributes.

    Polyline segments are rendered following the shortest path between their end vertices.

    Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  LineDataSource.LineDataProcessor
      Called for each line, allowing inspection, removal or update of coordinates and attributes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(LineData line)
      Adds a new line to the data source.
      void add​(java.util.List<LineData> lines)
      Adds new lines to the data source.
      void destroy()
      Frees all internally used resources.
      void forEach​(LineDataSource.LineDataProcessor processor)
      Iterates through all the lines from the data source and passes them to the given processor, one by one.
      void removeAll()
      Removes all lines from the data source.
      void removeIf​(LineDataSource.LineDataProcessor inspector)
      Iterates through all the lines from the data source and passes them to the given inspector, one by one.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • add

        public void add​(@NonNull
                        LineData line)

        Adds a new line to the data source.

        Parameters:
        line -

        Line to add.

      • add

        public void add​(@NonNull
                        java.util.List<LineData> lines)

        Adds new lines to the data source.

        Parameters:
        lines -

        Lines to add.

      • removeAll

        public void removeAll()

        Removes all lines from the data source.

      • forEach

        public void forEach​(@NonNull
                            LineDataSource.LineDataProcessor processor)

        Iterates through all the lines from the data source and passes them to the given processor, one by one. The processor can update the line data. The iteration stops after all lines have been processed or the processor returns false from the process call.

        Parameters:
        processor -

        Line processor.

      • removeIf

        public void removeIf​(@NonNull
                             LineDataSource.LineDataProcessor inspector)

        Iterates through all the lines from the data source and passes them to the given inspector, one by one. All lines for which the inspector returns true get removed from the data source. The inspector cannot update the line data.

        Parameters:
        inspector -

        Line data processor.

      • destroy

        public void destroy()

        Frees all internally used resources. After calling this method, the object is not usable anymore.