Skip to content

Instantly share code, notes, and snippets.

@varyP
varyP / MKMapView+Ext.swift
Last active February 10, 2020 02:49
Swift5 implementation to get radius from MKMapView's current zoomed in region & zoom-pan to any coordinate with animation.
// Created by Varun Parakh on 09/04/19 via Daniel.Burke (https://gist.github.com/d2burke/ad29811b07ae31b378ff)
/*
Have these defined in your global constants.
let mercatorRadius = 85445659.44705395
let maxGoogleZoomLevels = 20
let mercatorOffset = 268435456.0
*/
//
// MKMapView+Ext.swift