mgrs-ios 1.1.6 Documentation

Class Grids

public class Grids: BaseGrids  
  • Grids
Grids Grids BaseGrids BaseGrids Grids->BaseGrids

Superclass

BaseGrids

Initializers

init()

public init()  
  • Initialize, all grid types enabled per property configurations

init(_:​)

public init(_ types: [GridType])  
  • Initialize
  • @param types
  •        grid types to enable
    

Properties

zoom​Offset

public var zoomOffset = MGRSConstants.ZOOM_OFFSET
  • Grid zoom display offset from XYZ tile zoom levels, defaulted to MGRSConstants.ZOOM_OFFSET

Methods

create​GZD()

public static func createGZD() -> Grids  
  • Create only Grid Zone Designator grids
  • @return grids

default​Width()

public override func defaultWidth() -> Double  
  • Get the default grid line width
  • @return width

grids()

public override func grids() -> [BaseGrid]  
  • Get the grids
  • @return grids

new​Grid(_:​)

public func newGrid(_ type: GridType) -> Grid  
  • Create a new grid, override to create a specialized grid
  • @param type
  •        grid type
    
  • @return grid

new​Zoom​Grids(_:​)

public override func newZoomGrids(_ zoom: Int) -> BaseZoomGrids  
  • Create a new zoom grids
  • @param zoom
  •        zoom level
    
  • @return zoom grids

grids(_:​)

public override func grids(_ zoom: Int) -> ZoomGrids  

grid(_:​)

public func grid(_ type: GridType) -> Grid  
  • Get the grid
  • @param type
  •        grid type
    
  • @return grid

precision(_:​)

public func precision(_ zoom: Int) -> GridType?  
  • Get the grid precision for the zoom level
  • @param zoom
  •        zoom level
    
  • @return grid type precision

set​Grids(_:​)

public func setGrids(_ types: [GridType])  
  • Set the active grid types
  • @param types
  •        grid types
    

set​Grids(_:​)

public func setGrids(_ grids: [Grid])  
  • Set the active grids
  • @param grids
  •        grids
    

enable​Types(_:​)

public func enableTypes(_ types: [GridType])  
  • Enable grid types
  • @param types
  •        grid types
    

disable​Types(_:​)

public func disableTypes(_ types: [GridType])  
  • Disable grid types
  • @param types
  •        grid types
    

is​Enabled(_:​)

public func isEnabled(_ type: GridType) -> Bool  
  • Is the grid type enabled
  • @param type
  •        grid type
    
  • @return true if enabled

enable(_:​)

public func enable(_ type: GridType)  
  • Enable the grid type
  • @param type
  •        grid type
    

disable(_:​)

public func disable(_ type: GridType)  
  • Disable the grid type
  • @param type
  •        grid type
    

set​Min​Zoom(_:​_:​)

public func setMinZoom(_ type: GridType, _ minZoom: Int)  
  • Set the grid minimum zoom
  • @param type
  •        grid type
    
  • @param minZoom
  •        minimum zoom
    

set​Max​Zoom(_:​_:​)

public func setMaxZoom(_ type: GridType, _ maxZoom: Int?)  
  • Set the grid maximum zoom
  • @param type
  •        grid type
    
  • @param maxZoom
  •        maximum zoom
    

set​Zoom​Range(_:​_:​_:​)

public func setZoomRange(_ type: GridType, _ minZoom: Int, _ maxZoom: Int?)  
  • Set the grid zoom range
  • @param type
  •        grid type
    
  • @param minZoom
  •        minimum zoom
    
  • @param maxZoom
  •        maximum zoom
    

set​Lines​Min​Zoom(_:​_:​)

public func setLinesMinZoom(_ type: GridType, _ minZoom: Int?)  
  • Set the grid minimum level override for drawing grid lines
  • @param type
  •        grid type
    
  • @param minZoom
  •        minimum zoom level or null to remove
    

set​Lines​Max​Zoom(_:​_:​)

public func setLinesMaxZoom(_ type: GridType, _ maxZoom: Int?)  
  • Set the grid maximum level override for drawing grid lines
  • @param type
  •        grid type
    
  • @param maxZoom
  •        maximum zoom level or null to remove
    

set​All​Colors(_:​)

public func setAllColors(_ color: UIColor)  
  • Set all grid line colors
  • @param color
  •        grid line color
    

set​Color(_:​_:​)

public func setColor(_ types: [GridType], _ color: UIColor)  
  • Set the grid line color for the grid types
  • @param types
  •        grid types
    
  • @param color
  •        grid line color
    

set​Color(_:​_:​)

public func setColor(_ type: GridType, _ color: UIColor)  
  • Set the grid line color for the grid type
  • @param type
  •        grid type
    
  • @param color
  •        grid line color
    

set​All​Widths(_:​)

public func setAllWidths(_ width: Double)  
  • Set all grid line widths
  • @param width
  •        grid line width
    

set​Width(_:​_:​)

public func setWidth(_ types: [GridType], _ width: Double)  
  • Set the grid line width for the grid types
  • @param types
  •        grid types
    
  • @param width
  •        grid line width
    

set​Width(_:​_:​)

public func setWidth(_ type: GridType, _ width: Double)  
  • Set the grid line width for the grid type
  • @param type
  •        grid type
    
  • @param width
  •        grid line width
    

delete​Propagated​Styles()

public func deletePropagatedStyles()  
  • Delete propagated styles

delete​Propagated​Styles(_:​)

public func deletePropagatedStyles(_ types: [GridType])  
  • Delete propagated styles for the grid types
  • @param types
  •        grid types
    

delete​Propagated​Styles(_:​)

public func deletePropagatedStyles(_ type: GridType)  
  • Delete propagated styles for the grid type
  • @param type
  •        grid type
    

set​Color(_:​_:​_:​)

public func setColor(_ types: [GridType], _ precisionType: GridType, _ color: UIColor)  
  • Set the grid type precision line color for the grid types
  • @param types
  •        grid types
    
  • @param precisionType
  •        precision grid type
    
  • @param color
  •        grid line color
    

set​Color(_:​_:​_:​)

public func setColor(_ type: GridType, _ precisionTypes: [GridType], _ color: UIColor)  
  • Set the grid type precision line colors for the grid type
  • @param type
  •        grid type
    
  • @param precisionTypes
  •        precision grid types
    
  • @param color
  •        grid line color
    

set​Color(_:​_:​_:​)

public func setColor(_ type: GridType, _ precisionType: GridType, _ color: UIColor)  
  • Set the grid type precision line color for the grid type
  • @param type
  •        grid type
    
  • @param precisionType
  •        precision grid type
    
  • @param color
  •        grid line color
    

set​Width(_:​_:​_:​)

public func setWidth(_ types: [GridType], _ precisionType: GridType, _ width: Double)  
  • Set the grid type precision line width for the grid types
  • @param types
  •        grid types
    
  • @param precisionType
  •        precision grid type
    
  • @param width
  •        grid line width
    

set​Width(_:​_:​_:​)

public func setWidth(_ type: GridType, _ precisionTypes: [GridType], _ width: Double)  
  • Set the grid type precision line widths for the grid type
  • @param type
  •        grid type
    
  • @param precisionTypes
  •        precision grid types
    
  • @param width
  •        grid line width
    

set​Width(_:​_:​_:​)

public func setWidth(_ type: GridType, _ precisionType: GridType, _ width: Double)  
  • Set the grid type precision line width for the grid type
  • @param type
  •        grid type
    
  • @param precisionType
  •        precision grid type
    
  • @param width
  •        grid line width
    

labeler(_:​)

public func labeler(_ type: GridType) -> GridLabeler?  
  • Get the labeler for the grid type
  • @param type
  •        grid type
    
  • @return labeler or null

has​Labeler(_:​)

public func hasLabeler(_ type: GridType) -> Bool  
  • Has a labeler for the grid type
  • @param type
  •        grid type
    
  • @return true if has labeler

set​Labeler(_:​_:​)

public func setLabeler(_ type: GridType, _ labeler: GridLabeler)  
  • Set the labeler for the grid type
  • @param type
  •        grid type
    
  • @param labeler
  •        labeler
    

disable​All​Labelers()

public func disableAllLabelers()  
  • Disable all grid labelers

enable​Labelers(_:​)

public func enableLabelers(_ types: [GridType])  
  • Enable the labelers for the grid types
  • @param types
  •        grid types
    

disable​Labelers(_:​)

public func disableLabelers(_ types: [GridType])  
  • Disable the labelers for the grid types
  • @param types
  •        grid types
    

is​Labeler​Enabled(_:​)

public func isLabelerEnabled(_ type: GridType) -> Bool  
  • Is a labeler enabled for the grid type
  • @param type
  •        grid type
    
  • @return true if labeler enabled

enable​Labeler(_:​)

public func enableLabeler(_ type: GridType)  
  • Enable the grid type labeler
  • @param type
  •        grid type
    

disable​Labeler(_:​)

public func disableLabeler(_ type: GridType)  
  • Disable the grid type labeler
  • @param type
  •        grid type
    

set​Label​Min​Zoom(_:​_:​)

public func setLabelMinZoom(_ type: GridType, _ minZoom: Int)  
  • Set the grid minimum zoom
  • @param type
  •        grid type
    
  • @param minZoom
  •        minimum zoom
    

set​Label​Max​Zoom(_:​_:​)

public func setLabelMaxZoom(_ type: GridType, _ maxZoom: Int?)  
  • Set the grid maximum zoom
  • @param type
  •        grid type
    
  • @param maxZoom
  •        maximum zoom
    

set​Label​Zoom​Range(_:​_:​_:​)

public func setLabelZoomRange(_ type: GridType, _ minZoom: Int, _ maxZoom: Int?)  
  • Set the grid zoom range
  • @param type
  •        grid type
    
  • @param minZoom
  •        minimum zoom
    
  • @param maxZoom
  •        maximum zoom
    

set​Label​Buffer(_:​_:​)

public func setLabelBuffer(_ types: [GridType], _ buffer: Double)  
  • Set the label grid edge buffer for the grid types
  • @param types
  •        grid types
    
  • @param buffer
  •        label buffer (greater than or equal to 0.0 and less than 0.5)
    

get​Label​Buffer(_:​)

public func getLabelBuffer(_ type: GridType) -> Double  
  • Get the label grid edge buffer
  • @param type
  •        grid type
    
  • @return label buffer (greater than or equal to 0.0 and less than 0.5)

set​Label​Buffer(_:​_:​)

public func setLabelBuffer(_ type: GridType, _ buffer: Double)  
  • Set the label grid edge buffer
  • @param type
  •        grid type
    
  • @param buffer
  •        label buffer (greater than or equal to 0.0 and less than 0.5)
    

set​All​Label​Colors(_:​)

public func setAllLabelColors(_ color: UIColor)  
  • Set all label colors
  • @param color
  •        label color
    

set​Label​Color(_:​_:​)

public func setLabelColor(_ types: [GridType], _ color: UIColor)  
  • Set the label color for the grid types
  • @param types
  •        grid types
    
  • @param color
  •        label color
    

set​Label​Color(_:​_:​)

public func setLabelColor(_ type: GridType, _ color: UIColor)  
  • Set the label color
  • @param type
  •        grid type
    
  • @param color
  •        label color
    

set​All​Label​Text​Sizes(_:​)

public func setAllLabelTextSizes(_ textSize: Double)  
  • Set all label text sizes
  • @param textSize
  •        label text size
    

set​Label​Text​Size(_:​_:​)

public func setLabelTextSize(_ types: [GridType], _ textSize: Double)  
  • Set the label text size for the grid types
  • @param types
  •        grid types
    
  • @param textSize
  •        label text size
    

set​Label​Text​Size(_:​_:​)

public func setLabelTextSize(_ type: GridType, _ textSize: Double)  
  • Set the label text size
  • @param type
  •        grid type
    
  • @param textSize
  •        label text size
    

draw​Tile(_:​_:​_:​_:​_:​)

public func drawTile(_ tileWidth: Int, _ tileHeight: Int, _ x: Int, _ y: Int, _ zoom: Int) -> UIImage?  
  • Draw a tile with the dimensions and XYZ coordinate
  • @param tileWidth tile width
  • @param tileHeight tile height
  • @param x x coordinate
  • @param y y coordinate
  • @param zoom zoom level
  • @return image tile

draw​Tile(_:​_:​_:​)

public func drawTile(_ tileWidth: Int, _ tileHeight: Int, _ bounds: Bounds) -> UIImage?  
  • Draw a tile with the dimensions and bounds
  • @param tileWidth tile width
  • @param tileHeight tile height
  • @param bounds bounds
  • @return image tile

draw​Tile(_:​)

public func drawTile(_ gridTile: GridTile) -> UIImage?  
  • Draw the tile
  • @param gridTile tile
  • @return image tile

draw​Lines(_:​_:​_:​_:​_:​)

public static func drawLines(_ lines: [MGRSLine], _ tile: GridTile, _ grid: Grid, _ zone: GridZone, _ context: CGContext)  
  • Draw the lines on the tile
  • @param lines lines to draw
  • @param tile tile
  • @param grid grid
  • @param zone grid zone
  • @param context graphics context