mgrs-ios 1.1.6 Documentation

Class Tile​Utils

public class TileUtils  
  • Tile Utils

Properties

TILE_DP

public static let TILE_DP = 256
  • Displayed device-independent pixels

TILE_PIXELS_DEFAULT

public static let TILE_PIXELS_DEFAULT = TILE_DP
  • Tile pixels for default dpi tiles

TILE_PIXELS_HIGH

public static let TILE_PIXELS_HIGH = TILE_PIXELS_DEFAULT * 2
  • Tile pixels for high dpi tiles

SCALE_FACTOR_DEFAULT

public static let SCALE_FACTOR_DEFAULT: Float = 2.0
  • High density scale

Methods

tile​Length()

public static func tileLength() -> Int  
  • Get the tile side (width and height) dimension based upon the screen resolution
  • @return default tile length

tile​Length(_:​)

public static func tileLength(_ scale: Float) -> Int  
  • Get the tile side (width and height) dimension based upon the scale
  • @param scale resolution scale
  • @return default tile length

to​Data(_:​)

public static func toData(_ image: UIImage?) -> Data?  
  • Compress the image to byte data
  • @param image image
  • @return byte data

to​Coordinate(_:​)

public static func toCoordinate(_ point: MKMapPoint) -> CLLocationCoordinate2D  
  • Convert a MapKit map point to a location coordinate
  • @param point MK map point
  • @return location coordinate

to​Coordinate(_:​)

public static func toCoordinate(_ point: GridPoint) -> CLLocationCoordinate2D  
  • Convert a grid point to a location coordinate
  • @param point grid point
  • @return location coordinate

to​Map​Point(_:​)

public static func toMapPoint(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint  
  • Convert a location coordinate to a MapKit map point
  • @param coordinate location coordinate
  • @return map point

to​Map​Point(_:​)

public static func toMapPoint(_ point: GridPoint) -> MKMapPoint  
  • Convert a grid point to a MapKit map point
  • @param point grid point
  • @return map point

to​Grid​Point(_:​)

public static func toGridPoint(_ coordinate: CLLocationCoordinate2D) -> GridPoint  
  • Convert a location coordinate to a grid point
  • @param coordinate location coordinate
  • @return grid point

to​Grid​Point(_:​)

public static func toGridPoint(_ point: MKMapPoint) -> GridPoint  
  • Convert a MapKit map point to a grid point
  • @param point MK map point
  • @return grid point

current​Zoom(_:​)

public static func currentZoom(_ mapView: MKMapView) -> Double  
  • Get the current zoom level of the map view
  • @param mapView map view
  • @return current zoom level

current​Rounded​Zoom(_:​)

public static func currentRoundedZoom(_ mapView: MKMapView) -> Int  
  • Get the current rounded zoom level of the map view
  • @param mapView map view
  • @return current zoom level

coordinate​Region(_:​_:​_:​)

public static func coordinateRegion(_ coordinate: CLLocationCoordinate2D, _ zoom: Double, _ mapView: MKMapView) -> MKCoordinateRegion  
  • Get a coordinate region for the coordinate at the zoom level in the map view
  • @param coordinate location coordinate
  • @param zoom zoom level
  • @param mapView map view
  • @return coordinate region