Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. let topLeft: CLLocationCoordinate2D = mapView.projection.visibleRegion().farLeft
  2. let bottomLeft: CLLocationCoordinate2D = mapView.projection.visibleRegion().nearLeft
  3. let lat = Double(fabs(Float(topLeft.latitude - bottomLeft.latitude)))
  4. let metersPerPixel: Double = Double((cos(lat * .pi / 180) * 2 * .pi) * 6378137 / Double((256 * pow(2, zoom))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement