-1

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

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160

1 Answers1

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