Display and customize coordinate system grids, including Latitude/Longitude, MGRS, UTM, and USNG, on a map view or scene view.

Use case
Grids are often used on printed maps, but can also be helpful on digital 2D maps or 3D scenes, to identify locations.
How to use the sample
Use the picker to change the view from 2D or 3D, or tap the button in the toolbar to open the grid settings. You can select the type of grid (LatLong, MGRS, UTM, and USNG) and modify its properties like the visibility and color of the lines, and the position, format, and units of the labels.
How it works
- Create an instance of one of the
Gridtypes. - Grid lines and labels can be styled per grid level with
grid.lineSymbols[0]andgrid.textSymbols[0]subscripts on the grid. - The label position, format, unit, and visibility can be specified with
labelPosition,labelFormat,labelUnit, andisVisibleon theGrid.- Note that as of 200.6, MGRS, UTM, and USNG grids in a SceneView only support the
geographiclabel position.
- Note that as of 200.6, MGRS, UTM, and USNG grids in a SceneView only support the
- For the
LatitudeLongitudeGridtype, you can specify a label format ofdecimalDegreesordegreesMinutesSeconds. - To set the grid, assign it to the map view or scene view using the
grid(_:)modifier.
Relevant API
- Grid
- LatitudeLongitudeGrid
- MapView
- MGRSGrid
- SceneView
- SimpleLineSymbol
- TextSymbol
- USNGGrid
- UTMGrid
Tags
coordinates, degrees, graticule, grid, latitude, longitude, MGRS, minutes, seconds, USNG, UTM