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

public abstract class Path extends InteractiveLayer implements HasStyle, PathFunctions
An abstract class that contains options and constants shared between vector overlays (Polygon, Polyline, Circle). Do not use it directly. Extends InteractiveLayer
See Also:
  • Constructor Details

    • Path

      public Path()
  • Method Details

    • isStroke

      public boolean isStroke()
      Whether to draw stroke along the path.
      Returns:
      true if the stroke is drawn along the path
    • setStroke

      public void setStroke(boolean stroke)
      Whether to draw stroke along the path. Set it to false to disable borders on polygons or circles.
      Parameters:
      stroke - Set it to false to disable borders on polygons or circles.
    • getColor

      public String getColor()
      Gets the stroke color.
      Returns:
      the color of the stroke
    • setColor

      public void setColor(String color)
      Stroke color
      Parameters:
      color - the color of the stroke
    • getWeight

      public double getWeight()
      Gets the stroke width in pixels.
      Returns:
      the weight of the path
    • setWeight

      public void setWeight(double weight)
      Stroke width in pixels
      Parameters:
      weight - the weight of the path
    • getOpacity

      public double getOpacity()
      Gets the stroke opacity.
      Returns:
      the opacity of the path
    • setOpacity

      public void setOpacity(double opacity)
      Stroke opacity
      Parameters:
      opacity - the opacity of the path
    • getLineCap

      public String getLineCap()
      Gets the shape to be used at the end of the stroke.
      Returns:
      the shape used at the end of the stroke
    • setLineCap

      public void setLineCap(String lineCap)
      A string that defines shape to be used at the end of the stroke.
      Parameters:
      lineCap - shape to be used at the end of the stroke
    • getLineJoin

      public String getLineJoin()
      Gets the shape to be used at the corners of the stroke.
      Returns:
      the shape used at the corners of the stroke
    • setLineJoin

      public void setLineJoin(String lineJoin)
      A string that defines shape to be used at the corners of the stroke.
      Parameters:
      lineJoin - shape to be used at the corners of the stroke
    • getDashArray

      public String getDashArray()
      Gets the stroke dash pattern.
      Returns:
      the string that defines the stroke dash pattern
    • setDashArray

      public void setDashArray(String dashArray)
      A string that defines the stroke dash pattern. Doesn't work on Canvas-powered layers in some old browsers.
      Parameters:
      dashArray - efines the stroke dash pattern
    • getDashOffset

      public String getDashOffset()
      Gets the distance into the dash pattern to start the dash.
      Returns:
      the string that defines the distance into the dash pattern to start the dash
    • setDashOffset

      public void setDashOffset(String dashOffset)
      A string that defines the distance into the dash pattern to start the dash. Doesn't work on Canvas-powered layers in some old browsers.
      Parameters:
      dashOffset - defines the distance into the dash pattern to start the dash
    • isFill

      public boolean isFill()
      Whether to fill the path with color.
      Returns:
      true if the path is filled with color
    • setFill

      public void setFill(boolean fill)
      Whether to fill the path with color. Set it to false to disable filling on polygons or circles.
      Parameters:
      fill - Set it to false to disable filling on polygons or circles
    • getFillColor

      public String getFillColor()
      Gets the fill color.
      Returns:
      the fill color of the path
    • setFillColor

      public void setFillColor(String fillColor)
      Fill color. Defaults to the value of the color option
      Parameters:
      fillColor - the fill color of the path
    • getFillOpacity

      public double getFillOpacity()
      Gets the fill opacity.
      Returns:
      the fill opacity (0 between 1)
    • setFillOpacity

      public void setFillOpacity(double fillOpacity)
      Fill opacity.
      Parameters:
      fillOpacity - the fill opacity (0 between 1)
    • getFillRule

      public String getFillRule()
      Gets how the inside of a shape is determined.
      Returns:
      the string that defines how the inside of a shape is determined
    • setFillRule

      public void setFillRule(String fillRule)
      A string that defines how the inside of a shape is determined.
      Parameters:
      fillRule - the string that defines how the inside of a shape is determined
    • getClassName

      public String getClassName()
      Gets the custom class name set on the element.
      Returns:
      the class name set on an element
    • setClassName

      public void setClassName(String className)
      Custom class name set on an element. Only for SVG renderer.
      Parameters:
      className - the class name set on an element
    • getStyle

      public PathOptions getStyle()
      Returns the current path style options applied to this layer.
      Specified by:
      getStyle in interface HasStyle
      Returns:
      the current style options
    • setStyle

      public void setStyle(PathOptions pathOptions)
      Changes the appearance of this layer by applying the given path style options.
      Specified by:
      setStyle in interface HasStyle
      Specified by:
      setStyle in interface PathFunctions
      Parameters:
      pathOptions - the style options to apply