When you are working with a georeferenced view and data, it is often convenient to display a grid for quick orientation. You can add this grid to the view as a layer, using a layer builder.
Program: Creating a grid layer shows how to add a grid layer to a view.
LuciadLightspeed offers the following grid layer builders:
TLspLonLatGridLayerBuildercreates a latitude-longitude grid formed by evenly spaced meridians and parallels. It allows locating geographically referenced data immediately. This grid is used in all of the Lightspeed view samples that are shipped with LuciadLightspeed. If necessary, you can change the style of the grid lines and labels using the
ILspStylerimplementation for lon-lat grids,
TLspLonLatGridStyler. You can also configure the spacing between the grid lines. Consult the Javadoc
TLspLonLatGridLayerBuilderfor more information about how to do this.
TLspMGRSGridLayerBuildercreates an MGRS grid. It divides the earth into grid zones that are refined depending on the view scale. As opposed to a longitude-latitude grid block, a block in an MGRS grid always covers the same size area, independent of its location on earth. If necessary, you can change what grid lines and labels are displayed and how they are visualized, by configuring a
TLspMGRSGridStyleobject on the layer builder. The MGRS grid is demonstrated in the grid sample.
TLspGeorefGridLayerBuildercreates a Georef grid. It is similar to the latitude-longitude grid, but uses a simpler and more concise notation. If necessary, you can change what grid lines and labels are displayed and how they are visualized, by configuring a
TLspGeorefGridStyleobject on the layer builder. The Georef grid is demonstrated in the grid sample.
TLspXYGridLayerBuildercreates a Cartesian grid. It is typically defined in the world reference of the view, which results in an axis-aligned grid.