Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save susanna2222/fcd9763e2a8ec575c5ff27fdc92fff65 to your computer and use it in GitHub Desktop.
Save susanna2222/fcd9763e2a8ec575c5ff27fdc92fff65 to your computer and use it in GitHub Desktop.
func setupMapView(){
var annotationList = [MKPointAnnotation]()
var circleList = [MKCircle]()
let locationName = "Tokyo Tower"
let coordiate = CLLocationCoordinate2DMake(35.658626, 139.745471)
// setup annotation
let annotation = MKPointAnnotation()
annotation.coordinate = coordiate
annotation.title = locationName
annotationList.append(annotation)
// setup circle
let circle = MKCircle(center: coordiate, radius: 50)
circleList.append(circle)
// add to map view
mapView.addAnnotations([annotation])
mapView.addOverlays([circle])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment