// 左上角坐标 let topLeftCoord = mapView.convert(.zero, toCoordinateFrom: mapView) // 右下角坐标 let bottomRightCoord = mapView.convert(CGPoint(x: mapView.width, y: mapView.height), toCoordinateFrom: mapView) // 输出左上角和右下角的经纬度 print("左上角经纬度:\(topLeftCoord.latitude), \(topLeftCoord.longitude)") print("右下角经纬度:\(bottomRightCoord.latitude), \(bottomRightCoord.longitude)") print("地图中心的经纬度 = \(mapView.centerCoordinate.latitude), \(mapView.centerCoordinate.longitude)") searchTuple.topLeftCoord = topLeftCoord searchTuple.bottomRightCoord = bottomRightCoord