MMKProjection

class MMKProjection : NSObject

Makes two conversions: world->XY and XY->world, where XY are tile indexes. There are two main derived classes: spherical mercator (google, osm) and wgs84 mercator (mappable).

Summary

Instance methods

func worldToXY(withGeoPoint geoPoint: MMKPoint, zoom: Int) -> MMKXYPoint
Converts the world coordinates to a flat world position

func xyToWorld(with xyPoint: MMKXYPoint, zoom: Int) -> MMKPoint
Converts the flat world position to world coordinates

Properties

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

worldToXY(withGeoPoint:zoom:)

func worldToXY(withGeoPoint geoPoint: MMKPoint, zoom: Int) -> MMKXYPoint

Converts the world coordinates to a flat world position.


xyToWorld(with:zoom:)

func xyToWorld(with xyPoint: MMKXYPoint, zoom: Int) -> MMKPoint

Converts the flat world position to world coordinates.


Properties

isValid

var isValid: Bool { get }

Tells if this object is valid or no. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.