// 左上角坐标
        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

 

posted on 2025-02-04 08:55  懂事长qingzZ  阅读(30)  评论(0编辑  收藏  举报