Class
TileUtils
public class TileUtils
- Tile Utils
Properties
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
Methods
tileLength()
public static func tileLength() -> Int
- Get the tile side (width and height) dimension based upon the screen resolution
- @return default tile length
tileLength(_:)
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
toData(_:)
public static func toData(_ image: UIImage?) -> Data?
- Compress the image to byte data
- @param image image
- @return byte data
toCoordinate(_:)
public static func toCoordinate(_ point: MKMapPoint) -> CLLocationCoordinate2D
- Convert a MapKit map point to a location coordinate
- @param point MK map point
- @return location coordinate
toCoordinate(_:)
public static func toCoordinate(_ point: GridPoint) -> CLLocationCoordinate2D
- Convert a grid point to a location coordinate
- @param point grid point
- @return location coordinate
toMapPoint(_:)
public static func toMapPoint(_ coordinate: CLLocationCoordinate2D) -> MKMapPoint
- Convert a location coordinate to a MapKit map point
- @param coordinate location coordinate
- @return map point
toMapPoint(_:)
public static func toMapPoint(_ point: GridPoint) -> MKMapPoint
- Convert a grid point to a MapKit map point
- @param point grid point
- @return map point
toGridPoint(_:)
public static func toGridPoint(_ coordinate: CLLocationCoordinate2D) -> GridPoint
- Convert a location coordinate to a grid point
- @param coordinate location coordinate
- @return grid point
toGridPoint(_:)
public static func toGridPoint(_ point: MKMapPoint) -> GridPoint
- Convert a MapKit map point to a grid point
- @param point MK map point
- @return grid point
currentZoom(_:)
public static func currentZoom(_ mapView: MKMapView) -> Double
- Get the current zoom level of the map view
- @param mapView map view
- @return current zoom level
currentRoundedZoom(_:)
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
coordinateRegion(_:_:_:)
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