Created
August 21, 2019 05:48
-
-
Save susanna2222/fcd9763e2a8ec575c5ff27fdc92fff65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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