I want when user click on button that exist in center of map , map be locked and I get latitude and longitude of map , in fact get center of map I don't want use google map or Mapbox I Want to use map kit
Asked
Active
Viewed 688 times
-1
-
https://stackoverflow.com/questions/33784742/converting-view-points-to-mkmapview-coordinates – shota Aug 08 '18 at 13:37
-
2Ok, what have you tried so far? – Ahmad F Aug 08 '18 at 13:37
-
Please read [ask], create a [mcve] and add the _relevant_ code to your question. – Ashley Mills Aug 08 '18 at 13:41
1 Answers
2
Try the following code:
@IBAction func aaa(_ sender: UIButton) {
print(self.mapView.centerCoordinate.latitude)
print(self.mapView.centerCoordinate.longitude)
}

Kosuke Ogawa
- 7,383
- 3
- 31
- 52