Class SimpleLineSymbol

All Implemented Interfaces:
JsonSerializable

public final class SimpleLineSymbol extends LineSymbol
Uses predefined patterns and colors to symbolize graphics and features that have polyline geometry.

Simple line symbols display graphics using predefined line style patterns such as SimpleLineSymbol.Style.SOLID, SimpleLineSymbol.Style.DASH, or SimpleLineSymbol.Style.DOT.

Example of creating a SimpleLineSymbol:

 // create points for the line
 PointCollection points = new PointCollection(SpatialReferences.getWebMercator());
 points.add(-226913, 6550477);
 points.add(-226643, 6550477);
 Polyline line = new Polyline(points);

 // creates a solid red simple line symbol
 SimpleLineSymbol lineSymbol = new SimpleLineSymbol(Style.SOLID, 0xFFFF0000, 3);

 // add line with symbol to graphics overlay and add overlay to map view
 GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
 mapView.getGraphicsOverlays().add(graphicsOverlay);
 graphicsOverlay.getGraphics().add(new Graphic(line, lineSymbol));
 
A SimpleLineSymbol can be displayed using a Graphic and setting it to a GraphicsOverlay or setting symbol as a Renderer.
 GraphicsOverlay.getGraphics().add(new Graphic(Geometry, SimpleLineSymbol));
 
OR
 GraphicsOverlay.setRender(new SimpleRenderer(SimpleLineSymbol));
 
Since:
100.0.0
See Also:
  • Constructor Details

    • SimpleLineSymbol

      public SimpleLineSymbol()
      Creates a simple line symbol object with default values.

      The default values are:

      This is useful if the properties of the symbol are only known after the application is running.
      Since:
      100.0.0
    • SimpleLineSymbol

      @Deprecated(since="200.0.0", forRemoval=true) public SimpleLineSymbol(SimpleLineSymbol.Style style, int color, float width)
      Deprecated, for removal: This API element is subject to removal in a future version.
      as of 200.0.0, replaced by SimpleLineSymbol(Style, Color, float)
      Creates a new SimpleLineSymbol with the given properties:
      • Style, pattern that makes up the area of the symbol
      • Color, interior color of the symbol
      • Width, thickness of the symbol in density-independent pixels (dp)

      If the width of the symbol is 0 or less then the symbol will not be displayed.

      Parameters:
      style - the style of the Symbol, not null
      color - an integer representing the line color as 0xAARRGGBB
      width - the width of the Symbol in dp
      Throws:
      IllegalArgumentException - if style is null
      Since:
      100.0.0
    • SimpleLineSymbol

      public SimpleLineSymbol(SimpleLineSymbol.Style style, Color color, float width)
      Creates a simple line symbol object with a style, color and width.

      If the width of the symbol is 0 or less, then the symbol will not be displayed.

      Parameters:
      style - the type of simple line symbol to create
      color - the line color
      width - the width of the Symbol in dp
      Throws:
      IllegalArgumentException - if color is null
      IllegalArgumentException - if style is null
      Since:
      200.0.0
    • SimpleLineSymbol

      @Deprecated(since="200.0.0", forRemoval=true) public SimpleLineSymbol(SimpleLineSymbol.Style style, int color, float width, SimpleLineSymbol.MarkerStyle markerStyle, SimpleLineSymbol.MarkerPlacement markerPlacement)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new SimpleLineSymbol with the given properties:
      • Style, pattern that makes up the area of the symbol
      • Color, interior color of the symbol
      • Width, thickness of the symbol in density-independent pixels (dp)
      • MarkerStyle, style of markers at the ends of the symbol
      • MarkerPlacement, placement of markers at the ends of the symbol

      If the width of the symbol is 0 or less then the symbol will not be displayed.

      Parameters:
      style - the style of the Symbol, not null
      color - an integer representing the line color as 0xAARRGGBB
      width - the width of the Symbol in dp
      markerStyle - the marker style
      markerPlacement - the marker placement
      Throws:
      IllegalArgumentException - if style, markerStyle, or markerPlacement are null
      Since:
      100.2.0
    • SimpleLineSymbol

      public SimpleLineSymbol(SimpleLineSymbol.Style style, Color color, float width, SimpleLineSymbol.MarkerStyle markerStyle, SimpleLineSymbol.MarkerPlacement markerPlacement)
      Creates a simple line symbol object with a style, color, width, and line end marker.

      If the width of the symbol is 0 or less then the symbol will not be displayed.

      Parameters:
      style - the type of simple line symbol to create
      color - the line color
      width - the width of the Symbol in dp
      markerStyle - the marker style
      markerPlacement - the marker placement
      Throws:
      IllegalArgumentException - if color is null
      IllegalArgumentException - if style, markerStyle, or markerPlacement are null
      Since:
      200.0.0
  • Method Details