Class SimpleRenderer

  • All Implemented Interfaces:
    JsonSerializable

    public final class SimpleRenderer
    extends Renderer
    A SimpleRenderer uses one Symbol and draws all Features/Graphics using that Symbol.

    Properties of a SimpleRenderer:

    • Symbol, the Symbol that is used to draw Features/Graphics to a GeoView.
    • Description, gives detail information about what this Renderer's does.
    • Label, name that this Renderer can be referred to.

    Example of creating a SimpleRender:

     // create a mapView
     ...
     // create a GraphicsOverlay and set it to the mapView
     GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
     mapView.getGraphicsOverlays().add(graphicsOverlay);
    
     SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.TRIANGLE, 0xffff0000, 5);
     SimpleRenderer simpleRenderer = new SimpleRenderer(symbol);
     graphicsOverlay.setRenderer(simpleRenderer);
    
     // the graphic's symbol should be that of the renderer that was assigned
     Point randomPoint = new Point(2000000, 2000000);
     Graphic graphic = new Graphic(randomPoint);
     graphicsOverlay.getGraphics().add(graphic);
     
    Since:
    100.0.0
    • Constructor Detail

      • SimpleRenderer

        public SimpleRenderer()
        Creates a new SimpleRenderer with given default properties:
        • Symbol, Color: Red, Size: 10, Style: Circle
        • Description, null
        • Label, null
        Since:
        100.0.0
      • SimpleRenderer

        public SimpleRenderer​(Symbol symbol)
        Creates a new SimpleRenderer with the given Symbol.

        Setting the Symbol to null will just apply a default red circle Symbol.

        Parameters:
        symbol - the Symbol for this Renderer, can be null
        Since:
        100.0.0
    • Method Detail

      • getSymbol

        public Symbol getSymbol()
        Gets the Symbol that is being used by this Renderer to draw Features/Graphics to the GeoView.

        Default value is a red circle Symbol.

        Returns:
        the Symbol being used by this Renderer
        Since:
        100.0.0
        See Also:
        setSymbol(com.esri.arcgisruntime.symbology.Symbol)
      • setSymbol

        public void setSymbol​(Symbol symbol)
        Sets the Symbol to be used by this Renderer to draw Features/Graphics to the GeoView.

        Setting the Symbol to null will just apply a default red circle Symbol.

        Parameters:
        symbol - the new Symbol used by this Renderer, can be null
        Since:
        100.0.0
      • getDescription

        public java.lang.String getDescription()
        Gets the description that describes what this Renderer's does.

        Default value an empty string.

        Returns:
        the description of this Renderer
        Since:
        100.0.0
      • setDescription

        public void setDescription​(java.lang.String description)
        Sets the description, which gives detail information about what this Renderer's does. An example could be describing the meaning behind the Symbol it uses.
        Parameters:
        description - the new description for this Renderer
      • getLabel

        public java.lang.String getLabel()
        Gets the name of this Renderer.

        Default value is an empty string.

        Returns:
        the label of this Renderer
        Since:
        100.0.0
      • setLabel

        public void setLabel​(java.lang.String label)
        Sets a name that this Renderer can be referred to.
        Parameters:
        label - the new label for this Renderer
        Since:
        100.0.0