Other Functions
The following functions are available globally.
-
Converts a map scale to a zoom level.
Declaration
Objective-C
NSUInteger AWFMapZoomLevelFromZoomScale(MKZoomScale zoomScale)
Swift
func AWFMapZoomLevelFromZoomScale(_ zoomScale: MKZoomScale) -> UInt
Parameters
zoomScale
The zoom scale to convert.
Return Value
The zoom level corresponding to the zoom scale.
-
Returns a map coordinate that corresponds to the specified point.
Declaration
Objective-C
CLLocationCoordinate2D AWFMapTilePointToCoordinate(CGPoint point, NSUInteger zoomLevel)
Swift
func AWFMapTilePointToCoordinate(_ point: CGPoint, _ zoomLevel: UInt) -> CLLocationCoordinate2D
Parameters
point
The point to convert.
zoomLevel
The zoom level to use when converting to map coordinates.
Return Value
The map coordinate at the point.
-
Returns tile x and y indexes that contain the map point.
Declaration
Objective-C
CGPoint AWFMapPointToTilePoint(MKMapPoint mapPoint, NSUInteger zoomLevel)
Swift
func AWFMapPointToTilePoint(_ mapPoint: MKMapPoint, _ zoomLevel: UInt) -> CGPoint
Parameters
mapPoint
The map point to convert.
zoomLevel
The zoom level to use when calculating tile indexes.
Return Value
The tile x and y indexes that contain the map point.
-
Returns tile x and y indexes that contain the map coordinate.
Declaration
Objective-C
CGPoint AWFMapTilePointFromCoordinate(CLLocationCoordinate2D coord, NSUInteger zoomLevel)
Swift
func AWFMapTilePointFromCoordinate(_ coord: CLLocationCoordinate2D, _ zoomLevel: UInt) -> CGPoint
Parameters
coord
The map coordinate to convert.
zoomLevel
The zoom level to use when calculating the tile indexes.
Return Value
The tile x and y indexes that contain the map coordinate.