Class MarkerSymbolLayer

  • Direct Known Subclasses:
    PictureMarkerSymbolLayer, VectorMarkerSymbolLayer

    public abstract class MarkerSymbolLayer
    extends SymbolLayer
    A base class for marker symbol layer, representing a symobl layer used to display a marker. MarkerSymbolLayer draws a shape or picture at a specific location relative to point geometry. A marker symbol layer is most often used in point symbols, but they can also be included in polyline and polygon symbols to draw a symbol at locations along lines and outlines, or within areas (the center of a polygon, for example).

    ArcGIS Runtime includes the following types of marker symbol layers:

    This symbol layer controls many common operations vital for working with markers. Anchors, angles, offsets, and size properties are controlled on MarkerSymbolLayer.

    The MarkerSymbolLayer has methods affecting both 2D and 3D markers. Some properties apply only to 3D markers, such as angleX, or offsetZ. These properties have no effect on markers in 2D. Properties on 2D markers, such as offsetX, affect the marker's position in screen space, not world space. This means that the x-axis for a 2D marker runs from negative-x on the West edge of the screen to positive-x on the East edge of the screen. Negative-y to positive-y runs from the South edge of the screen to the North edge of the screen.

    Properties that apply only to 3D markers affect the marker's position in world space, rather than screen space. This means that the x, y, and z-axes to which the class methods are the axes of the world, with the following layout: from negative to positive, the x-axis spans from world West to world East, the y-axis from world South to world North, and the z-axis from directly into the surface to the sky.

    While a simple TextSymbol can be used to display a character as a marker, proper display is dependent on the referenced font being available on the machine or device running the app. If the exact font is not found, which is likely to occur on many mobile devices, a fallback mechanism is used to find the best available font to use. A character marker symbol authored from ArcGIS Pro, however, is represented by a VectorMarkerSymbolElement. This symbol stores the geometry that represents the character, is not dependent on the font to render the shape of the marker, and displays as expected on all devices.

    Since:
    100.5.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      SymbolAnchor getAnchor()
      Gets the anchor for this MarkerSymbolLayer.
      double getHeading()
      Gets the marker symbol layer's heading: the angle of rotation about the anchor point.
      double getOffsetX()
      Gets the X component of the offset.
      double getOffsetY()
      Gets the Y component of the offset.
      double getSize()
      Gets the size of this MarkerSymbolLayer.
      void setAnchor​(SymbolAnchor symbolAnchor)
      Sets the anchor for this MarkerSymbolLayer.
      void setHeading​(double heading)
      Sets the marker symbol layer's heading: the angle of rotation about the anchor point.
      void setOffsetX​(double offsetX)
      Sets the X component of the offset.
      void setOffsetY​(double offsetY)
      Sets the Y component of the offset.
      void setSize​(double size)
      Sets the size of this MarkerSymbolLayer.
      • Methods inherited from class java.lang.Object

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

      • getHeading

        public double getHeading()
        Gets the marker symbol layer's heading: the angle of rotation about the anchor point.

        The value can be any real number. The default value is 0. This property affects markers in both maps and scenes. Positive angles rotate the marker counterclockwise.

        Angle for MarkerSymbolLayer is measured in degrees counterclockwise from 0 to 360. Marker symbol layers can have a separate heading value defined (which is also 0 by default). Setting a heading for a marker symbol layer does not affect the angle of the point symbol. When an angle value is set for the point symbol, however, that value is applied cumulatively to all the marker symbol layers it contains. The heading for individual symbol layers must be re-fetched in order to see the updated value. In 2D, the rotation applies around the anchor point of the 2D marker. For 3D markers, the rotation applies around the z-axis.

        Returns:
        the heading in degrees
        Since:
        100.5.0
        See Also:
        setHeading(double)
      • setHeading

        public void setHeading​(double heading)
        Sets the marker symbol layer's heading: the angle of rotation about the anchor point.

        The value can be any real number. The default value is 0. This property affects markers in both maps and scenes. Positive angles rotate the marker counterclockwise.

        Angle for MarkerSymbolLayer is measured in degrees counterclockwise from 0 to 360. Marker symbol layers can have a separate heading value defined (which is also 0 by default). Setting a heading for a marker symbol layer does not affect the angle of the point symbol. When an angle value is set for the point symbol, however, that value is applied cumulatively to all the marker symbol layers it contains. The heading for individual symbol layers must be re-fetched in order to see the updated value. In 2D, the rotation applies around the anchor point of the 2D marker. For 3D markers, the rotation applies around the z-axis.

        Parameters:
        heading - the heading in degrees
        Since:
        100.5.0
        See Also:
        getHeading()
      • getOffsetX

        public double getOffsetX()
        Gets the X component of the offset. The x-offset is a delta applied to the marker in the direction corresponding to the given value. For example, a positive x-offset moves the marker in the positive-x direction. The default value is 0.
        Returns:
        the X component of the offset in density-independent pixels (dp)
        Since:
        100.5.0
      • setOffsetX

        public void setOffsetX​(double offsetX)
        Sets the X component of the offset. The x-offset is a delta applied to the marker in the direction corresponding to the given value. For example, a positive x-offset moves the marker in the positive-x direction. The value can be any real number.
        Parameters:
        offsetX - the X component of the offset in density-independent pixels (dp)
        Since:
        100.5.0
      • getOffsetY

        public double getOffsetY()
        Gets the Y component of the offset. The y-offset is a delta applied to the marker in the direction corresponding to the given value. For example, a positive y-offset moves the marker in the positive-y direction. The default value is 0.
        Returns:
        the Y component of the offset in density-independent pixels (dp)
        Since:
        100.5.0
      • setOffsetY

        public void setOffsetY​(double offsetY)
        Sets the Y component of the offset. The y-offset is a delta applied to the marker in the direction corresponding to the given value. For example, a positive y-offset moves the marker in the positive-y direction. The input value can be any real number.
        Parameters:
        offsetY - the Y component of the offset in density-independent pixels (dp)
        Since:
        100.5.0
      • getSize

        public double getSize()
        Gets the size of this MarkerSymbolLayer. The default value is 13.333 density-independent pixels (dp).
        Returns:
        the size in dp
        Since:
        100.5.0
        See Also:
        setSize(double)
      • setSize

        public void setSize​(double size)
        Sets the size of this MarkerSymbolLayer. The input value can be any positive number. A larger size means a larger marker.

        When getting the size from a multilayer point symbol, the value reported is the largest size of all the symbol layers it contains. The symbol size is updated when its symbol layer sizes change (if there is a new largest layer size). When setting a new size at the point symbol level, the size of the largest symbol layer is given the provided value, and all the smaller layers are sized proportionately. An individual symbol layer can be given a specific size without affecting the other layers.

        Parameters:
        size - the size in density-independent pixels (dp)
        Throws:
        ArcGISRuntimeException - if size is negative or zero
        Since:
        100.5.0
      • getAnchor

        public SymbolAnchor getAnchor()
        Gets the anchor for this MarkerSymbolLayer. The SymbolAnchor determines how ArcGIS Runtime anchors the MarkerSymbolLayer. SymbolAnchor specifies the marker's anchor point and SymbolAnchor.PlacementMode. The default symbol anchor is at xyz(0,0,0) and uses relative mode.

        The symbol anchor is immutable. To modify the anchor, create a new instance with the desired values and set it with setAnchor(SymbolAnchor). In the event that the symbol layer is modified and the anchor values change internally, this method will need to be called to retrieve a new instance containing the new anchor values, they are not updated automatically.

        Returns:
        the symbol anchor
        Since:
        100.5.0
        See Also:
        SymbolAnchor
      • setAnchor

        public void setAnchor​(SymbolAnchor symbolAnchor)
        Sets the anchor for this MarkerSymbolLayer. The SymbolAnchor determines how Runtime anchors the MarkerSymbolLayer. SymbolAnchor specifies the marker's anchor point and SymbolAnchor.PlacementMode. The default symbol anchor is at XYZ(0,0,0) and uses relative mode.

        The symbol anchor is immutable. To modify the anchor, create a new instance with the desired values and set it with setAnchor(SymbolAnchor). In the event that the symbol layer is modified and the anchor values change internally, this method will need to be called to retrieve a new instance containing the new anchor values. They are not updated automatically.

        Parameters:
        symbolAnchor - the symbol anchor, cannot be null
        Throws:
        java.lang.IllegalArgumentException - if symbolAnchor is null
        Since:
        100.5.0
        See Also:
        getAnchor()