Customize map view’s background by changing its grid properties.

Use case
A background grid defines the default color and grid for display behind a map or scene surface. Set properties on the background grid to highlight and give context to your map view or scene view.
How to use the sample
Tap the “Background Grid Settings” button in the toolbar to open the settings view. Tap the color next to “Color” and “Line Color” rows to change the background color and the grid’s line color respectively. Use the sliders to change the grid line width and grid size.
How it works
- Create a
Mapobject. - Display the map in a
MapView. - Set the
backgroundGridon theMapViewusing the view modifier. - Update the background grid properties from the settings view. The following
BackgroundGridproperties are updated:backgroundColor: fill colorlineColor: color of background grid lineslineWidth: width (in points) of background grid linessize: size (in points) of the background grid
Relevant API
- BackgroundGrid
- Map
- MapView
Tags
background, grid, map