Skip To Content ArcGIS for Developers Sign In Dashboard

BackgroundGrid Class

(Esri::ArcGISRuntime::BackgroundGrid)

Background for contents of MapView or SceneView. More...

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

Public Functions

BackgroundGrid()
BackgroundGrid(const QColor &color, const QColor &gridLineColor, float gridLineWidth, float gridSize)
BackgroundGrid(const BackgroundGrid &other)
BackgroundGrid(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)
BackgroundGrid &operator=(const BackgroundGrid &other)
BackgroundGrid &operator=(BackgroundGrid &&other)

Detailed Description

Background for contents of MapView or SceneView.

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.

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 with color = Qt::black, gridLineColor = Qt::white, gridLineWidth = 1, gridSize = 32.

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

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

BackgroundGrid::BackgroundGrid(const BackgroundGrid &other)

Copy constructor from other BackgroundGrid.

BackgroundGrid::BackgroundGrid(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 (in DIPs) of the background grid lines.

The default value is 1.

See also setGridLineWidth().

double BackgroundGrid::gridSize() const

Returns the size (in DIPs) of the background grid.

The default value is 20.0.

See also setGridSize().

bool BackgroundGrid::isVisible() const

Returns whether the grid is visible in the background.

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.

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().

void BackgroundGrid::setVisible(bool visible)

Sets whether the grid is visible in the background to visible.

The default value is true.

This function was introduced in Esri::ArcGISRuntime 100.3.

See also isVisible().

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

Assignment operator from other BackgroundGrid.

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

Move operator from other BackgroundGrid.


Feedback on this topic?