BackgroundGrid Class

  • BackgroundGrid
  • class Esri::ArcGISRuntime::BackgroundGrid

    Defines the default color and context grid for display behind a map or scene surface. More...

    Header: #include <BackgroundGrid.h>
    Since: Esri::ArcGISRuntime 100.0

    Public Functions

    BackgroundGrid()
    BackgroundGrid(const QColor &color, const QColor &gridLineColor, float gridLineWidth, float gridSize)
    BackgroundGrid(const Esri::ArcGISRuntime::BackgroundGrid &other)
    BackgroundGrid(Esri::ArcGISRuntime::BackgroundGrid &&other)
    ~BackgroundGrid()
    QColor color() const
    QColor gridLineColor() const
    double gridLineWidth() const
    double gridSize() const
    bool isVisible() const
    void setColor(const QColor &color)
    void setGridLineColor(const QColor &color)
    void setGridLineWidth(double gridLineWidth)
    void setGridSize(double gridSize)
    void setVisible(bool visible)
    Esri::ArcGISRuntime::BackgroundGrid &operator=(const Esri::ArcGISRuntime::BackgroundGrid &other)
    Esri::ArcGISRuntime::BackgroundGrid &operator=(Esri::ArcGISRuntime::BackgroundGrid &&other)

    Detailed Description

    BackgroundGrid is the grid that displays behind a Map in a MapView, or a Surface in a SceneView. If there is no map or surface provided, an empty view will display with only the BackgroundGrid.

    The BackgroundGrid is not associated with the Grid that can be displayed over a MapView. The Map displays on top of the background grid or the optional Map::backgroundColor to determine what is displayed under transparent areas of the map.

    An instance of this class can be used to set a default backdrop that a Map or Scene will display on top of.

    Example: Change the MapView's background grid:

    BackgroundGrid newGrid;
    newGrid.setColor(Qt::white);
    newGrid.setGridLineColor(Qt::black);
    newGrid.setGridLineWidth(5);
    newGrid.setGridSize(50);
    mapView->setBackgroundGrid(newGrid);

    Member Function Documentation

    BackgroundGrid::BackgroundGrid()

    Constructs a default BackgroundGrid.

    These default values are used: l color = Qt::black, l gridLineColor = c Qt::white, l gridLineWidth = 1, l gridSize = 32.

    BackgroundGrid::BackgroundGrid(const QColor &color, const QColor &gridLineColor, float gridLineWidth, float gridSize)

    Creates a BackgroundGrid with the specified color, gridLineColor, gridLineWidth and gridSize.

    BackgroundGrid is the grid that displays behind a Map in a MapView, or a Surface in a SceneView. If there is no map or surface provided, an empty view will display with only the BackgroundGrid.

    An instance of this class can be used to set a default backdrop that a Map or Scene will display on top of.

    Note that gridLineWidth and gridSize are defined in device-independent pixels.

    • color - The color of the background.
    • gridLineColor - The color of the grid lines.
    • gridLineWidth - The width of the grid lines in device-independent pixels (DIP).
    • gridSize - The size of the grid squares in device-independent pixels (DIP).

    BackgroundGrid::BackgroundGrid(const Esri::ArcGISRuntime::BackgroundGrid &other)

    Copy constructor from other BackgroundGrid.

    BackgroundGrid::BackgroundGrid(Esri::ArcGISRuntime::BackgroundGrid &&other)

    Move constructor from other BackgroundGrid.

    BackgroundGrid::~BackgroundGrid()

    Destructor.

    QColor BackgroundGrid::color() const

    Returns the fill color of the background.

    The default value is Silver ("#C0C0C0" or QColor(192, 192, 192)).

    See also setColor().

    QColor BackgroundGrid::gridLineColor() const

    Returns the color of the background grid lines.

    The default value is Black ("#FFFFFF" or QColor(255, 255, 255)).

    See also setGridLineColor().

    double BackgroundGrid::gridLineWidth() const

    Returns the width of the grid lines in device-independent pixels (DIP).

    This value must be greater than or equal to 0. Setting the grid line width to 0 will make grid lines invisible. The default value is 0.1.

    See also setGridLineWidth().

    double BackgroundGrid::gridSize() const

    Returns the size of each grid square in device-independent pixels (DIP).

    The default value is 20 x 20 pixels.

    See also setGridSize().

    [since Esri::ArcGISRuntime 100.3] bool BackgroundGrid::isVisible() const

    Returns true if grid lines are visible on the color, false otherwise.

    In the context of MapView, this value indicates if the gridLineColor is visible. In the context of SceneView, this value indicates if both the color and the gridLineColor are visible.

    The default value is true.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    void BackgroundGrid::setColor(const QColor &color)

    Sets the fill color of the background.

    The default value is Silver ("#C0C0C0" or QColor(192, 192, 192)).

    See also color().

    void BackgroundGrid::setGridLineColor(const QColor &color)

    Sets the color of the background grid lines.

    The default value is Black ("#FFFFFF" or QColor(255, 255, 255)).

    See also gridLineColor().

    void BackgroundGrid::setGridLineWidth(double gridLineWidth)

    Sets the width of the background grid lines to gridLineWidth DIPs.

    The default value is 1. This value must be greater than or equal to 0. Setting the grid line width to 0 will make grid lines invisible.

    See also gridLineWidth().

    void BackgroundGrid::setGridSize(double gridSize)

    Sets the size of the background grid to gridSize DIPs.

    The default value is 20.0.

    See also gridSize().

    [since Esri::ArcGISRuntime 100.3] void BackgroundGrid::setVisible(bool visible)

    Sets whether the grid lines are visible in the background to visible.

    If this value is true, grid lines will display on top of the BackgroundGrid::Color. If this value false, the BackgroundGrid::Color will display without the grid lines. The default value is true.

    This function was introduced in Esri::ArcGISRuntime 100.3.

    See also isVisible().

    Esri::ArcGISRuntime::BackgroundGrid &BackgroundGrid::operator=(const Esri::ArcGISRuntime::BackgroundGrid &other)

    Assignment operator from other BackgroundGrid.

    Esri::ArcGISRuntime::BackgroundGrid &BackgroundGrid::operator=(Esri::ArcGISRuntime::BackgroundGrid &&other)

    Move operator from other BackgroundGrid.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.