All Implemented Interfaces:
Serializable, Evented, SupportsMouseEvents, HasStyle, Identifiable, LayerPopupFunctions, LayerTooltipFunctions, ExecutableFunctions, PathFunctions
Direct Known Subclasses:
MultiPolyline, Polygon

public class Polyline extends Path
A class for drawing polyline overlays on a map. Extends Path.
See Also:
  • Constructor Details

    • Polyline

      public Polyline(LatLng... latlngs)
      Instantiates a polyline from the given geographical points.
      Parameters:
      latlngs - the geographical points of the polyline
    • Polyline

      public Polyline(List<LatLng> latlngs)
      Instantiates a polyline from the given list of geographical points.
      Parameters:
      latlngs - the geographical points of the polyline
    • Polyline

      public Polyline(LatLngArray latlngs)
      Instantiates a polyline from the given array of geographical points.
      Parameters:
      latlngs - the geographical points of the polyline
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns true if the Polyline has no LatLngs.
      Returns:
      true if it has no coordinates
    • getBounds

      public LatLngBounds getBounds()
      Returns the LatLngBounds of the path.
      Returns:
      the bounds of the polyline
    • getSmoothFactor

      public double getSmoothFactor()
      Gets how much to simplify the polyline on each zoom level.
      Returns:
      how much to simplify the polyline on each zoom level
    • setSmoothFactor

      public void setSmoothFactor(double smoothFactor)
      How much to simplify the polyline on each zoom level. More means better performance and smoother look, and less means more accurate representation.
      Parameters:
      smoothFactor - how much to simplify the polyline on each zoom level
    • isNoClip

      public boolean isNoClip()
      Whether polyline clipping is disabled.
      Returns:
      true if polyline clipping is disabled
    • setNoClip

      public void setNoClip(boolean noClip)
      Disable polyline clipping.
      Parameters:
      noClip - set it to true to disable polyline clipping
    • getLatlngs

      public GeometryStructure getLatlngs()
      Gets the geographical points that make up this polyline.
      Returns:
      the coordinates of the polyline